Skip to content

R6

What to build

Approved log-extra names cannot emit invalid numeric attribute values.

Source and evidence

Repository scientific/architectural review, snapshot 86c8517, item R6. Classification: confirmed defect; medium severity.

The handler checks broad scalar types and passes integers/floats through unchanged. It does not reuse the core's finite-float and signed-64-bit integer validation. Approved attribute names therefore do not establish approved attribute values. This violates the repository invariant that emitted attributes pass the existing schema and safety path.

Reproduction: register measurement as an event attribute, create ordinary LogRecords whose extra is respectively NaN, infinity, and 2**80, then call the real _OtelLogHandler.emit() with a capturing provider. All three reached the provider unchanged. A follow-up with a real LoggerProvider, synchronous in-memory exporter and the installed OTLP encode_logs() preserved NaN/infinity as protobuf double values. The oversized integer attribute was omitted with a value-out-of-range SDK log; the healthy fourth record retained its integer value. All four records survived encoding, so batch loss was not observed. No network export was attempted; handler and provider were closed after the experiment.

Acceptance criteria

  • [ ] NaN, positive/negative infinity and integers outside signed 64-bit range cannot reach the provider as emitted attributes.
  • [ ] Valid scalar, redacted-string and permitted list extras preserve their documented normalization.
  • [ ] A real in-memory SDK plus OTLP encoding contract proves healthy peer records survive invalid extras.
  • [ ] Diagnostics and exported data omit private submitted values and credentials; fail-open business logging is preserved.
  • [ ] Preserve Consumer-owned meaning, payload-free evidence, disabled optional-import isolation, safe diagnostics and the non-relaxable Safety Floor.
  • [ ] Run the narrowest observable contract, then applicable committed Make gates. Record every command and outcome; update specifications/compatibility evidence for changed public or wire contracts. Run native Collector verification for changed Collector assets and build for packaging changes.

Design guidance

Normalize allowed extra shapes, then use the canonical attribute safety validator before provider emission. Keep SDK-specific conversion behind the existing log adapter.

Keep prefactoring narrow and verifiable in this slice. Reuse established owners and structural interfaces; introduce a pattern only when it clarifies a real responsibility or variation point. Do not add consumer vocabulary or private payloads to platform code or evidence. Mocked/local results must not claim hosted, production, accelerator or release qualification.

Blocked by

None (can start immediately). Shared-area coordination is useful, but no other review fix is a genuine prerequisite for this slice.

Verification scope

Convert the described counterexample or investigation oracle into an observable test at the lowest suitable public boundary. Prefer bounded operation-count or deterministic interleaving evidence to flaky timing assertions; timing guarantees need a declared tolerance and independently owned cleanup. This ticket authorizes remediation/research, not publication or deployment.