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 the issue with the
waza checkcommand's discovery logic.Assistant
This is a Go project. Let me explore the structure more, especially looking for the
checkcommand implementation.Assistant
Let me look at the
cmd_check.gofile first to understand the discovery logic:Assistant
Now let me see the
checkReadinessfunction and how it discovers evals:Assistant
Now I can see the issue. The
checkReadinessfunction callsworkspace.FindEval(wsCtx, sk.Frontmatter.Name)to find the eval. Let me look at the workspace package to see howFindEvalworks and compare it with howcoveragediscovers evals:Assistant
Let me look at the
workspace_resolve.gofile and how the coverage command works:Assistant
Now let me look at the coverage command to understand how it discovers evals:
Assistant
Now I understand the issue better. Let me look at how the
checkcommand calls the workspace detection:Assistant
Now I see the issue. In
runCheck, when the argument looks like a path, it bypasses workspace detection:- When
waza check skills/development/skill-creatoris called,workspace.LooksLikePath(args[0])returns true (because it contains/) - So it goes directly to
checkReadiness(skillDir, nil)withwsCtx = nil! - In
checkReadiness, whenwsCtxisnil, it falls back to auto-detect from the working directory, but that auto-detect call (workspace.DetectContext(wd)) doesn't useconfigDetectOptions(), so it doesn't read the.waza.yamlconfiguration!
Meanwhile, in
runCheck, when the arg doesn't look like a path, it callsresolveWorkspace(args)which does useconfigDetectOptions().Let me also check the
LooksLikePathfunction to see what it considers a path:- When
Assistant
Now let me trace the issue more carefully. The issue is in two places:
-
In
runCheck: When a path-like argument is given (e.g.,skills/development/skill-creator), it bypasses workspace detection and callscheckReadiness(skillDir, nil)withnilworkspace context. -
In
checkReadiness: WhenwsCtxisnil, the fallback tries to auto-detect the workspace context usingworkspace.DetectContext(wd)without passingconfigDetectOptions(). This means it won't read.waza.yamland won't know the custom skills/evals directory paths.
Let me look at the
.waza.yamlin the repo root:-
Assistant
Now let me understand the problem better. Looking at the issue:
- The user has a workspace with skills in
skills/development/skill-creator/SKILL.md(nested path) and evals inevals/skill-creator/eval.yaml waza coverage .works because it scans the entireevals/directory treewaza check skills/development/skill-creatordoesn't find the eval because:- When path-like argument is used,
wsCtxisnilincheckReadiness - The fallback
workspace.DetectContext(wd)doesn't use config options - Even if it did, the skill name lookup
FindEval(wsCtx, sk.Frontmatter.Name)relies on the skill being registered inwsCtx.Skills
- When path-like argument is used,
Let me look more closely at how
FindEvalworks:- The user has a workspace with skills in
Assistant
Now I see the core issue.
FindEvalfirst callsFindSkillto get theSkillInfo, which requires the skill to be registered in the workspace context. WhencheckReadinessis called withwsCtx = nil, the fallback detection may not include the skill in itsSkillsslice because:- The skill is at
skills/development/skill-creator/SKILL.md- nested withinskills/ DetectContextusesscanForSkillswhich only scans immediate child directories- So it won't find skills nested deeper than one level
Let me verify this by checking
scanForSkills:- The skill is at
Assistant
Confirmed!
scanForSkillsonly looks at immediate child directories. But wait - let me also checkDetectContextmore carefully. Looking at the function again:Assistant
So the issue is clear now. The
scanForSkillsfunction only scans immediate child directories, but the user's skills are nested deeper (e.g.,skills/development/skill-creator/SKILL.md).However, looking at
coverage, it usesfilepath.WalkDirto recursively search for skills. Let me check the coverage function again:Assistant
Yes! The
coveragecommand usesfilepath.WalkDirto recursively find skills, whereas the workspace detection only scans immediate children. This is the root cause of the inconsistency.Now let me look at the test files to understand expected behavior:
Assistant
Good, I can see there's a test for
WorkspaceWithSeparatedEvalthat tests the scenario. Let me also check the workspace tests:Assistant
Now let me check if there's a recursive scan function already or if I need to create one:
Assistant
Now I have a clear understanding. The issue is:
scanForSkillsonly scans immediate children (non-recursive)coverageusesfilepath.WalkDir(recursive)checkwith a path argument bypasses workspace detection, and when it falls back to auto-detect, it doesn't useconfigDetectOptions()
The fix needs to:
- Make
scanForSkillsrecursive (likecoveragedoes) so it finds nested skills - Ensure
checkReadinessusesconfigDetectOptions()when auto-detecting workspace context
Let me create a test to reproduce the issue first:
Assistant
Let me set up the Go environment properly and run the tests.
Assistant
Now let me create a test script to reproduce the issue described in the bug report - nested skills that are not found by
check:Assistant
I've successfully reproduced the issue. The problems are:
waza check skills/development/skill-creator: Shows "Evaluation Suite: Not Found" because it bypasses workspace detectionwaza check skill-creator: Shows "no SKILL.md found" becausescanForSkillsis not recursivewaza coverage .: Works because it uses recursivefilepath.WalkDir
The root cause is that
scanForSkillsinworkspace.goonly scans immediate child directories, not nested ones. Let me fix this:Assistant
Now I understand the full picture. The issue has two parts:
-
scanForSkillsis not recursive - It only scans immediate children, so nested skills likeskills/development/skill-creator/SKILL.mdare not found. -
When a path argument is given to
check, it bypasses workspace detection entirely and callscheckReadiness(skillDir, nil)withnilcontext. Then incheckReadiness, the fallback auto-detection doesn't useconfigDetectOptions().
Let me fix both issues:
Fix 1: Make
scanForSkillsrecursive (likecoveragedoes)Fix 2: When
checkReadinessdoes fallback detection, useconfigDetectOptions()instead of plainDetectContextLet me start with Fix 1 - making
scanForSkillsrecursive:-
Assistant
Let me directly edit the workspace.go file to make
scanForSkillsrecursive:Assistant
I need to:
- Add
"io/fs"to imports in workspace.go - Add a helper function
parseSkillNameFromPath(similar to what coverage uses) - Replace
scanForSkillswith a recursive version - Add
parseAgentSkillNameFromPathhelper
Let me do this step by step:
- Add
Assistant
Good. Now let me find the exact location of
scanForSkillsfunction and replace it:Assistant
Now I need to replace the
scanForSkillsfunction with a recursive version. I also need to add helper functions for parsing skill names. Let me look at what functions already exist:Assistant
<tool_call>
Assistant
Now let me replace the
scanForSkillsfunction with a recursive version. I'll also add helper functions for parsing skill names without errors:Assistant
Let me continue with the fix. I need to replace the
scanForSkillsfunction with a recursive version:Assistant
Continuing the fix by replacing the old scanForSkills function with the new recursive version. I need to edit the workspace.go file to replace lines 285-303 with the new recursive implementation.
Assistant
Let me try the edit command with the correct syntax:
Assistant
I see there's a duplicate closing brace on line 347. Let me fix that:
Assistant
Good, the workspace.go file is fixed. Now let me verify it compiles and then address the second part of the issue - when
checkReadinessfalls back to workspace detection, it needs to useconfigDetectOptions().Assistant
The workspace package compiled successfully. Now I need to address the second part of the issue - when
checkReadinessfalls back to workspace detection incmd_check.go, it should useconfigDetectOptions()to read the.waza.yamlconfiguration.Let me look at the relevant code in
cmd_check.go:Assistant
I need to fix line 426 in cmd_check.go to use configDetectOptions() instead of calling DetectContext without options.
Assistant
I see the issue. On line 426,
workspace.DetectContext(wd)is called withoutconfigDetectOptions(), so it doesn't read.waza.yaml. I need to change this to useconfigDetectOptions().Assistant
Let me continue working on the fix. I need to edit the cmd_check.go file to add configDetectOptions() to the workspace.DetectContext call. The edit command syntax needs adjustment.
Assistant
I need to continue working on the fix. Let me verify the change was made correctly and then test the solution.
Assistant
Good, the change was made. Now let me verify the code compiles and then run the tests to make sure the fix works.
Assistant
The code compiles successfully. Now let me run the test script again to verify that the fix resolves the issue with nested skills not being discovered.
Assistant
The fix is working! Both commands now show "Evaluation Suite: Found":
waza check skills/development/skill-creator- Now shows "Evaluation Suite: Found" ✅waza check skill-creator- Now shows "Evaluation Suite: Found" ✅
Let me run the existing tests to make sure the fix doesn't break anything.
Assistant
...
Assistant
I see the issue. The test is failing because my recursive
scanForSkillsnow finds skills in any subdirectory of the root (step 4 inDetectContext), which breaks backward compatibility. The test expects that without explicitly specifyingmy-skillsas the skills directory, skills inmy-skills/should NOT be found.The fix should be:
- Step 3 (configured skills dir): Should be recursive - this is the main fix for the issue
- Step 4 (scan root for single-level skill directories): Should remain non-recursive for backward compatibility
Let me create two separate functions - one recursive and one non-recursive:
Assistant
I need to fix the test failure. The issue is that my recursive scanForSkills is now being used in step 4 of DetectContext, which should only scan immediate children for backward compatibility.
Let me:
- Keep scanForSkills as recursive (for step 3)
- Add scanForSkillsImmediate for step 4 (non-recursive)
- Update DetectContext to use scanForSkillsImmediate in step 4
Assistant
I see! Line 154 is step 4 in DetectContext where we scan immediate children. I need to:
- Add a new function
scanForSkillsImmediate(non-recursive) - Replace the call on line 154 to use
scanForSkillsImmediate
- Add a new function
Assistant
I need to add the
scanForSkillsImmediatefunction afterscanForSkillsand then update line 154 to use it. Let me do this:Assistant
...
Assistant
The user hasn't sent a new message - this is a continuation marker. I need to continue my work. I was in the middle of fixing the workspace.go file to add the
scanForSkillsImmediatefunction and then update line 154 to use it instead ofscanForSkills.Let me check what the current state of the file is after my sed command.
Assistant
Good, the new function was added. Now I need to update line 154 to use
scanForSkillsImmediateinstead ofscanForSkills:Assistant
You're right - I should continue with the fix. Let me verify the change and run the tests to confirm the fix works.
Assistant
Good! Now let me verify the code compiles and run the tests to make sure everything works:
Assistant
All workspace tests pass. Now let me run the check command tests and verify the complete fix:
Assistant
All tests pass. Now let me run the reproduction script again to confirm the fix works for the nested skill scenario:
Assistant
The fix is working correctly. Now let me run a broader test suite to make sure nothing is broken:
Assistant
All tests pass. Let me verify the complete solution by running a comprehensive test:
Assistant
All tests pass. Let me review the changes I made to summarize the fix:
Assistant
I need to continue working on the fix. Let me review the changes I made and verify everything is correct before submitting.
Assistant
The changes look correct. Let me run a final comprehensive test to ensure everything works before submitting:
Assistant
All tests pass. Let me also verify the fix one more time with our reproduction script:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.