Repository navigation
Save test evidence (findings, test log, screenshots) on features - #264
zwanski-start wants to merge 1 commit into
Conversation
Agents can attach a findings summary, a step-by-step test log and screenshots when calling feature_mark_passing / feature_mark_failing, or via the new feature_record_evidence tool (for regression re-checks). Evidence is stored in a new features.test_evidence JSON column (with migration), screenshots are copied into .autoforge/evidence/feature_<id>/, and the feature modal shows a Test Evidence panel with thumbnails served by an index-based, path-validated endpoint. Prompts updated to ask agents to include evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔍 QA report: ✅ PassedTester: Barbara (cubefarm agent, in a fresh session) · Round: 1 · Author: Ken The PR meets issue #69: agents can attach a summary, a test log and screenshots when marking features passing or failing, or through the new feature_record_evidence tool, and the UI shows them on the feature card and in the modal. Backend checks pass: 25 new tests, ruff, security tests, migration of an old-schema DB, and screenshot path validation that rejects traversal, outside paths, symlinks and non-images on both write and serve. The UI build, lint and real-browser checks (desktop and phone) pass. Minor notes: extra screenshot copies are left when mark_passing is rejected, and stale 'Verified passing' evidence stays on a feature later marked failing without new evidence. The e2e suite could not run because the Playwright browser binary is missing on this machine.
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
Adaptations: merged with AutoForgeAI#334 quality gates (evidence is built only after the gates pass, so a rejected call copies nothing), AutoForgeAI#245 manual testing and AutoForgeAI#300 in database.py/feature_mcp.py/client.py/templates; screenshot examples point at .autoforge/validation/ (Phase 3, AutoForgeAI#289). The unsandboxed MCP server no longer copies screenshots through a symlinked .autoforge/evidence path (agent-plantable), and copies that the stored evidence no longer references are deleted after each evidence write (re-tests and rejected calls used to accumulate copies). Tests RED->GREEN. Integrates AutoForgeAI#264 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
Adaptations: merged with AutoForgeAI#245 (manual-testing/in-progress header, ClipboardCheck icon) and AutoForgeAI#264 (TestEvidencePanel) in FeatureModal/FeatureCard. UI-only; no JS unit test framework in the repo, verified in the browser in the Phase 4 pass. Integrates AutoForgeAI#321 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeH26pcsqoxPb3CDs8g1VN
Closes #69
What changed
Agents can now save test evidence on a feature: a summary of findings, a log of how they tested it, and screenshots. It shows up on the feature card so you can review it quickly.
Backend / MCP
features.test_evidenceJSON column, with a migration (_migrate_add_test_evidence_column). Shape:{result, summary, test_log[], screenshots[], recorded_at}.feature_mark_passingandfeature_mark_failingtake optionalsummary,test_logandscreenshotsarguments. Calls without them behave exactly as before, and existing evidence is kept (COALESCE).feature_record_evidencetool for testing agents. A regression check that finds the feature still working shouldn't callmark_passingagain, so this records the re-verification instead. It is in the coding and testing agent tool lists and disallowed for the read-only assistant.api/test_evidence.pyhandles normalization and limits: summary up to 4000 chars, up to 50 log entries, up to 10 screenshots. Screenshots must be image files inside the project directory, and rejected ones come back aswarningsin the tool result. Accepted screenshots are copied into.autoforge/evidence/feature_<id>/so later sessions can't overwrite or clean them up in.playwright-cli/. The folder is gitignored.Feature.to_dict()so it doesn't bloat agent context (feature_get_by_idetc.).FeatureResponse.test_evidenceis added, plusGET /api/projects/{name}/features/{id}/evidence/screenshots/{index}. The endpoint looks screenshots up by index and never takes a path from the client. Before serving, it re-checks that the stored path is an image inside the project (traversal, absolute paths outside the project and non-image files all return 404).Prompts
UI
TestEvidencePanelin the feature modal: a "Verified passing" or "Regression found" badge, the time it was recorded, findings, a numbered test log, and a screenshot thumbnail grid. Clicking a thumbnail opens the full image; if the file is missing, the path is shown instead.How I verified it
python -m pytest test_test_evidence.py: 25 new tests pass. They cover path validation and traversal, evidence building and copying, all three MCP tools (including the already-passing guard leaving evidence untouched), the API response, and the screenshot endpoint (serving plus a tampered path giving 404).ruff check .is clean andpython test_security.pypasses. mypy reports no errors in the files I touched; the existing mypy errors are elsewhere.test_client.py,test_dependency_resolver.py,test_rate_limit_utils.py,test_devserver_security.pyandtest_ws_security.pygive 21 failed / 122 passed, the same count as on untouchedorigin/master, so those failures were already there.npm run lintshows no errors (only the existing warnings) andnpm run buildsucceeds.Assumptions / notes
.autoforge/evidence/and are not cleaned up.AutoForgeAI/autoforge(403 for the available accounts), so this PR comes from the forkzwanski-start/autoforge.🤖 Generated with Claude Code