Add report list and extend report divergence with --env/--height#56
Merged
Add report list and extend report divergence with --env/--height#56
Conversation
…/--height Add `seictl report list` to inventory shadow comparison data in S3, and extend `report divergence` with --env/--height convenience flags so engineers and agents can fetch divergence reports without knowing exact S3 keys. Both commands support --json for structured output. Changes: - New `report list` command: lists comparison pages and divergence reports in S3 with height ranges and block counts - Extended `report divergence`: --env expands to bucket name, --height computes the S3 key automatically - New Downloader interface in sidecar/s3/client.go for streaming S3 reads (used by FetchReport) - Extracted shadow.FetchReport() from report.go for testability No new dependencies. No changes to the sidecar, task engine, or comparison pipeline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 test cases with mock S3 fixtures covering: - resolveS3Ref: 9 cases (env expansion, bucket passthrough, mutual exclusivity, defaults for prefix/region, trailing slash normalization) - comparePageRe: 7 cases (valid comparison pages, raw export pages rejected, divergence reports rejected, unrelated files, empty key) - divergenceReportRe: 5 cases (valid reports, comparison pages rejected, raw exports rejected, empty key) - FetchReport: 7 cases (gzipped report, uncompressed report, S3 not found, corrupt gzip, invalid JSON, Layer1 data roundtrip, chain snapshot preservation) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
LGTM |
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
seictl report listto inventory shadow comparison data in S3seictl report divergencewith--env/--heightconvenience flags--jsonfor agent consumptionWhat this does
report list --env prod— shows what comparison pages and divergence reports exist:report divergence --env prod --height 198000242— fetches the divergence report without needing to know the S3 key. Equivalent to--bucket prod-sei-shadow-results --key shadow-results/divergence-198000242.report.json.gz.Why this scope
The shadow replayer crashes on app hash divergence, producing a handful of matching pages + exactly 1 divergence report. The investigation workflow is: "did it diverge?" → "show me the report." These two commands serve that workflow. Statistical analysis (summary, search, trends) was evaluated and cut per YAGNI — the data shape doesn't support it.
Changes
report.go— extended divergence command,resolveS3Ref()helper, registeredlistreport_list.go— newreport listcommand with S3 listing + key parsingsidecar/shadow/fetch.go— extractedFetchReport()for testabilitysidecar/s3/client.go— newDownloaderinterface for streaming S3 readsNo new dependencies. No sidecar/task engine/OpenAPI changes.
Test plan
seictl report list --env prodreturns inventoryseictl report list --env prod --jsonreturns structured JSONseictl report divergence --env prod --height Nfetches and renders reportseictl report divergence --env prod --height N --jsonreturns raw JSON--keyand--heightare mutually exclusive (error)--envand--bucketare mutually exclusive (error)🤖 Generated with Claude Code