Files
GTI_GERENCIADOR_FISCAL/fiscal/docs/AUTONOMOUS_FISCAL_COMPLETION_V1.md
T
gti d21a9d1140 Add 'fiscal/' from commit '102ba84500dbd9655a0471288c3e278652593ca9'
git-subtree-dir: fiscal
git-subtree-mainline: d95165fc8f
git-subtree-split: 102ba84500
2026-09-29 14:43:23 -03:00

5.7 KiB

Autonomous Fiscal Completion V1

Mission Result

STATUS=COMPLETED_OFFLINE_WITH_MEASURED_RESIDUALS

This mission ran without Z.ai, OpenAI, external provider queries, human-answer inference, or Firebird writes. Discovery used read-only transactions on the five explicitly allowlisted local copies.

Consolidated Report

DATABASES=5
TOTAL_PRODUCTS=35066

REQUIREDNESS_FIELDS=23
REQUIREDNESS_CONTEXTS=10

INBOUND_TABLES_DISCOVERED=1690 (schema map; external table row counts recorded as unavailable)
INBOUND_ITEMS_ANALYZED=118519
XML_DOCUMENTS_AVAILABLE=true (BLOB/XML-capable tables detected; payloads not exported)

ORIGIN_PENDING_BEFORE=35056
ORIGIN_RESOLVED_FROM_INBOUND=0
ORIGIN_CONFLICTS=0
ORIGIN_PENDING_AFTER=35056

PRODUCT_ROLE_PENDING_BEFORE=43
PRODUCT_ROLE_RESOLVED_DETERMINISTICALLY=0 (new mission resolutions)
PRODUCT_ROLE_PENDING_AFTER=43

ST_PENDING_BEFORE=86
ST_RESOLVED_FROM_INBOUND=0
ST_PENDING_AFTER=86

PIS_COFINS_PENDING_BEFORE=3 company profiles / product rules unavailable
PIS_COFINS_PENDING_AFTER=3 company profiles / product rules unavailable

IPI_CLASSIFICATION=OPTIONAL_REFERENCE for observed non-contributing companies; numeric TIPI remains reference data unless contribution/use is proven
IPI_HUMAN_DECISION_REQUIRED=false for the reference-only classification; no STORE_IPI_PROFILE applied

KB_PRODUCTS=30801
KB_CROSS_TENANT_REUSE=251 valid GTIN cross-tenant matches observed; tenant policy was not copied

EXTERNAL_PRODUCT_PROVIDERS_EVALUATED=5 candidate categories
RECOMMENDED_EXTERNAL_PROVIDER=authorization_required (licensed GS1/commercial bulk source)
RECOMMENDED_PROVIDER_COST=NOT_VERIFIED
EXPECTED_PROVIDER_COVERAGE=NOT_VERIFIED
EXPECTED_PROVIDER_AI_REDUCTION=NOT_VERIFIED

AI_BUDGET_PER_RUN=0.54 USD default guard
AI_BUDGET_DAILY=1.00 USD default guard
AI_BUDGET_MONTHLY=10.00 USD default guard
AI_USAGE_LEDGER_READY=true (model and migration 0015; no usage recorded)

TOTAL_REQUIRED_FIELD_INSTANCES=35283
REQUIRED_VALID=35066
REQUIRED_MISSING=217

FISCALLY_COMPLETE_PRODUCTS=34872
FISCALLY_INCOMPLETE_PRODUCTS=194
AUTONOMOUS_RATE=0.9944675754 (matrix-measured; human context remains incomplete)

AI_READY_BEFORE=511
AI_READY_AFTER=511

MANUAL_COMPANY_DECISIONS_REMAINING=19
MANUAL_GROUP_DECISIONS_REMAINING=738
MANUAL_PRODUCT_FACTS_REMAINING=46036

NEW_DETERMINISTIC_WRITES=0
NEW_DETERMINISTIC_WRITES_VERIFIED=0
SECOND_PASS_WRITES=0

FULL_TESTS=tests 324 passed, 1 skipped; central/tests 219 passed, 1 warning
FIREBIRD_AI_WRITES=0
AI_WRITE_ALLOWED=false

LOCAL_PRODUCT_COMPLETE=MEASURED_FOR_REQUIREDNESS_MATRIX; HUMAN_CONTEXT_INCOMPLETE
READY_FOR_ZAI_GOLD_EVAL=true

What The ERP Provided

The read-only evidence map discovered 5 databases, 1,680 user tables/relations, foreign-key candidates, fiscal item/header/supplier/key categories, and XML/BLOB-capable structures. Populated inbound item evidence was concentrated in C000088 and SINTEGRA_ENTRADA_ITEM; 118,519 inbound rows were analyzed. Supplier observations produced 284 strong non-origin aggregates and 406 conflicts in MMMODAS, but no inbound origin field was available in the analyzed item shape. Consequently origin remained ORIGIN_NEEDS_EVIDENCE.

C000062 and C000032 contain substantial historical fiscal activity, but their observed CFOP distributions and existing analysis do not prove that they are inbound supplier evidence. They were not promoted as such.

Requiredness And Completeness

The evaluator distinguishes required, conditional, reference-only, not applicable, and ERP-not-used. Empty IPI, IAT, IPPT, PIS/COFINS, and other conditional/reference fields are not automatically counted as incomplete when their trigger is not proven. The 194 incomplete products are measured required field gaps under the current known sale/company context, primarily CFOP, CSOSN, ICMS treatment, and ICMS rate. This is not a claim that every company or product context is complete.

Writes And Safety

No new deterministic candidate passed the complete evidence/provenance and write-guard contract without human context or unresolved conflict. Therefore the correct result was zero writes, not forced completion. The write audit records NEW_DETERMINISTIC_WRITES=0, NEW_DETERMINISTIC_WRITES_VERIFIED=0, and SECOND_PASS_WRITES=0.

Current NCM_CONFLICT=90 rows and all 73 historical INSUFFICIENT_EVIDENCE conflicts were preserved. No origin default, ST withholding, company decision, group decision, or product fact was invented.

External Data And Future AI

The provider adapter accepts GTIN records with provider version, retrieval time, raw hash, normalized data, and cache/redistribution flags. The central schema now has the ai_usage_ledger and external_product_cache tables via migration 0015. Budget checks reserve atomically before a future provider invocation and return AI_BUDGET_EXHAUSTED without sending a request. Identical future AI inputs have a stable cache key; no provider or AI call occurred in this mission.

Remaining Gaps

  • Human COMPANY/GROUP/PRODUCT facts remain unresolved.
  • Origin has no sufficiently strong inbound evidence for global promotion.
  • ST withholding is not proven merely by ST subject/CEST evidence.
  • PIS/COFINS NCM-linked Tabela 4.3.x rules are still unavailable locally.
  • External provider price, license, and coverage require operator authorization and source contract review.
  • The real Z.ai GOLD evaluation remains blocked by EXTERNAL_AI_CREDENTIAL_OR_BALANCE.

Verdict

VERDICT=MAXIMUM_MEASURED_OFFLINE_COMPLETION_WITHOUT_UNSAFE_INFERENCE

The system now has the requiredness contract, read-only inbound evidence map, conservative evidence aggregation, origin/role/ST/entry-scope gates, provider cache boundary, central budget schema, idempotency key, and measured autonomy artifacts. Remaining decisions are genuine evidence or authorization gaps.