Skip to content

test: golden-envelope snapshot tests + million-row scale test (#6)#59

Merged
copyleftdev merged 1 commit into
mainfrom
test/golden-and-scale
Jun 1, 2026
Merged

test: golden-envelope snapshot tests + million-row scale test (#6)#59
copyleftdev merged 1 commit into
mainfrom
test/golden-and-scale

Conversation

@copyleftdev

Copy link
Copy Markdown
Owner

What

The roadmap capstone — two validation guards that lock in everything #1#5 built. Test-only: no src/ change, so no version bump / release.

1. Golden-envelope snapshot tests (anomalyx/tests/golden.rs)

Runs the actual anomalyx binary and pins its byte-exact stdout for the three contract surfaces against committed goldens:

  • schemaschema.json (the JSON Schema)
  • describedescribe.json (protocol metadata, detectors, formats, config_version)
  • scan on a fixed CSV → scan_basic.json (full envelope: dict, dense rows, roles, summary, exit)

Any accidental contract drift — a renamed field, a changed dense-row layout, a shifted config_version, a recalibrated confidence — now fails CI as a visible diff instead of slipping into a release. Verified the tripwire fires (a one-field change → golden mismatch FAILED). Intentional changes regenerate with BLESS=1.

2. Million-row scale test (ax-validate/tests/stress.rs)

million_row_scan_is_deterministic_and_recovers_outliers: a 1,000,000-row scan must be byte-identical across runs and recover exactly the five injected outlier rows (precision = recall = 1). Determinism and correctness verified at scale, not just on the existing 40k toy input. Runs in ~3s; a loop-bound regression surfaces as a timeout.

Gate

fmt / clippy / full workspace test green (14 result-blocks). No mutation surface (tests only).

Roadmap

This completes the "make it full" arc: #1 FDR · #2 output scoping · #3 column roles · #4 robustness harness · #5 confidence calibration · #6 golden + scale ✓.

🤖 Generated with Claude Code

Two contract/validation guards, both test-only (no src/ change → no release):

1. anomalyx/tests/golden.rs — runs the actual binary and pins its byte-exact
   stdout for `schema`, `describe`, and a representative `scan` envelope (id col
   → identifier/skipped, reading col → one point outlier) against committed
   goldens under tests/golden/. Any accidental contract drift — renamed field,
   changed dense-row layout, shifted config_version, recalibrated confidence —
   fails CI as a visible diff. Verified the tripwire fires on a one-field change.
   Regenerate intentional changes with `BLESS=1 cargo test -p anomalyx --test golden`.

2. ax-validate/tests/stress.rs — million_row_scan_is_deterministic_and_recovers_
   outliers: a 1,000,000-row scan is byte-identical across runs AND recovers
   exactly the five injected outlier rows (precision=recall=1 at scale). Runs in
   ~3s; a loop-bound regression surfaces as a timeout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@copyleftdev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 45 minutes and 4 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7464e1c4-6ca4-4347-aa40-63075a34c1e5

📥 Commits

Reviewing files that changed from the base of the PR and between add599d and 2e0a0f0.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • crates/anomalyx/tests/golden.rs
  • crates/anomalyx/tests/golden/describe.json
  • crates/anomalyx/tests/golden/scan_basic.json
  • crates/anomalyx/tests/golden/schema.json
  • crates/ax-validate/tests/stress.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/golden-and-scale

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@copyleftdev copyleftdev merged commit 47e3cb3 into main Jun 1, 2026
2 checks passed
@copyleftdev copyleftdev deleted the test/golden-and-scale branch June 1, 2026 19:12
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