Skip to content

Add report list and extend report divergence with --env/--height#56

Merged
bdchatham merged 3 commits intomainfrom
feat/shadow-report-cli
Apr 2, 2026
Merged

Add report list and extend report divergence with --env/--height#56
bdchatham merged 3 commits intomainfrom
feat/shadow-report-cli

Conversation

@bdchatham
Copy link
Copy Markdown
Contributor

Summary

  • Adds seictl report list to inventory shadow comparison data in S3
  • Extends seictl report divergence with --env/--height convenience flags
  • Both commands support --json for agent consumption

What this does

report list --env prod — shows what comparison pages and divergence reports exist:

3 comparison page(s), 1 divergence report(s), 300 blocks covered

TYPE         HEIGHT RANGE              BLOCKS
page         198000000 - 198000099     100
page         198000100 - 198000199     100
page         198000200 - 198000242     43
divergence   198000242                 -

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, registered list
  • report_list.go — new report list command with S3 listing + key parsing
  • sidecar/shadow/fetch.go — extracted FetchReport() for testability
  • sidecar/s3/client.go — new Downloader interface for streaming S3 reads

No new dependencies. No sidecar/task engine/OpenAPI changes.

Test plan

  • seictl report list --env prod returns inventory
  • seictl report list --env prod --json returns structured JSON
  • seictl report divergence --env prod --height N fetches and renders report
  • seictl report divergence --env prod --height N --json returns raw JSON
  • --key and --height are mutually exclusive (error)
  • --env and --bucket are mutually exclusive (error)

🤖 Generated with Claude Code

bdchatham and others added 3 commits April 2, 2026 09:47
…/--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>
@bdchatham bdchatham marked this pull request as ready for review April 2, 2026 17:21
@bdchatham
Copy link
Copy Markdown
Contributor Author

LGTM

@bdchatham bdchatham merged commit 0fd9844 into main Apr 2, 2026
2 checks passed
@bdchatham bdchatham deleted the feat/shadow-report-cli branch April 2, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant