Pular para o conteúdo
EN · PT

Gate: rule-fulfilled

Each rule of this spec is marked in the code by a comment carrying its code (// ABCDX-B01: …).

Propriedade Valor
Julgamento uma IA ou uma pessoa responde a pergunta abaixo, via anchors judge
Confronta spec
Bloqueante por padrão — projeto novo sim
Bloqueante por padrão — projeto existente não — informa
Review seus alvos ficam marcados para revisar (anchors review)

Each rule of this spec is marked in the code by a comment carrying its code (// ABCDX-B01: …). Read the rule and the snippet it marks and answer: does the snippet DO what the rule describes? Fail it when the comment sits on code that does something else, when the rule describes a case the snippet does not handle, or when the mark is in a generic place (top of the file, an import) instead of the snippet that decides. The question is about what the code RUNS, not about what the comment claims. When failing it, PROPOSE the fix as a patch. BEFORE ANSWERING, check whether this unit declares @TBD for the piece this question asks about (@TBD: code, @TBD: code,test, …). If it does, the code does NOT exist yet by a recorded decision, and there is nothing to confront: answer waived, naming the absence (“the spec declares @TBD for this piece and it does not exist in the repository”). Do NOT answer pass — pass is a statement ABOUT the code, and without the code it states what nobody verified; the stamp stays in the map looking like real verification. Also check that the @TBD is TRUE: if the piece already exists in the repository, the marker is stale, the judgment is due as usual, and the stale declaration is a finding — while it stays there, every gate that reads it waives what it should demand.

gates:
- name: rule-fulfilled
on: [spec]
measures: judgment

Pergunta ao modelo se o trecho marcado no código realmente realiza o que a regra descreve.

Em termos simples: este gate garante que o seu software não cometa erros por descuido ou falta de sincronização. Se você ou uma inteligência artificial alterar um arquivo coberto por este gate, ele inspeciona o trabalho imediatamente.


Regexes e linters não sabem se uma função faz o que promete semânticamente. A IA avalia a correspondência real de intenção.

Sem este gate ativo, esse tipo de defeito passa despercebido pelos testes comuns e só estoura em produção ou durante refatorações dolorosas semanas depois.


Avalia o prompt semântico comparando o texto da regra na spec com o código entre os marcadores no arquivo fonte.

  • ✓ Pass (Aprovado): Veredito pass gravado com anchors judge.
  • ✗ Fail (Reprovado): Veredito fail acusando que o código diverge da regra.
  • ~ Indeterminado/Pending: Nenhum veredito emitido ainda.
  • Skip (Dispensado): Regra marcada como pendente de implementação (@TBD: code) recebe veredito dispensado.

Para ativar este gate no seu projeto, adicione o bloco abaixo na seção gates: do seu anchors.yaml:

gates:
- name: regra-cumprida
on: [spec]
ask: "o trecho marcado REALIZA o que a regra descreve?"
blocking: false

  • Quando ativar: Informativo; avalie e registre com anchors judge em revisões de PR.
  • Fase de execução: Configure em when: [pre-commit, ci] para verificações rápidas, ou when: [pre-push, ci] para gates que rodam ferramentas mais pesadas.
  • Transição de maturidade: Comece com blocking: false para avaliar o estado atual do repositório com anchors check. Quando zerar as ocorrências, altere para blocking: true.

Se o anchors check acusar falha (✗) neste gate:

  1. Ajuste o código para cumprir a regra da spec e grave o novo laudo com anchors judge.
  2. Reexecute a verificação no terminal:
    Terminal window
    anchors check
  3. Se o gate suportar correção automática, você pode tentar o comando:
    Terminal window
    anchors check --fix