feat: wrap ResultExportConfig around use-case sub-structs#110
Merged
Conversation
Refactors the flat ResultExportConfig into a wrapper around use-case sub-structs, following the pattern merged in #108. First (and currently only) use case is ShadowResultConfig, which carries the CanonicalRPC endpoint for app-hash divergence detection. Removes stale "monitor mode" / "scheduled mode" godoc that described a scheduled-export behavior that was never reachable (canonicalRpc is CRD-required via MinLength=1, so "without canonicalRpc" was never a valid input). Adds cross-field validation to replayerPlanner.Validate rejecting an empty resultExport wrapper, mirroring validateSnapshotGeneration at planner.go:331. Context-free helper, caller wraps with replayer: prefix — no shared helper takes a mode parameter. No sidecar code currently consumes ResultExport (was removed with the monitor-task subsystem in #89); this is a schema-only refactor to prepare for future use-case sub-structs without needing to rename existing fields. Co-Authored-By: Claude Opus 4.7 (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
Applies the sibling-wrapper pattern from #108 to
ResultExportConfig. The flat{ CanonicalRPC string }becomes a wrapper around aShadowResult *ShadowResultConfigsub-struct, which carries the canonical-RPC endpoint. Future result-export flavors slot in as siblings (scheduled, per-use-case comparisons, etc.) without renaming existing fields.ResultExportConfigis now a wrapper;ShadowResultConfigownscanonicalRpc. Both inapi/v1alpha1/common_types.go.canonicalRpc, butcanonicalRpcwas CRD-required (MinLength=1), so scheduled mode was never actually reachable through the CRD. Removed the prose; didn't preserve the behavior.replayerPlanner.Validate(the sole consumer today) rejects an emptyresultExport: {}wrapper via the context-freevalidateResultExporthelper + caller-wrap withreplayer:prefix — same pattern asvalidateSnapshotGeneration.pacific-1-shadow-replayer.yamlupdated to the nested shape.make manifests generate.ResultExportConfighas no active consumer today (was removed with the monitor-task subsystem in feat: remove monitor task system #89); this is schema-only.Shape
Verification
make build— succeedsmake lint— 0 issuesmake test— all packages pass, including the newTestReplayerPlanner_Validate_ResultExportcovering nil / valid-shadow-result / empty-wrapper-rejectionContext
Identified in the extensibility audit after #108 merged. Both the kubernetes-specialist and platform-engineer flagged
ResultExportConfigas the most direct clone of the anti-pattern #108 fixed: two behaviors discriminated by presence of a string field. No launched product, no backward-compat concerns.Test plan
pacific-1-shadow-replayer.yamland confirm it accepts the new nested shaperesultExport: {}(no sub-struct) and confirm the planner rejects it with areplayer: resultExport is set but has no sub-structerrormanifests/sei.io_seinodes.yaml,sei.io_seinodedeployments.yaml) for theresultExport.shadowResult.canonicalRpcpathResultExportConfig{ CanonicalRPC: ... }shape (grep verified clean)🤖 Generated with Claude Code