Skip to content

fix(golden): a machine-drafted row that names no real resource is a miss - #215

Merged
JarbasAl merged 1 commit into
devfrom
fix/golden-drafted-row-names-a-real-resource
Oct 1, 2026
Merged

JarbasAl merged 1 commit into
devfrom
fix/golden-drafted-row-names-a-real-resource

Conversation

@openvoiceos-bot

@openvoiceos-bot openvoiceos-bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Written by Claude Opus 5 (claude-opus-5) in an agent session, driven and read by a human maintainer.

The rule

A skill repository's own golden runner turns any mismatch on a
machine_generated row into an expected failure, with the reason
"coverage-gap (machine-drafted, pending native validation)". On
ovos-skill-fallback-unknown#69 that made nine kab and oc-FR rows green while
they named dotted pre-rename dialogs the skill had never shipped. A wrong
name is not a coverage gap.

The shared runner now separates the two. Every machine-drafted miss is
checked against the resources the skill ships for that row's locale,
locale/<lang>/<name>.intent|.dialog|.voc, read as written.

  • The name is there: the row is a coverage gap. It carries gap, it leaves
    the scored total, and the scoreboard counts it under coverage_gap with
    the row in gaps.
  • The name is not there, and no row of that locale fired the label: the row
    stays a miss, and its failure entry says which name the locale does not
    ship.

A label the run itself fired counts as real, because an Adapt intent built
in code ships no resource file.

What changed since the review

