feat(api): TaskFlow FastAPI Backend - Phase 2 Complete#4
Merged
Conversation
…w, and auth Complete Phase 2 backend implementation including: Core Features: - Projects CRUD with membership management - Tasks CRUD with recursive subtasks support - Task workflow (status transitions, progress, approve/reject) - Agent workers as first-class citizens alongside humans - Comprehensive audit logging for all state changes Technical Stack: - FastAPI with async SQLModel ORM - PostgreSQL (Neon) with asyncpg - JWT/JWKS authentication via Better Auth SSO - Dev mode bypass for local development Testing & CI: - 41 pytest tests covering all endpoints and workflows - GitHub Actions CI (test, lint, import-check) - SQLite in-memory for test isolation Documentation: - Full API reference with TypeScript types - Auth setup guide (JWT/JWKS flow) - Frontend integration prompt for dashboard team Constitutional Compliance: - Every action auditable (audit_logs table) - Agent parity (same API for humans and AI agents) - Recursive tasks (parent_task_id with unlimited depth) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix E501 line-too-long errors in tasks.py and user_setup.py - Fix E712 avoid equality comparison to True in user_setup.py - Add noqa directive for E402 in conftest.py (intentional import order) - Auto-fixed unused imports and type argument issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR implements Phase 2 of the TaskFlow platform: a complete FastAPI backend with JWT authentication, full CRUD operations for projects/tasks/agents, recursive task support, and comprehensive audit logging. The implementation follows a spec-driven approach with 41 passing tests covering all 27 API endpoints.
Key Changes
- Complete FastAPI backend with async SQLModel ORM and PostgreSQL integration
- JWT/JWKS authentication via Better Auth SSO with 1-hour caching
- Full task workflow management including status transitions, progress tracking, and approve/reject flows
- Recursive task support with parent-child relationships and unlimited nesting depth
Reviewed changes
Copilot reviewed 45 out of 48 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/003-backend-api/spec.md | Complete API specification with user scenarios, requirements, and endpoint definitions |
| specs/003-backend-api/tasks.md | Detailed task breakdown across 6 phases with acceptance criteria (26 tasks total) |
| specs/003-backend-api/plan.md | Implementation plan with architectural decisions and code examples |
| specs/003-backend-api/frontend-integration-prompt.md | Frontend integration guide with TypeScript types and API reference |
| specs/003-backend-api/checklists/requirements.md | Requirements validation checklist with formal verification results |
| packages/api/uv.lock | Python dependency lockfile for reproducible builds |
| packages/api/src/taskflow_api/tests/*.py | Test suite with 41 tests covering all endpoints and workflows |
| packages/api/main.py | Package entry point placeholder |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from ..database import get_session | ||
| from ..models.project import Project, ProjectMember | ||
| from ..models.task import Task | ||
| from ..models.worker import Worker |
There was a problem hiding this comment.
Import of 'Worker' is not used.
Suggested change
| from ..models.worker import Worker |
| from datetime import datetime | ||
| from typing import Literal | ||
|
|
||
| from pydantic import BaseModel, Field, model_validator |
There was a problem hiding this comment.
Import of 'model_validator' is not used.
Auto-formatted 4 files to pass CI format check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete implementation of the TaskFlow FastAPI backend with full CRUD operations, task workflow management, and JWT authentication.
Core Features
Technical Implementation
API Endpoints (27 total)
/health,/health/ready/api/projects/api/projects/{id}/members/api/workers/agents/api/projects/{id}/tasks,/api/tasks/{id}/api/tasks/{id}/audit,/api/projects/{id}/auditTesting
Documentation
Constitutional Compliance
Test Plan
ruff check)Files Changed
packages/api/.github/workflows/api.ymlspecs/003-backend-api/🤖 Generated with Claude Code