From f1986ca26c32d2e65ad5022dfc9d1bec78c089d8 Mon Sep 17 00:00:00 2001 From: Jiri Puc Date: Fri, 25 Sep 2026 10:29:58 +0200 Subject: [PATCH 1/2] design: belief-time reads use the current fact window (D118) Record in D118 and its design that facts_as_of and graph believed_at reads select facts by ingested_at/invalidated_at and show each with its current, in-place-corrected window; earlier windows stay in the adjudication transcript. A window-history table is the rejected alternative. Assured fact operations answer current belief and take no believed_at. The query-space reference and the ask-about-the-past guide say so. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01AXAuJJ6Tswr9Q3Auc1VPKb --- decisions.md | 9 +++++++ plan/designs/mutable_fact_windows_design.md | 27 ++++++++++++++++--- website/public/llms-full.txt | 8 ++++++ .../docs/guides/ask-about-the-past/page.mdx | 3 +++ .../app/docs/reference/query-space/page.mdx | 5 ++++ 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/decisions.md b/decisions.md index 108ec6d40..76a14e88f 100644 --- a/decisions.md +++ b/decisions.md @@ -5840,6 +5840,15 @@ implementation was withdrawn as unneeded for an unreleased product Points to observe on real corpora are kept in [the watch list](plan/analysis/mutable_fact_windows_watch_list.md). +**Belief-time reads (2026-09-25).** Because windows change in place, a +belief-time read (`facts_as_of`, graph helpers with `believed_at`) selects +facts by `ingested_at`/`invalidated_at` and shows each with its current window; +earlier windows remain readable only in the adjudication transcript. A +window-history table is rejected as a second write path and forget target for a +question the transcript already answers. Assured fact operations keep answering +current belief; they take no `believed_at` +([design §2](plan/designs/mutable_fact_windows_design.md#2-one-chosen-window-with-honest-precision)). + **Authority and delivery.** [D118 design](plan/designs/mutable_fact_windows_design.md) contains the full concepts, semantics, alternatives, security/recovery obligations and explicit supersession map for D106/D107/D110–D113. [Analysis](plan/analysis/lean_mutable_fact_windows.md) diff --git a/plan/designs/mutable_fact_windows_design.md b/plan/designs/mutable_fact_windows_design.md index db81bb75d..4fcb1ee3a 100644 --- a/plan/designs/mutable_fact_windows_design.md +++ b/plan/designs/mutable_fact_windows_design.md @@ -87,10 +87,29 @@ possible matches when a needed endpoint is unknown. Precision describes dates, not a permanent classification of the statement. The current fact row is authoritative. The ordinary adjudication transcript -records prior values and the reason for changing them. System timestamps on a -row alone do not reconstruct every earlier date revision; historical-belief -queries must use retained revision history where that is part of their contract. -This amendment does not claim a new historical-belief query API. +records prior values and the reason for changing them. + +**Belief-time reads use the current window.** A belief-time read asks "what +did the memory believe at instant B?" The shipped ones are the +`facts_as_of(valid_at, believed_at, max_rows)` query-space function and the +graph helpers given both `valid_at` and `believed_at`. They select facts by +their system timestamps (`ingested_at <= B` and not invalidated by `B`) and +then apply the world-time filter to each fact's window **as it stands now**. +A window corrected in place after `B` is therefore shown corrected. Example: +a fact first recorded on 1 August as "2026-07-01 to open" and corrected on +17 September to "2026-06-15 to open" appears in a read at `believed_at = +2026-08-10` with the June start. The August value is kept in the fact's +adjudication transcript (the before/after window of that decision); the read +does not replay it. The public documentation of both reads states this. + +Keeping a versioned copy of every window (a window-history table that +belief-time reads would join) is the rejected alternative. It would add a +second write per window change inside the fact-application transaction, a +second store for hard forget to scrub, and a history-join on every as-of read, +to answer a question the transcript already answers for a single fact. The +fact operations (`facts_context` and the other assured operations) answer +current belief only; their `time` selects world time. A belief-time question +goes through `facts_as_of` or the graph helpers. ## 3. Identity and dates are one ordinary adjudication diff --git a/website/public/llms-full.txt b/website/public/llms-full.txt index a0ff43457..1de6e1a9f 100644 --- a/website/public/llms-full.txt +++ b/website/public/llms-full.txt @@ -4710,6 +4710,9 @@ for row in believed.rows: ``` It returns at most 200 rows by default (its third argument, up to 1,000). +It picks the facts the memory held on the belief instant, but shows each +with its dates as they stand today: a window corrected after that instant +comes back corrected. The graph calls `graph_neighborhood` and `graph_path` take the same two clocks as `valid_at` and `believed_at`. @@ -12415,6 +12418,11 @@ The facts that were valid at `valid_at`, as the memory believed at `believed_at`. `max_rows` defaults to 200, hard cap 1,000. Category: bitemporal. +Belief time selects which facts the memory held (`ingested_at` and +`invalidated_at`). World time is tested against each fact's window as it +stands now: a window corrected after `believed_at` is shown and filtered +corrected. + | Column | Type | |---|---| | `deployment_id` | uuid | diff --git a/website/src/app/docs/guides/ask-about-the-past/page.mdx b/website/src/app/docs/guides/ask-about-the-past/page.mdx index b302fd310..eb737f330 100644 --- a/website/src/app/docs/guides/ask-about-the-past/page.mdx +++ b/website/src/app/docs/guides/ask-about-the-past/page.mdx @@ -230,6 +230,9 @@ for row in believed.rows: ``` It returns at most 200 rows by default (its third argument, up to 1,000). +It picks the facts the memory held on the belief instant, but shows each +with its dates as they stand today: a window corrected after that instant +comes back corrected. The graph calls `graph_neighborhood` and `graph_path` take the same two clocks as `valid_at` and `believed_at`. diff --git a/website/src/app/docs/reference/query-space/page.mdx b/website/src/app/docs/reference/query-space/page.mdx index 7fce5c15b..121f20385 100644 --- a/website/src/app/docs/reference/query-space/page.mdx +++ b/website/src/app/docs/reference/query-space/page.mdx @@ -398,6 +398,11 @@ The facts that were valid at `valid_at`, as the memory believed at `believed_at`. `max_rows` defaults to 200, hard cap 1,000. Category: bitemporal. +Belief time selects which facts the memory held (`ingested_at` and +`invalidated_at`). World time is tested against each fact's window as it +stands now: a window corrected after `believed_at` is shown and filtered +corrected. + | Column | Type | |---|---| | `deployment_id` | uuid | From 3338d199c387c366c3b58bf7e79caf0dc5a4f12b Mon Sep 17 00:00:00 2001 From: Jiri Puc Date: Fri, 6 Nov 2026 10:36:36 +0100 Subject: [PATCH 2/2] docs: clarify historical belief reads under corrected fact windows --- decisions.md | 20 +++--- plan/analysis/lean_mutable_fact_windows.md | 39 ++++++++++++ plan/designs/mutable_fact_windows_design.md | 61 +++++++++++-------- plan/designs/open_query_space_design.md | 30 ++++++--- website/public/llms-full.txt | 51 +++++++++------- website/src/app/docs/concepts/time/page.mdx | 14 +++-- .../docs/guides/ask-about-the-past/page.mdx | 25 +++++--- .../app/docs/reference/query-space/page.mdx | 16 ++--- 8 files changed, 168 insertions(+), 88 deletions(-) diff --git a/decisions.md b/decisions.md index 9774c3137..30e469941 100644 --- a/decisions.md +++ b/decisions.md @@ -5953,14 +5953,18 @@ implementation was withdrawn as unneeded for an unreleased product Points to observe on real corpora are kept in [the watch list](plan/analysis/mutable_fact_windows_watch_list.md). -**Belief-time reads (2026-09-25).** Because windows change in place, a -belief-time read (`facts_as_of`, graph helpers with `believed_at`) selects -facts by `ingested_at`/`invalidated_at` and shows each with its current window; -earlier windows remain readable only in the adjudication transcript. A -window-history table is rejected as a second write path and forget target for a -question the transcript already answers. Assured fact operations keep answering -current belief; they take no `believed_at` -([design §2](plan/designs/mutable_fact_windows_design.md#2-one-chosen-window-with-honest-precision)). +**Belief-time coverage clarification (2026-11-06).** The shipped +`facts_as_of` and graph belief-time reads filter and display each fact's current +world window after selecting its recorded belief interval. Later corrections +can change which facts a past-belief query returns. This accepted limitation +is not full historical reconstruction and does not supersede the time-travel +requirement. Per-fact adjudication transcripts retain permitted before/after +values but do not replace a historical query across facts. No additional +history store, write path or reconstruction API is introduced or selected by +this clarification. Assured fact operations retain current-belief semantics. +[Design §2](plan/designs/mutable_fact_windows_design.md#2-one-chosen-window-with-honest-precision) +and the [coverage analysis](plan/analysis/lean_mutable_fact_windows.md#belief-time-query-coverage-2026-11-06) +state the example, remaining requirement, alternatives and erasure boundary. **Authority and delivery.** [D118 design](plan/designs/mutable_fact_windows_design.md) contains the full concepts, semantics, alternatives, security/recovery obligations diff --git a/plan/analysis/lean_mutable_fact_windows.md b/plan/analysis/lean_mutable_fact_windows.md index 28ee16582..1277531bc 100644 --- a/plan/analysis/lean_mutable_fact_windows.md +++ b/plan/analysis/lean_mutable_fact_windows.md @@ -205,3 +205,42 @@ and stable application uniqueness are concrete implementation-contract gates. Grok also requested explicit D43 measurement semantics and supersession labels at the old rule/DDL sites. Known reporting periods are finite world windows; reaching their end does not invalidate belief in the historical figure. + + +## Belief-time query coverage (2026-11-06) + +The owner accepted documenting the existing current-window limitation. This +clarification changes no runtime behavior and does not withdraw the full +`requirements_v3.md` knowledge-lifecycle requirement to reconstruct what was +believed at a past instant. + +The current SQL in +`src/rememberstack/spine/migrations/versions/p9_30_0051_mutable_fact_windows.py`, +`facts_as_of`, applies +belief membership (`ingested_at` / `invalidated_at`) and world-time predicates +to the same current row. `src/rememberstack/spine/fact_graph_contract.py` gives graph reads the +same window interpretation; their D140 document-period gate is separate. +If an August record originally started in July, a September correction moving +its start to June makes it match a June world-time query with an August belief +instant. A correction can also remove a previous match. The effect changes +historical result membership, not just the dates printed beside a result. + +`src/rememberstack/spine/apply_fact_decision.py` and +`src/rememberstack/spine/fact_window_review.py` record before/after windows +in ordinary decision payloads. Reading a known fact's transcript can explain +those decisions. It is not equivalent to finding every fact that matched an +earlier window across the collection: filtering on current windows may already +exclude the identities whose old windows need inspection. Erasure may clear +window values or scrub decision features; retained history is not an exemption +from hard forget and cannot guarantee replay of every former state. + +Three choices must remain distinct. Documenting the existing read has no new +storage, inference, ingestion-reuse or query cost. A derived historical read +over permitted journal data could avoid another write path, but requires proof +of complete update coverage, ordering, indexes, bounds and erasure behavior. +A dedicated window-history table would add transactional writes, retained rows +and deletion obligations while potentially simplifying historical lookup. +Neither reconstruction design is selected or implemented by this clarification. +Rejecting duplicated current-window authority does not prove historical +reconstruction unnecessary. The binding design names the implementation gap; +public docs describe the current result rather than promising a past snapshot. diff --git a/plan/designs/mutable_fact_windows_design.md b/plan/designs/mutable_fact_windows_design.md index f72ee71d1..c51fc0180 100644 --- a/plan/designs/mutable_fact_windows_design.md +++ b/plan/designs/mutable_fact_windows_design.md @@ -86,30 +86,43 @@ The retrieval contract in §5 distinguishes confirmed interval matches from possible matches when a needed endpoint is unknown. Precision describes dates, not a permanent classification of the statement. -The current fact row is authoritative. The ordinary adjudication transcript -records prior values and the reason for changing them. - -**Belief-time reads use the current window.** A belief-time read asks "what -did the memory believe at instant B?" The shipped ones are the -`facts_as_of(valid_at, believed_at, max_rows)` query-space function and the -graph helpers given both `valid_at` and `believed_at`. They select facts by -their system timestamps (`ingested_at <= B` and not invalidated by `B`) and -then apply the world-time filter to each fact's window **as it stands now**. -A window corrected in place after `B` is therefore shown corrected. Example: -a fact first recorded on 1 August as "2026-07-01 to open" and corrected on -17 September to "2026-06-15 to open" appears in a read at `believed_at = -2026-08-10` with the June start. The August value is kept in the fact's -adjudication transcript (the before/after window of that decision); the read -does not replay it. The public documentation of both reads states this. - -Keeping a versioned copy of every window (a window-history table that -belief-time reads would join) is the rejected alternative. It would add a -second write per window change inside the fact-application transaction, a -second store for hard forget to scrub, and a history-join on every as-of read, -to answer a question the transcript already answers for a single fact. The -fact operations (`facts_context` and the other assured operations) answer -current belief only; their `time` selects world time. A belief-time question -goes through `facts_as_of` or the graph helpers. +The current fact row is authoritative for the engine's current interpretation. +The ordinary adjudication transcript records before/after windows for decisions +that change them, subject to the existing erasure contract. + +**Belief-time reads apply current windows.** The shipped +`facts_as_of(valid_at, believed_at, max_rows)` function selects surviving facts +by `ingested_at <= believed_at` and not invalidated by that instant, then +filters and displays each fact's world window **as it stands now**. The graph +helpers given both instants use the same current-window interpretation and +also apply their D140 evidence-in-force gates. Neither read reconstructs earlier +fact-window revisions. + +For example, a fact recorded on 1 August says a job began on 1 July. On +17 September its start is corrected to 15 June. A query with `valid_at = +2026-06-20` and `believed_at = 2026-08-10` now returns that fact, although the +window recorded in August excluded 20 June. Shortening a window can instead +remove a fact from the same past-belief query. Corrections therefore change +result membership as well as displayed dates. The public documentation of both +reads states this limitation. + +This is an explicit implementation gap against the +[time-travel requirement](../requirements/requirements_v3.md#knowledge-lifecycle), +which still requires reconstructing what the engine believed at a past instant. +Accepting the current limitation does not remove that requirement or claim it +is fulfilled. Historical-belief queries require retained revision history +where that is their contract. A per-fact transcript can explain a known fact's +recorded decisions; it is not a collection-wide historical query and must not +be described as an equivalent replacement. Hard forget may erase transcript +payloads, and erased before-images must never be replayed. + +This clarification introduces no window-history table, second write path or +new historical reconstruction API. It does not rule out reconstruction from +permitted recorded history or select its storage design. The +[analysis](../analysis/lean_mutable_fact_windows.md#belief-time-query-coverage-2026-11-06) +separates the current read semantics, the requirement gap and the alternatives. +The assured fact operations answer current belief only; their `time` selects +world time and they take no `believed_at` input. ## 3. Identity and dates are one ordinary adjudication diff --git a/plan/designs/open_query_space_design.md b/plan/designs/open_query_space_design.md index eab92d2f4..383c6bd08 100644 --- a/plan/designs/open_query_space_design.md +++ b/plan/designs/open_query_space_design.md @@ -307,9 +307,12 @@ same instant. `at` or `from`/`to` echo the request after validation. The mode and its required fields are never inferred from null timestamps. These modes deliberately do not overload the separate audit question “what -did the system believe at T?” That two-axis reconstruction remains the -`facts_as_of(valid_at, believed_at, ...)`/open-SQL contract. Every returned fact -still discloses `valid_from`, `valid_until`, `ingested_at`, and +did the system believe at T?” The separate +`facts_as_of(valid_at, believed_at, ...)`/open-SQL read accepts both clocks, +but applies current fact windows rather than reconstructing their earlier +revisions. Its limitation against the full historical requirement is explicit +in [D118 §2](mutable_fact_windows_design.md#2-one-chosen-window-with-honest-precision). +Every returned fact still discloses `valid_from`, `valid_until`, `ingested_at`, and `invalidated_at`. All four modes confirm against `facts_visible_history` with the predicates above, the current-system-belief predicate, and the same D48 survivor/provenance conditions. For `current`, this is the parameterized form @@ -574,8 +577,9 @@ AND (valid_from IS NULL OR valid_from <= T) AND (valid_until IS NULL OR valid_until > T) ``` -Relation/observation fact world-validity alone uses half-open -`[valid_from, valid_until)` intervals; null endpoints are open. Claim-evidence +Relation/observation fact world-validity uses D118 half-open +`[valid_from, valid_until)` intervals. `open` precision explicitly means an +ongoing end; other missing endpoints are unknown. Claim-evidence overlap is inclusive because shipped `instant` precision requires `claim_valid_from = claim_valid_until`, which a half-open convention would make empty. All references to a current view in one SQL statement observe the same @@ -587,12 +591,18 @@ default/hard `max_rows` bounds are defined only by the §4.3 limits table. It applies: ```sql -ingested_at <= believed_at +(ingested_at IS NULL OR ingested_at <= believed_at) AND (invalidated_at IS NULL OR invalidated_at > believed_at) -AND (valid_from IS NULL OR valid_from <= valid_at) -AND (valid_until IS NULL OR valid_until > valid_at) +AND valid_from <= valid_at +AND (valid_precision = 'open' OR valid_until > valid_at) ``` +The world-window columns in this predicate are the fact's current values. +A later window correction can therefore add or remove a fact from a query with +fixed past `valid_at` and `believed_at`. This is historical belief-interval +selection under corrected windows, not a snapshot of all fact values as known +then. The full time-travel requirement is not claimed satisfied by this read. + It emits both instants, `identity_regime = 'current'`, and `evidence_count_current`, `contradict_count_current`, and `support_state_current`. The shipped identity enum is only `current` or `as_of`; @@ -600,8 +610,8 @@ this SRF does not offer as-of identity reconstruction. Manifest comments state that its `*_current` columns are live current-testimony values, not historical reconstructions. Graph helpers accept either neither instant (current semantics) or both; supplying only one raises PostgreSQL `invalid_parameter_value`, which -the public surface maps to `invalid_parameter`. PostgreSQL's unbounded -belief history is authoritative. +the public surface maps to `invalid_parameter`. These PostgreSQL reads have +no finite projection horizon, but do not reconstruct earlier fact windows. **D54 provenance and state.** `facts_visible_history` requires surviving historical provenance, not current support. A processing-withdrawn fact can diff --git a/website/public/llms-full.txt b/website/public/llms-full.txt index f9a70d9e1..085a8eea8 100644 --- a/website/public/llms-full.txt +++ b/website/public/llms-full.txt @@ -1731,9 +1731,9 @@ fact's only support (see [Updating a source](https://remember.dev/docs/concepts/ are never deleted by this: an invalidated fact stays in memory with the instant it ended. -The graph operations take both clocks together, for a two-axis question: -"what did the memory believe on `believed_at` about the world on -`valid_at`?" +The graph operations take both clocks together to select a past belief +interval and a world-time instant. Their current-window limitation is stated +below. ```python from datetime import datetime, UTC @@ -1756,9 +1756,11 @@ result's `temporal_scope` has mode `as_of` and names both. See **Note:** A fact's window is corrected in place. A `believed_at` read filters on -`ingested_at` and `invalidated_at`, and shows each fact with its window -as it stands today. The windows a fact had before a correction are kept -in its decision transcript, not replayed by the read. +`ingested_at` and `invalidated_at`, then filters and displays world time using +the fact's current window. A later correction can make a fact appear or +disappear from the same past-belief query. Recorded earlier windows may be +available in its decision transcript, subject to erasure; the read does not +replay them or provide a full historical-window reconstruction. ## When a version is in force @@ -5040,13 +5042,14 @@ Claims whose time is `unknown` have no window and are left out; the were said rather than when they happened, write a SQL query on `claims_live` with `asserted_at`; see [Explore memory with SQL](https://remember.dev/docs/guides/sql). -## What the memory believed on an earlier day +## Facts recorded on an earlier day -The time modes answer "what was true then, as we know it now". To ask -"what did the memory believe on 1 August about 1 July?", before the -17 September correction arrived, use the `facts_as_of` function in a SQL -query. SQL queries run over the query space, a set of prepared read-only -views and functions; every statement is checked against it before it runs +The time modes answer "what was true then, as we know it now". The separate +`facts_as_of` function selects facts recorded by a belief instant and not yet +invalidated then, and tests them against a world-time instant using their +current corrected windows. It does not reconstruct earlier fact-window values. +SQL queries run over the query space, a set of prepared read-only views and +functions; every statement is checked against it before it runs ([Explore memory with SQL](https://remember.dev/docs/guides/sql)). `facts_as_of` takes a world-time instant and a belief instant: @@ -5063,9 +5066,13 @@ for row in believed.rows: ``` It returns at most 200 rows by default (its third argument, up to 1,000). -It picks the facts the memory held on the belief instant, but shows each -with its dates as they stand today: a window corrected after that instant -comes back corrected. +Both filtering and the returned dates use the fact's window as it stands +today. A later correction can make a fact appear or disappear from the same +past-belief query. For example, a July start learned in August and corrected +to June in September now matches a query about June with an August belief +instant. A full reconstruction of the earlier window is not available through +this function. + The graph calls `graph_neighborhood` and `graph_path` take the same two clocks as `valid_at` and `believed_at`. @@ -14846,14 +14853,14 @@ text in SQL. facts_as_of(valid_at timestamptz, believed_at timestamptz [, max_rows integer]) ``` -The facts that were valid at `valid_at`, as the memory believed at -`believed_at`. `max_rows` defaults to 200, hard cap 1,000. Category: -bitemporal. +Facts recorded by `believed_at` and not invalidated by that instant, +matching `valid_at` under their current corrected world windows. `max_rows` +defaults to 200, hard cap 1,000. Category: bitemporal. -Belief time selects which facts the memory held (`ingested_at` and -`invalidated_at`). World time is tested against each fact's window as it -stands now: a window corrected after `believed_at` is shown and filtered -corrected. +Belief time filters `ingested_at` and `invalidated_at`. Both the world-time +filter and displayed dates use each fact's window as it stands now. A window +correction made after `believed_at` can therefore add or remove facts from the +result. This function does not reconstruct earlier fact-window revisions. | Column | Type | |---|---| diff --git a/website/src/app/docs/concepts/time/page.mdx b/website/src/app/docs/concepts/time/page.mdx index eb81c061f..d0ad25656 100644 --- a/website/src/app/docs/concepts/time/page.mdx +++ b/website/src/app/docs/concepts/time/page.mdx @@ -222,9 +222,9 @@ fact's only support (see [Updating a source](/docs/concepts/updating-sources)). are never deleted by this: an invalidated fact stays in memory with the instant it ended. -The graph operations take both clocks together, for a two-axis question: -"what did the memory believe on `believed_at` about the world on -`valid_at`?" +The graph operations take both clocks together to select a past belief +interval and a world-time instant. Their current-window limitation is stated +below. ```python from datetime import datetime, UTC @@ -247,9 +247,11 @@ result's `temporal_scope` has mode `as_of` and names both. See A fact's window is corrected in place. A `believed_at` read filters on -`ingested_at` and `invalidated_at`, and shows each fact with its window -as it stands today. The windows a fact had before a correction are kept -in its decision transcript, not replayed by the read. +`ingested_at` and `invalidated_at`, then filters and displays world time using +the fact's current window. A later correction can make a fact appear or +disappear from the same past-belief query. Recorded earlier windows may be +available in its decision transcript, subject to erasure; the read does not +replay them or provide a full historical-window reconstruction. diff --git a/website/src/app/docs/guides/ask-about-the-past/page.mdx b/website/src/app/docs/guides/ask-about-the-past/page.mdx index 1a6cb3700..06f2e2583 100644 --- a/website/src/app/docs/guides/ask-about-the-past/page.mdx +++ b/website/src/app/docs/guides/ask-about-the-past/page.mdx @@ -207,13 +207,14 @@ Claims whose time is `unknown` have no window and are left out; the were said rather than when they happened, write a SQL query on `claims_live` with `asserted_at`; see [Explore memory with SQL](/docs/guides/sql). -## What the memory believed on an earlier day - -The time modes answer "what was true then, as we know it now". To ask -"what did the memory believe on 1 August about 1 July?", before the -17 September correction arrived, use the `facts_as_of` function in a SQL -query. SQL queries run over the query space, a set of prepared read-only -views and functions; every statement is checked against it before it runs +## Facts recorded on an earlier day + +The time modes answer "what was true then, as we know it now". The separate +`facts_as_of` function selects facts recorded by a belief instant and not yet +invalidated then, and tests them against a world-time instant using their +current corrected windows. It does not reconstruct earlier fact-window values. +SQL queries run over the query space, a set of prepared read-only views and +functions; every statement is checked against it before it runs ([Explore memory with SQL](/docs/guides/sql)). `facts_as_of` takes a world-time instant and a belief instant: @@ -230,9 +231,13 @@ for row in believed.rows: ``` It returns at most 200 rows by default (its third argument, up to 1,000). -It picks the facts the memory held on the belief instant, but shows each -with its dates as they stand today: a window corrected after that instant -comes back corrected. +Both filtering and the returned dates use the fact's window as it stands +today. A later correction can make a fact appear or disappear from the same +past-belief query. For example, a July start learned in August and corrected +to June in September now matches a query about June with an August belief +instant. A full reconstruction of the earlier window is not available through +this function. + The graph calls `graph_neighborhood` and `graph_path` take the same two clocks as `valid_at` and `believed_at`. diff --git a/website/src/app/docs/reference/query-space/page.mdx b/website/src/app/docs/reference/query-space/page.mdx index 8c9076fc2..f6b465b2d 100644 --- a/website/src/app/docs/reference/query-space/page.mdx +++ b/website/src/app/docs/reference/query-space/page.mdx @@ -400,14 +400,14 @@ text in SQL. facts_as_of(valid_at timestamptz, believed_at timestamptz [, max_rows integer]) ``` -The facts that were valid at `valid_at`, as the memory believed at -`believed_at`. `max_rows` defaults to 200, hard cap 1,000. Category: -bitemporal. - -Belief time selects which facts the memory held (`ingested_at` and -`invalidated_at`). World time is tested against each fact's window as it -stands now: a window corrected after `believed_at` is shown and filtered -corrected. +Facts recorded by `believed_at` and not invalidated by that instant, +matching `valid_at` under their current corrected world windows. `max_rows` +defaults to 200, hard cap 1,000. Category: bitemporal. + +Belief time filters `ingested_at` and `invalidated_at`. Both the world-time +filter and displayed dates use each fact's window as it stands now. A window +correction made after `believed_at` can therefore add or remove facts from the +result. This function does not reconstruct earlier fact-window revisions. | Column | Type | |---|---|