Skip to content

spec: finalize Literal carrier shape (RFC-001 §8.1) - #99

Merged
trendvidia merged 1 commit into
mainfrom
spec/064-literal-shape
Jul 16, 2026
Merged

spec: finalize Literal carrier shape (RFC-001 §8.1)#99
trendvidia merged 1 commit into
mainfrom
spec/064-literal-shape

Conversation

@trendvidia

Copy link
Copy Markdown
Owner

Closes #64 (spec item #15). Stacked on #98 (train: #94#95#96#97#98 → this); merge in order.

What

Replaces the placeholder Literal in descriptor.proto — the one bundle item that changes an existing wire shape, done now precisely because the carrier is unreleased and ratification (#56) freezes it:

  • EnumLiteral {enum_type, value_name, number} replaces string enum_name: enum references lower resolved — downstream consumers (protocheck, OpenAPI, codegen) never repeat linker work against a descriptor pool.
  • ListLiteral { repeated LiteralValue } replaces repeated AnnotationArg: elements are values, not arguments — the name and Expression junk states become unrepresentable. Homogeneous kind required (same enum_type for enum elements); mixed lists are compile errors; nesting legal. (this in [...] is unaffected — that whole rule is one opaque Expression.)
  • Message literals stay google.protobuf.Any, with the explicit-typing rule pinned: type from the param's declared type or an explicit use-site type name when the param is any — never inferred from value shape. Source-level spelling stays with the IETF draft (deps(actions): bump github/codeql-action from 3 to 4 #3).
  • RFC-001 §8.1: excerpt gains the four messages + a lowering-rules paragraph; §13 row 6 resolved; CHANGELOG.
  • Fixtures per acceptance criteria: 10_literal_args.proto (schema-text: enum ref + list literal) and 11_literal_carrier_golden.textproto (lowered AnnotationList covering all three kinds — protoc encode/decode-verified today, 334-byte binary).

Blast radius

Wire-breaking for the carrier by design, in the pre-freeze window: protocompile's shipped M1 lowering has no grammar path emitting enum/message/list annotation args yet (fixtures 01–06 contain none), so nothing emitted today changes. Follow-up: protocompile re-vendors descriptor.pb.go (same coordination pattern as the #35 descriptor_path bump).

trendvidia added a commit that referenced this pull request Jul 16, 2026
Ticks the six open-question boxes and adds a resolution record to each
section — GH #60#65, PR train #94#99 — with pointers to the follow-up
trackers (protocompile#67/#68, GH #102/#103) and the fixtures 07–11.
@trendvidia
trendvidia force-pushed the spec/063-streaming-contract branch from 6efd03d to c64d71b Compare July 16, 2026 06:19
@trendvidia
trendvidia force-pushed the spec/064-literal-shape branch 2 times, most recently from 2cadb16 to 3c7dc84 Compare July 16, 2026 06:24
trendvidia added a commit that referenced this pull request Jul 16, 2026
Ticks the six open-question boxes and adds a resolution record to each
section — GH #60#65, PR train #94#99 — with pointers to the follow-up
trackers (protocompile#67/#68, GH #102/#103) and the fixtures 07–11.
@trendvidia
trendvidia force-pushed the spec/063-streaming-contract branch from c64d71b to 7d03e8c Compare July 16, 2026 06:24
@trendvidia
trendvidia force-pushed the spec/064-literal-shape branch from 3c7dc84 to 97d22a1 Compare July 16, 2026 06:30
trendvidia added a commit that referenced this pull request Jul 16, 2026
Ticks the six open-question boxes and adds a resolution record to each
section — GH #60#65, PR train #94#99 — with pointers to the follow-up
trackers (protocompile#67/#68, GH #102/#103) and the fixtures 07–11.
@trendvidia
trendvidia force-pushed the spec/063-streaming-contract branch from 7d03e8c to 8f45f66 Compare July 16, 2026 06:30
trendvidia added a commit that referenced this pull request Jul 16, 2026
Ticks the six open-question boxes and adds a resolution record to each
section — GH #60#65, PR train #94#99 — with pointers to the follow-up
trackers (protocompile#67/#68, GH #102/#103) and the fixtures 07–11.
@trendvidia
trendvidia force-pushed the spec/063-streaming-contract branch from 8f45f66 to a203f09 Compare July 16, 2026 06:36
@trendvidia
trendvidia force-pushed the spec/064-literal-shape branch from 97d22a1 to 32281cf Compare July 16, 2026 06:36
Base automatically changed from spec/063-streaming-contract to main July 16, 2026 06:44
Resolves spec issue #15 (GH #64). In-place revision of the unreleased
carrier — the deliberate pre-freeze window for wire-shape changes.

- EnumLiteral {enum_type, value_name, number}: enum references lower
  RESOLVED; consumers never re-resolve bare names against a pool
  (replaces string enum_name).
- ListLiteral becomes repeated LiteralValue: elements are values, not
  arguments — no names, no expressions representable; homogeneous kind
  required (same enum_type for enum elements); nesting legal.
- Message literals stay google.protobuf.Any, with the explicit-typing
  rule pinned: type from the param declaration or an explicit use-site
  type name, never inferred from value shape; source spelling deferred
  to the IETF draft (#3).
- RFC-001 §8.1 excerpt + lowering rules prose; §13 row 6 resolved;
  CHANGELOG notes the protocompile descriptor.pb.go re-vendor follow-up.
- Fixtures: 10_literal_args.proto (schema-text: enum ref + list on
  any-typed params) and 11_literal_carrier_golden.textproto (lowered
  AnnotationList, all three kinds, protoc encode/decode-verified).
@trendvidia
trendvidia force-pushed the spec/064-literal-shape branch from 32281cf to aa00639 Compare July 16, 2026 06:45
trendvidia added a commit that referenced this pull request Jul 16, 2026
Ticks the six open-question boxes and adds a resolution record to each
section — GH #60#65, PR train #94#99 — with pointers to the follow-up
trackers (protocompile#67/#68, GH #102/#103) and the fixtures 07–11.
@trendvidia
trendvidia merged commit f29fffa into main Jul 16, 2026
4 checks passed
@trendvidia
trendvidia deleted the spec/064-literal-shape branch July 16, 2026 06:50
trendvidia added a commit that referenced this pull request Jul 16, 2026
* spec: finalize Literal carrier shape (RFC-001 §8.1)

Resolves spec issue #15 (GH #64). In-place revision of the unreleased
carrier — the deliberate pre-freeze window for wire-shape changes.

- EnumLiteral {enum_type, value_name, number}: enum references lower
  RESOLVED; consumers never re-resolve bare names against a pool
  (replaces string enum_name).
- ListLiteral becomes repeated LiteralValue: elements are values, not
  arguments — no names, no expressions representable; homogeneous kind
  required (same enum_type for enum elements); nesting legal.
- Message literals stay google.protobuf.Any, with the explicit-typing
  rule pinned: type from the param declaration or an explicit use-site
  type name, never inferred from value shape; source spelling deferred
  to the IETF draft (#3).
- RFC-001 §8.1 excerpt + lowering rules prose; §13 row 6 resolved;
  CHANGELOG notes the protocompile descriptor.pb.go re-vendor follow-up.
- Fixtures: 10_literal_args.proto (schema-text: enum ref + list on
  any-typed params) and 11_literal_carrier_golden.textproto (lowered
  AnnotationList, all three kinds, protoc encode/decode-verified).

* docs: record S1 resolutions (#11#16) in RFC-001-issues.md

Ticks the six open-question boxes and adds a resolution record to each
section — GH #60#65, PR train #94#99 — with pointers to the follow-up
trackers (protocompile#67/#68, GH #102/#103) and the fixtures 07–11.
trendvidia added a commit that referenced this pull request Jul 16, 2026
* spec: pin message-literal source grammar (RFC-001 §5.1, #102)

Expands the `literal` production left open in RFC-001 §5.1 and IETF
draft -01 (follow-up from #64 / PR #99, which pinned the carrier):

- messageLiteral: optional type name + braced colon-separated field
  inits — name REQUIRED when the param/field is `any`, OPTIONAL and
  verified otherwise; never inferred from shape
- listLiteral EBNF (used by fixture 10 but previously unpublished)
- tight subset, not full textformat: mandatory colon + commas, no
  trailing comma, fields at most once, repeated via list literals,
  maps deferred
- draft -01: ABNF additions, new Literal Values section, resolved
  open-issue bullet dropped
- grammar.ebnf: schema-extension section (with PXF-divergence notes)
- fixture 10 gains the Money message-literal use site; golden 11
  locations synced

Closes #102

* docs: record #15 source-spelling resolution (GH #102, PR #108)
This was referenced Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AnnotationArg Literal shape

1 participant