feat(bench): scaffold ourios-bench crate (PR-H1 of RFC 0006) - #49
Conversation
First half of the RFC 0006 `specified` → `red` progression. Lands the crate scaffold so the test stubs in PR-H2 have a public surface to link against; PR-H2 follows with the seven `#[ignore]`'d acceptance-criterion tests and the frontmatter status bump. Lands: - `crates/ourios-bench/` new crate, wired into the workspace `members` list (and removed from the "remaining members" comment block). - `crates/ourios-bench/src/lib.rs` — `BenchConfig`, `GateSet`, `ResultsFile` + sub-structs (`CorpusStats`, `OuriosStats`, `ZstdStats`, `A1Result`, `C1Result`, `C2Result`, `ConvergenceSample`), and a top-level `run()` entry point that currently returns `BenchError::NotImplemented`. Struct shapes mirror RFC 0006 §3.6 exactly so a future `serde_json::from_str(<results-file>)` parses against this type without translation. Nullable gate fields (`a1`, `c1`, `c2: Option<...>`) implement the §3.6 nullability rule. - `crates/ourios-bench/src/main.rs` — thin binary that prints a scaffold-stage banner to stderr and exits `2`. Argument parsing follows in PR-H2. - `justfile` — new `thesis-bench *ARGS` recipe per the RFC §3.7 resolution (separate from `bench`, which still runs `cargo bench` for the future criterion suite). What's *not* in this PR: - The per-module split (`corpus.rs` / `harness.rs` / `a1.rs` / `c1.rs` / `c2.rs` / `report.rs`) — collapsed into `lib.rs` for now per CLAUDE.md §5.2 "≤ 5 files per phase". The first module to graduate is `corpus.rs`, in a follow-up. - Test stubs — PR-H2. - RFC frontmatter `status: specified` → `red` — PR-H2 (after test stubs exist, the maturity model says). Verification: - `cargo build -p ourios-bench` — green. - `cargo fmt --all --check` — clean. - `cargo clippy --all-targets --all-features -- -D warnings` — clean. - `cargo test --all-features` — 225 passed / 18 ignored (unchanged from main; bench has no tests yet). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a new ourios-bench crate to the workspace with a Cargo manifest, library API scaffolding (BenchConfig, GateSet, ResultsFile, BenchError, run placeholder), a stub binary that exits non‑zero, and a justfile recipe to invoke the bench in release mode. ChangesRFC 0006 Benchmarking Crate Scaffold
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Scaffolds the new ourios-bench crate (RFC 0006 PR-H1) so follow-up Red-gate acceptance tests can link against a stable public surface, and wires a just thesis-bench entry point into the workspace.
Changes:
- Add new
crates/ourios-benchcrate with initial public API (BenchConfig,GateSet, results JSON structs,BenchError, and a stubrun()). - Add a stub
ourios-benchbinary that currently prints a scaffold banner and exits non-zero. - Wire the crate into the workspace and add a
just thesis-benchrecipe.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
justfile |
Adds thesis-bench recipe to run the new bench harness in release mode. |
crates/ourios-bench/src/main.rs |
Introduces stub CLI/binary entry point (currently banner + exit). |
crates/ourios-bench/src/lib.rs |
Defines the public surface (config, results schema, error type) and stub run(). |
crates/ourios-bench/Cargo.toml |
Adds crate manifest with workspace lint opt-in and serde/tempfile deps. |
Cargo.toml |
Adds crates/ourios-bench to workspace members. |
Cargo.lock |
Records the new workspace package and its dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@crates/ourios-bench/src/lib.rs`:
- Around line 29-31: This file lacks colocated unit tests for the non-trivial
contract behavior described; add a #[cfg(test)] mod tests block inside
src/lib.rs and implement focused unit tests that exercise the public API used by
main.rs and tests/, e.g. call and assert behaviors of run and any public
structs/enums used by the CLI contract, mock or construct inputs directly
(instead of relying only on tests/ integration tests), and include edge cases
referenced in the module docs so the module’s behavior is validated alongside
the code.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 28b8568e-d8bd-4e27-915e-ec409b3bd0a2
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
Cargo.tomlcrates/ourios-bench/Cargo.tomlcrates/ourios-bench/src/lib.rscrates/ourios-bench/src/main.rsjustfile
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
First half of the RFC 0006
specified→redprogression. Lands theourios-benchcrate scaffold so the test stubs in PR-H2 have a public surface to link against; PR-H2 follows with the seven#[ignore]'d acceptance-criterion tests and the frontmatter status bump.Lands
crates/ourios-bench/new crate, wired into the workspacememberslist (and removed from the "remaining members" comment block).src/lib.rs— public surface:BenchConfig/GateSet(the CLI's parsed shape; consumed byrun()).ResultsFile+ sub-structs (CorpusStats,OuriosStats,ZstdStats,A1Result,C1Result,C2Result,ConvergenceSample). Struct shapes mirror RFC 0006 §3.6 exactly so a futureserde_json::from_str(<results-file>)parses against this type without translation. Nullable gate fields (a1,c1,c2: Option<...>) implement the §3.6 nullability rule.BenchError— declared upfront so downstream test code doesn't have to refactor when later variants start firing.run()entry point that returnsBenchError::NotImplemented(the Red-gate scaffold).src/main.rs— thin binary that prints a scaffold-stage banner to stderr and exits2. CLI argument parsing follows in PR-H2.justfile— newthesis-bench *ARGSrecipe per the RFC §3.7 resolution (separate frombench, which still runscargo benchfor the future criterion suite).What's not in this PR
corpus.rs/harness.rs/a1.rs/c1.rs/c2.rs/report.rs) — collapsed intolib.rsfor now per CLAUDE.md §5.2 "≤ 5 files per phase". The first module to graduate iscorpus.rs, in a follow-up.status: specified→red— PR-H2 (after test stubs exist, the maturity model says).Test plan
cargo build -p ourios-bench— green.cargo fmt --all --check— clean.cargo clippy --all-targets --all-features -- -D warnings— clean.cargo test --all-features— 225 passed / 18 ignored (unchanged from main; bench has no tests yet).ResultsFilefield shape against RFC 0006 §3.6's JSON example to confirm one-to-one correspondence (the type is the §3.6 contract incarnated; drift here is drift from the RFC).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores