# Por que NÃO faço mais Review de AI (Video Técnico)

https://www.youtube.com/watch?v=qToBgU8K4Ms
Translation: en

[00:00] Pessoal, no vídeo de hoje eu quero falar sobre qualidade de código, tá?
  Folks, in today's video I want to talk about code quality, okay?

[00:04] Vai ser um vídeo um pouco diferente, porque não tem roteiro, não é sobre um assunto novo, não é sobre inteligência artificial, é sobre qualidade de código, tá?
  It's going to be a slightly different video, because there's no script, it's not about a new topic, it's not about artificial intelligence, it's about code quality, okay?

[00:13] Vamos voltar um pouco aqui e falar sobre engenharia de software, né?
  Let's go back a bit here and talk about software engineering, right?

[00:17] Primeiro, o que que é qualidade de código?
  First, what is code quality?

[00:18] Quando a gente coloca lá no Google, a gente vai ver isso aqui como resultado, né?
  When we put it on Google, we'll see this as a result, right?

[00:21] Code quality é uma forma de medir o quão bem estruturado tá o teu código, né? e quanto que ele segue alguns padrões.
  Code quality is a way to measure how well-structured your code is, right? and how much it follows some patterns.

[00:29] Então, tem muita coisa na nossa área de engenharia de software que foram estabelecidas já há décadas e são padrões de formas de criar projeto, né?
  So, there's a lot in our software engineering field that was established decades ago and are standards for ways of creating projects, right?

[00:39] Então, tu tem coisas como arquitetura hexagonal, esse esse tipo de coisa, design patterns, né?
  So, you have things like hexagonal architecture, this this type of thing, design patterns, right?

[00:44] Então tudo isso também vira e se torna algo que a gente vai lá e vende e fala que é qualidade de código.
  So all of this also becomes something that we go and sell and say is code quality.

[00:53] Bom, se tu trabalha na área há bastante tempo, provavelmente tu sabe essas palavras chaves e até
  Well, if you've worked in the field for a long time, you probably know these keywords and even

[01:00] mesmo hoje no nosso mundo atual, né?
  Even today in our current world, right?

[01:03] Porque quem é que hoje gera o código?
  Because who is it today that generates the code?

[01:05] Quem tá gerando a código é a inteligência artificial.
  The one generating the code is artificial intelligence.

[01:07] Então como é que a gente garante que a inteligência artificial tá gerando código para nós?
  So how do we ensure that artificial intelligence is generating code for us?

[01:12] Bom, no início, não sei se vocês se lembram, mas a gente usava a inteligência artificial como sendo um copiloto, né?
  Well, in the beginning, I don't know if you remember, but we used artificial intelligence as a copilot, right?

[01:18] Então, tu revisava tudo que a IA tava criando.
  So, you reviewed everything the AI was creating.

[01:20] Atualmente, o que a gente anda fazendo basicamente é spawnando diferentes agentes, múltiplos agentes, fazendo múltiplas tarefas ao mesmo tempo.
  Currently, what we've been doing basically is spawning different agents, multiple agents, doing multiple tasks at the same time.

[01:30] E isso gera lá no fim, digamos, um pull request.
  And this generates at the end, let's say, a pull request.

[01:33] Isso gera ou um pull request ou simplesmente modificações que tu vai ter que revisar, tá?
  This generates either a pull request or simply modifications that you will have to review, okay?

[01:41] seja através das ferramentas que tu utiliza aí para interagir com a inteligência artificial ou até mesmo lá no GitHub, né?
  whether through the tools you use to interact with artificial intelligence or even there on GitHub, right?

[01:48] Então vamos pegar um por request como esse aqui que eu tô desenvolvendo faz uns dois dias aí desde o final de semana pro PSU.
  So let's take a pull request like this one here that I've been developing for about two days since the weekend for PSU.

[01:55] Então agora eu comprei um Asus, né, um PC, como vocês devem devem ter visto lá no meu
  So now I bought an Asus, right, a PC, as you must have seen on my

[02:01] Instagram.
  Instagram.

[02:03] E esse Asus aqui ele vem com uma RTX 5060.
  And this Asus here it comes with an RTX 5060.

[02:06] Isso vai me permitir fazer algumas algumas otimizações para uso de modelos de inteligência artificial locais rodando nos computadores Windows que tem GPU.
  This will allow me to do some some optimizations for the use of local artificial intelligence models running on Windows computers that have a GPU.

[02:17] Só deixa eu desbloquear a tela aqui porque tá rodando dois agentes aqui.
  Let me just unlock the screen here because two agents are running here.

[02:19] No macOS eu já uso Metal para fazer algumas otimizações, mas no Windows, se tu tem uma placa de Nvid de Nvidia no teu computador, eu preciso utilizar CUDA junto com o meu lama CCP lá para basicamente fazer acontecer.
  On macOS I already use Metal to do some optimizations, but on Windows, if you have an Nvidia card on your computer, I need to use CUDA along with my CCP llama there to basically make it happen.

[02:34] Esse por request aqui, ele tá modificando 16 arquivos.
  This per request here, it's modifying 16 files.

[02:39] Algum deles é documentação, outros são basicamente arquivos aqui eh da mais da minha arquitetura de client, né?
  Some of them are documentation, others are basically files here uh from my client architecture, right?

[02:47] A gente tá falando de PCs, né?
  We are talking about PCs, right?

[02:49] E como que um script de baixo nível vai interagir com Electron, com depois o meu React, com renderer do meu aplicativo.
  And how will a low-level script interact with Electron, then with my React, with the renderer of my application.

[02:56] Tem alguns testes aqui, scripts de tuning e por aí vai.
  There are some tests here, tuning scripts and so on.

[02:59] Bom, a grande questão é como é que a gente faz um pihas,
  Well, the big question is how do we do a pihas,

[03:03] totalizando aqui, sei lá, quase 800 linhas sendo modificadas.
  totaling here, I don't know, almost 800 lines being modified.

[03:07] Como é que a gente faz? para garantir a qualidade desse desse código que vai paraa produção, entendeu?
  How do we ensure the quality of this code that goes into production, understand?

[03:12] Isso é uma tarefa que eu tô trabalhando.
  This is a task that I am working on.

[03:14] Se eu for abrir aqui o o cursor, cara, eu tenho três tarefas pendentes que eu tô trabalhando ao mesmo tempo, tirando aquela ali.
  If I open the cursor here, man, I have three pending tasks that I am working on at the same time, besides that one.

[03:21] Então, é muito código, é muito código pra gente vir aqui e fazer a revisão dessa qualidade de código.
  So, it's a lot of code, it's a lot of code for us to come here and review this code quality.

[03:28] Eu acho que recentemente eu trouxe um coach do Uncle Bob, que inclusive ele postou no Twitter falando que nós programadores a gente é péssimo em escrever código, né?
  I think recently I brought in a coach from Uncle Bob, who incidentally posted on Twitter saying that we programmers are terrible at writing code, right?

[03:34] A gente é muito lento e tudo mais.
  We are very slow and all that.

[03:36] mas que a gente não precisa abrir mão da qualidade.
  but that we don't need to give up on quality.

[03:39] E ele trouxe um ponto que é colocar análise estática, colocar análise de qualidade do código no teu P request.
  And he brought up a point which is to include static analysis, include code quality analysis in your pull request.

[03:47] E fazia tempo que eu queria fazer o setup disso e eu acabei fazendo o setup faz umas duas semanas e eu quero trazer aqui para vocês no canal.
  And I had wanted to set this up for a while and I ended up setting it up about two weeks ago and I want to bring it to you here on the channel.

[03:53] Eu comentei, já compartilhei isso numa palestra exclusivo para quem é membro lá do Stupid Button Club.
  I mentioned it, I already shared it in an exclusive talk for members of the Stupid Button Club.

[03:57] Se tu quer participar aí do nosso clube, né, onde a
  If you want to participate in our club, right, where the

[04:04] gente tem treinamentos a cada duas semanas,
  people have trainings every two weeks,

[04:05] já tem mais de 12 aulas gravadas,
  there are already more than 12 recorded classes,

[04:07] possui acesso a a vários desenvolvedores,
  has access to several developers,

[04:10] desenvolvedoras de SAS,
  SAS developers,

[04:13] cara, galera que tá na mesma vibe de criar um produto e tal, se desenvolver,
  man, people who are in the same vibe of creating a product and stuff, developing themselves,

[04:17] usa o cupom aqui para ter acesso.
  use the coupon here to get access.

[04:19] Mas o que eu mostrei lá foi o seguinte,
  But what I showed there was the following,

[04:21] agora todo por request que eu coloco, eu tenho um quality gate, tá?
  now for every request I make, I have a quality gate, okay?

[04:25] É basicamente um portão de qualidade e esse portão de qualidade tá fazendo com que a IA corrija problemas que eu teria que revisar e pedir para ela refazer.
  It's basically a quality gate and this quality gate is making the AI correct problems that I would have to review and ask it to redo.

