docs: Add English documentation (no ACI references)

- technical-en.md: Technical architecture and implementation
- executive-en.md: Business proposal and ROI analysis
- portal-en.md: Admin portal wireframes and features

All documentation is product-agnostic, ready for any client.
This commit is contained in:
Ricel Leite 2026-02-18 14:34:52 -03:00
parent 0a825a51e8
commit e00c9db939
6 changed files with 323 additions and 2017 deletions

View File

@ -1,346 +0,0 @@
# ACI JIRA AI Fixer
## Proposta Executiva
**Data:** 18 de Fevereiro de 2026
**Versão:** 1.1
**Atualização:** Azure OpenAI obrigatório para compliance
**Classificação:** Interno - Diretoria
---
## Sumário Executivo
### O Problema
A equipe de suporte enfrenta desafios crescentes na resolução de Support Cases:
| Desafio | Impacto |
|---------|---------|
| **Tempo de resposta** | Análise inicial consome horas de desenvolvedor sênior |
| **Backlog crescente** | Issues acumulam enquanto equipe foca em demandas urgentes |
| **Qualidade variável** | Dependência de conhecimento individual sobre o código |
| **Conhecimento concentrado** | Poucos especialistas conhecem todos os módulos |
### A Solução
Um sistema de **Inteligência Artificial** que:
1. **Monitora** automaticamente novos Support Cases no JIRA
2. **Analisa** o problema e identifica o código-fonte afetado
3. **Propõe** correções específicas em COBOL, SQL e JCL
4. **Documenta** a análise diretamente no JIRA
5. **Cria** branches com correções para revisão humana
### Resultado Esperado
```
┌─────────────────────────────────────────────────────────────┐
│ ANTES vs DEPOIS │
├─────────────────────────────────────────────────────────────┤
│ │
│ ANTES DEPOIS │
│ ────── ────── │
│ Issue criada Issue criada │
│ ↓ ↓ │
│ Dev analisa (2-4h) IA analisa (5min) │
│ ↓ ↓ │
│ Busca código (1-2h) Código identificado │
│ ↓ ↓ │
│ Investiga causa (2-4h) Causa + fix sugerido │
│ ↓ ↓ │
│ Desenvolve fix (2-4h) Dev revisa e aprova │
│ ↓ ↓ │
│ Review + deploy Review + deploy │
│ │
│ TOTAL: 8-14 horas TOTAL: 2-4 horas │
│ │
│ ✅ Redução de 60-70% no tempo de resolução │
│ │
└─────────────────────────────────────────────────────────────┘
```
---
## Por Que Agora?
### 1. Tecnologia Madura
Os modelos de linguagem (GPT-4, Claude) atingiram nível de qualidade suficiente para análise e geração de código, incluindo linguagens legadas como COBOL.
### 2. Vantagem Competitiva
Empresas líderes estão adotando IA para acelerar desenvolvimento. Quem não adotar ficará para trás em produtividade.
### 3. Volume Gerenciável
Com 5-10 issues/mês, o risco é baixo e o ambiente é ideal para validar a solução antes de escalar.
### 4. Custo Acessível
O custo operacional é mínimo (~R$2.500/mês) devido ao baixo volume.
---
## Como Funciona
### Fluxo Simplificado
```
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Support │ │ IA │ │ Dev │
│ Case │────▶│ Analisa │────▶│ Revisa │
│ (JIRA) │ │ + Sugere │ │ + Aprova │
└──────────────┘ └──────────────┘ └──────────────┘
5min 5min 30min-2h
┌─────────────────────┐
│ Comentário JIRA: │
│ - Causa raiz │
│ - Arquivos afetados│
│ - Correção proposta│
│ - Link para PR │
└─────────────────────┘
```
### Exemplo Real
**Issue:** "Transação sendo declinada com código 51 mesmo com saldo disponível"
**Resposta da IA (em 5 minutos):**
```
📋 ANÁLISE AUTOMÁTICA
🔍 Causa Identificada:
O programa ACQAUTH.CBL está comparando o campo WS-AVAILABLE-BALANCE
com formato PIC 9(9)V99, mas o valor retornado do HOST usa
PIC 9(11)V99, causando truncamento.
📁 Arquivo Afetado:
- src/cobol/ACQAUTH.CBL (linhas 1234-1256)
💡 Correção Proposta:
Alterar declaração de WS-AVAILABLE-BALANCE para PIC 9(11)V99
e ajustar a comparação na SECTION 3000-VALIDATE.
📊 Confiança: 87%
🔗 PR com correção: bitbucket.tsacorp.com/projects/ACQ/repos/...
```
### Segurança: IA Não Altera Código de Produção
```
┌─────────────────────────────────────────────────────────────┐
│ SEPARAÇÃO DE RESPONSABILIDADES │
├─────────────────────────────────────────────────────────────┤
│ │
│ Repositório CLIENTE (produção) │
│ ACQ-MF-safra-fork │
│ ├── IA tem acesso: SOMENTE LEITURA │
│ └── Alterações: APENAS por desenvolvedores │
│ │
│ Repositório IA (isolado) │
│ ACQ-MF-safra-ai │
│ ├── IA tem acesso: LEITURA E ESCRITA │
│ └── Propósito: Branches com sugestões de correção │
│ │
│ Fluxo de Aprovação: │
│ 1. IA cria branch no repositório isolado │
│ 2. IA abre Pull Request para repositório cliente │
│ 3. Desenvolvedor HUMANO revisa │
│ 4. Desenvolvedor HUMANO aprova ou rejeita │
│ 5. Só então o código vai para produção │
│ │
│ ✅ 100% das alterações passam por revisão humana │
│ │
└─────────────────────────────────────────────────────────────┘
```
---
## Investimento
### Desenvolvimento (MVP)
| Item | Investimento |
|------|--------------|
| Desenvolvimento (4.5 meses) | R$ 350.000 - R$ 450.000 |
| Infraestrutura inicial | R$ 15.000 |
| **Total MVP** | **R$ 365.000 - R$ 465.000** |
*Estimativa considera equipe dedicada de 4-5 profissionais.*
### Custo Operacional Mensal
| Item | Custo/Mês |
|------|-----------|
| APIs de Inteligência Artificial | R$ 150 |
| Infraestrutura (servidores) | R$ 1.000 - R$ 2.500 |
| Manutenção (10% equipe) | R$ 3.500 |
| **Total Operacional** | **~R$ 5.000/mês** |
*Custo baixo devido ao volume de 5-10 issues/mês.*
---
## Retorno do Investimento (ROI)
### Economia de Tempo
| Métrica | Valor |
|---------|-------|
| Issues por mês | 5-10 |
| Tempo médio atual por issue | 8-14 horas |
| Tempo médio com IA | 2-4 horas |
| **Economia por issue** | **6-10 horas** |
| **Economia mensal** | **30-100 horas de dev sênior** |
### Cálculo Financeiro
```
Custo hora desenvolvedor sênior: ~R$ 200
Economia mensal: 50 horas (média)
Valor economizado: R$ 10.000/mês
Investimento MVP: R$ 400.000 (média)
Custo operacional: R$ 5.000/mês
Payback: ~40-48 meses
Porém, considerando:
- Escala para mais clientes/produtos
- Redução de bugs em produção
- Liberação de devs para inovação
- Retenção de conhecimento
ROI real: Difícil quantificar, mas ALTAMENTE POSITIVO
```
### Benefícios Intangíveis
| Benefício | Impacto |
|-----------|---------|
| **Padronização** | Todas as issues analisadas com mesmo rigor |
| **Documentação** | Histórico completo de análises no JIRA |
| **Conhecimento** | IA aprende padrões, independe de pessoas |
| **Velocidade** | Resposta inicial em minutos, não horas |
| **Moral da equipe** | Devs focam em problemas complexos, não repetitivos |
---
## Riscos e Mitigações
| Risco | Probabilidade | Mitigação |
|-------|---------------|-----------|
| **IA sugere fix incorreto** | Média | Revisão humana obrigatória em 100% dos casos |
| **Resistência da equipe** | Baixa | Posicionar como assistente, não substituto |
| **Segurança do código** | ✅ Eliminado | Azure OpenAI - dados ficam no tenant Azure, não são usados para treino |
| **Custo de LLM aumenta** | Baixa | Contrato Enterprise Azure com preços fixos |
### Compliance e Segurança
A solução utiliza **exclusivamente Azure OpenAI**, garantindo:
- ✅ Dados de código não são enviados para APIs públicas
- ✅ Dados não são usados para treinar modelos Microsoft
- ✅ Processamento na região Brazil South (baixa latência)
- ✅ Compatível com políticas corporativas ACI
- ✅ Utiliza contrato Enterprise Agreement existente
**Nota:** O GitHub Copilot existente continuará sendo usado pelos desenvolvedores no IDE. São ferramentas complementares - Copilot para autocompletar código, AI Fixer para automatizar análise de issues.
### Abordagem Conservadora
O sistema será implementado em fases:
```
Fase 1 (MVP): Apenas análise e sugestão
IA comenta no JIRA, não cria código
Fase 2: Geração de código em repositório isolado
Humano decide se usa ou não
Fase 3: Pull Requests automáticos
Humano ainda aprova
Fase 4: Auto-merge (apenas para fixes de alta confiança)
Somente após meses de validação
```
---
## Timeline
```
┌─────────────────────────────────────────────────────────────┐
│ ROADMAP MVP │
├─────────────────────────────────────────────────────────────┤
│ │
│ Mês 1-2 Mês 2-3 Mês 3-4 Mês 4-5 │
│ ─────── ─────── ─────── ─────── │
│ Setup + Indexação Geração de Testes + │
│ Integrações de Código Correções Refinamento │
│ │
│ ✓ JIRA ✓ COBOL ✓ LLM ✓ Piloto │
│ ✓ Bitbucket ✓ SQL ✓ Validação ✓ Ajustes │
│ ✓ Infra ✓ JCL ✓ Output ✓ Docs │
│ │
│ │ │
│ ▼ │
│ GO-LIVE │
│ ~4.5 meses │
│ │
└─────────────────────────────────────────────────────────────┘
```
---
## Diferenciais da Solução
### Por que não usar ferramentas prontas (GitHub Copilot, etc)?
| Aspecto | Ferramentas Genéricas | Nossa Solução |
|---------|----------------------|---------------|
| **Integração JIRA** | ❌ Manual | ✅ Automática |
| **Conhecimento do sistema ACI** | ❌ Genérico | ✅ Treinado com regras ACI |
| **COBOL expertise** | ⚠️ Limitado | ✅ Otimizado para mainframe |
| **Fluxo Support Case** | ❌ Não existe | ✅ Nativo |
| **Segurança (on-premise)** | ❌ Cloud only | ✅ 100% interno |
| **Customização** | ❌ Genérico | ✅ Regras configuráveis |
---
## Recomendação
### Decisão Solicitada
Aprovar o desenvolvimento do **MVP do ACI JIRA AI Fixer** com:
- **Investimento:** R$ 400.000 - R$ 465.000
- **Timeline:** 4.5 meses
- **Escopo:** Produtos ACQ-MF e ICG-MF
- **Objetivo:** Reduzir tempo de análise de Support Cases em 60%+
### Próximos Passos (após aprovação)
1. **Semana 1:** Definir equipe e iniciar setup de infraestrutura
2. **Semana 2:** Criar repositórios AI e configurar integrações
3. **Mês 1:** Primeira demonstração com issue real
4. **Mês 3:** MVP funcional para piloto
5. **Mês 5:** Go-live em produção
---
## Conclusão
O **ACI JIRA AI Fixer** representa uma oportunidade de:
**Aumentar produtividade** da equipe de suporte em 60%+
**Reduzir tempo de resposta** de horas para minutos
**Padronizar qualidade** das análises
**Reter conhecimento** independente de pessoas
**Posicionar a ACI** na vanguarda de automação com IA
O momento é ideal: tecnologia madura, volume controlado para piloto, e demanda urgente da equipe.
---
**Documento preparado para apresentação à Diretoria.**
*Em caso de dúvidas, a equipe técnica está disponível para demonstração.*

View File

@ -1,558 +0,0 @@
# ACI JIRA AI Fixer - Portal Administrativo
**Versão:** 1.0
**Data:** 2026-02-18
**Classificação:** Interno - Visão de Produto
---
## 1. Visão Geral
O Portal Administrativo do ACI JIRA AI Fixer é uma interface web moderna e intuitiva que permite gerenciar todas as configurações do sistema sem necessidade de alterar código ou arquivos de configuração manualmente.
### 1.1 Objetivos
- **Zero código** para configuração
- **Interface intuitiva** para empresas de médio/grande porte
- **Multi-tenant** para suportar múltiplas equipes
- **Auditoria completa** de todas as ações
- **SSO integrado** com provedores corporativos
---
## 2. Telas do Portal
### 2.1 Dashboard Principal
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🤖 JIRA AI Fixer admin@aci.com ⚙️ 🔔 │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │Dashboard│ │ Issues │ │ Código │ │ Config │ │ Logs │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 📊 DASHBOARD │ │
│ │ │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ 12 │ │ 78% │ │ 2.3min │ │ │
│ │ │ Issues/mês │ │ Taxa Acerto │ │ Tempo Médio │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │
│ │ │ │
│ │ 📈 Últimos 30 dias │ │
│ │ ████████████████████░░░░░░ 78% fixes aceitos │ │
│ │ │ │
│ │ ┌─ Atividade Recente ─────────────────────────────────────────┐ │ │
│ │ │ ✅ SUPPORT-4521 - Fix aceito há 2 horas │ │ │
│ │ │ ⏳ SUPPORT-4519 - Aguardando review há 5 horas │ │ │
│ │ │ ❌ SUPPORT-4515 - Fix rejeitado há 1 dia │ │ │
│ │ └─────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
**Métricas exibidas:**
- Issues processadas (dia/semana/mês)
- Taxa de acerto (fixes aceitos vs rejeitados)
- Tempo médio de análise
- Gráfico de tendência
- Atividade recente
---
### 2.2 Configurações - Integrações
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ ⚙️ CONFIGURAÇÕES > Integrações │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─ JIRA ────────────────────────────────────────────────────────────────┐ │
│ │ ✅ Conectado │ │
│ │ │ │
│ │ URL do Servidor │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ https://gojira.tsacorp.com │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ API Token │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ •••••••••••••••••••••••••••••••• 👁️ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Webhook URL (copie e configure no JIRA) │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ https://ai-fixer.aci.com/api/webhook/jira 📋 │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Projetos Monitorados │ │
│ │ ☑️ ACQ - Acquirer ☑️ ICG - Interchange ☐ CORE - Core System │ │
│ │ │ │
│ │ [ 🔄 Testar Conexão ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Bitbucket ───────────────────────────────────────────────────────────┐ │
│ │ ✅ Conectado │ │
│ │ │ │
│ │ URL do Servidor │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ https://bitbucket.tsacorp.com │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Access Token │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ •••••••••••••••••••••••••••••••• 👁️ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [ 🔄 Testar Conexão ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ LLM Provider ────────────────────────────────────────────────────────┐ │
│ │ ✅ Azure OpenAI │ │
│ │ │ │
│ │ Provedor │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Azure OpenAI ▼ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ Opções: Azure OpenAI | OpenAI | OpenRouter (Free) | Self-hosted │ │
│ │ │ │
│ │ Endpoint │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ https://aci-openai.openai.azure.com │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ API Key │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ •••••••••••••••••••••••••••••••• 👁️ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Modelo │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ gpt-4o ▼ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [ 🔄 Testar Conexão ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Embeddings ──────────────────────────────────────────────────────────┐ │
│ │ ✅ Self-hosted │ │
│ │ │ │
│ │ Provedor │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Self-hosted (MiniLM-L6) ▼ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ Opções: Self-hosted | Azure OpenAI | OpenAI │ │
│ │ │ │
│ │ Para produção, recomendamos Azure OpenAI para compliance. │ │
│ │ │ │
│ │ [ 🔄 Testar Conexão ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ [ 💾 Salvar Tudo ] │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
### 2.3 Gerenciamento de Repositórios
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 📁 REPOSITÓRIOS [ + Adicionar ] │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ 📦 ACQ-MF-safra-fork [ ⚙️ ] [ 🗑️ ]│ │
│ │ │ │
│ │ URL: bitbucket.tsacorp.com/projects/ACQ/repos/ACQ-MF-safra-fork │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Status │ ✅ Indexado │ │ │
│ │ │ Arquivos │ 2.847 arquivos indexados │ │ │
│ │ │ Última Sync │ 18/02/2026 11:30 │ │ │
│ │ │ Fork AI │ ACQ-MF-safra-ai ✅ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Linguagens detectadas: │ │
│ │ ████████████████████░░░░░░░░░░ COBOL 68% │ │
│ │ ██████░░░░░░░░░░░░░░░░░░░░░░░░ SQL 22% │ │
│ │ ███░░░░░░░░░░░░░░░░░░░░░░░░░░░ JCL 10% │ │
│ │ │ │
│ │ [ 🔄 Re-indexar Agora ] [ 📊 Ver Detalhes ] [ ⏰ Agendar Sync ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ 📦 ICG-MF-safra-fork [ ⚙️ ] [ 🗑️ ]│ │
│ │ │ │
│ │ URL: bitbucket.tsacorp.com/projects/ICG/repos/ICG-MF-safra-fork │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Status │ ✅ Indexado │ │ │
│ │ │ Arquivos │ 1.923 arquivos indexados │ │ │
│ │ │ Última Sync │ 18/02/2026 11:30 │ │ │
│ │ │ Fork AI │ ICG-MF-safra-ai ✅ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [ 🔄 Re-indexar Agora ] [ 📊 Ver Detalhes ] [ ⏰ Agendar Sync ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
### 2.4 Editor de Regras de Negócio
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🧠 REGRAS DE NEGÓCIO [ + Novo Módulo ] │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Módulos configurados: │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │Autoriz. │ │Clearing │ │HostComm │ │ Batch │ │
│ │ ● │ │ │ │ │ │ │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │
│ ═══════════════════════════════════════════════════════════════════════ │
│ │
│ 📌 Módulo: Autorização │
│ │
│ ┌─ Descrição ───────────────────────────────────────────────────────────┐ │
│ │ Módulo de autorização de transações de cartão. Responsável pela │ │
│ │ validação, comunicação com HOST e geração de resposta. │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Programas Relacionados ──────────────────────────────────────────────┐ │
│ │ │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ ACQAUTH* ✕ │ │ ACQVALD* ✕ │ │ ACQHOST* ✕ │ [ + Adicionar ]│ │
│ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Keywords de Detecção ────────────────────────────────────────────────┐ │
│ │ │ │
│ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │
│ │ │autorização✕│ │ decline ✕ │ │código 51 ✕ │ │ timeout ✕ │ [+Add] │ │
│ │ └────────────┘ └────────────┘ └────────────┘ └────────────┘ │ │
│ │ │ │
│ │ Quando uma issue contém essas palavras, o sistema associa │ │
│ │ automaticamente ao módulo de Autorização. │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Regras de Contexto (instruções para a IA) ───────────────────────────┐ │
│ │ │ │
│ │ 📋 Regra 1 [ ✏️ ] [ 🗑️ ]│ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Transações acima de R$ 10.000 requerem validação adicional no │ │ │
│ │ │ programa ACQVALD através da SECTION 5000-VALIDATE-HIGH-VALUE │ │ │
│ │ │ antes de enviar ao HOST. │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ 📋 Regra 2 [ ✏️ ] [ 🗑️ ]│ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Códigos de resposta seguem padrão ISO 8583: │ │ │
│ │ │ - 00: Aprovada │ │ │
│ │ │ - 51: Saldo insuficiente (verificar WS-AVAILABLE-BALANCE) │ │ │
│ │ │ - 14: Cartão inválido │ │ │
│ │ │ - 91: Emissor indisponível │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ 📋 Regra 3 [ ✏️ ] [ 🗑️ ]│ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ O campo WS-AVAILABLE-BALANCE deve ter PIC 9(11)V99 para │ │ │
│ │ │ compatibilidade com o retorno do HOST. Verificar se não há │ │ │
│ │ │ truncamento em comparações. │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [ + Adicionar Nova Regra ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Restrições (arquivos que a IA NÃO pode alterar) ─────────────────────┐ │
│ │ │ │
│ │ ┌────────────────┐ ┌────────────────┐ │ │
│ │ │ /interfaces/* ✕│ │ /copybooks/HOST* ✕│ [ + Adicionar ]│ │
│ │ └────────────────┘ └────────────────┘ │ │
│ │ │ │
│ │ ⚠️ Arquivos nestas pastas serão apenas analisados, nunca alterados. │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ [ Cancelar ] [ 💾 Salvar Módulo ] │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
### 2.5 Visualização de Issues
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 📋 ISSUES ANALISADAS │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ 🔍 Buscar... Status: [ Todos ▼ ] [ 📅 Período ] │
│ │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ ┌─ SUPPORT-4521 ──────────────────────────────────────────────────┐ │ │
│ │ │ │ │ │
│ │ │ Transação declinada código 51 com saldo disponível │ │ │
│ │ │ │ │ │
│ │ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │ │
│ │ │ │ ✅ Aceito │ │ 🎯 87% │ │ ⏱️ 2m 34s │ │ 📁 1 arquivo│ │ │ │
│ │ │ └────────────┘ └────────────┘ └────────────┘ └────────────┘ │ │ │
│ │ │ │ │ │
│ │ │ Módulo: Autorização Criado: 18/02/2026 09:15 │ │ │
│ │ │ │ │ │
│ │ │ [ 👁️ Ver Análise Completa ] [ 📝 Ver PR ] [ 🔗 Abrir JIRA ] │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ ┌─ SUPPORT-4519 ──────────────────────────────────────────────────┐ │ │
│ │ │ │ │ │
│ │ │ Erro de formatação no arquivo de clearing │ │ │
│ │ │ │ │ │
│ │ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │ │
│ │ │ │ ⏳ Review │ │ 🎯 72% │ │ ⏱️ 3m 12s │ │ 📁 2 arquivos│ │ │ │
│ │ │ └────────────┘ └────────────┘ └────────────┘ └────────────┘ │ │ │
│ │ │ │ │ │
│ │ │ Módulo: Clearing Criado: 18/02/2026 06:45 │ │ │
│ │ │ │ │ │
│ │ │ [ 👁️ Ver Análise Completa ] [ 📝 Ver PR ] [ 🔗 Abrir JIRA ] │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ ┌─ SUPPORT-4515 ──────────────────────────────────────────────────┐ │ │
│ │ │ │ │ │
│ │ │ JCL falhando com código de retorno 12 │ │ │
│ │ │ │ │ │
│ │ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │ │
│ │ │ │ ❌ Rejeitado│ │ 🎯 45% │ │ ⏱️ 4m 01s │ │ 📁 1 arquivo│ │ │ │
│ │ │ └────────────┘ └────────────┘ └────────────┘ └────────────┘ │ │ │
│ │ │ │ │ │
│ │ │ Motivo: "Análise incorreta do dataset PROD.CLEARING.INPUT" │ │ │
│ │ │ │ │ │
│ │ │ [ 👁️ Ver Análise ] [ 🔄 Re-analisar ] [ 🔗 Abrir JIRA ] │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ Mostrando 1-10 de 47 issues [ ← Anterior ] [ Próximo → ] │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
### 2.6 Detalhes da Análise
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 👁️ ANÁLISE: SUPPORT-4521 [ ← Voltar]│
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─ Informações da Issue ────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Título: Transação declinada código 51 com saldo disponível │ │
│ │ Status: ✅ Fix Aceito │ │
│ │ Confiança: 87% │ │
│ │ Tempo de análise: 2 minutos 34 segundos │ │
│ │ Analisado em: 18/02/2026 09:17:34 │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Descrição Original ──────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Cliente Safra reporta que transações estão sendo declinadas com │ │
│ │ código 51 (saldo insuficiente) mesmo quando o cliente possui saldo │ │
│ │ disponível. Ocorre em transações acima de R$ 100.000,00. │ │
│ │ │ │
│ │ Stack trace: │ │
│ │ ACQAUTH - SECTION 3000-VALIDATE - EVALUATE WS-RESPONSE-CODE │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Análise da IA ───────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 🔍 CAUSA RAIZ IDENTIFICADA │ │
│ │ │ │
│ │ O programa ACQAUTH.CBL está comparando o campo WS-AVAILABLE-BALANCE │ │
│ │ com formato PIC 9(9)V99 (máximo 9.999.999,99), mas o valor │ │
│ │ retornado do HOST usa PIC 9(11)V99 (máximo 999.999.999,99). │ │
│ │ │ │
│ │ Isso causa truncamento em valores acima de R$ 100.000,00, │ │
│ │ fazendo com que o saldo apareça como insuficiente. │ │
│ │ │ │
│ │ 📁 ARQUIVOS AFETADOS │ │
│ │ • src/cobol/ACQAUTH.CBL (linhas 1234-1256) │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Correção Proposta ───────────────────────────────────────────────────┐ │
│ │ │ │
│ │ ```cobol │ │
│ │ * ANTES (linha 1234) │ │
│ │ 05 WS-AVAILABLE-BALANCE PIC 9(9)V99. │ │
│ │ │ │
│ │ * DEPOIS │ │
│ │ 05 WS-AVAILABLE-BALANCE PIC 9(11)V99. │ │
│ │ ``` │ │
│ │ │ │
│ │ Também ajustar a SECTION 3000-VALIDATE para usar o novo tamanho. │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Links ───────────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 🔗 Issue no JIRA: gojira.tsacorp.com/browse/SUPPORT-4521 │ │
│ │ 📝 Pull Request: bitbucket.tsacorp.com/.../pull-requests/142 │ │
│ │ 💬 Comentário IA: Ver no JIRA │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ [ 🔄 Re-analisar ] [ 📥 Exportar PDF ] │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
## 3. Stack Tecnológico do Portal
### 3.1 Frontend
```yaml
Framework: React 18 + TypeScript
Estilização: Tailwind CSS + shadcn/ui
Componentes:
- Tabelas com ordenação e filtros
- Formulários com validação
- Gráficos (Recharts)
- Editor de código (Monaco Editor)
- Notificações toast
State Management: React Query + Zustand
Roteamento: React Router v6
Build: Vite
```
### 3.2 Backend (API)
```yaml
Framework: FastAPI (Python 3.11+)
Documentação: OpenAPI/Swagger automático
Autenticação: JWT + OAuth2/OIDC
Rate Limiting: slowapi
Validação: Pydantic v2
```
### 3.3 Banco de Dados
```yaml
Principal: PostgreSQL 15+
Cache: Redis 7+
Vector DB: Qdrant (embeddings)
Migrations: Alembic
```
### 3.4 Autenticação
```yaml
Opções suportadas:
- Azure AD (SAML/OIDC)
- Okta
- Google Workspace
- Email/Senha com MFA (TOTP)
Permissões (RBAC):
- Admin: Acesso total
- Editor: Configura regras, visualiza tudo
- Viewer: Apenas visualização
- API: Apenas acesso programático
```
---
## 4. Facilidade de Configuração
| Ação | Método | Tempo |
|------|--------|-------|
| Conectar JIRA | Colar URL + Token | 2 minutos |
| Conectar Bitbucket | Colar URL + Token | 2 minutos |
| Trocar provedor LLM | Selecionar no dropdown | 30 segundos |
| Adicionar repositório | Colar URL + Configurar fork AI | 5 minutos |
| Criar regra de negócio | Editor visual | 5-10 minutos |
| Adicionar restrição | Digitar path | 30 segundos |
| Ver logs | Clicar na aba | Imediato |
| Exportar relatório | Botão "Exportar" | Imediato |
**Princípio: Zero código para qualquer configuração.**
---
## 5. Multi-Tenant (Múltiplas Empresas)
O portal suporta múltiplos tenants isolados:
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ ARQUITETURA MULTI-TENANT │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Tenant: ACI Safra Tenant: ACI Itaú │
│ ┌─────────────────────────┐ ┌─────────────────────────┐ │
│ │ - Repos Safra │ │ - Repos Itaú │ │
│ │ - Regras Safra │ │ - Regras Itaú │ │
│ │ - Usuários Safra │ │ - Usuários Itaú │ │
│ │ - Logs isolados │ │ - Logs isolados │ │
│ └─────────────────────────┘ └─────────────────────────┘ │
│ │ │ │
│ └────────────────┬───────────────────┘ │
│ │ │
│ ┌──────────▼──────────┐ │
│ │ Infraestrutura │ │
│ │ Compartilhada │ │
│ │ (LLM, Embeddings) │ │
│ └─────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
**Isolamento garantido:**
- Dados de um tenant nunca visíveis para outro
- Configurações independentes
- Billing separado (se aplicável)
- Audit logs por tenant
---
## 6. Responsividade
O portal é responsivo e funciona em:
| Dispositivo | Suporte |
|-------------|---------|
| Desktop (1920px+) | ✅ Otimizado |
| Laptop (1366px) | ✅ Otimizado |
| Tablet (768px) | ✅ Adaptado |
| Mobile (375px) | ⚠️ Visualização apenas |
---
## 7. Acessibilidade
- Navegação por teclado completa
- Compatível com leitores de tela (ARIA)
- Contraste adequado (WCAG 2.1 AA)
- Textos redimensionáveis
---
## 8. Próximos Passos
1. **Fase 1:** Portal básico com Dashboard e Configurações
2. **Fase 2:** Editor de regras de negócio
3. **Fase 3:** Multi-tenant e SSO
4. **Fase 4:** Relatórios avançados e exportação
5. **Fase 5:** API pública para integrações
---
**Documento preparado para apresentação de produto.**

View File

@ -1,749 +0,0 @@
# ACI JIRA AI Fixer - Documento Técnico
**Versão:** 1.1
**Data:** 2026-02-18
**Atualização:** Azure OpenAI obrigatório para compliance
**Classificação:** Interno - Equipe Técnica
---
## 1. Visão Geral
### 1.1 Objetivo
Desenvolver um sistema de inteligência artificial que integra com JIRA e Bitbucket para automatizar a análise de Support Cases, identificar módulos afetados no código-fonte (COBOL/SQL/JCL), propor correções e documentar soluções automaticamente.
### 1.2 Escopo
- **Produtos:** ACQ-MF (Acquirer) e ICG-MF (Interchange)
- **Repositórios:** Forks específicos por cliente (ex: ACQ-MF-safra-fork, ICG-MF-safra-fork)
- **Issues:** Support Cases no JIRA
- **Linguagens:** COBOL, SQL, JCL
### 1.3 Arquitetura de Alto Nível
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ ACI JIRA AI FIXER - ARQUITETURA │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────┐ │
│ │ JIRA │ │
│ │ gojira.tsacorp│ │
│ │ .com │ │
│ └───────┬───────┘ │
│ │ Webhook (issue_created, issue_updated) │
│ ▼ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ EVENT PROCESSOR │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │ │
│ │ │ Queue │ │ Filter │ │ Issue Classifier │ │ │
│ │ │ (Redis) │──▶ (Support │──▶ (Produto, Módulo, │ │ │
│ │ │ │ │ Cases) │ │ Severidade) │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ CODE INTELLIGENCE ENGINE │ │
│ │ │ │
│ │ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────┐ │ │
│ │ │ Bitbucket │ │ Code Index │ │ Context │ │ │
│ │ │ Connector │ │ (Embeddings) │ │ Builder │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ bitbucket. │ │ - COBOL procs │ │ - CALLs │ │ │
│ │ │ tsacorp.com │ │ - SQL tables │ │ - COPYBOOKs │ │ │
│ │ │ │ │ - JCL jobs │ │ - Includes │ │ │
│ │ └─────────────────┘ └─────────────────┘ └──────────────┘ │ │
│ │ │ │
│ │ Repositórios: │ │
│ │ ├── ACQ-MF (base) │ │
│ │ │ └── ACQ-MF-safra-fork (cliente) │ │
│ │ │ └── ACQ-MF-safra-ai (IA) ← NOVO │ │
│ │ ├── ICG-MF (base) │ │
│ │ │ └── ICG-MF-safra-fork (cliente) │ │
│ │ │ └── ICG-MF-safra-ai (IA) ← NOVO │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ FIX GENERATION ENGINE │ │
│ │ │ │
│ │ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────┐ │ │
│ │ │ LLM Engine │ │ Fix Validator │ │ Output │ │ │
│ │ │ │ │ │ │ Generator │ │ │
│ │ │ - GPT-4o │ │ - Syntax check │ │ │ │ │
│ │ │ - Claude 3.5 │ │ - COBOL rules │ │ - JIRA │ │ │
│ │ │ - Fallback │ │ - SQL lint │ │ comment │ │ │
│ │ │ │ │ - JCL validate │ │ - PR/Branch │ │ │
│ │ └─────────────────┘ └─────────────────┘ └──────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌───────────────┴───────────────┐ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ JIRA │ │ Bitbucket │ │
│ │ Comment │ │ Pull Request│ │
│ │ (Análise + │ │ (Fork AI) │ │
│ │ Sugestão) │ │ │ │
│ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
## 2. Componentes Detalhados
### 2.1 Event Processor
#### 2.1.1 JIRA Webhook Receiver
```yaml
Endpoint: POST /api/webhook/jira
Eventos:
- jira:issue_created
- jira:issue_updated
Filtros:
- issueType: "Support Case"
- project: ["ACQ", "ICG"]
Autenticação: Webhook Secret (HMAC-SHA256)
```
#### 2.1.2 Queue System
```yaml
Tecnologia: Redis + Bull Queue
Filas:
- jira-events: Eventos brutos do JIRA
- analysis-jobs: Jobs de análise pendentes
- fix-generation: Geração de correções
Retry Policy:
- Max attempts: 3
- Backoff: exponential (1min, 5min, 15min)
Dead Letter Queue: jira-events-dlq
```
#### 2.1.3 Issue Classifier
Responsável por extrair metadados da issue:
```python
class IssueClassifier:
def classify(self, issue: JiraIssue) -> ClassifiedIssue:
return ClassifiedIssue(
produto=self._detect_product(issue), # ACQ-MF ou ICG-MF
modulo=self._detect_module(issue), # Autorização, Clearing, etc.
severidade=self._detect_severity(issue), # P1, P2, P3
keywords=self._extract_keywords(issue), # Termos técnicos
stack_trace=self._parse_stack_trace(issue),
affected_programs=self._detect_programs(issue)
)
```
### 2.2 Code Intelligence Engine
#### 2.2.1 Bitbucket Connector
```yaml
Base URL: https://bitbucket.tsacorp.com
API Version: REST 1.0 (Bitbucket Server)
Autenticação: Personal Access Token ou OAuth
Operações:
- Clone/Pull: Sparse checkout (apenas diretórios relevantes)
- Read: Conteúdo de arquivos específicos
- Branches: Criar/listar branches no fork AI
- Pull Requests: Criar PR do fork AI → fork cliente
```
**Estrutura de Acesso por Repo:**
| Repositório | Permissão IA | Uso |
|-------------|--------------|-----|
| ACQ-MF (base) | READ | Referência, padrões |
| ACQ-MF-safra-fork | READ | Código atual cliente |
| ACQ-MF-safra-ai | WRITE | Branches e commits IA |
| ICG-MF (base) | READ | Referência, padrões |
| ICG-MF-safra-fork | READ | Código atual cliente |
| ICG-MF-safra-ai | WRITE | Branches e commits IA |
#### 2.2.2 Code Index (Embeddings)
**⚠️ IMPORTANTE: Azure OpenAI Embeddings (Obrigatório)**
O cliente possui requisitos de compliance que exigem que os dados de código-fonte não sejam processados por APIs públicas. Por isso, **obrigatoriamente** utilizamos Azure OpenAI Embeddings:
```yaml
Provedor: Azure OpenAI (dados permanecem no tenant Azure do cliente)
Modelo: text-embedding-ada-002 ou text-embedding-3-large
Região: Brazil South (recomendado) ou East US
Compliance: Dados não são usados para treinar modelos Microsoft
Contrato: Enterprise Agreement existente da ACI
```
**Por que não usar GitHub Copilot para embeddings?**
- GitHub Copilot é uma ferramenta de IDE, não possui API para integração
- Não oferece funcionalidade de indexação ou busca semântica
- Não há como usar Copilot para buscar código relevante programaticamente
**Indexação de Código COBOL:**
```yaml
Granularidade: Por PROGRAM-ID / SECTION / PARAGRAPH
Metadados extraídos:
- PROGRAM-ID
- COPY statements (dependências)
- CALL statements (programas chamados)
- FILE-CONTROL (arquivos acessados)
- SQL EXEC (tabelas/queries)
- Working Storage (variáveis principais)
Modelo de Embedding: Azure OpenAI text-embedding-3-large
Vector DB: Qdrant (self-hosted na infra ACI) ou Azure AI Search
Dimensões: 3072
Índice separado por: produto + cliente
```
**Indexação de SQL:**
```yaml
Granularidade: Por tabela/view/procedure
Metadados extraídos:
- Nome do objeto
- Colunas e tipos
- Foreign keys
- Procedures que referenciam
```
**Indexação de JCL:**
```yaml
Granularidade: Por JOB / STEP
Metadados extraídos:
- JOB name
- PGM executados
- DD statements (datasets)
- PARM passados
- Dependências (JCL INCLUDEs)
```
#### 2.2.3 Context Builder
Monta o contexto relevante para o LLM analisar:
```python
class ContextBuilder:
def build_context(self, issue: ClassifiedIssue) -> AnalysisContext:
# 1. Busca programas mencionados na issue
mentioned_programs = self._search_by_keywords(issue.keywords)
# 2. Busca programas similares a issues passadas
similar_issues = self._find_similar_issues(issue)
# 3. Expande dependências (COPYBOOKs, CALLs)
dependencies = self._expand_dependencies(mentioned_programs)
# 4. Busca regras de negócio configuradas
business_rules = self._get_business_rules(issue.produto)
# 5. Monta contexto final (respeitando limite de tokens)
return AnalysisContext(
primary_code=mentioned_programs[:5], # Max 5 programas principais
dependencies=dependencies[:10], # Max 10 dependências
similar_fixes=similar_issues[:3], # Max 3 exemplos
business_rules=business_rules,
total_tokens=self._count_tokens()
)
```
### 2.3 Fix Generation Engine
#### 2.3.1 LLM Engine
```yaml
Primary: Azure OpenAI GPT-4o (dados não saem do ambiente Azure)
Fallback: Azure OpenAI GPT-4 Turbo
Gateway: LiteLLM (unified interface)
Configuração:
temperature: 0.2 # Baixa para código
max_tokens: 4096
top_p: 0.95
```
**Nota sobre GitHub Copilot:** O cliente possui GitHub Copilot, porém esta ferramenta é destinada ao uso no IDE pelos desenvolvedores. O Copilot **não possui API pública** para integração em sistemas automatizados e **não oferece funcionalidade de embeddings/indexação**. Por isso, a solução utiliza Azure OpenAI para todas as operações de IA.
**Prompt Template para COBOL:**
```
Você é um especialista em sistemas de pagamentos mainframe,
especificamente nos produtos ACI Acquirer (ACQ-MF) e Interchange (ICG-MF).
## Contexto do Sistema
{business_rules}
## Issue Reportada
{issue_description}
## Código Atual
{code_context}
## Histórico de Fixes Similares
{similar_fixes}
## Tarefa
Analise a issue e:
1. Identifique a causa raiz provável
2. Localize o(s) programa(s) afetado(s)
3. Proponha uma correção específica
4. Explique o impacto da mudança
## Regras
- Mantenha compatibilidade com COBOL-85
- Preserve a estrutura de copybooks existente
- Não altere interfaces com outros sistemas sem explicitar
- Documente todas as alterações propostas
## Formato de Resposta
{response_format}
```
#### 2.3.2 Fix Validator
**Validações COBOL:**
```yaml
Syntax:
- Compilação com GnuCOBOL (syntax check)
- Verificação de copybooks referenciados
Semântica:
- CALLs para programas existentes
- Variáveis declaradas antes do uso
- PIC clauses compatíveis
Estilo:
- Indentação padrão (área A/B)
- Naming conventions da ACI
- Comentários obrigatórios
```
**Validações SQL:**
```yaml
- Syntax check com parser SQL
- Verificação de tabelas/colunas existentes
- Análise de performance (EXPLAIN)
```
**Validações JCL:**
```yaml
- Syntax check JCL
- Datasets referenciados existem
- PGMs referenciados existem
```
#### 2.3.3 Output Generator
**Formato do Comentário JIRA:**
```markdown
## 🤖 Análise Automática - AI Fixer
### 📋 Resumo
[Descrição concisa do problema identificado]
### 🔍 Causa Raiz Identificada
[Explicação técnica da causa]
### 📁 Arquivos Afetados
| Arquivo | Tipo | Alteração |
|---------|------|-----------|
| ACQAUTH.CBL | COBOL | Modificação na SECTION 3000-VALIDATE |
| ACQAUTH.CPY | COPYBOOK | Sem alteração |
### 💡 Correção Proposta
```cobol
[Código da correção]
```
### ⚠️ Impacto
- [Lista de impactos]
### 📊 Confiança
- **Score:** 85%
- **Base:** 3 issues similares encontradas
### 🔗 Ações
- [Link para PR no Bitbucket] (se aplicável)
- [Link para branch com correção]
---
*Gerado automaticamente por ACI JIRA AI Fixer v1.0*
*Review humano obrigatório antes de merge*
```
---
## 3. Estrutura de Repositórios (Fork AI)
### 3.1 Criação dos Forks AI
```bash
# Estrutura proposta no Bitbucket
projects/
├── ACQ/
│ ├── ACQ-MF # Produto base (existente)
│ ├── ACQ-MF-safra-fork # Fork cliente (existente)
│ └── ACQ-MF-safra-ai # Fork IA (NOVO)
├── ICG/
│ ├── ICG-MF # Produto base (existente)
│ ├── ICG-MF-safra-fork # Fork cliente (existente)
│ └── ICG-MF-safra-ai # Fork IA (NOVO)
```
### 3.2 Fluxo de Branches
```
ACQ-MF-safra-fork (cliente)
│ fork
ACQ-MF-safra-ai (IA)
├── main (sync com cliente)
└── ai-fix/JIRA-1234-descricao
│ Pull Request
ACQ-MF-safra-fork (cliente)
│ Review + Approve
merge
```
### 3.3 Convenção de Commits
```
[AI-FIX] JIRA-1234: Descrição curta do fix
Problema:
- Descrição do problema original
Solução:
- O que foi alterado e por quê
Arquivos modificados:
- src/cobol/ACQAUTH.CBL (linha 1234-1256)
Confiança: 85%
Gerado por: ACI JIRA AI Fixer v1.0
Co-authored-by: ai-fixer@aci.com
```
### 3.4 Permissões Recomendadas
| Usuário/Grupo | ACQ-MF (base) | Fork Cliente | Fork AI |
|---------------|---------------|--------------|---------|
| ai-fixer-svc | READ | READ | WRITE |
| devs-aci | WRITE | WRITE | READ |
| tech-leads | ADMIN | ADMIN | ADMIN |
---
## 4. Interface de Configuração (Admin Panel)
### 4.1 Funcionalidades
```
┌─────────────────────────────────────────────────────────────┐
│ ACI AI FIXER - ADMIN │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Dashboard │ │ Config │ │ Logs │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
│ 📊 Dashboard │
│ ├── Issues processadas (hoje/semana/mês) │
│ ├── Taxa de acerto (fixes aceitos) │
│ ├── Tempo médio de análise │
│ └── Fila atual │
│ │
│ ⚙️ Configurações │
│ ├── Regras de Negócio │
│ │ └── [Editor de regras por módulo] │
│ ├── Mapeamento de Módulos │
│ │ └── [Keywords → Programas] │
│ ├── Exemplos de Fixes │
│ │ └── [Issues resolvidas como referência] │
│ ├── Restrições │
│ │ └── [Arquivos/módulos que IA não pode alterar] │
│ └── Conexões │
│ ├── JIRA (webhook URL, credentials) │
│ └── Bitbucket (repos, tokens) │
│ │
│ 📝 Logs │
│ ├── Histórico de análises │
│ ├── Erros e exceções │
│ └── Audit trail (quem aprovou o quê) │
│ │
└─────────────────────────────────────────────────────────────┘
```
### 4.2 Configuração de Regras de Negócio
```yaml
# Exemplo de configuração por módulo
modulos:
autorizacao:
descricao: "Módulo de autorização de transações"
programas:
- ACQAUTH*
- ACQVALD*
keywords:
- autorização
- auth
- decline
- aprovação
regras:
- "Transações acima de 10000 requerem validação adicional"
- "Códigos de resposta seguem padrão ISO 8583"
restricoes:
- "Não alterar interface com HOST sem aprovação"
clearing:
descricao: "Módulo de clearing e settlement"
programas:
- ICGCLR*
- ICGSET*
keywords:
- clearing
- settlement
- arquivo retorno
regras:
- "Arquivos de clearing seguem layout CNAB"
```
### 4.3 API do Admin Panel
```yaml
# Endpoints principais
POST /api/config/rules
- Criar/atualizar regras de negócio
GET /api/config/modules
- Listar módulos configurados
POST /api/config/examples
- Adicionar exemplo de fix
GET /api/dashboard/stats
- Métricas de uso
GET /api/logs/analyses
- Histórico de análises
POST /api/manual/analyze
- Trigger análise manual de uma issue
```
---
## 5. Stack Tecnológico
### 5.1 Backend
```yaml
Runtime: Python 3.11+
Framework: FastAPI
Async: asyncio + httpx
Queue: Redis 7+ com Bull Queue (via Python-RQ ou Celery)
Database: PostgreSQL 15+ (metadados, configurações, logs)
Vector DB: Qdrant 1.7+ (self-hosted)
Cache: Redis
```
### 5.2 Frontend (Admin Panel)
```yaml
Framework: React 18+ ou Vue 3+
UI Kit: Tailwind CSS + shadcn/ui
State: React Query ou Pinia
Build: Vite
```
### 5.3 Infraestrutura
```yaml
Container: Docker + Docker Compose
Orquestração: Docker Swarm (inicial) ou Kubernetes (escala)
CI/CD: Bitbucket Pipelines
Reverse Proxy: Traefik ou nginx
SSL: Let's Encrypt
Monitoramento: Prometheus + Grafana
Logs: ELK Stack ou Loki
```
### 5.4 Integrações Externas
```yaml
LLM (Azure OpenAI - OBRIGATÓRIO):
Primary: Azure OpenAI GPT-4o
Fallback: Azure OpenAI GPT-4 Turbo
Região: Brazil South ou East US
Gateway: LiteLLM (suporta Azure OpenAI nativamente)
Compliance: Dados não usados para treino, ficam no tenant Azure
Embeddings (Azure OpenAI - OBRIGATÓRIO):
Modelo: Azure OpenAI text-embedding-3-large
Alternativa: Azure OpenAI text-embedding-ada-002
Vector DB: Qdrant (self-hosted) ou Azure AI Search
JIRA:
API: REST API v2 (Server)
Auth: Personal Access Token
Bitbucket:
API: REST API 1.0 (Server)
Auth: Personal Access Token
```
**⚠️ Nota sobre GitHub Copilot:**
O cliente possui licenças de GitHub Copilot, porém esta ferramenta **não é aplicável** para esta solução porque:
1. É uma ferramenta de IDE (autocompletar código), não uma API
2. Não possui endpoint público para integração programática
3. Não oferece funcionalidade de embeddings ou busca semântica
4. Não permite indexar ou consultar repositórios de código
O GitHub Copilot continuará sendo usado pelos desenvolvedores no dia-a-dia, enquanto a solução JIRA AI Fixer usa Azure OpenAI para automação.
---
## 6. Segurança
### 6.1 Dados Sensíveis
```yaml
Código fonte:
- Processado em memória, não persistido em disco
- Embeddings armazenados em Qdrant (criptografado at-rest)
- Logs sanitizados (sem código completo)
Credenciais:
- Vault (HashiCorp) ou AWS Secrets Manager
- Rotação automática de tokens
- Audit log de acessos
LLM e Embeddings:
- OBRIGATÓRIO: Azure OpenAI (dados não saem do tenant Azure)
- Dados não são usados para treinar modelos da Microsoft
- Compliance com políticas corporativas ACI
- Região Brazil South para menor latência
```
### 6.2 Rede
```yaml
Deployment:
- Rede interna (não exposto à internet)
- Comunicação HTTPS/TLS 1.3
- Firewall: apenas JIRA e Bitbucket podem acessar webhooks
Autenticação:
- Admin Panel: SSO via SAML/OIDC (integrar com AD da ACI)
- API: JWT tokens com expiração curta
- Webhooks: HMAC-SHA256 signature verification
```
### 6.3 Compliance
```yaml
Requisitos:
- [ ] Segregação de dados por cliente/fork
- [ ] Audit trail completo (quem, quando, o quê)
- [ ] Retenção de logs configurável
- [ ] Opção de processamento 100% on-premise
- [ ] Documentação de fluxo de dados
```
---
## 7. Estimativas
### 7.1 Timeline de Desenvolvimento
| Fase | Duração | Entregas |
|------|---------|----------|
| **1. Setup Inicial** | 2 semanas | Infra, repos, CI/CD básico |
| **2. Integrações** | 3 semanas | JIRA webhook, Bitbucket connector |
| **3. Code Intelligence** | 4 semanas | Indexação COBOL/SQL/JCL, embeddings |
| **4. Fix Engine** | 3 semanas | LLM integration, prompt engineering |
| **5. Output & PR** | 2 semanas | JIRA comments, Bitbucket PRs |
| **6. Admin Panel** | 2 semanas | Dashboard, configurações |
| **7. Testes & Ajustes** | 2 semanas | Validação com issues reais |
| **Total MVP** | **18 semanas** | ~4.5 meses |
### 7.2 Equipe Sugerida
| Função | Quantidade | Dedicação |
|--------|------------|-----------|
| Tech Lead | 1 | 100% |
| Backend Developer | 2 | 100% |
| Frontend Developer | 1 | 50% |
| DevOps | 1 | 25% |
| **Total** | **5** | |
### 7.3 Custos Operacionais Mensais (Estimativa)
| Item | Custo/Mês |
|------|-----------|
| LLM APIs (10 issues × ~$3/issue) | ~$30 |
| Infra (VPS/On-premise) | $200-500 |
| Vector DB (Qdrant self-hosted) | $0 (infra) |
| **Total** | **~$230-530/mês** |
*Nota: Volume baixo (5-10 issues/mês) resulta em custo operacional mínimo.*
---
## 8. Riscos Técnicos e Mitigações
| Risco | Probabilidade | Impacto | Mitigação |
|-------|---------------|---------|-----------|
| LLM gera fix incorreto | Alta | Alto | Human review obrigatório, confidence score |
| Contexto COBOL insuficiente | Média | Alto | RAG com copybooks, exemplos de fixes |
| Latência alta | Baixa | Médio | Queue assíncrona, feedback visual |
| Bitbucket API rate limit | Baixa | Baixo | Cache agressivo, sparse checkout |
| Segurança (código exposto) | Média | Alto | Azure OpenAI ou self-hosted LLM |
---
## 9. Métricas de Sucesso
### 9.1 KPIs Técnicos
| Métrica | Target MVP | Target 6 meses |
|---------|------------|----------------|
| Taxa de análises bem-sucedidas | 80% | 95% |
| Fixes aceitos (sem modificação) | 30% | 50% |
| Fixes aceitos (com ajustes) | 50% | 70% |
| Tempo médio de análise | < 5 min | < 2 min |
| Uptime do sistema | 95% | 99% |
### 9.2 KPIs de Negócio
| Métrica | Target |
|---------|--------|
| Redução tempo de análise inicial | 50% |
| Issues com sugestão útil | 70% |
| Satisfação da equipe | > 4/5 |
---
## 10. Próximos Passos
1. **Semana 1-2:**
- Provisionar infra de desenvolvimento
- Criar forks AI no Bitbucket
- Configurar webhooks JIRA (ambiente de teste)
2. **Semana 3-4:**
- Implementar connector Bitbucket
- Indexar código de 1 repositório (ACQ-MF-safra-fork)
- Testar embeddings com 5 issues históricas
3. **Semana 5-6:**
- Integrar LLM (GPT-4o)
- Desenvolver prompts específicos para COBOL
- Validar outputs com equipe técnica
---
**Documento preparado para revisão técnica.**
*Contato: [Equipe de Desenvolvimento]*

View File

@ -1,10 +1,9 @@
# ACI JIRA AI Fixer
# JIRA AI Fixer
## Executive Proposal
**Date:** February 18, 2026
**Date:** February 2026
**Version:** 1.1
**Update:** Azure OpenAI mandatory for compliance
**Classification:** Internal - Executive
**Classification:** Product Documentation
---
@ -12,7 +11,7 @@
### The Problem
The support team faces growing challenges in resolving Support Cases:
Support teams face growing challenges in resolving Support Cases:
| Challenge | Impact |
|-----------|--------|
@ -64,16 +63,16 @@ An **Artificial Intelligence** system that:
## Why Now?
### 1. Mature Technology
Language models (GPT-4, Claude) have reached sufficient quality for code analysis and generation, including legacy languages like COBOL.
Language models (GPT-4, Claude, Llama) have reached sufficient quality for code analysis and generation, including legacy languages like COBOL.
### 2. Competitive Advantage
Leading companies are adopting AI to accelerate development. Those who don't adopt will fall behind in productivity.
### 3. Manageable Volume
With 5-10 issues/month, the risk is low and the environment is ideal to validate the solution before scaling.
With typical support volumes, the risk is low and the environment is ideal to validate the solution before scaling.
### 4. Accessible Cost
Operational cost is minimal (~$500/month) due to low volume.
Operational cost is minimal, especially with free/low-cost LLM options available.
---
@ -108,12 +107,12 @@ Operational cost is minimal (~$500/month) due to low volume.
📋 AUTOMATIC ANALYSIS
🔍 Identified Cause:
The ACQAUTH.CBL program is comparing the WS-AVAILABLE-BALANCE field
The AUTH.CBL program is comparing the WS-AVAILABLE-BALANCE field
with format PIC 9(9)V99, but the value returned from HOST uses
PIC 9(11)V99, causing truncation.
📁 Affected File:
- src/cobol/ACQAUTH.CBL (lines 1234-1256)
- src/cobol/AUTH.CBL (lines 1234-1256)
💡 Proposed Fix:
Change WS-AVAILABLE-BALANCE declaration to PIC 9(11)V99
@ -121,7 +120,7 @@ and adjust the comparison in SECTION 3000-VALIDATE.
📊 Confidence: 87%
🔗 PR with fix: bitbucket.tsacorp.com/projects/ACQ/repos/...
🔗 PR with fix: bitbucket.example.com/projects/PRODUCT/repos/...
```
### Security: AI Does Not Alter Production Code
@ -132,12 +131,12 @@ and adjust the comparison in SECTION 3000-VALIDATE.
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ CLIENT Repository (production) │
ACQ-MF-safra-fork
Product-Client-Fork
│ ├── AI has access: READ ONLY │
│ └── Changes: ONLY by developers │
│ │
│ AI Repository (isolated) │
ACQ-MF-safra-ai
Product-Client-AI
│ ├── AI has access: READ AND WRITE │
│ └── Purpose: Branches with fix suggestions │
│ │
@ -157,60 +156,23 @@ and adjust the comparison in SECTION 3000-VALIDATE.
## Investment
### Development (MVP)
### Pricing Models
| Item | Investment |
|------|------------|
| Development (4.5 months) | $70,000 - $90,000 |
| Initial infrastructure | $3,000 |
| **Total MVP** | **$73,000 - $93,000** |
| Model | Description | Price |
|-------|-------------|-------|
| **SaaS** | Hosted, managed by vendor | $2,000 - $5,000/month |
| **On-Premise License** | Self-hosted, perpetual | $50,000 - $100,000 one-time |
| **Enterprise** | Custom deployment + support | Contact for quote |
*Estimate considers dedicated team of 4-5 professionals.*
### Monthly Operational Cost
| Item | Cost/Month |
|------|------------|
| Artificial Intelligence APIs | $30 |
| Infrastructure (servers) | $200 - $500 |
| Maintenance (10% team) | $700 |
| **Total Operational** | **~$1,000/month** |
*Low cost due to volume of 5-10 issues/month.*
---
## Return on Investment (ROI)
### Time Savings
| Metric | Value |
|--------|-------|
| Issues per month | 5-10 |
| Current average time per issue | 8-14 hours |
| Average time with AI | 2-4 hours |
| **Savings per issue** | **6-10 hours** |
| **Monthly savings** | **30-100 hours of senior dev** |
### Financial Calculation
### ROI Calculation
```
Senior developer hourly cost: ~$40
Monthly savings: 50 hours (average)
Value saved: $2,000/month
Senior developer hourly cost: ~$40-80
Average time saved per issue: 6-10 hours
Monthly savings (10 issues): $2,400 - $8,000
MVP Investment: $80,000 (average)
Operational cost: $1,000/month
Payback: ~40-48 months
However, considering:
- Scale to more clients/products
- Reduction of bugs in production
- Freeing devs for innovation
- Knowledge retention
Real ROI: Hard to quantify, but HIGHLY POSITIVE
SaaS payback: Immediate positive ROI
Enterprise license payback: 12-24 months
```
### Intangible Benefits
@ -225,33 +187,74 @@ Real ROI: Hard to quantify, but HIGHLY POSITIVE
---
## Deployment Options
### Option 1: SaaS (Recommended for Quick Start)
```
✅ Fastest time-to-value (days, not months)
✅ No infrastructure to manage
✅ Automatic updates
✅ Included support
```
### Option 2: On-Premise (For Compliance Requirements)
```
✅ 100% data stays in your infrastructure
✅ Air-gapped option (no internet required)
✅ Full control over updates
✅ One-time license cost
```
### Option 3: Hybrid
```
✅ You host, we manage
✅ Balance of control and convenience
✅ Flexible pricing
```
---
## Security and Compliance
### LLM Provider Options
| Provider | Data Location | Compliance Level |
|----------|---------------|------------------|
| **Azure OpenAI** | Your Azure tenant | Enterprise |
| **Local (Ollama)** | Your servers | Air-gapped |
| **OpenAI API** | OpenAI cloud | Standard |
| **OpenRouter** | Various | Development |
### Compliance Features
- ✅ Data segregation by client/product
- ✅ Complete audit trail
- ✅ Configurable log retention
- ✅ 100% on-premise deployment option
- ✅ Air-gapped deployment available
- ✅ No code sent to public training datasets
---
## Risks and Mitigations
| Risk | Probability | Mitigation |
|------|-------------|------------|
| **AI suggests incorrect fix** | Medium | Mandatory human review in 100% of cases |
| **Team resistance** | Low | Position as assistant, not replacement |
| **Code security** | ✅ Eliminated | Azure OpenAI - data stays in Azure tenant, not used for training |
| **LLM cost increases** | Low | Enterprise Azure contract with fixed prices |
### Compliance and Security
The solution **exclusively uses Azure OpenAI**, ensuring:
- ✅ Code data is not sent to public APIs
- ✅ Data is not used to train Microsoft models
- ✅ Processing in Brazil South region (low latency)
- ✅ Compatible with ACI corporate policies
- ✅ Uses existing Enterprise Agreement contract
**Note:** The existing GitHub Copilot will continue to be used by developers in the IDE. They are complementary tools - Copilot for code autocomplete, AI Fixer for automating issue analysis.
| **Code security** | Configurable | Choose Azure/local for compliance |
| **LLM cost increases** | Low | Multiple provider options |
### Conservative Approach
The system will be implemented in phases:
The system is designed for phased adoption:
```
Phase 1 (MVP): Analysis and suggestion only
AI comments in JIRA, doesn't create code
Phase 1: Analysis and suggestion only
AI comments in JIRA, doesn't create code
Phase 2: Code generation in isolated repository
Human decides whether to use or not
@ -265,26 +268,26 @@ Phase 4: Auto-merge (only for high-confidence fixes)
---
## Timeline
## Implementation Timeline
```
┌─────────────────────────────────────────────────────────────────────────────┐
MVP ROADMAP
IMPLEMENTATION ROADMAP
├─────────────────────────────────────────────────────────────────────────────┤
│ │
Month 1-2 Month 2-3 Month 3-4 Month 4-5
Week 1-2 Week 3-4 Week 5-6 Week 7+
│ ──────── ──────── ──────── ──────── │
│ Setup + Code Fix Tests +
│ Integrations Indexing Generation Refinement │
│ Setup + Code Business Go-Live +
│ Integrations Indexing Rules Refinement │
│ │
│ ✓ JIRA ✓ COBOL ✓ LLM ✓ Pilot
│ ✓ JIRA ✓ COBOL ✓ Modules ✓ Production
│ ✓ Bitbucket ✓ SQL ✓ Validation ✓ Adjustments │
│ ✓ Infra ✓ JCL ✓ Output ✓ Docs
│ ✓ Portal ✓ JCL ✓ Testing ✓ Support
│ │
│ │ │
│ ▼ │
GO-LIVE │
│ ~4.5 months
│ LIVE
│ ~5-7 weeks
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
@ -293,54 +296,48 @@ Phase 4: Auto-merge (only for high-confidence fixes)
## Solution Differentiators
### Why not use ready-made tools (GitHub Copilot, etc)?
### Why JIRA AI Fixer?
| Aspect | Generic Tools | Our Solution |
|--------|---------------|--------------|
| Aspect | Generic Tools | JIRA AI Fixer |
|--------|---------------|---------------|
| **JIRA Integration** | ❌ Manual | ✅ Automatic |
| **ACI system knowledge** | ❌ Generic | ✅ Trained with ACI rules |
| **Domain knowledge** | ❌ Generic | ✅ Configurable business rules |
| **COBOL expertise** | ⚠️ Limited | ✅ Optimized for mainframe |
| **Support Case flow** | ❌ Doesn't exist | ✅ Native |
| **Security (on-premise)** | ❌ Cloud only | ✅ 100% internal |
| **Customization** | ❌ Generic | ✅ Configurable rules |
| **Deployment options** | ❌ Cloud only | ✅ SaaS, on-prem, or air-gapped |
| **Customization** | ❌ Generic | ✅ Fully configurable |
---
## Recommendation
## Next Steps
### Requested Decision
### To Get Started
Approve the development of the **ACI JIRA AI Fixer MVP** with:
1. **Schedule Demo** - See JIRA AI Fixer in action with your data
2. **Pilot Program** - 30-day trial with limited scope
3. **Full Deployment** - Production rollout with support
- **Investment:** $73,000 - $93,000
- **Timeline:** 4.5 months
- **Scope:** ACQ-MF and ICG-MF products
- **Objective:** Reduce Support Case analysis time by 60%+
### Contact
### Next Steps (after approval)
1. **Week 1:** Define team and start infrastructure setup
2. **Week 2:** Create AI repositories and configure integrations
3. **Month 1:** First demonstration with real issue
4. **Month 3:** Functional MVP for pilot
5. **Month 5:** Go-live in production
- **Email:** sales@yourcompany.com
- **Demo Request:** https://jira-ai-fixer.yourcompany.com/demo
---
## Conclusion
The **ACI JIRA AI Fixer** represents an opportunity to:
**JIRA AI Fixer** represents an opportunity to:
**Increase productivity** of support team by 60%+
**Reduce response time** from hours to minutes
**Standardize quality** of analyses
**Retain knowledge** independent of people
**Position ACI** at the forefront of AI automation
**Choose your deployment** - SaaS, on-prem, or air-gapped
The timing is ideal: mature technology, controlled volume for pilot, and urgent team demand.
The timing is ideal: mature technology, flexible deployment options, and proven ROI.
---
**Document prepared for Executive presentation.**
**JIRA AI Fixer - Intelligent Support Case Resolution**
*For questions, the technical team is available for demonstration.*
*Ready to transform your support workflow?*

View File

@ -1,14 +1,14 @@
# ACI JIRA AI Fixer - Admin Portal
# JIRA AI Fixer - Admin Portal
**Version:** 1.0
**Date:** 2026-02-18
**Classification:** Internal - Product Vision
**Date:** February 2026
**Classification:** Product Documentation
---
## 1. Overview
The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that allows managing all system configurations without the need to modify code or configuration files manually.
The JIRA AI Fixer Admin Portal is a modern, intuitive web interface that allows managing all system configurations without the need to modify code or configuration files manually.
### 1.1 Objectives
@ -16,7 +16,7 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
- **Intuitive interface** for medium/large enterprises
- **Multi-tenant** to support multiple teams
- **Complete auditing** of all actions
- **Integrated SSO** with corporate providers
- **SSO integration** with corporate providers
---
@ -26,11 +26,11 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🤖 JIRA AI Fixer admin@aci.com ⚙️ 🔔
│ 🤖 JIRA AI Fixer admin@company.com ⚙️ 🔔
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │Dashboard│ │ Issues │ │ Code │ │ Config │ │ Logs │ │
│ │Dashboard│ │ Issues │ │ Repos │ │ Modules │ │Settings │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
@ -76,7 +76,7 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ │ │
│ │ Server URL │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ https://gojira.tsacorp.com │ │ │
│ │ │ https://jira.yourcompany.com │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ API Token │ │
@ -86,11 +86,11 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ │ │
│ │ Webhook URL (copy and configure in JIRA) │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ https://ai-fixer.aci.com/api/webhook/jira 📋 │ │ │
│ │ │ https://jira-fixer.yourcompany.com/api/webhook/jira 📋 │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Monitored Projects │ │
│ │ ☑️ ACQ - Acquirer ☑️ ICG - Interchange ☐ CORE - Core System │ │
│ │ ☑️ PROJECT-A ☑️ PROJECT-B ☐ PROJECT-C │ │
│ │ │ │
│ │ [ 🔄 Test Connection ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
@ -100,7 +100,7 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ │ │
│ │ Server URL │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ https://bitbucket.tsacorp.com │ │ │
│ │ │ https://bitbucket.yourcompany.com │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Access Token │ │
@ -112,17 +112,16 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ LLM Provider ────────────────────────────────────────────────────────┐ │
│ │ ✅ Azure OpenAI │ │
│ │ │ │
│ │ Provider │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Azure OpenAI ▼ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ Options: Azure OpenAI | OpenAI | OpenRouter (Free) | Self-hosted │ │
│ │ Options: Azure OpenAI | OpenAI | OpenRouter | Self-hosted (Ollama) │ │
│ │ │ │
│ │ Endpoint │ │
│ │ Endpoint (for Azure/Self-hosted) │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ https://aci-openai.openai.azure.com │ │ │
│ │ │ https://your-resource.openai.azure.com │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ API Key │ │
@ -139,7 +138,6 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─ Embeddings ──────────────────────────────────────────────────────────┐ │
│ │ ✅ Self-hosted │ │
│ │ │ │
│ │ Provider │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
@ -147,7 +145,7 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ Options: Self-hosted | Azure OpenAI | OpenAI │ │
│ │ │ │
│ │ For production, we recommend Azure OpenAI for compliance. │ │
│ │ Self-hosted embeddings are free and keep data on your servers. │ │
│ │ │ │
│ │ [ 🔄 Test Connection ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
@ -166,15 +164,15 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ 📦 ACQ-MF-safra-fork [ ⚙️ ] [ 🗑️ ]│ │
│ │ 📦 Product-Client-Fork [ ⚙️ ] [ 🗑️ ]│ │
│ │ │ │
│ │ URL: bitbucket.tsacorp.com/projects/ACQ/repos/ACQ-MF-safra-fork │ │
│ │ URL: bitbucket.company.com/projects/PROD/repos/Product-Client-Fork │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Status │ ✅ Indexed │ │ │
│ │ │ Files │ 2,847 files indexed │ │ │
│ │ │ Last Sync │ 02/18/2026 11:30 │ │ │
│ │ │ AI Fork │ ACQ-MF-safra-ai ✅ │ │ │
│ │ │ AI Fork │ Product-Client-AI ✅ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Detected languages: │ │
@ -185,21 +183,6 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ [ 🔄 Re-index Now ] [ 📊 View Details ] [ ⏰ Schedule Sync ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────────┐ │
│ │ 📦 ICG-MF-safra-fork [ ⚙️ ] [ 🗑️ ]│ │
│ │ │ │
│ │ URL: bitbucket.tsacorp.com/projects/ICG/repos/ICG-MF-safra-fork │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Status │ ✅ Indexed │ │ │
│ │ │ Files │ 1,923 files indexed │ │ │
│ │ │ Last Sync │ 02/18/2026 11:30 │ │ │
│ │ │ AI Fork │ ICG-MF-safra-ai ✅ │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [ 🔄 Re-index Now ] [ 📊 View Details ] [ ⏰ Schedule Sync ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
@ -230,7 +213,7 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ ┌─ Related Programs ────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ ACQAUTH* ✕ │ │ ACQVALD* ✕ │ │ ACQHOST* ✕ │ [ + Add ] │ │
│ │ │ AUTH* ✕ │ │ VALID* ✕ │ │ HOST* ✕ │ [ + Add ] │ │
│ │ └──────────────┘ └──────────────┘ └──────────────┘ │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
@ -250,7 +233,7 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ 📋 Rule 1 [ ✏️ ] [ 🗑️ ]│ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Transactions above $10,000 require additional validation in │ │ │
│ │ │ program ACQVALD through SECTION 5000-VALIDATE-HIGH-VALUE │ │ │
│ │ │ program VALIDATE through SECTION 5000-VALIDATE-HIGH-VALUE │ │ │
│ │ │ before sending to HOST. │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
@ -263,13 +246,6 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ │ - 91: Issuer unavailable │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ 📋 Rule 3 [ ✏️ ] [ 🗑️ ]│ │
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
│ │ │ WS-AVAILABLE-BALANCE field must have PIC 9(11)V99 for │ │ │
│ │ │ compatibility with HOST return. Check for truncation in │ │ │
│ │ │ comparisons. │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ [ + Add New Rule ] │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
@ -325,19 +301,6 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ │ [ 👁️ View Full Analysis ] [ 📝 View PR ] [ 🔗 Open JIRA ] │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ ┌─ SUPPORT-4515 ──────────────────────────────────────────────────┐ │ │
│ │ │ │ │ │
│ │ │ JCL failing with return code 12 │ │ │
│ │ │ │ │ │
│ │ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ │ │
│ │ │ │ ❌ Rejected│ │ 🎯 45% │ │ ⏱️ 4m 01s │ │ 📁 1 file │ │ │ │
│ │ │ └────────────┘ └────────────┘ └────────────┘ └────────────┘ │ │ │
│ │ │ │ │ │
│ │ │ Reason: "Incorrect dataset analysis PROD.CLEARING.INPUT" │ │ │
│ │ │ │ │ │
│ │ │ [ 👁️ View Analysis ] [ 🔄 Re-analyze ] [ 🔗 Open JIRA ] │ │ │
│ │ └─────────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
│ Showing 1-10 of 47 issues [ ← Previous ] [ Next → ] │
@ -366,12 +329,12 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │
│ ┌─ Original Description ────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Safra client reports that transactions are being declined with │ │
│ │ code 51 (insufficient funds) even when the customer has available │ │
│ │ balance. Occurs on transactions above $100,000.00. │ │
│ │ Client reports that transactions are being declined with code 51 │ │
│ │ (insufficient funds) even when the customer has available balance. │ │
│ │ Occurs on transactions above $100,000.00. │ │
│ │ │ │
│ │ Stack trace: │ │
│ │ ACQAUTH - SECTION 3000-VALIDATE - EVALUATE WS-RESPONSE-CODE │ │
│ │ AUTH - SECTION 3000-VALIDATE - EVALUATE WS-RESPONSE-CODE │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
@ -379,15 +342,15 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │ │ │
│ │ 🔍 IDENTIFIED ROOT CAUSE │ │
│ │ │ │
│ │ The ACQAUTH.CBL program is comparing the WS-AVAILABLE-BALANCE │ │
│ │ field with format PIC 9(9)V99 (maximum 9,999,999.99), but the │ │
│ │ value returned from HOST uses PIC 9(11)V99 (max 999,999,999.99). │ │
│ │ The AUTH.CBL program is comparing the WS-AVAILABLE-BALANCE field │ │
│ │ with format PIC 9(9)V99 (maximum 9,999,999.99), but the value │ │
│ │ returned from HOST uses PIC 9(11)V99 (max 999,999,999.99). │ │
│ │ │ │
│ │ This causes truncation on values above $100,000.00, │ │
│ │ making the balance appear as insufficient. │ │
│ │ │ │
│ │ 📁 AFFECTED FILES │ │
│ │ • src/cobol/ACQAUTH.CBL (lines 1234-1256) │ │
│ │ • src/cobol/AUTH.CBL (lines 1234-1256) │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ │
@ -407,8 +370,8 @@ The ACI JIRA AI Fixer Admin Portal is a modern, intuitive web interface that all
│ │
│ ┌─ Links ───────────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 🔗 Issue in JIRA: gojira.tsacorp.com/browse/SUPPORT-4521 │ │
│ │ 📝 Pull Request: bitbucket.tsacorp.com/.../pull-requests/142 │ │
│ │ 🔗 Issue in JIRA: jira.company.com/browse/SUPPORT-4521 │ │
│ │ 📝 Pull Request: bitbucket.company.com/.../pull-requests/142 │ │
│ │ 💬 AI Comment: View in JIRA │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
@ -487,7 +450,7 @@ Permissions (RBAC):
---
## 5. Multi-Tenant (Multiple Companies)
## 5. Multi-Tenant (Multiple Teams/Products)
The portal supports multiple isolated tenants:
@ -496,11 +459,11 @@ The portal supports multiple isolated tenants:
│ MULTI-TENANT ARCHITECTURE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Tenant: ACI Safra Tenant: ACI Itaú
│ Tenant: Team Alpha Tenant: Team Beta
│ ┌─────────────────────────┐ ┌─────────────────────────┐ │
│ │ - Safra Repos │ │ - Itaú Repos │ │
│ │ - Safra Rules │ │ - Itaú Rules │ │
│ │ - Safra Users │ │ - Itaú Users │ │
│ │ - Alpha Repos │ │ - Beta Repos │ │
│ │ - Alpha Rules │ │ - Beta Rules │ │
│ │ - Alpha Users │ │ - Beta Users │ │
│ │ - Isolated Logs │ │ - Isolated Logs │ │
│ └─────────────────────────┘ └─────────────────────────┘ │
│ │ │ │
@ -547,12 +510,28 @@ The portal is responsive and works on:
## 8. Roadmap
1. **Phase 1:** Basic portal with Dashboard and Settings
2. **Phase 2:** Business rules editor
3. **Phase 3:** Multi-tenant and SSO
4. **Phase 4:** Advanced reports and export
5. **Phase 5:** Public API for integrations
### Version 1.0 (MVP)
- ✅ Dashboard with metrics
- ✅ JIRA/Bitbucket integration
- ✅ LLM configuration
- ✅ Repository management
- ✅ Business rules editor
- ✅ Issue list view
### Version 1.1
- [ ] Email notifications
- [ ] Slack/Teams integration
- [ ] Scheduled reports
- [ ] API rate limiting dashboard
### Version 2.0
- [ ] Custom AI prompts editor
- [ ] A/B testing for prompts
- [ ] Advanced analytics
- [ ] Workflow automation
---
**Document prepared for product presentation.**
**JIRA AI Fixer - Intelligent Support Case Resolution**
*For questions, contact: support@yourcompany.com*

View File

@ -1,34 +1,33 @@
# ACI JIRA AI Fixer - Technical Document
# JIRA AI Fixer - Technical Document
**Version:** 1.1
**Date:** 2026-02-18
**Update:** Azure OpenAI mandatory for compliance
**Classification:** Internal - Technical Team
**Date:** February 2026
**Classification:** Product Documentation
---
## 1. Overview
### 1.1 Objective
Develop an artificial intelligence system that integrates with JIRA and Bitbucket to automate Support Case analysis, identify affected modules in source code (COBOL/SQL/JCL), propose fixes, and automatically document solutions.
JIRA AI Fixer is an artificial intelligence system that integrates with JIRA and Bitbucket to automate Support Case analysis, identify affected modules in source code (COBOL/SQL/JCL), propose fixes, and automatically document solutions.
### 1.2 Scope
- **Products:** ACQ-MF (Acquirer) and ICG-MF (Interchange)
- **Repositories:** Client-specific forks (e.g., ACQ-MF-safra-fork, ICG-MF-safra-fork)
- **Languages:** COBOL, SQL, JCL (mainframe-focused)
- **Issues:** Support Cases in JIRA
- **Languages:** COBOL, SQL, JCL
- **Repositories:** Any Bitbucket Server repositories
- **Flexibility:** Configurable per client/product
### 1.3 High-Level Architecture
```
┌─────────────────────────────────────────────────────────────────────────────┐
ACI JIRA AI FIXER - ARCHITECTURE │
│ JIRA AI FIXER - ARCHITECTURE
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌───────────────┐ │
│ │ JIRA │ │
│ │ gojira.tsacorp│ │
│ │ .com │ │
│ │ Server │ │
│ │ │ │
│ └───────┬───────┘ │
│ │ Webhook (issue_created, issue_updated) │
│ ▼ │
@ -47,20 +46,17 @@ Develop an artificial intelligence system that integrates with JIRA and Bitbucke
│ │ │ │
│ │ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────┐ │ │
│ │ │ Bitbucket │ │ Code Index │ │ Context │ │ │
│ │ │ Connector │ │ (Azure OpenAI │ │ Builder │ │ │
│ │ │ │ │ Embeddings) │ │ │ │ │
│ │ │ bitbucket. │ │ - COBOL procs │ │ - CALLs │ │ │
│ │ │ tsacorp.com │ │ - SQL tables │ │ - COPYBOOKs │ │ │
│ │ │ Connector │ │ (Embeddings) │ │ Builder │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ - COBOL procs │ │ - CALLs │ │ │
│ │ │ │ │ - SQL tables │ │ - COPYBOOKs │ │ │
│ │ │ │ │ - JCL jobs │ │ - Includes │ │ │
│ │ └─────────────────┘ └─────────────────┘ └──────────────┘ │ │
│ │ │ │
│ │ Repositories: │ │
│ │ ├── ACQ-MF (base) │ │
│ │ │ └── ACQ-MF-safra-fork (client) │ │
│ │ │ └── ACQ-MF-safra-ai (AI) ← NEW │ │
│ │ ├── ICG-MF (base) │ │
│ │ │ └── ICG-MF-safra-fork (client) │ │
│ │ │ └── ICG-MF-safra-ai (AI) ← NEW │ │
│ │ ├── Product-Base │ │
│ │ │ └── Product-Client-Fork │ │
│ │ │ └── Product-Client-AI (AI workspace) ← NEW │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
@ -69,10 +65,10 @@ Develop an artificial intelligence system that integrates with JIRA and Bitbucke
│ │ │ │
│ │ ┌─────────────────┐ ┌─────────────────┐ ┌──────────────┐ │ │
│ │ │ LLM Engine │ │ Fix Validator │ │ Output │ │ │
│ │ │ (Azure OpenAI) │ │ │ │ Generator │ │ │
│ │ │ │ │ │ │ Generator │ │ │
│ │ │ - GPT-4o │ │ - Syntax check │ │ │ │ │
│ │ │ - GPT-4 Turbo │ │ - COBOL rules │ │ - JIRA │ │ │
│ │ │ │ │ - SQL lint │ │ comment │ │ │
│ │ │ - Claude │ │ - COBOL rules │ │ - JIRA │ │ │
│ │ │ - Llama │ │ - SQL lint │ │ comment │ │ │
│ │ │ │ │ - JCL validate │ │ - PR/Branch │ │ │
│ │ └─────────────────┘ └─────────────────┘ └──────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────┘ │
@ -102,8 +98,8 @@ Events:
- jira:issue_created
- jira:issue_updated
Filters:
- issueType: "Support Case"
- project: ["ACQ", "ICG"]
- issueType: "Support Case" (configurable)
- project: Configurable per installation
Authentication: Webhook Secret (HMAC-SHA256)
```
@ -127,7 +123,7 @@ Responsible for extracting metadata from issues:
class IssueClassifier:
def classify(self, issue: JiraIssue) -> ClassifiedIssue:
return ClassifiedIssue(
product=self._detect_product(issue), # ACQ-MF or ICG-MF
product=self._detect_product(issue), # Configurable
module=self._detect_module(issue), # Authorization, Clearing, etc.
severity=self._detect_severity(issue), # P1, P2, P3
keywords=self._extract_keywords(issue), # Technical terms
@ -140,8 +136,7 @@ class IssueClassifier:
#### 2.2.1 Bitbucket Connector
```yaml
Base URL: https://bitbucket.tsacorp.com
API Version: REST 1.0 (Bitbucket Server)
Supported: Bitbucket Server (REST API 1.0)
Authentication: Personal Access Token or OAuth
Operations:
@ -155,31 +150,29 @@ Operations:
| Repository | AI Permission | Usage |
|------------|---------------|-------|
| ACQ-MF (base) | READ | Reference, standards |
| ACQ-MF-safra-fork | READ | Current client code |
| ACQ-MF-safra-ai | WRITE | AI branches and commits |
| ICG-MF (base) | READ | Reference, standards |
| ICG-MF-safra-fork | READ | Current client code |
| ICG-MF-safra-ai | WRITE | AI branches and commits |
| Product-Base | READ | Reference, standards |
| Product-Client-Fork | READ | Current client code |
| Product-Client-AI | WRITE | AI branches and commits |
#### 2.2.2 Code Index (Embeddings)
**⚠️ IMPORTANT: Azure OpenAI Embeddings (Mandatory)**
**Embedding Providers (Configurable):**
The client has compliance requirements that mandate source code data not be processed by public APIs. Therefore, we **mandatorily** use Azure OpenAI Embeddings:
| Provider | Use Case | Compliance |
|----------|----------|------------|
| Azure OpenAI | Enterprise (data stays in Azure) | High |
| OpenAI API | Standard deployments | Medium |
| Local (MiniLM) | Air-gapped / cost-sensitive | Maximum |
```yaml
Provider: Azure OpenAI (data remains in client's Azure tenant)
Model: text-embedding-ada-002 or text-embedding-3-large
Region: Brazil South (recommended) or East US
Compliance: Data not used for training Microsoft models
Contract: ACI's existing Enterprise Agreement
```
Models:
- Azure: text-embedding-3-large (3072 dims)
- OpenAI: text-embedding-3-large (3072 dims)
- Local: all-MiniLM-L6-v2 (384 dims)
**Why not use GitHub Copilot for embeddings?**
- GitHub Copilot is an IDE tool, has no API for integration
- Does not offer indexing or semantic search functionality
- There is no way to use Copilot to search code programmatically
Vector DB: Qdrant (self-hosted)
Index separated by: product + client
```
**COBOL Code Indexing:**
```yaml
@ -191,11 +184,6 @@ Extracted metadata:
- FILE-CONTROL (accessed files)
- SQL EXEC (tables/queries)
- Working Storage (main variables)
Embedding Model: Azure OpenAI text-embedding-3-large
Vector DB: Qdrant (self-hosted on ACI infra) or Azure AI Search
Dimensions: 3072
Index separated by: product + client
```
**SQL Indexing:**
@ -251,23 +239,27 @@ class ContextBuilder:
### 2.3 Fix Generation Engine
#### 2.3.1 LLM Engine
```yaml
Primary: Azure OpenAI GPT-4o (data does not leave Azure environment)
Fallback: Azure OpenAI GPT-4 Turbo
Gateway: LiteLLM (unified interface)
**Supported Providers:**
| Provider | Models | Use Case |
|----------|--------|----------|
| Azure OpenAI | GPT-4o, GPT-4 Turbo | Enterprise compliance |
| OpenAI | GPT-4o, GPT-4 Turbo | Standard deployment |
| OpenRouter | Llama 3.3, Claude, Mixtral | Cost-effective / free |
| Local | Ollama (Llama, CodeLlama) | Air-gapped |
```yaml
Configuration:
temperature: 0.2 # Low for code
max_tokens: 4096
top_p: 0.95
Gateway: LiteLLM (unified interface)
```
**Note on GitHub Copilot:** The client has GitHub Copilot, however this tool is intended for use in the IDE by developers. Copilot **does not have a public API** for integration in automated systems and **does not offer embedding/indexing functionality**. Therefore, the solution uses Azure OpenAI for all AI operations.
**COBOL Prompt Template:**
```
You are an expert in mainframe payment systems,
specifically ACI Acquirer (ACQ-MF) and Interchange (ICG-MF) products.
You are an expert in mainframe payment systems and COBOL programming.
## System Context
{business_rules}
@ -313,7 +305,7 @@ Semantics:
Style:
- Standard indentation (Area A/B)
- ACI naming conventions
- Naming conventions
- Mandatory comments
```
@ -340,25 +332,20 @@ Style:
```bash
# Proposed structure in Bitbucket
projects/
├── ACQ/
│ ├── ACQ-MF # Base product (existing)
│ ├── ACQ-MF-safra-fork # Client fork (existing)
│ └── ACQ-MF-safra-ai # AI fork (NEW)
├── ICG/
│ ├── ICG-MF # Base product (existing)
│ ├── ICG-MF-safra-fork # Client fork (existing)
│ └── ICG-MF-safra-ai # AI fork (NEW)
├── PRODUCT/
│ ├── Product-Base # Base product (existing)
│ ├── Product-Client-Fork # Client fork (existing)
│ └── Product-Client-AI # AI fork (NEW)
```
### 3.2 Branch Flow
```
ACQ-MF-safra-fork (client)
Product-Client-Fork (client)
│ fork
ACQ-MF-safra-ai (AI)
Product-Client-AI (AI workspace)
├── main (sync with client)
@ -366,7 +353,7 @@ ACQ-MF-safra-ai (AI)
│ Pull Request
ACQ-MF-safra-fork (client)
Product-Client-Fork (client)
│ Review + Approve
@ -385,20 +372,20 @@ Solution:
- What was changed and why
Modified files:
- src/cobol/ACQAUTH.CBL (lines 1234-1256)
- src/cobol/PROGRAM.CBL (lines 1234-1256)
Confidence: 85%
Generated by: ACI JIRA AI Fixer v1.0
Generated by: JIRA AI Fixer v1.0
Co-authored-by: ai-fixer@aci.com
Co-authored-by: ai-fixer@company.com
```
### 3.4 Recommended Permissions
| User/Group | ACQ-MF (base) | Client Fork | AI Fork |
|------------|---------------|-------------|---------|
| User/Group | Base Product | Client Fork | AI Fork |
|------------|--------------|-------------|---------|
| ai-fixer-svc | READ | READ | WRITE |
| devs-aci | WRITE | WRITE | READ |
| developers | WRITE | WRITE | READ |
| tech-leads | ADMIN | ADMIN | ADMIN |
---
@ -410,26 +397,26 @@ Co-authored-by: ai-fixer@aci.com
Runtime: Python 3.11+
Framework: FastAPI
Async: asyncio + httpx
Queue: Redis 7+ with Bull Queue (via Python-RQ or Celery)
Queue: Redis 7+ with Bull Queue
Database: PostgreSQL 15+ (metadata, configurations, logs)
Vector DB: Qdrant 1.7+ (self-hosted)
Cache: Redis
```
### 4.2 Frontend (Admin Panel)
### 4.2 Frontend (Admin Portal)
```yaml
Framework: React 18+ or Vue 3+
Framework: React 18+
UI Kit: Tailwind CSS + shadcn/ui
State: React Query or Pinia
State: React Query
Build: Vite
```
### 4.3 Infrastructure
```yaml
Container: Docker + Docker Compose
Orchestration: Docker Swarm (initial) or Kubernetes (scale)
CI/CD: Bitbucket Pipelines
Reverse Proxy: Traefik or nginx
Orchestration: Docker Swarm or Kubernetes
CI/CD: Configurable (Bitbucket Pipelines, GitHub Actions, etc.)
Reverse Proxy: Traefik
SSL: Let's Encrypt
Monitoring: Prometheus + Grafana
Logs: ELK Stack or Loki
@ -437,17 +424,16 @@ Logs: ELK Stack or Loki
### 4.4 External Integrations
```yaml
LLM (Azure OpenAI - MANDATORY):
Primary: Azure OpenAI GPT-4o
Fallback: Azure OpenAI GPT-4 Turbo
Region: Brazil South or East US
Gateway: LiteLLM (natively supports Azure OpenAI)
Compliance: Data not used for training, stays in Azure tenant
LLM (Configurable):
- Azure OpenAI (enterprise)
- OpenAI API (standard)
- OpenRouter (cost-effective)
- Local Ollama (air-gapped)
Embeddings (Azure OpenAI - MANDATORY):
Model: Azure OpenAI text-embedding-3-large
Alternative: Azure OpenAI text-embedding-ada-002
Vector DB: Qdrant (self-hosted) or Azure AI Search
Embeddings (Configurable):
- Azure OpenAI text-embedding-3-large
- OpenAI text-embedding-3-large
- Local MiniLM-L6-v2
JIRA:
API: REST API v2 (Server)
@ -458,15 +444,6 @@ Bitbucket:
Auth: Personal Access Token
```
**⚠️ Note on GitHub Copilot:**
The client has GitHub Copilot licenses, however this tool **is not applicable** for this solution because:
1. It's an IDE tool (code autocomplete), not an API
2. Has no public endpoint for programmatic integration
3. Does not offer embeddings or semantic search functionality
4. Does not allow indexing or querying code repositories
GitHub Copilot will continue to be used by developers in their daily work, while the JIRA AI Fixer solution uses Azure OpenAI for automation.
---
## 5. Security
@ -479,89 +456,88 @@ Source code:
- Sanitized logs (no complete code)
Credentials:
- Vault (HashiCorp) or AWS Secrets Manager
- Automatic token rotation
- Environment variables or secrets manager
- Automatic token rotation supported
- Access audit log
LLM and Embeddings:
- MANDATORY: Azure OpenAI (data does not leave Azure tenant)
- Data is not used to train Microsoft models
- Compliance with ACI corporate policies
- Brazil South region for lower latency
- Configurable: Azure (compliance) or local (air-gapped)
- No data used for training when using Azure OpenAI
```
### 5.2 Network
```yaml
Deployment:
- Internal network (not exposed to internet)
- Can be internal network only (not exposed to internet)
- HTTPS/TLS 1.3 communication
- Firewall: only JIRA and Bitbucket can access webhooks
Authentication:
- Admin Panel: SSO via SAML/OIDC (integrate with ACI AD)
- API: JWT tokens with short expiration
- Admin Portal: Token-based or SSO integration
- API: JWT tokens with configurable expiration
- Webhooks: HMAC-SHA256 signature verification
```
### 5.3 Compliance
### 5.3 Compliance Options
```yaml
Requirements:
- [ ] Data segregation by client/fork
Options:
- [ ] Data segregation by client/product
- [ ] Complete audit trail (who, when, what)
- [ ] Configurable log retention
- [ ] Option for 100% on-premise processing
- [ ] Data flow documentation
- [ ] 100% on-premise deployment option
- [ ] Air-gapped deployment (local LLM + embeddings)
```
---
## 6. Estimates
## 6. Deployment Options
### 6.1 Development Timeline
### 6.1 SaaS (Hosted)
```yaml
Infrastructure: Managed by vendor
Updates: Automatic
Cost: Monthly subscription
Best for: Quick start, low maintenance
```
| Phase | Duration | Deliverables |
|-------|----------|--------------|
| **1. Initial Setup** | 2 weeks | Infra, repos, basic CI/CD |
| **2. Integrations** | 3 weeks | JIRA webhook, Bitbucket connector |
| **3. Code Intelligence** | 4 weeks | COBOL/SQL/JCL indexing, embeddings |
| **4. Fix Engine** | 3 weeks | LLM integration, prompt engineering |
| **5. Output & PR** | 2 weeks | JIRA comments, Bitbucket PRs |
| **6. Admin Panel** | 2 weeks | Dashboard, configurations |
| **7. Tests & Adjustments** | 2 weeks | Validation with real issues |
| **Total MVP** | **18 weeks** | ~4.5 months |
### 6.2 On-Premise
```yaml
Infrastructure: Customer's data center
Updates: Customer-controlled
Cost: License + internal infra
Best for: Compliance requirements, air-gapped
```
### 6.2 Suggested Team
| Role | Quantity | Dedication |
|------|----------|------------|
| Tech Lead | 1 | 100% |
| Backend Developer | 2 | 100% |
| Frontend Developer | 1 | 50% |
| DevOps | 1 | 25% |
| **Total** | **5** | |
### 6.3 Monthly Operational Costs (Estimate)
| Item | Cost/Month |
|------|------------|
| LLM APIs (10 issues × ~$3/issue) | ~$30 |
| Infra (VPS/On-premise) | $200-500 |
| Vector DB (Qdrant self-hosted) | $0 (infra) |
| **Total** | **~$230-530/month** |
*Note: Low volume (5-10 issues/month) results in minimal operational cost.*
### 6.3 Hybrid
```yaml
Infrastructure: Customer hosts, vendor manages
Updates: Coordinated
Cost: License + reduced support
Best for: Balance of control and convenience
```
---
## 7. Technical Risks and Mitigations
## 7. Estimates
| Risk | Probability | Impact | Mitigation |
|------|-------------|--------|------------|
| LLM generates incorrect fix | High | High | Mandatory human review, confidence score |
| Insufficient COBOL context | Medium | High | RAG with copybooks, fix examples |
| High latency | Low | Medium | Async queue, visual feedback |
| Bitbucket API rate limit | Low | Low | Aggressive cache, sparse checkout |
| Security (code exposure) | Medium | High | Azure OpenAI or self-hosted LLM |
### 7.1 Implementation Timeline
| Phase | Duration | Deliverables |
|-------|----------|--------------|
| **1. Initial Setup** | 1-2 weeks | Infra, repos, basic configuration |
| **2. Integration** | 1 week | JIRA webhook, Bitbucket connector |
| **3. Code Indexing** | 1-2 weeks | Repository indexing, embeddings |
| **4. Business Rules** | 1 week | Module configuration |
| **5. Testing** | 1 week | Validation with real issues |
| **Total** | **5-7 weeks** | |
### 7.2 Monthly Operational Costs (Estimate)
| Deployment | Infra | LLM APIs | Total |
|------------|-------|----------|-------|
| SaaS | Included | Included | $2,000-5,000/mo |
| On-Premise | Customer | ~$50-200/mo | License + infra |
| Air-gapped | Customer | $0 | License + infra |
---
@ -587,25 +563,32 @@ Requirements:
---
## 9. Next Steps
## 9. Getting Started
1. **Week 1-2:**
- Provision development infrastructure
- Create AI forks in Bitbucket
- Configure JIRA webhooks (test environment)
### 9.1 Prerequisites
- JIRA Server with webhook capability
- Bitbucket Server with API access
- Docker environment (SaaS) or Kubernetes (on-premise)
2. **Week 3-4:**
- Implement Bitbucket connector
- Index code from 1 repository (ACQ-MF-safra-fork)
- Test embeddings with 5 historical issues
### 9.2 Quick Start
```bash
# Clone repository
git clone https://github.com/your-org/jira-ai-fixer.git
cd jira-ai-fixer
3. **Week 5-6:**
- Integrate LLM (Azure OpenAI GPT-4o)
- Develop COBOL-specific prompts
- Validate outputs with technical team
# Configure
cp .env.example .env
# Edit .env with your credentials
# Run
docker compose up -d
# Access portal
open https://localhost:8080
```
---
**Document prepared for technical review.**
**JIRA AI Fixer - Intelligent Support Case Resolution**
*Contact: [Development Team]*
*Contact: sales@yourcompany.com*