feat: aceitar as fases reais do MixGestao

X-Mix-Fase passa a aceitar CORRECAO_1..9, ANALISE_CORRECAO_1..9,
LOG_CLASSIFICACAO e LOG_NARRACAO; ate 12 chamadas por pergunta.
Teste 56/56. Doc com a configuracao e o comportamento do exe.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-25 09:27:16 -03:00
co-authored by Claude Opus 5.5
parent 22c1e121fc
commit eb6066f182
3 changed files with 50 additions and 21 deletions
+13
View File
@@ -385,6 +385,19 @@ def main():
st, r, _ = chat(tok3)
checar(st == 403 and r.get("erro") == "cliente_inativo", "cliente inativo: 403")
print("fases reais do MixGestao")
antes = saldo_db(cur)[1]
p3 = str(uuid.uuid4())
sts = [chat(tok, p3, f)[0] for f in ("PLANO", "CORRECAO_1", "CORRECAO_2")]
checar(sts == [200, 200, 200] and saldo_db(cur)[1] == antes + 1,
"PLANO + 2 correcoes: 1 pergunta debitada (%r)" % sts)
p4 = str(uuid.uuid4())
sts = [chat(tok, p4, f)[0] for f in ("LOG_CLASSIFICACAO", "LOG_NARRACAO")]
checar(sts == [200, 200] and saldo_db(cur)[1] == antes + 2,
"Log: classificacao + narracao = 1 pergunta (%r)" % sts)
st, r, _ = chat(tok, fase="CORRECAO_10")
checar(st == 400 and r.get("erro") == "fase_invalida", "CORRECAO_10 fora do padrao: 400")
print("consultas do admin e LGPD")
st, r = admin("consumo", cnpj=CNPJ, mes=MES)
checar(st == 200 and len(r.get("chamadas", [])) >= 8, "consumo do mes listado")