8000 test: add property tests for bitemporal interval and retraction semantics · Issue #211 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test: add property tests for bitemporal interval and retraction semantics #211

Closed

Description

@adityamukho

Source

Extracted from the reliability audit snippet: overlapping valid/tx time, historic range, straddling boundaries, gaps, conflicting facts, retractions, point/interval query classes.

Programmatic test scope

Add property-style tests for bitemporal semantics across generated transaction sequences and valid-time intervals.

Cases to cover

  • Overlapping valid intervals for the same EAV triple.
  • Gaps and boundary points at valid_from / valid_to.
  • Retraction followed by re-assertion.
  • :as-of transaction-count snapshots before, at, and after retractions.
  • Point-in-time, time interval, time-point lookup, and time-interval lookup queries.

Acceptance criteria

  • Tests compare query output against a small independent reference model.
  • Generated cases include edge boundaries and conflicting facts.
  • Failures print a minimal reproducible transaction/query sequence.

Activity

  1. added
    enhancementNew feature or request
    rustPull requests that update rust code
    stabilityStability/panic issue
    on May 1, 2026
  2. adityamukho commented on May 2, 2026

    @adityamukho
    CollaboratorAuthor

    Audit finding: The deep audit identified a concrete bug that this issue's test cases would catch: net_asserted_facts() (storage.rs:463-484) keys only on (entity, attribute, encode_value) — ignoring valid_from/valid_to. This means if the same EAV triple is asserted with two different valid-time intervals (e.g., salary=100k valid 2020-2022, then salary=100k again valid 2024-2026), only the latest-transacted one survives. A :valid-at "2021-06-01" query incorrectly returns empty.

    The pending_key (storage.rs:17) correctly includes valid_from, valid_to as part of the dedup key, so storage treats them as distinct facts. But the query pipeline collapses them before the valid-time filter runs.

    A property test covering "overlapping valid intervals for the same EAV triple" (listed in this issue's cases) would expose this immediately. The fix will land separately, but this issue's test scope is confirmed as high-value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    data-integrityData integrity issueenhancementNew feature or requestrustPull requests that update rust codestabilityStability/panic issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0