Skip to main content

Caveman Test Fixtures API

Table of Contents

Top

upsquad/cavemantest/v1/clearance_cases.proto

Case1AnnotatedField

Case1AnnotatedField — field carries a proto edit_clearance option; walker MUST emit that value and source="proto".

FieldTypeLabelDescription
namestringname has an L3 edit clearance and explicit L2 read clearance.

Case2Leaf

Case2Leaf is the nested message whose secret_value has no annotation and must fail-closed.

FieldTypeLabelDescription
secret_valuestringsecret_value is deliberately un-annotated.

Case2NestedLeafUninherited

Case2NestedLeafUninherited — the parent field is annotated, but the nested leaf has no annotation and MUST NOT inherit. Walker emits 0 (fail-closed to L5) for the nested leaf.

FieldTypeLabelDescription
wrapperCase2Leafwrapper has an L3 edit_clearance, but its nested fields MUST NOT inherit it.

Case3OneofVariantUninherited

Case3OneofVariantUninherited — a oneof whose variants have no annotations MUST NOT inherit from anywhere. Walker emits 0 for the variants.

FieldTypeLabelDescription
arm_astringarm_a has no annotation.
arm_bint32arm_b has no annotation.

Case4ProtoWinsOverRegistry

Case4ProtoWinsOverRegistry — a field carries BOTH a proto annotation and a sibling-registry entry. Proto wins; source="proto".

FieldTypeLabelDescription
override_mestringoverride_me is annotated L3 in proto AND overridden L4 in registry.

Case5RegistryFallsThrough

Case5RegistryFallsThrough — a field without any proto annotation, but the sibling registry has an entry. Walker emits registry value, source="registry".

FieldTypeLabelDescription
registry_setstringregistry_set is un-annotated; resolved via the fixture registry YAML to L4.

Top

upsquad/cavemantest/v1/kinds_matrix.proto

ClientStreamRPCRequest

ClientStreamRPCRequest — unique body for the streaming RPC; lint requires distinct request/response types per RPC.

FieldTypeLabelDescription
chunkstringA string payload.

ClientStreamRPCResponse

ClientStreamRPCResponse — envelope.

MapRPCRequest

MapRPCRequest carries the map<K,V> branch. The walker treats map fields as JSON-textarea (FieldKindUnknown) and does not recurse into the synthetic entry message.

FieldTypeLabelDescription
labelsMapRPCRequest.LabelsEntryrepeatedA map<string,string> — renderers emit the JSON-textarea placeholder.

MapRPCRequest.LabelsEntry

FieldTypeLabelDescription
keystring
valuestring

MapRPCResponse

MapRPCResponse — envelope.

NestedRPCRequest

NestedRPCRequest covers the non-wrapper, non-well-known, non-map MessageKind path (falls through the well-known switch and recurses via buildMessageIR) and the SecretRef short-circuit preceding the well-known-type switch.

FieldTypeLabelDescription
nestedScalarRPCRequestA nested message — exercises recursion.
api_keyupsquad.secret.v1.SecretRefA SecretRef — exercises FieldKindSecretRef short-circuit.

NestedRPCResponse

NestedRPCResponse — envelope.

OneofRPCRequest

OneofRPCRequest exercises the FieldKindOneof path (real, non-synthetic).

FieldTypeLabelDescription
literalstringScalar arm.
structuredScalarRPCRequestMessage arm.

OneofRPCResponse

OneofRPCResponse — envelope.

RepeatedRPCRequest

RepeatedRPCRequest carries every FieldKind as a repeated field, driving the writeRepeated branches in both renderers end-to-end.

FieldTypeLabelDescription
a_stringsstringrepeatedrepeated string.
a_boolsboolrepeatedrepeated bool.
a_intsint32repeatedrepeated int32.
a_bytes_listbytesrepeatedrepeated bytes.
a_colorsKindsMatrixColorrepeatedrepeated enum.
a_timestampsgoogle.protobuf.Timestamprepeatedrepeated Timestamp.
a_durationsgoogle.protobuf.Durationrepeatedrepeated Duration.
a_structsgoogle.protobuf.Structrepeatedrepeated Struct → FieldKindStruct repeated.
a_anysgoogle.protobuf.Anyrepeatedrepeated Any.
a_msgsScalarRPCRequestrepeatedrepeated message.
a_secretsupsquad.secret.v1.SecretRefrepeatedrepeated SecretRef — hand-override expected in the generated TSX.

