feat: focused test generation in waza suggest (closes #357)#380
Merged
Conversation
Extend `waza suggest` with steerable generation and merge-safe apply: - New flags: --count, --focus, --force (in addition to existing --dry-run / --apply / --model / --output-dir / --format) - Per-case confidence (0-1) and rationale referencing the SKILL.md span - --apply is merge-safe: existing eval.yaml is preserved (new task files picked up via existing tasks: glob), and existing task / fixture files (by path or task id) are never overwritten unless --force is also passed - Generated tasks are schema-validated via internal/validation before being written to disk - Focus categories: triggers, negative-triggers, edge-fixtures, do-not-use-for, parameters - Tests cover focus directives, count guidance, overwrite safety (with and without --force), duplicate task id detection (in-batch and against existing tasks), and schema validation failures - README.md and site CLI reference updated with new flags + worked examples Closes #357 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds steerable, merge-safe synthetic test generation to waza suggest, aligning with #357 by introducing focus/count controls, per-task metadata in dry-run/JSON output, overwrite safety checks, and schema validation before writing artifacts.
Changes:
- Add
--count,--focus, and--forceflags towaza suggest, with validation and updated help/docs. - Extend suggestion payload to include per-task
confidence/rationale(kept out of written task YAML), and validate generated eval/task YAML via JSON schema before writing. - Make
--applymerge-safer by default (skip overwriting existing eval.yaml; refuse task/fixture overwrites unless forced; show diffs on task conflicts) and add tests for these behaviors.
Show a summary per file
| File | Description |
|---|---|
| site/src/content/docs/reference/cli.mdx | Documents new waza suggest flags, merge-safety behavior, and a worked focused example. |
| README.md | Updates waza suggest docs and examples to cover count/focus/force and metadata behavior. |
| internal/suggest/suggest.go | Implements focus categories, schema validation, overwrite/id-collision safeguards, diff output, and force/merge-safe write options. |
| internal/suggest/prompt.go | Updates LLM prompt schema/instructions to request confidence/rationale and honor count/focus directives. |
| cmd/waza/cmd_suggest.go | Wires new CLI flags into generation + apply flow, including argument validation and force/apply constraints. |
| internal/suggest/suggest_test.go | Updates existing tests for the new WriteToDir signature. |
| internal/suggest/suggest_apply_test.go | Adds tests for focus directives, overwrite/id safety, and schema validation failures. |
| internal/suggest/resolve_test.go | Updates tests for the new WriteToDir signature. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 4
- Review effort level: Low
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jun 28, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
waza suggeststeering flags:--count,--focus,--force, alongside existing dry-run/apply behavior.confidenceandrationalein suggestion output while keeping written task YAML schema-valid.--applymerge-safe with task-id/path overwrite checks, force override, and clear diffs for task conflicts.Closes #357
Validation
PATH=/opt/homebrew/bin:$PATH go test ./...PATH=/opt/homebrew/bin:$PATH make lintcd site && PATH=/opt/homebrew/bin:$PATH npm ci --no-audit --no-fund && PATH=/opt/homebrew/bin:$PATH npm run build