Skip to content

rfc: add RFC 0040, the system column namespace - #546

Merged
azimafroozeh merged 4 commits into
ModernRelay:mainfrom
azimafroozeh:rfc-system-column-namespace
Sep 1, 2026
Merged

rfc: add RFC 0040, the system column namespace#546
azimafroozeh merged 4 commits into
ModernRelay:mainfrom
azimafroozeh:rfc-system-column-namespace

Conversation

@azimafroozeh

@azimafroozeh azimafroozeh commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What & why

This PR adds RFC 0040, which frees the property names id, src, and dst for user schemas and moves OmniGraph's implicit stored columns into a reserved namespace. Motivated by #529: a ported schema whose natural key is named id collides with the implicit physical id column, failing with a misleading error when declared with @key and silently producing a duplicate physical column without it.

  • Reserve the leading-underscore property namespace for the system; the per-name Lance reservations collapse into one prefix rule, and future system columns need no further reservations or versions.
  • Newly created graphs spell the system columns __id/__src/__dst; every existing graph keeps its current spellings through per-graph resolution keyed on its schema IR version, so the design contains no migration.
  • The query language gains meta-fields ($p.@id, $e.@src, $e.@dst) that work on every graph; $p.id keeps its exact current behavior on existing graphs (with a deprecation lint) and refers only to a user property on new ones.
  • API payloads carry each graph's own column names; an explicit per-graph upgrade renames the columns and mechanically rewrites the graph's stored queries in one schema apply.

Backing issue / RFC

Checklist

  • Change is focused (adds one RFC document, no source changes)
  • Tests added/updated for behavior changes (none: docs-only, no behavior change)
  • Public docs updated if user-facing surface changed (the RFC is the added document; user docs change with the implementation)
  • Reviewed against docs/dev/invariants.md: no Hard Invariant weakened; the RFC's Invariants section names the one knowingly brushed deny-list item (on-disk format change) and carries its refusal and compatibility evidence plan

Local verification

  • no build or test commands: docs-only RFC addition, no source touched
  • vocabulary guard not run: the diff touches only docs/rfcs/, outside the guarded surfaces

Notes for reviewers

  • No flag day: at the release boundary, existing graphs, queries, and clients see no behavior change beyond a deprecation lint; each graph adopts the new spellings at its own explicit upgrade.
  • The new binary permanently accepts exactly two schema IR vintages; old binaries refuse new-vintage graphs through the existing strict version validation.
  • A draft implementation is in progress alongside; unresolved questions 1 and 2 (Lance rename metadata-only, constraint endpoint spelling) are implementation gates, and question 3 is release timing.

Greptile Summary

The PR adds RFC 0040, proposing a reserved system-column namespace while preserving existing graph spellings through per-graph schema vintage.

  • Introduces __id, __src, and __dst storage names and corresponding query meta-fields.
  • Defines feature-set-based schema IR compatibility and explicit graph upgrades.
  • Documents stored-query rewriting, cluster rollout ordering, compatibility gates, and implementation tests.
  • Registers RFC 0040 in the RFC index.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains from the previously reported issues.

The revised RFC preserves vintage during ordinary applies, moves stored-query rewriting outside the graph transaction with a post-upgrade validation gate, and documents an ordered restart-before-upgrade rollout.

Important Files Changed

Filename Overview
docs/rfcs/0040-system-column-namespace.md Defines the system-column namespace, vintage-preserving compatibility model, explicit upgrade workflow, and associated validation gates.
docs/rfcs/README.md Registers RFC 0040 in the canonical RFC index.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Old[Old-vintage graph<br/>id / src / dst] --> Apply[Ordinary schema apply]
  Apply --> Old
  Old --> Rewrite[Rewrite stored queries<br/>to meta-fields]
  Rewrite --> Restart[Restart with rewritten registry]
  Restart --> Upgrade[Explicit graph upgrade]
  Upgrade --> New[New-vintage graph<br/>__id / __src / __dst]
  New --> Meta[Queries use @id / @src / @dst]
Loading

Reviews (4): Last reviewed commit: "review" | Re-trigger Greptile

@azimafroozeh
azimafroozeh marked this pull request as ready for review August 23, 2026 15:50
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment thread docs/rfcs/0040-system-column-namespace.md Outdated
Comment thread docs/rfcs/0040-system-column-namespace.md Outdated
Comment thread docs/rfcs/0040-system-column-namespace.md Outdated
@ragnorc

ragnorc commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The design is sound — spelling resolution keyed on the accepted IR's vintage (never physical inspection) keeps one source of truth, the meta-fields are proper grammar constructs, and the no-migration story is credible including the resolver-stamping landmine you caught. The reserved __ namespace is also going to pay off beyond this RFC: it gives future engine-owned computed columns (e.g. retrieval metric columns) a collision-free home with no per-name reservations.

Three fixes before acceptance:

  1. Template conformance (blocking): the file uses the retired header-table format (**Status**, **Author track**, provisional number). The registry mandates the exact YAML frontmatter schema and template sections — Evidence and tests, Rollout, and Decision log are currently missing (the evidence gates exist but are scattered inline), and Proposed isn't in the status enum.
  2. Registry: the diff never adds the 0040 row or removes the reservation sentence in docs/rfcs/README.md.
  3. The vintage-closure claim needs reconciling with rfc: add RFC 0044, derived edge identity via @key on edge types #592/feat(engine): add edge keys with derived identity #593: "the new binary accepts exactly two vintages, permanently" is already in tension with edge keys minting a third ir_version under a highest-required-stamp rule. An old-spelling graph that later declares an edge key is exactly the combination a single linear scalar can't express — suggest settling the joint numbering question (facets vs. linear) at acceptance of these two RFCs rather than leaving it to implementation-time coordination, since a third orthogonal schema feature (analyzed-search semantics) is already queued behind them.

@azimafroozeh
azimafroozeh force-pushed the rfc-system-column-namespace branch from cf354b6 to 463fd70 Compare September 1, 2026 13:51
@azimafroozeh
azimafroozeh force-pushed the rfc-system-column-namespace branch from 463fd70 to cd7aef7 Compare September 1, 2026 13:53
@azimafroozeh
azimafroozeh merged commit 12b9e9a into ModernRelay:main Sep 1, 2026
21 checks passed
@azimafroozeh
azimafroozeh deleted the rfc-system-column-namespace branch September 1, 2026 13:59
ragnorc added a commit that referenced this pull request Sep 1, 2026
…#598)

docs/rfcs/README.md carried literal <<<<<<>>>>>> conflict markers from
the #546 registry landing (commit 463fd70). Resolved to the marker's
own second side: RFC 0040 has landed, so its reservation sentence is
retired and only the next-available line remains.
@azimafroozeh azimafroozeh mentioned this pull request Sep 1, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants