RFC-0036 null validity bound: PostgreSQL decision
Versioned draft snapshot
RFCs, reference catalogs, and evidence reflect Spec 3b2e3e7a114fb826b1445d39a48756b8fff629cd. Counts and pending/status notes belong to that snapshot. Read the dated project update for later progress.
Source repositories are private during staging. Links marked “repository access required” need access to the linked repository.
This is a trace and gap record from the pinned draft specification. It does not establish proof or implementation conformance.
Authored contract and observed gap
RFC-0036 §8.2 defines validFrom = null as an unbounded past and validTo = null as an unbounded future. The interval is half-open. The in-memory and object-store graph readers now honor this rule, and PostgreSQL’s statement_select policy accepts either null bound.
PostgreSQL’s initial schema still declares graph.statement.valid_from TIMESTAMPTZ NOT NULL DEFAULT now(). graph.create_statement defaults p_valid_from to now(), the batch writer coalesces null to now(), and the TypeScript single-create adapter omits a null value. Multiple current-read and permission functions filter with valid_from <= now(); a nullable row would be invisible there. The SQL contract cannot currently represent the authored unbounded-past value. This is a public persistence and query behavior change, even though no Gnomon installation has been deployed.
Recommended decision
Honor the RFC literally for the first release. Make valid_from nullable with a null default; pass an explicit null through scalar and batch creates; validate a non-null end only when a non-null start exists; and use (valid_from IS NULL OR valid_from <= evaluation_time) throughout read, traversal, permission, explanation, and membership SQL. Keep valid_to > evaluation_time exclusive. Regenerate SQL bindings from source. Include direct, bulk, permission, and historical-query tests for both open and finite bounds.
The alternative is to change RFC-0036 to say omitted or null start means creation time. That would remove the unbounded-past state from the contract and differ from the other backends. No deployed data requires that compromise.
Acceptance criteria
- The SQL table, scalar create, batch create, and reopen function preserve explicit null bounds and reject
validFrom > validTowith the RFC error contract. - Every SQL read or permission path that checks current validity treats null start as unbounded past and a finite end as exclusive. Tests exercise an actual null database row under restricted RLS.
- TypeScript PostgreSQL create and bulk create behave identically for absent, null, and finite bounds. Generated database bindings and their drift gate pass.
- RFC source, domain projection, implementation audit, and migration record agree. The spec and site are republished or pinned together after the normative change.
Owner decision
Choose whether to preserve RFC-0036’s null/unbounded-past contract in PostgreSQL, or revise the RFC to creation-time semantics before the first release.