|
| 1 | +# DevFlow |
| 2 | + |
| 3 | +DevFlow is an auditable multi-agent system for resolving software issues from |
| 4 | +intake to a reviewed pull request. It is built for the **Agent Infra** track of |
| 5 | +the Global Open-source AI Challenge and maps its domain agents onto the |
| 6 | +[AgentTeams](https://github.com/agentscope-ai/AgentTeams) Manager–Team–Worker |
| 7 | +runtime. |
| 8 | + |
| 9 | +The project is intentionally a controlled workflow rather than an unrestricted |
| 10 | +agent swarm: |
| 11 | + |
| 12 | +```text |
| 13 | +Issue → Triage → Locate → Code → Test → Review → Approval / PR |
| 14 | + ↑ │ │ |
| 15 | + └────────┴───────┘ feedback loop |
| 16 | +``` |
| 17 | + |
| 18 | +Every stage has a structured input/output contract, explicit failure behavior, |
| 19 | +security boundaries, and an event trail. T4/T5 changes stop for recorded human |
| 20 | +approval. |
| 21 | + |
| 22 | +## What works now |
| 23 | + |
| 24 | +- Six domain agents: Team Leader, Triage, Locator, Coder, Tester, Reviewer. |
| 25 | +- Typed event bus and lifecycle events for local execution. |
| 26 | +- AST-aware code indexing and an experience store backed by ChromaDB. |
| 27 | +- OpenAI-compatible LLM client with Pydantic response validation. |
| 28 | +- MCP boundaries for GitHub and isolated CI/CD tools. |
| 29 | +- Structured logs, OpenTelemetry spans, and in-memory metrics. |
| 30 | +- Credential-free offline demo that applies a real candidate patch in a |
| 31 | + temporary repository, executes a real regression test, reviews the result, |
| 32 | + and writes a JSON evidence report. |
| 33 | +- AgentTeams `Team` manifest and six self-contained Skill v2 packages with |
| 34 | + typed contracts, deterministic validators, UI metadata, examples, and |
| 35 | + release/rollback policy. |
| 36 | +- Integrity-checked `HandoffEnvelope` collaboration with versioned artifacts, |
| 37 | + idempotency keys, and SHA-256. |
| 38 | + |
| 39 | +## Quick start |
| 40 | + |
| 41 | +Python 3.10–3.12 is recommended. |
| 42 | + |
| 43 | +```powershell |
| 44 | +py -3.10 -m venv .venv |
| 45 | +.\.venv\Scripts\python -m pip install -e ".[dev]" |
| 46 | +.\.venv\Scripts\devflow validate |
| 47 | +.\.venv\Scripts\devflow demo |
| 48 | +.\.venv\Scripts\python -m pytest |
| 49 | +``` |
| 50 | + |
| 51 | +The demo does not need an API key or GitHub token. It: |
| 52 | + |
| 53 | +1. classifies the bundled calculator issue; |
| 54 | +2. retrieves and identifies the faulty function; |
| 55 | +3. produces a structured one-line patch; |
| 56 | +4. copies the fixture repository to a temporary sandbox; |
| 57 | +5. proves that the baseline fails and the candidate passes; |
| 58 | +6. performs the review/approval gate; |
| 59 | +7. distills and stores a provenance-linked reusable experience; |
| 60 | +8. stores the full event and result evidence under `.devflow/runs/`. |
| 61 | + |
| 62 | +Production mode uses variables from `.env.example`. Copy it to `.env` and |
| 63 | +provide only the credentials required by the integrations you enable. |
| 64 | +Install the persistent ChromaDB-backed RAG implementation with |
| 65 | +`python -m pip install -e ".[rag]"`; the credential-free demo does not require |
| 66 | +that heavier optional dependency. |
| 67 | + |
| 68 | +## AgentTeams deployment |
| 69 | + |
| 70 | +DevFlow targets AgentTeams `agentteams.io/v1beta1`. |
| 71 | + |
| 72 | +```powershell |
| 73 | +.\.venv\Scripts\python scripts\build_agentteams_package.py |
| 74 | +``` |
| 75 | + |
| 76 | +Copy `dist/devflow-worker.zip` into the AgentTeams Manager/controller at |
| 77 | +`/tmp/devflow-worker.zip`, then apply: |
| 78 | + |
| 79 | +```bash |
| 80 | +agentteams-apply.sh -f agentteams/team.yaml |
| 81 | +``` |
| 82 | + |
| 83 | +The manifest creates one Team Leader and five workers. AgentTeams supplies the |
| 84 | +Matrix room topology, task delegation, heartbeat/state reconciliation, shared |
| 85 | +storage, and credential isolation. DevFlow supplies the software-engineering |
| 86 | +roles, reusable Skills, schemas, gates, and evidence. |
| 87 | + |
| 88 | +## Project layout |
| 89 | + |
| 90 | +```text |
| 91 | +agentteams/ AgentTeams v1beta1 Team manifest and package template |
| 92 | +config/ agent, skill, security, MCP, observability configuration |
| 93 | +docs/ research notes and competition scorecard |
| 94 | +examples/ deterministic regression scenario |
| 95 | +skills/ distributable SKILL.md specifications |
| 96 | +src/devflow/ runtime, agents, models, RAG, CLI |
| 97 | +tests/ unit and end-to-end tests |
| 98 | +``` |
| 99 | + |
| 100 | +## Verification |
| 101 | + |
| 102 | +```powershell |
| 103 | +.\.venv\Scripts\python -m ruff check src tests examples |
| 104 | +.\.venv\Scripts\python -m mypy src |
| 105 | +.\.venv\Scripts\python -m pytest --cov=devflow --cov-report=term-missing |
| 106 | +.\.venv\Scripts\python scripts\evaluate_skills.py |
| 107 | +.\.venv\Scripts\devflow demo |
| 108 | +``` |
| 109 | + |
| 110 | +See [the research basis](docs/RESEARCH.md), [competition scorecard](docs/SCORECARD.md), |
| 111 | +[Skill engineering standard](docs/SKILL_ENGINEERING.md), and |
| 112 | +[AgentTeams mapping](docs/AGENTTEAMS.md) for design rationale and remaining work. |
| 113 | + |
| 114 | +## Security |
| 115 | + |
| 116 | +- Workers receive gateway-scoped consumer credentials, not raw provider keys. |
| 117 | +- Generated paths must remain repository-relative. |
| 118 | +- Secret-shaped output and dangerous execution patterns are blocked. |
| 119 | +- Test execution occurs in a temporary copy in the offline demo. |
| 120 | +- CI failure and high/critical findings block promotion. |
| 121 | +- T4/T5 issues always require a human approval event. |
| 122 | + |
| 123 | +Never commit `.env`, runtime evidence containing private code, or real tokens. |
| 124 | + |
| 125 | +## License |
| 126 | + |
| 127 | +Apache-2.0. See [LICENSE](LICENSE). |
0 commit comments