[04:36] Então, normalmente o que eu tô fazendo agora nos meus agentes é pedindo para que eles quando colocam pro request eles façam babysitat.
  So, normally what I'm doing now with my agents is asking them to babysit when they make a request.

[04:42] Então, o meu fluxo aqui de trabalho e eu já vou explicar num outro vídeo vídeo na quarta-feira eu vou postar a respeito de qual ferramenta eu tô utilizando mais esse mês, né?
  So, my workflow here and I'm going to explain in another video, video on Wednesday I'm going to post about which tool I'm using most this month, right?

[04:51] Porque todo mês a gente aprende uma ferramenta nova.
  Because every month we learn a new tool.

[04:55] Na verdade não aprende, né?
  Actually, we don't learn, right?

[04:57] Todo mês muda a nossa preferência por ferramentas.
  Every month our preference for tools changes.

[04:59] Uma hora é Cá e outra hora é uma ferramenta que já tem uma interface gráfica.
  One moment it's here and another moment it's a tool that already has a graphical interface.

[05:04] Então na quarta-feira
  So on Wednesday

[05:06] eu vou te mostrar um pouco mais da das ferramentas que eu tô utilizando.
  I'm going to show you a bit more of the tools I'm using.

[05:09] Mas aqui falando de uma forma mais abstrata, né?
  But here, speaking in a more abstract way, right?

[05:11] Normalmente eu tenho um agente que ele que ele tem todo o AI harness, que eu também vou explicar nesse vídeo de quarta.
  Normally I have an agent that has the entire AI harness, which I will also explain in this video on Wednesday.

[05:17] E no fim ele vai gerar o código.
  And in the end, it will generate the code.

[05:20] E desse código ele vai criar uma branch.
  And from this code, it will create a branch.

[05:23] E dessa brand ele vai criar o nosso P request.
  And from this branch, it will create our pull request.

[05:25] Então, normalmente o que eu peço para ele no fim é abrir o p request.
  So, normally, what I ask it to do in the end is to open the pull request.

[05:30] Esse é o resultado final dele, e ele fazer babysitting, né?
  This is its final result, and it does babysitting, right?

[05:32] Normalmente ele vai virar um babysat do meu p request.
  Normally it will become a babysitter for my pull request.

[05:35] Ele tem que ficar de babá lá, tem que monitorar.
  It has to act as a babysitter there, it has to monitor.

[05:39] Normalmente quando pede para ele fazer algo assim, a maioria dos modelos mais aí top de linha já vão entender o que tu quer dizer.
  Normally, when you ask it to do something like this, most of the top-of-the-line models will already understand what you mean.

[05:47] Então, normalmente é o seguinte, o C ele tá verde, os revisadores deixaram comentários e os revisadores aqui pode ser um copilot, pode ser uma ferramenta externa, pode ser um colega teu, né?
  So, normally it's like this: the CI is green, the reviewers have left comments, and the reviewers here can be a copilot, an external tool, or a colleague of yours, right?

[05:58] E ali dentro do CI também tem os testes, né?
  And within the CI, there are also the tests, right?

[06:00] Então o CI faz a parte do também rodar os testes e também o quality gate, tá?
  So the CI also does the part of running the tests and also the quality gate, okay?

[06:02] Então o modelo ele fica basicamente
  So the model basically stays

[06:08] em loop fazendo isso aqui.
  in a loop doing this here.

[06:10] Ele faz uma, ele bota um request, ele verifica se o CI passou, ele verifica se os deixar, os reviewers deixaram comentários.
  It makes a, it puts a request, it checks if the CI passed, it checks if the reviewers left comments.

[06:16] Se deixaram comentários, ele vai lá e vai endereçar o comentários.
  If they left comments, it goes there and addresses the comments.

[06:20] tu ainda não criou uma skill para isso.
  you still haven't created a skill for this.

[06:23] Eu eu super recomendo criar uma skill de babysit e customizar ela, porque uma das coisas que eu gosto de fazer é dizer pra Iá,
  I super recommend creating a babysit skill and customizing it, because one of the things I like to do is tell IA,

[06:30] resolver todas as conversas depois de endereçar os comentários, né, para que lá no GitHub tu consiga acompanhar quais comentários ela já implementou.
  resolve all conversations after addressing the comments, right, so that on GitHub you can track which comments it has already implemented.

[06:39] Enfim, um desses processos, então eu criei o Quality Gate.
  Anyway, one of these processes, so I created the Quality Gate.

[06:41] Então a Ia fica aqui automaticamente corrigindo e corrigindo, corrigindo isso aqui.
  So the IA stays here automatically correcting and correcting, correcting this here.

[06:45] O que que é isso aqui?
  What is this here?

[06:48] que eu vou descrever agora para ti, tá?
  which I will describe to you now, okay?

[06:49] Porque eu tenho vários baseline, que seria qual que é a base que ele tem que pegar como como referência, tá, de melhorias.
  Because I have several baselines, which would be what is the base that it has to take as a reference, okay, for improvements.

[06:57] No momento que tu coloca um quality gate no teu projeto que nunca teve controle de qualidade, o teu projeto vai ficar verde.
  The moment you put a quality gate in your project that has never had quality control, your project will turn green.

[07:04] Se tu colocar no mesmo PR, que introduz um quality gate, a melhor baseline, tu não vai
  If you put in the same PR, which introduces a quality gate, the best baseline, you won't

[07:09] conseguir merergear esse por request com quality gate, tá?
  to be able to merge this pull request with a quality gate, okay?

[07:11] Porque tudo vai falhar.
  Because everything will fail.

[07:14] Então, quality gator, tipo assim, a gente tá aqui e tu tá levando a gente para cá.
  So, quality gate, like this, we are here and you are taking us here.

[07:15] Por exemplo, baseline, tá?
  For example, baseline, okay?

[07:21] De de cobertura, pô, a gente tá em 7% de de código não coberto e tu tá levando a gente para 10%.
  Of coverage, man, we are at 7% of uncovered code and you are taking us to 10%.

[07:27] E por aí vai, tá?
  And so on, okay?

[07:30] Duplicação de código, nosso baseline é 2,2 e tu tá nos levando aí para 2,04.
  Code duplication, our baseline is 2.2 and you are taking us to 2.04.

[07:37] Então, show de bola.
  So, great.

[07:40] algumas violações de regras que a gente tem, tá aumentando, tá subindo, né?
  some rule violations that we have, are increasing, are going up, right?

[07:41] Então aqui nós temos algumas regressões no final disso.
  So here we have some regressions at the end of this.

[07:43] Por exemplo, local llmservice.js.
  For example, local llmservice.js.

[07:48] É um arquivo que cresceu de 1000 a 1 para 1140 linhas nesse por request.
  It's a file that grew from 1000 to 1 to 1140 lines in this pull request.

[07:54] Então cresceu 140 linhas.
  So it grew 140 lines.

[07:57] É pouca coisa, mas cara, o arquivo já tá com 1000 linhas.
  It's a small thing, but man, the file already has 1000 lines.

[07:59] Ele já passou do limite estipulado, né?
  It has already exceeded the stipulated limit, right?

[08:01] Então a IA antes de a gente ergar esse código, ela vai ficar no babysitat ali tentando corrigir isso aí.
  So the AI, before we merge this code, it will stay there babysitting trying to fix it.

[08:05] Aqui ela vai vir com coisas como
  Here it will come with things like

[08:10] refazer o que ela fez, né?
  redo what she did, right?

[08:13] Fazer um um dry e extrair alguma coisa, não pelo dry, mas porque um arquivo tá crescendo, modularizar.
  Do a dry run and extract something, not because of the dry run, but because a file is growing, modularize.

[08:19] A IA já é capaz de fazer isso, cara.
  AI is already capable of doing this, man.

[08:24] Tu bota isso aqui na mão de um de um chat EPT, de um GPT 5.5, de um Opus 4.7.
  You put this in the hands of a chat EPT, a GPT 5.5, an Opus 4.7.

[08:27] Esses modelos vão conseguir ver isso aqui e pensar numa solução que case com uma boa arquitetura, tá?
  These models will be able to see this and think of a solution that fits with a good architecture, okay?

[08:35] Antigamente a gente tinha que descrever tudo isso para modelos, mas cara não precisa mais descrever.
  In the past, we had to describe all of this to models, but man, you don't need to describe it anymore.

[08:39] Eles já foram treinados com todos os livros de melhor como escrever o melhor código.
  They have already been trained with all the books on how to write the best code.

[08:46] Eles não fazem porque eles são preguiçosos, né?
  They don't do it because they are lazy, right?

[08:48] Eles não fazem porque se eles fizessem do D zero isso, tu gastaria menos tokens.
  They don't do it because if they did it from scratch, you would spend fewer tokens.

[08:52] Na verdade é isso.
  Actually, that's it.

