feat: TECHNICAL_PLACEHOLDER (NCM 00000000) is replaceable by the product enrichment; real values preserved; Agent 1.3.4

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
gti
2026-09-26 10:50:12 -03:00
co-authored by Claude Sonnet 5
parent 5281c1d79b
commit c68c6c67ed
26 changed files with 290 additions and 31 deletions
+10
View File
@@ -107,3 +107,13 @@ Production KB starts empty (0 products, head 0028 before deploy). The lab databa
### Measured (local data only; `docs/runs/enrichment_history_analysis.json`)
See the V2 report in the mission summary; key findings: cross-client NCM agreement is poor (a candidate taken from the other clients matches the held-out client's own NCM only 62 % of the time, and only 42 % even when >= 2 clients corroborate it), which is exactly why client data can never verify an NCM on its own.
## TECHNICAL_PLACEHOLDER (1.3.4)
The SGV refuses to save a product without NCM, so operators type a filler. An empty-only rule therefore never fires for that product. Contract:
- Per-field allowlist `PRODUCT_ENRICHMENT_PLACEHOLDERS = {CLASSIFICACAO_FISCAL: {"00000000"}}` (dots ignored: `0000.00.00` is the same filler). `0`, `99999999`, `SEM NCM`... are NOT placeholders (no evidence of SGV behaviour); nothing else is ever overwritten.
- A placeholder is "not classified yet", never `HUMAN_OVERRIDDEN`. A real NCM (even a wrong one) is preserved, whatever the KB says. cClassTrib typed by the operator is never touched (RTC gates own it).
- Where it is decided: the Hub treats a placeholder like an empty field when it builds the per-field decisions (`resolver._empty`, audit note `technical_placeholder`); the Agent must ALSO accept it in the typed write (`write_field`: compare-and-swap `UPDATE ... WHERE TRIM(f)=<exact value just read>`), so this needs Agent >= 1.3.4.
Both tables are identical (parity test). The audit records `old = 00000000`.
- Scope reminders: products created while the function was DISABLED / WAITING stay history (re-baseline); REPROCESS_ALL/SYNC do not push products through the enrichment (only NEW products after the baseline do);
a product WITHOUT EAN is resolved by name only from a unique VERIFIED_KB match.
+22
View File
@@ -0,0 +1,22 @@
{
"copy_only": true,
"checks": {
"PLACEHOLDER_PRODUCT_DETECTED_DRY_RUN": true,
"DRY_RUN_ZERO_WRITES": true,
"DRY_RUN_DECISION_GENERATED_FOR_NCM": true,
"ENABLED_PLACEHOLDER_REPLACED": true,
"CEST_IPI_ONLY_WHEN_SAFE": true,
"CCLASSTRIB_OPERATOR_VALUE_UNTOUCHED": true,
"AUDIT_RECORDS_THE_REPLACED_PLACEHOLDER": true,
"EXISTING_REAL_VALUE_PRESERVED": true,
"UNLISTED_FILLER_NOT_OVERWRITTEN": true,
"SECOND_RUN_WRITES_0": true
},
"ALL_PASS": true,
"PH002": [
"22021000",
"0300700",
0.0,
"200009"
]
}