:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(hogql): shrink parser-parity divergences with shrinkray (#63514)
Robbie8acd6d2b5456
diff --git a/posthog/hogql/scripts/_diagnostic_common.py b/posthog/hogql/scripts/_diagnostic_common.pyindex fd9eeb1bdde3..647a108e66a6 100644--- a/posthog/hogql/scripts/_diagnostic_common.py+++ b/posthog/hogql/scripts/_diagnostic_common.py@@ -323,6 +323,44 @@ def _shape_for(return _ast_mismatch_shape((_node_type(o_ast), _node_type(c_ast)), _diff_path(o_ast, c_ast))+# ---------------------------------------------------------------------------+# Minimiser — reduce a divergence to its smallest still-diverging repro+# ---------------------------------------------------------------------------+++def shrink_to_shape(+ query: str,+ rule: str,+ oracle_backend: str,+ candidate_backend: str,+ target_shape: DivergenceShape,+) -> str:+ """Reduce `query` to the smallest variant that still produces+ `target_shape` against the two backends, via shrinkray (see `_shrink`).+ The interestingness predicate is exactly "same divergence shape", so the+ reduction can't wander onto a different bug.++ Returns the original query unchanged on any ordinary (`Exception`)+ failure — a bad reduction must never abort the grind. A `BaseException`+ (a shadow-mismatch `SystemExit`, a Ctrl-C) intentionally still+ propagates."""++ def is_interesting(candidate: str) -> bool:+ return _shape_for(candidate, rule, oracle_backend, candidate_backend) == target_shape++ # Imported lazily: shrinkray is the optional `hogql-parser-parity` group,+ # and this module is on the import path of `test_diagnostic_common.py`,+ # `parser_bench.py`, and `pbt_corpus.py` — none of which shrink. A+ # module-level import would break their (CI-collected) import without the+ # group. Only this shrink path requires it.+ from posthog.hogql.scripts import _shrink # noqa: PLC0415++ try:+ return _shrink.shrink(query, is_interesting)+ except Exception:+ return query++# ===========================================================================# Corpus diagnostic machinery# ===========================================================================@@ -568,6 +606,56 @@ class Failure:query: strdetail: str # rejection message, crash traceback, or formatted diff pathn_occurrences: int+ shrunk_from: int | None = None # original char length if `shrink_failures` reduced `query`, else None+++def shrink_failures(+ failures: list[Failure],+ *,+ rule: str,+ oracle: str,+ candidate: str,+) -> list[Failure]:+ """Reduce each shrinkable failure's query to its minimal still-diverging+ form via shrinkray, returning a new list. `ast_mismatch` and+ `candidate_reject` shrink toward their recomputed `DivergenceShape`;+ crashes (`candidate_crash` / `oracle_crash`) are left verbatim — a crash+ isn't a stable shape to reduce toward (same limitation as the PBT path).+ Progress goes to stderr because shrinking a large failure set is slow."""+ out: list[Failure] = []+ shrinkable = {"candidate_reject", "ast_mismatch"}+ # Count only the shrinkable failures so the progress bar reflects work+ # actually done — crashes are passed through verbatim, not shrunk.+ shrinkable_total = sum(1 for fa in failures if fa.kind in shrinkable)+ done = 0+ for i, fa in enumerate(failures):+ try:+ if fa.kind in shrinkable:+ done += 1+ sys.stderr.write(f"\r [shrink] {done}/{shrinkable_total} …")+ sys.stderr.flush()+ shape = _shape_for(fa.query, rule, oracle, candidate)+ if shape is not None:+ shrunk = shrink_to_shape(fa.query, rule, oracle, candidate, shape)+ if shrunk != fa.query:+ out.append(dataclasses.replace(fa, query=shrunk, shrunk_from=len(fa.query)))+ continue+ out.append(fa)+ except KeyboardInterrupt:+ # Ctrl-C during the (slow) shrink phase must not discard the+ # completed grind's failures — emit the current and remaining+ # ones un-shrunk so the caller still writes a full dump. Each+ # iteration appends exactly once, so `len(out) == i` iff this+ # failure hasn't been appended yet; that guards against a double+ # entry when the interrupt lands after the append but before the+ # `continue`, wherever in the iteration it strikes.+ sys.stderr.write(f"\r [shrink] interrupted at {done}/{shrinkable_total} — keeping the rest un-shrunk\n")+ if len(out) == i:+ out.append(fa)+ out.extend(failures[i + 1 :])+ return out+ sys.stderr.write("\r" + " " * 40 + "\r")+ return outdef write_failures(path: Path, failures: list[Failure], repo_root: Path, *, title: str) -> None:@@ -585,8 +673,10 @@ def write_failures(path: Path, failures: list[Failure], repo_root: Path, *, titlf.write("-- Each block: occurrences count, failure kind + detail, then the entry.\n\n")for i, fa in enumerate(failures):f.write("-- " + "=" * 76 + "\n")- f.write(f"-- [{i + 1}/{len(failures)}] seen {fa.n_occurrences}x in last 7d\n")+ f.write(f"-- [{i + 1}/{len(failures)}] seen {fa.n_occurrences}x\n")f.write(f"-- kind: {fa.kind}\n")+ if fa.shrunk_from is not None:+ f.write(f"-- shrunk: {fa.shrunk_from} -> {len(fa.query)} chars\n")for line in fa.detail.splitlines() or [""]:f.write(f"-- {line}\n" if line else "--\n")f.write("\n")diff --git a/posthog/hogql/scripts/_shrink.py b/posthog/hogql/scripts/_shrink.pynew file mode 100644index 000000000000..15bca9dedc57--- /dev/null+++ b/posthog/hogql/scripts/_shrink.py@@ -0,0 +1,80 @@+"""shrinkray-backed test-case minimiser for the parser-parity diagnostics.++The diagnostics in this directory find queries where two parser backends+disagree, then reduce each one to a minimal repro a human can paste into a+regression test. The reduction used to be a hand-rolled greedy+delete-one-token pass; this module replaces it with+[shrinkray](https://github.com/DRMacIver/shrinkray), a multi-format+test-case reducer by the author of Hypothesis. shrinkray shrinks *within*+tokens too (smaller identifiers, smaller numbers, collapsed structure), so+it lands on tighter repros than token deletion alone.++shrinkray lives in the optional `hogql-parser-parity` dependency group, not+the default dev install, so its heavy transitive deps (textual, libcst,+black) aren't forced on every dev. The parity diagnostics that import this+module therefore require that group — `uv sync --group hogql-parser-parity`+— and fail at import with a plain `ModuleNotFoundError` without it. That's+the deliberate trade: these are parity-work-only scripts, so they may simply+require the parity dependency rather than carry a graceful-degradation path.++`shrink()` is generic over a `str -> bool` interestingness predicate, so it+knows nothing about divergence shapes — the diagnostic-aware wrapper+(`shrink_to_shape` in `_diagnostic_common`) builds the predicate.+"""++from __future__ import annotations++from collections.abc import Callable+from random import Random++import trio+from shrinkray.problem import BasicReductionProblem, InvalidInitialExample+from shrinkray.reducer import ShrinkRay+from shrinkray.work import Volume, WorkContext+++def shrink(initial: str, is_interesting: Callable[[str], bool], *, parallelism: int = 1) -> str:+ """Reduce `initial` to the smallest string that still satisfies+ `is_interesting`, using shrinkray.++ `is_interesting` is a plain synchronous predicate over the candidate+ text. It's wrapped in the async, bytes-typed predicate shrinkray wants:+ candidates that aren't valid UTF-8 or are blank are treated as not+ interesting (shrinkray works on raw bytes and will probe both). The+ returned string is guaranteed to satisfy `is_interesting` — shrinkray+ only ever moves to smaller *interesting* test cases, and never below the+ initial one.++ If `is_interesting(initial)` is false, there's nothing to reduce toward,+ so `initial` is returned unchanged. Any other shrinkray error+ propagates — the grind-robustness fallback (return the original query on+ failure) lives in the caller, so this stays a thin, reusable utility.+ """++ async def predicate(test_case: bytes) -> bool:+ # shrinkray cancels between predicate calls at its own checkpoint, so a+ # blocking body is fine here.+ await trio.lowlevel.checkpoint()+ try:+ text = test_case.decode("utf-8")+ except UnicodeDecodeError:+ return False+ if not text.strip():+ return False+ # is_interesting is GIL-bound CPU work (parses with both backends): a+ # worker thread buys no parallelism, and parallelism is pinned to 1, so+ # call it directly rather than paying a `to_thread` hop per candidate.+ return is_interesting(text)++ async def drive() -> bytes:+ # Random(0) + parallelism=1 → deterministic repros; the predicate is CPU-bound and synchronous, so concurrency wouldn't help anyway.+ work = WorkContext(random=Random(0), parallelism=parallelism, volume=Volume.quiet)+ problem = BasicReductionProblem(initial=initial.encode("utf-8"), is_interesting=predicate, work=work)+ try:+ await problem.setup() # validates the initial example is interesting+ except InvalidInitialExample:+ return initial.encode("utf-8")+ await ShrinkRay(target=problem).run()+ return problem.current_test_case++ return trio.run(drive).decode("utf-8")diff --git a/posthog/hogql/scripts/hog_corpus_diagnostic.py b/posthog/hogql/scripts/hog_corpus_diagnostic.pyindex bc58bc43a746..f360f43881a0 100644--- a/posthog/hogql/scripts/hog_corpus_diagnostic.py+++ b/posthog/hogql/scripts/hog_corpus_diagnostic.py@@ -70,6 +70,7 @@ from posthog.hogql.scripts._diagnostic_common import (print_corpus_summary,repo_relative,run_corpus_parity,+ shrink_failures,write_failures,)@@ -185,6 +186,15 @@ def main() -> int:default=None,help="Output file for failing programs (default: <dump>.failures.hog alongside the dump)",)+ p.add_argument(+ "--shrink-failures",+ action="store_true",+ help=(+ "Reduce each failing program to a minimal repro via shrinkray before "+ "writing it out. Needs the optional `hogql-parser-parity` group "+ "(`uv sync --group hogql-parser-parity`)."+ ),+ )p.add_argument("--limit",type=int,@@ -267,11 +277,16 @@ def main() -> int:print_corpus_summary(result, oracle=args.oracle, candidate=args.candidate)# 4. Failure dump.- if result.failures:+ failures = result.failures+ if failures and args.shrink_failures:+ print()+ print(f"Shrinking {len(failures)} failing programs via shrinkray…")+ failures = shrink_failures(failures, rule="program", oracle=args.oracle, candidate=args.candidate)+ if failures:out_path = Path(args.write_failures) if args.write_failures else args.input.with_suffix(".failures.hog")- write_failures(out_path, result.failures, REPO_ROOT, title="hog_corpus_failures")+ write_failures(out_path, failures, REPO_ROOT, title="hog_corpus_failures")print()- print(f"Wrote {len(result.failures)} failing programs to {repo_relative(out_path, REPO_ROOT)}")+ print(f"Wrote {len(failures)} failing programs to {repo_relative(out_path, REPO_ROOT)}")return 130 if result.interrupted else 0diff --git a/posthog/hogql/scripts/log_corpus_diagnostic.py b/posthog/hogql/scripts/log_corpus_diagnostic.pyindex cbb29fb879b1..ce51f327301f 100644--- a/posthog/hogql/scripts/log_corpus_diagnostic.py+++ b/posthog/hogql/scripts/log_corpus_diagnostic.py@@ -66,6 +66,7 @@ from posthog.hogql.scripts._diagnostic_common import (print_corpus_summary,repo_relative,run_corpus_parity,+ shrink_failures,write_failures,)@@ -207,6 +208,15 @@ def main() -> int:default=None,help="Output file for failing queries (default: <dump>.failures.sql alongside the dump)",)+ p.add_argument(+ "--shrink-failures",+ action="store_true",+ help=(+ "Reduce each failing query to a minimal repro via shrinkray before "+ "writing it out. Needs the optional `hogql-parser-parity` group "+ "(`uv sync --group hogql-parser-parity`)."+ ),+ )p.add_argument("--limit",type=int,@@ -296,11 +306,16 @@ def main() -> int:print_corpus_summary(result, oracle=args.oracle, candidate=args.candidate)# 4. Failure dump.- if result.failures:+ failures = result.failures+ if failures and args.shrink_failures:+ print()+ print(f"Shrinking {len(failures)} failing queries via shrinkray…")+ failures = shrink_failures(failures, rule="select", oracle=args.oracle, candidate=args.candidate)+ if failures:out_path = Path(args.write_failures) if args.write_failures else args.input.with_suffix(".failures.sql")- write_failures(out_path, result.failures, REPO_ROOT, title="hogql_log_corpus_failures.sql")+ write_failures(out_path, failures, REPO_ROOT, title="hogql_log_corpus_failures.sql")print()- print(f"Wrote {len(result.failures)} failing queries to {repo_relative(out_path, REPO_ROOT)}")+ print(f"Wrote {len(failures)} failing queries to {repo_relative(out_path, REPO_ROOT)}")return 130 if result.interrupted else 0diff --git a/posthog/hogql/scripts/pbt_diagnostic.py b/posthog/hogql/scripts/pbt_diagnostic.pyindex 09c6c5abf5dd..fdaf71be3496 100644--- a/posthog/hogql/scripts/pbt_diagnostic.py+++ b/posthog/hogql/scripts/pbt_diagnostic.py@@ -17,9 +17,11 @@ Distinct from the pytest PBT in five ways:both ASTs together and print only the path from root to the firstdiffering node.3. **Auto-shrinker (`--shrink-failures`).** For each ast_mismatch- and reject, run a delete-one-token reducer that keeps the smallest- variant which still triggers the same divergence shape. Drops- typical PBT failures from 200+ chars to <50.+ and reject, run shrinkray (via `_shrink` / `shrink_to_shape`) to+ reduce it to the smallest variant that still triggers the same+ divergence shape. Drops typical PBT failures from 200+ chars to a+ handful. Needs the optional `hogql-parser-parity` dependency group+ (`uv sync --group hogql-parser-parity`).4. **Optional JSONL persistence (`--write-divergences PATH`).** Dropone JSON line per failing example for cross-run analysis orregression-corpus extraction.@@ -65,7 +67,6 @@ Typical usage:from __future__ import annotationsimport os-import reimport sysimport jsonimport argparse@@ -88,7 +89,7 @@ from posthog.hogql.scripts._diagnostic_common import (_node_type,_probe_backend,_safe_parse,- _shape_for,+ shrink_to_shape,)from posthog.hogql.test._generated_grammar_strategies import expr_strategy, program_strategy, select_strategyfrom posthog.hogql.test.test_parser_grammar_pbt import (@@ -102,68 +103,7 @@ from posthog.hogql.test.test_parser_grammar_pbt import (# Auto-shrinker# ---------------------------------------------------------------------------#-# Hypothesis has its own shrinker but we're running queries that already-# escaped from a Hypothesis trial — by the time the diagnostic sees them,-# Hypothesis has moved on. We re-run our own delete-one-token reducer so-# each printed failure is a small repro the human can paste into a unit-# test.---_TOKEN_RE = re.compile(r"\s+|[^\s]+")---def _tokenize_for_shrink(query: str) -> list[str]:- """Split into shrinker units. We use whitespace-or-non-whitespace- runs so paren matching is preserved (a token like `(` or `)` is a- single shrinker unit). The original whitespace is retained so we- can re-join faithfully."""- return [m.group(0) for m in _TOKEN_RE.finditer(query)]---def _shrink_query(- query: str,- rule: str,- oracle_backend: str,- candidate_backend: str,- target_shape: DivergenceShape,- max_passes: int = 5,-) -> str:- """Greedy delete-one-token shrinker. Each pass walks every token- and drops it (and its trailing whitespace) if the resulting query- still triggers the same divergence shape. Stops when a pass- removes nothing or after `max_passes`. Linear in- tokens × passes — fine for ~50-300-token PBT queries."""- current = query- for _ in range(max_passes):- tokens = _tokenize_for_shrink(current)- # Try delete each non-whitespace token (and any trailing- # whitespace token) in turn.- improved = False- i = 0- while i < len(tokens):- if tokens[i].isspace():- i += 1- continue- # Build a candidate with tokens[i] removed (plus any- # immediately-following whitespace token).- drop_to = i + 1- if drop_to < len(tokens) and tokens[drop_to].isspace():- drop_to += 1- candidate = "".join(tokens[:i] + tokens[drop_to:])- if not candidate.strip():- i += 1- continue- shape = _shape_for(candidate, rule, oracle_backend, candidate_backend)- if shape == target_shape:- current = candidate- tokens = _tokenize_for_shrink(current)- improved = True- # Don't advance i — the next token slid into this slot.- continue- i += 1- if not improved:- break- return current+# Hypothesis has moved on by the time the diagnostic sees a failure, so we re-reduce via shrinkray (`shrink_to_shape`) to the smallest variant with the same divergence shape — a tight repro to paste into a unit test.# ---------------------------------------------------------------------------@@ -284,14 +224,7 @@ def main() -> int:return 1counts: Counter[str] = Counter()- # Buckets store `(query, shrunk_or_none, steps_for_mismatch)`. We- # shrink ONCE per failure (in `run()` below) and reuse the result- # both for the JSONL writer and the summary print loop — otherwise- # the two paths would shrink independently and could land on- # different minima of the same divergence (greedy deletion picks- # the first viable reduction at each step, so order matters), and- # a user cross-referencing the two outputs would see two- # different "minimal" repros for the same bug.+ # Buckets store `(query, shrunk_or_none, steps_for_mismatch)`; we shrink ONCE per failure here and reuse it for both the JSONL writer and the summary print loop, since shrinking is the slow step and doing it twice is pure waste.mismatch_buckets: dict[tuple[str, str], list[tuple[str, str | None, list]]] = {}reject_buckets: dict[str, list[tuple[str, str | None]]] = {}# Two-sided contract: the oracle rejected but the candidate accepted —@@ -365,7 +298,7 @@ def main() -> int:counts["candidate_accepts_oracle_reject"] += 1bucket = _node_type(rc_ast)shape = DivergenceShape(kind="candidate_accepts_oracle_reject")- shrunk = _shrink_query(query, args.rule, oracle, candidate, shape) if args.shrink_failures else None+ shrunk = shrink_to_shape(query, args.rule, oracle, candidate, shape) if args.shrink_failures else Noneaccept_reject_buckets.setdefault(bucket, []).append((query, shrunk))write_record({@@ -408,7 +341,7 @@ def main() -> int:counts["candidate_reject"] += 1sig = c_detail or "<no message>"shape = DivergenceShape(kind="candidate_reject", reject_signature=sig)- shrunk = _shrink_query(query, args.rule, oracle, candidate, shape) if args.shrink_failures else None+ shrunk = shrink_to_shape(query, args.rule, oracle, candidate, shape) if args.shrink_failures else Nonereject_buckets.setdefault(sig, []).append((query, shrunk))write_record({@@ -449,7 +382,7 @@ def main() -> int:mismatch_bucket = (_node_type(o_ast), _node_type(c_ast))steps = _diff_path(o_ast, c_ast)shape = _ast_mismatch_shape(mismatch_bucket, steps)- shrunk = _shrink_query(query, args.rule, oracle, candidate, shape) if args.shrink_failures else None+ shrunk = shrink_to_shape(query, args.rule, oracle, candidate, shape) if args.shrink_failures else Nonemismatch_buckets.setdefault(mismatch_bucket, []).append((query, shrunk, steps))write_record({diff --git a/posthog/hogql/scripts/shrink_query.py b/posthog/hogql/scripts/shrink_query.pynew file mode 100644index 000000000000..ed6ff588585b--- /dev/null+++ b/posthog/hogql/scripts/shrink_query.py@@ -0,0 +1,117 @@+# ruff: noqa: T201, E402+"""Shrink one HogQL query, read from stdin, to a minimal parser-parity repro.++Reads a query on stdin, checks whether the oracle and candidate backends+disagree on it, and — if they do — writes the smallest variant that still+triggers the same divergence to **stdout** (via shrinkray). All diagnostic+chatter goes to stderr, so stdout is exactly the shrunk query and nothing+else, ready to capture in `$(...)` or pipe onward.++This is the single-query reducer for the parity loop in+[`rust/hogql/parser/README.md`](../../../rust/hogql/parser/README.md): a+human — or a background agent told to brainstorm adversarial grammar+surface — pipes in a query that diverges (or that they think might) and gets+the minimal repro back to paste into a regression test. It doubles as a+divergence check: a query the backends agree on exits non-zero with the+reason on stderr.++Exit codes: `0` — a divergence was found and its minimal form is on stdout;+`1` — no divergence to shrink, or a setup error (reason on stderr).++## Usage++ echo '<query>' | PYTHONPATH=. python posthog/hogql/scripts/shrink_query.py+ pbpaste | PYTHONPATH=. python posthog/hogql/scripts/shrink_query.py --rule program++Needs the optional `hogql-parser-parity` dependency group+(`uv sync --group hogql-parser-parity`).+"""++from __future__ import annotations++import os+import sys+import argparse++import django++# Keep stdout pristine (only the shrunk query, for `$(...)` capture): django setup/settings print chatter there, so point stdout at stderr before django.setup() — early enough that logging config binds to stderr too — and write the result to the saved real stdout.+_REAL_STDOUT = sys.stdout+sys.stdout = sys.stderr++os.environ.setdefault("DJANGO_SETTINGS_MODULE", "posthog.settings")+django.setup()++from posthog.hogql.scripts._diagnostic_common import _probe_backend, _safe_parse, _shape_for, shrink_to_shape+++def _explain_no_divergence(query: str, rule: str, oracle: str, candidate: str) -> str:+ """Human-readable reason `_shape_for` returned None — the input isn't a+ shrinkable divergence. Re-parses both backends to classify which of the+ no-divergence cases this is."""+ o_status, _, o_detail = _safe_parse(query, rule, oracle)+ c_status, _, c_detail = _safe_parse(query, rule, candidate)+ if o_status == "crash":+ return f"no divergence to shrink: oracle {oracle!r} crashed ({o_detail}) — nothing to compare against"+ if c_status == "crash":+ return (+ f"no divergence to shrink: candidate {candidate!r} crashed ({c_detail}) — "+ f"a crash isn't a stable shape to reduce toward; reproduce it directly"+ )+ if o_status == "reject" and c_status == "reject":+ return "no divergence to shrink: both backends reject this query (they agree)"+ return "no divergence to shrink: oracle and candidate produce identical ASTs (they agree)"+++def main() -> int:+ p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)+ p.add_argument(+ "--rule",+ choices=("expr", "select", "program"),+ default="select",+ help="Parser rule the query should parse as (default: select)",+ )+ p.add_argument(+ "--oracle",+ default=os.environ.get("ORACLE_BACKEND", "cpp-json"),+ help="Source-of-truth backend (default: cpp-json)",+ )+ p.add_argument(+ "--candidate",+ default=os.environ.get("CANDIDATE_BACKEND", "rust-json"),+ help="Backend under test (default: rust-json; override for forks)",+ )+ args = p.parse_args()++ for label, backend in (("oracle", args.oracle), ("candidate", args.candidate)):+ err = _probe_backend(args.rule, backend)+ if err is not None:+ print(f"ERROR: {label} backend {backend!r} unavailable: {err}", file=sys.stderr)+ return 1++ # Read raw bytes and decode UTF-8 explicitly — the round trip must be+ # byte-exact and locale-independent (shrinkray works on UTF-8 bytes too).+ try:+ query = sys.stdin.buffer.read().decode("utf-8")+ except UnicodeDecodeError as e:+ print(f"ERROR: stdin is not valid UTF-8: {e}", file=sys.stderr)+ return 1+ if not query.strip():+ print("ERROR: no query on stdin", file=sys.stderr)+ return 1++ shape = _shape_for(query, args.rule, args.oracle, args.candidate)+ if shape is None:+ print(_explain_no_divergence(query, args.rule, args.oracle, args.candidate), file=sys.stderr)+ return 1++ shrunk = shrink_to_shape(query, args.rule, args.oracle, args.candidate, shape)+ print(f"shrunk {len(query)} -> {len(shrunk)} chars ({shape.kind})", file=sys.stderr)+ # Saved real stdout carries *only* the minimal query — exact bytes, no trailing newline added (a load-bearing one survives in `shrunk`).+ _REAL_STDOUT.write(shrunk)+ _REAL_STDOUT.flush()+ return 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/pyproject.toml b/pyproject.tomlindex e04176a8d670..fe8308965f0e 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -281,6 +281,9 @@ sentiment = ["optimum[onnxruntime]~=1.25.0","torch~=2.8.0",]+hogql-parser-parity = [+ "shrinkray==26.4.14.0",+][tool.uv]required-version = ">=0.10.2"diff --git a/rust/hogql/parser/README.md b/rust/hogql/parser/README.mdindex 483eb2c55765..e710f0fa3e8a 100644--- a/rust/hogql/parser/README.md+++ b/rust/hogql/parser/README.md@@ -163,14 +163,18 @@ that have already been fixed in the working tree.`hog_corpus_diagnostic.py` (the hog corpus has been at 100% fora while — usually skip);+ PBT (`pbt_diagnostic.py --rule expr|select|program`);- + thinking hard about edge cases the grammar surface invites.+ + thinking hard about edge cases the grammar surface invites —+ pipe each candidate through `shrink_query.py` to confirm it+ diverges and get the minimal form.For everything other than regression tests, start with a smallbudget (lower `--n`, less thinking time) and increase until atleast one divergence surfaces.-2. **Reduce + pin.** Shrink each divergence to its minimal form and- add it as a regression test in `_test_parser.py`'s factory so- it runs on all three backends.+2. **Reduce + pin.** Shrink each divergence to its minimal form via+ shrinkray — pipe one query through `shrink_query.py`, or use+ `--shrink-failures` on the corpus runners — and add it as a+ regression test in `_test_parser.py`'s factory so it runs on all+ three backends.3. **Read before fixing.** Read the grammar AND the cpp visitor forthe rule. 100% identical behaviour means knowing exactly what cppdoes — guessing leads to fixes that resurface on a deeper PBT@@ -190,7 +194,8 @@ in the background:+ `pbt_diagnostic.py --rule program`+ `log_corpus_diagnostic.py` (real query corpus)+ a research subagent grepping for cpp-vs-rust visitor differences-+ a research subagent brainstorming adversarial edge cases++ a research subagent brainstorming adversarial edge cases, each+ confirmed + minimised through `shrink_query.py`Most of these can stream divergences as they're found. Once at leastone known divergence is in hand, start fixing it while the parallel@@ -233,8 +238,9 @@ PYTHONPATH=. python posthog/hogql/scripts/pbt_diagnostic.py \Generates ~5 000 random grammar surface examples per rule, parses withoracle and candidate, buckets divergences by AST shape, and prints-shrunk reproducers. Use `--shrink-failures` to auto-reduce each-divergence to a minimal example.+reproducers. Use `--shrink-failures` to reduce each divergence to a+minimal example via shrinkray (needs the optional `hogql-parser-parity`+group — `uv sync --group hogql-parser-parity`).### Real-query corpora via `log_corpus_diagnostic.py` / `hog_corpus_diagnostic.py`@@ -250,7 +256,41 @@ PYTHONPATH=. python posthog/hogql/scripts/hog_corpus_diagnostic.pyBoth auto-download via `hogli metabase:query` and cache locally under`posthog/hogql/scripts/.local/`. Pass `--skip-download` to reuse theexisting dump while iterating. Failures are written one block per-divergence to a `.sql` / `.hog` file the agent can chew through.+divergence to a `.sql` / `.hog` file the agent can chew through. Add+`--shrink-failures` to reduce each failing query to a minimal repro via+shrinkray before it's written.++### Shrink one query via `shrink_query.py`++```bash+# Pipe in a query that diverges (or that you think might); get the+# minimal repro back on stdout:+echo '<query>' | PYTHONPATH=. python posthog/hogql/scripts/shrink_query.py --rule select+```++The "think hard about edge cases" arm of the loop, and the reducer for+any single divergence. Reads one query on stdin, writes the smallest+variant that still triggers the same divergence to stdout (chatter goes+to stderr, so stdout is exactly the repro). Doubles as a divergence+check: a query the backends agree on exits non-zero with the reason on+stderr. An agent brainstorming edge cases pipes each candidate through+it and keeps the ones that come back shrunk.++### The diagnostics need the optional parity group++Shrinking is powered by [shrinkray](https://github.com/DRMacIver/shrinkray),+which lives in the `hogql-parser-parity` group rather than the default dev+install (its transitive deps — textual, libcst, black — are heavy). The+parity scripts in `posthog/hogql/scripts/` import it at module level, so+they require that group:++```bash+uv sync --group hogql-parser-parity+```++Without it they fail fast at startup with a `ModuleNotFoundError` — these+are parity-work-only tools, so they just require the parity dependency+rather than degrading to a no-shrink mode.### Perf bench via `posthog/hogql/scripts/parser_bench.py`diff --git a/uv.lock b/uv.lockindex eda4314e0597..0348533b6339 100644--- a/uv.lock+++ b/uv.lock@@ -562,6 +562,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/30/da/43b15f28fe5f9e027b41c539abc5469052e9d48fd75f8ff094ba2a0ae767/billiard-4.2.1-py3-none-any.whl", hash = "sha256:40b59a4ac8806ba2c2369ea98d876bc6108b051c227baffd928c644d15d8f3cb", size = 86766, upload-time = "2024-09-21T13:40:20.188Z" },]+[[package]]+name = "binaryornot"+version = "0.6.0"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/86/72/4755b85101f37707c71526a301c1203e413c715a0016ecb592de3d2dcfff/binaryornot-0.6.0.tar.gz", hash = "sha256:cc8d57cfa71d74ff8c28a7726734d53a851d02fad9e3a5581fb807f989f702f0", size = 478718, upload-time = "2026-03-08T16:26:28.804Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/cd/0c/31cfaa6b56fe23488ecb993bc9fc526c0d84d89607decdf2a10776426c2e/binaryornot-0.6.0-py3-none-any.whl", hash = "sha256:900adfd5e1b821255ba7e63139b0396b14c88b9286e74e03b6f51e0200331337", size = 14185, upload-time = "2026-03-08T16:26:27.466Z" },+]+[[package]]name = "bingads"version = "13.0.26"@@ -3881,6 +3890,33 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/e7/1e/fb441c07b6662ec1fc92b249225ba6e6e5221b05623cb0131d082f782edc/lazy_object_proxy-1.11.0-py3-none-any.whl", hash = "sha256:a56a5093d433341ff7da0e89f9b486031ccd222ec8e52ec84d0ec1cdc819674b", size = 16635, upload-time = "2025-04-16T16:53:47.198Z" },]+[[package]]+name = "libcst"+version = "1.8.6"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "pyyaml-ft" },+]+sdist = { url = "https://files.pythonhosted.org/packages/de/cd/337df968b38d94c5aabd3e1b10630f047a2b345f6e1d4456bd9fe7417537/libcst-1.8.6.tar.gz", hash = "sha256:f729c37c9317126da9475bdd06a7208eb52fcbd180a6341648b45a56b4ba708b", size = 891354, upload-time = "2025-11-03T22:33:30.621Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/90/01/723cd467ec267e712480c772aacc5aa73f82370c9665162fd12c41b0065b/libcst-1.8.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7445479ebe7d1aff0ee094ab5a1c7718e1ad78d33e3241e1a1ec65dcdbc22ffb", size = 2206386, upload-time = "2025-11-03T22:32:27.422Z" },+ { url = "https://files.pythonhosted.org/packages/17/50/b944944f910f24c094f9b083f76f61e3985af5a376f5342a21e01e2d1a81/libcst-1.8.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4fc3fef8a2c983e7abf5d633e1884c5dd6fa0dcb8f6e32035abd3d3803a3a196", size = 2083945, upload-time = "2025-11-03T22:32:28.847Z" },+ { url = "https://files.pythonhosted.org/packages/36/a1/bd1b2b2b7f153d82301cdaddba787f4a9fc781816df6bdb295ca5f88b7cf/libcst-1.8.6-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:1a3a5e4ee870907aa85a4076c914ae69066715a2741b821d9bf16f9579de1105", size = 2235818, upload-time = "2025-11-03T22:32:30.504Z" },+ { url = "https://files.pythonhosted.org/packages/b9/ab/f5433988acc3b4d188c4bb154e57837df9488cc9ab551267cdeabd3bb5e7/libcst-1.8.6-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:6609291c41f7ad0bac570bfca5af8fea1f4a27987d30a1fa8b67fe5e67e6c78d", size = 2301289, upload-time = "2025-11-03T22:32:31.812Z" },+ { url = "https://files.pythonhosted.org/packages/5d/57/89f4ba7a6f1ac274eec9903a9e9174890d2198266eee8c00bc27eb45ecf7/libcst-1.8.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:25eaeae6567091443b5374b4c7d33a33636a2d58f5eda02135e96fc6c8807786", size = 2299230, upload-time = "2025-11-03T22:32:33.242Z" },+ { url = "https://files.pythonhosted.org/packages/f2/36/0aa693bc24cce163a942df49d36bf47a7ed614a0cd5598eee2623bc31913/libcst-1.8.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04030ea4d39d69a65873b1d4d877def1c3951a7ada1824242539e399b8763d30", size = 2408519, upload-time = "2025-11-03T22:32:34.678Z" },+ { url = "https://files.pythonhosted.org/packages/db/18/6dd055b5f15afa640fb3304b2ee9df8b7f72e79513814dbd0a78638f4a0e/libcst-1.8.6-cp313-cp313-win_amd64.whl", hash = "sha256:8066f1b70f21a2961e96bedf48649f27dfd5ea68be5cd1bed3742b047f14acde", size = 2119853, upload-time = "2025-11-03T22:32:36.287Z" },+ { url = "https://files.pythonhosted.org/packages/c9/ed/5ddb2a22f0b0abdd6dcffa40621ada1feaf252a15e5b2733a0a85dfd0429/libcst-1.8.6-cp313-cp313-win_arm64.whl", hash = "sha256:c188d06b583900e662cd791a3f962a8c96d3dfc9b36ea315be39e0a4c4792ebf", size = 1999808, upload-time = "2025-11-03T22:32:38.1Z" },+ { url = "https://files.pythonhosted.org/packages/25/d3/72b2de2c40b97e1ef4a1a1db4e5e52163fc7e7740ffef3846d30bc0096b5/libcst-1.8.6-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:c41c76e034a1094afed7057023b1d8967f968782433f7299cd170eaa01ec033e", size = 2190553, upload-time = "2025-11-03T22:32:39.819Z" },+ { url = "https://files.pythonhosted.org/packages/0d/20/983b7b210ccc3ad94a82db54230e92599c4a11b9cfc7ce3bc97c1d2df75c/libcst-1.8.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:5432e785322aba3170352f6e72b32bea58d28abd141ac37cc9b0bf6b7c778f58", size = 2074717, upload-time = "2025-11-03T22:32:41.373Z" },+ { url = "https://files.pythonhosted.org/packages/13/f2/9e01678fedc772e09672ed99930de7355757035780d65d59266fcee212b8/libcst-1.8.6-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:85b7025795b796dea5284d290ff69de5089fc8e989b25d6f6f15b6800be7167f", size = 2225834, upload-time = "2025-11-03T22:32:42.716Z" },+ { url = "https://files.pythonhosted.org/packages/4a/0d/7bed847b5c8c365e9f1953da274edc87577042bee5a5af21fba63276e756/libcst-1.8.6-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:536567441182a62fb706e7aa954aca034827b19746832205953b2c725d254a93", size = 2287107, upload-time = "2025-11-03T22:32:44.549Z" },+ { url = "https://files.pythonhosted.org/packages/02/f0/7e51fa84ade26c518bfbe7e2e4758b56d86a114c72d60309ac0d350426c4/libcst-1.8.6-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2f04d3672bde1704f383a19e8f8331521abdbc1ed13abb349325a02ac56e5012", size = 2288672, upload-time = "2025-11-03T22:32:45.867Z" },+ { url = "https://files.pythonhosted.org/packages/ad/cd/15762659a3f5799d36aab1bc2b7e732672722e249d7800e3c5f943b41250/libcst-1.8.6-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:7f04febcd70e1e67917be7de513c8d4749d2e09206798558d7fe632134426ea4", size = 2392661, upload-time = "2025-11-03T22:32:47.232Z" },+ { url = "https://files.pythonhosted.org/packages/e4/6b/b7f9246c323910fcbe021241500f82e357521495dcfe419004dbb272c7cb/libcst-1.8.6-cp313-cp313t-win_amd64.whl", hash = "sha256:1dc3b897c8b0f7323412da3f4ad12b16b909150efc42238e19cbf19b561cc330", size = 2105068, upload-time = "2025-11-03T22:32:49.145Z" },+ { url = "https://files.pythonhosted.org/packages/a6/0b/4fd40607bc4807ec2b93b054594373d7fa3d31bb983789901afcb9bcebe9/libcst-1.8.6-cp313-cp313t-win_arm64.whl", hash = "sha256:44f38139fa95e488db0f8976f9c7ca39a64d6bc09f2eceef260aa1f6da6a2e42", size = 1985181, upload-time = "2025-11-03T22:32:50.597Z" },+]+[[package]]name = "librt"version = "0.11.0"@@ -3914,6 +3950,18 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/43/57/31586d60aabd0c2e6de644406ee3c3f5df3ce9b99b57feab1d4f770e1f0d/linkedin_api_client-0.3.0-py3-none-any.whl", hash = "sha256:2d47745ca2487def4daec8ace4f341b64a59ee59878943cac5e7f22cff3443a6", size = 35626, upload-time = "2023-06-29T16:06:10.277Z" },]+[[package]]+name = "linkify-it-py"+version = "2.1.0"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "uc-micro-py" },+]+sdist = { url = "https://files.pythonhosted.org/packages/2e/c9/06ea13676ef354f0af6169587ae292d3e2406e212876a413bf9eece4eb23/linkify_it_py-2.1.0.tar.gz", hash = "sha256:43360231720999c10e9328dc3691160e27a718e280673d444c38d7d3aaa3b98b", size = 29158, upload-time = "2026-03-01T07:48:47.683Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/b4/de/88b3be5c31b22333b3ca2f6ff1de4e863d8fe45aaea7485f591970ec1d3e/linkify_it_py-2.1.0-py3-none-any.whl", hash = "sha256:0d252c1594ecba2ecedc444053db5d3a9b7ec1b0dd929c8f1d74dce89f86c05e", size = 19878, upload-time = "2026-03-01T07:48:46.098Z" },+]+[[package]]name = "llvmlite"version = "0.46.0"@@ -4065,6 +4113,11 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" },]+[package.optional-dependencies]+linkify = [+ { name = "linkify-it-py" },+]+[[package]]name = "markdown-to-mrkdwn"version = "0.2.0"@@ -4206,6 +4259,18 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/fd/d9/eaa1f80170d2b7c5ba23f3b59f766f3a0bb41155fbc32a69adfa1adaaef9/mcp-1.26.0-py3-none-any.whl", hash = "sha256:904a21c33c25aa98ddbeb47273033c435e595bbacfdb177f4bd87f6dceebe1ca", size = 233615, upload-time = "2026-01-24T19:40:30.652Z" },]+[[package]]+name = "mdit-py-plugins"+version = "0.6.1"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "markdown-it-py" },+]+sdist = { url = "https://files.pythonhosted.org/packages/59/fc/f8d0863f8862f25602c0404d75568e89fb6b4109804645e5cdfb1be5cf56/mdit_py_plugins-0.6.1.tar.gz", hash = "sha256:a2bca0f039f39dbd35fb74ae1b5f998608c437463371f0ff7f49a19a17a114d0", size = 56114, upload-time = "2026-05-13T09:03:38.91Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/a5/69/6da5581c6a7fede7dc261bf4e67d6adca4196f176b43288b55b3db395b6e/mdit_py_plugins-0.6.1-py3-none-any.whl", hash = "sha256:214c82fb2ac524472ab6a5bcab1de80f73b50443e187f401bfd77efbc7c6481d", size = 66663, upload-time = "2026-05-13T09:03:37.76Z" },+]+[[package]]name = "mdurl"version = "0.1.2"@@ -5363,6 +5428,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/80/c8/210f282d278e4709cdd71b12a31af45a30a22ab3207b387e29b37e478713/playwright-1.60.0-py3-none-win_arm64.whl", hash = "sha256:6e4f6700a4c2250efff8e690a81d66e3855754fb587b6b87cf5c784014f91537", size = 34037981, upload-time = "2026-05-18T12:00:57.584Z" },]+[[package]]+name = "plotext"+version = "5.3.2"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/c9/d7/f75f397af966fe252d0d34ffd3cae765317fce2134f925f95e7d6725d1ce/plotext-5.3.2.tar.gz", hash = "sha256:52d1e932e67c177bf357a3f0fe6ce14d1a96f7f7d5679d7b455b929df517068e", size = 61967, upload-time = "2024-09-24T15:13:37.728Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/f6/1e/12fe7c40cd2099a1f454518754ed229b01beaf3bbb343127f0cc13ce6c22/plotext-5.3.2-py3-none-any.whl", hash = "sha256:394362349c1ddbf319548cfac17ca65e6d5dfc03200c40dfdc0503b3e95a2283", size = 64047, upload-time = "2024-09-24T15:13:36.296Z" },+]+[[package]]name = "pluggy"version = "1.6.0"@@ -5693,6 +5767,9 @@ dev = [{ name = "types-tzlocal" },{ name = "watchdog" },]+hogql-parser-parity = [+ { name = "shrinkray" },+]sentiment = [{ name = "optimum", extra = ["onnxruntime"] },{ name = "torch" },@@ -5964,6 +6041,7 @@ dev = [{ name = "types-tzlocal", specifier = "~=5.1.0.1" },{ name = "watchdog", specifier = "==5.0.3" },]+hogql-parser-parity = [{ name = "shrinkray", specifier = "==26.4.14.0" }]sentiment = [{ name = "optimum", extras = ["onnxruntime"], specifier = "~=1.25.0" },{ name = "torch", specifier = "~=2.8.0" },@@ -6396,11 +6474,11 @@ wheels = [[[package]]name = "pygments"-version = "2.19.1"+version = "2.20.0"source = { registry = "https://pypi.org/simple" }-sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581, upload-time = "2025-01-06T17:26:30.443Z" }+sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" },+ { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" },][[package]]@@ -6952,6 +7030,30 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" },]+[[package]]+name = "pyyaml-ft"+version = "8.0.0"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/5e/eb/5a0d575de784f9a1f94e2b1288c6886f13f34185e13117ed530f32b6f8a8/pyyaml_ft-8.0.0.tar.gz", hash = "sha256:0c947dce03954c7b5d38869ed4878b2e6ff1d44b08a0d84dc83fdad205ae39ab", size = 141057, upload-time = "2025-06-10T15:32:15.613Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/68/ba/a067369fe61a2e57fb38732562927d5bae088c73cb9bb5438736a9555b29/pyyaml_ft-8.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8c1306282bc958bfda31237f900eb52c9bedf9b93a11f82e1aab004c9a5657a6", size = 187027, upload-time = "2025-06-10T15:31:48.722Z" },+ { url = "https://files.pythonhosted.org/packages/ad/c5/a3d2020ce5ccfc6aede0d45bcb870298652ac0cf199f67714d250e0cdf39/pyyaml_ft-8.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:30c5f1751625786c19de751e3130fc345ebcba6a86f6bddd6e1285342f4bbb69", size = 176146, upload-time = "2025-06-10T15:31:50.584Z" },+ { url = "https://files.pythonhosted.org/packages/e3/bb/23a9739291086ca0d3189eac7cd92b4d00e9fdc77d722ab610c35f9a82ba/pyyaml_ft-8.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3fa992481155ddda2e303fcc74c79c05eddcdbc907b888d3d9ce3ff3e2adcfb0", size = 746792, upload-time = "2025-06-10T15:31:52.304Z" },+ { url = "https://files.pythonhosted.org/packages/5f/c2/e8825f4ff725b7e560d62a3609e31d735318068e1079539ebfde397ea03e/pyyaml_ft-8.0.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cec6c92b4207004b62dfad1f0be321c9f04725e0f271c16247d8b39c3bf3ea42", size = 786772, upload-time = "2025-06-10T15:31:54.712Z" },+ { url = "https://files.pythonhosted.org/packages/35/be/58a4dcae8854f2fdca9b28d9495298fd5571a50d8430b1c3033ec95d2d0e/pyyaml_ft-8.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06237267dbcab70d4c0e9436d8f719f04a51123f0ca2694c00dd4b68c338e40b", size = 778723, upload-time = "2025-06-10T15:31:56.093Z" },+ { url = "https://files.pythonhosted.org/packages/86/ed/fed0da92b5d5d7340a082e3802d84c6dc9d5fa142954404c41a544c1cb92/pyyaml_ft-8.0.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:8a7f332bc565817644cdb38ffe4739e44c3e18c55793f75dddb87630f03fc254", size = 758478, upload-time = "2025-06-10T15:31:58.314Z" },+ { url = "https://files.pythonhosted.org/packages/f0/69/ac02afe286275980ecb2dcdc0156617389b7e0c0a3fcdedf155c67be2b80/pyyaml_ft-8.0.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7d10175a746be65f6feb86224df5d6bc5c049ebf52b89a88cf1cd78af5a367a8", size = 799159, upload-time = "2025-06-10T15:31:59.675Z" },+ { url = "https://files.pythonhosted.org/packages/4e/ac/c492a9da2e39abdff4c3094ec54acac9747743f36428281fb186a03fab76/pyyaml_ft-8.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:58e1015098cf8d8aec82f360789c16283b88ca670fe4275ef6c48c5e30b22a96", size = 158779, upload-time = "2025-06-10T15:32:01.029Z" },+ { url = "https://files.pythonhosted.org/packages/5d/9b/41998df3298960d7c67653669f37710fa2d568a5fc933ea24a6df60acaf6/pyyaml_ft-8.0.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:e64fa5f3e2ceb790d50602b2fd4ec37abbd760a8c778e46354df647e7c5a4ebb", size = 191331, upload-time = "2025-06-10T15:32:02.602Z" },+ { url = "https://files.pythonhosted.org/packages/0f/16/2710c252ee04cbd74d9562ebba709e5a284faeb8ada88fcda548c9191b47/pyyaml_ft-8.0.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:8d445bf6ea16bb93c37b42fdacfb2f94c8e92a79ba9e12768c96ecde867046d1", size = 182879, upload-time = "2025-06-10T15:32:04.466Z" },+ { url = "https://files.pythonhosted.org/packages/9a/40/ae8163519d937fa7bfa457b6f78439cc6831a7c2b170e4f612f7eda71815/pyyaml_ft-8.0.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c56bb46b4fda34cbb92a9446a841da3982cdde6ea13de3fbd80db7eeeab8b49", size = 811277, upload-time = "2025-06-10T15:32:06.214Z" },+ { url = "https://files.pythonhosted.org/packages/f9/66/28d82dbff7f87b96f0eeac79b7d972a96b4980c1e445eb6a857ba91eda00/pyyaml_ft-8.0.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dab0abb46eb1780da486f022dce034b952c8ae40753627b27a626d803926483b", size = 831650, upload-time = "2025-06-10T15:32:08.076Z" },+ { url = "https://files.pythonhosted.org/packages/e8/df/161c4566facac7d75a9e182295c223060373d4116dead9cc53a265de60b9/pyyaml_ft-8.0.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd48d639cab5ca50ad957b6dd632c7dd3ac02a1abe0e8196a3c24a52f5db3f7a", size = 815755, upload-time = "2025-06-10T15:32:09.435Z" },+ { url = "https://files.pythonhosted.org/packages/05/10/f42c48fa5153204f42eaa945e8d1fd7c10d6296841dcb2447bf7da1be5c4/pyyaml_ft-8.0.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:052561b89d5b2a8e1289f326d060e794c21fa068aa11255fe71d65baf18a632e", size = 810403, upload-time = "2025-06-10T15:32:11.051Z" },+ { url = "https://files.pythonhosted.org/packages/d5/d2/e369064aa51009eb9245399fd8ad2c562bd0bcd392a00be44b2a824ded7c/pyyaml_ft-8.0.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:3bb4b927929b0cb162fb1605392a321e3333e48ce616cdcfa04a839271373255", size = 835581, upload-time = "2025-06-10T15:32:12.897Z" },+ { url = "https://files.pythonhosted.org/packages/c0/28/26534bed77109632a956977f60d8519049f545abc39215d086e33a61f1f2/pyyaml_ft-8.0.0-cp313-cp313t-win_amd64.whl", hash = "sha256:de04cfe9439565e32f178106c51dd6ca61afaa2907d143835d501d84703d3793", size = 171579, upload-time = "2025-06-10T15:32:14.34Z" },+]+[[package]]name = "qrcode"version = "7.4.2"@@ -7523,6 +7625,27 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" },]+[[package]]+name = "shrinkray"+version = "26.4.14.0"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "binaryornot" },+ { name = "black" },+ { name = "chardet" },+ { name = "click" },+ { name = "exceptiongroup" },+ { name = "humanize" },+ { name = "libcst" },+ { name = "textual" },+ { name = "textual-plotext" },+ { name = "trio" },+]+sdist = { url = "https://files.pythonhosted.org/packages/85/87/07be58219bea2dce4eb987663be2a55b8352771715c74428309efac9a4e4/shrinkray-26.4.14.0.tar.gz", hash = "sha256:0ebd55f3d3a5fb33a716d809b4e3138a3a4a8c1d80da1996a9fb5307b66e3109", size = 332091, upload-time = "2026-04-14T10:00:27.959Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/da/30/157b99610b70861f3b12264d38845537f2803c287d2c349300c033957bb9/shrinkray-26.4.14.0-py3-none-any.whl", hash = "sha256:0be6d53a720eed5f4d6a46a36d0ee6c224961207da95c88860b9783e0b40b639", size = 102172, upload-time = "2026-04-14T10:00:26.344Z" },+]+[[package]]name = "simple-salesforce"version = "1.12.9"@@ -8014,6 +8137,36 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/60/f0/1d9bfcc8ee6b83472ec571406bd0dd51c0e6330ff1a51b2d29861d389e85/textblob-0.15.3-py2.py3-none-any.whl", hash = "sha256:b0eafd8b129c9b196c8128056caed891d64b7fa20ba570e1fcde438f4f7dd312", size = 636507, upload-time = "2019-02-24T23:03:17.3Z" },]+[[package]]+name = "textual"+version = "8.2.7"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "markdown-it-py", extra = ["linkify"] },+ { name = "mdit-py-plugins" },+ { name = "platformdirs" },+ { name = "pygments" },+ { name = "rich" },+ { name = "typing-extensions" },+]+sdist = { url = "https://files.pythonhosted.org/packages/9b/7a/c519db0aba5024f86e71e9631810bfdd6866ed2c8695bd7fa34b90e7ef59/textual-8.2.7.tar.gz", hash = "sha256:658f568ff81e30ed43890c3e07520390e5cf1b4763822006e060656b0a88f105", size = 1859249, upload-time = "2026-05-19T10:52:49.531Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/a8/f5/c1e18bc0707300a0e90204343abbf7d7acd6fb7ebe03a6d4893b99a234b8/textual-8.2.7-py3-none-any.whl", hash = "sha256:4caaa13a90bc4cf9c6c862c067ccd34fe84e9c161710a2a907a8026313b6bd73", size = 731129, upload-time = "2026-05-19T10:52:51.773Z" },+]++[[package]]+name = "textual-plotext"+version = "1.0.1"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "plotext" },+ { name = "textual" },+]+sdist = { url = "https://files.pythonhosted.org/packages/9a/b0/e4e0f38df057db778252db0dd2c08522d7222b8537b6a0181d797b9044bd/textual_plotext-1.0.1.tar.gz", hash = "sha256:836f53a3316756609e194129a35c2875638e7958c261f541e0a794f7c98011be", size = 16489, upload-time = "2024-11-30T19:25:56.625Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/35/53/fba7da208f9d3f59254413660fa0aa6599f2aca806f3ae356670455fd4ea/textual_plotext-1.0.1-py3-none-any.whl", hash = "sha256:6b6bfd00b29f121ddf216eaaf9bdac9d688ed72f40028484d279a10cbbb169ed", size = 16558, upload-time = "2024-11-30T19:25:32.208Z" },+]+[[package]]name = "threadpoolctl"version = "3.6.0"@@ -8770,6 +8923,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/6f/d3/13adff37f15489c784cc7669c35a6c3bf94b87540229eedf52ef2a1d0175/ua_parser_builtins-0.18.0.post1-py3-none-any.whl", hash = "sha256:eb4f93504040c3a990a6b0742a2afd540d87d7f9f05fd66e94c101db1564674d", size = 86077, upload-time = "2024-12-05T18:44:36.732Z" },]+[[package]]+name = "uc-micro-py"+version = "2.0.0"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/78/67/9a363818028526e2d4579334460df777115bdec1bb77c08f9db88f6389f2/uc_micro_py-2.0.0.tar.gz", hash = "sha256:c53691e495c8db60e16ffc4861a35469b0ba0821fe409a8a7a0a71864d33a811", size = 6611, upload-time = "2026-03-01T06:31:27.526Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/61/73/d21edf5b204d1467e06500080a50f79d49ef2b997c79123a536d4a17d97c/uc_micro_py-2.0.0-py3-none-any.whl", hash = "sha256:3603a3859af53e5a39bc7677713c78ea6589ff188d70f4fee165db88e22b242c", size = 6383, upload-time = "2026-03-01T06:31:26.257Z" },+]+[[package]]name = "umap-learn"version = "0.5.7"