Skip to content

test(benchmarks): add RFC-0001 LLM surface corpus - #53

Open
tingfeng347 wants to merge 2 commits into
HydroRoll-Team:devfrom
tingfeng347:test/llm-surface-corpus
Open

test(benchmarks): add RFC-0001 LLM surface corpus#53
tingfeng347 wants to merge 2 commits into
HydroRoll-Team:devfrom
tingfeng347:test/llm-surface-corpus

Conversation

@tingfeng347

@tingfeng347 tingfeng347 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • add a provider-neutral bilingual natural-language to canonical OneRoll v2 surface corpus
  • validate the corpus with a Draft 2020-12 JSON Schema and repository contract tests
  • verify every canonical oracle against the accepted RFC-0001 target Pest grammar
  • document the boundary between exact canonical match, grammar validity, and future semantic evaluation

Scope

This PR does not change RFC-0001, the target grammar, parser behavior, runtime semantics, package dependencies, or CI workflows. It establishes deterministic evidence infrastructure for the usability and LLM tool-call concern discussed in #51.

Validation

  • uv sync --all-groups --frozen
  • uv run --frozen python -m unittest tests.test_llm_surface_contract -v
  • cargo test v2_target_grammar_parses_llm_surface_corpus -- --nocapture
  • cargo fmt --all -- --check
  • cargo test --all-targets --all-features
  • cargo test --release checked_i64_
  • cargo test --release rfc_0002_
  • cargo clippy --all-targets --all-features -- -D warnings -A non-local-definitions
  • uv run --frozen ruff check .
  • uv run --frozen ruff format --check .
  • uv run --frozen mypy --strict src/oneroll docs/rfcs/0004-target-api.pyi
  • uv run --frozen maturin develop
  • uv run --no-sync python -m unittest discover -s tests -v
  • LC_ALL=C LANG=C uv run --no-sync sphinx-build -W --keep-going -b html docs/source docs/_build/html
  • git diff --check

Related to #51.

Summary by Sourcery

Establish deterministic bilingual LLM surface evaluation evidence for RFC-0001 without changing language, parser, runtime, dependencies, or CI behavior.

New Features:

  • Add a provider-neutral bilingual corpus mapping natural-language intents to canonical OneRoll v2 expressions.

Enhancements:

  • Define clear boundaries between exact canonical matching, target-grammar validity, and future semantic evaluation.

Documentation:

  • Document the corpus purpose, scope, evaluation metrics, and provider-runner contract.

Tests:

  • Validate corpus structure, bilingual pairing, canonical formatting, RFC references, and feature coverage with Draft 2020-12 schema and repository contract tests.
  • Verify every canonical corpus expression parses with the accepted RFC-0001 target grammar.

@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces deterministic evidence infrastructure for RFC-0001 LLM-surface usability evaluation: a bilingual canonical corpus, schema and repository contract validation, and Rust target-grammar coverage, while explicitly avoiding changes to the RFC, runtime semantics, dependencies, or CI.

Flow diagram for RFC-0001 LLM surface corpus validation

flowchart LR
    Cases[cases.json] --> Schema[cases.schema.json]
    Cases --> PyContract[Python contract tests]
    Cases --> RustContract[Rust V2TargetParser test]
    Schema --> PyContract
    PyContract --> Structure[Structure and bilingual pairing valid]
    RustContract --> Grammar[Target grammar valid]
    Structure --> Evidence[Deterministic evaluation evidence]
    Grammar --> Evidence
Loading

File-Level Changes

Change Details Files
Add a provider-neutral bilingual corpus of natural-language intents paired with canonical RFC-0001 OneRoll v2 expressions.
  • Add 32+ English/Chinese paired cases covering multiple surface feature families.
  • Document corpus purpose, provider-runner format, validation boundaries, and the distinction between exact matching, grammar validity, and semantic equivalence.
  • Define the corpus structure and constraints with a Draft 2020-12 JSON Schema.
benchmarks/llm_surface/README.md
benchmarks/llm_surface/cases.json
benchmarks/llm_surface/cases.schema.json
Add repository-level contract checks to enforce corpus quality and metadata consistency.
  • Validate the schema and corpus contents.
  • Check unique IDs, bilingual pairing, shared expected values and metadata, canonical formatting, RFC references, and feature-family coverage.
  • Ignore strings and top-level comments when checking canonical spacing.
tests/test_llm_surface_contract.py
Verify every corpus oracle against the accepted RFC-0001 target grammar without changing parser or runtime behavior.
  • Deserialize the corpus in Rust and parse each canonical expression with the embedded V2TargetParser.
  • Report the case ID and canonical expression when grammar validation fails.
src/conformance_tests.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@fu050409

fu050409 commented Sep 3, 2026

Copy link
Copy Markdown

cc @HsiangNianian plz take a look

auto-merge was automatically disabled September 3, 2026 12:34

Head branch was pushed to by a user without write access

@tingfeng347
tingfeng347 force-pushed the test/llm-surface-corpus branch from 01f8ce4 to 2dc8e2e Compare September 3, 2026 12:34
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