feat(bench): RFC 0031 — registry-bearing comparative store (RFC0031.1) - #469
Conversation
Third increment of the equivalence-harness slice, closing the gap the Ourios-side extraction surfaced: cleanly-mined string bodies reconstruct from the audit-derived template registry (RFC 0017), which build_query_store does not persist (B1/B2 read only row counts), so those bodies rendered empty. - `build_comparative_store` mines the corpus into a queryable store AND persists the miner's audit stream into the `audit/...` partition series (via AuditWriter, mirroring the A1 gate), so the querier's `derive_template_registry` can reconstruct bodies on the read path. - `build_store` gains a `capture_audit` flag and returns the drained audit events; `build_query_store` / `build_b1_store` pass `false` (behaviour unchanged), refactored through a shared inner to avoid duplicating the busiest-template logic. - The comparative test now builds the registry-bearing store and asserts **bit-identical bodies** — the Ourios side of RFC0031.1 proven end to end locally: corpus → store → in-process query → byte-exact LineKeys. Next: the Loki testcontainers side (Dex-style) drives the same OTLP corpus into Loki, queries the equivalent LogQL, and feeds `compare_lines` to flip the RFC0031.1 stub green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe benchmark store pipeline gains optional audit capture and a comparative builder that persists audit partitions. The RFC0031.1 extraction test now uses this builder and verifies extracted bodies match the original corpus exactly. ChangesComparative store construction
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ComparativeTest
participant build_comparative_store
participant harness_run_streaming
participant AuditWriter
ComparativeTest->>build_comparative_store: build comparative store
build_comparative_store->>harness_run_streaming: enable audit capture
harness_run_streaming-->>build_comparative_store: return store and audit events
build_comparative_store->>AuditWriter: write audit partitions
build_comparative_store-->>ComparativeTest: return built store
ComparativeTest->>ComparativeTest: compare extracted bodies with corpus lines
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR extends the ourios-bench RFC 0031 equivalence harness to build a registry-bearing comparative store by persisting the miner audit stream into the audit/... partition series, enabling the querier’s read-time template registry derivation (RFC 0017) so rendered string bodies reconstruct correctly for RFC0031.1 comparisons.
Changes:
- Add
build_comparative_store, which captures miner audit events and writes them viaAuditWriterintoaudit/...partitions. - Refactor
build_query_storethrough a shared inner path that can optionally capture audit events, keeping B1/B2 behavior unchanged. - Update the comparative test to build the comparative store and assert bit-identical extracted bodies.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/ourios-bench/src/store.rs | Adds audit capture plumbing and writes captured audit events into audit/... partitions for registry-bearing comparative stores. |
| crates/ourios-bench/src/lib.rs | Exports build_comparative_store as part of the public bench API surface. |
| crates/ourios-bench/src/comparative.rs | Updates the Ourios-side extraction test to validate bit-identical reconstructed bodies using the registry-bearing store. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot review: the body test sorted the extracted bodies but compared against the unsorted fixture `lines`, passing only because the fixture happened to be lexicographic. Sort `expected` too, so reordering the fixture can't turn it into a latent flake. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot review: write_audit_partition and the A1 gate's write_audit had near-identical AuditWriter open/append/close loops. Extract the shared loop as `store::write_audit_partitions`; both callers keep their own partition derivation (A1's proxy-record `audit_partition`, the store's canonical `derive_audit_partition` — equivalent keys) but hand off the identical write dance. A1's derivation + its `audit_partition_collapses_same_day_hours` test are untouched; a full derivation merge would orphan A1's proxy_record and that test, which is a separate approval-gated refactor of a validated gate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Third increment of the RFC 0031 equivalence-harness slice — closing the gap the Ourios-side extraction (#468) surfaced through local iteration.
The gap: cleanly-mined string bodies reconstruct from the audit-derived template registry (RFC 0017), but
build_query_storedoesn't persist the audit stream (B1/B2 only ever read row counts), so those bodies rendered empty. RFC0031.1's equivalence check compares rendered bodies, so this had to be fixed.The fix:
build_comparative_store— mines the corpus into a queryable store and persists the miner's audit stream into theaudit/...partition series (viaAuditWriter, mirroring the A1 gate), so the querier'sderive_template_registryreconstructs bodies on the read path.build_storegains acapture_auditflag and returns the drained audit events;build_query_store/build_b1_storepassfalse(behaviour unchanged), refactored through a shared inner to avoid duplicating the busiest-template logic.LineKeys.Verification
cargo test -p ourios-bench --lib→ 85 passed (incl. the bit-identical-body test).store::tests → 11 passed (build_query_store/build_b1_storebehaviour unchanged).clippy --all-targets --all-features -D warningsclean.Next
The Loki testcontainers side (Dex-style) drives the same OTLP corpus into Loki, queries the equivalent LogQL, and feeds
compare_lines→ flips theRFC0031.1stub green. With this increment, the Ourios half is fully local-verifiable, so that's the only remaining piece.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests