Files
GTI_GERENCIADOR_FISCAL/release/RELEASE_MANIFEST.json
T
gti 7e83d17533 feat: wire field_contract into product enrichment; auto-discover CRT/CONTRIBUINTE_IPI at heartbeat; targeted per-product ERP evidence
field_contract.resolve_product was only exercised by its own unit tests. /v1/products/resolve now calls it for every product whose NCM
resolves, merging CFOP/CST/CSOSN/PIS-COFINS/CST_IPI/SITUACAO_TRIBUTARIA/IAT/IPPT decisions alongside CLASSIFICACAO_FISCAL/CEST/IPI - reusing
the same engine, the same FiscalContextEntry table the blocker-resolution workflow already writes to, no duplicated rules.

Closes three real transport/discovery gaps found while wiring it in:
- Agent heartbeat never sent company_crt (env-var UF only) or company_contribuinte_ipi, so Installation.company_crt stayed permanently empty
  even though company_context.resolve() already proves both from C000004/EMISSOR for every coverage job. Resolved once, cached, retried only
  while unresolved. Migration 0032 adds Installation.company_contribuinte_ipi (NULL=unknown, never coerced to "N").
- The Agent's enrichment payload only ever reported 3 old fields (CLASSIFICACAO_FISCAL/CEST/IPI) as "current", so the Hub could never see the
  product's own CFOP/CST/CSOSN/... nor the classification columns (TIPO/PROD_COZINHA/PRODUTO_SERVICO/CODGRUPO) infer_role needs - separated
  into a read-only CURRENT_REPORT_FIELDS list, the write allowlist (PRODUCT_ENRICHMENT_WRITE_V1) untouched.
- Added a targeted, product_code-scoped evidence query (firebird_reader.read_product_evidence: recipes/composed/purchases/stock, indexed WHERE,
  never a full-table scan) so st_withheld/product_role can be proven for a single ad-hoc resolve, not only during a full sync job.

Verified read-only against the real database (D:\PROJETOS\GTISISTEMAS\Banco\GTI.FDB): CRT=1, CONTRIBUINTE_IPI=N, company_context.resolve()
reaches HIGH confidence; infer_role correctly resolved RESALE/OWN_PRODUCTION for 5/8 sample real products with zero operator questions.

1121 tests passed (tests + central/tests + agent/tests), 0 failed. Version 1.3.7 (single GTI_FISCAL_VERSION shared by Hub and Agent per
central/app/version.py's own design - never independently versioned).
2026-09-27 18:26:20 -03:00

93 lines
2.5 KiB
JSON

{
"artifact": "RELEASE_MANIFEST",
"GTI_FISCAL_VERSION": "1.3.7",
"generated_at": "2026-09-27T00:00:00+00:00",
"hub": {
"version": "1.3.7",
"api_compat": "1.0",
"engine_version": "0.3.0",
"decision_version": "mission-04c-ipi-ex-split"
},
"agent_version": "1.3.7",
"fiscal_engine": {
"ENGINE_VERSION": "0.3.0",
"DECISION_VERSION": "mission-04c-ipi-ex-split",
"DECISION_ENGINE_VERSION": "fiscal-decision-v1",
"PRODUCT_DEFAULTS_ENGINE_VERSION": "product-defaults-v1",
"ICMS_CONTEXT_ENGINE_VERSION": "icms-context-v1"
},
"migrations": {
"alembic_head_in_repo": "0032_contribuinte_ipi",
"applied_revision": "0032_contribuinte_ipi",
"applied_revision_source": "PENDING REAL DEPLOY - placeholder set equal to repo head for local test coherence; scripts/release_manifest.py must be re-run against the live post-deploy Hub to confirm the real applied_revision before this manifest is trusted",
"count": 32
},
"datasets_active": [
{
"kind": "ANP",
"sha256": "8271a80007548b01",
"record_count": 1031
},
{
"kind": "BA_ST_MVA",
"sha256": "e07e9085952bc256",
"record_count": 303
},
{
"kind": "CEST",
"sha256": "d7fb7e8da0ace051",
"record_count": 1051
},
{
"kind": "CFOP",
"sha256": "c95c91ed1644fdd1",
"record_count": 619
},
{
"kind": "FCP",
"sha256": "3079d088169003cf",
"record_count": 27
},
{
"kind": "NCM",
"sha256": "3abc0d2eb2501bbd",
"record_count": 15156
},
{
"kind": "NCM_UTRIB",
"sha256": "afc8bfc94c4f9575",
"record_count": 10516
},
{
"kind": "NFE_MOC_TABLES",
"sha256": "5eb4cf2010b10b0b",
"record_count": 96
},
{
"kind": "RTC_BIOFUEL_INDEX",
"sha256": "c49a011503657fc6",
"record_count": 23
},
{
"kind": "RTC_CBS_RATES",
"sha256": "33f17aa3322de841",
"record_count": 2
},
{
"kind": "RTC_CCLASSTRIB",
"sha256": "1448cb63a41bdb67",
"record_count": 164
},
{
"kind": "RTC_CCREDPRES",
"sha256": "65f2461398b6c361",
"record_count": 13
},
{
"kind": "TIPI_IPI",
"sha256": "d155f1baafb4039d",
"record_count": 11103
}
],
"note": "1.3.7: field_contract wired into /v1/products/resolve (post-NCM fiscal completion); Agent heartbeat now reports company_crt and company_contribuinte_ipi (auto-discovered from C000004, migration 0032); Agent now reports CURRENT_REPORT_FIELDS (fiscal-completion fields + classification columns) for role inference. Agent code changed: a new GTIFiscalAgent-Setup-1.3.7 installer is published this release."
}