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:
textrepo/ ├── .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:yamlpaths: skills: skills/ evals: evals/ results: results/ server: resultsDir: resultsSteps to reproduce
From the workspace root:
powershellwaza 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:
- Waza version:
- Assistant
I'll start by exploring the repository to understand its structure and locate the relevant code for
waza check,coverage, andrun. Let's first see what's in the root. - Assistant
Let me get a better overview of the project structure.
- Assistant
This is a Go project. Let me explore the structure more to understand the codebase.
- Assistant
Let me look at the checks directory first since that's where the
checkcommand logic likely lives, then the discovery directory for how skills/evals are discovered, and the cmd directory for the command structure. - Assistant
Let me start by reading the key files related to the issue. I'll examine the check command, discovery logic, and coverage command to understand how evals are discovered differently.
- Assistant
Now let me look at the check command and coverage command to understand how they discover evals.
- Assistant
Let me continue reading the file. I need to see the
checkReadinessfunction: - Assistant
Let me read the checkReadiness function.
- Assistant
Now let me look at the workspace detection logic, particularly
workspace.FindEvalandworkspace.DetectContext: - Assistant
Let me look at the workspace.go file to understand FindEval and DetectContext.
- Assistant
Now let me look at the workspace_resolve.go and the coverage command to understand how they handle eval discovery:
- Assistant
Now let me look at how
cmd_coverage.godiscovers evals: - Assistant
Now I need to understand the exact discovery differences between
checkandcoverage. Let me trace the flow more carefully: - Assistant
Now I have a clear picture. Let me trace the exact problem. Let me look at how
scanForSkillsworks and howcoveragediscovers skills differently: - Assistant
Let me read the function again.
- Assistant
Now I understand the issue completely. Let me trace through the key problem:
scanForSkillsinworkspace.goonly checks immediate children of the skills directory- For a workspace with
skills/development/skill-creator/SKILL.md,scanForSkills("skills/")only looks atskills/development/,skills/copilot-exclusive/,skills/testing/- none of which have SKILL.md directly coverageusesdiscoverSkillFileswhich doesfilepath.WalkDirrecursively - finding skills at any depthfindEvalConfigindiscovery.gousesfilepath.Dir(filepath.Dir(skillDir))which only goes up 2 levels, not enough forskills/development/skill-creator/
Let me check the existing tests:
- Assistant
Let me also look at the discovery tests:
- Assistant
Let me look at the checks/eval_suite.go and the existing tests for the check command:
- Assistant
Now let me also check the cmd_check_test.go and cmd_check_workspace_test.go to understand test coverage:
- Assistant
Now I have a complete understanding. Let me summarize the root causes:
Root Cause 1:
scanForSkillsinworkspace.goonly checks immediate children of the skills directory. Forskills/development/skill-creator/SKILL.md, it looks atskills/development/and doesn't find SKILL.md there. Meanwhile,coverageusesfilepath.WalkDirto recursively find skills.Root Cause 2:
findEvalConfigindiscovery.gousesfilepath.Dir(filepath.Dir(skillDir))which only goes up 2 levels. Forskills/development/skill-creator/, it goes toskills/instead of the workspace root.Let me now make the fixes:
- Assistant
Let me check the Go environment.
- Assistant
Let me set up the Go environment properly.
- Assistant
Let me set the full Go environment.
- Assistant
Good, tests pass. Let me also run the discovery tests and check tests.
- Assistant
Good. Now let me also run the cmd/waza tests.
- Assistant
All tests pass. Now let me first create a reproduction test to confirm the bug, then implement the fix. Let me create a test that simulates the multi-skill workspace structure from the issue:
- Assistant
Let me write it as a proper test:
- Assistant
The test confirms the bug. The workspace detection fails to find skills in nested directories. Now let me implement the fix. I need to make
scanForSkillsrecursive inworkspace.go: - Assistant
Now let me fix
scanForSkillsin workspace.go to make it recursive: - Assistant
Now let me edit the
scanForSkillsfunction to be recursive: - Assistant
Let me also update the comment above the function:
- Assistant
Now let me fix
findEvalConfigindiscovery.go. The current code usesfilepath.Dir(filepath.Dir(skillDir))which only goes up 2 levels, but for nested skills likeskills/development/skill-creator/, it needs to go up further to find the workspace root: - Assistant
Let me look at the full findEvalConfig function:
- Assistant
Let me read the findEvalConfig function:
- Assistant
Now I need to fix
findEvalConfigto walk up the directory tree to findevals/{name}/eval.yamlat any level. The current code only goes up 2 levels: - Assistant
Let me also update the comment above
findEvalConfig: - Assistant
Now let me also add a missing blank line before
FilterWithEval: - Assistant
The edit got garbled. Let me see the full file and fix it properly:
- Assistant
The file got garbled. Let me fix the section from line 137 to 147:
- Assistant
Good, the file is now correct. Let me run the tests to make sure existing tests still pass:
- Assistant
Good, discovery tests pass. Let me run workspace tests:
- Assistant
The test
TestDetectContext_WithCustomSkillsDirfails because step 4 inDetectContext(scanning CWD for child dirs) now recursively finds skills inmy-skills/. Step 4 should remain non-recursive (it's for direct children of CWD), while step 3 (configured skills dir) should be recursive.Let me keep
scanForSkillsnon-recursive for step 4 and create a separate recursive variant for step 3: - Assistant
Let me look at where
scanForSkillsis called inDetectContext: - Assistant
Let me read the DetectContext function to see the exact flow:
- Assistant
I need to keep step 4 non-recursive but make steps 3 and 3b recursive. Let me revert
scanForSkillsand create a separate recursive variant: - Assistant
Good. Now let me update
DetectContextto usescanForSkillsRecursivefor steps 3 and 3b (the configured skills dirs): - Assistant
Now let me also update step 3b to use
scanForSkillsRecursivefor.github/skills/: - Assistant
Now let me run the workspace tests again:
- Assistant
All workspace tests pass. Let me run discovery tests too:
- Assistant
All tests pass. Now let me run the cmd/waza tests:
- Assistant
Excellent! All tests pass. Now let me create a reproduction test that verifies the fix works for the specific scenario described in the issue. I'll create a temporary test file:
- Assistant
The reproduction test passes. Now let me clean up the test file and also verify the discovery fix works for nested skills:
- Assistant
Let me also verify the discovery fix for deeply nested skills by running the existing discovery tests and checking the
TestDiscoverProjectLayouttest: - Assistant
All tests pass. Now let me run the full test suite for cmd/waza to make sure nothing is broken:
- Assistant
All tests pass. Now let me also run a broader test to make sure nothing else is broken:
- Assistant
All internal tests pass. Let me now review the changes I've made to ensure they're correct:
- Assistant
The changes look correct. Let me now run the full test suite one more time to make sure everything is working:
- Assistant
Let me check if there were any failures:
- Assistant
Good, no failures. Let me also check if there are any tests that I might have missed by looking at the full output:
- Assistant
All tests pass. Let me now verify the final state of the changes by looking at the diff one more time:
- Assistant
Now let me also think about an important edge case. The
checkReadinessfunction's auto-detection in step 5 doesn't useconfigDetectOptions(). Let me check if this could cause issues for the specific scenario described in the issue: - Assistant
Let me check the eval detection logic in
checkReadiness: - Assistant
Let me see the exact eval detection logic:
- Assistant
I also notice that the
checkReadinessfunction's fallback detection at line 424-430 doesn't useconfigDetectOptions()to load project config. This means if a workspace uses custom paths in.waza.yaml, the fallback detection won't use them. Let me fix this too: - Assistant
Let me update the fallback detection to use
configDetectOptions(): - Assistant
I see there's a duplicate closing brace on line 434. Let me fix that:
- Assistant
I see there's an extra
}on line 434. Let me fix this: - Assistant
I see there are still duplicates. Let me fix the whole section properly:
- Assistant
Good. Let me verify the code compiles:
- Assistant
Good, the code compiles. Let me run all the tests again:
- Assistant
All tests pass. Let me also run the checks package tests:
- Assistant
All tests pass. Let me now run the complete test suite to verify nothing is broken:
- Assistant
All tests pass with no failures. Let me verify the final diff:
- Assistant
Let me look at the complete diff to make sure everything is correct:
- Assistant
The diff looks correct. Let me now verify the full test suite passes once more with a clean run:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.