BE-456: HashQL: Entity type model enrichment and graph store query extensions#8524
Conversation
feat: checkpoint (II) feat: checkpoint (III) feat: snapshot vec feat: add dedicated filter feat: checkpoint feat: filter implementation feat: filter implementation (mostly) done chore: environment capture note chore: always postgres bigint feat: target clone feat: simplify lookup feat: move storage up feat: eval entity path chore: checkpoint chore: checkpoint chore: find entrypoint feat: eval context feat: eval cleanup chore: cleanup feat: track index feat: wire up filter feat: add error reporting chore: checkpoint feat: add traverse, and first postgres compiler outline feat: traverse bitmap feat: move traversal out feat: projections feat: projections fix: clippy feat: subquery projection for lateral feat: checkpoint feat: test plan feat: checkpoint feat: checkpoint – failing tests ;-; feat: checkpoint – failing tests ;-; feat: checkpoint — passing tests fix: import fix: entity type feat: checkpoint feat: attribute a cost to terminator placement switches fix: import feat: checkpoint feat: checkpoint chore: lint
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
PR SummaryMedium Risk Overview Extends the graph Postgres query builder with new SQL expression capabilities (e.g. composite Enriches HashQL’s entity type model with metadata/temporal/provenance/confidence/encodings fields and updates graph read path resolution plus golden tests to match the new Reviewed by Cursor Bugbot for commit 1a97257. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Misleading enum variant name for
jsonb_aggfunction- Renamed
Function::JsonAggtoFunction::JsonbAggand updated all internal usages/tests to match the emittedjsonb_agg(...)SQL.
- Renamed
- ✅ Fixed: Multiple new symbols defined but never referenced
- Removed the eight unreferenced symbol definitions from
sym.rsto eliminate dead entries and duplicate provenance naming.
- Removed the eight unreferenced symbol definitions from
Or push these changes by commenting:
@cursor push 928f4a2c0b
Preview (928f4a2c0b)
diff --git a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs
--- a/libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs
+++ b/libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs
@@ -17,7 +17,7 @@
pub enum Function {
Min(Box<Expression>),
Max(Box<Expression>),
- JsonAgg(Box<Expression>),
+ JsonbAgg(Box<Expression>),
JsonExtractText(Box<Expression>),
JsonExtractAsText(Box<Expression>, PathToken<'static>),
JsonExtractPath(Vec<Expression>),
@@ -55,7 +55,7 @@
expression.transpile(fmt)?;
fmt.write_char(')')
}
- Self::JsonAgg(expression) => {
+ Self::JsonbAgg(expression) => {
fmt.write_str("jsonb_agg(")?;
expression.transpile(fmt)?;
fmt.write_char(')')
@@ -821,9 +821,9 @@
}
#[test]
- fn transpile_json_agg() {
+ fn transpile_jsonb_agg() {
assert_eq!(
- Expression::Function(Function::JsonAgg(Box::new(Expression::Parameter(1))))
+ Expression::Function(Function::JsonbAgg(Box::new(Expression::Parameter(1))))
.transpile_to_string(),
"jsonb_agg($1)"
);
diff --git a/libs/@local/hashql/core/src/symbol/sym.rs b/libs/@local/hashql/core/src/symbol/sym.rs
--- a/libs/@local/hashql/core/src/symbol/sym.rs
+++ b/libs/@local/hashql/core/src/symbol/sym.rs
@@ -36,7 +36,6 @@
entity,
entity_edition_id,
entity_id,
- entity_type_ids,
entity_uuid,
eq,
Err,
@@ -55,8 +54,6 @@
left_entity_confidence,
left_entity_id,
left_entity_provenance,
- left_entity_uuid,
- left_entity_web_id,
link_data,
List,
lt,
@@ -76,10 +73,7 @@
or,
pow,
properties,
- property_metadata,
provenance,
- provenance_edition,
- provenance_inferred,
provided,
r#as: "as",
r#as_force: "as!",
@@ -101,8 +95,6 @@
right_entity_confidence,
right_entity_id,
right_entity_provenance,
- right_entity_uuid,
- right_entity_web_id,
Some,
special_form,
String,
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## graphite-base/8524 #8524 +/- ##
======================================================
- Coverage 67.55% 60.50% -7.05%
======================================================
Files 897 970 +73
Lines 82970 100617 +17647
Branches 4511 4649 +138
======================================================
+ Hits 56049 60880 +4831
- Misses 26347 39120 +12773
- Partials 574 617 +43
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🤖 Augment PR SummarySummary: This PR enriches the HashQL entity type model to better reflect the full graph database schema, and extends the Postgres query-builder/AST to support additional SQL constructs needed by the HashQL→Postgres compiler. Changes:
Technical Notes: Query builder aliasing is standardized on an 🤖 Was this summary useful? React with 👍 or 👎 |
6ef6d13 to
ef9b858
Compare
61d002f to
bc50eb0
Compare
b8fe72b to
69a8667
Compare
69a8667 to
40ba97b
Compare
bc50eb0 to
8b6ee87
Compare
40ba97b to
a4534ce
Compare
8b6ee87 to
687e4f1
Compare
a4534ce to
4503abc
Compare
b9e2eb9 to
1a97257
Compare


🌟 What is the purpose of this PR?
Enriches the HashQL entity type model to match the full database schema, extends the graph-store SQL query builder with new expression types needed by the postgres compiler, and adds a database migration for the
continuationcomposite type. This is the foundation layer for the postgres translation stack (BE-457, BE-306).🔍 What does this change?
hashql-core:
IdSnapshotVec, a typed-ID-indexed vector with transactional snapshot/rollback support (used by the postgres compiler for scoped state)TemporalInterval,EntityTemporalMetadata,Confidence, provenance types,EntityMetadata, andLinkDatafields to match the full database schema. Previously onlyEntityId,EntityRecordId, and partialLinkDatawere modeled.edition_idandontology_type_idssymbolsgraph-postgres-store query builder:
FieldAccess(composite field extraction),JsonAgg,Constant::Null,Constant::U128,UnaryOperator::IsNotFalseJsonB,Continuation,Numeric,Int,BigIntUnnestnow accepts multiple expressions (UNNEST(a, b, c))SelectStatementgainsOFFSETsupport.cast(),.not()and.grouped()now takeself&'static strtoIdentifierfor consistencymod postgresandmod tablemadepubfor use by the HashQL postgres compilerDatabase migration (v010__query):
continuationcomposite type:(filter boolean, block int, locals int[], values jsonb[]). This is the row type returned by compiled filter subqueries; the interpreter reads.filterto decide row inclusion and.block/.locals/.valuesto resume multi-block CFGs.hashql-eval:
graph/read/path.rsto handle the expanded entity field structurelib.rsanderror.rsfor the postgres module (filled in by BE-306)Test output updates:
.jsonc/.stdout/.stderrfixtures across eval (graph/read), HIR (lower/checking, specialization, graph-hoisting), and MIR (reify, inline) test suites, all cascading from the entity type changesPre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
The entity type model still does not cover every field in the database schema (e.g.,
property_metadatainner structure is opaque). Fields are added as needed by the postgres compiler; remaining gaps will be filled incrementally.🛡 What tests cover this?
IdSnapshotVechas doc tests and inline unit tests covering push/set/rollback/nested snapshotsFieldAccess,JsonAgg,Null,U128,IsNotFalse,UNNESTwith multiple args, cast types, andOFFSET❓ How to test this?