Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/gq-logic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,5 @@ jobs:

- name: Run GQ logic tests
if: needs.classify_changes.outputs.run_full_ci == 'true'
run: cargo test -p omnigraph-engine --test gq_logic_tests --locked -- --nocapture
# The corpus crate: format self-tests, corpus layout check, one test per case.
run: cargo test -p omnigraph-gqt --locked -- --nocapture
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Tools that support `@` imports include these automatically:
- Storage substrate: Lance 11.0.0
- Workspace: compiler, storage, engine (`omnigraph-engine` package), policy,
API types, cluster, CLI, server, Azure admission wrapper, benchmark harness,
and `omnigraph-dst` (deterministic simulation testing; needs
`omnigraph-gqt` (the `.gqt` logic-test corpus and its runner; one libtest
test per case), and `omnigraph-dst` (deterministic simulation testing; needs
`--cfg tokio_unstable`, set by its crate-local `.cargo/config.toml` when
cargo runs from the crate dir — compiles empty without it)
- License: MIT
Expand Down Expand Up @@ -152,7 +153,7 @@ Set `OMNIGRAPH_UPDATE_OPENAPI=1` only when the drift is intentional.
- For a bug, reproduce the predicted failure at the tier the regression rule
below names, then fix the root cause and prove the regression turns green.
- Query-behavior tests default to `.gqt` logic tests under
`crates/omnigraph/tests/gq_logic_tests/`; a Rust test needs a reason the
`crates/omnigraph-gqt/cases/`; a Rust test needs a reason the
logic test format cannot express (mechanism assertions, scale symptoms,
process environment, concurrency).
- Every issue fix lands a regression test at the cheapest tier that catches
Expand Down
80 changes: 70 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"crates/omnigraph-policy",
"crates/omnigraph-server",
"crates/omnigraph-dst",
"crates/omnigraph-gqt",
"tools/omnigraph-vocabulary-guard",
]
default-members = [
Expand Down
32 changes: 32 additions & 0 deletions crates/omnigraph-gqt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "omnigraph-gqt"
version = "0.10.0"
edition = "2024"
description = "GQ logic-test corpus (`cases/*.gqt`) and its runner; one named test per case."
license = "MIT"
repository = "https://github.com/ModernRelay/omnigraph"
homepage = "https://github.com/ModernRelay/omnigraph"
publish = false

# No doc examples; skip the empty doctest target on every `cargo test -p`.
[lib]
doctest = false

[dependencies]
futures = { workspace = true }
omnigraph = { package = "omnigraph-engine", path = "../omnigraph", version = "0.10.0" }
omnigraph-compiler = { path = "../omnigraph-compiler", version = "0.10.0" }
serde_json = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true }

[dev-dependencies]
datatest-stable = "0.3"

# One libtest test per `cases/*.gqt`; mechanism and flags: tests/gq_logic_tests.rs.
[[test]]
name = "gq_logic_tests"
harness = false

[lints]
workspace = true
31 changes: 31 additions & 0 deletions crates/omnigraph-gqt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# omnigraph-gqt

The GQ logic-test corpus and its runner. Never part of a release build:
`publish = false`, not a workspace default member, not in `release.yml`. A
bare `cargo test` at the workspace root therefore skips it; `-p omnigraph-gqt`
or `--workspace` reaches it.

- `cases/*.gqt`: the corpus. One file is one case: a `.pg` schema, JSONL
seed rows, and steps (queries, mutations, restarts, loops) with expected
outcomes. Format, refusal set, and comparison semantics: RFC 0045
(`docs/rfcs/0045-gq-logic-tests.md`). A regression for a merged fix is
`issue_NNN_<short_name>.gqt`; `scripts/check-fix-regression.py` looks for it
here.
- `src/lib.rs`: the runner (case parsing, execution against a fresh
temporary store, row comparison, bless). Format self-tests and the corpus
layout check are its unit tests (`src/tests.rs`).
- `tests/gq_logic_tests.rs`: one libtest test per case, named
`case::<file>.gqt`, registered at run time by `datatest-stable`
(`harness = false`). A new case file is picked up without any Rust change.

```bash
cargo test -p omnigraph-gqt # everything
cargo test -p omnigraph-gqt --test gq_logic_tests issue_563 # cases whose name contains issue_563
cargo test -p omnigraph-gqt --test gq_logic_tests -- --list # one line per case
cargo test -p omnigraph-gqt --test gq_logic_tests -- --test-threads=2
OMNIGRAPH_GQ_BLESS=1 cargo test -p omnigraph-gqt --test gq_logic_tests my_case # rewrite the failing expect
```

`OMNIGRAPH_GQ_CASE_TIMEOUT_SECS=<n>` (default 10) bounds each case's wall
time; a case over budget belongs in a `heavy-repro:` `#[ignore]`d Rust test,
not here.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# red_on: 2026-08-29, pre-fix build: the bm25 scan cap (limit 2 x 4 = 8 rows) fed count() only the capped window, so total was 8, not 20.
# notes: an aggregate's value is computed over the matching rows, so the BM25
# notes: scan cap must never apply to aggregate returns. Rust twin:
# notes: bm25_ordered_aggregate_counts_all_matches_not_the_capped_scan (tests/search.rs).
# notes: bm25_ordered_aggregate_counts_all_matches_not_the_capped_scan (crates/omnigraph/tests/search.rs).
# notes: Seed geometry: 20 chunks all matching "needle", strict tf gradient
# notes: (tf = 20 - c) so BM25 has a real order with no ties.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# notes: the uncapped retry ran. Passes on pre-cap code too (an unbounded scan
# notes: finds everything): this case guards the retry GIVEN the cap, not the cap
# notes: itself; the cap is the aggregate case's job. Rust twin:
# notes: bm25_join_fills_limit_when_capped_scan_underfills_issue_563 (tests/search.rs).
# notes: bm25_join_fills_limit_when_capped_scan_underfills_issue_563 (crates/omnigraph/tests/search.rs).

--- schema
node Chunk {
Expand Down
Loading