RFC-0049 endpoint closure proposal
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: proposed, awaiting owner decision. Owners: Compiler, Graph Runtime. No normative source facts changed.
Counterexamples
Let G have vertices {a,b} and edge e from a to b. Let H contain only vertex a. Both satisfy RFC-0049 §3.2. Literal gnomon-set difference produces vertices {b} and edge {e}, so e lacks its subject vertex. Likewise, a selection predicate true for b and e but false for a retains a dangling edge. These are direct counterexamples to the §6 difference and §5 selection descriptions when combined with unconditional endpoint closure.
Recommended induced-edge semantics
For G=(V,E), define induced edges I(E,V) as the edges in E whose subject and object both belong to V.
- Difference: V’ = V1 minus V2; E’ = I(E1 minus E2, V’).
- Selection by predicate P: V’ = {v in V where P(v)}; E’ = I({e in E where P(e)}, V’).
- edges(G) remains its explicit §5 operation: retain E and exactly its endpoint vertices. It is distinct from selecting only edge-gnomons with a predicate.
- vertices(G) remains (V, empty edges).
These rules never reintroduce a removed or nonmatching vertex. They preserve the §5 no-added-gnomons property and prevent a hidden endpoint from being restored merely to make a result well formed. An author who wants edge selection with endpoint retention uses edges or an explicitly defined source operator whose authorization contract covers both endpoints.
Intersection remains vertex and edge intersection, which already preserves closure for valid inputs. Union remains vertex and edge union. Qualifier compatibility and authorization apply before these formulas; the formulas do not override temporal or permission failures.
byId contract
For a readable object ID, return that vertex with no edges. For a readable statement ID, return the edge and its two endpoints only if both endpoints are readable in the same tenant, principal, and temporal context. Otherwise return the empty subgraph, consistent with source missing-data behavior. Do not expose the hidden edge or add unauthorized endpoint placeholders. This extends the current zero-edge singleton description to cover both gnomon kinds explicitly.
Materialization must similarly remove any edge whose endpoints do not survive authorization filtering before emitting a self-contained subgraph wire value. Typed scalar or entity materializations have their separate output-shape rules.
Exact changes after approval
- RFC-0049 §4 byId signature/description: distinguish object and statement IDs.
- §5 selection: add the induced-edge formula and contrast its result with the explicit edges operator. §6 difference: add the induced-edge formula.
- §9.3: require endpoint-safe authorization redaction for subgraph wire form.
- Lean operator summaries, normative statements, examples, and authored RDF: propagate the same rules and refresh source-bound reviews.
Acceptance
- G minus H returns vertex b and no edges; selecting only b/e also has no edges.
- Selecting a/b/e retains the edge; selecting only a/b returns no edges.
- edges(G) retains a, b, and e; vertices(G) retains a and b without e.
- Difference from the empty graph preserves G; self-difference is empty.
- Every result satisfies endpoint closure and selection/difference never add vertices absent from their retained vertex sets.
- Statement byId returns both readable endpoints, handles self-loops, and returns empty for an unreadable endpoint or mismatched context.
- Permission revocation before materialization removes incident edges without revealing hidden endpoint identities.
- Test the implementation against these cases; mathematical formulas and source consistency alone are not runtime conformance.
Alternative: restore endpoint vertices after difference or selection. This can retain vertices expressly removed by the operation or rejected by its predicate and requires a separate authorization rule. It changes ordinary filtering semantics more substantially than induced-edge removal.