test(gq): add a mandatory --- expect shape section and a result-schema check - #635
Merged
azimafroozeh merged 2 commits intoSep 5, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
--- expect shape section and a result-sch…--- expect shape section and a result-schema check
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
This PR makes a
.gqtrows step state and check its result columns, so a wrongly typed result column fails the case even when every affected cell is null. Follow-up to #596 and #607; motivated by the fix for #623, whose zero-row aggregate case could not go red: since #627 the JSON writer omits a null cell's key, so{"n": 0}renders from aFloat64column and aDate32column alike, and the type assertion had to live in a Rust test.--- expect unordered/--- expect ordered) carries a mandatory--- expect shapesection: one<name>: <type>line per result column in.pgproperty syntax,?permitting a null cell (p.age: I32?,total: I64,p.embedding: Vector(3)). A missing section is a parse refusal naming both routes (write it from the.pgschema, or fill it withOMNIGRAPH_GQ_BLESS=1and review the diff).QueryResult::schema()before the rows: column count, executed column name (executed_column_name), ArrowDataTypethroughPropType::to_arrow, and no null cell in a column written without?. Messages spell both sides in.pgwhere the executed type has a spelling (expected I32, the executor returned F64).infer_query_result_schemafor the step's declaration: count, name,DataType, and no null in a column the compiler infers non-nullable. It costs the author nothing and tieslint's promise to the executed result; the shape section exists because this check cannot see a rule the compiler and the executor share.?exactly when the column holds a null cell (the executor's own nullable flag is never read:aggregate_returnsets every column nullable). Bless refuses to rewrite a shape whose executed type the compiler disputes, and refuses a type with no.pgspelling, naming it.PropType::from_arrow/ScalarType::from_arroware added to the compiler as the inverse ofto_arrowover its image, with a round-trip test over every scalar, list and nullable form;executed_column_namebecomespub.docs/dev/testing.md, the crate README, AGENTS.md's regression-tier sentence and the Fix Regression Gate's printed skeleton follow.Backing issue / RFC
docs/rfcs/0045-gq-logic-tests.md), amended in this PR with the shape section and the result-schema check; no separate issue.Checklist
.gqtrunner's result-schema checking: shape section, computed check, bless, and the docs and corpus that carry them)from_arrowround-trip; the 11 corpus cases run with their 16 shape sections; disabling the check turns three wiring pins red)docs/dev/testing.md,crates/omnigraph-gqt/README.md, AGENTS.md, RFC 0045; no product surface changes).pggrammar and the query surface are untouched)Local verification
cargo check --workspace --all-targets— greencargo test -p omnigraph-gqt— green: 116 self-tests, 11 corpus casescargo test -p omnigraph-compiler types::— green: 5 testscargo clippy -p omnigraph-gqt -p omnigraph-compiler --all-targets -- -D warnings -W clippy::dbg_macro— greencargo fmt --all --check— greenpython3 scripts/check-fix-regression.py --self-test— okscripts/check-agents-md.sh— green (45 links, 43 docs)python3 scripts/check-docs.py— green (125 files)cargo run -p omnigraph-vocabulary-guard -- check --surface rust-string --base <merge base> ...— not conclusive: the audit is disabled in CI (VOCABULARY_AUDIT_ENABLED: "false") and the merge base itself reports unclassified occurrencescargo test --workspace— not run: the engine and server crates are not touched; the compiler change is a visibility keyword and a new type mapping covered by its own testsNotes for reviewers
countaggregate is red until the fix for bug: min and max refuse Date and Bool columns #623 lands (the executor types the columnFloat64); the shape line written from the.pgschema is right, the message says so, and bless refuses to pin the executor's type. No corpus case carries one.return { $p }) is red under the computed check until the bare-node projection fix lands (the compiler infers the node object, the executor returns the id column); no corpus case carries one, and the failure message names the form..pgdeclaration. test(gq): add the Kuzu-derived.gqtcase corpus #617 is the largest..pgschema and the return clause; or run, hit the refusal, bless, review the diff.p: Personfor a bare node is refused until the bare-node fix lands. A.pg-nullable property may be written without?when the step's data holds no null; that is the stronger assertion and is accepted.?on a never-null column (nothing mechanical; bless never writes one the data does not justify, so it is visibly hand-made); aliasing every column to dodge the name spelling (legitimate, the types are still checked); a shape-only rebless in anissue_Ncase satisfying the Fix Regression Gate's added-body-line rule (a review flag).p.namefor an unaliased property); the compiler's inferred schema andlint --jsonstill spell itname, and whether that folds into the executed spelling is a separate compiler decision, out of scope here..pgvocabulary against the author's lines, the computed check in Arrow vocabulary against the compiler's fields.pubonexecuted_column_name,from_arrowonPropTypeandScalarType;omnigraph-gqtgainsarrow-schema(dep) andarrow-array(dev-dep).