Repository navigation
Save test evidence (summary, log, screenshots) on features for review - #319
zwanski-start wants to merge 3 commits into
Conversation
Agents can now attach a test summary, raw log and screenshot paths when
calling feature_mark_passing / feature_mark_failing, or record evidence
without a status change via the new feature_record_evidence tool.
Evidence is kept in a new features.test_evidence JSON column (last 10
entries, size-capped) and served by GET /features/{id}/evidence plus a
screenshot endpoint that only serves images referenced by the evidence.
Refs AutoForgeAI#69
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FeatureModal gets a Test Evidence section (newest first) with the agent's summary, collapsible raw log and screenshot thumbnails - FeatureCard shows an Evidence indicator when evidence exists - Coding/testing prompt templates instruct agents to pass test_summary, test_log and screenshots, and testing agents to call feature_record_evidence when a feature still passes - Tests for the MCP tools and API endpoints Closes AutoForgeAI#69 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔍 QA report: ✅ PassedTester: Ada (cubefarm agent, in a fresh session) · Round: 1 · Author: Dennis PR #319 does what issue #69 asks: agents can attach a test summary, raw log and screenshots when they mark a feature passing or failing, or through the new feature_record_evidence tool, and reviewers see it on the card and in the feature modal. The migration from an old features.db works, the screenshot endpoint only serves listed image files inside the project (traversal attempts get 404), and calls without evidence behave as before. ruff, all Python tests, the UI build and lint pass, mypy shows no new errors, and the UI works in the browser at desktop and phone sizes. One small non-blocking issue: an open modal doesn't show evidence recorded after it was opened until it is reopened, which is how the modal already handled feature status before this PR.
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
Summary
Agents can now save test evidence: a summary of how they tested and what they found, an optional raw log, and optional screenshots. The evidence is stored on the feature and shown on its card, so a person can quickly review how each feature was verified.
Backend
features.test_evidenceJSON column, with an auto-migration for existing databases. Each entry has{recorded_at, agent_type, result: pass|fail, summary, log, screenshots[]}. Only the 10 most recent entries are kept. Summaries are capped at 4k chars, logs at 20k chars and screenshots at 10 per entry. The column is deliberately left out ofFeature.to_dict()so it doesn't make agent and orchestrator payloads bigger.feature_mark_passingandfeature_mark_failingtake optionaltest_summary,test_logandscreenshots. The evidence is written in the same transaction as the status change. Calls without evidence behave exactly as before.feature_record_evidence(feature_id, result, test_summary, ...)records evidence without changing the status. Testing agents need this because they are told not to callfeature_mark_passingagain on a feature that is already passing.client.pypassesAGENT_TYPEto the MCP server so each entry records whether a coding or testing agent captured it. The new tool is added to the coding and testing agent allowlists and is explicitly disallowed for the read-only assistant.evidence_count.GET /api/projects/{p}/features/{id}/evidencereturns the full entries. They are fetched only when a feature is opened, so the list poll that runs every 5s stays small.GET /api/projects/{p}/features/{id}/evidence/screenshot?path=serves a screenshot only when that exact path appears in the feature's evidence, the path resolves inside the project directory, and it is an image (png/jpg/gif/webp).UI
Prompts
test_summary(plus a log and screenshots when available) when they mark features. Testing agents callfeature_record_evidencewhen a regression check passes.Verification
test_feature_evidence.py(7 tests) covers the MCP tools (record, cap, truncate, validation, path normalisation) and the API endpoints, including the screenshot path restrictions.test_security.pypasses, andpytest test_client.py test_dependency_resolver.py test_rate_limit_utils.pygives 55 passed.ruff check .is clean, and mypy reports no new errors in the changed files.npm run lintshows 0 errors (the 6 warnings were already there), andnpm run buildsucceeds.HOMEand the Vite dev server, seeded a demo project through the MCP functions, then confirmed the card indicator, the evidence list, the screenshot thumbnail, the missing-file fallback and the log toggle all work.Assumptions / notes
features.dbinstead of a separate table. That keeps the change small and matches howhuman_input_requestis stored..playwright-cli/, so if someone deletes that folder the UI shows "file unavailable".Closes #69
🤖 Generated with Claude Code