Repository navigation
feat(intent-cases): markdown reporter, baseline diff, auto-discovery, deterministic m2v warmup - #60
Conversation
Three follow-up improvements to the intent-case test framework:
1. **Markdown report (--ovoscope-accuracy-md=PATH)**
Render the per-(pipeline, lang, intent) pivot as Markdown with
collapsible sections. Drops into the gh-automations PR-comment
workflow as a new '🎯 Intent-Case Accuracy' section alongside the
existing skill-tests and bus-coverage panels. Also surfaces a
'Hardest utterances' table (top-N by cross-pipeline pass rate)
so reviewers can see which phrasings need locale tuning.
2. **Structural baseline diff**
Replace the scalar pass-rate baseline gate with a full diff:
identifies which (pipeline, lang, intent, utterance) cases
regressed (was-pass -> now-fail) vs recovered. The PR comment
now lists the regressed cases verbatim, and the session fails
if any regression is detected. JSON output includes a
baseline_diff block for downstream tooling.
3. **Auto-discovery via conftest**
Skills can now opt in to intent-case tests by declaring a single
dict in test/end2end/conftest.py:
ovoscope_intent_cases = dict(
skill_id='my-skill.author',
handlers={...},
)
The pytest plugin walks loaded conftest modules at configure
time and calls register_intent_case_tests() automatically.
The explicit API stays supported and unchanged.
Plus a deterministic m2v warm-up: instead of time.sleep(10), wait for
the burst of padatious:register_intent events to settle (quiet-window
heuristic) then pad for the 3 s in-plugin debounce. Falls back to a
sleep if the bus introspection fails for any reason.
7 new unit tests cover the loader, summary, baseline diff, and
markdown emitter — no live MiniCroft required, runs in <1 s.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis PR enhances intent test reliability and accuracy reporting. It introduces deterministic M2V sync waiting for warmup, adds pytest auto-discovery for intent case configurations, extends accuracy summary with per-utterance rollups, and generates baseline-aware Markdown reports that detect regressed/recovered test cases with hardest-utterance highlighting. ChangesIntent Testing & Accuracy Reporting Enhancements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Automated check summary ready. 📊I've aggregated the results of the automated checks for this PR below. 🏷️ Release PreviewA detailed preview of the next release cycle. 🎬 Current:
🚀 Release Channel Compatibility Predicted next version:
📋 Repo HealthEvaluating the repository's overall condition. 📋 ✅ All required files present. Latest Version: ✅ 🔍 LintAnalysis complete! Check out the details below. 📊 ❌ ruff: issues found — see job log ⚖️ License CheckEnsuring our copyright headers are in tip-top shape. ✍️ ✅ No license violations found (60 packages). License distribution: 14× MIT, 14× MIT License, 7× Apache Software License, 7× Apache-2.0, 4× BSD-3-Clause, 2× ISC License (ISCL), 2× PSF-2.0, 2× Python Software Foundation License, +7 more Full breakdown — 60 packages
Copyright (c) 2022 Phil Ewels Permission is hereby granted, free of charge, to any person obtaining a copy The above copyright notice and this permission notice shall be included in all THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 🔒 Security (pip-audit)Ensuring our security logs are being captured. 🪵 ✅ No known vulnerabilities found (68 packages scanned). 🔨 Build TestsChecking the alignment of our build components. 📏 ✅ All versions pass
📊 CoverageCharting the progress of our testing efforts. 📉 ❌ 54.4% total coverage Files below 80% coverage (12 files)
Full report: download the Your automated guardian for repository health 🛡️ |
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 `@ovoscope/intent_cases.py`:
- Around line 497-507: Remove the unreachable return of an undefined variable by
deleting the trailing "return created" statement; the function already returns
the result of register_intent_case_tests (referenced as
register_intent_case_tests(...)) so remove any reference to the undefined
variable created and keep the single return of register_intent_case_tests.
🪄 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
Run ID: a91697ef-5323-4d0b-9a8b-ce73664ab522
📒 Files selected for processing (3)
ovoscope/intent_cases.pyovoscope/pytest_plugin.pytest/unittests/test_intent_cases.py
| return register_intent_case_tests( | ||
| target_globals, | ||
| skill_id=cfg["skill_id"], | ||
| handlers=cfg["handlers"], | ||
| cases_dir=cases_dir, | ||
| pipelines=cfg.get("pipelines"), | ||
| ignore_messages=cfg.get("ignore_messages"), | ||
| timeout=cfg.get("timeout", 30), | ||
| m2v_warmup=cfg.get("m2v_warmup", 10.0), | ||
| ) | ||
| return created |
There was a problem hiding this comment.
Remove unreachable return statement with undefined variable.
Line 507 contains unreachable code that references an undefined variable created. The function already returns on line 497 via the register_intent_case_tests call. This unreachable statement should be removed.
🐛 Proposed fix
timeout=cfg.get("timeout", 30),
m2v_warmup=cfg.get("m2v_warmup", 10.0),
)
- return created📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return register_intent_case_tests( | |
| target_globals, | |
| skill_id=cfg["skill_id"], | |
| handlers=cfg["handlers"], | |
| cases_dir=cases_dir, | |
| pipelines=cfg.get("pipelines"), | |
| ignore_messages=cfg.get("ignore_messages"), | |
| timeout=cfg.get("timeout", 30), | |
| m2v_warmup=cfg.get("m2v_warmup", 10.0), | |
| ) | |
| return created | |
| return register_intent_case_tests( | |
| target_globals, | |
| skill_id=cfg["skill_id"], | |
| handlers=cfg["handlers"], | |
| cases_dir=cases_dir, | |
| pipelines=cfg.get("pipelines"), | |
| ignore_messages=cfg.get("ignore_messages"), | |
| timeout=cfg.get("timeout", 30), | |
| m2v_warmup=cfg.get("m2v_warmup", 10.0), | |
| ) |
🤖 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 `@ovoscope/intent_cases.py` around lines 497 - 507, Remove the unreachable
return of an undefined variable by deleting the trailing "return created"
statement; the function already returns the result of register_intent_case_tests
(referenced as register_intent_case_tests(...)) so remove any reference to the
undefined variable created and keep the single return of
register_intent_case_tests.
The previous auto-discovery used pytest_configure to walk sys.modules
for conftest.py files — but pytest doesn't collect tests from
conftest.py, and conftests aren't loaded yet at pytest_configure time
either. Switched to a pytest_pycollect_makemodule hookwrapper that
fires once per candidate test module: if the module declares a
top-level 'ovoscope_intent_cases' dict, the helper injects the
generated TestCase classes into its namespace before pytest's standard
Python-class collector walks it.
Result: a skill's complete intent-case wiring is now this 3-line file:
# test/end2end/test_intents.py
ovoscope_intent_cases = dict(
skill_id='my-skill.author',
handlers={'WhoAreYou.intent': 'MySkill.handle_who', ...},
)
Verified end-to-end:
- 12 tests collected from a 3-line shim in 0.14s
- TestM2V slice ran live (1 XPASS, 2 XFAIL matching the known
m2v-misroutes-'who are you' divergence canary) in 36 s
- Markdown / JSON / accuracy gate all fired correctly
Explicit register_intent_case_tests(globals(), ...) continues to work
unchanged.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Follow-up to #58. Adds the missing pieces needed to actually surface the intent-case accuracy data in a PR review without diving into action logs, and removes the last sleep-based race.
1. Markdown report (
--ovoscope-accuracy-md=PATH)Renders the per-(pipeline, lang, intent) pivot as Markdown with collapsible
<details>sections. Drops directly into the gh-automations PR-comment workflow as a new 🎯 Intent-Case Accuracy section alongside the existing 🔌 Skill Tests / 🚌 Bus Coverage panels (matching PR: OpenVoiceOS/gh-automations#32).Includes a Hardest utterances table (top-N by cross-pipeline pass rate) so reviewers can immediately see which phrasings need locale tuning.
--ovoscope-accuracy-top-ncontrols the cut-off (default 10).2. Structural baseline diff
Replaces the previous scalar
overall_accuracy < baselinegate with a per-case structural diff:The PR comment lists regressed cases verbatim (pipeline / lang / intent / utterance) and the session fails if any regression is present. JSON output now carries a
baseline_diffblock for downstream tooling.3. Auto-discovery via conftest
Skills can opt-in to intent-case tests with zero Python in their test module:
A new pytest_configure walks loaded conftest modules and calls
register_intent_case_tests()automatically. The explicit API stays supported.4. Deterministic m2v warmup
Replaces the
time.sleep(10)in_shared_minicroftwith a bus-event wait: listen forpadatious:register_intentuntil quiet for 0.5 s, then pad for the in-plugin 3 shandle_sync_intentsdebounce. Falls back to a sleep on any failure so the suite stays robust to FakeBus internals changing.Tests
test/unittests/test_intent_cases.py— 7 unit tests covering the case-file loader, the summary roll-ups (incl. newby_utterancerollup), the structural baseline diff, and the Markdown emitter (sections, baseline diff section). Runs in <1 s, no MiniCroft required.Test plan
pytest test/unittests/test_intent_cases.py— 7/7 passovos-skill-personalPR Release 1.1.0a1 #103) produces a populatedintent-accuracy.mdlocally🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
--ovoscope-accuracy-mdand--ovoscope-accuracy-top-nfor enhanced accuracy reporting.Tests