docs: Missão 5 addendum (Z.1-Z.6) - correct labels, add tables, adopt VERSIONING.md

Z.1: KB conflict counts were reported as ROW counts (kb_knowledge rows), not
DISTINCT GTIN counts - a single conflicted product with 2 competing NCM
candidates produces 2 rows, doubling the apparent conflict count. Real
number, measured directly in production: 262 distinct GTINs in CONFLICT
(all under knowledge_key=ncm), matching the ~264 baseline closely - no real
growth, just a row-vs-GTIN counting mismatch in the earlier report.

Z.3: corrected the Missão 4 claim that NFCE_ITENS was the "fonte encontrada"
for what PIS/COFINS was actually transmitted - that overstated certainty.
Relabeled PISCOFINS_FONTE_TRANSMITIDA = NÃO_CONCLUSIVO in
docs/PISCOFINS_TRANSMITTED_SOURCE_V1.md and both dossiê copies: a blank
NFCE_ITENS column is equally consistent with "nothing was transmitted" and
"the SGV transmitted a value in the XML but never wrote it back to that
column" - we cannot tell without the actual XML.

Z.4: docs/AUTOFILL_SAFE_3_CELULAS_V1.md - table of the 3 real AUTO_FILL_SAFE
cells (000801/000802 CFOP, 000697 IPPT) with proposed value, field_contract
rule and concrete evidence for each.

Z.5: docs/NCM_27_BLOCKED_PRODUCTS_V1.md now marks the 15 test/garbage-named
products as "produto de teste" in the kb.attest queue (still counted in
coverage, just lower priority); the 3 legacy + 5 out-of-table NCMs are
flagged for reclassification once the official NCM catalog (Fase 2 of this
mission) is loaded and approved.

Z.6: CLAUDE.md records independent Hub/Agent versioning (docs/VERSIONING.md)
as the adopted standard going forward.

No schema/migration change. No Firebird write anywhere.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
gti
2026-09-28 15:03:22 -03:00
co-authored by Claude Sonnet 5
parent 92e9c9a14e
commit 8f3dcaada9
6 changed files with 61 additions and 20 deletions
+9 -6
View File
@@ -71,14 +71,17 @@ dezembro/2022.
confirmação do "Tratamento padrão de ICMS" no card correspondente, e mesmo assim o motor consulta
o tratamento antes de propor o código (nunca aplica 102 cegamente).
## Atualização (Missão 4): onde exatamente está guardado o que foi transmitido
## Atualização (Missão 5): o que foi realmente transmitido é NÃO_CONCLUSIVO
Procuramos por XML/BLOB armazenado nos 5 bancos: **não existe** — o SGV só guarda o *caminho* do
arquivo XML no disco da máquina, nunca o conteúdo. A fonte real e mais próxima do que foi
transmitido são as próprias colunas de PIS/COFINS de `NFCE_ITENS` (CST, base, alíquota, valor por
item) — os mesmos valores que o SGV usa para montar o XML. Isso não muda a conclusão da pergunta
(a): mesmo sendo a fonte real, essas colunas confirmam que o cadastro do produto nunca é
consultado. Ver `docs/PISCOFINS_TRANSMITTED_SOURCE_V1.md`.
arquivo XML no disco da máquina, nunca o conteúdo. As colunas de PIS/COFINS de `NFCE_ITENS` (CST,
base, alíquota, valor por item) são a melhor evidência disponível no banco, mas **corrigimos aqui
uma afirmação forte demais da Missão 4**: essas colunas estão em branco para quase todos os itens,
e sem o XML de verdade não sabemos se "em branco" significa "nada foi transmitido" ou "o SGV
transmitiu um valor no XML mas nunca gravou de volta no banco". As duas explicações são compatíveis
com os mesmos dados — por isso a fonte do que foi *efetivamente* transmitido continua
**NÃO_CONCLUSIVO**. O que continua de pé, com certeza: o cadastro do produto nunca é consultado
(branco também). Ver `docs/PISCOFINS_TRANSMITTED_SOURCE_V1.md`.
## Como usar este dossiê