SMOODEV-2700: Python log-level wire parity + golden-vector parity corpus#174
Merged
Merged
Conversation
…rity corpus
Python was the sole outlier across the five hand-written ports. It emitted a
lowercase string in `level` ("info") and never emitted `LogLevel` at all, while
TS/Go/Rust/.NET all emit BOTH: `level` = pino-compatible numeric, `LogLevel` =
canonical lowercase string.
This broke downstream log-level ingest: rust/api-prime's observability ingest
takes the first matching level key, so our own services' numeric `level` (30)
won the race over the unambiguous `LogLevel` ("info") -- which is why prod shows
a mixed bag of levels: ['30','40','ERROR','INFO','WARN'].
Python now emits both. The numeric codes already existed in `level_to_code()`
(trace=10 .. fatal=60); they were simply never written to the record. This is a
BREAKING wire-shape change for Python consumers reading `level` as a string --
they should read `LogLevel` instead. Changeset documents the migration.
Five hand-written implementations WILL drift; this bug is the proof. Adds
`parity-corpus.json`, a committed golden-vector corpus pinning the exact
level/LogLevel pair every port must emit for all six levels, asserted by the TS
and Python suites so drift fails that language's build. Follows the ADR-089
pattern used by @smooai/audit. Go/Rust/.NET lanes are NOT yet wired -- see the
corpus file; wiring them is mechanical and separately scoped.
Verified .NET already writes both (SmooLogger.cs:431-432) -- no fix needed.
The uvicorn adapter's uppercase "level": "INFO" is a stdlib logging dictConfig
threshold, not wire output, and is correctly left alone.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S2bM94GAnVjYSSv1x7HKRB
🦋 Changeset detectedLatest commit: 85d48f8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Fixes Python log-level wire parity and adds a cross-language golden-vector parity corpus (parity-corpus.json) exercised from both the TS and Python test suites.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ji3rA65cTfU9vPQh9HAASJ