Generate grounded tests
orangepro_generate_testsGenerate up to five grounded, bucket-diverse tests from local evidence for targeted behaviors, returning code, run hints, and verifiable citations so agents can write and execute them.
Instructions
Generate a small capped set (1-5) of grounded tests from local evidence using your own model key (BYOK: OpenAI-compatible, Ollama, or Anthropic). Tests are diversified across lightweight LOCAL scenario buckets (happy_path, validation_error, edge_case, integration_flow, security_privacy, regression) chosen from the evidence — unjustified buckets are skipped, never padded. By default it focuses the top-gap behavior and returns up to limit bucket-diverse tests for it; pass multiple target_ids to split the budget across them. Each test reports its bucket plus VALIDATED grounding evidence (every cited entity resolved against the local graph with its kind, evidence strength, and source_ref) and discloses weak/candidate evidence; evidence_summary reports proof coverage and any broken citations, so the grounding is verifiable rather than asserted. If evidence is too thin, returns missing-evidence guidance instead of generic tests. Returns each test's code plus run_hints (a suggested file path + run command) and an agent_workflow: YOU (the agent) write each file and run it with your shell tools, then report pass/fail + stack traces — OrangePro never writes to or runs anything in the repo. Requires the repo's test framework/deps to already be installed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Total tests to generate (1-5), spread across local scenario buckets. Default 3. | |
| model | No | Model name override. | |
| compare | No | Run BOTH arms — prompt-only baseline vs Local KG, same model + system prompt — and return side-by-side scores (completeness, context awareness, accuracy, domain specificity) plus both test suites. Non-persisting testing view. | |
| base_ref | No | PR-scoped generation: restrict to the behaviors the diff vs this ref touches (e.g. 'main') — for branch/PR review, target only the changed code. Requires a git repo + a real diff; returns structured guidance (status + guidance) instead of fabricating when there is none. Overrides target_ids. | |
| provider | No | BYOK provider override (auto-detected from env if omitted). Use 'deterministic' for an offline stand-in; without any provider configured, generation returns setup guidance instead of degrading. | |
| framework | No | Framework hint, e.g. 'playwright', 'vitest', 'pytest'. | |
| workspace | No | Local workspace root. Defaults to the current directory. | |
| target_ids | No | Behavior/requirement external ids to target. Default: the top-gap behavior. Pass several to split the budget across them (each gets a test when the budget allows, in priority order). | |
| write_files | No | Deferred/premium: repo file writing is disabled in the first slice; always treated as false. | |
| prompt_version | No | Prompt strategy. Defaults to v2; v5 is opt-in until corpus validation clears it as default. |