RFC-0036 statement identity and interval conflict 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.
Status: owner decision required before first normative graph release. Owners: Graph Platform, Storage, spec. No Gnomon deployment needs a data migration.
Authored contract
RFC-0036 §4.2 invariants 4–5 permit multiple rows for the same (subjectId, predicateId, objectId) when validity intervals are disjoint, require overlap rejection with M36011, and prohibit backend silent deduplication. RFC-0037 names a client statement.upsert as the layer that controls upsert semantics. The current graph client has create and createMany calls but no such upsert operation.
Current behavior
| Backend | Duplicate triple behavior | Historical intervals |
|---|---|---|
| PostgreSQL | unique_statement is unique on the triple alone. The shipped reopen migration returns the existing ID for an open duplicate and overwrites the same row’s bounds when a closed triple is recreated. Batch create deduplicates its input by triple. | A closed interval is lost when that row is reopened. The PGlite regression currently asserts one row after repeated reopen cycles. |
| Object store | FileStatementService.Create returns the existing ID for any non-deleted duplicate triple, including a closed or future interval. | A second disjoint interval cannot be inserted through create. |
| Memory | MemoryStatementQueries.create allocates a new ID for every call and does not check overlap. | Disjoint intervals can coexist, but overlapping intervals also coexist silently. |
M36010 now rejects reversed finite bounds in each backend, but it does not address triple overlap or duplicate handling.
Recommendation
Keep RFC-0036’s temporal statement model for the first release. Define interval overlap using open bounds as negative/positive infinity and half-open endpoints, so adjacent intervals are disjoint. Give each successful create a new statement ID; return M36011 on overlap. PostgreSQL must remove triple-only uniqueness and enforce non-overlap transactionally; scalar and batch creation must share this rule. Implement an explicit client upsert if callers need idempotent active edges. Reconcile reopen and grant/revoke consumers against this API instead of hiding history in backend create. Test simultaneous inserts, adjacent intervals, open bounds, invalidation, re-add, and batch rollback. The M6.2 CRDT plan’s future partial indexes must be composed with this temporal rule rather than assumed to implement it.
The alternative is to revise RFC-0036 to specify one mutable row per triple and make the current PostgreSQL/object-store deduplication canonical. That removes multi-interval history and makes M36011 inapplicable; it would require changes to RFC prose, Lean, RDF, diagnostic catalogs, and any bitemporal public claims. The memory backend would also need to adopt that identity rule.
Acceptance criteria
- Record one canonical statement identity and interval conflict rule in authored RFC, Lean, RDF, diagnostics, and graph backend model.
- Make PostgreSQL, object store, and memory create and bulk create agree on new ID versus error, finite and open-bound overlap, adjacency, closed-row re-add, and concurrent writes.
- Update client upsert and application reconciliation callers to request idempotence explicitly if the temporal model is chosen.
- Regenerate bindings and projections, rebind affected source reviews, run cross-backend conformance and published-artifact tests, and update the migration record.
Owner decision
Choose the RFC-0036 multi-interval temporal model or revise the first-release RFC to a single mutable row per triple.