Multi-agent pipeline for autonomous migration and refactoring of Odoo l10n-brazil modules. All LLM inference is local via Ollama (qwen3-coder). No external APIs.
issue/pr → issue_analyzer → codebase_analyzer
↓
migration_agent (l10n-brazil)
↓
refactor_agent (perf only)
↓
┌── execution_agent (k8s sandbox) ──┐
│ ↓ │
│ debug_agent → fix_agent ───────┘
│ (retry loop, max 9 attempts)
└──────────────────────────────────
↓
test_agent
↓
ci_agent → Forgejo PR
All agents share a single AgentState object, checkpointed to JSON after each step.
- Python 3.11+
- Ollama running locally with
qwen3-coderpulled - minikube running with
l10n-agentsnamespace (or existing k8s cluster) kubectlin PATH and kubeconfig configured
git clone https://git.pop.coop/popsolutions/l10n-brazil-agents
cd l10n-brazil-agents
pip install -r requirements.txt
cp .config/settings.env.example .config/settings.envEdit .config/settings.env with your credentials (never commit this file).
Install the pre-push security hook:
cp scripts/security-check.sh .git/hooks/pre-push
chmod +x .git/hooks/pre-pushollama pull qwen3-coder
ollama serveminikube start --cpus=4 --memory=8g
kubectl apply -f k8s/sandbox.yaml
kubectl get pods -n l10n-agentspython graph.py \
--repo /path/to/l10n_br_account \
--issue "Migrate l10n_br_account from 16.0 to 18.0" \
--from-version 16.0 \
--to-version 18.0python graph.py \
--repo /path/to/l10n_br_account \
--resume /tmp/l10n-agents/ci_agent.jsonpython -m pytest tests/ -v- Migrated files written in-place to
--repo - Migration scripts at
<repo>/migrations/<version>/ - PR opened at
https://git.pop.coop/oca-mirror/<module>/pulls/ - Full pipeline summary printed to stdout
- Checkpoints at
/tmp/l10n-agents/*.json
All credentials in .config/settings.env (gitignored):
| Variable | Description | Default |
|---|---|---|
OLLAMA_URL |
Ollama endpoint | http://localhost:11434 |
LLM_MODEL |
Model name | qwen3-coder |
FORGEJO_URL |
Forgejo instance | https://git.pop.coop |
FORGEJO_TOKEN |
API token | required |
SMTP_HOST |
Mail server | mail.popsolutions.com.br |
SMTP_PORT |
SMTP port | 465 |
SMTP_USER |
SMTP user | ia@pop.coop |
SMTP_PASS |
SMTP password | required |
NOTIFY_EMAILS |
Alert recipients | lpc@pop.coop,m@pop.coop |
K8S_NAMESPACE |
Pod namespace | l10n-agents |
MAX_RETRIES |
Debug loop limit | 9 |
| Agent | Input | Output |
|---|---|---|
issue_analyzer |
Issue text | Technical plan + affected files |
codebase_analyzer |
Repo files | Bottleneck map + dependency graph |
migration_agent |
Files + plan | Migrated code + migration scripts |
refactor_agent |
Codebase map | Performance-optimized code |
execution_agent |
Code + scripts | Logs + errors from k8s pod |
debug_agent |
Errors + logs | Classified error report |
fix_agent |
Error report | Corrected files |
test_agent |
Running pod | Test results + perf metrics |
ci_agent |
Final state | Commit + Forgejo PR |
knowledge/migration_rules.py contains regex-based rules applied before any LLM call.
These handle: api decorator changes, openerp→odoo imports, l10n-brazil field renames,
fiscal pattern updates. Add new patterns here first — cheaper and faster than LLM.
Each agent pod is isolated in the l10n-agents k8s namespace with CPU/memory quotas.
To process multiple modules in parallel, run multiple graph.py instances pointing
to different repos. The checkpoint system prevents work duplication on failure.
For datacenter deployment on Proxmox:
- Run Ollama on the bare-metal node with GPU
- Run the agent pipeline as k8s jobs on the blade cluster
- Use the Proxmox storage backend for checkpoint persistence
- All credentials in
.config/settings.env— never in code - Pre-push hook blocks credential patterns
- Whitelist-based
.gitignore - No code executed outside k8s sandbox pods
- Pods auto-deleted after pipeline completes