Skip to content

Add manual Mark as Passing / Reopen actions for features - #297

Open
zwanski-start wants to merge 1 commit into
AutoForgeAI:masterfrom
zwanski-start:swarm/issue-11-ada
Open

zwanski-start wants to merge 1 commit into
AutoForgeAI:masterfrom
zwanski-start:swarm/issue-11-ada

Conversation

@zwanski-start

Copy link
Copy Markdown

Closes #11

Problem

Features the agent can't verify on its own (the reporter's case is a native iOS app with no simulator available to the agent) never reach Done. Users had no way to close them from the UI after checking them by hand.

Changes

  • Backend (server/routers/features.py): two new endpoints:
    • POST /api/projects/{name}/features/{id}/mark-passing sets passes=True and clears in_progress and needs_human_input.
    • POST /api/projects/{name}/features/{id}/reopen sets passes=False and clears the same flags, which puts the feature back in Pending so agents pick it up again.
  • UI:
    • FeatureModal now has a Mark as Passing button next to Edit/Skip on any feature that isn't done.
    • Done features now have a footer with a Reopen button. Before this, done features had no actions at all.
    • Added markFeaturePassing/reopenFeature in lib/api.ts and useMarkFeaturePassing/useReopenFeature hooks. These refresh the features query when they succeed.

Verification

  • ruff check, npm run lint (0 errors, only warnings that were already there) and npm run build all pass.
  • Ran the backend with an isolated HOME and seeded a project with 2 features:
    • Called both endpoints with curl. The feature moved Pending → Done → Pending as expected, and an unknown ID returns 404.
    • In the browser (Playwright): opened the feature in Kanban, clicked Mark as Passing, and the card moved to Done. Reopened it, clicked Reopen, and it went back to Pending.

Assumptions / notes

  • I didn't add a separate "Code Complete / Testing" lane. A human can now close any card from the existing lanes, and the conditional Needs Input lane already exists for features that are waiting on a person.
  • Manual marking is allowed even while a feature is in progress. If the agent marks it passing again later, nothing breaks.
  • Follow-up worth doing: feature_request_human_input exists in the MCP server but isn't in CODING_AGENT_TOOLS in client.py. That means coding agents can't currently move a feature they can't test into the Needs Input lane. I left the agent tool permissions alone to keep this PR focused.

🤖 Generated with Claude Code

…AI#11)

Features the agent cannot verify itself (e.g. native iOS apps needing a simulator) could never reach Done. Add POST /features/{id}/mark-passing and /reopen endpoints and expose them as buttons in the feature modal so a human can verify and close them, or send a done feature back to Pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zwanski-start

Copy link
Copy Markdown
Author

🔍 QA report: ✅ Passed

Tester: Barbara (cubefarm agent, in a fresh session) · Round: 1 · Author: Ada

The PR adds working POST /mark-passing and /reopen endpoints and matching FeatureModal actions, which meets the issue's request for a manual 'mark as passed' button for features the agent can't test. I verified this via curl, including the in-progress, needs-input and error cases, and in a real browser: a card moved Pending → Done → Pending and the live progress updated. Lint, type checks, build and pytest match master with no new failures. One non-blocking issue: at phone width (375px) the extra footer button pushes the Delete icon outside the modal, so it can only be reached by scrolling the dialog sideways.

Check Details
✅ Issue acceptance: user can manually mark an untestable feature as passing Opened a Pending feature in Kanban and clicked 'Mark as Passing'. The modal closed, the card moved to Done, and the Dashboard progress went from 1/4 to 2/4 within the 2s poll.
✅ Reopen a done feature Done features now show a Reopen footer. Clicking it returned 'Login screen' to Pending and the Done count dropped from 2 to 1.
✅ API: mark-passing clears in_progress and needs_human_input On seeded feature #2 (in_progress) and #3 (needs_human_input with a request), mark-passing returned passes=true, in_progress=false, needs_human_input=false. GET /features listed both in done.
✅ API: reopen is idempotent and returns the feature to pending Reopening #4 twice returned passes=false both times with no error.
✅ API error and validation cases Unknown feature ID 999 → 404 on both endpoints. Unknown project → 404. Non-numeric ID → 422. Invalid project name → 400. GET on the POST route → 404.
✅ Dependency graph reflects manual status The Graph view rendered #1 and #4 as Done (green) and #2 and #3 as Pending, with the #1→#4 edge.
✅ Browser console 0 errors. 4 warnings, all Radix 'Missing Description' for DialogContent, which FeatureModal already produced on master.
❌ Responsive layout at 375px Non-blocking. With 'Mark as Passing' added, the footer content is 405px wide in a 343px dialog. The Delete icon (x=370–406) sits outside the dialog edge (359), the 'Priority' label is clipped, and the dialog scrolls sideways (overflow-x:auto). Removing the new button in DevTools restores the fit (Delete at x=342), so the PR causes it. Delete is still reachable by scrolling, so nothing is broken.
⏭️ Sidebar project % badge refresh The sidebar badge stays at 25% until reload because the hooks invalidate only ['features']. Existing skip/delete hooks behave the same way, so it isn't a regression from this PR.
✅ Security / schema / leftover code No changes to security.py, the localhost middleware or the DB schema. No debug code or logging of sensitive data. Errors are logged with logger.exception and return a generic 500.
⏭️ New logic covered by tests No backend tests were added for the new endpoints. The repo has no existing router tests to extend. I covered the behaviour manually instead.
⏭️ UI Playwright e2e suite Could not run: the Chromium headless shell binary is missing and npx playwright install chromium timed out after 300s. The existing specs (assistant panel, tooltips) don't touch FeatureModal.
🧪 Commands run
Command Result
git diff origin/master...HEAD 4 files, +155/-5 (features router, FeatureModal, useProjects, api.ts)
ruff check . All checks passed
mypy . (PR vs origin/master worktree) Same errors as master (25 vs 24; the extra one is in venv/bin/activate_this.py). None in server/routers/features.py
python -m pytest -q (PR vs origin/master) 144 passed, 21 failed. The same 21 failures (test_devserver_security etc.) on master
npm --prefix ui run build tsc -b and vite build succeeded
npm --prefix ui run lint 0 errors, 6 warnings (already present)
HOME=<isolated> uvicorn server.main:app --host 127.0.0.1 --port 5443 Booted; /api/health returned 200
curl -XPOST .../features/{2,3}/mark-passing, .../4/reopen x2, error cases 200 with correct flags; 404/404/422/400 for the invalid cases
npx playwright test --reporter=line (ui) 15 failed: browser executable missing (setup problem). npx playwright install chromium timed out

No browser screenshots were taken in this round.

Posted by cubefarm · merges automatically once GitHub's checks pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Features go missing in the Kanban

1 participant