gnomonlearn
Docs/RFC-0049/Reference catalog

RFC-0049 · Reference catalog

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.

← Read the authored RFC

Generated reference catalog. This page renders structured Lean data for RFC-0049: defined terms, diagnostics, dependencies, and invariants. It does not establish proof coverage or runtime conformance. The authored narrative lives in RFC-0049.

This page is generated from the lean/Gnomon/Spec/ module for RFC-0049. Edit that source and regenerate this catalog.


Title: Projection Algebra
Status: draft
Owners: Compiler, Graph Platform, Module Platform
Diagnostic range: M49000-M49099

Depends on: RFC-0001, RFC-0006, RFC-0007, RFC-0008, RFC-0010, RFC-0024, RFC-0033, RFC-0036, RFC-0037, RFC-0038, RFC-0039, RFC-0040, RFC-0042, RFC-0048

Proof citations in source: 17 / 17. Standalone proof verification is pending.


Definitions

TermMeaning
AggregationA function Subgraph → Scalar | Tuple; the single boundary at which the algebra exits the closed carrier and produces a non-gnomon value.
CarrierThe set of all gnomons in the runtime; the graph (graph.resource ∪ graph.statement) at a given system time and valid time is the carrier instance.
Closure projectionA projection that walks edges to expand a subgraph (traversal, transitive closure).
Composition projectionA projection that combines two or more input subgraphs (∪, ∩, \, ⋈).
MaterializationThe boundary operation that converts a subgraph to a wire-form value; preserves structure but flattens to a serializable form.
ProjectionA typed function Subgraph → Subgraph satisfying closure: every output is a valid input to another projection.
Provenance projectionThe named projection provenance(a) that returns the template-instantiation lineage subgraph rooted at any gnomon.
QueryA typed, named declaration that exposes a parameterized projection as a callable read operation.
Refinement projectionA projection that filters or restricts an input subgraph (σ, π, ρ).
Source projectionA projection that takes the empty subgraph plus parameters and produces a subgraph derived from the carrier.
SubgraphA set of gnomons: zero or more object-gnomons and zero or more edge-gnomons. Every projection’s input and output is a subgraph.

Diagnostics

CodeSeverityDescription
M49010ErrorSubgraph violates edge-endpoint closure: an edge references a vertex not in the subgraph
M49020ErrorSource projection attempted across tenant boundaries
M49021InfoSource projection excluded gnomons due to predicate-policy authorization (emitted with —verbose-projection)
M49030ErrorComposition ∩ or \ mixes subgraphs with mismatched bitemporal qualifiers
M49031Errortraverse mixes subgraphs with mismatched bitemporal qualifiers
M49040InfoAggregation on empty subgraph returned null for avg/min/max; consider explicit default in caller
M49050ErrorMaterialization cannot satisfy declared returns type (subgraph shape mismatch)
M49060WarningProjection cannot be compiled as view or reactive due to non-pure structure; falling back to live
M49070Defectservice/system-auth projection result was returned across a principal boundary without re-filtering — potential data leak
M49080ErrorQuery declaration body contains side effects or non-projection operators
M49090ErrorMutation attempts direct write to graph.resource or graph.statement; mutations MUST use templates
M49100ErrorProjection body is imperative (sequenced statements); projections MUST be pure expressions
M49110Warningservice-auth projection crosses tenant boundary; audit emission (RFC-0047) is mandatory
M49120WarningOperator precedence ambiguous; recommend explicit parentheses
M49130ErrorBitemporal qualifier references a future time without explicit permitFuture: true annotation
M49140ErrorgroupBy partition count exceeds the configured cardinality limit (default 10000)

Dependency neighborhood

graph LR
  nRFC_0049["RFC-0049"]
  nRFC_0001["RFC-0001"]
  nRFC_0049 --> nRFC_0001
  nRFC_0006["RFC-0006"]
  nRFC_0049 --> nRFC_0006
  nRFC_0007["RFC-0007"]
  nRFC_0049 --> nRFC_0007
  nRFC_0008["RFC-0008"]
  nRFC_0049 --> nRFC_0008
  nRFC_0010["RFC-0010"]
  nRFC_0049 --> nRFC_0010
  nRFC_0024["RFC-0024"]
  nRFC_0049 --> nRFC_0024
  nRFC_0033["RFC-0033"]
  nRFC_0049 --> nRFC_0033
  nRFC_0036["RFC-0036"]
  nRFC_0049 --> nRFC_0036
  nRFC_0037["RFC-0037"]
  nRFC_0049 --> nRFC_0037
  nRFC_0038["RFC-0038"]
  nRFC_0049 --> nRFC_0038
  nRFC_0039["RFC-0039"]
  nRFC_0049 --> nRFC_0039
  nRFC_0040["RFC-0040"]
  nRFC_0049 --> nRFC_0040
  nRFC_0042["RFC-0042"]
  nRFC_0049 --> nRFC_0042
  nRFC_0048["RFC-0048"]
  nRFC_0049 --> nRFC_0048

Invariants

  1. Aggregations are scalar/tuple producers and cannot feed back into the projection algebra; closure ends at aggregation. (enforced by: compile-time)
  2. Composition operators reject or normalize subgraphs whose bitemporal qualifiers differ; traverse rejects mismatches outright. (enforced by: compile-time + runtime)
  3. Every edge-gnomon in a subgraph references vertices that are also in that subgraph; subgraphs are self-contained. (enforced by: compile-time + runtime)
  4. Every projection operator handles the empty subgraph gracefully, returning empty or zero rather than throwing. (enforced by: runtime)
  5. Every projection’s output is a valid input to another projection; aggregation and materialization are the only exit points. (enforced by: compile-time)
  6. Every source projection is filtered by the active session’s tenant context; cross-tenant gnomons are unreachable. (enforced by: runtime + RLS)
  7. Mutation invocations require an idempotency key so that replays remain safe. (enforced by: runtime)
  8. Mutations MUST be expressed as one or more template invocations and MUST NOT directly write graph.resource or graph.statement. (enforced by: compile-time + runtime)
  9. Mutations MUST emit template-instance-of, template-with, and module-installed-by provenance for every gnomon they create. (enforced by: runtime)
  10. Projection bodies are pure expression trees with no imperative or mutating steps. (enforced by: compile-time)
  11. Projections cannot cross tenant boundaries except through explicitly elevated service-scoped projections with mandatory audit emission. (enforced by: compile-time + runtime)
  12. Query declarations MUST NOT have side effects; their bodies must be purely projective and idempotent. (enforced by: compile-time)
  13. Source projections exclude gnomons the principal cannot read under predicate-policy authorization. (enforced by: runtime)
  14. When no bitemporal qualifier is given, projections default to asOf(now()).validAt(now()) and propagate qualifiers consistently. (enforced by: compile-time + runtime)

Normative Statements

Statements are structured source data. Proof citations, where present, have not passed a standalone Gnomon proof gate.

Aggregation

  1. MUST_NOT — Aggregation outputs are not subgraphs and cannot feed back into the projection algebra.
  2. MUST — Aggregations honor authorization by excluding unreadable gnomons, producing principal-relative aggregates. (proof citation: rfc0049_aggregation_honors_auth; verification pending)

Bitemporal Qualifiers

  1. MUST — Authors wanting explicit mixed-time analysis must use named projections that materialize into a comparison form rather than algebraic mixing. (proof citation: rfc0049_mixed_time_via_named_projection; verification pending)
  2. MUST — Composition operators on subgraphs with different bitemporal qualifiers must normalize per defined rules. (proof citation: rfc0049_qualifier_normalization_total; verification pending)
  3. MUST — Inputs to traverse must have matching bitemporal qualifiers; mismatch is an error. (proof citation: rfc0049_traverse_requires_match; verification pending)

Composition Rules and Invariants

  1. SHOULD — Compilers should optimize using the algebraic identities for union, intersection, and difference with the empty subgraph. (proof citation: rfc0049_subgraph_identities; verification pending)
  2. MUST — Projection bodies must be pure expression trees, not sequences of mutating statements. (proof citation: rfc0049_projections_are_pure; verification pending)
  3. MUST_NOT — Projections must not cross tenant boundaries; cross-tenant analysis requires explicit service-scoped elevation and audit.

Materialization

  1. MUST — Materialize evaluates predicate-policy permissions at every gnomon boundary; unauthorized gnomons are dropped. (proof citation: rfc0049_materialize_honors_policy; verification pending)
  2. MUST_NOT — Null is never emitted on the wire; optional absent fields are omitted. (proof citation: rfc0049_no_null_on_wire; verification pending)

Mutation Declarations

  1. MUST — A mutation must be expressed as one or more template invocations; direct writes to graph.resource or graph.statement are forbidden. (proof citation: rfc0049_mutation_via_template; verification pending)
  2. MUST — A mutation must produce provenance for every gnomon created. (proof citation: rfc0049_mutation_produces_provenance; verification pending)
  3. MUST — A mutation must require an idempotency key so replays are safe.

Query Declarations

  1. MUST — A query must be idempotent — same inputs return the same value modulo carrier motion.
  2. MUST_NOT — A query must not have side effects; compilers must reject non-purely-projective query bodies. (proof citation: rfc0049_query_no_side_effects; verification pending)
  3. MUST — A query must respect authorization — the principal’s view of the carrier scopes the projection. (proof citation: rfc0049_query_scoped_by_principal_view; verification pending)

Refinement Projections

  1. MUST_NOT — Refinement projections never add gnomons to a subgraph. (proof citation: rfc0049_refinement_never_adds; verification pending)

Source Projections

  1. MUST — Every source projection is filtered by the active session’s tenant context; cross-tenant gnomons are unreachable. (proof citation: rfc0049_source_projection_tenant_scoped; verification pending)
  2. MUST — Source projections honor bitemporal qualifiers, defaulting to asOf(now()).validAt(now()) when none given. (proof citation: rfc0049_source_projection_bitemporal_default; verification pending)
  3. MUST — Source projections honor predicate-policy authorization, excluding gnomons the principal cannot read. (proof citation: rfc0049_source_projection_predicate_policy; verification pending)

The Closure Property

  1. MUST — Every projection’s input and output is a subgraph (subgraph-in / subgraph-out closure).
  2. MUST — For every edge in a subgraph, both endpoints must be in the subgraph’s vertex set.

The projection Declaration Kind

  1. MUST — Service- or system-scoped projections returning principal-restricted gnomons must be wrapped by a query that re-applies user-level filtering. (proof citation: rfc0049_service_scoped_requires_user_wrapping; verification pending)

Linked References

DirectionTarget
Depends onRFC-0001
Depends onRFC-0006
Depends onRFC-0007
Depends onRFC-0008
Depends onRFC-0010
Depends onRFC-0024
Depends onRFC-0033
Depends onRFC-0036
Depends onRFC-0037
Depends onRFC-0038
Depends onRFC-0039
Depends onRFC-0040
Depends onRFC-0042
Depends onRFC-0048