[08:55] O que as empresas de inteligência artificial descobriram é que deixando os modelos delas preguiçosos, tu queima mais token, porque tu tem que pegar o output dela que ela gerou, que é um output que não tá perfeito, e tu tem que dar um novo input para gerar um novo output.
  What artificial intelligence companies have discovered is that by letting their models be lazy, you burn more tokens, because you have to take their output that they generated, which is an output that isn't perfect, and you have to give a new input to generate a new output.

[09:05] Então tu fica nesse ciclo.
  So you get stuck in this cycle.

[09:09] Toda vez que eles vêm aqui e fazem esse babysitat, eu
  Every time they come here and do this babysitting, I

[09:11] gasto mais token, mais token, mais token.
  I spent more tokens, more tokens, more tokens.

[09:15] se tu sabe como faz direito e tu sabe corrigir, porque que tu não fez de primeira?
  If you know how to do it right and you know how to correct it, why didn't you do it the first time?

[09:19] simplesmente porque não seria mais vantajoso praic Open AI se o modelo fizesse de primeira,
  Simply because it wouldn't be more advantageous for OpenAI if the model did it the first time,

[09:23] mas eles tm capacidade de já fazer de primeira, tá?
  but they have the capacity to do it the first time, okay?

[09:27] Quanto custa? Bom, testa ultra review, ultra ultra plan da Antropic para te ver quanto que custa, cara.
  How much does it cost? Well, test the ultra review, ultra ultra plan from Anthropic to see how much it costs, man.

[09:34] Quando eles lançaram Ultra Review e Ultra Planning, foi até interessante porque eu fiz a o bate-papo lá no canal do Fernando UiNOPC
  When they launched Ultra Review and Ultra Planning, it was even interesting because I did the chat on Fernando UiNOPC's channel

[09:40] estava lançando um um plano, né, um produto, uma solução que por trás estaria rodando um modelo muito melhor, como por exemplo o Mitos.
  was launching a plan, right, a product, a solution that would be running a much better model behind it, like for example Mitos.

[09:50] E dois dias depois eles lançaram lá o Ultra Review e o Ultra Plan.
  And two days later they launched the Ultra Review and the Ultra Plan there.

[09:55] E cara, eu fui testar e eu gastei 150, tipo, para testar.
  And man, I went to test it and I spent 150, like, to test it.

[09:58] Eu rodava o Ultra Review, ele gastava 30 e tinha um bug no cloud que e eu ficava sem limite e simplesmente o Ultra Review crashava e ele já tinha consumido o meu
  I ran the Ultra Review, it spent 30 and there was a bug in the cloud that I ran out of limit and simply the Ultra Review crashed and it had already consumed my

[10:12] saldo.
  balance.

[10:14] Aí para ele finalizar e eu ver o resultado, eu tinha que botar mais crédito, mais crédito e assim foi.
  So for it to finish and for me to see the result, I had to put in more credit, more credit, and so it went.

[10:18] Então é muito caro.
  So it's very expensive.

[10:20] Mas enfim, esse é o mundo que a gente tá no momento, né?
  But anyway, this is the world we're in at the moment, right?

[10:23] Então deixa eu te trazer uma uma visão geral aqui do meu projeto, né?
  So let me give you an overview of my project, right?

[10:27] Que eu chamo de Strawberry.
  Which I call Strawberry.

[10:27] H, a gente tá com 483 violações do ES Lint.
  Uh, we have 483 ES Lint violations.

[10:33] Basicamente aqui é um estrutural espalhado em 120 arquivos.
  Basically, here it's a structural issue spread across 120 files.

[10:36] Tem 2,2% de duplicação de código, que é algo na real tão ruim.
  There's 2.2% code duplication, which isn't really that bad.

[10:42] Tem 7% de cobertura de testes e tem 19 arquivos acima do limite do tamanho.
  There's 7% test coverage and there are 19 files above the size limit.

[10:47] O maior arquivo deles é o app.js, JS que tem 4600 linhas.
  Their largest file is app.js, JS, which has 4600 lines.

[10:54] E ainda assim eu consigo já começar a dormir um pouco mais tranquilo, abrindo pro request todo dia com a o meu agente de A, escrevendo a maioria parte do código.
  And even so, I can already start to sleep a little more peacefully, opening pull requests every day with my AI agent, writing most of the code.

[11:02] Nem vou dizer porque ele escreve 100% do código.
  I won't even say why it writes 100% of the code.

[11:05] Porque o quality gate que eu o quality gate que eu montei tem uma regra de ouro que é cada piode adicionar código, mas
  Because the quality gate that I, the quality gate that I set up has a golden rule, which is every pull request adds code, but

[11:12] não pode aumentar nenhuma das métricas,
  you cannot increase any of the metrics,

[11:15] nem por uma violação, nem por uma linha,
  neither by a violation, nor by a line,

[11:17] nem por 0,1 ponto percentual, tá?
  nor by 0.1 percentage point, okay?

[11:21] Então esse é o meu baseline aqui que eu te passei e não não é para ficar pior do que isso.
  So this is my baseline here that I passed to you and it's not supposed to get worse than this.

[11:26] Aos poucos agora eu vou começar a colocar pro request refatoração para ir melhorando esse baseline, tá?
  Little by little now I will start to put in refactoring requests to improve this baseline, okay?

[11:31] Então isso aqui normalmente, né, se chama de ratchet, que é catraca, né?
  So this here normally, right, is called a ratchet, which is a ratchet, right?

[11:36] A catraca tu só anda num sentido, uma vez que tu congelou ali o teu baseline.
  The ratchet you only move in one direction, once you have frozen your baseline there.

[11:41] Então todo quality gate, tu vai ter que definir um baseline, tu congela ele e o repositório só pode melhorar a partir dali ou empatar, né?
  So every quality gate, you will have to define a baseline, you freeze it and the repository can only improve from there or tie, right?

[11:50] Então, antes de tu fechar o vídeo e começar a pensar, né, pô, isso aí é burocracia, isso vai me atrasar, deixa eu falar uma palavra chave para ti, que é por que essa essa catraca torna o possível deixar IA escrevendo 100% do teu código sem o teu code base virar um slope em se meses, né?
  So, before you close the video and start thinking, right, wow, this is bureaucracy, this will slow me down, let me tell you a keyword, which is why this ratchet makes it possible to have AI writing 100% of your code without your codebase turning into a slope in months, right?

[12:07] Virar uma bagunça
  Turn into a mess

[12:13] em seis meses, porque não é só o quality gate que eu vou finalizar o vídeo agora te explicando, tá?
  in six months, because it's not just the quality gate that I'm going to finish the video now explaining, okay?

[12:18] Aqui eu pedi pro próprio cloud fazer um resumo do que que eu tenho no meu pipeline.
  Here I asked the cloud itself to summarize what I have in my pipeline.

[12:23] Então, no momento que um request é aberto, a gente roda lá o npmci.
  So, when a request is opened, we run the npmci there.

[12:26] Isso aqui, basicamente, ele faz a instalação determinística ali.
  This here, basically, it does the deterministic installation there.

[12:31] O npm audit, audit level critical bloqueia se tiver qualquer coisa crítica.
  The npm audit, audit level critical blocks if there is anything critical.

[12:35] NPM audit audit level high avisa, mas não bloqueia.
  NPM audit audit level high warns, but does not block.

[12:38] Aí ele roda o npm run lint que é o padrão lá do teu React.
  Then it runs npm run lint which is the standard for your React.

[12:43] NP NPN run test coverage C plus coverage.
  NP NPN run test coverage C plus coverage.

[12:48] Lá tem o meu Jest lá rodando.
  There is my Jest running there.

[12:51] Aí a gente tem o node rodando um script de quality gate, que é aquilo que eu te mostrei ali, que faz o check, que é o nosso coração da catraca, né, dessa catraca de baseline que eu te falei.
  Then we have the node running a quality gate script, which is what I showed you there, which does the check, which is the heart of our turnstile, right, of this baseline turnstile that I told you about.

[13:00] Aí disso a gente faz comentários no P request, mas coloca alguns steps no sumário do P request e faz o upload dos artefatos, né, que seria o coverage e todos os relatórios que depois o teu
  Then from this we make comments on the P request, but we put some steps in the summary of the P request and upload the artifacts, right, which would be the coverage and all the reports that then your

[13:14] agente vai ter acesso.
  The agent will have access.

[13:16] Então não adianta simplesmente tu ir no teu request e guspir isso aqui.
  So it's no use just going to your request and spitting this out.

[13:18] O agente precisa ter acesso a a tá OK o que que tá acontecendo, né?
  The agent needs to have access to, okay, what is happening, right?

[13:23] O que que tá dando de errado.
  What is going wrong.

[13:24] Então se eu abrir aqui o arquivo quality gate, é um arquivo com 581 linhas, né?
  So if I open the quality gate file here, it's a file with 581 lines, right?

