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 additional SQL constructs: composite Enriches HashQL’s graph entity type definitions to include metadata/temporal/provenance/confidence/encodings and updates graph read path resolution + compiletest fixtures to reflect the new Written by Cursor Bugbot for commit 43775ba. This will update automatically on new commits. Configure here. |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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,
libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs
Show resolved
Hide resolved
libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs
Fixed
Show fixed
Hide fixed
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## bm/be-429-hashql-per-island-entitypath-requirements-and-fetchisland #8524 +/- ##
=======================================================================================================
+ Coverage 62.94% 62.95% +0.01%
=======================================================================================================
Files 1320 1321 +1
Lines 135105 135533 +428
Branches 5517 5521 +4
=======================================================================================================
+ Hits 85041 85328 +287
- Misses 49150 49293 +143
+ Partials 914 912 -2
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 👎 |
libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs
Show resolved
Hide resolved
6ef6d13 to
ef9b858
Compare
ef9b858 to
a91293c
Compare
libs/@local/graph/postgres-store/src/store/postgres/query/expression/conditional.rs
Show resolved
Hide resolved
922e42b to
572197c
Compare
a91293c to
43775ba
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


🌟 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?