gnomonlearn
Docs/RFC-0050/Reference catalog

RFC-0050 · 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-0050: defined terms, diagnostics, dependencies, and invariants. It does not establish proof coverage or runtime conformance. The authored narrative lives in RFC-0050.

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


Title: Template-Mediated Creation Contract
Status: draft
Owners: Compiler, Module Platform, Runtime
Diagnostic range: M50000-M50099

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

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


Definitions

TermMeaning
Lineage subgraphThe closure of provenance statements rooted at any gnomon: the template, its arguments, the calling template (if any), the module, the principal.
Privileged write pathA small, named set of paths permitted to write graph.resource/graph.statement directly: the bootstrap loader, the system installer principal during install, and db.graph.unrestricted capability holders.
Provenance statementAn edge-gnomon that records one fact about a created gnomon’s origin. There are six provenance predicates.
Template invocation contextThe runtime context active during a template execution: the calling principal, the active transaction, the parent invocation, and the input arguments.
Template-mediated creationAn gnomon is created exclusively as the result of a template instantiation; never via direct DB write from outside db.graph.

Diagnostics

CodeSeverityDescription
M50010ErrorDirect write to graph.resource/graph.statement attempted outside a template invocation context
M50011ErrorDatabase-layer rejection of direct write (RLS gate); usually a defense-in-depth catch of M50010
M50012ErrorOperation effects block contains direct resource/statement effect not wrapped in template.compose
M50020Errordb.graph.unrestricted capability invoked without mandatory audit emission
M50021ErrorApplication module declares db.graph.unrestricted in tokens:; this capability is reserved to system contexts
M50030InfoModule manifest’s objects of type resource/statement produce gnomons with reduced provenance (install-time path)
M50040ErrorRequired provenance statement(s) missing from a created gnomon
M50050InfoGraph contains legacy gnomons without provenance statements (count emitted at install time)
M50060Warningcore.lineage traversal exceeded lineage-max-depth; result is truncated
M50070DefectTemplate marker present in graph client context but executor frame stack is empty (state divergence)
M50080WarningSensitive argument detected in template.with argument record; redaction applied — verify upstream caller intent

Dependency neighborhood

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

Invariants

  1. Cross-template-call lineage is captured via template.instantiated_from chains walkable by closure.
  2. Direct INSERT into graph.resource/graph.statement outside a template marker or admin session is rejected by RLS (M50011). (enforced by: RLS)
  3. Every gnomon is either the output of a template instantiation or of a privileged-write path; direct writes to graph.resource/graph.statement from elsewhere are prohibited. (enforced by: compile-time + runtime + RLS)
  4. Provenance statements are emitted in the same transaction as the created gnomon and commit atomically with it. (enforced by: runtime)
  5. Sensitive arguments are redacted before hashing in template.with argument records. (enforced by: runtime)
  6. The privileged-write path is restricted to bootstrap, the system installer, and holders of db.graph.unrestricted. (enforced by: RLS)
  7. The runtime template-marker stack mirrors the template executor’s call stack. (enforced by: runtime)
  8. core.provenance(gnomonId) returns a complete provenance subgraph for any gnomon.
  9. db.graph.unrestricted MUST be reserved to system contexts; application modules MUST NOT request it (M50021). (enforced by: compile-time)
  10. template.instance_of, module.installed_by, principal.created_by, and transaction.created_in are mandatory on every gnomon (with the bootstrap exception); missing any is M50040. (enforced by: compile-time)

Normative Statements

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

Compatibility and Migration

  1. MUST — The framework MUST tolerate legacy gnomons lacking provenance statements.
  2. MUST — The install engine MUST emit module.installed_by and principal.created_by for every install-time gnomon. (proof citation: rfc0050_b6_grounded; verification pending)

Compile-Time Validation

  1. MUST — Direct resource/statement effects in operations MUST be wrapped in a template.compose step. (proof citation: rfc0050_b0_grounded; verification pending)
  2. MUST — User-namespace operations emitting direct resource/statement effects without template.compose produce M50012. (proof citation: rfc0050_b20_grounded; verification pending)

Cross-Template-Call Lineage

  1. MUST — Gnomons produced by nested template calls record the calling template via template.instantiated_from. (proof citation: rfc0050_b2_grounded; verification pending)

Invariants

  1. MUST — Every gnomon has either template.instance_of, or was created by a privileged path with module.installed_by and principal.created_by present.
  2. MUST — template.instance_of, module.installed_by, principal.created_by, and transaction.created_in are mandatory on every non-bootstrap gnomon. (proof citation: rfc0050_b15_grounded; verification pending)

Provenance Schema

  1. MUST — Provenance statements are emitted in the same transaction as the gnomon they describe. (proof citation: rfc0050_provenance_same_transaction; verification pending)
  2. MUST — Sensitive argument fields are redacted before hashing in template.with records. (proof citation: rfc0050_sensitive_redacted; verification pending)

Purpose

  1. MUST — All non-intrinsic, non-bootstrap gnomon creation MUST go through a template. (proof citation: rfc0050_non_intrinsic_via_template; verification pending)

Runtime Validation

  1. MUST — Graph client write methods MUST reject calls when the template invocation marker stack is empty and the caller lacks db.graph.unrestricted. (proof citation: rfc0050_empty_stack_unrestricted_check; verification pending)

The Privileged-Write Path

  1. MUST_NOT — Application modules MUST NOT request the db.graph.unrestricted capability. (proof citation: rfc0050_app_modules_no_unrestricted; verification pending)
  2. MUST — Every invocation of db.graph.unrestricted MUST emit an audit log entry with unrestrictedCapability: true.
  3. MUST — Module manifests declaring db.graph.unrestricted MUST be reviewed manually before approval. (proof citation: rfc0050_b27_grounded; verification pending)

The Provenance Projection

  1. MUST — Lineage projection is depth-bounded (default 32).

The Single Rule

  1. MUST_NOT — Direct writes to graph.resource or graph.statement from outside privileged paths are prohibited. (proof citation: rfc0050_no_direct_writes; verification pending)
  2. MUST — Every gnomon is the output of either a template instantiation or a privileged-write path.

Linked References

DirectionTarget
Depends onRFC-0001
Depends onRFC-0005
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-0041
Depends onRFC-0042
Depends onRFC-0048
Depends onRFC-0049