[13:29] Basicamente, eu faço o importe aqui do meu arquivo JSON de baseline.
  Basically, I import my JSON baseline file here.

[13:32] Então, se eu for lá no meu arquivo de baseline, baseline.jonj, aqui eu vou ter o baseline que eu te comentei, tá?
  So, if I go to my baseline file, baseline.jonj, here I will have the baseline I told you about, okay?

[13:39] Aí eu defino um arquivo de métricas, né? O matrixsumary.jjonj.
  Then I define a metrics file, right? The matrixsummary.json.

[13:44] Eu rodo um coletor de métricas e depois eu tenho um script que vai comparar as métricas com o meu baseline.
  I run a metrics collector and then I have a script that will compare the metrics with my baseline.

[13:52] Isso vai me dar as falhas e eu escrevo o MarkD, um sumário em MarkD com as métricas, com baseline e com as falhas.
  This will give me the failures and I write the MarkD, a summary in MarkD with the metrics, with the baseline, and with the failures.

[13:59] Para coletar as métricas, eu pego os arquivos, eu leio o o coverage, leio o resultado do S link do duplicações.
  To collect the metrics, I get the files, I read the coverage, I read the result of the S link of duplications.

[14:06] Então, se tu quiser ver as duplicações, por exemplo, duplication table, então, collectrix, cadê aqui?
  So, if you want to see the duplications, for example, duplication table, then, collectrix, where is it here?

[14:14] Function collect matrix. E
  Function collect matrix. And

[14:17] aqui eu tenho collect collect duplication matrix.
  Here I have collect collect duplication matrix.

[14:19] Para fazer um script com uma função dessa, cara, tu pode usar qualquer biblioteca.
  To make a script with a function like this, man, you can use any library.

[14:23] Aí tem a JSCPD, que basicamente verifica quantos códigos tem duplicado no teu projeto.
  Then there's JSCPD, which basically checks how many duplicated codes there are in your project.

[14:29] Então aqui basicamente eu tenho os argumentos do comando do JS DSPD que vai rodar o comando, então, e vai pegar o output.
  So here I basically have the arguments of the JS DSPD command that will run the command, and it will get the output.

[14:38] Desse output eu vou construir o meu sumário, tá?
  From this output, I will build my summary, okay?

[14:39] Então, tudo isso aqui que eu coleto de métricas tem biblioteca para isso.
  So, all this that I collect from metrics has libraries for it.

[14:44] Não é nada excepcional que eu tô fazendo.
  It's nothing exceptional that I'm doing.

[14:45] Eu só tô colando um monte de ferramentas e chamando isso de quality gates.
  I'm just putting together a bunch of tools and calling it quality gates.

[14:49] Bom, se a gente fosse voltar aqui pra definição de qualidade de código pelo Google, pela resultado da busca no Google, né, a gente diria que um projeto tem que ser de boa manutenção.
  Well, if we were to go back here to the definition of code quality by Google, by the search result on Google, right, we would say that a project must be maintainable.

[14:58] E eu acho que isso aqui é uma coisa que tem mudado bastante, né, na nossa área.
  And I think this is something that has changed a lot, right, in our field.

[15:02] O que que significa um projeto de boa manutenção?
  What does a maintainable project mean?

[15:06] A gente sempre falou que o melhor código é aquele código que um ser humano entende, né?
  We always said that the best code is code that a human being understands, right?

[15:11] Tu tem que escrever o teu código para que tu daqui a um ano entenda o que tu escreveu.
  You have to write your code so that a year from now you understand what you wrote.

[15:14] E como é que tu faz isso?
  And how do you do that?

[15:16] Através do readability, né?
  Through readability, right?

[15:19] Hoje em dia a gente tem que pensar nisso aqui para agentes.
  Nowadays we have to think about this here for agents.

[15:22] Então, uma das coisas até uns erros que eu vejo a galera cometendo muitas vezes é é remover comentários que os agentes deixam no código.
  So, one of the things, even some mistakes I see people making often is removing comments that agents leave in the code.

[15:30] Eu acho que comentário perto do código explicando o que que aquele trecho tá fazendo, por que aquilo tá sendo feito daquela forma.
  I think comments near the code explaining what that snippet is doing, why it's being done that way.

