gnomonlearn
Docs/RFC-0006 enum keyword proposal

RFC-0006 enum keyword 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 first-release language contract. Owners: Semantic Core and Module Platform. No system is deployed; no runtime data migration is needed.

Evidence and decision

RFC-0006 §4.B lists type and enum as separate declaration kinds. Section 4.8 instead says the type row is only a conceptual label for a named enumeration value type and that RFC-0008 surfaces it exclusively with the enum keyword. RFC-0008 §8.17 defines enum-decl and has no top-level type grammar. The RDF claim type-equals-enum selects §4.8, while the RDF domain projection contains separate type and enum declaration-kind IRIs.

The extracted sample corpus has 50 top-level type declarations in 36 .gnm files and no top-level enum declarations. The Lean frontend’s symbol table and enum check currently recognize type, so accepting those examples does not prove the RFC-0008 grammar. Some values are camelCase even though RFC-0006 §4.6a and RFC-0008 §8.17 require lower_snake_case. These are source and implementation changes, not a deployed compatibility obligation.

Recommended first-release contract: enum is the sole authoring keyword for named enumerations, and type is the conceptual value-type category, not a separate declaration kind. Keep inline enum as the scoped form. Remove the duplicate type declaration-kind row from §4.B, clarify §4.8, and reconcile Lean and RDF identities to one named-enum declaration kind. Convert the 50 sample declarations, their values and references where casing changes, then make the canonical parser and published compiler accept enum and reject top-level type with a useful diagnostic. The source-control history preserves the old examples; no temporary dual syntax is needed for the first release.

Alternative: retain top-level type and revise RFC-0008 to define it as the authoring keyword while reserving enum for inline forms. That preserves more sample text but makes the same enumeration concept use different names by scope and contradicts the current RFC-0008 examples and grammar.

Acceptance

  1. One authored declaration-kind row, one Lean definition, and one RDF identity describe the canonical named enumeration; query consumers and source-bound reviews are checked before dropping the duplicate IRI.
  2. RFC-0006, RFC-0008, companion Q&A, generated references, and all 50 corpus declarations use the chosen keyword and naming rule consistently.
  3. The parser, semantic checker, Graph module compiler, CLI, build loader, Bazel rule, and published bundle path agree on the keyword. Positive and negative fixtures cover top-level and inline forms, imports, values, and casing diagnostics.
  4. Regenerate Lean references and RDF from their sources, update review hashes, run corpus and query gates, and compare affected RDF result sets.