The review of the first cut recorded SHIP-WITH-FIXES with three defects.
Each one is fixed here, and each fix has a test that fails without it.

  1. An all-gaps run is not an all-skipped run. run_golden tested
    total == 0 alone, and the scoreboard takes the gaps out of scored as
    well as the skips. Two loaded rows and two gaps printed "ALL SKIPPED: 0
    row(s) loaded, every one needs_manual, nothing measured", exited 4, and
    returned above the COVERAGE GAP lines. The all-gaps case now prints the
    gap lines, prints an ALL GAPS line, and exits 6. Exit 4 keeps its
    meaning, and a control asserts it.
  2. The names come from the skill's own tree. locale_resources globbed
    <checkout>/**/locale/<lang>/*, so any other skill's file under the
    checkout answered for this skill. A run in a repository that holds a
    .venv read every installed skill's locale tree, which reopens the mask
    this rule exists to close. The search is bound to <root>/locale/<lang>
    and <root>/<package>/locale/<lang>, and assert_root_dir supplies the
    root.
  3. A label is proof for its own locale. run_rows accumulated one
    fired_labels set over every locale, so an intent that fired in en-US
    proved the name existed for pt-PT as well. The labels are kept per lang.

Rebase on #214

#214 landed first. This branch is rebased onto dev. Both sides rewrote
run_rows and scoreboard, and the merged result keeps #214's per-locale
process path, its worker_timeout bound and the pipeline/preset
arguments of scoreboard, with this PR's gap filter on the scored rows.

Under --per-locale-process the coverage-gap pass runs inside each child,
one locale per child, so the labels are per locale there by construction.
That is now stated in the code, and a test asserts that gap and reason
survive the worker's JSON result file, because a silent drop would read as a
run with no gaps at all.

Evidence

  • python -m pytest -q test/unittests/test_golden_minicroft.py: 43 passed.
  • Break checks, one at a time on the imported tree: the old total == 0
    branch fails the all-gaps test; the unbounded glob fails the two scoping
    tests; a pooled label set fails the two locale tests.
  • docs/cli.md records the rule, the tree bound and exit code 6.

Round 2: the bound reads res_dir, not root_dir

reviewer-b's SHIP-WITH-FIXES at 47de895 found that the bound read the wrong
directory. ovos-workshop ovos_workshop/skills/ovos.py:162 sets
self.res_dir = resources_dir or self.root_dir, and every resource loader
reads res_dir: load_lang, load_dialog_files, load_vocab_files,
load_regex_files and find_resource. A skill built with resources_dir=
keeps its locale tree where root_dir does not hold it, so the bound found no
name at all and the skill's OWN resource read as a name nobody ships. That
fails a run that should pass, which is worse than the sibling hole it
replaced.

assert_res_dir now supplies the tree, and run_rows reads it. A skill that
sets nothing keeps res_dir == root_dir, so the common case is the behaviour
this branch already had.

The decision on a resources_dir outside the checkout: it is refused. It
gets the same two checks as the root, exit code 3 with the path in the
message. The names in such a tree cannot be shown to be this checkout's own
source, and reading them lets a gold row that names a resource this checkout
does not ship pass, which is T-3140 from a new direction. A refusal is loud;
the alternative is silent.

A declared resources_dir also settles the package question: the skill said
where its resources live, which is stronger than any inference from the
module's path, so that directory alone is the bound.

own_package's NAME arm is kept, and its docstring now says why it is
unreachable today: the arm needs a caller that passes a root ABOVE the class
module's directory, and no production caller does, because ovos-workshop
derives root_dir from that module. It is the narrowing answer, so losing it
widens the bound.

Round 2 evidence

  • python -m pytest -q test/unittests/test_golden_minicroft.py: 69 passed.
  • Whole suite, test/unittests/: 788 passed, 38 skipped, 3 failed. The three
    are test_golden.py::TestEntryPointResolution and two
    TestRunGoldenSuite cases; they fail the same way on the unmodified
    47de895 tree in this venv, which has no template-engine plugins
    installed. CI has them.
  • Mutation: skill_root = root in place of the assert_res_dir call fails
    both new run_rows tests, the gap case and the control.
  • TestTheBoundFollowsResDir drives the whole chain through run_rows on a
    real MiniCroft, with a fixture skill that passes resources_dir. Its two
    trees each hold a name the other does not: hello under res_dir is a
    coverage gap, root_only under root_dir stays a miss. The bound moved
    rather than grew.
  • TestResDirIsCheckedLikeRootDir covers the refusals: outside the checkout,
    and under each of site-packages, dist-packages, .venv and venv.

Round 3: the language directory is walked recursively

reviewer-b's SHIP-WITH-FIXES at 4356d49 found that the bound read the right
TREE at the wrong DEPTH. OVOS-INTENT-2 §2:

A language directory MAY contain subdirectories; a skill author MAY use
them to organize resources in any way they choose. A loader resolves a
resource by searching the language directory and all its subdirectories,
recursively
. Subdirectory names carry no meaning to a loader — they are an
authoring convenience only.

ovos_workshop.resource_files.find_resource implements that with
sorted(directory.rglob(res_name)). locale_resources used a flat
folder.iterdir(), so a resource at locale/<lang>/dialog/x.dialog was never
named: the coverage-gap pass found no gap, and a machine-drafted row on the
skill's OWN resource read "en-US ships no resource named x: the row names one
that does not exist, which is a defect in the row". A correct row accused, and
a run that should pass failing.

The walk is now folder.rglob("*"), files only. The is_file() guard is not
decoration: under iterdir a DIRECTORY named trap.dialog was counted as a
resource, and a test pins that it is not.

Not a widening. The same clause forbids two files with one extension sharing a
base name anywhere in one language tree, so collapsing every depth into one
name set loses nothing, and a name no tree holds is still a miss.

Round 3 evidence

  • python -m pytest -q test/unittests/test_golden_minicroft.py: 74 passed,
    145s. Round 2 measured 69 on this file, so the 5 new tests are the whole
    delta and nothing went red.
  • Mutation, rglob put back to iterdir on the merged tree: 3 of the 5 fail,
    with the review's own sentence, AssertionError: False is not true : en-US ships no resource named 'nested': the row names one that does not exist.
    The two that pass are the premise (ovos-workshop finds the file) and the miss
    control, which is the right shape. The file was restored from a copy taken
    before the edit, and git diff afterwards shows only this round's work.
  • reviewer-b's own cell,
    review-ovoscope-215-4356d49.nested_locale_cell.py, re-run unchanged on this
    head: locale_resources -> ['hello', 'nested'] and the row reads
    matched=False gap=True, coverage-gap (machine-drafted, pending native validation). It read ['hello'] and gap=False at 4356d49.
  • TestTheLangDirectoryIsWalkedRecursively drives run_rows on a real
    MiniCroft with a fixture skill whose nested.dialog sits two directories
    below locale/en-US. It asserts the premise through ovos-workshop first, so
    a fixture the loader cannot read would fail loudly rather than prove nothing.
  • Fleet, counted over the 113 locale trees checked out on this box: 17 skills
    gain names under the recursive read and 13 had no name at all before it,
    ovos-skill-alerts, ovos-skill-audio-recording, ovos-skill-boot-finished,
    ovos-skill-color-picker, ovos-skill-date-time, ovos-skill-dictation,
    ovos-skill-weather and ovos-skill-hello-world among them. The review
    counted 127 trees, 38 and 28 by its own sweep; the numbers differ because the
    sweeps differ, and the direction and the named skills agree.
  • docs/cli.md now says the runner reads the lang directory and every
    directory below it.
  • Ruff: the gate named 4 E741 Ambiguous variable name: 'l' in the test file
    as added against dev. They came from rounds 1 and 2 of this pull request,
    not from dev and not from round 3 (ruff counts 5 at the merge base, 9 at
    4356d49 and 9 at the round-3 tree, and no round-3 line adds one). They are
    this pull request's own, so they are fixed rather than excused: the six lines
    in the two all-gaps tests bind ln, the file reads 5 again, and the file was
    re-run afterwards for the same 74 passed.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e938dfe4-2d3c-4d07-84bc-e5a2b8a8dd1a

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@github-actions github-actions Bot added the fix label Sep 19, 2026
@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Automated check summary ready. 📊

I've aggregated the results of the automated checks for this PR below.

🔍 Lint

Analysis complete! Check out the details below. 📊

❌ ruff: issues found in 74 file(s) — see job log
✅ actionlint: 12 workflow file(s), no finding

🔒 Security (pip-audit)

Cybersecurity sweep: checking for vulnerabilities. 🕸️

✅ No known vulnerabilities found (133 packages scanned).

⚖️ License Check

Checking for any potential legal hurdles. 🚧

✅ No license violations found.

Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.

🏷️ Release Preview

Ensuring the 'Thanks' section includes your name! 🤝

Current: 1.11.1a1 → Next: 1.11.2a1

Signal Value
Label fix
PR title fix(golden): a machine-drafted row that names no real resource is a miss
Bump build

⚠️ No conventional commit prefix — alpha-only bump.
Suggested: fix: update the thing or feat: update the thing


🚀 Release Channel Compatibility

Predicted next version: 1.11.2a1

Channel Status Note Current Constraint
Stable ⚪ Not in channel -
Testing ❌ Too new (must be <1.0.0) ovoscope>=0.7.2,<1.0.0
Alpha ✅ Compatible ovoscope>=1.6.15a1

📋 Repo Health

Ensuring the repository remains in peak condition. 🏔️

✅ All required files present.

Latest Version: 1.11.1a1

✅ ovoscope/version.py — Version file
✅ README.md — README
✅ LICENSE — License file
✅ pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
✅ CHANGELOG.md — Changelog
✅ ovoscope/version.py has valid version block markers

📊 Coverage

A deep dive into the sea of test results. 🌊

⚠️ 65.7% total coverage

Files below 80% coverage (16 files)
File Coverage Missing lines
ovoscope/golden_worker.py 0.0% 30
ovoscope/simple_listener.py 0.0% 63
ovoscope/version.py 0.0% 5
ovoscope/classic_listener.py 18.2% 117
ovoscope/intent_cases.py 22.3% 153
ovoscope/pytest_plugin.py 47.0% 210
ovoscope/ocp.py 47.9% 61
ovoscope/cli.py 48.3% 140
ovoscope/tts_intelligibility.py 49.0% 102
ovoscope/e2e.py 57.1% 73
ovoscope/listener.py 57.1% 127
ovoscope/voice_loop.py 59.0% 119
ovoscope/media.py 60.3% 96
ovoscope/audio.py 64.4% 126
ovoscope/__init__.py 66.9% 401
ovoscope/media_provider.py 67.6% 23

Full report: download the coverage-report artifact.

🔨 Build Tests

The build report has been filed and is ready. 📁

✅ All versions pass

Python Build Install Tests pytest
3.10 ✅ ✅ ✅ 809 passed, 25 skipped, 119 warnings in 304.59s (0:05:04)
3.11 ✅ ✅ ✅ 809 passed, 25 skipped, 119 warnings in 303.05s (0:05:03)
3.12 ✅ ✅ ✅ 809 passed, 25 skipped, 119 warnings in 314.18s (0:05:14)
3.13 ✅ ✅ ✅ 809 passed, 25 skipped, 156 warnings in 315.37s (0:05:15)
3.14 ✅ ✅ ✅ 809 passed, 25 skipped, 156 warnings in 322.45s (0:05:22)

Keeping the code clean, one PR at a time ✨

@JarbasAl
JarbasAl force-pushed the fix/golden-drafted-row-names-a-real-resource branch from 4b2e029 to 8fd442c Compare September 25, 2026 01:42
@github-actions github-actions Bot added fix and removed fix labels Sep 25, 2026
@JarbasAl
JarbasAl force-pushed the fix/golden-drafted-row-names-a-real-resource branch 4 times, most recently from 47de895 to 4356d49 Compare September 26, 2026 19:18
@github-actions github-actions Bot added fix and removed fix labels Sep 26, 2026
@JarbasAl
JarbasAl force-pushed the fix/golden-drafted-row-names-a-real-resource branch from 4356d49 to 9bb6273 Compare September 27, 2026 22:58
@github-actions github-actions Bot added fix and removed fix labels Sep 27, 2026
A skill repository's own golden runner turned any mismatch on a
machine_generated row into an expected failure. A wrong name is not a
coverage gap: the shared runner now checks the name against the resources
the skill ships for that row's locale, and a name nobody ships stays a miss
that says which name is missing.

The resource names come from the tree the skill READS, its res_dir, and from
the language directory with every directory below it. OVOS-INTENT-2 §2 says a
loader resolves a resource by searching the language directory and all its
subdirectories, recursively, which ovos-workshop find_resource implements
with rglob. A flat read named none of those files, so the skill's own nested
resource read as a name nobody ships: a correct row accused. Over the locale
trees checked out here, 13 skills had no name at all under the flat read,
ovos-skill-date-time, ovos-skill-alerts and ovos-skill-color-picker among
them.

A label the run itself fired counts as real, for its own locale alone,
because an Adapt intent built in code ships no resource file.

T-3735, T-5750, T-5864.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JarbasAl
JarbasAl force-pushed the fix/golden-drafted-row-names-a-real-resource branch from 9bb6273 to b4848c8 Compare September 27, 2026 23:13
@github-actions github-actions Bot added fix and removed fix labels Sep 27, 2026
@JarbasAl
JarbasAl marked this pull request as ready for review October 1, 2026 14:30
@JarbasAl
JarbasAl merged commit 4cda35d into dev Oct 1, 2026
15 checks passed
@JarbasAl
JarbasAl deleted the fix/golden-drafted-row-names-a-real-resource branch October 1, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants