Adds an ADMIN-only "Contexto Fiscal" section to the Agent detail page: confirm/alter/clear the fiscal decisions
field_contract.resolve_product genuinely cannot derive from the ERP alone (icms_treatment, pis_cofins_profile,
entry_scope). Persists through the existing FiscalContextEntry table (the same one blocker_resolution already
writes operator answers into) - no new persistence model, no opaque JSON box. CSRF + RBAC + audit reuse the exact
mechanism already proven for /agents/{id}/features. Confirming or clearing flags every already-enriched product on
the installation for re-evaluation.
The list was reduced from 5 candidates to 3 by auditing real production data (Agent 2, 2026-09-27/28):
icms_rate/credit_rate and rounding were dropped - both proven NOT_APPLICABLE / ALREADY_DERIVED for this CRT=1
company from real field_contract dry-runs, not assumption. Real evidence surfaced in the UI is a dated, one-time
manual read-only measurement (disclosed in the card copy itself as such) - the Hub has no direct Firebird access,
so this is not a live query; a follow-up should pipe it through the heartbeat the same way CRT/CONTRIBUINTE_IPI
were wired.
Also found, during the same audit, that this client's NFC-e emission ignores the product's cadastral PIS/COFINS
CST/rate fields entirely (verified on the 3 real products that DO have them populated - the emitted documents never
carry the cadastral value) - documented as a strong OPEN recommendation for a future field_contract change, not
applied here, since changing canonical fiscal semantics needs accountant sign-off, not just my own inference.
1129 tests passed (tests + central/tests + agent/tests), 0 failed. Version 1.3.9 (single GTI_FISCAL_VERSION). Hub
only - Agent unchanged, no new installer this release.
20 lines
462 B
TOML
20 lines
462 B
TOML
[project]
|
|
name = "gti-fiscal-hub"
|
|
version = "1.3.9"
|
|
requires-python = ">=3.10"
|
|
dependencies = [
|
|
"fastapi>=0.115,<1",
|
|
"jinja2>=3.1,<4",
|
|
"uvicorn[standard]>=0.30,<1",
|
|
"sqlalchemy>=2.0,<3",
|
|
"psycopg[binary]>=3.2,<4",
|
|
"alembic>=1.13,<2",
|
|
"httpx>=0.27,<1",
|
|
"openpyxl>=3.1,<4",
|
|
"pypdf>=4.0,<6",
|
|
"pdfplumber>=0.11,<1",
|
|
# SSO from GTI Gerenciador (central/app/sso.py): Ed25519-signed JWT assertions.
|
|
"pyjwt>=2.14,<3",
|
|
"cryptography>=50,<51",
|
|
]
|