[15:34] é muito melhor do que tu ter um MD gigante, porque hoje em dia os AIness eles já vão buscar com grap ou com qualquer que seja a ferramenta que eles estão usando, eles vão buscar o arquivo específico que eles precisam alterar e, cara, eles poder ler aquele arquivo, ler o código e ler os comentários, que são coisas que não estão no código sendo ditas, né?
  is much better than having a giant MD, because nowadays AI agents will already search with grep or whatever tool they are using, they will search for the specific file they need to change and, man, they can read that file, read the code and read the comments, which are things that are not being said in the code, right?

[15:53] Aquilo ajuda muito mais e aquilo torna o código muito mais legível, né?
  That helps a lot more and that makes the code much more readable, right?

[15:58] Eu sempre fui a favor de tu não escrever comentários no código porque o teu código é a tua própria documentação, mas agora no mundo de agentes de a eu tô voltando um pouco atrás nisso aí.
  I was always in favor of you not writing comments in the code because your code is your own documentation, but now in the world of AI agents I'm backtracking a bit on that.

[16:10] Tu tem o reliability, né?
  You have reliability, right?

[16:12] O quanto que uma função ela ela faz o que ela é é prevista para fazer, né?
  How much a function does what it's expected to do, right?

[16:15] Com mínimos bugs e tudo mais, o quanto
  With minimal bugs and all that, how much

[16:21] que ela é testável e o quanto que é eficiente.
  that it is testable and how efficient it is.

[16:25] Aí tem formas de medir isso, né?
  Then there are ways to measure this, right?

[16:27] Uma das formas que muita gente usa é o Sonar Cube.
  One of the ways many people use is Sonar Cube.

[16:29] Então isso que eu tô te fazendo, falando aqui, te mostrando, cara, é o mínimo do mínimo, é um scriptinho, tá ligado?
  So this that I'm doing, saying here, showing you, man, is the minimum of the minimum, it's a little script, you know?

[16:34] Mas tu poderia usar algo como Son Cube, por exemplo, para rodar no teu projeto.
  But you could use something like Son Cube, for example, to run on your project.

[16:38] O próprio GitHub Code Quality tem também algumas métricas de complexidade, duplicação e coverage.
  GitHub Code Quality itself also has some metrics for complexity, duplication, and coverage.

[16:42] Aí tu tem code reviews, né?
  Then you have code reviews, right?

[16:45] Tu pode pedir a para uma IA revisar ou para um mano e por aí vai.
  You can ask an AI to review it or a colleague, and so on.

[16:49] Então isso tudo vai reduzir débito técnico e adada eada.
  So all of this will reduce technical debt and blah blah blah.

[16:52] Eu sei que isso é bonito, mas ao meu ver não é sobre isso que até eu tô falando.
  I know this is nice, but in my view, it's not what I'm even talking about.

[16:57] Eu tô falando porque eu acabei virando o gargalo da Iá, tá ligado?
  I'm talking about it because I ended up becoming the bottleneck for the AI, you know?

[17:01] Eu fazer o babysit das coisas do request básicas é o gargalo.
  Me doing the babysitting of basic request things is the bottleneck.

[17:04] Eu não consigo entregar quatro tarefas ao mesmo tempo se eu precisar ler 10.000 linhas de código por dia.
  I can't deliver four tasks at the same time if I need to read 10,000 lines of code per day.

[17:10] Então eu eu tenho que começar a me blindar aos meus próprios erros como revisor de código.
  So I have to start shielding myself from my own errors as a code reviewer.

[17:16] E é uma coisa louca de se pensar, né?
  And it's a crazy thing to think about, right?

[17:19] Aá tá escrevendo o código, a IA tá revisando o código.
  The AI is writing the code, the AI is reviewing the code.

[17:21] Então o que que a gente faz?
  So what do we do?

[17:23] A gente tem que fazer a parte da engenharia, né?
  We have to do the engineering part, right?

[17:25] A gente tem que fazer a parte do controle de qualidade e entender que como qualquer controle de qualidade o humano é falho.
  We have to do the quality control part and understand that like any quality control, humans are fallible.

[17:31] Então tu tem que colocar catracas, tem que colocar portões para barrar automaticamente quando a qualidade cair.
  So you have to put in turnstiles, you have to put in gates to automatically block when quality drops.

[17:38] Beleza?
  Okay?

[17:41] Ainda essa semana eu vou falar um pouco mais sobre como eu tô usando inteligência artificial.
  Still this week I will talk a little more about how I am using artificial intelligence.

[17:43] Então, já vai se hidratando aí, deixando o teu like, o comentário e eu te vejo no próximo vídeo.
  So, go hydrate yourself there, leaving your like, your comment, and I'll see you in the next video.
