fix(sourcegen): split multi-line condition in Activity context remarks#4
Merged
Conversation
The activity-context remarks path concatenated RequirementLevel.Condition — a
free-form, sometimes multi-line registry field — straight into a single
AppendDocLine, the same leak class fixed for example values. The v1.41.0
registry has 46 multi-line conditions (db.*, faas, messaging, k8s, session,
feature_flag, ...), so any consumer projecting the Activities surface for those
prefixes got uncompilable output (e.g. [SemanticConventionActivities("db")]
emitted 126+ CS0102/CS0246/CS0708 from leaked prose).
Split the composed line via SourceWriter.SplitLines before AppendDocLine,
matching how EventsEmitter already handles Condition/Note. Single-line
conditions are byte-identical (60/60 snapshot tests pass); a db-activities repro
goes from 126+ errors to 0/0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Follow-up to the example-value escaping fix (PR #3). That fix covered
WriteExamplesComment+EventsEmitter; this closes the last instance of the same bug class.ActivityExtensionsEmitterconcatenatedRequirementLevel.Condition— a free-form, sometimes multi-line registry field — directly into oneAppendDocLine, instead of splitting it the wayEventsEmitteralready does. The v1.41.0 registry has 46 multi-line conditions (db.*,faas,messaging,k8s,session,feature_flag, …), so any consumer projecting the Activities surface for those prefixes got uncompilable output.Evidence
A temporary
[SemanticConventionActivities("db")]marker emitted 126+ CS0102/CS0246/CS0708 (leaked condition prose parsed as code). After the fix: 0 / 0.Fix
Split the composed line via
SourceWriter.SplitLinesbeforeAppendDocLine— idiomatic, matches the existing summary/remarks/Note handling.Verification
🤖 Generated with Claude Code