Semconv: type attributes after their values and expose whole enums #173
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 396 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #173"
general
weight: 0.35
inge4pres
Closes #99.
Two problems in the generated semconv attribute definitions:
1. every attribute was a
StringAttribute, whatever its registry type (http.response.status_codewas declared as a string), and arrays andtemplate[T]attributes were no exception;2. enum attributes were a different shape from the others: a
.basedefinition next to awell_known_valuesthat held a single arbitrary member, the first one, and not the enum.Changes
Typed attributes. The definition type now follows the registry type:
IntAttribute,DoubleAttribute,BooleanAttribute, the four array forms, andtemplate[T]takes the type ofT.resource.zigandtrace.zigalready handled int, double and boolean, and now share one type map withattribute.zig, which also adds arrays. Unknown types still fall back toStringAttribute.Enum attributes have the shape of every other attribute. There is no more
.base:http_request_method.name,.stability... likeserver_port.well_known_valuesis a declaration holding the whole enum,voidfor attributes without well-known values:A declaration cannot be read through a value (
method.well_known_valuesdoes not compile), hence the@TypeOf. The<name>Valueenums are unchanged. This matches the other languages' generated semconv, where the key is a flat definition and none nests it under a wrapper: Go and Java put the well-known values beside the key (sibling constants, a nested...Valuesclass), and Rust has no well-known values at all, only key constants.Int-valued enums.
cpython.gc.generationandrpc.grpc.status_codehave numeric members. They use a newIntEnumAttributeand spell their values withtoInt(), instead of atoString()returning"0".The generated files were regenerated with
zig build semconv-generate(weaver v0.16.1, spec 1.36.0), from the updated templates; regenerating the unchanged templates first gave no diff.Breaking changes
Intended, the module is alpha:
x.base.name/x.base.stabilitybecomex.name/x.stabilityfor the 125 attributes with well-known values;well_known_valuesis a type and no longer a value, andEnumAttribute.initno longer takes it;toString();StringAttributeare now typed, e.g.http_response_status_codeis anIntAttribute: code reading theirexamplesgets?[]const i64and no longer?[]const []const u8.Related
#84 builds on these definitions (
sdk.attributes.fromPairsmatches them structurally). Itsbuilders.zigreads.base.nameand thewell_known_valuesfield, so whichever of the two lands second needs a small follow-upTesting
zig build semconv-test semconv-examples semconv-run-examples sdk-test,zig fmt --check. The examples assert the new shapes (typed definitions,well_known_values, int enums).