Skip to content

spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#15

Merged
trendvidia merged 3 commits into
mainfrom
v1.0-spec-rename
May 13, 2026
Merged

spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#15
trendvidia merged 3 commits into
mainfrom
v1.0-spec-rename

Conversation

@trendvidia
Copy link
Copy Markdown
Owner

Summary

Implements the three one-time spec changes from the protowire v1.0 freeze line (STABILITY.md) in lockstep with the other v1.0 ports.

  • @table@dataset (draft §3.4.4). Hard cutover, no alias period.
  • @proto directive added (draft §3.4.5). Four body shapes lexically distinguished (anonymous, named, source, descriptor). Descriptor form is the MUST-support shape; this port supports all four.
  • Reserved directive names expanded from 5 to 13 (draft §3.4.6).

Public API rename surface

Before After
Ast::TableDirective Ast::DatasetDirective
Ast::TableRow Ast::DatasetRow
class TableReader class DatasetReader
Result::Tables() Result::Datasets()
Result::AddTable() Result::AddDataset()
TokenKind::kAtTable kAtDataset
Ast::ProtoDirective + Ast::ProtoShape (new)
Document::protos + Result::Protos() + Result::AddProto() (new)
TokenKind::kAtProto (new)
IsFutureReservedDirective(name) from schema.h (new)

Source files renamed:

  • include/protowire/pxf/table_reader.hdataset_reader.h
  • src/pxf/table_reader.ccdataset_reader.cc
  • test/pxf_table_reader_test.ccpxf_dataset_reader_test.cc

@dataset's row message type is now optional in the AST — binding to an anonymous @proto per draft §3.4.4 Anonymous binding. Lexer::RepositionTo(int) added so the parser can skip past an @proto brace-body whose interior is protobuf source rather than PXF.

Test plan

  • CMake project VERSION bumped 0.75.01.0.0
  • cmake --build build clean (no errors in our code; absl/protobuf nullability warnings from headers are pre-existing)
  • ctest: 229 tests, 0 failures
  • New test/pxf_proto_directive_test.cc with 11 cases covering all four body shapes, anonymous binding, multi-@proto, nested-brace bodies, reserved-name rejection, @type coexistence

Companion releases (v1.0 lockstep):

  • protowire (spec) v1.0.0 ✅
  • protowire-go v1.0.0 ✅
  • protowire-java v1.0.1 ✅ (Maven Central)
  • protowire-typescript v1.0.0 ✅ (npm)
  • protowire-kotlin v1.0.0 ✅ (Maven Central)

After this merges + tags v1.0.0, protowire-python (which wraps this port via nanobind FFI) can land its v1.0 update.

Implements the three one-time spec changes from the protowire v1.0
freeze line (STABILITY.md) in lockstep with the other v1.0 ports.
Hard cutover, no alias period; v1.0 is itself the major bump.

Public API rename surface:
  Ast::TableDirective  → Ast::DatasetDirective
  Ast::TableRow        → Ast::DatasetRow
  class TableReader    → class DatasetReader
  Result::Tables()     → Result::Datasets()
  Result::AddTable()   → Result::AddDataset()
  TokenKind::kAtTable  → kAtDataset; + kAtProto                (new)
  Ast::ProtoDirective + Ast::ProtoShape (kAnonymous/kNamed/
                        kSource/kDescriptor)                   (new)
  Document::protos / Result::Protos() / Result::AddProto()     (new)
  IsFutureReservedDirective(name) from schema.h                (new)

Source files renamed:
  include/protowire/pxf/table_reader.h  → dataset_reader.h
  src/pxf/table_reader.cc               → dataset_reader.cc
  test/pxf_table_reader_test.cc         → pxf_dataset_reader_test.cc

New: test/pxf_proto_directive_test.cc with 11 cases covering all
four @proto body shapes, anonymous binding, multi-@proto, nested-
brace bodies, reserved-name rejection, @type coexistence.

@dataset's row message type is now optional in the AST (binding to
an anonymous @proto). Lexer::RepositionTo(int) added so the parser
can skip past an @proto brace-body whose interior is protobuf
source rather than PXF.

CMake project VERSION bumped 0.75.0 → 1.0.0.
ctest: 229 tests, 0 failures.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 13, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 87.31884% with 35 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pxf/decode_fast.cc 89.79% 6 Missing and 4 partials ⚠️
src/pxf/dataset_reader.cc 70.00% 3 Missing and 6 partials ⚠️
include/protowire/pxf/lexer.h 58.33% 3 Missing and 2 partials ⚠️
src/pxf/parser.cc 95.37% 3 Missing and 2 partials ⚠️
src/pxf/lexer.cc 33.33% 2 Missing and 2 partials ⚠️
src/pxf/ast.cc 84.61% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

CI's format-check flagged 25 violations across 7 files touched by
the rename / @proto addition. Re-ran clang-format -i (LLVM 22.1.5
from Homebrew) over the affected files; ctest still green (230/230).

No behavioural change.
Adds targeted coverage for the v1.0 additions previously below CI's
patch threshold (60.9% with 102 lines missing). Adds 12 new tests
to pxf_proto_directive_test.cc (now 23 total, 241 across the suite):

- ProtoFast fixture mirroring PxfDirectiveFast — drives consume-
  ProtoDirective + capture_brace_body on the fast path via
  Unmarshal / UnmarshalFull against test.proto's AllTypes. Covers
  all four body shapes (anonymous, named, source, descriptor),
  nested-brace bodies, multi-@proto, three error paths
  (bad-shape, named-missing-brace, anonymous-unmatched-brace),
  and a reserved-directive-name rejection. Exercises
  Result::AddProto / Result::Protos() accessors along the way.

- ProtoShape.NameLookup — covers ProtoShapeName for all four
  enum values. Adds the previously-declared-but-undefined
  ProtoShapeName implementation to src/pxf/ast.cc.

ctest: 241 tests, 0 failures.
@trendvidia trendvidia merged commit 5038132 into main May 13, 2026
10 checks passed
@trendvidia trendvidia deleted the v1.0-spec-rename branch May 13, 2026 11:11
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.

2 participants