feat: close final incomplete product analysis

This commit is contained in:
gti
2026-09-22 14:34:15 -03:00
parent e3ac68c70e
commit dca4847c21
5 changed files with 5799 additions and 0 deletions
+125
View File
@@ -0,0 +1,125 @@
{
"artifact": "FINAL_194_PRODUCT_CLOSURE_V1",
"status": "ANALYZED_WITHOUT_NEW_RESOLUTION",
"incomplete_before": 194,
"incomplete_after": 194,
"autonomous_rate_after": 0.9944675754,
"blockers_by_type": {
"MISSING_COMPANY_CONTEXT": 4,
"MISSING_ST_FACT": 57,
"OTHER_PROVEN_BLOCKER": 156
},
"missing_field_counts": {
"ALIQUOTA": 53,
"CFOP": 79,
"CSOSN": 27,
"SITUACAO_TRIBUTARIA": 58
},
"gtin": {
"with_valid_gtin": 45,
"without_gtin": 149,
"gtin_already_in_kb": 45,
"gtin_new": 0,
"gtin_conflict": 0
},
"kb_reuse": {
"fingerprint_hits": 194,
"gtin_exact_hits": 45,
"resolved_by_kb": 0,
"officially_validated_new_required_fields": 0,
"tenant_context_shared": 0,
"fingerprint_ncm_conflicts_not_promoted": 10
},
"priority": {
"resolvable_now_deterministically": 0,
"resolvable_with_external_product_data": 0,
"resolvable_with_ai_semantic": 0,
"human_fact_required": 4,
"data_conflict": 10,
"erp_limitation": 0
},
"ai_work_items": {
"total_before": 511,
"required_for_completeness": 0,
"optional_enrichment": 511,
"projected_cost_required_only": 0.0,
"required_products": 0,
"classification_rule": "all 511 current LLM items concern optional/reference enrichment under the current requiredness matrix"
},
"provider_impact": {
"candidates": [
{
"provider": "GS1/offical GTIN service",
"gtin_matchable": 45,
"expected_ncm_resolution": 0,
"expected_cest_resolution": 0,
"expected_other_fields": 0,
"estimated_queries": 0,
"estimated_cost": 0,
"reason": "all valid GTINs already have KB identity; no paid query needed"
},
{
"provider": "licensed commercial API",
"gtin_matchable": 45,
"expected_ncm_resolution": 0,
"expected_cest_resolution": 0,
"expected_other_fields": 0,
"estimated_queries": 0,
"estimated_cost": 0,
"reason": "not queried; KB-first policy"
},
{
"provider": "licensed commercial bulk dataset",
"gtin_matchable": 45,
"expected_ncm_resolution": 0,
"expected_cest_resolution": 0,
"expected_other_fields": 0,
"estimated_queries": 0,
"estimated_cost": "NOT_VERIFIED",
"reason": "license and coverage not verified"
}
],
"required_products": 0,
"projected_cost": 0.0,
"cost_per_incomplete_product_resolved": 0.0
},
"inbound": {
"resolved": 0,
"origin_resolved": 0,
"st_resolved": 0,
"official_source_resolved": 0
},
"writes": {
"new_writes": 0,
"new_writes_verified": 0,
"second_pass_writes": 0,
"firebird_writes": 0
},
"pis_cofins": {
"required_incomplete": 0,
"source_available": false,
"sgv_consumption_proven": false,
"missing_rule": "SPED Tabela 4.3.x NCM-linked determination tables"
},
"human_blockers": {
"company": 4,
"group": 0,
"product": 190
},
"can_deploy_without_ai": true,
"deployment_note": "Operationally the Agent can process complete products and leave explicitly blocked residuals; this report does not authorize deployment.",
"prevents_100_percent": {
"products": 194,
"required_field_instances": 217,
"by_field": {
"ALIQUOTA": 53,
"CFOP": 79,
"CSOSN": 27,
"SITUACAO_TRIBUTARIA": 58
},
"ncm_fingerprint_conflicts_outside_baseline": 10
},
"ai_write_allowed": false,
"external_api_calls": 0,
"firebird_writes": 0
}
+144
View File
@@ -0,0 +1,144 @@
# Final 194 Product Closure V1
## Result
```text
STATUS=ANALYZED_WITHOUT_NEW_RESOLUTION
INCOMPLETE_BEFORE=194
INCOMPLETE_AFTER=194
AUTONOMOUS_RATE_AFTER=99.4468%
```
The 194 products were inventoried individually from the five local databases
using read-only Firebird access. No AI, external provider, human inference, or
Firebird write was used.
## Blockers
Field blocker instances may overlap on the same product; product total remains
194 unique `(DATABASE, PRODUCT_CODE)` keys.
```text
CFOP=79
SITUACAO_TRIBUTARIA / ST_FACT=57
ALIQUOTA=53
CSOSN=27
MISSING_COMPANY_CONTEXT=4 field instances
OTHER_PROVEN_BLOCKER=156 field instances
```
No product was resolved deterministically because every missing field lacked a
proven replacement under the current company/product context and the existing
write contract. The 4 RINCAO cases with ambiguous company context remain
`MISSING_COMPANY_CONTEXT`.
## GTIN And KB
```text
WITH_VALID_GTIN=45
WITHOUT_GTIN=149
GTIN_ALREADY_IN_KB=45
GTIN_NEW=0
GTIN_CONFLICT=0
KB_FINGERPRINT_HITS=194
RESOLVED_BY_KB=0
```
All valid GTINs already had a KB identity, so no external provider query was
necessary. Fingerprint KB hits were used for comparison only. Tenant-specific
CFOP, CSOSN, CST, ST-withheld, and company policy were never shared.
Ten fingerprint matches had NCM differences between the current product and KB
observation. They remain data conflicts and were not promoted or majority-
resolved. This is additional conflict evidence, not a hidden resolution.
## AI Residual Reclassification
```text
AI_WORK_ITEMS_TOTAL_BEFORE=511
AI_REQUIRED_FOR_COMPLETENESS=0
AI_OPTIONAL_ENRICHMENT=511
AI_REQUIRED_PRODUCTS=0
PROJECTED_AI_COST_FOR_REQUIRED_ONLY=0
```
The current 511 items are `EX_TIPI`, `CEST`, `PRODUCT_ROLE`, and `INVALID_NCM`
semantic/reference work. Under the requiredness matrix they do not currently
prevent the 194 products from reaching the measured completeness state. They
remain useful optional enrichment and are not sent to a future model merely to
increase an unrelated work-item count.
## External Providers
```text
GTIN_EXTERNAL_PROVIDER_CANDIDATES=0
EXTERNAL_PROVIDER_REQUIRED_PRODUCTS=0
PROJECTED_PROVIDER_COST=0
COST_PER_INCOMPLETE_PRODUCT_RESOLVED=0
```
The existing provider evaluation remains authorization-only. A provider was
not queried because all 45 valid GTINs were already present in the KB and 149
products have no valid GTIN. Commercial coverage, price, and license remain
`NOT_VERIFIED`.
## PIS/COFINS
```text
PIS_COFINS_REQUIRED_INCOMPLETE=0
PIS_COFINS_SOURCE_STATUS=SOURCE_AVAILABLE=false; NCM-linked SPED Tabela 4.3.x rules missing
```
The missing PIS/COFINS source is regime-specific and cannot be replaced by an
artificial NCM table. The SGV consumption of those fields remains unproven for
this residual set.
## Origin, ST, And NCM
```text
RESOLVED_BY_INBOUND=0
RESOLVED_BY_OFFICIAL_SOURCE=0
RESOLVED_OTHER_DETERMINISTIC=0
ORIGIN_RESOLVED=0
ST_RESOLVED=0
```
The inbound evidence scan found supplier observations, but no direct origin
fact sufficient for these products. ST subject evidence was not treated as
proof that ST was already withheld. Invalid/conflicting NCM evidence remains
blocked and was not changed by majority.
## Writes And Go/No-Go
```text
NEW_WRITES=0
NEW_WRITES_VERIFIED=0
SECOND_PASS_WRITES=0
HUMAN_COMPANY_BLOCKERS=4
HUMAN_GROUP_BLOCKERS=0 additional blockers in this 194 set
HUMAN_PRODUCT_BLOCKERS=190
DATA_CONFLICT_BLOCKERS=10 outside baseline product incompleteness
ERP_LIMITATION_BLOCKERS=0
CAN_DEPLOY_WITHOUT_AI=true (operational assessment only; no deployment authorized)
```
The Agent can process the 34,872 complete products and leave these 194
explicitly blocked rather than corrupting fiscal data. Deployment itself remains
out of scope.
## What Prevents 100 Percent
- 194 products remain incomplete.
- 217 required-field instances are missing: 79 CFOP, 57 ST facts, 53 rates, and 27 CSOSN entries.
- 4 field instances lack company context.
- 10 fingerprint/NCM conflicts remain outside the baseline incomplete set.
- Human product/company facts are still required; no default was invented.
## Final Report
```text
FULL_TESTS=tests 324 passed, 1 skipped; central/tests 219 passed, 1 warning
FIREBIRD_AI_WRITES=0
AI_WRITE_ALLOWED=false
VERDICT=NO_SAFE_AUTOMATIC_RESOLUTION_REMAINED_FOR_THE_194_WITH_CURRENT_EVIDENCE
```
File diff suppressed because it is too large Load Diff