Repository navigation
Testing agent: command-line verification strategy for non-web projects - #279
zwanski-start wants to merge 1 commit into
Conversation
…projects Testing agents only knew how to verify features in a browser, which made them weak at finding bugs in CLI tools, scripts and other programs run from bash. The testing prompt now has a command-line strategy: plan success criteria, make results observable, simulate user input, run the program from bash and compare captured output/exit codes. Projects whose app spec declares no web frontend get a testing prompt with the browser instructions removed and the command-line strategy as the only option, including existing projects with older prompts. Closes AutoForgeAI#136 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔍 QA report: ✅ PassedTester: Dennis (cubefarm agent, in a fresh session) · Round: 1 · Author: Dennis The PR adds a command-line verification strategy (B0–B5: plan criteria, make results observable, simulated input, run from bash capturing stdout/stderr/exit code, compare, keep as automated tests) to the testing prompt, covering every step the issue asks for. For projects whose app spec declares no web frontend, it removes the browser instructions; older browser-only project prompts get Strategy B injected. The new tests, ruff and the security tests pass, the other test and mypy failures are the same on master, and probing with real inputs (the shipped spec template and master's old prompt) shows web projects unchanged and CLI projects correctly adapted. Minor non-blocking notes: a frontend description starting with 'Headless…' or 'Terminal…' is misclassified as having no web UI, a few browser phrases remain when an old project prompt is adapted, and a non-UTF-8 spec raises UnicodeDecodeError (the same issue already exists in has_project_prompts).
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
Closes #136
What changed
.claude/templates/testing_prompt.template.md: STEP 2 now asks the testing agent to choose a strategy:tests/fixtures/, stdin viaprintf/heredoc, args, env).test-output/)prompts.py:project_has_web_ui(project_dir)reads the app spec's<frontend>block and ignores HTML comments. It returnsFalsewhen the spec has a<technology_stack>but no frontend, or the frontend is empty/"none"/"CLI…"/"terminal…"/"headless…". It returnsNonewhen there is no spec or no tech stack.get_testing_prompt(): when a project has no web UI, it adds a "PROJECT TYPE: NO WEB UI" header, removes the browser strategy and the Playwright tool reference, and keeps command-line verification as the only strategy. Existing projects with an older browser-onlytesting_prompt.mdget STEP 2 replaced with Strategy B, pulled from the base template so there is a single source of truth.test_testing_prompt.py: 16 pytest tests for detection, web/unknown/CLI prompt output, and the legacy-prompt path.CLAUDE.md: documents the two strategies and the new test file.Verification
python -m pytest test_testing_prompt.py: 16 passedruff check .: clean.mypy prompts.py test_testing_prompt.py: clean.python test_security.py: all passAssumptions / notes
pythonis not on the global allowlist, so Python CLI projects still need it in.autoforge/allowed_commands.yaml. The prompt tells the agent to use allowed alternatives or record the limitation, and not to work around it.🤖 Generated with Claude Code