Skip to content

feat(bench): RFC 0031 — Ourios-side query extraction (RFC0031.1) - #468

Merged
jensholdgaard merged 3 commits into
mainfrom
rfc0031-green-ourios-extraction
Jul 11, 2026
Merged

feat(bench): RFC 0031 — Ourios-side query extraction (RFC0031.1)#468
jensholdgaard merged 3 commits into
mainfrom
rfc0031-green-ourios-extraction

Conversation

@jensholdgaard

@jensholdgaard jensholdgaard commented Jul 11, 2026

Copy link
Copy Markdown
Owner

What

Second increment of the RFC 0031 equivalence-harness slice: the Ourios half of the RFC0031.1 check, landing as a locally-verifiable increment (the payoff of the "Adjust" path).

  • ourios_query_lines — runs a logs-DSL query against a store in-process (the querier; RFC 0031 §7, no served binary) and lowers the rendered rows to LineKeys, so they feed compare_lines.
  • body_bytes — lowers the Rendered (string) body; Structured/Absent error rather than collapse, because RFC 0025's absent-vs-empty distinction must be represented deliberately (the OTLP-native gates extend LineKey with a body-kind discriminator).
  • Integration test: builds a real RFC 0005 store from a text corpus and proves extraction returns one LineKey per stored row, with in-span timestamps, round-tripping through compare_lines (self-equivalence).

Dependency promotion (querier + tokio → regular deps)

The comparative harness is a lib gate that produces docs/benchmarks.md §9 numbers (like a1/c1/c2), and producing comparative numbers requires in-process querying — so the querier belongs in the lib, not just the B2 criterion bench where the only prior in-process query lived.

No hidden cost, verified: ourios-bench is a leaf crate (nothing depends on it, so nothing inherits the heavier lib), there is no dependency cycle (querier deps only core/miner/parquet), and querier+tokio already compiled for the bench's tests — so build time is unchanged in practice.

A real finding this increment surfaced (locally, before any Loki container)

Reconstructing a cleanly-mined string body needs the audit-derived template registry (RFC 0017), which build_query_store does not persist — B1/B2 only ever read row counts, never rendered bodies. So the extraction is correct (right count + timestamps) but bodies render empty against a count-only store. The test therefore asserts extraction shape + comparator integration, and documents that body-content equivalence needs a registry-bearing store — the next increment adds a comparative store-builder that persists the audit stream (like the A1 gate) so bodies render, then the Loki testcontainers side (Dex-style).

This is exactly the kind of subtlety the Adjust path was meant to catch with fast local iteration rather than blind CI.

Tests

cargo test -p ourios-bench --lib comparative → 9 passed. fmt + clippy clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added in-process query support for comparative benchmarking.
    • Query results can now be converted into comparable timestamp and log-line records.
    • Exposed the new query capability through the benchmarking package’s public API.
  • Bug Fixes

    • Unsupported log body formats now return a clear pipeline error instead of being silently converted.
  • Tests

    • Added coverage for unsupported body formats and query results from stored log data.

Second increment of the equivalence-harness slice: the Ourios half of
the RFC0031.1 check. `ourios_query_lines` runs a logs-DSL query against a
store in-process (the querier — RFC 0031 §7, no served binary) and lowers
the rendered rows to `LineKey`s, so they feed `compare_lines`.

- Promote ourios-querier + tokio from dev-deps to regular deps: the
  comparative harness is a lib gate that produces docs/benchmarks.md §9
  numbers (like a1/c1/c2), and producing comparative numbers requires
  in-process querying — so the querier belongs in the lib, not just the
  B2 criterion bench. No hidden cost: ourios-bench is a leaf crate
  (nothing inherits the heavier lib) and there is no dependency cycle
  (querier deps only core/miner/parquet).
- `body_bytes` lowers the `Rendered` (string) body; `Structured`/`Absent`
  error rather than collapse — RFC 0025's absent-vs-empty distinction
  must be represented deliberately, which the OTLP-native gates will do
  by extending `LineKey` with a body-kind discriminator.
- Integration test builds a real store from a text corpus and proves
  extraction returns one LineKey per row with in-span timestamps and
  self-equivalence through `compare_lines`.

Finding this increment surfaced (locally, before any Loki container):
reconstructing a cleanly-mined string body needs the audit-derived
template registry (RFC 0017), which `build_query_store` does not persist
(B1/B2 read only counts). The next increment adds a comparative
store-builder that persists the audit stream — like the A1 gate — so
bodies render; then the Loki testcontainers side (Dex-style).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jensholdgaard
jensholdgaard requested a review from Copilot July 11, 2026 10:37
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jensholdgaard, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6034b365-ca9f-4513-a50a-1c698ba38dab

📥 Commits

Reviewing files that changed from the base of the PR and between f3e3ff7 and 203c6c2.

📒 Files selected for processing (1)
  • crates/ourios-bench/src/comparative.rs
📝 Walkthrough

Walkthrough

The benchmark crate now runs Ourios queries in-process, converts rendered query rows into LineKey values, exposes the helper publicly, and adds dependency and test coverage for query extraction and unsupported body handling.

Changes

Ourios query comparison

Layer / File(s) Summary
In-process runtime dependencies
crates/ourios-bench/Cargo.toml
Adds ourios-querier and pinned Tokio runtime dependencies to the regular dependency set while retaining Criterion for development benchmarks.
Query extraction and body conversion
crates/ourios-bench/src/comparative.rs
Adds ourios_query_lines, which parses DSL, executes the querier on a current-thread runtime, and converts rendered bodies and timestamps into LineKey values.
Public API and validation
crates/ourios-bench/src/comparative.rs, crates/ourios-bench/src/lib.rs
Re-exports the query helper and tests unsupported body errors, fixture-backed extraction, timestamp bounds, and comparator self-equivalence.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Benchmark as Comparative benchmark
  participant Runtime as Tokio runtime
  participant Querier as Ourios querier
  participant Comparator as LineKey comparator
  Benchmark->>Runtime: Parse DSL and run query
  Runtime->>Querier: Execute query for tenant and time window
  Querier-->>Runtime: Return log rows
  Runtime->>Comparator: Convert rows to LineKey values
  Comparator-->>Benchmark: Return comparable lines
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change and tests, but it does not follow the required template sections for Summary, Related, and Checklist. Rewrite it to use the template headings Summary, Related, and Checklist, and complete each required checklist item.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: RFC 0031.1 Ourios-side query extraction for the bench harness.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rfc0031-green-ourios-extraction

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.

`cargo doc -D warnings` rejects a public item's doc linking a private
one: `ourios_query_lines` linked `[body_bytes]` (private). Reword to a
plain description; no link.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the Ourios-side extraction for the RFC 0031.1 equivalence harness by running logs-DSL queries in-process via ourios-querier, lowering returned rows into LineKeys for compare_lines, and introducing strict body-kind handling to preserve RFC 0025’s absent-vs-empty distinction.

Changes:

  • Add comparative::ourios_query_lines plus body_bytes to extract (timestamp, body) keys from in-process querier results.
  • Add tests covering deferred non-string body kinds and a local self-equivalence extraction over a real RFC 0005 store.
  • Promote ourios-querier and tokio from dev-dependencies to regular dependencies, and re-export ourios_query_lines from the crate root.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
crates/ourios-bench/src/lib.rs Re-exports ourios_query_lines as part of the public comparative harness surface.
crates/ourios-bench/src/comparative.rs Adds in-process querying + row lowering to LineKey, strict body-kind lowering, and tests.
crates/ourios-bench/Cargo.toml Promotes ourios-querier + tokio to regular dependencies to support the lib-gate harness.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/ourios-bench/src/comparative.rs
Comment thread crates/ourios-bench/src/comparative.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/ourios-bench/src/comparative.rs (1)

369-379: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider testing LogBody::Structured alongside Absent.

The test name body_bytes_defers_non_string_kinds (plural) covers only Absent. Adding a Structured(AnyValue) case would fully exercise the other => error arm and match the test's stated scope.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/ourios-bench/src/comparative.rs` around lines 369 - 379, Extend the
body_bytes_defers_non_string_kinds test to also pass a LogBody::Structured value
containing an AnyValue and assert that it returns an error. Keep the existing
LogBody::Absent assertion, covering both non-string variants handled by the
other => error arm.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/ourios-bench/src/comparative.rs`:
- Around line 369-379: Extend the body_bytes_defers_non_string_kinds test to
also pass a LogBody::Structured value containing an AnyValue and assert that it
returns an error. Keep the existing LogBody::Absent assertion, covering both
non-string variants handled by the other => error arm.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f9d77c4b-b55b-4193-8513-990b0cc4b7e7

📥 Commits

Reviewing files that changed from the base of the PR and between b6a1c8d and f3e3ff7.

📒 Files selected for processing (3)
  • crates/ourios-bench/Cargo.toml
  • crates/ourios-bench/src/comparative.rs
  • crates/ourios-bench/src/lib.rs

Copilot review:
- ourios_query_lines now enforces the documented limit requirement: it
  errors unless the rendered row count equals the total match count, so a
  missing/too-small `| limit` can't silently make the equivalence check
  compare a truncated (or empty) result. Tested (a limit-less query over
  matching rows errors).
- body_bytes names the body *kind* (structured/absent) in its error
  instead of Debug-dumping the full LogBody — a structured body can be
  large or carry sensitive payload.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

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.

2 participants