RepeatedRPCResponse

RepeatedRPCResponse — envelope.

ScalarRPCRequest

ScalarRPCRequest carries every proto scalar kind the walker switches on. Each field has an edit_clearance so the renderers emit path-keyed entries in the FIELD_EDIT_CLEARANCE map (exercises non-empty map path).

FieldTypeLabelDescription
a_boolboolA bool scalar.
a_int32int32An int32 scalar.
a_sint32sint32A sint32 — separate walker case from int32.
a_sfixed32sfixed32A sfixed32 — separate walker case from int32.
a_int64int64An int64 scalar.
a_sint64sint64A sint64 — separate walker case from int64.
a_sfixed64sfixed64A sfixed64 — separate walker case from int64.
a_uint32uint32A uint32.
a_fixed32fixed32A fixed32 — uint32 walker variant.
a_uint64uint64A uint64.
a_fixed64fixed64A fixed64 — uint64 walker variant.
a_floatfloatA float.
a_doubledoubleA double.
a_stringstringA string.
a_bytesbytesA bytes scalar.

ScalarRPCResponse

ScalarRPCResponse is the response envelope. Intentionally empty — renderers only walk requests.

WellKnownRPCRequest

WellKnownRPCRequest carries every well-known-type short-circuit branch.

FieldTypeLabelDescription
a_tsgoogle.protobuf.TimestampA Timestamp.
a_durgoogle.protobuf.DurationA Duration.
a_anygoogle.protobuf.AnyAn Any.
a_structgoogle.protobuf.StructA Struct.
a_valuegoogle.protobuf.ValueA Value (same walker branch as Struct).
a_listvaluegoogle.protobuf.ListValueA ListValue.
a_strvalgoogle.protobuf.StringValueA StringValue.
a_bytesvalgoogle.protobuf.BytesValueA BytesValue.
a_boolvalgoogle.protobuf.BoolValueA BoolValue.
a_i32valgoogle.protobuf.Int32ValueAn Int32Value.
a_i64valgoogle.protobuf.Int64ValueAn Int64Value.
a_u32valgoogle.protobuf.UInt32ValueA UInt32Value.
a_u64valgoogle.protobuf.UInt64ValueA UInt64Value.
a_floatvalgoogle.protobuf.FloatValueA FloatValue.
a_doublevalgoogle.protobuf.DoubleValueA DoubleValue.

WellKnownRPCResponse

WellKnownRPCResponse — envelope.

KindsMatrixColor

KindsMatrixColor is an enum with a few values, for FieldKindEnum coverage.

NameNumberDescription
KINDS_MATRIX_COLOR_UNSPECIFIED0Default unspecified.
KINDS_MATRIX_COLOR_RED1Red.
KINDS_MATRIX_COLOR_BLUE2Blue.

KindsMatrixService

KindsMatrixService wraps every message above as an RPC request type so the e2e test's generateFile pass renders every branch of every renderer.

Method NameRequest TypeResponse TypeDescription
ScalarRPCScalarRPCRequestScalarRPCResponseScalarRPC covers every scalar kind.
WellKnownRPCWellKnownRPCRequestWellKnownRPCResponseWellKnownRPC covers every well-known type.
RepeatedRPCRepeatedRPCRequestRepeatedRPCResponseRepeatedRPC covers every writeRepeated branch.
MapRPCMapRPCRequestMapRPCResponseMapRPC covers the map<> JSON-fallback branch.
NestedRPCNestedRPCRequestNestedRPCResponseNestedRPC covers message recursion + SecretRef.
OneofRPCOneofRPCRequestOneofRPCResponseOneofRPC covers the oneof expansion.
ClientStreamRPCClientStreamRPCRequest streamClientStreamRPCResponseClientStreamRPC proves the streaming-RPC placeholder branch (both renderers emit a disabled div and return early from writeRPCForm).

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)