Ensure strict real-time parity between ERP/POS price masters and Electronic Shelf Label (ESL) fleets (SES-imagotag, ZKONG, Pricer, Hanshow, SOLUM) via bounded delta streams, monotonic idempotency tokens, and Sub-GHz RF battery preservation models.
Activate this skill when:
Do NOT use this skill when:
$$\mathbf{Price\ Master\ (ERP/POS)} \xrightarrow{\text{Extract}} \mathbf{Transform\ Middleware} \xrightarrow{\text{API/Message}} \mathbf{ESL\ Server} \xrightarrow{\text{Sub-GHz/2.4GHz}} \mathbf{Base\ Station\ (AP)} \xrightarrow{\text{RF\ Packet}} \mathbf{Physical\ Tag}$$
trace_id recording timestamps and status codes across all five layers. A "200 OK" from the ESL central server API is NEVER treated as proof that the physical shelf display has updated.$$\text{RowHash} = \text{SHA256}(\text{SKU} + \text{BasePrice} + \text{PromoPrice} + \text{Currency} + \text{UnitOfMeasure} + \text{Barcode} + \text{TemplateID})$$
idempotency_key and a monotonically increasing version_timestamp (ISO 8601 UTC).| Anti-Pattern | Manifestation in Code/Workflow | Mandatory Production Counter-Rule |
|---|---|---|
| Scheduled Full Catalog Floods | Blasting 60,000 tags every night at midnight. | Stream strict deltas using SHA256 content watermarks. |
| Ghost Price Blindness | Assuming API 200 OK means the customer sees the new price. | Track gateway ACK packet receipts (status: ACK_CONFIRMED). |
| Non-Idempotent Retries | Retrying failed HTTP calls without idempotency keys. | Attach UUIDv5(sku, store_id, price_timestamp) to all mutations. |
| Timezone Ambiguity | Pushing promo prices without UTC/local time offsets. | Enforce ISO 8601 UTC timestamps with explicit store local offsets. |
| Gateway RF Flooding | Blasting 5,000 updates/second to a single RF base station. | Enforce leaky-bucket queue throttling ($\le 150\text{ tags/min/AP}$). |
| Silent Canvas Overflow | Pushing a 6-digit price into a 4-digit template field ($1499 becomes $14). | Validate text bounds and template layout dimensions before enqueueing. |
| Destructive Rollback Omission | Deploying flash sales without pre-computing revert state. | Cache previous active state to enable 1-click atomic rollback. |
| Orphan Tag Neglect | Leaving decommissioned tags in the active database. | Reconcile missing heartbeat tags after 72 hours; flag as ORPHAN. |
| Mid-Day Peak Syncing | Pushing massive price shifts during peak Saturday shopping hours. | Schedule bulk promotions before store opening or during off-peak hours. |
| Unshielded Write Broadcasts | Executing write scripts without an audit dry-run. | Enforce dry-run simulation mode prior to initiating physical RF broadcasts. |
import hashlib
import time
from typing import Dict, List, Optional
def compute_sku_hash(item: dict) -> str:
import json
payload = json.dumps({key: item[key] for key in
("sku", "price", "promo_price", "currency", "uom", "barcode", "template", "tag_id")},
sort_keys=True, separators=(",", ":"), allow_nan=False)
return hashlib.sha256(payload.encode('utf-8')).hexdigest()
class ESLDeltaSyncPipeline:
def __init__(self, watermark_db: dict, max_rate_per_min: int = 150):
if max_rate_per_min <= 0:
raise ValueError("Rate must be positive")
self.watermark_db = watermark_db # SKU -> {version: int, content_hash: str}
self.max_rate_per_min = max_rate_per_min
self.last_tx_time = 0.0
def process_catalog_stream(self, incoming_feed: List[dict], dry_run: bool = True) -> dict:
# Single-worker example: production needs a transactional per-SKU compare-and-set
# and a durable outbox; never run concurrent writers against this plain dict.
pending = {}
for item in incoming_feed:
version = item['version']
if type(version) is not int or version < 1:
raise ValueError("Positive monotonic integer version required")
sku = item['sku']
previous = pending.get(sku) or self.watermark_db.get(sku)
if previous and version == previous['version'] and compute_sku_hash(item) != previous['content_hash']:
raise ValueError("Conflicting payload for the same version")
if previous and version <= previous['version']:
continue
current_hash = compute_sku_hash(item)
pending[sku] = {'version': version, 'content_hash': current_hash, 'item': item}
if dry_run:
return {'mode': 'DRY_RUN', 'accepted_versions': len(pending)}
sent = 0
for sku, candidate in pending.items():
previous = self.watermark_db.get(sku)
if previous and candidate['version'] <= previous['version']:
continue
if not previous or candidate['content_hash'] != previous['content_hash']:
delay = 60.0 / self.max_rate_per_min - (time.monotonic() - self.last_tx_time)
if delay > 0:
time.sleep(delay)
job = {'sku': sku, 'tag_id': candidate['item']['tag_id'],
'price_data': candidate['item'],
'idempotency_key': hashlib.sha256(f"{sku}:{candidate['version']}:{candidate['content_hash']}".encode()).hexdigest()}
# Adapter must fail on missing physical ACK; API acceptance alone is insufficient.
if transmit_to_esl_gateway(job) is not True:
raise RuntimeError("Physical acknowledgement not confirmed; watermark unchanged")
self.last_tx_time = time.monotonic()
sent += 1
# Advance the version even when content is unchanged, preventing older replays.
self.watermark_db[sku] = {'version': candidate['version'], 'content_hash': candidate['content_hash']}
return {'mode': 'LIVE_COMMITTED', 'sent_deltas': sent}
{
"audit_timestamp": "2026-09-22T10:15:00Z",
"store_id": "STORE-0842",
"total_audited_skus": 14200,
"in_sync": 14188,
"ghost_pricing_discrepancies": [
{
"sku": "SKU-99014",
"barcode": "4006381333931",
"tag_mac": "00:1A:7D:DA:71:04",
"aisle": "Aisle 4 - Cereals",
"erp_master_price": 4.99,
"esl_server_price": 4.99,
"tag_ack_price": 3.99,
"divergence_layer": "RF Base Station (Packet dropped due to antenna shadow)",
"last_ack_timestamp": "2026-09-20T04:12:00Z",
"recommended_action": "Force targeted re-transmit on Channel 11"
}
]
}
def estimate_tag_battery_years(
updates_per_day: float,
ambient_temp_celsius: float = 21.0,
battery_mah: float = 1200.0,
uAh_per_refresh: float = 18.0,
standby_uA: float = 1.2
) -> float:
import math
values = (updates_per_day, ambient_temp_celsius, battery_mah, uAh_per_refresh, standby_uA)
if any(isinstance(v, bool) or not isinstance(v, (int, float)) or not math.isfinite(v) for v in values):
raise ValueError("Finite numeric battery assumptions required")
if updates_per_day < 0 or battery_mah <= 0 or uAh_per_refresh <= 0 or standby_uA < 0:
raise ValueError("Nonnegative usage and positive capacity/refresh cost required")
# Temperature de-rating factor (freezer sections de-rate capacity significantly)
temp_factor = 0.65 if ambient_temp_celsius < 0.0 else (0.85 if ambient_temp_celsius < 10.0 else 1.0)
effective_mah = battery_mah * 0.85 * temp_factor # 85% usable chemistry margin
daily_drain_uAh = (updates_per_day * uAh_per_refresh) + (standby_uA * 24.0)
daily_drain_mAh = daily_drain_uAh / 1000.0
if daily_drain_mAh == 0:
raise ValueError("A positive drain estimate is required")
lifespan_days = effective_mah / daily_drain_mAh
return round(lifespan_days / 365.25, 2)
Before finalizing any ESL integration, sync workflow, or audit output:
"To update the electronic labels, run a Python script that loops over all 50,000 products in your database and POSTs them to the ZKONG API every hour. If prices are wrong on the shelves, just run the script again."
Problems: Fatal catalog flooding, battery destruction, zero delta tracking, zero idempotency, ignores gateway rate-limiting, blind to physical tag ACK status.
1. Execute read-only audit comparing ERP pricing against ESL gateway ACK states; identify 12 divergent SKUs.
2. Compute SHA256 delta hashes for all modified SKUs since watermark2026-09-22T08:00:00Z.
3. Generate idempotent mutation payloads withUUIDv5tokens and monotonic timestamp versioning.
4. Verify tag layout: Confirm that promo prices fit within the 2.9-inch 3-color e-paper template without numeric truncation.
5. Queue rate-limited dispatch at 120 tags/min on Base Station 03, logging transmission to physical tag ACK confirmation.