fix(canon): correct SSE bytes_out claim in telemetry-validation-gate#211
Merged
Conversation
The original step 3 said "For SSE-streamed responses, expected bytes_out = 0 and tokens_out = 0 per the Emission Contract." This contradicts the wrapper's own design: per klappy://canon/constraints/telemetry-governance §Emission Contract Rule 2, the wrapper measures the in-memory \`content\` envelope BEFORE MCP transport framing. SSE-transported responses still produce non-zero bytes_out and tokens_out at the wrapper. Smoke evidence (main preview, 2026-05-16 00:30Z): all 14 successful SSE-framed tool calls emitted non-zero bytes_out (range 288 to 28,593) and tokens_out (range 121 to 7,780). Zero SSE responses produced zero emitted bytes_out. The wrapper's in-memory measurement defeats the SSE-zero failure mode that originally motivated the wrapper. The "0 for SSE" line in the Numeric Values table of telemetry-governance refers to the old wire-edge instrumentation, not the wrapper. The replaced text clarifies this.
Canon Quality —
|
Canon Quality — Frontmatter Schema ✅All 41 file(s) in Validator: |
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.
Disposition of Cursor Bugbot finding on PR #210 plus a related factual error caught by smoke evidence.
What Bugbot caught on #210
Bugbot flagged the original procedure step 3 as referring to
request_bodyandresponse_body(full HTTP bodies including JSON-RPC framing) when the wrapper actually measuresJSON.stringify(args)andJSON.stringify(result.content). That finding was addressed in the merged version of #210 before merge.What this PR fixes
The merged version still contains an SSE claim that contradicts the wrapper's design:
The wrapper measures the in-memory
contentenvelope before MCP transport framing. SSE framing is applied later, on the wire. The wrapper sees the JS object, not the SSE-encoded body. Therefore SSE-transported responses produce non-zerobytes_outat the wrapper.Smoke evidence (main preview, 2026-05-16 00:30Z)
All 14 successful SSE-framed tool calls in the smoke pass emitted non-zero values:
Zero SSE responses produced zero emitted
bytes_out. The wrapper's in-memory measurement is exactly the failure mode the Emission Contract was written to defeat.The fix
Replace the wrong SSE caveat with a correct one that names the old wire-edge instrumentation as the source of the "0 for SSE" line in telemetry-governance §Numeric Values.
Note
Low Risk
Low risk documentation-only change; clarifies expected telemetry calculations for SSE-streamed tool responses to avoid incorrect validation outcomes.
Overview
Updates
canon/constraints/telemetry-validation-gate.mdto remove the claim that SSE-streamed tool responses should emitbytes_out = 0/tokens_out = 0during validation.The gate now explicitly states that the wrapper measures the in-memory
{ content: [...] }envelope before transport framing, and that the “0 for SSE” caveat applies to legacy wire-edge instrumentation, not the current wrapper.Reviewed by Cursor Bugbot for commit 81d58d8. Bugbot is set up for automated code reviews on this repo. Configure here.