gnomonlearn
Docs/RFC-0051 PostgreSQL domain review

RFC-0051 PostgreSQL domain review

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: all 102 domain nodes reviewed on 2026-10-05; 41 match and 61 have class, identity, or summary mismatches. Owners: Storage, Security, Compiler. No RDF facts changed.

Four nodes match: KP15 and KP24 design decisions, bootstrap.sql as a generated artifact, and the named db.pg.audit-trail aspect. Ten mismatch:

  • db.graph.unrestricted has no definition in authored RFC-0051 or Lean. Its claimed privilege to write outside templates requires an explicit security contract before it can be published as a capability.
  • KP28’s summary omits the ids ownership exception and development fallback.
  • Eight PostgreSQL table/function identities are typed NamedDeclaration, whose ontology means a Gnomon declaration instance. The PostgreSQL adapter source establishes backend objects, not corresponding DSL declarations.

The current StorageConstruct class means a source form or type selector, so it is not an automatic replacement for database object instances. Prepare a concrete class map after reviewing the remaining adapter identities. Retain subject IRIs only if they correctly identify the same entity across consumers.

Acceptance: resolve the capability source, accurately scope role ownership, identify database object versus authoring declaration identities, inspect shared consumers, obtain the owner’s class/identity decision, regenerate projections, and verify source-bound reviews and consumer queries. No deployment migration is required because Gnomon is not deployed.

Database objects, effect aliases, and columns

Sixteen additional nodes have source-bound mismatch verdicts. Seven table or function identities continue to use NamedDeclaration, and five SQL column identities use Field, whose ontology means a typed slot on a source declaration. The physical database objects need explicit classes and ownership.

Three resource-operation aliases describe genuine backend call mappings but are typed EffectKind without a typed-effect definition in the owning adapter source. The statement.upsert alias is more serious: §11.2 defines Create and CreateMany, not conflict-aware upsert semantics. Do not infer an upsert contract from these create calls.

The audit tenant column summary agrees with §9.2’s app.current_tenant_id capture, but §7.1’s five-GUC table omits that tenant setting. This runtime context gap needs reconciliation separately from the RDF class correction. No source projection facts changed in this review.

Resource/statement columns and invariants

Twenty-five more nodes were reviewed. Thirteen physical SQL column identities remain typed as source-declaration Fields. Their logical-to-physical mapping exists in §5, but the node IRIs and summaries identify the physical columns; the ontology must distinguish those identities explicitly.

Eleven invariant/module nodes match the source requirements. One additional summary mismatch says graph.reserved_namespaces is bootstrap-only, whereas §8 explicitly permits extension during db.graph module installation and prohibits additions only by application modules. Keep that privileged extension path visible when preparing the correction.

Source-bound coverage for this RFC is now 55 of 102 domain nodes. This review made no RDF fact changes and did not test database invariants at runtime.

Completed module, operation, and type review

The remaining 47 nodes are six platform modules, twenty logical data types, and twenty-one PostgreSQL function operations. Modules and types agree with §4, §6, §9, and §10’s adapter mapping. These are source-bound verdicts; they do not settle cross-RFC Number or other type-contract conflicts.

All twenty-one function nodes are typed Operation, but that ontology class means an algebra operation kind such as Source or Refinement. The functions are backend implementations identified by §11 and need database/runtime operation classes. They should be considered together with the earlier SQL functions typed NamedDeclaration when preparing a consistent adapter class map.

All 102 domain nodes now have source-bound verdicts. No RDF facts changed. The proposed map must distinguish modules, logical types, physical database objects, physical columns, backend operations, and authoring declarations, and preserve meaningful cross-layer links without conflating their identities.

Consumer scan correction

The wider source inventory found an explicit db.graph.unrestricted contract in RFC-0050 §7.3 and shared definitions in RFC-0036 and RFC-0050. The earlier adapter-local absence finding must not be interpreted as global absence. Preserve the capability; reconcile RFC-0051 attribution with its RFC-0050 owner. Ten RFC-0050 incoming references depend on it. The source-bound mismatch now records the missing owner attribution rather than unsupported authorization. All eighteen column nodes also have Field-implying property domains that need new column-specific predicates when retyped.