CI/CD & Workflows
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
CI/CD and workflows within SweepBot are designed to manage a complex monorepo architecture using Turborepo and pnpm. The system ensures high code quality and rapid delivery by automating testing, linting, and build processes across the backend (Fastify), frontend (React), and browser extension (WXT) modules. These workflows are primarily managed by a dedicated DevOps and Quality Assurance specialist (Agent 4), who oversees the infrastructure, release automation, and testing frameworks.
The primary goal of the workflow system is to support a multi-agent development environment where four distinct agents operate in non-overlapping domains. By utilizing shared configurations and centralized build orchestration, the project maintains consistency in type checking, security scanning, and deployment procedures for various hosting environments like Vercel and Railway.
Sources: AGENT_4_DEVOPS_DOCS.md:1-15, AGENTS.md:54-85, CLAUDE.md:1-10
Build Orchestration & Monorepo Management
SweepBot utilizes Turborepo to orchestrate tasks across the monorepo. The configuration defines task dependencies, allowing for incremental builds and optimized caching.
Task Dependencies and Caching
The system categorizes tasks into build, test, lint, and typecheck. The build task is configured to depend on the builds of its workspace dependencies, ensuring that shared packages like @sweepbot/types and @sweepbot/utils are compiled before the applications that depend on them.
The diagram shows the hierarchical task execution managed by Turborepo.
Sources: turbo.json:1-40, CODEBASE_IMPROVEMENTS.md:144-160, AGENTS.md:54-60
Build Configuration Summary
| Task | Dependencies | Cache Outputs | Description |
|---|---|---|---|
build | ^build | dist/**, .next/** | Builds all packages in dependency order. |
test | build | N/A | Runs Vitest suites across the monorepo. |
lint | N/A | N/A | Executes ESLint 0-warning policy checks. |
typecheck | N/A | N/A | Runs tsc for strict mode verification. |
Sources: turbo.json:3-25, CLAUDE.md:27-45
CI/CD Pipeline Architecture
The CI/CD pipeline, defined in .github/workflows/ci.yml, serves as the automated gatekeeper for the main branch. It implements a multi-stage process that includes automated testing, type checking, and security scanning.
Pipeline Stages
- Validation: Every push triggers linting and type checking across all workspaces to enforce the "0 warnings" policy.
- Automated Testing: The pipeline executes over 54 test suites with a target of >80% code coverage. This includes unit tests via Vitest and E2E tests via Playwright or Cypress.
- Build Verification: Verification of build artifacts for the web dashboard, API, and browser extension (Chrome/Firefox).
- Security Scanning: Automated SAST and dependency auditing to detect vulnerabilities.
This flowchart illustrates the sequential validation steps within the GitHub Actions workflow.
Sources: AGENT_4_DEVOPS_DOCS.md:30-45, CLAUDE.md:25-50, AGENTS.md:175-180
Multi-Agent Coordination Workflows
To prevent conflicts in a multi-agent environment, the project employs a strict Coordination Protocol. This protocol defines absolute file ownership and communication rules for integration.
Domain-Driven Workflows
Each agent has an exclusive domain. Agent 4 (DevOps) is the only agent authorized to modify CI/CD workflows and root configurations. Integration follows a "Shared Package First" rule, where Agent 3 must formalize types and utilities before Agent 1 (Backend) or Agent 2 (Frontend) can consume them in their respective workflows.
Integration Sequence
The sequence diagram shows how shared type definitions precede backend implementation and DevOps validation.
Release & Deployment Management
The release workflow is automated using Changesets for versioning and automated notes generation.
Deployment Targets
- Web Dashboard: Deployed to Vercel via automated hooks.
- API: Hosted on Railway, utilizing health probes (
/health/ready) for zero-downtime deployments. - Extension: Automated builds generate ZIP artifacts for the Chrome Web Store and Firefox Add-ons.
Sources: AGENTS.md:80-85, CLAUDE.md:50-55, AGENT_4_DEVOPS_DOCS.md:120-130
Workflow Automation Commands
| Command | Action | Scope |
|---|---|---|
pnpm dev | Start development server | Monorepo root |
pnpm test:coverage | Generate coverage reports | Monorepo root |
pnpm lint:fix | Auto-fix linting issues | All packages |
pnpm db:migrate | Push schema changes | apps/api |
pnpm build:zip | Generate extension artifacts | apps/extension |
Sources: CLAUDE.md:18-45, AGENTS.md:65-75
Conclusion
The CI/CD and workflow system in SweepBot provides a structured, automated environment that balances the needs of four independent developers. By leveraging Turborepo for efficient builds and GitHub Actions for rigorous quality gates, the project maintains a high standard of reliability. The centralized management of types and documentation by specialized agents ensures that as the system scales toward Phase 2 and beyond, architectural integrity and "Responsible Play" guardrails remain strictly enforced.