diff --git a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/closure-generics.stdout b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/closure-generics.stdout index 905726f02a9..86484e63441 100644 --- a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/closure-generics.stdout +++ b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/closure-generics.stdout @@ -42,5 +42,5 @@ Expr#0@41 ------------------------ ------------------------ -┌─ 4 -└→ (T:0?26) -> _0 \ No newline at end of file +┌─ 4 +└→ (T:0?30) -> _0 \ No newline at end of file diff --git a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/constraints-parsing.stdout b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/constraints-parsing.stdout index 43a9a4732a5..a8ff455c7b0 100644 --- a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/constraints-parsing.stdout +++ b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/constraints-parsing.stdout @@ -3,5 +3,5 @@ Expr#4294967040@28 ------------------------ -┌─ Sortable:0 -└→ (items: List) \ No newline at end of file +┌─ Sortable:0 +└→ (items: List) \ No newline at end of file diff --git a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/generics-apply-params.stdout b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/generics-apply-params.stdout index 3350715d8ac..adf2d86486d 100644 --- a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/generics-apply-params.stdout +++ b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/generics-apply-params.stdout @@ -4,7 +4,7 @@ Expr#4294967040@42 ------------------------ ┌─ StringWrapper:0<> -└→ ([?27 = String] (foo: T:0?27),) +└→ ([?31 = String] (foo: T:0?31),) -┌─ Wrapper:0 -└→ (foo: T:0?26) \ No newline at end of file +┌─ Wrapper:0 +└→ (foo: T:0?30) \ No newline at end of file diff --git a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/generics-with-params.stdout b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/generics-with-params.stdout index ad14bfc4195..d3ea7d0c9b8 100644 --- a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/generics-with-params.stdout +++ b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/generics-with-params.stdout @@ -3,5 +3,5 @@ Expr#4294967040@23 ------------------------ -┌─ Wrapper:0 -└→ List \ No newline at end of file +┌─ Wrapper:0 +└→ List \ No newline at end of file diff --git a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/locals-generic-params-struct.stdout b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/locals-generic-params-struct.stdout index 51aaae50cf1..8509793a8cf 100644 --- a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/locals-generic-params-struct.stdout +++ b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/locals-generic-params-struct.stdout @@ -3,5 +3,5 @@ Expr#4294967040@23 ------------------------ -┌─ Box:0 -└→ (foo: T:0?26) \ No newline at end of file +┌─ Box:0 +└→ (foo: T:0?30) \ No newline at end of file diff --git a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/locals-generic-params.stdout b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/locals-generic-params.stdout index 1f8d056d45d..68075e0bf2b 100644 --- a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/locals-generic-params.stdout +++ b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/locals-generic-params.stdout @@ -3,5 +3,5 @@ Expr#4294967040@18 ------------------------ -┌─ Box:0 -└→ T:0?26 \ No newline at end of file +┌─ Box:0 +└→ T:0?30 \ No newline at end of file diff --git a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/result.stdout b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/result.stdout index 8c4f185d8f7..06d4279ccd2 100644 --- a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/result.stdout +++ b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/definition/result.stdout @@ -3,12 +3,12 @@ Expr#4294967040@76 ------------------------ -┌─ Err:0 -└→ ::main::Err:0(E:0?34) +┌─ Err:0 +└→ ::main::Err:0(E:0?38) -┌─ Ok:0 -└→ ::main::Ok:0(T:0?33) +┌─ Ok:0 +└→ ::main::Ok:0(T:0?37) -┌─ Result:0 -└→ [?31 = T:1?29] ::main::Ok:0(T:0?31) - | [?32 = E:1?30] ::main::Err:0(E:0?32) \ No newline at end of file +┌─ Result:0 +└→ [?35 = T:1?33] ::main::Ok:0(T:0?35) + | [?36 = E:1?34] ::main::Err:0(E:0?36) \ No newline at end of file diff --git a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/generic-type-resolution.stdout b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/generic-type-resolution.stdout index 424350b8ccf..b999839fedf 100644 --- a/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/generic-type-resolution.stdout +++ b/libs/@local/hashql/ast/tests/ui/lowering/type-extractor/generic-type-resolution.stdout @@ -27,9 +27,9 @@ Expr#0@48 ------------------------ -┌─ Box:0 -└→ (value: T:0?26) +┌─ Box:0 +└→ (value: T:0?30) ------------------------ -4 = [?27 = Number] (value: T:0?27) +4 = [?31 = Number] (value: T:0?31) ------------------------ \ No newline at end of file diff --git a/libs/@local/hashql/core/src/heap/allocator.rs b/libs/@local/hashql/core/src/heap/allocator.rs index c453ef7a189..6d750495a26 100644 --- a/libs/@local/hashql/core/src/heap/allocator.rs +++ b/libs/@local/hashql/core/src/heap/allocator.rs @@ -6,7 +6,11 @@ use bump_scope::{Bump, BumpBox, BumpScope}; use super::{BumpAllocator, bump::ResetAllocator}; -pub struct Checkpoint(bump_scope::Checkpoint); +#[expect( + clippy::field_scoped_visibility_modifiers, + reason = "constructed and destructured by sibling allocator types" +)] +pub struct Checkpoint(pub(super) bump_scope::Checkpoint); /// Internal arena allocator. #[derive(Debug)] @@ -155,7 +159,11 @@ unsafe impl alloc::Allocator for Allocator { } } -pub struct AllocatorScope<'scope>(BumpScope<'scope>); +#[expect( + clippy::field_scoped_visibility_modifiers, + reason = "constructed by sibling allocator types in scoped callbacks" +)] +pub struct AllocatorScope<'scope>(pub(super) BumpScope<'scope>); impl BumpAllocator for AllocatorScope<'_> { type Checkpoint = Checkpoint; diff --git a/libs/@local/hashql/core/src/heap/convert.rs b/libs/@local/hashql/core/src/heap/convert.rs index 398d95fc09e..9c930292a97 100644 --- a/libs/@local/hashql/core/src/heap/convert.rs +++ b/libs/@local/hashql/core/src/heap/convert.rs @@ -1,5 +1,6 @@ //! Allocator-aware conversion traits. +use alloc::rc::Rc; use core::alloc::Allocator; use super::CollectIn as _; @@ -58,6 +59,26 @@ impl FromIn for Box { } } +impl FromIn<&str, A> for Rc { + #[inline] + fn from_in(value: &str, allocator: A) -> Self { + // This is very much the same as Rc::from(), but without the specialization + let mut slice = Rc::new_uninit_slice_in(value.len(), allocator); + + // SAFETY: We have just created the slice, so we're guaranteed to have exclusive access. + let slice_ref = unsafe { Rc::get_mut_unchecked(&mut slice) }; + slice_ref.write_copy_of_slice(value.as_bytes()); + + // SAFETY: We have just written to the slice, so we're guaranteed to have initialized it. + let slice = unsafe { slice.assume_init() }; + + let (ptr, alloc) = Rc::into_raw_with_allocator(slice); + + // SAFETY: str has the same layout as `[u8]`, so this is safe. + unsafe { Self::from_raw_in(ptr as *const str, alloc) } + } +} + #[cfg(test)] mod tests { use super::*; @@ -109,4 +130,45 @@ mod tests { let boxed: Box = String::from("foo").into_in(&heap); assert_eq!(&*boxed, "foo"); } + + #[test] + fn str_into_rc_str() { + let heap = Heap::new(); + + let rc: Rc = "hello".into_in(&heap); + assert_eq!(&*rc, "hello"); + + let rc: Rc = Rc::from_in("world", &heap); + assert_eq!(&*rc, "world"); + } + + #[expect(clippy::non_ascii_literal)] + #[test] + fn str_into_rc_str_unicode() { + let heap = Heap::new(); + + let rc: Rc = "日本語 🎉".into_in(&heap); + assert_eq!(&*rc, "日本語 🎉"); + } + + #[test] + fn str_into_rc_str_empty() { + let heap = Heap::new(); + + let rc: Rc = "".into_in(&heap); + assert_eq!(&*rc, ""); + assert_eq!(rc.len(), 0); + } + + #[test] + fn rc_str_clone_shares_data() { + let heap = Heap::new(); + + let rc1: Rc = "shared".into_in(&heap); + let rc2 = Rc::clone(&rc1); + + assert_eq!(&*rc1, "shared"); + assert_eq!(&*rc2, "shared"); + assert!(Rc::ptr_eq(&rc1, &rc2)); + } } diff --git a/libs/@local/hashql/core/src/heap/mod.rs b/libs/@local/hashql/core/src/heap/mod.rs index 6049dfa8c6a..68360ad9803 100644 --- a/libs/@local/hashql/core/src/heap/mod.rs +++ b/libs/@local/hashql/core/src/heap/mod.rs @@ -97,6 +97,7 @@ mod bump; mod clone; mod convert; mod iter; +mod pool; mod scratch; mod transfer; @@ -110,6 +111,7 @@ pub use self::{ clone::{CloneIn, TryCloneIn}, convert::{FromIn, IntoIn}, iter::{CollectIn, FromIteratorIn}, + pool::{ScratchPool, ScratchPoolGuard}, scratch::Scratch, transfer::TransferInto, }; diff --git a/libs/@local/hashql/core/src/heap/pool.rs b/libs/@local/hashql/core/src/heap/pool.rs new file mode 100644 index 00000000000..7a7b7c64a6f --- /dev/null +++ b/libs/@local/hashql/core/src/heap/pool.rs @@ -0,0 +1,201 @@ +//! Pool of scratch allocators for parallel bump allocation. +//! +//! [`ScratchPool`] enables bump allocation across multiple threads. Each thread +//! borrows its own [`ScratchPoolGuard`] via [`get`](ScratchPool::get), which provides +//! an independent bump allocator. +//! +//! # Usage +//! +//! ``` +//! # #![feature(allocator_api)] +//! use hashql_core::heap::ScratchPool; +//! +//! let pool = ScratchPool::new(); +//! +//! let guard = pool.get(); +//! let mut vec: Vec = Vec::new_in(&guard); +//! vec.push(42); +//! ``` + +use core::{alloc, mem, ptr}; + +use bump_scope::{BumpBox, BumpPool, BumpPoolGuard}; + +use super::{AllocatorScope, BumpAllocator, allocator::Checkpoint}; + +/// A pool of scratch allocators for parallel bump allocation. +/// +/// Unlike [`Scratch`](super::Scratch) which is `!Sync`, `ScratchPool` can be shared +/// across threads. Each thread obtains its own [`ScratchPoolGuard`] via [`get`](Self::get), +/// which provides an independent bump allocator. +/// +/// # Example +/// +/// ``` +/// # #![feature(allocator_api)] +/// use hashql_core::heap::ScratchPool; +/// +/// let pool = ScratchPool::new(); +/// let guard = pool.get(); +/// +/// let mut vec: Vec = Vec::new_in(&guard); +/// vec.push(1); +/// vec.push(2); +/// ``` +pub struct ScratchPool(BumpPool); + +impl ScratchPool { + /// Creates a new empty scratch pool. + #[must_use] + #[inline] + pub fn new() -> Self { + Self(BumpPool::new()) + } + + /// Borrows an allocator from the pool. + /// + /// Each call may reuse a previously returned allocator or create a new one. + #[inline] + pub fn get(&self) -> ScratchPoolGuard<'_> { + ScratchPoolGuard(self.0.get()) + } + + /// Resets all allocators in the pool, freeing all allocations at once. + /// + /// The pool retains its current capacity. + /// + /// # Panics + /// + /// All [`ScratchPoolGuard`]s must have been dropped before calling this method. + #[inline] + pub fn reset(&mut self) { + self.0.reset(); + } +} + +impl Default for ScratchPool { + fn default() -> Self { + Self::new() + } +} + +/// A borrowed allocator from a [`ScratchPool`]. +/// +/// Implements [`BumpAllocator`] and [`Allocator`](alloc::Allocator), so it can be +/// used anywhere a bump allocator is expected. +pub struct ScratchPoolGuard<'pool>(BumpPoolGuard<'pool>); + +impl BumpAllocator for ScratchPoolGuard<'_> { + type Checkpoint = Checkpoint; + type Scoped<'scope> = AllocatorScope<'scope>; + + #[inline] + fn scoped(&mut self, func: impl FnOnce(Self::Scoped<'_>) -> T) -> T { + self.0.scoped(|scope| func(AllocatorScope(scope))) + } + + #[inline] + fn checkpoint(&self) -> Self::Checkpoint { + Checkpoint(self.0.checkpoint()) + } + + #[inline] + unsafe fn rollback(&self, checkpoint: Self::Checkpoint) { + // SAFETY: The same safety preconditions apply. + unsafe { self.0.reset_to(checkpoint.0) } + } + + #[inline] + fn try_allocate_slice_copy(&self, slice: &[T]) -> Result<&mut [T], alloc::AllocError> { + self.0 + .try_alloc_slice_copy(slice) + .map(BumpBox::leak) + .map_err(|_err| alloc::AllocError) + } + + #[inline] + fn try_allocate_slice_uninit( + &self, + len: usize, + ) -> Result<&mut [mem::MaybeUninit], alloc::AllocError> { + const { + assert!( + !core::mem::needs_drop::(), + "Cannot allocate a type that needs drop" + ); + }; + + self.0 + .try_alloc_uninit_slice(len) + .map(BumpBox::leak) + .map_err(|_err| alloc::AllocError) + } +} + +// SAFETY: Delegates to bump_scope via the internal BumpPoolGuard. +#[expect(unsafe_code, reason = "proxy to bump")] +unsafe impl alloc::Allocator for ScratchPoolGuard<'_> { + #[inline] + fn allocate(&self, layout: alloc::Layout) -> Result, alloc::AllocError> { + bump_scope::alloc::Allocator::allocate(&*self.0, layout).map_err(|_err| alloc::AllocError) + } + + #[inline] + fn allocate_zeroed( + &self, + layout: alloc::Layout, + ) -> Result, alloc::AllocError> { + bump_scope::alloc::Allocator::allocate_zeroed(&*self.0, layout) + .map_err(|_err| alloc::AllocError) + } + + #[inline] + unsafe fn deallocate(&self, ptr: ptr::NonNull, layout: alloc::Layout) { + // SAFETY: Caller upholds Allocator contract. + unsafe { + bump_scope::alloc::Allocator::deallocate(&*self.0, ptr, layout); + } + } + + #[inline] + unsafe fn grow( + &self, + ptr: ptr::NonNull, + old_layout: alloc::Layout, + new_layout: alloc::Layout, + ) -> Result, alloc::AllocError> { + // SAFETY: Caller upholds Allocator contract. + unsafe { + bump_scope::alloc::Allocator::grow(&*self.0, ptr, old_layout, new_layout) + .map_err(|_err| alloc::AllocError) + } + } + + #[inline] + unsafe fn grow_zeroed( + &self, + ptr: ptr::NonNull, + old_layout: alloc::Layout, + new_layout: alloc::Layout, + ) -> Result, alloc::AllocError> { + // SAFETY: Caller upholds Allocator contract. + unsafe { + bump_scope::alloc::Allocator::grow_zeroed(&*self.0, ptr, old_layout, new_layout) + .map_err(|_err| alloc::AllocError) + } + } + + #[inline] + unsafe fn shrink( + &self, + ptr: ptr::NonNull, + old_layout: alloc::Layout, + new_layout: alloc::Layout, + ) -> Result, alloc::AllocError> { + // SAFETY: Caller upholds Allocator contract. + unsafe { + bump_scope::alloc::Allocator::shrink(&*self.0, ptr, old_layout, new_layout) + .map_err(|_err| alloc::AllocError) + } + } +} diff --git a/libs/@local/hashql/core/src/lib.rs b/libs/@local/hashql/core/src/lib.rs index 98a62567f1b..30bcbe06294 100644 --- a/libs/@local/hashql/core/src/lib.rs +++ b/libs/@local/hashql/core/src/lib.rs @@ -33,9 +33,10 @@ slice_partition_dedup, slice_swap_unchecked, step_trait, - str_from_raw_parts, try_trait_v2, variant_count, + get_mut_unchecked, + extern_types )] extern crate alloc; diff --git a/libs/@local/hashql/core/src/module/mod.rs b/libs/@local/hashql/core/src/module/mod.rs index f97b1617874..d0b7e253255 100644 --- a/libs/@local/hashql/core/src/module/mod.rs +++ b/libs/@local/hashql/core/src/module/mod.rs @@ -9,7 +9,7 @@ pub mod item; pub mod locals; pub mod namespace; mod resolver; -mod std_lib; +pub mod std_lib; pub mod universe; use core::slice; diff --git a/libs/@local/hashql/core/src/module/std_lib/core/mod.rs b/libs/@local/hashql/core/src/module/std_lib/core/mod.rs index bdf0ce5fc2e..fae43081c6b 100644 --- a/libs/@local/hashql/core/src/module/std_lib/core/mod.rs +++ b/libs/@local/hashql/core/src/module/std_lib/core/mod.rs @@ -12,12 +12,12 @@ pub(in crate::module::std_lib) mod bool; pub(in crate::module::std_lib) mod cmp; pub(in crate::module::std_lib) mod json; pub(in crate::module::std_lib) mod math; -pub(in crate::module::std_lib) mod option; +pub mod option; pub(in crate::module::std_lib) mod result; -pub(in crate::module::std_lib) mod url; -pub(in crate::module::std_lib) mod uuid; +pub mod url; +pub mod uuid; -pub(crate) fn func<'heap>( +pub(in crate::module::std_lib) fn func<'heap>( lib: &StandardLibrary<'_, 'heap>, def: &mut ModuleDef<'heap>, diff --git a/libs/@local/hashql/core/src/module/std_lib/core/option.rs b/libs/@local/hashql/core/src/module/std_lib/core/option.rs index 60a8ca036f1..7bf46204fa5 100644 --- a/libs/@local/hashql/core/src/module/std_lib/core/option.rs +++ b/libs/@local/hashql/core/src/module/std_lib/core/option.rs @@ -1,19 +1,23 @@ use crate::{ heap::Heap, module::std_lib::{ItemDef, ModuleDef, StandardLibrary, StandardLibraryModule}, - symbol::Symbol, - r#type::TypeId, + symbol::{Symbol, sym}, }; -const NONE_ABSOLUTE_PATH: &str = "::core::option::None"; -const SOME_ABSOLUTE_PATH: &str = "::core::option::Some"; +pub mod types { + use crate::{ + symbol::sym, + r#type::{TypeBuilder, TypeId}, + }; -// create a concrete monomorphized instance of `Option` -pub(in crate::module::std_lib) fn option(lib: &StandardLibrary<'_, '_>, value: TypeId) -> TypeId { - let none = lib.ty.opaque(NONE_ABSOLUTE_PATH, lib.ty.null()); - let some = lib.ty.opaque(SOME_ABSOLUTE_PATH, value); + // create a concrete monomorphized instance of `Option` + #[must_use] + pub fn option(ty: &TypeBuilder<'_, '_>, value: TypeId) -> TypeId { + let none = ty.opaque(sym::path::None, ty.null()); + let some = ty.opaque(sym::path::Some, value); - lib.ty.union([none, some]) + ty.union([none, some]) + } } pub(in crate::module::std_lib) struct Option { @@ -32,30 +36,24 @@ impl<'heap> StandardLibraryModule<'heap> for Option { // Option is simply a union between two opaque types, when the constructor only takes a // `Null` the constructor automatically allows for no-value. - let t_arg = lib.ty.fresh_argument("T"); + let t_arg = lib.ty.fresh_argument(sym::T); let t_ref = lib.ty.hydrate_argument(t_arg); let t_param = lib.ty.param(t_arg); // newtype None = Null; - let none_ty = lib.ty.opaque(NONE_ABSOLUTE_PATH, lib.ty.null()); - def.push( - lib.heap.intern_symbol("None"), - ItemDef::newtype(lib.ty.env, none_ty, &[]), - ); + let none_ty = lib.ty.opaque(sym::path::None, lib.ty.null()); + def.push(sym::None, ItemDef::newtype(lib.ty.env, none_ty, &[])); // newtype Some = T; let some_ty = lib .ty - .generic([(t_arg, None)], lib.ty.opaque(SOME_ABSOLUTE_PATH, t_param)); - def.push( - lib.heap.intern_symbol("Some"), - ItemDef::newtype(lib.ty.env, some_ty, &[t_ref]), - ); + .generic([(t_arg, None)], lib.ty.opaque(sym::path::Some, t_param)); + def.push(sym::Some, ItemDef::newtype(lib.ty.env, some_ty, &[t_ref])); // type Option = Some | None; let option_ty = lib.ty.union([some_ty, none_ty]); def.push( - lib.heap.intern_symbol("Option"), + sym::Option, ItemDef::r#type(lib.ty.env, option_ty, &[t_ref]), ); diff --git a/libs/@local/hashql/core/src/module/std_lib/core/url.rs b/libs/@local/hashql/core/src/module/std_lib/core/url.rs index 2dbbef43520..0335472f623 100644 --- a/libs/@local/hashql/core/src/module/std_lib/core/url.rs +++ b/libs/@local/hashql/core/src/module/std_lib/core/url.rs @@ -1,9 +1,20 @@ use crate::{ heap::Heap, module::std_lib::{ItemDef, ModuleDef, StandardLibrary, StandardLibraryModule}, - symbol::Symbol, + symbol::{Symbol, sym}, }; +pub(crate) mod types { + use crate::{ + symbol::sym, + r#type::{TypeBuilder, TypeId}, + }; + + pub(crate) fn url(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::Url, ty.string()) + } +} + pub(in crate::module::std_lib) struct Url { _dependencies: (), } @@ -17,13 +28,11 @@ impl<'heap> StandardLibraryModule<'heap> for Url { fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { let mut def = ModuleDef::new(); - let heap = lib.heap; // TODO: consider making this constructor private via intrinsic (requires VM) // newtype Url = String; - let url_ty = lib.ty.opaque("::core::url::Url", lib.ty.string()); - let url = ItemDef::newtype(lib.ty.env, url_ty, &[]); - def.push(heap.intern_symbol("Url"), url); + let url_ty = types::url(&lib.ty); + def.push(sym::Url, ItemDef::newtype(lib.ty.env, url_ty, &[])); def } diff --git a/libs/@local/hashql/core/src/module/std_lib/core/uuid.rs b/libs/@local/hashql/core/src/module/std_lib/core/uuid.rs index edc2950e56a..a679193e885 100644 --- a/libs/@local/hashql/core/src/module/std_lib/core/uuid.rs +++ b/libs/@local/hashql/core/src/module/std_lib/core/uuid.rs @@ -1,9 +1,20 @@ use crate::{ heap::Heap, module::std_lib::{ItemDef, ModuleDef, StandardLibrary, StandardLibraryModule}, - symbol::Symbol, + symbol::{Symbol, sym}, }; +pub(crate) mod types { + use crate::{ + symbol::sym, + r#type::{TypeBuilder, TypeId}, + }; + + pub(crate) fn uuid(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::Uuid, ty.string()) + } +} + pub(in crate::module::std_lib) struct Uuid { _dependencies: (), } @@ -11,19 +22,17 @@ pub(in crate::module::std_lib) struct Uuid { impl<'heap> StandardLibraryModule<'heap> for Uuid { type Children = (); - fn name(heap: &'heap Heap) -> Symbol<'heap> { - heap.intern_symbol("uuid") + fn name(_: &'heap Heap) -> Symbol<'heap> { + sym::uuid } fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { let mut def = ModuleDef::new(); - let heap = lib.heap; // TODO: consider making this constructor private via intrinsic (requires VM) // newtype Uuid = String; - let uuid_ty = lib.ty.opaque("::core::uuid::Uuid", lib.ty.string()); - let uuid = ItemDef::newtype(lib.ty.env, uuid_ty, &[]); - def.push(heap.intern_symbol("Uuid"), uuid); + let uuid = ItemDef::newtype(lib.ty.env, types::uuid(&lib.ty), &[]); + def.push(sym::Uuid, uuid); def } diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/entity.rs b/libs/@local/hashql/core/src/module/std_lib/graph/entity.rs index a238122ad05..8106254199a 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/entity.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/entity.rs @@ -5,7 +5,7 @@ use crate::{ locals::TypeDef, std_lib::{ self, ModuleDef, StandardLibraryModule, - core::{func, option::option}, + core::{func, option::types::option}, decl, }, }, @@ -59,7 +59,7 @@ impl<'heap> StandardLibraryModule<'heap> for Entity { let decl = decl!(lib; (entity: lib.ty.apply([(entity_ty.arguments[0].id, T)], entity_ty.id), path: json_path_ty.id - ) -> option(lib, lib.ty.unknown()) + ) -> option(&lib.ty, lib.ty.unknown()) ); func(lib, &mut def, "::graph::entity::property", &[], decl); diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/head.rs b/libs/@local/hashql/core/src/module/std_lib/graph/head.rs index 87dc1c3a851..a157436cf54 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/head.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/head.rs @@ -5,12 +5,13 @@ use crate::{ locals::TypeDef, std_lib::{self, ModuleDef, StandardLibraryModule, core::func, decl}, }, - symbol::Symbol, + symbol::{Symbol, sym}, }; pub(in crate::module::std_lib) struct Head { _dependencies: ( std_lib::graph::Graph, + std_lib::graph::temporal::Temporal, std_lib::graph::types::knowledge::entity::Entity, ), } @@ -26,10 +27,13 @@ impl<'heap> StandardLibraryModule<'heap> for Head { let mut def = ModuleDef::new(); let heap = lib.heap; - let graph = lib.manifest::(); + let query_temporal_axes_ty = lib + .manifest::() + .expect_type(sym::QueryTemporalAxes); - let query_temporal_axes_ty = graph.expect_type(heap.intern_symbol("QueryTemporalAxes")); - let mut graph_ty = graph.expect_type(heap.intern_symbol("Graph")); + let mut graph_ty = lib + .manifest::() + .expect_type(heap.intern_symbol("Graph")); graph_ty.instantiate(&mut lib.instantiate); let mut entity = lib diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/mod.rs b/libs/@local/hashql/core/src/module/std_lib/graph/mod.rs index ecb68b6cb2b..7d6a3380645 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/mod.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/mod.rs @@ -2,8 +2,9 @@ pub(in crate::module::std_lib) mod body; pub(in crate::module::std_lib) mod entity; pub(in crate::module::std_lib) mod head; pub(in crate::module::std_lib) mod tail; +pub mod temporal; pub(in crate::module::std_lib) mod tmp; -pub(in crate::module::std_lib) mod types; +pub mod types; use crate::{ heap::Heap, @@ -12,7 +13,6 @@ use crate::{ std_lib::{ItemDef, ModuleDef, StandardLibraryModule}, }, symbol::Symbol, - r#type::{TypeId, kind::generic::GenericArgumentId}, }; pub(in crate::module::std_lib) struct Graph { @@ -21,6 +21,7 @@ pub(in crate::module::std_lib) struct Graph { impl<'heap> StandardLibraryModule<'heap> for Graph { type Children = ( + self::temporal::Temporal, self::head::Head, self::body::Body, self::tail::Tail, @@ -58,25 +59,6 @@ impl<'heap> StandardLibraryModule<'heap> for Graph { ItemDef::r#type(lib.ty.env, graph_ty, &[t_ref]), ); - // newtype TimeAxis = (:) - // - // Currently implemented as an empty opaque type. This will be enhanced to support - // user construction in the future. - // see: https://linear.app/hash/issue/H-4736/hashql-make-time-axis-constructible - let time_axis_ty = lib.ty.generic( - [] as [GenericArgumentId; 0], - lib.ty.opaque( - "::graph::TimeAxis", - lib.ty.r#struct([] as [(&str, TypeId); 0]), - ), - ); - def.push( - lib.heap.intern_symbol("QueryTemporalAxes"), - // Export as `type` rather than `newtype` since TimeAxis is currently not - // user-constructible - ItemDef::r#type(lib.ty.env, time_axis_ty, &[]), - ); - def } } diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/temporal.rs b/libs/@local/hashql/core/src/module/std_lib/graph/temporal.rs new file mode 100644 index 00000000000..26729210137 --- /dev/null +++ b/libs/@local/hashql/core/src/module/std_lib/graph/temporal.rs @@ -0,0 +1,285 @@ +use crate::{ + heap::Heap, + module::std_lib::{ItemDef, ModuleDef, StandardLibrary, StandardLibraryModule}, + symbol::{Symbol, sym}, +}; + +pub mod types { + use crate::{ + symbol::sym, + r#type::{TypeBuilder, TypeId}, + }; + + #[must_use] + pub fn timestamp(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::Timestamp, ty.integer()) + } + + #[must_use] + pub fn unbounded_temporal_bound(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::UnboundedTemporalBound, ty.null()) + } + + #[must_use] + pub fn inclusive_temporal_bound(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::InclusiveTemporalBound, self::timestamp(ty)) + } + + #[must_use] + pub fn exclusive_temporal_bound(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::ExclusiveTemporalBound, self::timestamp(ty)) + } + + #[must_use] + pub fn temporal_bound(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.union([ + self::unbounded_temporal_bound(ty), + self::inclusive_temporal_bound(ty), + self::exclusive_temporal_bound(ty), + ]) + } + + #[must_use] + pub fn finite_temporal_bound(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.union([ + self::inclusive_temporal_bound(ty), + self::exclusive_temporal_bound(ty), + ]) + } + + // newtype DecisionTime = T + #[must_use] + pub fn decision_time(ty: &TypeBuilder<'_, '_>, inner: TypeId) -> TypeId { + ty.opaque(sym::path::DecisionTime, inner) + } + + // newtype TransactionTime = T + #[must_use] + pub fn transaction_time(ty: &TypeBuilder<'_, '_>, inner: TypeId) -> TypeId { + ty.opaque(sym::path::TransactionTime, inner) + } + + /// `newtype Interval = (start: S, end: E)`. + /// + /// Generic over the start and end bound types. Callers pass concrete types + /// to monomorphize (e.g. `InclusiveTemporalBound` for start, + /// `OpenTemporalBound` for end). + #[must_use] + pub fn interval(ty: &TypeBuilder<'_, '_>, start: TypeId, end: TypeId) -> TypeId { + ty.opaque( + sym::path::Interval, + ty.r#struct([(sym::start, start), (sym::end, end)]), + ) + } + + /// `type OpenTemporalBound = ExclusiveTemporalBound | UnboundedTemporalBound`. + #[must_use] + pub fn open_temporal_bound(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.union([ + self::exclusive_temporal_bound(ty), + self::unbounded_temporal_bound(ty), + ]) + } + + /// `type LeftClosedTemporalInterval = Interval`. + #[must_use] + pub fn left_closed_temporal_interval(ty: &TypeBuilder<'_, '_>) -> TypeId { + self::interval( + ty, + self::inclusive_temporal_bound(ty), + self::open_temporal_bound(ty), + ) + } + + /// `type RightBoundedTemporalInterval = Interval`. + #[must_use] + pub fn right_bounded_temporal_interval(ty: &TypeBuilder<'_, '_>) -> TypeId { + self::interval( + ty, + self::temporal_bound(ty), + self::finite_temporal_bound(ty), + ) + } +} + +pub(in crate::module::std_lib) struct Temporal { + _dependencies: (), +} + +impl<'heap> StandardLibraryModule<'heap> for Temporal { + type Children = (); + + fn name(_heap: &'heap Heap) -> Symbol<'heap> { + sym::temporal + } + + #[expect(clippy::too_many_lines, clippy::similar_names)] + fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { + let mut def = ModuleDef::new(); + + // newtype Timestamp = Integer + // + // TODO: replace with a dedicated primitive type in the future. + let timestamp_ty = types::timestamp(&lib.ty); + def.push( + sym::Timestamp, + ItemDef::newtype(lib.ty.env, timestamp_ty, &[]), + ); + + // newtype DecisionTime = T + let dt_t_arg = lib.ty.fresh_argument(sym::T); + let dt_t_ref = lib.ty.hydrate_argument(dt_t_arg); + let dt_t_param = lib.ty.param(dt_t_arg); + + let decision_time_ty = lib.ty.generic( + [(dt_t_arg, None)], + types::decision_time(&lib.ty, dt_t_param), + ); + def.push( + sym::DecisionTime, + ItemDef::newtype(lib.ty.env, decision_time_ty, &[dt_t_ref]), + ); + + // newtype TransactionTime = T + let tt_t_arg = lib.ty.fresh_argument(sym::T); + let tt_t_ref = lib.ty.hydrate_argument(tt_t_arg); + let tt_t_param = lib.ty.param(tt_t_arg); + + let transaction_time_ty = lib.ty.generic( + [(tt_t_arg, None)], + types::transaction_time(&lib.ty, tt_t_param), + ); + def.push( + sym::TransactionTime, + ItemDef::newtype(lib.ty.env, transaction_time_ty, &[tt_t_ref]), + ); + + // newtype UnboundedTemporalBound = Null + let unbounded_bound_ty = types::unbounded_temporal_bound(&lib.ty); + def.push( + sym::UnboundedTemporalBound, + ItemDef::newtype(lib.ty.env, unbounded_bound_ty, &[]), + ); + + // newtype InclusiveTemporalBound = Timestamp + let inclusive_bound_ty = types::inclusive_temporal_bound(&lib.ty); + def.push( + sym::InclusiveTemporalBound, + ItemDef::newtype(lib.ty.env, inclusive_bound_ty, &[]), + ); + + // newtype ExclusiveTemporalBound = Timestamp + let exclusive_bound_ty = types::exclusive_temporal_bound(&lib.ty); + def.push( + sym::ExclusiveTemporalBound, + ItemDef::newtype(lib.ty.env, exclusive_bound_ty, &[]), + ); + + // type TemporalBound = UnboundedTemporalBound | InclusiveTemporalBound + // | ExclusiveTemporalBound + let temporal_bound_ty = + lib.ty + .union([unbounded_bound_ty, inclusive_bound_ty, exclusive_bound_ty]); + def.push( + sym::TemporalBound, + ItemDef::r#type(lib.ty.env, temporal_bound_ty, &[]), + ); + + // type FiniteTemporalBound = InclusiveTemporalBound | ExclusiveTemporalBound + let finite_bound_ty = lib.ty.union([inclusive_bound_ty, exclusive_bound_ty]); + def.push( + sym::FiniteTemporalBound, + ItemDef::r#type(lib.ty.env, finite_bound_ty, &[]), + ); + + // type OpenTemporalBound = ExclusiveTemporalBound | UnboundedTemporalBound + let open_bound_ty = lib.ty.union([exclusive_bound_ty, unbounded_bound_ty]); + def.push( + sym::OpenTemporalBound, + ItemDef::r#type(lib.ty.env, open_bound_ty, &[]), + ); + + // newtype Interval = (start: S, end: E) + let interval_s_arg = lib.ty.fresh_argument(sym::S); + let interval_s_ref = lib.ty.hydrate_argument(interval_s_arg); + let interval_s_param = lib.ty.param(interval_s_arg); + + let interval_e_arg = lib.ty.fresh_argument(sym::E); + let interval_e_ref = lib.ty.hydrate_argument(interval_e_arg); + let interval_e_param = lib.ty.param(interval_e_arg); + + let interval_ty = lib.ty.generic( + [(interval_s_arg, None), (interval_e_arg, None)], + types::interval(&lib.ty, interval_s_param, interval_e_param), + ); + def.push( + sym::Interval, + ItemDef::newtype(lib.ty.env, interval_ty, &[interval_s_ref, interval_e_ref]), + ); + + // type LeftClosedTemporalInterval = + // Interval + let left_closed_interval_ty = types::interval(&lib.ty, inclusive_bound_ty, open_bound_ty); + def.push( + sym::LeftClosedTemporalInterval, + ItemDef::r#type(lib.ty.env, left_closed_interval_ty, &[]), + ); + + // type RightBoundedTemporalInterval = + // Interval + let right_bounded_interval_ty = + types::interval(&lib.ty, temporal_bound_ty, finite_bound_ty); + def.push( + sym::RightBoundedTemporalInterval, + ItemDef::r#type(lib.ty.env, right_bounded_interval_ty, &[]), + ); + + // newtype PinnedTransactionTimeTemporalAxes = ( + // pinned: TransactionTime, + // variable: DecisionTime, + // ) + let pinned_tx_ty = lib.ty.opaque( + sym::path::PinnedTransactionTimeTemporalAxes, + lib.ty.r#struct([ + (sym::pinned, types::transaction_time(&lib.ty, timestamp_ty)), + ( + sym::variable, + types::decision_time(&lib.ty, right_bounded_interval_ty), + ), + ]), + ); + def.push( + sym::PinnedTransactionTimeTemporalAxes, + ItemDef::newtype(lib.ty.env, pinned_tx_ty, &[]), + ); + + // newtype PinnedDecisionTimeTemporalAxes = ( + // pinned: DecisionTime, + // variable: TransactionTime, + // ) + let pinned_dt_ty = lib.ty.opaque( + sym::path::PinnedDecisionTimeTemporalAxes, + lib.ty.r#struct([ + (sym::pinned, types::decision_time(&lib.ty, timestamp_ty)), + ( + sym::variable, + types::transaction_time(&lib.ty, right_bounded_interval_ty), + ), + ]), + ); + def.push( + sym::PinnedDecisionTimeTemporalAxes, + ItemDef::newtype(lib.ty.env, pinned_dt_ty, &[]), + ); + + // type QueryTemporalAxes = PinnedTransactionTimeTemporalAxes + // | PinnedDecisionTimeTemporalAxes + let query_temporal_axes_ty = lib.ty.union([pinned_tx_ty, pinned_dt_ty]); + def.push( + sym::QueryTemporalAxes, + ItemDef::r#type(lib.ty.env, query_temporal_axes_ty, &[]), + ); + + def + } +} diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/tmp.rs b/libs/@local/hashql/core/src/module/std_lib/graph/tmp.rs index ef113a6836f..e9bfed600b5 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/tmp.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/tmp.rs @@ -5,12 +5,12 @@ use crate::{ locals::TypeDef, std_lib::{self, ModuleDef, StandardLibraryModule, core::func}, }, - symbol::Symbol, + symbol::{Symbol, sym}, r#type::TypeId, }; pub(in crate::module::std_lib) struct Tmp { - _dependencies: (std_lib::graph::Graph,), + _dependencies: (std_lib::graph::temporal::Temporal,), } impl<'heap> StandardLibraryModule<'heap> for Tmp { @@ -22,11 +22,10 @@ impl<'heap> StandardLibraryModule<'heap> for Tmp { fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { let mut def = ModuleDef::new(); - let heap = lib.heap; let query_temporal_axes_ty = lib - .manifest::() - .expect_type(heap.intern_symbol("QueryTemporalAxes")); + .manifest::() + .expect_type(sym::QueryTemporalAxes); // ::graph::tmp::decision_time_now() -> TimeAxis func( diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/entity.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/entity.rs index 375c4591b76..dd5b0f19e26 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/entity.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/entity.rs @@ -2,292 +2,545 @@ use crate::{ heap::Heap, module::{ StandardLibrary, - std_lib::{self, ItemDef, ModuleDef, StandardLibraryModule, core::option::option}, + std_lib::{self, ItemDef, ModuleDef, StandardLibraryModule}, }, symbol::{Symbol, sym}, }; +pub mod types { + use crate::{ + module::std_lib::{self, core::option::types::option}, + symbol::sym, + r#type::{TypeBuilder, TypeId}, + }; + + // newtype EntityUuid = Uuid; + pub struct EntityUuidDependencies { + pub uuid: TypeId, + } + + #[must_use] + pub fn entity_uuid(ty: &TypeBuilder<'_, '_>, deps: Option) -> TypeId { + let EntityUuidDependencies { uuid } = deps.unwrap_or_else(|| EntityUuidDependencies { + uuid: std_lib::core::uuid::types::uuid(ty), + }); + + ty.opaque(sym::path::EntityUuid, uuid) + } + + // newtype DraftId = Uuid; + pub struct DraftIdDependencies { + pub uuid: TypeId, + } + + #[must_use] + pub fn draft_id(ty: &TypeBuilder<'_, '_>, deps: Option) -> TypeId { + let DraftIdDependencies { uuid } = deps.unwrap_or_else(|| DraftIdDependencies { + uuid: std_lib::core::uuid::types::uuid(ty), + }); + + ty.opaque(sym::path::DraftId, uuid) + } + + // newtype EntityEditionId = Uuid; + pub struct EntityEditionIdDependencies { + pub uuid: TypeId, + } + + #[must_use] + pub fn entity_edition_id( + ty: &TypeBuilder<'_, '_>, + deps: Option, + ) -> TypeId { + let EntityEditionIdDependencies { uuid } = + deps.unwrap_or_else(|| EntityEditionIdDependencies { + uuid: std_lib::core::uuid::types::uuid(ty), + }); + + ty.opaque(sym::path::EntityEditionId, uuid) + } + + // newtype EntityId = (web_id: WebId, entity_uuid: EntityUuid, draft_id: Option) + pub struct EntityIdDependencies { + pub web_id: TypeId, + pub entity_uuid: TypeId, + pub draft_id: TypeId, + } + + #[must_use] + pub fn entity_id(ty: &TypeBuilder<'_, '_>, deps: Option) -> TypeId { + let EntityIdDependencies { + web_id, + entity_uuid, + draft_id, + } = deps.unwrap_or_else(|| EntityIdDependencies { + web_id: std_lib::graph::types::principal::actor_group::web::types::web_id(ty, None), + entity_uuid: self::entity_uuid(ty, None), + draft_id: self::draft_id(ty, None), + }); + + ty.opaque( + sym::path::EntityId, + ty.r#struct([ + (sym::web_id, web_id), + (sym::entity_uuid, entity_uuid), + (sym::draft_id, option(ty, draft_id)), + ]), + ) + } + + // newtype RecordId = (entity_id: EntityId, edition_id: EntityEditionId) + pub struct RecordIdDependencies { + pub entity_id: TypeId, + pub edition_id: TypeId, + } + + #[must_use] + pub fn record_id(ty: &TypeBuilder<'_, '_>, deps: Option) -> TypeId { + let RecordIdDependencies { + entity_id, + edition_id, + } = deps.unwrap_or_else(|| RecordIdDependencies { + entity_id: self::entity_id(ty, None), + edition_id: self::entity_edition_id(ty, None), + }); + + ty.opaque( + sym::path::RecordId, + ty.r#struct([(sym::entity_id, entity_id), (sym::edition_id, edition_id)]), + ) + } + + // newtype TemporalMetadata = ( + // decision_time: DecisionTime, + // transaction_time: TransactionTime, + // ) + pub struct TemporalMetadataDependencies { + pub interval: TypeId, + } + + #[must_use] + pub fn temporal_metadata( + ty: &TypeBuilder<'_, '_>, + deps: Option, + ) -> TypeId { + let TemporalMetadataDependencies { interval } = + deps.unwrap_or_else(|| TemporalMetadataDependencies { + interval: std_lib::graph::temporal::types::left_closed_temporal_interval(ty), + }); + + ty.opaque( + sym::path::TemporalMetadata, + ty.r#struct([ + ( + sym::decision_time, + std_lib::graph::temporal::types::decision_time(ty, interval), + ), + ( + sym::transaction_time, + std_lib::graph::temporal::types::transaction_time(ty, interval), + ), + ]), + ) + } + + // newtype Confidence = Number + #[must_use] + pub fn confidence(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::Confidence, ty.number()) + } + + // newtype InferredEntityProvenance = Unknown + // + // JSONB blob in `entity_ids.provenance`. Contains `created_by_id`, + // `created_at_transaction_time`, `created_at_decision_time`, and optional + // `first_non_draft_created_at_*` timestamps. + #[must_use] + pub fn inferred_entity_provenance(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::InferredEntityProvenance, ty.unknown()) + } + + // newtype EntityEditionProvenance = Unknown + // + // JSONB blob in `entity_editions.provenance`. Contains `created_by_id`, + // optional `archived_by_id`, `actor_type`, `OriginProvenance`, and + // `Vec`. + #[must_use] + pub fn entity_edition_provenance(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::EntityEditionProvenance, ty.unknown()) + } + + // newtype EntityProvenance = ( + // inferred: InferredEntityProvenance, + // edition: EntityEditionProvenance, + // ) + pub struct EntityProvenanceDependencies { + pub inferred: TypeId, + pub edition: TypeId, + } + + #[must_use] + pub fn entity_provenance( + ty: &TypeBuilder<'_, '_>, + deps: Option, + ) -> TypeId { + let EntityProvenanceDependencies { inferred, edition } = + deps.unwrap_or_else(|| EntityProvenanceDependencies { + inferred: self::inferred_entity_provenance(ty), + edition: self::entity_edition_provenance(ty), + }); + + ty.opaque( + sym::path::EntityProvenance, + ty.r#struct([(sym::inferred, inferred), (sym::edition, edition)]), + ) + } + + // newtype PropertyProvenance = Unknown + // + // JSONB blob on entity edges (`entity_edge.provenance`). Just + // `Vec`. + #[must_use] + pub fn property_provenance(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::PropertyProvenance, ty.unknown()) + } + + // newtype PropertyObjectMetadata = Unknown + // + // JSONB blob in `entity_editions.property_metadata`. Contains per-property-key + // metadata (confidence, provenance) rather than property values. + #[must_use] + pub fn property_object_metadata(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::PropertyObjectMetadata, ty.unknown()) + } + + // newtype EntityMetadata = ( + // record_id: EntityRecordId, + // temporal_versioning: EntityTemporalMetadata, + // entity_type_ids: List, + // archived: Boolean, + // provenance: EntityProvenance, + // confidence: Option, + // properties: PropertyObjectMetadata, + // ) + pub struct EntityMetadataDependencies { + pub record_id: TypeId, + pub temporal_versioning: TypeId, + pub entity_type_ids: TypeId, + pub provenance: TypeId, + pub confidence: TypeId, + pub properties: TypeId, + } + + #[must_use] + pub fn entity_metadata( + ty: &TypeBuilder<'_, '_>, + deps: Option, + ) -> TypeId { + let EntityMetadataDependencies { + record_id, + temporal_versioning, + entity_type_ids, + provenance, + confidence, + properties, + } = deps.unwrap_or_else(|| EntityMetadataDependencies { + record_id: self::record_id(ty, None), + temporal_versioning: self::temporal_metadata(ty, None), + entity_type_ids: ty.list(std_lib::graph::types::ontology::types::versioned_url( + ty, None, + )), + provenance: self::entity_provenance(ty, None), + confidence: self::confidence(ty), + properties: self::property_object_metadata(ty), + }); + + ty.opaque( + sym::path::EntityMetadata, + ty.r#struct([ + (sym::record_id, record_id), + (sym::temporal_versioning, temporal_versioning), + (sym::entity_type_ids, entity_type_ids), + (sym::archived, ty.boolean()), + (sym::provenance, provenance), + (sym::confidence, option(ty, confidence)), + (sym::properties, properties), + ]), + ) + } + + // newtype LinkData = ( + // left_entity_id: EntityId, + // right_entity_id: EntityId, + // left_entity_confidence: Option, + // left_entity_provenance: PropertyProvenance, + // right_entity_confidence: Option, + // right_entity_provenance: PropertyProvenance, + // ) + pub struct LinkDataDependencies { + pub entity_id: TypeId, + pub confidence: TypeId, + pub property_provenance: TypeId, + } + + #[must_use] + pub fn link_data(ty: &TypeBuilder<'_, '_>, deps: Option) -> TypeId { + let LinkDataDependencies { + entity_id, + confidence, + property_provenance, + } = deps.unwrap_or_else(|| LinkDataDependencies { + entity_id: self::entity_id(ty, None), + confidence: self::confidence(ty), + property_provenance: self::property_provenance(ty), + }); + + ty.opaque( + sym::path::LinkData, + ty.r#struct([ + (sym::left_entity_id, entity_id), + (sym::right_entity_id, entity_id), + (sym::left_entity_confidence, option(ty, confidence)), + (sym::left_entity_provenance, property_provenance), + (sym::right_entity_confidence, option(ty, confidence)), + (sym::right_entity_provenance, property_provenance), + ]), + ) + } + + // newtype EntityEncodings = (vectors: Unknown) + // + // The graph API doesn't expose encodings yet, but the storage layer already has + // them. The `?` inner type is correct; the encoding format is opaque to the + // type system. + #[must_use] + pub fn entity_encodings(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque( + sym::path::EntityEncodings, + ty.r#struct([(sym::vectors, ty.unknown())]), + ) + } + + // newtype Entity = ( + // properties: T, + // link_data: Option, + // metadata: EntityMetadata, + // encodings: EntityEncodings, + // ) + pub struct EntityDependencies { + pub link_data: TypeId, + pub metadata: TypeId, + pub encodings: TypeId, + } + + #[must_use] + pub fn entity( + ty: &TypeBuilder<'_, '_>, + properties: TypeId, + deps: Option, + ) -> TypeId { + let EntityDependencies { + link_data, + metadata, + encodings, + } = deps.unwrap_or_else(|| EntityDependencies { + link_data: self::link_data(ty, None), + metadata: self::entity_metadata(ty, None), + encodings: self::entity_encodings(ty), + }); + + ty.opaque( + sym::path::Entity, + ty.r#struct([ + (sym::properties, properties), + (sym::link_data, option(ty, link_data)), + (sym::metadata, metadata), + (sym::encodings, encodings), + ]), + ) + } +} + pub(in crate::module::std_lib) struct Entity { _dependencies: ( std_lib::core::uuid::Uuid, std_lib::graph::types::principal::actor_group::web::Web, std_lib::graph::types::ontology::Ontology, + std_lib::graph::temporal::Temporal, ), } impl<'heap> StandardLibraryModule<'heap> for Entity { type Children = (); - fn name(heap: &'heap Heap) -> Symbol<'heap> { - heap.intern_symbol("entity") + fn name(_: &'heap Heap) -> Symbol<'heap> { + sym::entity } #[expect(clippy::too_many_lines)] fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { let mut def = ModuleDef::new(); - let heap = lib.heap; - // newtype EntityUuid = Uuid; let uuid_ty = lib .manifest::() - .expect_newtype(heap.intern_symbol("Uuid")); - let entity_uuid_ty = lib - .ty - .opaque("::graph::types::knowledge::entity::EntityUuid", uuid_ty.id); - def.push( - heap.intern_symbol("EntityUuid"), - ItemDef::newtype(lib.ty.env, entity_uuid_ty, &[]), - ); + .expect_newtype(sym::Uuid) + .id; + let web_id_ty = lib + .manifest::() + .expect_newtype(sym::WebId) + .id; + let versioned_url_ty = lib + .manifest::() + .expect_newtype(sym::VersionedUrl) + .id; + let left_closed_interval_ty = lib + .manifest::() + .expect_type(sym::LeftClosedTemporalInterval) + .id; - // newtype DraftId = Uuid; - let draft_id_ty = lib - .ty - .opaque("::graph::types::knowledge::entity::DraftId", uuid_ty.id); - def.push( - heap.intern_symbol("DraftId"), - ItemDef::newtype(lib.ty.env, draft_id_ty, &[]), - ); + let ty = &lib.ty; - // newtype EntityEditionId = Uuid; - let entity_edition_id_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::EntityEditionId", - uuid_ty.id, - ); + let entity_uuid_ty = + types::entity_uuid(ty, Some(types::EntityUuidDependencies { uuid: uuid_ty })); def.push( - heap.intern_symbol("EntityEditionId"), - ItemDef::newtype(lib.ty.env, entity_edition_id_ty, &[]), + sym::EntityUuid, + ItemDef::newtype(ty.env, entity_uuid_ty, &[]), ); - // newtype EntityId = (web_id: WebId, entity_uuid: EntityUuid, draft_id: Option) - let web_id = lib - .manifest::() - .expect_newtype(heap.intern_symbol("WebId")); - let entity_id_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::EntityId", - lib.ty.r#struct([ - ("web_id", web_id.id), - ("entity_uuid", entity_uuid_ty), - ("draft_id", option(lib, draft_id_ty)), - ]), - ); - def.push( - heap.intern_symbol("EntityId"), - ItemDef::newtype(lib.ty.env, entity_id_ty, &[]), - ); + let draft_id_ty = types::draft_id(ty, Some(types::DraftIdDependencies { uuid: uuid_ty })); + def.push(sym::DraftId, ItemDef::newtype(ty.env, draft_id_ty, &[])); - // newtype EntityRecordId = (entity_id: EntityId, edition_id: EntityEditionId) - let entity_record_id_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::EntityRecordId", - lib.ty.r#struct([ - ("entity_id", entity_id_ty), - ("edition_id", entity_edition_id_ty), - ]), + let entity_edition_id_ty = types::entity_edition_id( + ty, + Some(types::EntityEditionIdDependencies { uuid: uuid_ty }), ); def.push( - heap.intern_symbol("EntityRecordId"), - ItemDef::newtype(lib.ty.env, entity_record_id_ty, &[]), + sym::EntityEditionId, + ItemDef::newtype(ty.env, entity_edition_id_ty, &[]), ); - // newtype TemporalInterval = Unknown - // - // Opaque wrapper for `LeftClosedTemporalInterval`. The internal structure (start bound, - // end bound) is not exposed to the HashQL type system; the placement resolver only needs - // the field name prefix (`temporal_versioning.decision_time`). - let temporal_interval_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::TemporalInterval", - lib.ty.unknown(), - ); - def.push( - heap.intern_symbol("TemporalInterval"), - ItemDef::newtype(lib.ty.env, temporal_interval_ty, &[]), - ); + let entity_id_ty = types::entity_id( + ty, + Some(types::EntityIdDependencies { + web_id: web_id_ty, + entity_uuid: entity_uuid_ty, + draft_id: draft_id_ty, + }), + ); + def.push(sym::EntityId, ItemDef::newtype(ty.env, entity_id_ty, &[])); - // newtype EntityTemporalMetadata = ( - // decision_time: TemporalInterval, - // transaction_time: TemporalInterval, - // ) - let temporal_metadata_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::EntityTemporalMetadata", - lib.ty.r#struct([ - ("decision_time", temporal_interval_ty), - ("transaction_time", temporal_interval_ty), - ]), - ); - def.push( - heap.intern_symbol("EntityTemporalMetadata"), - ItemDef::newtype(lib.ty.env, temporal_metadata_ty, &[]), - ); + let record_id_ty = types::record_id( + ty, + Some(types::RecordIdDependencies { + entity_id: entity_id_ty, + edition_id: entity_edition_id_ty, + }), + ); + def.push(sym::RecordId, ItemDef::newtype(ty.env, record_id_ty, &[])); - // newtype Confidence = Number - let confidence_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::Confidence", - lib.ty.number(), + let temporal_metadata_ty = types::temporal_metadata( + ty, + Some(types::TemporalMetadataDependencies { + interval: left_closed_interval_ty, + }), ); def.push( - heap.intern_symbol("Confidence"), - ItemDef::newtype(lib.ty.env, confidence_ty, &[]), + sym::TemporalMetadata, + ItemDef::newtype(ty.env, temporal_metadata_ty, &[]), ); - // newtype InferredEntityProvenance = Unknown - // - // JSONB blob in `entity_ids.provenance`. Contains `created_by_id`, - // `created_at_transaction_time`, `created_at_decision_time`, and optional - // `first_non_draft_created_at_*` timestamps. - let inferred_provenance_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::InferredEntityProvenance", - lib.ty.unknown(), - ); + let confidence_ty = types::confidence(ty); def.push( - heap.intern_symbol("InferredEntityProvenance"), - ItemDef::newtype(lib.ty.env, inferred_provenance_ty, &[]), + sym::Confidence, + ItemDef::newtype(ty.env, confidence_ty, &[]), ); - // newtype EntityEditionProvenance = Unknown - // - // JSONB blob in `entity_editions.provenance`. Contains `created_by_id`, - // optional `archived_by_id`, `actor_type`, `OriginProvenance`, and - // `Vec`. - let edition_provenance_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::EntityEditionProvenance", - lib.ty.unknown(), - ); + let inferred_provenance_ty = types::inferred_entity_provenance(ty); def.push( - heap.intern_symbol("EntityEditionProvenance"), - ItemDef::newtype(lib.ty.env, edition_provenance_ty, &[]), + sym::InferredEntityProvenance, + ItemDef::newtype(ty.env, inferred_provenance_ty, &[]), ); - // newtype EntityProvenance = ( - // inferred: InferredEntityProvenance, - // edition: EntityEditionProvenance, - // ) - let entity_provenance_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::EntityProvenance", - lib.ty.r#struct([ - ("inferred", inferred_provenance_ty), - ("edition", edition_provenance_ty), - ]), - ); + let edition_provenance_ty = types::entity_edition_provenance(ty); def.push( - heap.intern_symbol("EntityProvenance"), - ItemDef::newtype(lib.ty.env, entity_provenance_ty, &[]), + sym::EntityEditionProvenance, + ItemDef::newtype(ty.env, edition_provenance_ty, &[]), ); - // newtype PropertyProvenance = Unknown - // - // JSONB blob on entity edges (`entity_edge.provenance`). Just - // `Vec`. - let property_provenance_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::PropertyProvenance", - lib.ty.unknown(), + let entity_provenance_ty = types::entity_provenance( + ty, + Some(types::EntityProvenanceDependencies { + inferred: inferred_provenance_ty, + edition: edition_provenance_ty, + }), ); def.push( - heap.intern_symbol("PropertyProvenance"), - ItemDef::newtype(lib.ty.env, property_provenance_ty, &[]), + sym::EntityProvenance, + ItemDef::newtype(ty.env, entity_provenance_ty, &[]), ); - // newtype PropertyObjectMetadata = Unknown - // - // JSONB blob in `entity_editions.property_metadata`. Contains per-property-key - // metadata (confidence, provenance) rather than property values. - let property_object_metadata_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::PropertyObjectMetadata", - lib.ty.unknown(), - ); + let property_provenance_ty = types::property_provenance(ty); def.push( - heap.intern_symbol("PropertyObjectMetadata"), - ItemDef::newtype(lib.ty.env, property_object_metadata_ty, &[]), + sym::PropertyProvenance, + ItemDef::newtype(ty.env, property_provenance_ty, &[]), ); - // newtype EntityMetadata = ( - // record_id: EntityRecordId, - // temporal_versioning: EntityTemporalMetadata, - // entity_type_ids: List, - // archived: Boolean, - // provenance: EntityProvenance, - // confidence: Option, - // properties: PropertyObjectMetadata, - // ) - let versioned_url = lib - .manifest::() - .expect_newtype(heap.intern_symbol("VersionedUrl")); - let entity_metadata_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::EntityMetadata", - lib.ty.r#struct([ - ("record_id", entity_record_id_ty), - ("temporal_versioning", temporal_metadata_ty), - ("entity_type_ids", lib.ty.list(versioned_url.id)), - ("archived", lib.ty.boolean()), - ("provenance", entity_provenance_ty), - ("confidence", option(lib, confidence_ty)), - ("properties", property_object_metadata_ty), - ]), - ); + let property_object_metadata_ty = types::property_object_metadata(ty); def.push( - heap.intern_symbol("EntityMetadata"), - ItemDef::newtype(lib.ty.env, entity_metadata_ty, &[]), + sym::PropertyObjectMetadata, + ItemDef::newtype(ty.env, property_object_metadata_ty, &[]), ); - // newtype LinkData = ( - // left_entity_id: EntityId, - // right_entity_id: EntityId, - // left_entity_confidence: Option, - // left_entity_provenance: PropertyProvenance, - // right_entity_confidence: Option, - // right_entity_provenance: PropertyProvenance, - // ) - let link_data_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::LinkData", - lib.ty.r#struct([ - ("left_entity_id", entity_id_ty), - ("right_entity_id", entity_id_ty), - ("left_entity_confidence", option(lib, confidence_ty)), - ("left_entity_provenance", property_provenance_ty), - ("right_entity_confidence", option(lib, confidence_ty)), - ("right_entity_provenance", property_provenance_ty), - ]), + let entity_metadata_ty = types::entity_metadata( + ty, + Some(types::EntityMetadataDependencies { + record_id: record_id_ty, + temporal_versioning: temporal_metadata_ty, + entity_type_ids: ty.list(versioned_url_ty), + provenance: entity_provenance_ty, + confidence: confidence_ty, + properties: property_object_metadata_ty, + }), ); def.push( - heap.intern_symbol("LinkData"), - ItemDef::newtype(lib.ty.env, link_data_ty, &[]), + sym::EntityMetadata, + ItemDef::newtype(ty.env, entity_metadata_ty, &[]), ); - // newtype EntityEncodings = (vectors: Unknown) - // - // The graph API doesn't expose encodings yet, but the storage layer already has - // them. The `?` inner type is correct; the encoding format is opaque to the - // type system. - let encodings_ty = lib.ty.opaque( - "::graph::types::knowledge::entity::EntityEncodings", - lib.ty.r#struct([("vectors", lib.ty.unknown())]), - ); + let link_data_ty = types::link_data( + ty, + Some(types::LinkDataDependencies { + entity_id: entity_id_ty, + confidence: confidence_ty, + property_provenance: property_provenance_ty, + }), + ); + def.push(sym::LinkData, ItemDef::newtype(ty.env, link_data_ty, &[])); + + let encodings_ty = types::entity_encodings(ty); def.push( - heap.intern_symbol("EntityEncodings"), - ItemDef::newtype(lib.ty.env, encodings_ty, &[]), + sym::EntityEncodings, + ItemDef::newtype(ty.env, encodings_ty, &[]), ); - // newtype Entity = ( - // properties: T, - // link_data: Option, - // metadata: EntityMetadata, - // encodings: EntityEncodings, - // ) - let t_arg = lib.ty.fresh_argument("T"); + // Entity + let t_arg = lib.ty.fresh_argument(sym::T); let t_ref = lib.ty.hydrate_argument(t_arg); let t_param = lib.ty.param(t_arg); let entity_ty = lib.ty.generic( [t_arg], - lib.ty.opaque( - sym::path::Entity, - lib.ty.r#struct([ - ("properties", t_param), - ("link_data", option(lib, link_data_ty)), - ("metadata", entity_metadata_ty), - ("encodings", encodings_ty), - ]), + types::entity( + &lib.ty, + t_param, + Some(types::EntityDependencies { + link_data: link_data_ty, + metadata: entity_metadata_ty, + encodings: encodings_ty, + }), ), ); def.push( - heap.intern_symbol("Entity"), + sym::Entity, ItemDef::newtype(lib.ty.env, entity_ty, &[t_ref]), ); diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/mod.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/mod.rs index b68d310a05f..7fd11736062 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/mod.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/knowledge/mod.rs @@ -1,4 +1,4 @@ -pub(in crate::module::std_lib) mod entity; +pub mod entity; use crate::{ heap::Heap, diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/mod.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/mod.rs index 80686d4a3a0..9e743089972 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/mod.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/mod.rs @@ -8,9 +8,9 @@ use crate::{ symbol::Symbol, }; -pub(in crate::module::std_lib) mod knowledge; -pub(in crate::module::std_lib) mod ontology; -pub(in crate::module::std_lib) mod principal; +pub mod knowledge; +pub mod ontology; +pub mod principal; pub(in crate::module::std_lib) struct Types { _dependencies: (), diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/ontology/entity_type.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/ontology/entity_type.rs index b79b0f639d2..b8fb9b034ab 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/ontology/entity_type.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/ontology/entity_type.rs @@ -2,7 +2,7 @@ use crate::{ heap::Heap, module::{ StandardLibrary, - std_lib::{self, ItemDef, ModuleDef, StandardLibraryModule, core::option::option}, + std_lib::{self, ItemDef, ModuleDef, StandardLibraryModule, core::option::types::option}, }, symbol::Symbol, }; @@ -31,7 +31,7 @@ impl<'heap> StandardLibraryModule<'heap> for EntityType { .expect_newtype(heap.intern_symbol("WebId")); let entity_type_metadata_ty = lib.ty.opaque( "::graph::types::ontology::entity_type::EntityTypeMetadata", - lib.ty.r#struct([("web_id", option(lib, web_id.id))]), + lib.ty.r#struct([("web_id", option(&lib.ty, web_id.id))]), ); def.push( heap.intern_symbol("EntityTypeMetadata"), diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/ontology/mod.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/ontology/mod.rs index da2ec631994..8edd217d567 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/ontology/mod.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/ontology/mod.rs @@ -1,12 +1,62 @@ pub(in crate::module::std_lib) mod entity_type; +pub mod types { + use crate::{ + module::std_lib, + symbol::sym, + r#type::{TypeBuilder, TypeId}, + }; + + #[must_use] + pub fn ontology_type_version(ty: &TypeBuilder<'_, '_>) -> TypeId { + ty.opaque(sym::path::OntologyTypeVersion, ty.string()) + } + + pub struct BaseUrlDependencies { + pub url: TypeId, + } + + #[must_use] + pub fn base_url(ty: &TypeBuilder<'_, '_>, deps: Option) -> TypeId { + let BaseUrlDependencies { url } = deps.unwrap_or_else(|| BaseUrlDependencies { + url: std_lib::core::url::types::url(ty), + }); + + ty.opaque(sym::path::BaseUrl, url) + } + + pub struct VersionedUrlDependencies { + pub base_url: TypeId, + pub ontology_type_version: TypeId, + } + + #[must_use] + pub fn versioned_url( + ty: &TypeBuilder<'_, '_>, + deps: Option, + ) -> TypeId { + let VersionedUrlDependencies { + base_url: base_url_ty, + ontology_type_version: version_ty, + } = deps.unwrap_or_else(|| VersionedUrlDependencies { + base_url: self::base_url(ty, None), + ontology_type_version: self::ontology_type_version(ty), + }); + + ty.opaque( + sym::path::VersionedUrl, + ty.r#struct([(sym::base_url, base_url_ty), (sym::version, version_ty)]), + ) + } +} + use crate::{ heap::Heap, module::{ StandardLibrary, std_lib::{self, ItemDef, ModuleDef, StandardLibraryModule}, }, - symbol::Symbol, + symbol::{Symbol, sym}, }; pub(in crate::module::std_lib) struct Ontology { @@ -22,38 +72,37 @@ impl<'heap> StandardLibraryModule<'heap> for Ontology { fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { let mut def = ModuleDef::new(); - let heap = lib.heap; // newtype OntologyTypeVersion = String; - let ontology_type_version_ty = lib - .ty - .opaque("::graph::ontology::OntologyTypeVersion", lib.ty.string()); + let ontology_type_version_ty = types::ontology_type_version(&lib.ty); def.push( - heap.intern_symbol("OntologyTypeVersion"), + sym::OntologyTypeVersion, ItemDef::newtype(lib.ty.env, ontology_type_version_ty, &[]), ); let url_ty = lib .manifest::() - .expect_newtype(heap.intern_symbol("Url")) + .expect_newtype(sym::Url) .id; // TODO: consider making this constructor private via intrinsic (requires VM) // newtype BaseUrl = Url; - let base_url_ty = lib.ty.opaque("::graph::types::ontology::BaseUrl", url_ty); - let base_url = ItemDef::newtype(lib.ty.env, base_url_ty, &[]); - def.push(heap.intern_symbol("BaseUrl"), base_url); + let base_url_ty = + types::base_url(&lib.ty, Some(types::BaseUrlDependencies { url: url_ty })); + def.push(sym::BaseUrl, ItemDef::newtype(lib.ty.env, base_url_ty, &[])); // newtype VersionedUrl = (base_url: BaseUrl, version: OntologyTypeVersion); - let versioned_url_ty = lib.ty.opaque( - "::graph::types::ontology::VersionedUrl", - lib.ty.r#struct([ - ("base_url", base_url_ty), - ("version", ontology_type_version_ty), - ]), + let versioned_url_ty = types::versioned_url( + &lib.ty, + Some(types::VersionedUrlDependencies { + base_url: base_url_ty, + ontology_type_version: ontology_type_version_ty, + }), + ); + def.push( + sym::VersionedUrl, + ItemDef::newtype(lib.ty.env, versioned_url_ty, &[]), ); - let versioned_url = ItemDef::newtype(lib.ty.env, versioned_url_ty, &[]); - def.push(lib.heap.intern_symbol("VersionedUrl"), versioned_url); def } diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/actor_group/mod.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/actor_group/mod.rs index 078c532a1f4..2134f79dc61 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/actor_group/mod.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/actor_group/mod.rs @@ -1,4 +1,29 @@ -pub(in crate::module::std_lib) mod web; +pub mod web; + +pub mod types { + use crate::{ + module::std_lib, + symbol::sym, + r#type::{TypeBuilder, TypeId}, + }; + + pub struct ActorGroupEntityUuidDependencies { + pub uuid: TypeId, + } + + #[must_use] + pub fn actor_group_entity_uuid( + ty: &TypeBuilder<'_, '_>, + deps: Option, + ) -> TypeId { + let ActorGroupEntityUuidDependencies { uuid } = + deps.unwrap_or_else(|| ActorGroupEntityUuidDependencies { + uuid: std_lib::core::uuid::types::uuid(ty), + }); + + ty.opaque(sym::path::ActorGroupEntityUuid, uuid) + } +} use crate::{ heap::Heap, @@ -6,7 +31,7 @@ use crate::{ StandardLibrary, std_lib::{self, ItemDef, ModuleDef, StandardLibraryModule}, }, - symbol::Symbol, + symbol::{Symbol, sym}, }; pub(in crate::module::std_lib) struct ActorGroup { @@ -22,7 +47,6 @@ impl<'heap> StandardLibraryModule<'heap> for ActorGroup { fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { let mut def = ModuleDef::new(); - let heap = lib.heap; // newtype ActorGroupEntityUuid = EntityUuid; // (we just set it to Uuid to avoid any cycles) @@ -30,14 +54,15 @@ impl<'heap> StandardLibraryModule<'heap> for ActorGroup { // see: https://linear.app/hash/issue/H-4735/hashql-convert-rust-types-into-hashql-types let uuid_ty = lib .manifest::() - .expect_newtype(heap.intern_symbol("Uuid")); - let entity_uuid_ty = lib.ty.opaque( - "::graph::types::principal::actor_group::ActorGroupEntityUuid", - uuid_ty.id, + .expect_newtype(sym::Uuid) + .id; + let actor_group_entity_uuid_ty = types::actor_group_entity_uuid( + &lib.ty, + Some(types::ActorGroupEntityUuidDependencies { uuid: uuid_ty }), ); def.push( - heap.intern_symbol("ActorGroupEntityUuid"), - ItemDef::newtype(lib.ty.env, entity_uuid_ty, &[]), + sym::ActorGroupEntityUuid, + ItemDef::newtype(lib.ty.env, actor_group_entity_uuid_ty, &[]), ); def diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/actor_group/web.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/actor_group/web.rs index 0834fe10e1c..fa3319c5865 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/actor_group/web.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/actor_group/web.rs @@ -4,9 +4,35 @@ use crate::{ StandardLibrary, std_lib::{self, ItemDef, ModuleDef, StandardLibraryModule}, }, - symbol::Symbol, + symbol::{Symbol, sym}, }; +pub mod types { + use crate::{ + module::std_lib, + symbol::sym, + r#type::{TypeBuilder, TypeId}, + }; + + pub struct WebIdDependencies { + pub actor_group_entity_uuid: TypeId, + } + + #[must_use] + pub fn web_id(ty: &TypeBuilder<'_, '_>, deps: Option) -> TypeId { + let WebIdDependencies { + actor_group_entity_uuid, + } = deps.unwrap_or_else(|| WebIdDependencies { + actor_group_entity_uuid: + std_lib::graph::types::principal::actor_group::types::actor_group_entity_uuid( + ty, None, + ), + }); + + ty.opaque(sym::path::WebId, actor_group_entity_uuid) + } +} + pub(in crate::module::std_lib) struct Web { _dependencies: (std_lib::graph::types::principal::actor_group::ActorGroup,), } @@ -20,20 +46,19 @@ impl<'heap> StandardLibraryModule<'heap> for Web { fn define(lib: &mut StandardLibrary<'_, 'heap>) -> ModuleDef<'heap> { let mut def = ModuleDef::new(); - let heap = lib.heap; // newtype WebId = ActorGroupEntityUuid; let actor_group_entity_uuid_ty = lib .manifest::() - .expect_newtype(heap.intern_symbol("ActorGroupEntityUuid")); - let entity_uuid_ty = lib.ty.opaque( - "::graph::types::principal::actor_group::web::WebId", - actor_group_entity_uuid_ty.id, - ); - def.push( - heap.intern_symbol("WebId"), - ItemDef::newtype(lib.ty.env, entity_uuid_ty, &[]), + .expect_newtype(sym::ActorGroupEntityUuid) + .id; + let web_id_ty = types::web_id( + &lib.ty, + Some(types::WebIdDependencies { + actor_group_entity_uuid: actor_group_entity_uuid_ty, + }), ); + def.push(sym::WebId, ItemDef::newtype(lib.ty.env, web_id_ty, &[])); def } diff --git a/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/mod.rs b/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/mod.rs index 674022d3350..ae6f9075180 100644 --- a/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/mod.rs +++ b/libs/@local/hashql/core/src/module/std_lib/graph/types/principal/mod.rs @@ -1,4 +1,4 @@ -pub(in crate::module::std_lib) mod actor_group; +pub mod actor_group; use crate::{ heap::Heap, diff --git a/libs/@local/hashql/core/src/module/std_lib/mod.rs b/libs/@local/hashql/core/src/module/std_lib/mod.rs index 39c72b32c42..447d3065775 100644 --- a/libs/@local/hashql/core/src/module/std_lib/mod.rs +++ b/libs/@local/hashql/core/src/module/std_lib/mod.rs @@ -1,5 +1,5 @@ -mod core; -mod graph; +pub mod core; +pub mod graph; mod kernel; use ::core::iter; diff --git a/libs/@local/hashql/core/src/symbol/repr.rs b/libs/@local/hashql/core/src/symbol/repr.rs index 891017c53a8..42bd96d0e54 100644 --- a/libs/@local/hashql/core/src/symbol/repr.rs +++ b/libs/@local/hashql/core/src/symbol/repr.rs @@ -29,7 +29,6 @@ use alloc::alloc::handle_alloc_error; use core::{ alloc::{AllocError, Layout}, - mem, num::NonZero, ptr::{self, NonNull}, }; @@ -37,6 +36,18 @@ use core::{ use super::sym::SYMBOLS; use crate::heap::BumpAllocator; +unsafe extern "C" { + /// A dummy type used to force `RuntimeRepr` to be unsized while not requiring + /// references to it be wide pointers. + type Unsize; +} + +#[repr(C, align(2))] +struct RuntimeReprSkeleton { + len: usize, + data: [u8; 0], +} + /// Header for a runtime-allocated symbol with inline string data. /// /// # Memory Layout @@ -54,23 +65,23 @@ use crate::heap::BumpAllocator; /// # Provenance /// /// References to this type (`&RuntimeSymbol`) only have provenance for the header, -/// not the trailing bytes. All access must go through [`NonNull`] -/// to preserve full allocation provenance. +/// not the trailing bytes. All access must go through [`*mut RuntimeSymbol`] to +/// preserve full allocation provenance. #[repr(C, align(2))] pub(crate) struct RuntimeRepr { - len: usize, - data: [u8; 0], + skel: RuntimeReprSkeleton, + unsize: Unsize, } impl RuntimeRepr { /// Computes the allocation layout for a runtime symbol with `len` bytes of data. #[inline] fn layout(len: usize) -> Layout { - Layout::from_size_align( - size_of::().checked_add(len).expect("overflow"), - mem::align_of::(), - ) - .expect("invalid RuntimeSymbol layout") + let (layout, _offset) = Layout::new::() + .extend(Layout::array::(len).expect("should not overflow")) + .expect("valid RuntimeSymbol layout"); + + layout } /// Allocates a runtime symbol containing `value` on the given allocator. @@ -94,49 +105,27 @@ impl RuntimeRepr { /// # Errors /// /// Returns [`AllocError`] if the allocator cannot satisfy the request. + #[expect(clippy::cast_ptr_alignment)] fn try_alloc(alloc: &A, value: &str) -> Result, AllocError> { let len = value.len(); let layout = Self::layout(value.len()); - let ptr = alloc.allocate(layout)?.cast::(); + let ptr = alloc.allocate(layout)?.as_ptr() as *mut Self; // SAFETY: `ptr` points to a freshly allocated block of `layout` size. // We write `len` to the header and copy `len` bytes of string data // immediately after the header, which fits within the allocation. unsafe { - ptr.cast::().write(len); + (&raw mut (*ptr).skel.len).write(len); - let buf = ptr.add(1).cast::(); - ptr::copy_nonoverlapping(value.as_ptr(), buf.as_ptr(), len); + (&raw mut (*ptr).skel.data) + .cast::() + .copy_from_nonoverlapping(value.as_ptr(), value.len()); } - Ok(ptr) - } - - /// Returns a pointer to the inline string data. - /// - /// This performs pointer arithmetic without dereferencing, so it is safe. - /// The returned pointer has provenance for the trailing bytes if `this` - /// has provenance for the full allocation. - #[inline] - const fn data_ptr(this: NonNull) -> NonNull { - // SAFETY: `this` points to a valid `RuntimeSymbol` allocation, which - // always has at least `size_of::()` bytes. Adding 1 moves past - // the header to the inline data region. - unsafe { this.add(1) }.cast() - } - - /// Reads the length of the inline string data. - /// - /// # Safety - /// - /// - `this` must point to a valid, initialized [`RuntimeRepr`] allocation. - /// - The allocation must remain live for the duration of this call. - #[inline] - const unsafe fn len(this: NonNull) -> usize { - // SAFETY: Caller guarantees `this` points to a valid, initialized allocation. - unsafe { this.cast::().read() } + // SAFETY: the pointer returned from `alloc.allocate` is non-null + Ok(unsafe { NonNull::new_unchecked(ptr) }) } /// Returns the inline data as a byte slice. @@ -147,10 +136,15 @@ impl RuntimeRepr { /// - The allocation must remain live for the lifetime `'a`. /// - The returned slice must not be mutated for the lifetime `'a`. #[inline] - const unsafe fn as_bytes<'a>(this: NonNull) -> &'a [u8] { + const unsafe fn as_bytes<'a>(this: *mut Self) -> &'a [u8] { // SAFETY: Caller guarantees `this` is valid and the allocation outlives `'a`. - // `data_ptr` returns a pointer to the inline bytes, and `len` returns the count. - unsafe { core::slice::from_raw_parts(Self::data_ptr(this).as_ptr(), Self::len(this)) } + // `data_ptr` has provenance over the full allocation (no reborrow narrowing). + unsafe { + let data_ptr = (&raw const (*this).skel.data).cast::(); + let len = (&raw const (*this).skel.len).read(); + + core::slice::from_raw_parts(data_ptr, len) + } } /// Returns the inline data as a string slice. @@ -161,10 +155,9 @@ impl RuntimeRepr { /// - The allocation must remain live for the lifetime `'a`. /// - The returned string must not be mutated for the lifetime `'a`. #[inline] - const unsafe fn as_str<'a>(this: NonNull) -> &'a str { - // SAFETY: Caller guarantees `this` is valid and the allocation outlives `'a`. - // The bytes are valid UTF-8 because they were copied from a `&str` in `try_alloc`. - unsafe { core::str::from_raw_parts(Self::data_ptr(this).as_ptr(), Self::len(this)) } + const unsafe fn as_str<'a>(this: *mut Self) -> &'a str { + // SAFETY: The bytes are valid UTF-8 because they were copied from a `&str` in `try_alloc`. + unsafe { core::str::from_utf8_unchecked(Self::as_bytes(this)) } } } @@ -251,7 +244,8 @@ impl Repr { /// - `self` must have been created via [`Repr::runtime`]. /// - The underlying allocation must still be live. #[inline] - unsafe fn as_runtime(self) -> NonNull { + #[expect(clippy::cast_ptr_alignment)] + unsafe fn as_runtime(self) -> *mut RuntimeRepr { debug_assert!(self.tag() == Self::TAG_RUNTIME); self.ptr @@ -260,7 +254,7 @@ impl Repr { // lowest bit is always 0. Masking it off preserves a valid, non-zero address. unsafe { NonZero::new_unchecked(addr.get() & !Self::TAG_MASK) } }) - .cast::() + .as_ptr() as *mut RuntimeRepr } /// Extracts the constant symbol index. @@ -354,7 +348,7 @@ impl Repr { #[inline] pub(crate) fn runtime(symbol: NonNull) -> Self { const { - assert!(align_of::() >= Self::MIN_ALIGN); + assert!(align_of::() >= Self::MIN_ALIGN); } let ptr = symbol.map_addr(|addr| addr | Self::TAG_RUNTIME).cast(); @@ -366,7 +360,7 @@ impl Repr { const _: () = { assert!(size_of::() == size_of::<*const ()>()); assert!(size_of::>() == size_of::<*const ()>()); - assert!(align_of::() >= Repr::MIN_ALIGN); + assert!(align_of::() >= Repr::MIN_ALIGN); }; #[cfg(test)] @@ -481,8 +475,7 @@ mod tests { // SAFETY: `symbol` points to a valid allocation and `heap` is live. unsafe { - assert_eq!(RuntimeRepr::len(symbol), 5); - assert_eq!(RuntimeRepr::as_str(symbol).len(), 5); + assert_eq!(RuntimeRepr::as_str(symbol.as_ptr()).len(), 5); } } } diff --git a/libs/@local/hashql/core/src/symbol/sym.rs b/libs/@local/hashql/core/src/symbol/sym.rs index 4bc9c4fe5b5..d4809e9ed2b 100644 --- a/libs/@local/hashql/core/src/symbol/sym.rs +++ b/libs/@local/hashql/core/src/symbol/sym.rs @@ -4,6 +4,7 @@ use super::Symbol; hashql_macros::define_symbols! { // [tidy] sort alphabetically start access, + ActorGroupEntityUuid, add, and, archived, @@ -19,38 +20,55 @@ hashql_macros::define_symbols! { bit_xor, Boolean, collect, + Confidence, confidence, core, created_at_decision_time, created_at_transaction_time, created_by_id, decision_time, + DecisionTime, Dict, div, draft_id, + DraftId, dummy: "", E, edition, edition_id, encodings, + end, entity, + Entity, entity_edition_id, entity_id, entity_type_ids, entity_uuid, + EntityEditionId, + EntityEditionProvenance, + EntityEncodings, + EntityId, + EntityMetadata, + EntityProvenance, + EntityUuid, eq, Err, + ExclusiveTemporalBound, filter, + FiniteTemporalBound, foo, gt, gte, id, + InclusiveTemporalBound, index, inferred, + InferredEntityProvenance, input, input_exists: "$exists", Integer, Intersection, + Interval, kernel, left_entity_confidence, left_entity_id, @@ -58,6 +76,8 @@ hashql_macros::define_symbols! { left_entity_uuid, left_entity_web_id, link_data, + LeftClosedTemporalInterval, + LinkData, List, lt, lte, @@ -72,15 +92,24 @@ hashql_macros::define_symbols! { null, Number, Ok, + OntologyTypeVersion, + OpenTemporalBound, option, + Option, or, + pinned, + PinnedDecisionTimeTemporalAxes, + PinnedTransactionTimeTemporalAxes, pow, properties, property_metadata, + PropertyObjectMetadata, + PropertyProvenance, provenance, provenance_edition, provenance_inferred, provided, + QueryTemporalAxes, r#as: "as", r#as_force: "as!", r#else: "else", @@ -96,7 +125,10 @@ hashql_macros::define_symbols! { r#type: "type", r#use: "use", R, + RightBoundedTemporalInterval, + S, record_id, + RecordId, Result, right_entity_confidence, right_entity_id, @@ -105,21 +137,34 @@ hashql_macros::define_symbols! { right_entity_web_id, Some, special_form, + start, String, sub, T, + temporal, temporal_versioning, - then: "then", - thunk: "thunk", + TemporalBound, + TemporalInterval, + TemporalMetadata, + then, + thunk, + Timestamp, transaction_time, + TransactionTime, U, + UnboundedTemporalBound, Union, Unknown, unknown, Url, + uuid, + Uuid, + variable, vectors, version, + VersionedUrl, web_id, + WebId, // [tidy] sort alphabetically end internal: { @@ -176,13 +221,48 @@ hashql_macros::define_symbols! { path: { // [tidy] sort alphabetically start + ActorGroupEntityUuid: "::graph::types::principal::actor_group::ActorGroupEntityUuid", + BaseUrl: "::graph::types::ontology::BaseUrl", + Confidence: "::graph::types::knowledge::entity::Confidence", + DecisionTime: "::graph::temporal::DecisionTime", + DraftId: "::graph::types::knowledge::entity::DraftId", Entity: "::graph::types::knowledge::entity::Entity", + EntityEditionId: "::graph::types::knowledge::entity::EntityEditionId", + EntityEditionProvenance: "::graph::types::knowledge::entity::EntityEditionProvenance", + EntityEncodings: "::graph::types::knowledge::entity::EntityEncodings", + EntityId: "::graph::types::knowledge::entity::EntityId", + EntityMetadata: "::graph::types::knowledge::entity::EntityMetadata", + EntityProvenance: "::graph::types::knowledge::entity::EntityProvenance", + EntityUuid: "::graph::types::knowledge::entity::EntityUuid", + ExclusiveTemporalBound: "::graph::temporal::ExclusiveTemporalBound", graph_body_filter: "::graph::body::filter", graph_head_entities: "::graph::head::entities", graph_tail_collect: "::graph::tail::collect", - none: "::core::option::None", + InclusiveTemporalBound: "::graph::temporal::InclusiveTemporalBound", + InferredEntityProvenance: "::graph::types::knowledge::entity::InferredEntityProvenance", + Interval: "::graph::temporal::Interval", + LeftClosedTemporalInterval: "::graph::temporal::LeftClosedTemporalInterval", + LinkData: "::graph::types::knowledge::entity::LinkData", + None: "::core::option::None", + OntologyTypeVersion: "::graph::ontology::OntologyTypeVersion", + OpenTemporalBound: "::graph::temporal::OpenTemporalBound", option: "::core::option::Option", - some: "::core::option::Some", + PinnedDecisionTimeTemporalAxes: "::graph::temporal::PinnedDecisionTimeTemporalAxes", + PinnedTransactionTimeTemporalAxes: "::graph::temporal::PinnedTransactionTimeTemporalAxes", + PropertyObjectMetadata: "::graph::types::knowledge::entity::PropertyObjectMetadata", + PropertyProvenance: "::graph::types::knowledge::entity::PropertyProvenance", + RecordId: "::graph::types::knowledge::entity::RecordId", + RightBoundedTemporalInterval: "::graph::temporal::RightBoundedTemporalInterval", + Some: "::core::option::Some", + TemporalInterval: "::graph::types::knowledge::entity::TemporalInterval", + TemporalMetadata: "::graph::types::knowledge::entity::TemporalMetadata", + Timestamp: "::graph::temporal::Timestamp", + TransactionTime: "::graph::temporal::TransactionTime", + UnboundedTemporalBound: "::graph::temporal::UnboundedTemporalBound", + Url: "::core::url::Url", + Uuid: "::core::uuid::Uuid", + VersionedUrl: "::graph::types::ontology::VersionedUrl", + WebId: "::graph::types::principal::actor_group::web::WebId", // [tidy] sort alphabetically end } } diff --git a/libs/@local/hashql/eval/tests/ui/postgres/comparison-no-cast.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/comparison-no-cast.aux.mir index 98d2753e013..8ab01df57eb 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/comparison-no-cast.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/comparison-no-cast.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -59,7 +59,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#5}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/constant-true-filter.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/constant-true-filter.aux.mir index 76a15d5fcc5..441df13a42b 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/constant-true-filter.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/constant-true-filter.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -17,7 +17,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#2}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/dict-construction.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/dict-construction.aux.mir index 7c78cd33883..121e5b297c3 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/dict-construction.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/dict-construction.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -63,7 +63,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/entity-archived-check.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/entity-archived-check.aux.mir index e5c9cdc1591..1f0930a9178 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/entity-archived-check.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/entity-archived-check.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -21,7 +21,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#3}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/entity-draft-id-equality.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/entity-draft-id-equality.aux.mir index 12741a18694..7bfa8544e3a 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/entity-draft-id-equality.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/entity-draft-id-equality.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -33,7 +33,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#4}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/entity-type-ids-lateral.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/entity-type-ids-lateral.aux.mir index 2c63fe041d6..de6c0076542 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/entity-type-ids-lateral.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/entity-type-ids-lateral.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -33,7 +33,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#4}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/entity-uuid-equality.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/entity-uuid-equality.aux.mir index 8c05e0ee2bc..6cad1540f5a 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/entity-uuid-equality.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/entity-uuid-equality.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -87,7 +87,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/entity-web-id-equality.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/entity-web-id-equality.aux.mir index 6ebcab406ec..34bd3f3f127 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/entity-web-id-equality.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/entity-web-id-equality.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -33,7 +33,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#4}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/env-captured-variable.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/env-captured-variable.aux.mir index 5af838ddd8a..91b42901077 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/env-captured-variable.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/env-captured-variable.aux.mir @@ -16,7 +16,7 @@ fn {graph::read::filter@27}(%0: (), %1: ::graph::types::knowledge::entity::Entit thunk {thunk#8}() -> List<::graph::types::knowledge::entity::Entity> { let %0: ::graph::types::knowledge::entity::EntityUuid - let %1: ::graph::TimeAxis + let %1: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %2: List<::graph::types::knowledge::entity::Entity> let %3: (::graph::types::knowledge::entity::EntityUuid,) diff --git a/libs/@local/hashql/eval/tests/ui/postgres/if-input-branches.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/if-input-branches.aux.mir index d1e8ae0ff3e..a37e4c830d1 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/if-input-branches.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/if-input-branches.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -49,7 +49,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#8}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/input-parameter-exists.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/input-parameter-exists.aux.mir index 702591e451a..0bcb261a65d 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/input-parameter-exists.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/input-parameter-exists.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -63,7 +63,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#5}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/input-parameter-load.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/input-parameter-load.aux.mir index 5bd46f8214a..44c93a8aa9f 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/input-parameter-load.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/input-parameter-load.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -33,7 +33,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#4}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/let-binding-propagation.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/let-binding-propagation.aux.mir index 99c0ab174d5..090f32ef138 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/let-binding-propagation.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/let-binding-propagation.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#2}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#2}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -33,7 +33,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#4}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/list-construction.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/list-construction.aux.mir index 304c2591a3b..129a0800977 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/list-construction.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/list-construction.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -49,7 +49,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/logical-and-inputs.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/logical-and-inputs.aux.mir index ef01d32c99d..c8527abb702 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/logical-and-inputs.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/logical-and-inputs.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -63,7 +63,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#5}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/minimal-select-no-extra-joins.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/minimal-select-no-extra-joins.aux.mir index 1b70eb198c4..e8e26e5f88f 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/minimal-select-no-extra-joins.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/minimal-select-no-extra-joins.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -33,7 +33,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#4}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/mixed-sources-filter.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/mixed-sources-filter.aux.mir index 7e038965ce3..6a68ca98848 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/mixed-sources-filter.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/mixed-sources-filter.aux.mir @@ -26,7 +26,7 @@ fn {graph::read::filter@36}(%0: (), %1: ::graph::types::knowledge::entity::Entit thunk {thunk#10}() -> List<::graph::types::knowledge::entity::Entity> { let %0: ::graph::types::knowledge::entity::EntityUuid - let %1: ::graph::TimeAxis + let %1: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %2: List<::graph::types::knowledge::entity::Entity> let %3: () let %4: (::graph::types::knowledge::entity::EntityUuid,) diff --git a/libs/@local/hashql/eval/tests/ui/postgres/multiple-filters.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/multiple-filters.aux.mir index b35b02a348c..1c709a3ea81 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/multiple-filters.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/multiple-filters.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#2}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#2}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -56,7 +56,7 @@ thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () let %2: () - let %3: ::graph::TimeAxis + let %3: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %3 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/nested-if-input-branches.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/nested-if-input-branches.aux.mir index e5f2fb7b56a..22203d05ab6 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/nested-if-input-branches.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/nested-if-input-branches.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -65,7 +65,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#12}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/opaque-passthrough.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/opaque-passthrough.aux.mir index fda48bf5412..660d39aa265 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/opaque-passthrough.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/opaque-passthrough.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -103,7 +103,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#8}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/struct-construction.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/struct-construction.aux.mir index f63dd51fca6..f4287ad3fc2 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/struct-construction.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/struct-construction.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -63,7 +63,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/eval/tests/ui/postgres/tuple-construction.aux.mir b/libs/@local/hashql/eval/tests/ui/postgres/tuple-construction.aux.mir index 8a165d7b2fe..aa383add640 100644 --- a/libs/@local/hashql/eval/tests/ui/postgres/tuple-construction.aux.mir +++ b/libs/@local/hashql/eval/tests/ui/postgres/tuple-construction.aux.mir @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD time_axis @@ -63,7 +63,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { let %0: List<::graph::types::knowledge::entity::Entity> let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %2 = input LOAD time_axis diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-constrained.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-constrained.stdout index 9624a0176b7..928ea5f18cd 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-constrained.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-constrained.stdout @@ -1,27 +1,27 @@ ════ Initial HIR ═══════════════════════════════════════════════════════════════ -let foo:0 = (a:0: ?26, b:0: ?26): ?26 -> +let foo:0 = (a:0: ?30, b:0: ?30): ?30 -> ::core::math::add(a:0, b:0) in foo:0(2, 3) ════ HIR after type checking ═══════════════════════════════════════════════════ -let foo:0 = (a:0: ?29, b:0: ?29): ?29 -> +let foo:0 = (a:0: ?33, b:0: ?33): ?33 -> ::core::math::add(a:0, b:0) in foo:0(2, 3) ════ Types ═════════════════════════════════════════════════════════════════════ -┌─ let foo:0 = (a:0: ?29, b:0: ?29): ?29 -> +┌─ let foo:0 = (a:0: ?33, b:0: ?33): ?33 -> │ ::core::math::add(a:0, b:0) │ in │ foo:0(2, 3) └→ Integer -┌─ (a:0: ?29, b:0: ?29): ?29 -> ::core::math::add(a:0, b:0) -└→ (T:0?29, T:0?29) -> T:0?29 +┌─ (a:0: ?33, b:0: ?33): ?33 -> ::core::math::add(a:0, b:0) +└→ (T:0?33, T:0?33) -> T:0?33 ┌─ ::core::math::add(a:0, b:0) └→ Integer diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-unconstrained-direct.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-unconstrained-direct.stdout index f4862f6e1b9..a8c368374df 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-unconstrained-direct.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-unconstrained-direct.stdout @@ -1,6 +1,6 @@ ════ Initial HIR ═══════════════════════════════════════════════════════════════ -(a:0: ?26): ?26 -> a:0("1") +(a:0: ?30): ?30 -> a:0("1") ════ HIR after type checking ═══════════════════════════════════════════════════ diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-unconstrained.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-unconstrained.stdout index 2d7a03e4cb7..59f74202da5 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-unconstrained.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/closure-call-unconstrained.stdout @@ -1,33 +1,33 @@ ════ Initial HIR ═══════════════════════════════════════════════════════════════ -let foo:0 = (a:0: ?26): ?26 -> a:0, - bar:0 = (a:1: ?28): ?28 -> foo:0(a:1) +let foo:0 = (a:0: ?30): ?30 -> a:0, + bar:0 = (a:1: ?32): ?32 -> foo:0(a:1) in bar:0(2) ════ HIR after type checking ═══════════════════════════════════════════════════ -let foo:0 = (a:0: ?29): ?29 -> a:0, - bar:0 = (a:1: ?31): ?31 -> foo:0(a:1) +let foo:0 = (a:0: ?33): ?33 -> a:0, + bar:0 = (a:1: ?35): ?35 -> foo:0(a:1) in bar:0(2) ════ Types ═════════════════════════════════════════════════════════════════════ -┌─ let foo:0 = (a:0: ?29): ?29 -> a:0, -│ bar:0 = (a:1: ?31): ?31 -> foo:0(a:1) +┌─ let foo:0 = (a:0: ?33): ?33 -> a:0, +│ bar:0 = (a:1: ?35): ?35 -> foo:0(a:1) │ in │ bar:0(2) └→ Integer -┌─ (a:0: ?29): ?29 -> a:0 -└→ (T:0?29) -> T:0?29 +┌─ (a:0: ?33): ?33 -> a:0 +└→ (T:0?33) -> T:0?33 ┌─ a:0 └→ ? -┌─ (a:1: ?31): ?31 -> foo:0(a:1) -└→ (T:1?31) -> T:1?31 +┌─ (a:1: ?35): ?35 -> foo:0(a:1) +└→ (T:1?35) -> T:1?35 ┌─ foo:0(a:1) └→ ? diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/closure-constrained.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/closure-constrained.stdout index 6df3304ac34..fa863abad97 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/closure-constrained.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/closure-constrained.stdout @@ -1,27 +1,27 @@ ════ Initial HIR ═══════════════════════════════════════════════════════════════ -let add:0 = (a:0: ?26, b:0: ?26): ?26 -> +let add:0 = (a:0: ?30, b:0: ?30): ?30 -> ::core::math::add(a:0, b:0) in add:0(1, 2) ════ HIR after type checking ═══════════════════════════════════════════════════ -let add:0 = (a:0: ?29, b:0: ?29): ?29 -> +let add:0 = (a:0: ?33, b:0: ?33): ?33 -> ::core::math::add(a:0, b:0) in add:0(1, 2) ════ Types ═════════════════════════════════════════════════════════════════════ -┌─ let add:0 = (a:0: ?29, b:0: ?29): ?29 -> +┌─ let add:0 = (a:0: ?33, b:0: ?33): ?33 -> │ ::core::math::add(a:0, b:0) │ in │ add:0(1, 2) └→ Integer -┌─ (a:0: ?29, b:0: ?29): ?29 -> ::core::math::add(a:0, b:0) -└→ (T:0?29, T:0?29) -> T:0?29 +┌─ (a:0: ?33, b:0: ?33): ?33 -> ::core::math::add(a:0, b:0) +└→ (T:0?33, T:0?33) -> T:0?33 ┌─ ::core::math::add(a:0, b:0) └→ Number diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.stdout index 15a323ed088..f232a69153e 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/collect-filter-graph.stdout @@ -57,7 +57,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -66,9 +66,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -127,7 +135,7 @@ │ edition: ?, │ inferred: ? │ ), -│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ record_id: ::graph::types::knowledge::entity::RecordId( │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), │ entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) @@ -136,9 +144,17 @@ │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ) │ ), -│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( -│ decision_time: ?, -│ transaction_time: ? +│ temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( +│ decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )), +│ transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )) │ ) │ ), │ properties: ? @@ -188,7 +204,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -197,9 +213,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -246,7 +270,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -255,9 +279,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -302,7 +334,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -311,9 +343,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -360,7 +400,7 @@ │ edition: ?, │ inferred: ? │ ), -│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ record_id: ::graph::types::knowledge::entity::RecordId( │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), │ entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) @@ -369,9 +409,17 @@ │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ) │ ), -│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( -│ decision_time: ?, -│ transaction_time: ? +│ temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( +│ decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )), +│ transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )) │ ) │ ), │ properties: ? @@ -423,7 +471,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -432,9 +480,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -482,7 +538,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -491,9 +547,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -538,7 +602,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -547,9 +611,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -595,7 +667,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -604,9 +676,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -653,7 +733,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -662,9 +742,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -672,7 +760,28 @@ ) ┌─ ::graph::head::entities -└→ (::graph::TimeAxis(:)) -> +└→ ( + ::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + ) -> ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( encodings: ::graph::types::knowledge::entity::EntityEncodings( @@ -712,7 +821,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -721,9 +830,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -731,10 +848,49 @@ ) ┌─ ::graph::tmp::decision_time_now() -└→ ::graph::TimeAxis(:) +└→ ::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) ┌─ ::graph::tmp::decision_time_now -└→ () -> ::graph::TimeAxis(:) +└→ () -> + (::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + )) ┌─ ( │ vertex:0: ::graph::types::knowledge::entity::Entity( @@ -775,7 +931,7 @@ │ edition: ?, │ inferred: ? │ ), -│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ record_id: ::graph::types::knowledge::entity::RecordId( │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), │ entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) @@ -784,9 +940,17 @@ │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ) │ ), -│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( -│ decision_time: ?, -│ transaction_time: ? +│ temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( +│ decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )), +│ transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )) │ ) │ ), │ properties: ? @@ -837,7 +1001,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -846,9 +1010,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -881,7 +1053,7 @@ ) ┌─ vertex:0.metadata.record_id -└→ ::graph::types::knowledge::entity::EntityRecordId( +└→ ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -905,7 +1077,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -914,9 +1086,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ) @@ -957,7 +1137,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -966,9 +1146,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.stdout index 0d816e96cc8..1fb9dcaa75b 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/filter-graph.stdout @@ -54,7 +54,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -63,9 +63,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -122,7 +130,7 @@ │ edition: ?, │ inferred: ? │ ), -│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ record_id: ::graph::types::knowledge::entity::RecordId( │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), │ entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) @@ -131,9 +139,17 @@ │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ) │ ), -│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( -│ decision_time: ?, -│ transaction_time: ? +│ temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( +│ decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )), +│ transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )) │ ) │ ), │ properties: ? @@ -185,7 +201,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -194,9 +210,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -244,7 +268,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -253,9 +277,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -300,7 +332,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -309,9 +341,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -357,7 +397,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -366,9 +406,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -415,7 +463,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -424,9 +472,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -434,7 +490,28 @@ ) ┌─ ::graph::head::entities -└→ (::graph::TimeAxis(:)) -> +└→ ( + ::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + ) -> ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( encodings: ::graph::types::knowledge::entity::EntityEncodings( @@ -474,7 +551,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -483,9 +560,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -493,10 +578,49 @@ ) ┌─ ::graph::tmp::decision_time_now() -└→ ::graph::TimeAxis(:) +└→ ::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) ┌─ ::graph::tmp::decision_time_now -└→ () -> ::graph::TimeAxis(:) +└→ () -> + (::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + )) ┌─ ( │ vertex:0: ::graph::types::knowledge::entity::Entity( @@ -537,7 +661,7 @@ │ edition: ?, │ inferred: ? │ ), -│ record_id: ::graph::types::knowledge::entity::EntityRecordId( +│ record_id: ::graph::types::knowledge::entity::RecordId( │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), │ entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) @@ -546,9 +670,17 @@ │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ) │ ), -│ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( -│ decision_time: ?, -│ transaction_time: ? +│ temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( +│ decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )), +│ transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( +│ end: ::graph::temporal::UnboundedTemporalBound(Null) +│ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), +│ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) +│ )) │ ) │ ), │ properties: ? @@ -599,7 +731,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -608,9 +740,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -643,7 +783,7 @@ ) ┌─ vertex:0.metadata.record_id -└→ ::graph::types::knowledge::entity::EntityRecordId( +└→ ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -667,7 +807,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -676,9 +816,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ) @@ -719,7 +867,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -728,9 +876,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? diff --git a/libs/@local/hashql/hir/tests/ui/lower/checking/minimal-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/checking/minimal-graph.stdout index d34dc296e9b..01edc5b54df 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/checking/minimal-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/checking/minimal-graph.stdout @@ -51,7 +51,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -60,9 +60,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -109,7 +117,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -118,9 +126,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -165,7 +181,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -174,9 +190,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -222,7 +246,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -231,9 +255,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -241,7 +273,28 @@ ) ┌─ ::graph::head::entities -└→ (::graph::TimeAxis(:)) -> +└→ ( + ::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + ) -> ::graph::Graph( 'marker: ::graph::types::knowledge::entity::Entity( encodings: ::graph::types::knowledge::entity::EntityEncodings( @@ -281,7 +334,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -290,9 +343,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? @@ -300,8 +361,47 @@ ) ┌─ ::graph::tmp::decision_time_now() -└→ ::graph::TimeAxis(:) +└→ ::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) ┌─ ::graph::tmp::decision_time_now -└→ () -> ::graph::TimeAxis(:) +└→ () -> + (::graph::temporal::PinnedTransactionTimeTemporalAxes( + pinned: ::graph::temporal::TransactionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + ) + | ::graph::temporal::PinnedDecisionTimeTemporalAxes( + pinned: ::graph::temporal::DecisionTime(::graph::temporal::Timestamp(Integer)), + variable: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) + )) diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/bind-arguments.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/bind-arguments.stdout index a7c21930b83..ef79b55265a 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/bind-arguments.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/bind-arguments.stdout @@ -12,10 +12,10 @@ └→ _0«Number» ┌─ ::core::math::add -└→ [?25 = Number, ?26 = Integer] ( - T?25«Number», - U?26«Integer» - ) -> (T?25«Number» | U?26«Integer») +└→ [?29 = Number, ?30 = Integer] ( + T?29«Number», + U?30«Integer» + ) -> (T?29«Number» | U?30«Integer») ┌─ 42.12 └→ Number diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/call.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/call.stdout index 5ac50bd4563..91881d9db86 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/call.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/call.stdout @@ -12,8 +12,8 @@ └→ _0«Number» ┌─ ::core::math::add -└→ (T?25«Number», U?26«Integer») -> - (T?25«Number» | U?26«Integer») +└→ (T?29«Number», U?30«Integer») -> + (T?29«Number» | U?30«Integer») ┌─ 42.12 └→ Number diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/closure-call-unconstrained-direct.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/closure-call-unconstrained-direct.stdout index d43b05c829c..c2ced5b7b27 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/closure-call-unconstrained-direct.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/closure-call-unconstrained-direct.stdout @@ -1,21 +1,21 @@ ════ Initial HIR ═══════════════════════════════════════════════════════════════ -(a:0: ?26): ?26 -> a:0("1") +(a:0: ?30): ?30 -> a:0("1") ════ HIR after type inference ══════════════════════════════════════════════════ -(a:0: ?27): ?27 -> a:0("1") +(a:0: ?31): ?31 -> a:0("1") ════ Types ═════════════════════════════════════════════════════════════════════ -┌─ (a:0: ?27): ?27 -> a:0("1") +┌─ (a:0: ?31): ?31 -> a:0("1") └→ _0«String» -┌─ (a:0: ?27): ?27 -> a:0 -└→ (T:0?27«String») -> T:0?27«String» +┌─ (a:0: ?31): ?31 -> a:0 +└→ (T:0?31«String») -> T:0?31«String» ┌─ a:0 -└→ ?26«?» +└→ ?30«?» ┌─ "1" └→ String diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/closure-call-unconstrained.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/closure-call-unconstrained.stdout index 3da8093edc6..c4d4af037ac 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/closure-call-unconstrained.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/closure-call-unconstrained.stdout @@ -1,48 +1,48 @@ ════ Initial HIR ═══════════════════════════════════════════════════════════════ -let foo:0 = (a:0: ?26): ?26 -> a:0, - bar:0 = (a:1: ?28): ?28 -> foo:0(a:1) +let foo:0 = (a:0: ?30): ?30 -> a:0, + bar:0 = (a:1: ?32): ?32 -> foo:0(a:1) in bar:0(2) ════ HIR after type inference ══════════════════════════════════════════════════ -let foo:0 = (a:0: ?29): ?29 -> a:0, - bar:0 = (a:1: ?31): ?31 -> foo:0(a:1) +let foo:0 = (a:0: ?33): ?33 -> a:0, + bar:0 = (a:1: ?35): ?35 -> foo:0(a:1) in bar:0(2) ════ Types ═════════════════════════════════════════════════════════════════════ -┌─ let foo:0 = (a:0: ?29): ?29 -> a:0, -│ bar:0 = (a:1: ?31): ?31 -> foo:0(a:1) +┌─ let foo:0 = (a:0: ?33): ?33 -> a:0, +│ bar:0 = (a:1: ?35): ?35 -> foo:0(a:1) │ in │ bar:0(2) └→ _1«Integer» -┌─ (a:0: ?29): ?29 -> a:0 -└→ (T:0?29) -> T:0?29 +┌─ (a:0: ?33): ?33 -> a:0 +└→ (T:0?33) -> T:0?33 ┌─ a:0 -└→ ?26«?» +└→ ?30«?» -┌─ (a:1: ?31): ?31 -> foo:0(a:1) -└→ (T:1?31) -> T:1?31 +┌─ (a:1: ?35): ?35 -> foo:0(a:1) +└→ (T:1?35) -> T:1?35 ┌─ foo:0(a:1) └→ _0«?» ┌─ foo:0 -└→ (T:0?30«?») -> T:0?30«?» +└→ (T:0?34«?») -> T:0?34«?» ┌─ a:1 -└→ ?28«?» +└→ ?32«?» ┌─ bar:0(2) └→ _1«Integer» ┌─ bar:0 -└→ (T:1?32«Integer») -> T:1?32«Integer» +└→ (T:1?36«Integer») -> T:1?36«Integer» ┌─ 2 └→ Integer diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/closure-constrained.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/closure-constrained.stdout index ae28568e8f4..865a64cd007 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/closure-constrained.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/closure-constrained.stdout @@ -1,26 +1,26 @@ ════ Initial HIR ═══════════════════════════════════════════════════════════════ -(a:0: ?26, b:0: ?26): ?26 -> ::core::math::add(a:0, b:0) +(a:0: ?30, b:0: ?30): ?30 -> ::core::math::add(a:0, b:0) ════ HIR after type inference ══════════════════════════════════════════════════ -(a:0: ?29, b:0: ?29): ?29 -> ::core::math::add(a:0, b:0) +(a:0: ?33, b:0: ?33): ?33 -> ::core::math::add(a:0, b:0) ════ Types ═════════════════════════════════════════════════════════════════════ -┌─ (a:0: ?29, b:0: ?29): ?29 -> ::core::math::add(a:0, b:0) -└→ (T:0?29, T:0?29) -> T:0?29 +┌─ (a:0: ?33, b:0: ?33): ?33 -> ::core::math::add(a:0, b:0) +└→ (T:0?33, T:0?33) -> T:0?33 ┌─ ::core::math::add(a:0, b:0) └→ _0«Number» ┌─ ::core::math::add -└→ (T?27«Number», U?28«Number») -> - (T?27«Number» | U?28«Number») +└→ (T?31«Number», U?32«Number») -> + (T?31«Number» | U?32«Number») ┌─ a:0 -└→ ?26«Number» +└→ ?30«Number» ┌─ b:0 -└→ ?26«Number» +└→ ?30«Number» diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/closure-integer.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/closure-integer.stdout index e7fe0e27a13..f89fedf61de 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/closure-integer.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/closure-integer.stdout @@ -1,26 +1,26 @@ ════ Initial HIR ═══════════════════════════════════════════════════════════════ -(a:0: ?26, b:0: ?26): ?26 -> ::core::math::add(a:0, b:0) +(a:0: ?30, b:0: ?30): ?30 -> ::core::math::add(a:0, b:0) ════ HIR after type inference ══════════════════════════════════════════════════ -(a:0: ?29, b:0: ?29): ?29 -> ::core::math::add(a:0, b:0) +(a:0: ?33, b:0: ?33): ?33 -> ::core::math::add(a:0, b:0) ════ Types ═════════════════════════════════════════════════════════════════════ -┌─ (a:0: ?29, b:0: ?29): ?29 -> ::core::math::add(a:0, b:0) -└→ (T:0?29, T:0?29) -> T:0?29 +┌─ (a:0: ?33, b:0: ?33): ?33 -> ::core::math::add(a:0, b:0) +└→ (T:0?33, T:0?33) -> T:0?33 ┌─ ::core::math::add(a:0, b:0) └→ _0«Integer» ┌─ ::core::math::add -└→ (T?27«Integer», U?28«Integer») -> - (T?27«Integer» | U?28«Integer») +└→ (T?31«Integer», U?32«Integer») -> + (T?31«Integer» | U?32«Integer») ┌─ a:0 -└→ ?26«Integer» +└→ ?30«Integer» ┌─ b:0 -└→ ?26«Integer» +└→ ?30«Integer» diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/ctor.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/ctor.stdout index efb942d3449..4e12f9ec803 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/ctor.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/ctor.stdout @@ -12,7 +12,7 @@ └→ _0«::core::option::Some(Integer)» ┌─ ::core::option::Some -└→ (T?25«Integer») -> ::core::option::Some(T?25«Integer») +└→ (T?29«Integer») -> ::core::option::Some(T?29«Integer») ┌─ 2 └→ Integer diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/if.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/if.stdout index cd2219bb156..1c32a4393a5 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/if.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/if.stdout @@ -24,7 +24,7 @@ else ::core::option::None() └→ _0«::core::option::Some(Integer)» ┌─ ::core::option::Some -└→ (T?25«Integer») -> ::core::option::Some(T?25«Integer») +└→ (T?29«Integer») -> ::core::option::Some(T?29«Integer») ┌─ 2 └→ Integer diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/infer-argument.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/infer-argument.stdout index 00aa99dbcea..2f134281bbc 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/infer-argument.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/infer-argument.stdout @@ -18,8 +18,8 @@ └→ _3«Integer» ┌─ ::core::math::add -└→ (T?25«Integer», U?26«Integer») -> - (T?25«Integer» | U?26«Integer») +└→ (T?29«Integer», U?30«Integer») -> + (T?29«Integer» | U?30«Integer») ┌─ lhs:0 └→ _0«Integer» diff --git a/libs/@local/hashql/hir/tests/ui/lower/inference/qualified-variable.stdout b/libs/@local/hashql/hir/tests/ui/lower/inference/qualified-variable.stdout index 334131d8782..88adbaa4421 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/inference/qualified-variable.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/inference/qualified-variable.stdout @@ -12,8 +12,8 @@ └→ _0«Integer» ┌─ ::core::math::add -└→ (T?25«Integer», U?26«Integer») -> - (T?25«Integer» | U?26«Integer») +└→ (T?29«Integer», U?30«Integer») -> + (T?29«Integer» | U?30«Integer») ┌─ 123 └→ Integer diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-custom-collect.stderr b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-custom-collect.stderr index 4100f56b8a8..f999276d515 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-custom-collect.stderr +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-custom-collect.stderr @@ -43,7 +43,7 @@ error[lower::specialization::non-intrinsic-graph-operation]: Non-intrinsic funct │ edition: ?, │ inferred: ? │ ), - │ record_id: ::graph::types::knowledge::entity::EntityRecordId( + │ record_id: ::graph::types::knowledge::entity::RecordId( │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), │ entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) @@ -52,9 +52,17 @@ error[lower::specialization::non-intrinsic-graph-operation]: Non-intrinsic funct │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ) │ ), - │ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - │ decision_time: ?, - │ transaction_time: ? + │ temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + │ decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + │ end: ::graph::temporal::UnboundedTemporalBound(Null) + │ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + │ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + │ )), + │ transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + │ end: ::graph::temporal::UnboundedTemporalBound(Null) + │ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + │ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + │ )) │ ) │ ), │ properties: ? @@ -99,7 +107,7 @@ error[lower::specialization::non-intrinsic-graph-operation]: Non-intrinsic funct │ edition: ?, │ inferred: ? │ ), - │ record_id: ::graph::types::knowledge::entity::EntityRecordId( + │ record_id: ::graph::types::knowledge::entity::RecordId( │ edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), │ entity_id: ::graph::types::knowledge::entity::EntityId( │ draft_id: ::core::option::None(Null) @@ -108,9 +116,17 @@ error[lower::specialization::non-intrinsic-graph-operation]: Non-intrinsic funct │ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) │ ) │ ), - │ temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - │ decision_time: ?, - │ transaction_time: ? + │ temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + │ decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + │ end: ::graph::temporal::UnboundedTemporalBound(Null) + │ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + │ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + │ )), + │ transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + │ end: ::graph::temporal::UnboundedTemporalBound(Null) + │ | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + │ start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + │ )) │ ) │ ), │ properties: ? diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.stdout index 70b5b74655a..ee0df31c049 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/collect-filter-graph.stdout @@ -55,7 +55,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -64,9 +64,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/complex.stdout b/libs/@local/hashql/hir/tests/ui/lower/specialization/complex.stdout index 857b8b6159d..f2e17b8f8e4 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/complex.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/complex.stdout @@ -2,7 +2,7 @@ let foo:0 = 1, bar:0 = 1, - equals:0 = (lhs:0: ?26, rhs:0: ?26): Boolean -> + equals:0 = (lhs:0: ?30, rhs:0: ?30): Boolean -> ::core::cmp::eq(lhs:0, rhs:0) in equals:0(foo:0, bar:0) @@ -11,6 +11,6 @@ equals:0(foo:0, bar:0) let foo:0 = 1, bar:0 = 1, - equals:0 = (lhs:0: ?29, rhs:0: ?29): Boolean -> lhs:0 == rhs:0 + equals:0 = (lhs:0: ?33, rhs:0: ?33): Boolean -> lhs:0 == rhs:0 in equals:0(foo:0, bar:0) diff --git a/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.stdout b/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.stdout index 742855c98c0..7188231ca00 100644 --- a/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.stdout +++ b/libs/@local/hashql/hir/tests/ui/lower/specialization/filter-graph.stdout @@ -54,7 +54,7 @@ edition: ?, inferred: ? ), - record_id: ::graph::types::knowledge::entity::EntityRecordId( + record_id: ::graph::types::knowledge::entity::RecordId( edition_id: ::graph::types::knowledge::entity::EntityEditionId(::core::uuid::Uuid(String)), entity_id: ::graph::types::knowledge::entity::EntityId( draft_id: ::core::option::None(Null) @@ -63,9 +63,17 @@ web_id: ::graph::types::principal::actor_group::web::WebId(::graph::types::principal::actor_group::ActorGroupEntityUuid(::core::uuid::Uuid(String))) ) ), - temporal_versioning: ::graph::types::knowledge::entity::EntityTemporalMetadata( - decision_time: ?, - transaction_time: ? + temporal_versioning: ::graph::types::knowledge::entity::TemporalMetadata( + decision_time: ::graph::temporal::DecisionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )), + transaction_time: ::graph::temporal::TransactionTime(::graph::temporal::Interval( + end: ::graph::temporal::UnboundedTemporalBound(Null) + | ::graph::temporal::ExclusiveTemporalBound(::graph::temporal::Timestamp(Integer)), + start: ::graph::temporal::InclusiveTemporalBound(::graph::temporal::Timestamp(Integer)) + )) ) ), properties: ? diff --git a/libs/@local/hashql/hir/tests/ui/reify/closure.stdout b/libs/@local/hashql/hir/tests/ui/reify/closure.stdout index e22641a558f..ef0c2679b52 100644 --- a/libs/@local/hashql/hir/tests/ui/reify/closure.stdout +++ b/libs/@local/hashql/hir/tests/ui/reify/closure.stdout @@ -1 +1 @@ -(foo:0: ?26, bar:0: ?26): ?26 -> ::core::math::add(foo:0, bar:0) \ No newline at end of file +(foo:0: ?30, bar:0: ?30): ?30 -> ::core::math::add(foo:0, bar:0) \ No newline at end of file diff --git a/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-filter.jsonc b/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-filter.jsonc index 468b578f841..e22e464edf9 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-filter.jsonc +++ b/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-filter.jsonc @@ -11,10 +11,7 @@ "::graph::tail::collect", [ "::graph::body::filter", - [ - "::graph::head::entities", - ["input", "axis", "::graph::QueryTemporalAxes"] - ], + ["::graph::head::entities", ["input", "axis", "_"]], [ "fn", { "#tuple": [] }, diff --git a/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-filter.stdout b/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-filter.stdout index 040e4c2ebad..73fda5d494b 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-filter.stdout +++ b/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-filter.stdout @@ -13,7 +13,7 @@ fn {graph::read::filter@11}(%0: (Boolean,), %1: ::graph::types::knowledge::entit *thunk {thunk#5}() -> Integer | List<::graph::types::knowledge::entity::Entity> { let %0: Integer | List<::graph::types::knowledge::entity::Entity> let %1: Integer - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %3: Boolean let %4: List<::graph::types::knowledge::entity::Entity> let %5: (Boolean,) diff --git a/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-head.jsonc b/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-head.jsonc index 6d63105cbdd..6e8cf46c13c 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-head.jsonc +++ b/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-head.jsonc @@ -1,6 +1,3 @@ //@ run: pass //@ description: Graph read head creates GraphReadHeadAxis edge -[ - "::graph::tail::collect", - ["::graph::head::entities", ["input", "axis", "::graph::QueryTemporalAxes"]] -] +["::graph::tail::collect", ["::graph::head::entities", ["input", "axis", "_"]]] diff --git a/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-head.stdout b/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-head.stdout index 1d758058f5a..d6b23bcafe8 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-head.stdout +++ b/libs/@local/hashql/mir/tests/ui/pass/data-dependency/graph-read-head.stdout @@ -1,7 +1,7 @@ ════ MIR ═══════════════════════════════════════════════════════════════════════ -thunk {thunk#0}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#0}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD axis @@ -11,7 +11,7 @@ thunk {thunk#0}() -> ::graph::TimeAxis { } *thunk {thunk#1}() -> List<::graph::types::knowledge::entity::Entity> { - let %0: ::graph::TimeAxis + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: List<::graph::types::knowledge::entity::Entity> bb0(): { diff --git a/libs/@local/hashql/mir/tests/ui/pass/execution/entity_uuid_equality.snap b/libs/@local/hashql/mir/tests/ui/pass/execution/entity_uuid_equality.snap index 2192f800648..7d9e9926001 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/execution/entity_uuid_equality.snap +++ b/libs/@local/hashql/mir/tests/ui/pass/execution/entity_uuid_equality.snap @@ -2,7 +2,7 @@ source: libs/@local/hashql/mir/src/pass/execution/tests.rs expression: output --- -fn {graph::read::filter@4294967040}(%0: (), %1: Entity) -> Boolean { +fn {graph::read::filter@4294967040}(%0: (), %1: Entity) -> Boolean { let %2: Boolean let %3: Uuid let %4: EntityUuid diff --git a/libs/@local/hashql/mir/tests/ui/pass/execution/statement_placement/interpret/eq_opaque_entity_uuid.snap b/libs/@local/hashql/mir/tests/ui/pass/execution/statement_placement/interpret/eq_opaque_entity_uuid.snap index 1e9e2dd7f7a..9e2c832baef 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/execution/statement_placement/interpret/eq_opaque_entity_uuid.snap +++ b/libs/@local/hashql/mir/tests/ui/pass/execution/statement_placement/interpret/eq_opaque_entity_uuid.snap @@ -2,7 +2,7 @@ source: libs/@local/hashql/mir/src/pass/execution/statement_placement/tests.rs expression: output --- -fn {graph::read::filter@4294967040}(%0: (), %1: Entity) -> Boolean { +fn {graph::read::filter@4294967040}(%0: (), %1: Entity) -> Boolean { let %2: Boolean let %3: Uuid let %4: EntityUuid diff --git a/libs/@local/hashql/mir/tests/ui/pass/execution/statement_placement/postgres/eq_opaque_entity_uuid.snap b/libs/@local/hashql/mir/tests/ui/pass/execution/statement_placement/postgres/eq_opaque_entity_uuid.snap index 87cdcc5db7c..6ed6afca2eb 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/execution/statement_placement/postgres/eq_opaque_entity_uuid.snap +++ b/libs/@local/hashql/mir/tests/ui/pass/execution/statement_placement/postgres/eq_opaque_entity_uuid.snap @@ -2,7 +2,7 @@ source: libs/@local/hashql/mir/src/pass/execution/statement_placement/tests.rs expression: output --- -fn {graph::read::filter@4294967040}(%0: (), %1: Entity) -> Boolean { +fn {graph::read::filter@4294967040}(%0: (), %1: Entity) -> Boolean { let %2: Boolean let %3: Uuid let %4: EntityUuid diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/closure-inline.jsonc b/libs/@local/hashql/mir/tests/ui/pass/inline/closure-inline.jsonc index ad27820f419..83db88aa4e8 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/closure-inline.jsonc +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/closure-inline.jsonc @@ -7,8 +7,8 @@ "fn", { "#tuple": [] }, { "#struct": {} }, - "::graph::QueryTemporalAxes", - ["input", "axis", "::graph::QueryTemporalAxes"] + "::graph::temporal::QueryTemporalAxes", + ["input", "axis", "::graph::temporal::QueryTemporalAxes"] ], ["get_axis"] ] diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/closure-inline.stdout b/libs/@local/hashql/mir/tests/ui/pass/inline/closure-inline.stdout index 1ea3c9650a0..a346854964d 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/closure-inline.stdout +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/closure-inline.stdout @@ -1,7 +1,7 @@ ════ Initial MIR ═══════════════════════════════════════════════════════════════ -fn {closure#3}(%0: ()) -> ::graph::TimeAxis { - let %1: ::graph::TimeAxis +fn {closure#3}(%0: ()) -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %1: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %1 = input LOAD axis @@ -10,8 +10,8 @@ fn {closure#3}(%0: ()) -> ::graph::TimeAxis { } } -thunk get_axis:0() -> () -> ::graph::TimeAxis { - let %0: () -> ::graph::TimeAxis +thunk get_axis:0() -> () -> (::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes) { + let %0: () -> (::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes) let %1: () bb0(): { @@ -22,9 +22,9 @@ thunk get_axis:0() -> () -> ::graph::TimeAxis { } } -*thunk {thunk#2}() -> ::graph::TimeAxis { - let %0: () -> ::graph::TimeAxis - let %1: ::graph::TimeAxis +*thunk {thunk#2}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: () -> (::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes) + let %1: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = apply (get_axis:0 as FnPtr) @@ -36,8 +36,8 @@ thunk get_axis:0() -> () -> ::graph::TimeAxis { ════ Pre-inlining MIR ══════════════════════════════════════════════════════════ -fn {closure#3}(%0: ()) -> ::graph::TimeAxis { - let %1: ::graph::TimeAxis +fn {closure#3}(%0: ()) -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %1: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %1 = input LOAD axis @@ -46,8 +46,8 @@ fn {closure#3}(%0: ()) -> ::graph::TimeAxis { } } -thunk get_axis:0() -> () -> ::graph::TimeAxis { - let %0: () -> ::graph::TimeAxis +thunk get_axis:0() -> () -> (::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes) { + let %0: () -> (::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes) bb0(): { %0 = closure(({closure#3} as FnPtr), ()) @@ -56,8 +56,8 @@ thunk get_axis:0() -> () -> ::graph::TimeAxis { } } -*thunk {thunk#2}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +*thunk {thunk#2}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = apply ({closure#3} as FnPtr) () @@ -68,8 +68,8 @@ thunk get_axis:0() -> () -> ::graph::TimeAxis { ════ Inlined MIR ═══════════════════════════════════════════════════════════════ -fn {closure#3}(%0: ()) -> ::graph::TimeAxis { - let %1: ::graph::TimeAxis +fn {closure#3}(%0: ()) -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %1: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %1 = input LOAD axis @@ -78,8 +78,8 @@ fn {closure#3}(%0: ()) -> ::graph::TimeAxis { } } -thunk get_axis:0() -> () -> ::graph::TimeAxis { - let %0: () -> ::graph::TimeAxis +thunk get_axis:0() -> () -> (::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes) { + let %0: () -> (::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes) bb0(): { %0 = closure(({closure#3} as FnPtr), ()) @@ -88,10 +88,10 @@ thunk get_axis:0() -> () -> ::graph::TimeAxis { } } -*thunk {thunk#2}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +*thunk {thunk#2}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: () - let %2: ::graph::TimeAxis + let %2: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %1 = () diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/excessive-depth.jsonc b/libs/@local/hashql/mir/tests/ui/pass/inline/excessive-depth.jsonc index fff9af5cfe4..67ec20c37b1 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/excessive-depth.jsonc +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/excessive-depth.jsonc @@ -10,10 +10,7 @@ "::graph::tail::collect", [ "::graph::body::filter", - [ - "::graph::head::entities", - ["input", "axis", "::graph::QueryTemporalAxes"] - ], + ["::graph::head::entities", ["input", "axis", "_"]], [ "fn", { "#tuple": [] }, diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/excessive-depth.stderr b/libs/@local/hashql/mir/tests/ui/pass/inline/excessive-depth.stderr index ca873735088..25fd1f6b3a1 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/excessive-depth.stderr +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/excessive-depth.stderr @@ -1,11 +1,11 @@ warning[mir::transform::excessive-inlining-depth]: Excessive inlining depth ╭▸ -17 │ ┏ [ -18 │ ┃ "fn", -19 │ ┃ { "#tuple": [] }, -20 │ ┃ { "#struct": { "vertex": "_" } }, +14 │ ┏ [ +15 │ ┃ "fn", +16 │ ┃ { "#tuple": [] }, +17 │ ┃ { "#struct": { "vertex": "_" } }, ‡ ┃ -67 │ ┃ ] +64 │ ┃ ] │ ┗━━━━━┛ filter has deeply nested calls that could not be fully inlined │ ├ note: aggressive inlining stopped after 1 iterations diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-aggressive.jsonc b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-aggressive.jsonc index db62c30004d..3325bfcc273 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-aggressive.jsonc +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-aggressive.jsonc @@ -4,10 +4,7 @@ "::graph::tail::collect", [ "::graph::body::filter", - [ - "::graph::head::entities", - ["input", "axis", "::graph::QueryTemporalAxes"] - ], + ["::graph::head::entities", ["input", "axis", "_"]], [ "fn", { "#tuple": [] }, diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-aggressive.stdout b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-aggressive.stdout index ec3eaf48466..b0abcece659 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-aggressive.stdout +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-aggressive.stdout @@ -1,7 +1,7 @@ ════ Initial MIR ═══════════════════════════════════════════════════════════════ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD axis @@ -21,7 +21,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity } *thunk {thunk#3}() -> List<::graph::types::knowledge::entity::Entity> { - let %0: ::graph::TimeAxis + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: List<::graph::types::knowledge::entity::Entity> let %2: () @@ -41,8 +41,8 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity ════ Pre-inlining MIR ══════════════════════════════════════════════════════════ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD axis @@ -62,7 +62,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity } *thunk {thunk#3}() -> List<::graph::types::knowledge::entity::Entity> { - let %0: ::graph::TimeAxis + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: List<::graph::types::knowledge::entity::Entity> let %2: () @@ -82,8 +82,8 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity ════ Inlined MIR ═══════════════════════════════════════════════════════════════ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD axis @@ -103,10 +103,10 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity } *thunk {thunk#3}() -> List<::graph::types::knowledge::entity::Entity> { - let %0: ::graph::TimeAxis + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: List<::graph::types::knowledge::entity::Entity> let %2: () - let %3: ::graph::TimeAxis + let %3: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { goto -> bb3() diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.jsonc b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.jsonc index da71b8f06ab..368d4e602d8 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.jsonc +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.jsonc @@ -4,10 +4,7 @@ "::graph::tail::collect", [ "::graph::body::filter", - [ - "::graph::head::entities", - ["input", "axis", "::graph::QueryTemporalAxes"] - ], + ["::graph::head::entities", ["input", "axis", "_"]], [ "fn", { "#tuple": [] }, diff --git a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.stdout b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.stdout index 34b1520b153..e58715e7cbe 100644 --- a/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.stdout +++ b/libs/@local/hashql/mir/tests/ui/pass/inline/filter-with-ctor.stdout @@ -1,7 +1,7 @@ ════ Initial MIR ═══════════════════════════════════════════════════════════════ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD axis @@ -89,7 +89,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity } *thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { - let %0: ::graph::TimeAxis + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: List<::graph::types::knowledge::entity::Entity> let %2: () @@ -109,8 +109,8 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity ════ Pre-inlining MIR ══════════════════════════════════════════════════════════ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD axis @@ -196,7 +196,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity } *thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { - let %0: ::graph::TimeAxis + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: List<::graph::types::knowledge::entity::Entity> let %2: () @@ -216,8 +216,8 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity ════ Inlined MIR ═══════════════════════════════════════════════════════════════ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD axis @@ -303,10 +303,10 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity } *thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { - let %0: ::graph::TimeAxis + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: List<::graph::types::knowledge::entity::Entity> let %2: () - let %3: ::graph::TimeAxis + let %3: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { goto -> bb3() diff --git a/libs/@local/hashql/mir/tests/ui/reify/graph-read.jsonc b/libs/@local/hashql/mir/tests/ui/reify/graph-read.jsonc index 57decdd1e6b..3527315b161 100644 --- a/libs/@local/hashql/mir/tests/ui/reify/graph-read.jsonc +++ b/libs/@local/hashql/mir/tests/ui/reify/graph-read.jsonc @@ -4,10 +4,7 @@ "::graph::tail::collect", [ "::graph::body::filter", - [ - "::graph::head::entities", - ["input", "axis", "::graph::QueryTemporalAxes"] - ], + ["::graph::head::entities", ["input", "axis", "_"]], [ "fn", { "#tuple": [] }, diff --git a/libs/@local/hashql/mir/tests/ui/reify/graph-read.stdout b/libs/@local/hashql/mir/tests/ui/reify/graph-read.stdout index dea77dc30ef..f9e09102564 100644 --- a/libs/@local/hashql/mir/tests/ui/reify/graph-read.stdout +++ b/libs/@local/hashql/mir/tests/ui/reify/graph-read.stdout @@ -1,5 +1,5 @@ -thunk {thunk#1}() -> ::graph::TimeAxis { - let %0: ::graph::TimeAxis +thunk {thunk#1}() -> ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes { + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes bb0(): { %0 = input LOAD axis @@ -87,7 +87,7 @@ fn {graph::read::filter@7}(%0: (), %1: ::graph::types::knowledge::entity::Entity } *thunk {thunk#7}() -> List<::graph::types::knowledge::entity::Entity> { - let %0: ::graph::TimeAxis + let %0: ::graph::temporal::PinnedTransactionTimeTemporalAxes | ::graph::temporal::PinnedDecisionTimeTemporalAxes let %1: List<::graph::types::knowledge::entity::Entity> let %2: ()