testdata: expand the schema-extensions conformance corpus (#68) - #156
Merged
Conversation
Comprehensive coverage per issue #68: every declaration shape (13), refinement over every value-shaped base kind (14), report goldens for collection/key validation incl. for_key (15), @sensitive redaction (16), the four named error states — missing impl (17), unsatisfiable default (18), locale-catalog miss (19), and invalid signature plus seven more must-not-compile fixtures (invalid/) — with the protocompile -> stock protoc -> re-marshal round-trip contract documented in the README (verified byte-identical over the full lowered corpus). Runtime goldens computed with protocheck and audited against the spec; the 15 map-key violation is spec-authored (engine gap trendvidia/protocheck#53). Fixture 14 pins fully-qualified TypeDecl.base_type_fqn (drift tracked in trendvidia/protocompile#121). Ledger #19 resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #68. Expands the corpus from 12 to 20 numbered fixtures plus an
invalid/suite, covering all five bullets of the issue:Declaration shapes —
13_declaration_shapes.proto. Paren-less and empty-paren annotation declarations; params of every §5.1 type (string/int32/int64/float/double/bool/bytes/any/expression and qualified-ident enum + message types) with defaults incl. negative literals; zero-param and multi-param functions; a function with both an option list and trailing annotations; a bare type alias; use sites with no parens, empty parens, all-defaulted args, positional-then-named args, bytes/float/negative args, bare enum-value refs, and message literals with and without the optional leading type name.Composition —
14_refinement_kinds.proto. Enum, wrapper (plus a chained derived alias), and message refinement; field-level rules stacked atop a chain; an alias as a repeated element type. (Chained refinement over primitives was already covered by 02.)Placements were already covered by 03 (message/oneof/service/rpc/enum/enum-value leading, field/enum-value trailing); 13 adds the trailing annotation list on
functionDecl.Error states — one report-golden fixture each, following the 07 executable pattern (schema + instance directory, top-level golden, pinned stubs/catalogs in the schema header):
17_missing_impl_golden— missing impl: lenient engine ⇒ reservedprotowire.function.unimplementedwith the spec-pinned fallback template; strict engines fail startup.invalid/arity_mismatch.proto— invalid signature: declared-function call arity mismatch is a compile error (§8.1).18_default_unsatisfiable_golden— unsatisfiable rule:@defaultfailing its own field's rules ⇒RULE_KIND_DEFAULTwith the substituted default asactual_value.19_catalog_miss— locale catalog miss: Report golden plus amessages_de.txtrendering golden (catalog hit interpolates function-authored params; miss falls back verbatim).Plus two goldens the ledger routed to #68:
15_collections_golden(per-element repeated/map validation incl. the key dimension withfor_key, #141/#153) and16_sensitive_golden(§6.7 redaction at all three attachment sites, #90/#21).Round trip. Documented in the README as the corpus's descriptor-level contract and verified here: the full positive corpus (all 17 schema fixtures + libraries, 24 files) compiles and lowers through the reference protocompile pipeline, and the lowered
FileDescriptorSetround-trips through stock protoc (decode → re-encode with the carrier + pxf schemas in scope) byte-identically (§8.5). All six report goldens, the config golden, and the carrier goldenprotoc --encodecleanly. The executable harness stays in protocheck'sroundtrip/(private-module graph); expanding its fixture list rides the next protowire pin bump.Verification. Every positive fixture compiled + carrier-dumped through local protocompile; all eight
invalid/fixtures rejected with diagnostics attributable to their manifest error class; goldens 16–19 are byte-for-byte the reports protocheck v2.1.0 emits (engine/wall_time omitted per cross-port equality); golden 15 matches except the map-key violation, which is spec-authored because the engine does not validate the key dimension yet.Reference-toolchain gaps found and filed while building this:
TypeDecl.base_type_fqnlowers as-written instead of fully qualified (fixture 14 pins the FQN expectation).Ledger #19 marked resolved in
docs/RFC-001-issues.md.