Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5953,6 +5953,19 @@ 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 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
and explicit supersession map for D106/D107/D110–D113. [Analysis](plan/analysis/lean_mutable_fact_windows.md)
Expand Down
39 changes: 39 additions & 0 deletions plan/analysis/lean_mutable_fact_windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
42 changes: 37 additions & 5 deletions plan/designs/mutable_fact_windows_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +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. 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.
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

Expand Down
30 changes: 20 additions & 10 deletions plan/designs/open_query_space_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -587,21 +591,27 @@ 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`;
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
Expand Down
45 changes: 30 additions & 15 deletions website/public/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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:

Expand All @@ -5063,6 +5066,13 @@ for row in believed.rows:
```

It returns at most 200 rows by default (its third argument, up to 1,000).
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`.

Expand Down Expand Up @@ -14843,9 +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 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 |
|---|---|
Expand Down
14 changes: 8 additions & 6 deletions website/src/app/docs/concepts/time/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -247,9 +247,11 @@ result's `temporal_scope` has mode `as_of` and names both. See
<Callout type="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.

</Callout>

Expand Down
22 changes: 15 additions & 7 deletions website/src/app/docs/guides/ask-about-the-past/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -230,6 +231,13 @@ for row in believed.rows:
```

It returns at most 200 rows by default (its third argument, up to 1,000).
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`.

Expand Down
11 changes: 8 additions & 3 deletions website/src/app/docs/reference/query-space/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +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.
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 |
|---|---|
Expand Down
Loading