refactor(processor): nest spectral metrics under shared model#85
Merged
flexiondotorg merged 2 commits intomainfrom May 4, 2026
Merged
refactor(processor): nest spectral metrics under shared model#85flexiondotorg merged 2 commits intomainfrom
flexiondotorg merged 2 commits intomainfrom
Conversation
Contributor
flexiondotorg
commented
May 4, 2026
- Move interval and measurement spectral values into nested SpectralMetrics
- Preserve flat spectral JSON fields for backward compatibility
- Update adaptive, logging, and candidate consumers to read nested values
- Add shared spectral report descriptors and stale-field guard tests
- Move interval and measurement spectral values into nested SpectralMetrics - Preserve flat spectral JSON fields for backward compatibility - Update adaptive, logging, and candidate consumers to read nested values - Add shared spectral report descriptors and stale-field guard tests Signed-off-by: Martin Wimpress <code@wimpress.io>
Contributor
There was a problem hiding this comment.
1 issue found across 23 files
Confidence score: 2/5
- There is a high-confidence, high-severity serialization bug in
internal/processor/analyzer_metrics.go: promotedMarshalJSON/UnmarshalJSONmethods on embeddedBaseMeasurementscan cause outer measurement structs to read/write only base fields. - This creates concrete regression risk for metrics payloads, since non-base fields may be silently dropped during JSON marshal/unmarshal and lead to incorrect processing downstream.
- Given the 8/10 severity and 9/10 confidence, this is likely merge-blocking until serialization behavior is corrected.
- Pay close attention to
internal/processor/analyzer_metrics.go- embedded-method promotion is likely overriding expected outer struct JSON handling.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/processor/analyzer_metrics.go">
<violation number="1" location="internal/processor/analyzer_metrics.go:196">
P1: Defining MarshalJSON/UnmarshalJSON on embedded BaseMeasurements causes outer measurement structs to serialize/deserialize only base fields due to method promotion.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
- Add explicit JSON marshal and unmarshal methods for AudioMeasurements and OutputMeasurements so outer fields survive serialisation. - Keep the flat spectral_* contract intact through BaseMeasurements. - Add regression tests for input and output field round trips. Signed-off-by: Martin Wimpress <code@wimpress.io>
Contributor
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Requires human review: Large-scale refactor of core data models and adaptive logic across many files. Custom JSON marshaling/unmarshaling logic warrants human review to ensure API compatibility and no regressions.
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.