Repository navigation
Conversation
… .intent files Most skills ship no golden file, but every skill that registers Padatious intents already states what it was trained on. `ovoscope generate` reads a checkout's locale/<lang>/*.intent and *.entity files and writes rows that `ovoscope golden` runs, so any skill can be smoke-tested: an intent that never registers, a sentence another skill or pipeline stage takes, a handler that crashes. Nothing re-implements the template grammar: ovos_spec_tools.expand and inline_keywords expand each line, ovos_utils.bracket_expansion.expand_slots fills the slots, LocaleResources finds entities and vocabularies (in subfolders too, whatever the case of the lang folder). A slot is filled from its .entity file, then --slot NAME=VALUE, then a small default table by declared type and slot name; a slot nothing fills is skipped, not guessed. A template is skipped exactly when ovos-workshop 9.x drops it (expand raises MalformedTemplate: adjacent slots, empty sample, slot-only line), plus slot-only samples and unfilled slots, each with a stable reason id. Single-branch groups are folded and registered by OVOS, so their rows are generated and reported as warnings. Rows load through load_golden_rows and carry source: generated and machine_generated: true, plus template, source_file and slot_sources, so reports keep generated and hand-written golden apart. --format intent-cases writes <lang>/<Intent>.intent.test files with a generated header and never overwrites without --force. Rows per intent are capped (--max-per-intent, default 10); templates take turns so every line is covered before any gets a second row, entity values are spread, and the output is deterministic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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 |
This was referenced Sep 29, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new subcommand,
ovoscope generate, that drafts golden-utterance rows from a skill's ownlocale/<lang>/*.intentand*.entityfiles.ovoscope goldenruns the rows as they are, so a skill without a hand-written golden file can still be tested.Why
Most skills ship no golden file, yet a sentence taken from a skill's own training data should always reach its own intent. When it doesn't, the install, the pipeline or the registration is broken. That makes the generated rows a smoke test for every skill: an intent that never registers, a sentence another skill or pipeline stage takes, a handler that crashes, or a line ending in a slot on ovos-padatious < 2 (OpenVoiceOS/ovos-padatious-pipeline-plugin#175).
Today this is done by hand. The drafted rows already in the fleet were copied word for word from the
.intentfiles, e.g. hello-world'smachine_generatedrows. Two consumers need it automated: andlo/ovos-tui-client#44 (test the skills on a live install, compare stable and alpha) and andlo/ovos-klondike-mercantile#6 (test every skill in the store per release channel). A skill's own CI can use it as well.How
Nothing re-implements the template grammar:
ovos_spec_tools.expand+inline_keywordsexpand each line (OVOS-INTENT-1). These are the calls ovos-workshop makes when it registers the intent.ovos_utils.bracket_expansion.expand_slotsfills the slots, one sample at a time. The slot-value product, which is the part that explodes, is only built for rows that are actually taken.LocaleResources/find_lang_dirfind entities and vocabularies, including in subfolders (weather keeps its intents underen-US/intents/) and whatever the case of the lang folder.Slot values: a slot is filled from its
.entityfile, then--slot NAME=VALUE, then a small default table, first by declared type ({number:x},{location:x}, ...) and then by slot name. A slot none of these fill is skipped and reported, not guessed. A guessed value would produce a false miss, not a finding.Skipped, mirroring ovos-workshop 9.x: a template is skipped exactly when
expandraisesMalformedTemplate. That covers adjacent slots, an empty sample and a slot-only line, which is the condition_drop_malformed_samplesuses. Expansion is eager on purpose:(on|)yieldsonbefore its empty sample, and OVOS drops the whole line. Also skipped: a slot-only sample ({x}from{x} [please], whichexpandaccepts) and samples whose slots nothing fills. Every skip has a stable reason id.Single-branch groups
(word)are not skipped. ovos-spec-tools folds them to the bare word with a warning, and ovos-workshop registers them, so their rows are generated and the template is listed underwarnings.Cap:
--max-per-intent(default 10) per intent and language. Templates take turns, so every line gives one row before any line gives a second, because the bugs this finds are per line. Entity values are spread evenly over the value set, and the same checkout always gives the same rows in the same order.Generated is not golden: every row carries
"source": "generated"and"machine_generated": true, plustemplate,source_fileandslot_sources.load_golden_rowskeeps these inGoldenRow.provenance, so reports can keep generated and hand-written rows apart. Padatious was trained on exactly these sentences, so a pass proves the intent is reachable, not that the skill understands other phrasings.--format intent-caseswrites<lang>/<Intent>.intent.testfiles that open with a comment saying the same, and never overwrites an existing file without--force.Exit codes: 0 rows written, 2 no rows (no
.intenttemplates, or every one skipped), 3 an output file exists without--force.--reportwrites rows per intent, skips and warnings as JSON.Tested
test/unittests/test_generate.py, 36 tests: every skip reason, single-branch warning, slot sources, subfolders and lang-folder case, cap and round-robin, determinism, round-trip throughload_golden_rowsandload_intent_cases, overwrite protection, CLI.ovoscope golden: hello-world en-US 36/36 matched, convert en-US 20/20 matched.Not in this PR
goldenscoreboard does not carry row provenance yet, so for now a report tells generated from golden by running the files separately. AddingsourcetoRowResultand counting it in the scoreboard would be a small follow-up.--slotcovers it, and each language is one dict entry.build_engine_intentsingolden.pyglobs*.intentnon-recursively, so it misses skills that keep intents in subfolders (weather). This is unrelated to this change, but it came up while testing.🤖 Generated with Claude Code