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 structure to understand the codebase and then identify where the
checkcommand's discovery logic differs fromcoverageandrun.Assistant
This is a Go project. Let me explore the structure more, particularly the
cmd/wazadirectory andinternaldirectory where the commands are likely implemented.Assistant
Let me look at the main files related to the issue -
cmd_check.goandcmd_coverage.goto understand how they discover evals differently:Assistant
The file is large. Let me look at the key function
checkReadinesswhich does the actual evaluation discovery. Let me search for it.Assistant
Now I can see the
checkReadinessfunction. The key logic for finding evals is in lines 416-435. Let me also look at the workspace functions to understand how they work:Assistant
Now let me look at the workspace package to understand how
FindEvalandDetectContextwork:Assistant
Now I understand the workspace logic. Let me now look at the
cmd_coverage.goto see how it uses the workspace detection differently:Assistant
Now I see the key difference! The
coveragecommand usesdiscoverSkillFilesanddiscoverEvalFileswhich scan directories for skills/evals, and it also uses the.waza.yamlpaths implicitly viadiscoverPaths. But thecheckcommand has a different flow.Let me trace the issue. Looking at
runCheckfunction:Assistant
Let me look at the existing tests to understand the expected behavior better:
Assistant
This test
TestCheckCommand_WorkspaceWithSeparatedEvalis important. It shows that when runningwaza check eval-testin a workspace with the proper structure, it should find the eval. Let me run the tests first to see if they pass:Assistant
Let me set up the Go environment properly.
Assistant
Good, the test passes. Now let me understand the issue better. According to the issue, the problem occurs when:
- Running
waza check skills/development/skill-creator- reports "Evaluation Suite: Not Found" - Running
waza check skill-creator- reports "no SKILL.md found in "
But
waza coverage .andwaza run evals/skill-creator/eval.yamlwork fine.Let me trace through the code:
- When user runs
waza check skills/development/skill-creator, the arg is"skills/development/skill-creator" - In
runCheck,workspace.LooksLikePath(args[0])will returntrue(because it contains/) - So it goes directly to the path-based code path, calling
checkReadiness(skillDir, nil)withwsCtx = nil - Since
wsCtxisnil, the workspace-aware eval detection is skipped!
This is the bug! When a path is provided, the
wsCtxisnil, so the eval discovery incheckReadinessthat relies on workspace context won't work properly.Let me verify by looking at the code again:
- Running
Assistant
Yes, confirmed! On line 182, when a path-like argument is detected,
checkReadiness(skillDir, nil)is called withnilforwsCtx. This means the workspace-aware eval detection won't work.Now let me also check the second case:
waza check skill-creator:- When user runs
waza check skill-creator, the arg is"skill-creator"(no/) workspace.LooksLikePath("skill-creator")returnsfalse- So it goes to
resolveWorkspace(args)which should find the skill
Let me check
resolveWorkspace:- When user runs
Assistant
I see! When
waza check skill-creatoris run (without/), it goes toresolveWorkspace, which:- Calls
workspace.DetectContext(wd, configDetectOptions()...)- this uses the configured skills/evals directories from.waza.yaml - Then looks up the skill by name with
workspace.FindSkill(ctx, "skill-creator")
But wait, there's an issue. The user reports getting
no SKILL.md found in <workspace root>. This error comes fromcheckReadiness:goskillPath := filepath.Join(skillDir, "SKILL.md") if _, err := os.Stat(skillPath); errors.Is(err, os.ErrNotExist) { return nil, fmt.Errorf("no SKILL.md found in %s", skillDir) }So if
resolveWorkspacefails, it falls back to checking the current directory. Let me trace what happens when returns an error...- Calls
Assistant
I see the issue now! The
scanForSkillsfunction only scans immediate child directories. So for a structure like:codeskills/ ├── development/ │ └── skill-creator/SKILL.md ├── copilot-exclusive/ │ ├── mcp-ecosystem/SKILL.md │ └── ...When it scans
skills/, it findsdevelopment/andcopilot-exclusive/directories, but those directories don't containSKILL.mddirectly - they contain subdirectories withSKILL.mdfiles. SoscanForSkillswon't find them!However, the
coveragecommand usesfilepath.WalkDirto recursively find skills:Assistant
That's exactly it! The
coveragecommand usesfilepath.WalkDirwhich recursively walks through directories, but theworkspacepackage'sscanForSkillsonly looks at immediate children.Now let me create a test to reproduce the issue:
Assistant
Let me create a script to reproduce the issue with nested skill directories:
Assistant
I'll submit my changes now.
Assistant
Let me first create a proper test to reproduce the issue with nested skill directories.
Assistant
I need to build the waza binary first:
Assistant
I've successfully reproduced the issue:
waza check skills/development/skill-creator- Shows "Evaluation Suite: Not Found" even though the eval exists atevals/skill-creator/eval.yamlwaza check skill-creator- Shows "no SKILL.md found in /tmp/tmp.rTKwOv55Mf" even though the skill exists atskills/development/skill-creator/SKILL.mdwaza coverage .- Works correctly and finds both skills with their evals
Now I understand the two bugs:
Bug 1: When using a path like
skills/development/skill-creator,checkReadinessis called withwsCtx = nil, so it can't discover the eval through workspace-aware detection.Bug 2: The
scanForSkillsfunction inworkspace.goonly scans immediate child directories, not nested directories. So skills inskills/development/skill-creator/are not found.Let me fix both issues:
Fix 1: Make
scanForSkillsrecursive to find skills in nested directories.Fix 2: When a path is provided to
check, also detect workspace context so eval discovery works properly.Let me start with Fix 1:
Assistant
Now I need to make
scanForSkillsrecursive. Let me update it:Assistant
I need to modify
scanForSkillsto recursively scan subdirectories. Let me update the function:Assistant
The edit got mangled. Let me revert and try again with a different approach:
Assistant
Let me use sed to make the replacement more precisely:
Assistant
The replacement worked. Now let me verify the code compiles and run the test:
Assistant
Good, it compiles. Now let me run the existing workspace tests:
Assistant
One test failed:
TestDetectContext_WithCustomSkillsDir. Let me look at this test to understand what it expects:Assistant
I see. This test expects that when running with default options (without specifying a custom skills directory), it should NOT find skills in
my-skills/. However, my recursive change is finding skills in nested directories.The issue is that step 4 of
DetectContextscans all child directories:go// 4. Scan immediate children of dir for SKILL.md skills = scanForSkills(absDir)With my recursive change, this now scans all nested directories under the root, which could find skills in unexpected places.
The fix should only apply to the configured skills directory (step 3), not to the fallback scan (step 4). Let me update my approach:
- Keep step 4 as a non-recursive scan (just immediate children)
- Make step 3 (the configured skills directory scan) recursive
Assistant
bash
<tool_call> <function=bash_terminal> <parameter=command> cat > /tmp/workspace_patch.go << 'ENDOFFILE' // scanForSkills scans immediate child directories of parentDir for SKILL.md files. func scanForSkills(parentDir string) []SkillInfo { entries, err := os.ReadDir(parentDir) if err != nil { return nil }
codeAssistant
The user is pointing out that I need to use a proper tool call. Let me continue with my fix.
I've already added the
scanForSkillsRecursivefunction toworkspace.go. Now I need to updateDetectContextto use the recursive scan for the configured skills directory (step 3) while keeping the non-recursive scan for the fallback (step 4).Assistant
I need to change
scanForSkillstoscanForSkillsRecursiveon lines 133 and 139 for the configured skills directories, but keepscanForSkillson line 153 for the fallback scan.Assistant
Let me check if the changes were actually applied:
Assistant
Good, the changes look correct. Now let me verify the recursive functions are properly defined and run the tests.
Assistant
Wait, the recursive functions weren't added to the file. Let me check what happened. The previous git checkout reverted all changes. I need to add the recursive functions again.
Assistant
I see the issue - the function calls were changed to
scanForSkillsRecursive, but the recursive function definitions were never added to the file. Let me add them.Assistant
Continuing to implement the recursive skill discovery fix. I need to verify that the recursive functions were properly added to the file.
Assistant
I see the issue - the insertion point was wrong, causing the
scanForSkillsfunction to be missing its closing brace. Let me fix this:Assistant
Let me start fresh with a cleaner approach. I'll create a complete patch file and apply it properly.
Assistant
The user is asking me to fix the issue. Let me continue with my work. I need to:
- Verify the workspace.go changes were applied correctly
- Now fix the cmd_check.go to pass workspace context when a path is provided
- Test that both issues are resolved
Let me first check the workspace.go changes, then move on to fix cmd_check.go.
Assistant
Good, the workspace.go changes look correct. Let me run the workspace tests:
Assistant
All workspace tests pass. Now I need to fix the second issue in
cmd_check.go- when a path-like argument is provided (e.g.,skills/development/skill-creator), the workspace context is not being detected, so eval discovery fails.Let me examine the relevant code and fix it:
Assistant
Now I see the issue. When a path-like argument is provided,
checkReadinessis called withnilworkspace context. I need to fix this to also detect the workspace when a path is provided.Assistant
Good, both fixes are applied. Now let me build and test the changes.
Assistant
Now let me run my test script again to see if both issues are fixed:
Assistant
Excellent! Both issues are now fixed:
waza check skills/development/skill-creator- Now shows "Evaluation Suite: Found" ✅waza check skill-creator- Now works correctly and finds the skill ✅
Now let me run the existing tests to make sure I didn't break anything:
Assistant
The test results show all tests passed - all green. The workspace tests and check command tests are all passing. Let me run a few more related tests to ensure the fix is comprehensive.
Assistant
All tests are passing. Let me now create a more comprehensive test to verify my fix handles edge cases properly, and then I'll submit the solution.
Let me create a test script that covers:
- Nested skills with path argument
- Nested skills with skill name argument
- Workspace with .waza.yaml configuration
- Eval discovery works in all cases
- Edge cases like deeply nested skills
Assistant
Let me verify the changes I made and then submit them.
Assistant
All tests pass. Let me summarize the changes I made to resolve the issue and submit the solution.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.