Skip to content

popsolutions/l10n-brazil-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

l10n-brazil-agents

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.

Architecture

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.

Requirements

  • Python 3.11+
  • Ollama running locally with qwen3-coder pulled
  • minikube running with l10n-agents namespace (or existing k8s cluster)
  • kubectl in PATH and kubeconfig configured

Setup

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.env

Edit .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-push

Ollama setup

ollama pull qwen3-coder
ollama serve

K8s sandbox setup

minikube start --cpus=4 --memory=8g
kubectl apply -f k8s/sandbox.yaml
kubectl get pods -n l10n-agents

Usage

Single module migration

python 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.0

Resume from checkpoint

python graph.py \
  --repo /path/to/l10n_br_account \
  --resume /tmp/l10n-agents/ci_agent.json

Run unit tests (no k8s, no LLM needed)

python -m pytest tests/ -v

Output

  • 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

Environment variables

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 responsibilities

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

Deterministic rules

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.

Scaling

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

Security

  • 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

About

Um projeto pra quem é muito burro e não sabe programar ou simplemente está cansado de ficar diante de um teclado

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors