ISSUE DESCRIPTION waza check eval discovery is inconsistent with coverage and run in…
- User
ISSUE DESCRIPTION
waza checkeval discovery is inconsistent withcoverageandrunin multi-skill workspacesSummary
In a multi-skill workspace,
waza coverage .andwaza run evals/.../eval.yamlboth recognize the eval structure, butwaza checkdoes not discover the related eval suite consistently.This creates a confusing user experience because the workspace appears valid for coverage and execution, but readiness checks report that no eval exists or fail to find the skill.
Environment
- Waza version:
0.31.0 - OS: Windows
- Shell: PowerShell
Workspace shape
This was reproduced in a repository with this structure:
repo/ ├── .waza.yaml ├── skills/ │ ├── development/skill-creator/SKILL.md │ ├── copilot-exclusive/mcp-ecosystem/SKILL.md │ ├── copilot-exclusive/fleet-parallel/SKILL.md │ ├── testing/eval-harness/SKILL.md │ └── copilot-exclusive/background-agent/SKILL.md └── evals/ ├── skill-creator/eval.yaml ├── mcp-ecosystem/eval.yaml ├── fleet-parallel/eval.yaml ├── eval-harness/eval.yaml └── background-agent/eval.yamlThe root
.waza.yamlincludes:paths: skills: skills/ evals: evals/ results: results/ server: resultsDir: resultsSteps to reproduce
From the workspace root:
waza coverage . waza check skills/development/skill-creator waza check skill-creator waza run evals/skill-creator/eval.yaml --task create-dev-skill-001 --trials 1 --output-dir results -vActual behavior
waza coverage .Coverage recognizes the pilot evals and shows the skill as partially covered.
Example outcome:
skill-creatorappears with2tasks- other pilot skills also appear in the coverage grid
waza run evals/skill-creator/eval.yaml ...Run executes successfully enough to:
- load the skill directories
- run the selected task
- apply graders
- save a result JSON file under
results/...
waza check skills/development/skill-creatorOutput includes:
Evaluation Suite: Not Found - Waza version:
- Assistant
I'll start by exploring the repository structure to understand the codebase and locate relevant files. Let's first get an overview.
- Assistant
Let me explore the repository structure more comprehensively.
- Assistant
This is a Go project. Let me explore the cmd directory to find the
checkcommand implementation. - Assistant
Good, I found the check command file. Let me examine it.
- Assistant
Let me search for the
checkReadinessfunction and the eval discovery logic. - Assistant
Let me look at the checkReadiness function starting at line 358.
- Assistant
Now I need to look at the
workspace.FindEvalfunction which is used for eval discovery. Let me examine that. - Assistant
I'll open the workspace.go file to see the FindEval function.
- Assistant
Now let me look at how
waza coveragediscovers evals to compare. Let's check cmd_coverage.go. - Assistant
Now I need to understand how the workspace resolution works for the check command. Let me look at workspace_resolve.go:
- Assistant
Let me check the workspace test file to understand the expected behavior:
- Assistant
Now let me examine the full workspace_test.go to understand the existing tests:
- Assistant
Let me see the full test file to understand the existing tests and expectations.
- Assistant
Now I need to understand the core issue. Let me re-read the issue description carefully:
The workspace structure is:
repo/ ├── .waza.yaml ├── skills/ │ ├── development/skill-creator/SKILL.md │ ├── copilot-exclusive/mcp-ecosystem/SKILL.md │ ├── copilot-exclusive/fleet-parallel/SKILL.md │ ├── testing/eval-harness/SKILL.md │ └── copilot-exclusive/background-agent/SKILL.md └── evals/ ├── skill-creator/eval.yaml ├── mcp-ecosystem/eval.yaml ├── fleet-parallel/eval.yaml ├── eval-harness/eval.yaml └── background-agent/eval.yamlThe
.waza.yaml:paths: skills: skills/ evals: evals/ results: results/ server: resultsDir: resultsThe issue is:
waza coverage .works - discovers evals and skills
- Assistant
Now I understand the root cause. Let me analyze:
Problem:
scanForSkillsonly checks immediate children of the skills directory for SKILL.md. In the issue's workspace structure, skills are nested two levels deep (skills/development/skill-creator/SKILL.md), so the scan fails.Coverage uses
filepath.WalkDir(recursive), while check usesscanForSkills(immediate children only).Let me also check how the
checkcommand handles the case wherewsCtxis nil but a path is given: - Assistant
Let me understand the project configuration loading:
- Assistant
Let me find the projectconfig package.
- Assistant
Let me examine the projectconfig to understand how the config is loaded and used.
- Assistant
Let me understand the full picture. The issue is that
scanForSkillsonly checks immediate children of the skills directory, so nested skill directories (likeskills/development/skill-creator/SKILL.md) are never found.Let me also check for the
countValidatedTasksfunction used in the check command for eval validation: - Assistant
Now I have a clear understanding of the issue. Let me trace through the problem:
-
scanForSkillsonly checks immediate children - In the issue, skills are nested likeskills/development/skill-creator/SKILL.md, butscanForSkillsonly checksskills/development/for SKILL.md (not found). -
checkReadinesscalled withwsCtx=nilfor path args - When a path likeskills/development/skill-creatoris given,checkReadinessis called withwsCtx=nil, so it falls back to auto-detection with default options (no.waza.yamlconfig). -
Auto-detection in
checkReadinessuses defaults - The fallback workspace detection incheckReadinessdoesn't useconfigDetectOptions(), so it uses defaultskills/evalsdirectories instead of the ones from.waza.yaml.
Let me first reproduce the issue with a test script:
-
- Assistant
Now I have a clear picture. The issue is two-fold:
-
scanForSkillsonly checks immediate children of the skills directory, but skills can be nested deeper (e.g.,skills/development/skill-creator/SKILL.md). -
When called with a path argument,
checkReadinessreceiveswsCtx=niland falls back to auto-detection without.waza.yamlconfig. -
When called with a skill name,
resolveWorkspacefails because skills are nested 2 levels deep andscanForSkillscan't find them.
Let me now implement the fix. The main change is to make
scanForSkillssupport recursive scanning: -
- Assistant
Let me look at the key
scanForSkillsfunction that needs fixing: - Assistant
Now let me look at the scanForSkills function:
- Assistant
Now I have a clear understanding of the root cause. Let me trace through both cases:
waza check skill-creator(by name):LooksLikePath("skill-creator")→ falseresolveWorkspace→DetectContext(wd, configDetectOptions()...)scanForSkills(skillsDir)only checks immediate children ofskills/- Children are
development/,copilot-exclusive/,testing/— none have SKILL.md directly - Returns
ContextNone→ error → fallback to current dir → "no SKILL.md found"
waza check skills/development/skill-creator(by path):LooksLikePath(...)→ truecheckReadiness(skillDir, nil)— wsCtx is nil- Auto-detection from working dir:
DetectContext(wd)without config → samescanForSkillsissue - Can't find eval → "Evaluation Suite: Not Found"
The root cause:
scanForSkillsonly checks immediate children whilecoverageuses recursivefilepath.WalkDir.Let me now check for related tests and make the fix:
- Assistant
Let me check the Go environment:
- Assistant
Let me set up the Go environment properly:
- Assistant
Let me try to set GOPATH properly.
- Assistant
Let me set the HOME environment variable and try again.
- Assistant
Now let me understand the exact changes needed. I'll look at the full
DetectContextandcheckReadinessflow: - Assistant
Now I understand the root cause clearly. Let me trace through both scenarios:
waza check skill-creator(skill name):resolveWorkspace→DetectContext→scanForSkills(skills/)only checks immediate children (development/,copilot-exclusive/,testing/) — none have SKILL.md directly- Returns
ContextNone→ error "no workspace detected"
waza check skills/development/skill-creator(path):checkReadiness(skillDir, nil)withwsCtx=nil- Auto-detection calls
DetectContext(wd)with defaults → samescanForSkillsproblem - Can't find eval → "Evaluation Suite: Not Found"
The core problem:
scanForSkillsonly checks immediate children of the skills directory, whilecoverageusesfilepath.WalkDirfor recursive discovery.Let me now implement the fix:
- Assistant
Now I understand the two-part issue clearly:
- Primary bug:
scanForSkillsonly scans immediate children → nested skills (skills/development/skill-creator/SKILL.md) not found - Secondary issue:
checkReadinesscalled withwsCtx=nilfor path args, and its fallback auto-detection doesn't use project config
Let me implement the fix. The key change is making
scanForSkillsrecursive, matchingcoverage'sdiscoverSkillFiles: - Primary bug:
- Assistant
Let me use bash to make the edit:
- Assistant
Let me verify the edit was applied correctly:
- Assistant
Good, the edit looks correct. Now let me also need to handle the second issue - when
checkReadinessis called with a path butwsCtx=nil, it should load project config for proper auto-detection. Let me also fix thecmd_check.goto pass config options: - Assistant
Now let me fix the second issue - the auto-detection fallback in
checkReadinessshould use project config: - Assistant
Now I need to fix the second issue:
checkReadiness's auto-detection should use config options. Let me modify it to useconfigDetectOptions(): - Assistant
Let me verify the change:
- Assistant
Good. Now let me also check if there are additional issues. Let me look at how
runCheckhandles the path argument case: - Assistant
Now I see the full picture. There's also a second issue - when
waza check skill-creatoris used (skill name, not path), theresolveWorkspacecall fails becausescanForSkillsdoesn't find nested skills. But with my fix toscanForSkills, both paths should work. Let me also check theFindEvalfunction's path construction: - Assistant
Good, I can see that
FindEvalfirst callsFindSkillto look up the skill in the context. If the skill isn't in the context (because scanForSkills didn't find it), it returns an error. Now let me verify the fix compiles: - Assistant
Good, it compiles. Now let me run the workspace tests:
- Assistant
I see - one test is failing because
scanForSkillsis now too aggressive for step 4 (scanning root directory). The testTestDetectContext_WithCustomSkillsDirexpects that when using default options, skills undermy-skills/(notskills/) are NOT found via step 4. But with recursive scanning, they are now found.The fix: Step 4 (scanning root directory) should only look at immediate children (shallow scan), while step 3 (configured skills directory) should scan recursively.
Let me fix this by adding a depth parameter:
- Assistant
I see the issue. Let me revise the approach - keep the shallow scan for step 4, and add a recursive scan for step 3:
- Assistant
I need a different approach. Let me keep the original shallow
scanForSkillsand add a new recursive version. The issue is:- Step 3 (configured skills dir) needs recursive scanning
- Step 4 (root dir fallback) needs shallow scanning
- Assistant
Let me directly rewrite the function properly:
- Assistant
Good. Now I need to update
DetectContextto usescanForSkillsRecursivefor step 3 (the configured skills directory): - Assistant
Now I need to change step 3 to use
scanForSkillsRecursiveinstead ofscanForSkills: - Assistant
Now let me also update the
.github/skillsscan to use recursive: - Assistant
Let me verify the changes are correct:
- Assistant
It seems the sed commands didn't work. Let me check what's there:
- Assistant
Now I see the issue - the sed commands targeted wrong line numbers. Let me fix them properly:
- Assistant
Let me verify:
- Assistant
Good. Now let me run the tests again:
- Assistant
All workspace tests pass. Now let me run the full test suite:
- Assistant
Let me also build the cmd/waza package:
- Assistant
All tests pass. Now let me create a test script to verify the fix works for the issue scenario:
- Assistant
I need to build from the waza directory.
- Assistant
Good, the build succeeded. Now let me test with the test workspace:
- Assistant
Excellent!
waza check skill-creatornow correctly finds the eval! The key line is:🧪 Evaluation Suite: Found ✅ eval.yaml detected. Run 'waza run eval.yaml' to test.Now let me test the path-based invocation too:
- Assistant
Both paths work! Let me also test
waza checkwith no args in the multi-skill workspace: - Assistant
Excellent! The fix works perfectly. All three skills are found now. Let me also run the full test suite:
- Assistant
All tests pass. Let me now verify my changes are correct and review the diff:
- Assistant
The diff looks clean and focused. Let me verify the fix handles edge cases properly. Let me test with a deeper nested structure:
- Assistant
Now let me test with the deeply nested structure:
- Assistant
Let me check the eval part:
- Assistant
Let me also test the path-based invocation with the deep structure:
- Assistant
Let me also test that coverage still works correctly:
- Assistant
Coverage also works correctly - it finds the skill and its eval. Let me now test the original scenario from the issue:
- Assistant
Both
coverageandchecknow find the same skills. Let me verify theeval-harnessskill too (which is underskills/testing/): - Assistant
Good -
eval-harnesscorrectly shows "Not Found" because we didn't create an eval.yaml for it. Let me run all the tests one more time to confirm everything is clean: - Assistant
All tests pass. Let me clean up the test workspaces and provide a summary of the changes:
- Assistant
Let me verify the final state of the changes one more time:
- Assistant
Let me review the final diff one more time:
- Assistant
Let me also verify that the imports are correct (we're using
os.DirEntrywhich is fine since it's an alias forfs.DirEntry):
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.