feat: introduce a temporal oracle for bitemporal memory replay - #873
Draft
Gardenia-zx wants to merge 23 commits into
Draft
Gardenia-zx wants to merge 23 commits into
Gardenia-zx wants to merge 23 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
OSPP 2026 project context
This PR is the Phase 1 milestone delivery of my Open Source Promotion Plan (OSPP) 2026 project for Apache GeaFlow, under the broader Dynamic Context Memory proposal described in #683.
The overall OSPP project explores how GeaFlow can support evolving contextual memory for AI applications. Phase 1 focuses on establishing a correctness-first Temporal Oracle: a deterministic reference implementation for representing, normalizing, replaying, querying, comparing, and recovering bitemporal memory state.
The Temporal Oracle is intended to serve as the correctness baseline for later integration, scalability, and performance work.
Phase 1 deliverables
ADD,CORRECT, andRETRACTMemoryGraphArchitecture overview
The main processing flow is:
MemoryEvent→EventNormalizer→NormalizedMemoryEvent→FullReplayOracle/IncrementalTemporalIntegrator→TemporalState→CanonicalSnapshotThe resulting canonical snapshot can then be:
SnapshotComparator;MemoryGraphrepresentation.Main changes
ADD,CORRECT, andRETRACTevents, including interval splitting and tombstones.SUPERSEDES,DUPLICATE_OF, andCONFLICTS_WITHrelations between fact versions.MemoryGraphmodel.Core semantics and invariants
[start, end).Addressed high-priority pre-PR review findings
Instantnanosecond precision during event normalization and payload hashing.Suggested review order
The implementation can be reviewed in the following order:
temporal/model: domain objects, interval rules, and invariants.temporal/semantics: event normalization, ledger behavior, and temporal state.temporal/oracleandtemporal/query: replay rules and bitemporal queries.temporal/integration: incremental integration, aggregation, serialization, and recovery.temporal/adapter: snapshot-to-MemoryGraphround trip and graph validation.Scope and boundaries
This is an additive Phase 1 correctness/reference implementation.
org.apache.geaflow.ai.temporalpackage.geaflow-ai/pom.xml.This PR intentionally contains the complete Phase 1 vertical slice so that replay equivalence, state recovery, and graph round-trip invariants can be reviewed together.
It does not represent completion of the entire OSPP project. Later work may build on this correctness foundation to address production-facing APIs, distributed temporal processing, retrieval integration, scalability, and performance evaluation.
Because this milestone is larger than a typical feature PR, it is intentionally opened as a Draft PR for early architecture and correctness review. In particular, feedback is welcome on:
If maintainers prefer smaller PRs, the implementation can be split into:
MemoryGraphadapter and graph validation.How was this PR tested?
Validation completed:
geaflow-aimodule test suite: 181 tests, 0 failures, 0 errors, and 2 platform-specific skips on Windows.TemporalStateRecoveryTestunder WSL/Linux: 8/8 passed.