opencode-skills-collection 4.0.71 → 4.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +13 -1
- package/bundled-skills/agent-memory-discipline/SKILL.md +204 -0
- package/bundled-skills/agent-memory-discipline/references/entry-format.md +37 -0
- package/bundled-skills/antigravity-maintainer-batch-release/SKILL.md +2 -2
- package/bundled-skills/chatexport-need-miner/SKILL.md +196 -0
- package/bundled-skills/dali-short-address-commissioner/SKILL.md +185 -0
- package/bundled-skills/eol-resistor-calculator/SKILL.md +211 -0
- package/bundled-skills/esl-price-sync/SKILL.md +210 -0
- package/bundled-skills/jev-social/SKILL.md +5 -5
- package/bundled-skills/marlin-bed-leveling/SKILL.md +181 -0
- package/bundled-skills/noaa-radar-satellite-fetching/SKILL.md +253 -0
- package/bundled-skills/oneroster-csv-validator/SKILL.md +205 -0
- package/bundled-skills/telegram-mini-app/references/detailed-guide.md +26 -0
- package/bundled-skills/weather-data-lifecycle-management/SKILL.md +159 -0
- package/bundled-skills/weather-data-reproducibility/SKILL.md +292 -0
- package/bundled-skills/weather-model-run-discovery/SKILL.md +241 -0
- package/bundled-skills/weather-pipeline-performance-diagnosis/SKILL.md +184 -0
- package/package.json +1 -1
- package/skills_index.json +385 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dali-short-address-commissioner
|
|
3
|
+
description: "Commissions DALI and DALI-2 (IEC 62386) lighting buses: short-address assignment (0-63), 24-bit binary search collision resolution, groups, and DT8 color control. Trigger phrases: commission dali, dali short address, dali collision resolution, dali bus addressing, dali-2 setup."
|
|
4
|
+
category: architecture
|
|
5
|
+
risk: safe
|
|
6
|
+
source: community
|
|
7
|
+
source_repo: wwewtech/dali-short-address-commissioner
|
|
8
|
+
source_type: community
|
|
9
|
+
date_added: "2026-09-22"
|
|
10
|
+
author: wwewtech
|
|
11
|
+
tags: [dali, dali-2, lighting-control, iec-62386, building-automation, iot]
|
|
12
|
+
tools: [claude, cursor, gemini, windsurf]
|
|
13
|
+
license: "MIT"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# DALI Short-Address Commissioner: Deterministic IEC 62386 Bus Provisioning
|
|
17
|
+
|
|
18
|
+
Systematically discover, resolve address collisions, assign short addresses (0–63), program groups and scenes, configure DT8 color gear, and schedule emergency battery duration tests on DALI and DALI-2 networks per IEC 62386.
|
|
19
|
+
|
|
20
|
+
## When to Use This Skill
|
|
21
|
+
|
|
22
|
+
Activate this skill when:
|
|
23
|
+
- Bringing up, commissioning, or expanding DALI or DALI-2 lighting installations (KNX/DALI gateways, Tridonic, Philips Dynalite, Helvar, Osram, Lunatone).
|
|
24
|
+
- The user asks: "How do I commission this DALI bus?", "Fix duplicate DALI short addresses", "Assign DALI addresses without erasing existing fixtures", or "Program DALI groups and DT8 tunable white".
|
|
25
|
+
- Resolving address clash loops where multiple ballasts respond simultaneously to broadcast queries.
|
|
26
|
+
- Designing or scheduling DALI-2 Part 202 emergency lighting duration and function tests across staggered floor circuits.
|
|
27
|
+
|
|
28
|
+
Do NOT use this skill when:
|
|
29
|
+
- Commissioning DMX512/RDM stage lighting, 0–10V analog dimming, or proprietary wireless RF networks (Zigbee, Bluetooth Mesh, Casambi).
|
|
30
|
+
- Diagnosing dead ballasts or physical wiring faults before basic DALI bus voltage (12V–20.5V DC) and current limits (<= 250mA) are confirmed.
|
|
31
|
+
- Programming building-wide KNX logic (this skill covers the DALI protocol domain strictly).
|
|
32
|
+
|
|
33
|
+
## Core Mental Models & Non-Negotiable Rules
|
|
34
|
+
|
|
35
|
+
1. **The 64-Address Bus Capacity Law**:
|
|
36
|
+
- A single DALI subnet supports strictly **0 to 63 short addresses** (64 control gear units maximum).
|
|
37
|
+
- Groups are strictly bounded to **0 to 15** (16 groups).
|
|
38
|
+
- Scenes are strictly bounded to **0 to 15** (16 scenes).
|
|
39
|
+
- If an installation has 65+ ballasts, the physical bus MUST be segmented into multiple DALI subnets with separate line masters or gateways.
|
|
40
|
+
|
|
41
|
+
2. **The Double-Command 100ms Transmission Invariant**:
|
|
42
|
+
- Configuration and addressing commands (INITIALISE [cmd 258], RANDOMISE [259], SET SHORT ADDRESS [267], ENABLE WRITE [cmd 32], etc.) MUST be transmitted **twice within 100ms** to be executed by control gear.
|
|
43
|
+
- Sending an addressing command only once will result in silent ignored execution by all IEC 62386 compliant gear.
|
|
44
|
+
|
|
45
|
+
3. **The 15-Minute Hardware Commissioning Timer**:
|
|
46
|
+
- Transmitting `INITIALISE` (cmd 258) starts a mandatory 15-minute countdown timer inside every ballast's micro-controller.
|
|
47
|
+
- All discovery, random address binary searching, and short address assignment MUST complete within 15 minutes, or the bus must receive a periodic keep-alive `INITIALISE` refresh.
|
|
48
|
+
- Upon completion, the master MUST transmit `TERMINATE` (cmd 257) to lock operational memory and exit programming state.
|
|
49
|
+
|
|
50
|
+
4. **24-Bit Random Address Binary Search ($2^{24} = 16,777,216$ Space)**:
|
|
51
|
+
- When gear enters randomizing state (`RANDOMISE`), each unit generates a pseudo-random 24-bit integer (`0x000000` to `0xFFFFFF`).
|
|
52
|
+
- The master searches the 24-bit space using `SEARCHADDRH`, `SEARCHADDRM`, `SEARCHADDRL` and `COMPARE` (cmd 265).
|
|
53
|
+
- If multiple ballasts match, the master performs binary search down to a single device.
|
|
54
|
+
- Once isolated, assign short address via `PROGRAM SHORT ADDRESS` (cmd 267) and immediately transmit `WITHDRAW` (cmd 266) so the addressed fixture drops out of remaining search iterations.
|
|
55
|
+
|
|
56
|
+
5. **Physical Identify & Non-Destructive Extension Invariant**:
|
|
57
|
+
- Every assigned short address MUST be verified visually using `IDENTIFY` or toggling `RECALL MAX LEVEL` / `OFF` before committing to lighting schedules.
|
|
58
|
+
- When adding fixtures to an existing operational line, NEVER broadcast a global `INITIALISE (all)`; use `INITIALISE (without short address)` so already-commissioned ballasts (0–63) preserve their programming.
|
|
59
|
+
|
|
60
|
+
## Named Sins & Anti-Patterns (Что категорически ЗАПРЕЩЕНО)
|
|
61
|
+
|
|
62
|
+
| Anti-Pattern | Manifestation in Code/Workflow | Mandatory Production Counter-Rule |
|
|
63
|
+
| :--- | :--- | :--- |
|
|
64
|
+
| **Single-Shot Addressing Commands** | Sending cmd 258 or cmd 267 once without repetition. | Always repeat configuration commands within a strict 100ms window. |
|
|
65
|
+
| **Exceeding 64 Short Addresses** | Attempting to assign address 64 or 65 on one loop. | Partition into Subnet A and Subnet B; enforce 0–63 maximum. |
|
|
66
|
+
| **Timer Starvation** | Letting the 15-minute `INITIALISE` window expire mid-search. | Issue keep-alive refresh or optimize binary search loop to < 3 minutes. |
|
|
67
|
+
| **Ghost Address Overwrite** | Assigning address 0 without scanning if address 0 is in use. | Run non-destructive `QUERY STATUS` (cmd 144) across 0–63 before reassigning. |
|
|
68
|
+
| **Bus Overcurrent Overload** | Connecting 64 ballasts (2mA each) + sensors to a 100mA PSU. | Verify total quiescent load $\le$ PSU rating (250mA max per IEC 62386). |
|
|
69
|
+
| **DT8 / DT6 Type Mismatch** | Controlling tunable white gear with single-channel DT6 arc power. | Issue `SELECT DIMMING CURVE / COLOUR` (Part 209) and send DT8 color coordinates. |
|
|
70
|
+
| **Simultaneous Emergency Discharge** | Triggering 3-hour duration tests on all emergency lights at once. | Stagger tests across alternating weeks/groups to ensure safety illumination. |
|
|
71
|
+
| **Missing WITHDRAW Command** | Forgetting cmd 266 after addressing a found ballast. | Send `WITHDRAW` immediately after `PROGRAM SHORT ADDRESS` to exclude from search. |
|
|
72
|
+
| **DALI Polarity Panic** | Halting installation claiming standard DALI requires polarity. | Note DALI uses an integrated bridge rectifier; polarity is non-critical (though consistent coloring is advised). |
|
|
73
|
+
| **Energizing Unverified Mains** | Commissioning ballasts while 230V live mains work is ongoing. | Enforce physical lockout/tagout (LOTO) prior to terminal connection. |
|
|
74
|
+
|
|
75
|
+
## Concrete Archetypes / Presets
|
|
76
|
+
|
|
77
|
+
### Archetype 1: Greenfield DALI Discovery & Binary Search (Python/C Pseudo-code)
|
|
78
|
+
```python
|
|
79
|
+
import time
|
|
80
|
+
|
|
81
|
+
def send_dali_double_cmd(cmd_byte1: int, cmd_byte2: int):
|
|
82
|
+
transmit_dali_frame(cmd_byte1, cmd_byte2)
|
|
83
|
+
time.sleep(0.015) # 15ms spacing
|
|
84
|
+
transmit_dali_frame(cmd_byte1, cmd_byte2)
|
|
85
|
+
|
|
86
|
+
def commission_greenfield_bus() -> dict:
|
|
87
|
+
assigned = {}
|
|
88
|
+
# 1. Start 15-min commissioning session
|
|
89
|
+
send_dali_double_cmd(0xA5, 0x00) # INITIALISE (all gear)
|
|
90
|
+
send_dali_double_cmd(0xA7, 0x00) # RANDOMISE
|
|
91
|
+
time.sleep(0.100) # Wait 100ms for random address generation
|
|
92
|
+
|
|
93
|
+
next_short_addr = 0
|
|
94
|
+
while next_short_addr < 64:
|
|
95
|
+
low, high = 0x000000, 0xFFFFFF
|
|
96
|
+
found_random_addr = None
|
|
97
|
+
|
|
98
|
+
# Binary search 24-bit space
|
|
99
|
+
while low <= high:
|
|
100
|
+
mid = (low + high) // 2
|
|
101
|
+
set_search_address(mid)
|
|
102
|
+
if query_compare(): # cmd 265: does any gear have random_addr <= mid?
|
|
103
|
+
found_random_addr = mid
|
|
104
|
+
high = mid - 1
|
|
105
|
+
else:
|
|
106
|
+
low = mid + 1
|
|
107
|
+
|
|
108
|
+
if found_random_addr is None:
|
|
109
|
+
break # No more unaddressed fixtures on the bus
|
|
110
|
+
|
|
111
|
+
# Isolate and assign
|
|
112
|
+
set_search_address(found_random_addr)
|
|
113
|
+
short_addr_payload = (next_short_addr << 1) | 0x01
|
|
114
|
+
send_dali_double_cmd(0xB7, short_addr_payload) # PROGRAM SHORT ADDRESS
|
|
115
|
+
send_dali_cmd(0xAB, 0x00) # WITHDRAW (cmd 266)
|
|
116
|
+
|
|
117
|
+
# Physical verify
|
|
118
|
+
flash_fixture(next_short_addr)
|
|
119
|
+
assigned[next_short_addr] = hex(found_random_addr)
|
|
120
|
+
next_short_addr += 1
|
|
121
|
+
|
|
122
|
+
send_dali_cmd(0xA1, 0x00) # TERMINATE (cmd 257)
|
|
123
|
+
return assigned
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Archetype 2: Surgical Replacement of a Failed Ballast
|
|
127
|
+
```python
|
|
128
|
+
def replace_single_failed_ballast(expected_short_addr: int):
|
|
129
|
+
# Do NOT wipe existing 63 ballasts:
|
|
130
|
+
send_dali_double_cmd(0xA5, 0xFF) # INITIALISE (ONLY gear without short address)
|
|
131
|
+
send_dali_double_cmd(0xA7, 0x00) # RANDOMISE
|
|
132
|
+
time.sleep(0.100)
|
|
133
|
+
|
|
134
|
+
# Perform binary search for the single new replacement unit
|
|
135
|
+
random_addr = search_single_unit()
|
|
136
|
+
set_search_address(random_addr)
|
|
137
|
+
|
|
138
|
+
# Program directly into the missing slot
|
|
139
|
+
payload = (expected_short_addr << 1) | 0x01
|
|
140
|
+
send_dali_double_cmd(0xB7, payload)
|
|
141
|
+
send_dali_cmd(0xAB, 0x00) # WITHDRAW
|
|
142
|
+
send_dali_cmd(0xA1, 0x00) # TERMINATE
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Archetype 3: Group & DT8 Tunable White Configuration
|
|
146
|
+
```python
|
|
147
|
+
def configure_dt8_tunable_white(short_addr: int, mirek: int, group_id: int):
|
|
148
|
+
# Mirek = 1,000,000 / Kelvin (e.g. 2700K = 370 mirek, 6500K = 153 mirek)
|
|
149
|
+
send_dali_cmd(0x01, 0x00) # DTR0: low byte of mirek
|
|
150
|
+
send_dali_cmd(0x03, 0x00) # DTR1: high byte of mirek
|
|
151
|
+
send_dali_double_cmd(0xE7, 0x20) # SET TEMP COLOUR (DT8 Part 209)
|
|
152
|
+
# Add to group (0-15)
|
|
153
|
+
group_payload = 0x60 | (group_id & 0x0F)
|
|
154
|
+
send_dali_double_cmd(0x01 | (short_addr << 1), group_payload)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## The Pre-Emit Quality Gate Checklist
|
|
158
|
+
|
|
159
|
+
Before finalizing any DALI commissioning plan or script, check:
|
|
160
|
+
- [ ] **Address Ceiling**: Total short addresses $\le 64$ (addresses 0–63).
|
|
161
|
+
- [ ] **Double Transmission Timing**: Configuration commands repeat twice within 100ms.
|
|
162
|
+
- [ ] **Commissioning Window**: 15-minute timer monitored with `TERMINATE` sent at conclusion.
|
|
163
|
+
- [ ] **Withdrawal Discipline**: `WITHDRAW` (cmd 266) sent immediately after each address assignment.
|
|
164
|
+
- [ ] **Bus Current Check**: Total quiescent load calculated ($\le 250\text{mA}$ power supply capacity).
|
|
165
|
+
- [ ] **Emergency Test Staggering**: Emergency battery duration tests scheduled in alternating groups.
|
|
166
|
+
- [ ] **Physical Verification**: `IDENTIFY` / `WINK` toggle step included for human visual signoff.
|
|
167
|
+
|
|
168
|
+
## Self-Correction & Verification Loop
|
|
169
|
+
|
|
170
|
+
### Bad (Vibe-Coded AI Slop Output):
|
|
171
|
+
> "To assign addresses on DALI, loop from 1 to 100 and send cmd 267 to each light. If lights don't respond, change the positive and negative wires because DALI needs polarity."
|
|
172
|
+
*Problems: Exceeds 64 addresses, addresses start at 1 instead of 0, misses double-command transmission, forgets random search, wrongly asserts DALI polarity dependence.*
|
|
173
|
+
|
|
174
|
+
### Good (Production DALI Commissioner Output):
|
|
175
|
+
> 1. Verify bus PSU delivers 16V DC with total load under 250mA (e.g., 42 ballasts $\times$ 2mA = 84mA).
|
|
176
|
+
> 2. Send `INITIALISE (all)` [cmd 258] twice within 100ms, starting the 15-minute commissioning watchdog.
|
|
177
|
+
> 3. Transmit `RANDOMISE` [cmd 259] twice within 100ms.
|
|
178
|
+
> 4. Execute 24-bit binary search across `SEARCHADDR` space. For each isolated unit, transmit `PROGRAM SHORT ADDRESS` (slot 0–41) twice within 100ms, immediately followed by `WITHDRAW` [cmd 266].
|
|
179
|
+
> 5. Issue `TERMINATE` [cmd 257] to exit programming mode and physically pulse each luminaire to verify mapping.
|
|
180
|
+
|
|
181
|
+
## Limitations
|
|
182
|
+
|
|
183
|
+
- DALI command support, timing, gear limits, and DT8 behavior vary by control gear, device type, and IEC 62386 edition. Confirm commands against the exact gear and gateway manuals before transmission.
|
|
184
|
+
- Commissioning can disrupt occupied lighting and emergency systems. Coordinate an approved outage and have a qualified lighting professional verify any live bus operation; never treat these examples as a substitute for site procedures.
|
|
185
|
+
- Pseudo-code is illustrative and is not a tested gateway driver. Verify address mapping and every fixture physically before saving configuration.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eol-resistor-calculator
|
|
3
|
+
description: "Calculates and validates end-of-line (EOL, SEOL, DEOL, TEOL) resistor loops for intrusion alarm panels (Honeywell, DSC, Paradox, Bosch) with wire gauge drop and state tables. Trigger phrases: eol resistor, deol wiring, alarm zone resistor, calculate end of line, double eol tamper."
|
|
4
|
+
category: architecture
|
|
5
|
+
risk: safe
|
|
6
|
+
source: community
|
|
7
|
+
source_repo: wwewtech/eol-resistor-calculator
|
|
8
|
+
source_type: community
|
|
9
|
+
date_added: "2026-09-22"
|
|
10
|
+
author: wwewtech
|
|
11
|
+
tags: [security-systems, hardware, electronics, alarm-panel, circuit-design, electrical-engineering]
|
|
12
|
+
tools: [claude, cursor, gemini, windsurf]
|
|
13
|
+
license: "MIT"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# EOL Resistor Calculator: Precision Intrusion Loop Supervision & State Solver
|
|
17
|
+
|
|
18
|
+
Accurately size, configure, and troubleshoot Single (SEOL), Double (DEOL), and Triple (TEOL) end-of-line resistor loops across major security panel architectures with copper wire drop compensation and tamper state discrimination.
|
|
19
|
+
|
|
20
|
+
## When to Use This Skill
|
|
21
|
+
|
|
22
|
+
Activate this skill when:
|
|
23
|
+
- Sizing, retrofitting, or diagnosing hardwired security loops on alarm panels (DSC PowerSeries/Neo, Honeywell Ademco Vista, Paradox EVO/Spectra, Bosch B/G Series, Texecom Premier Elite).
|
|
24
|
+
- The user asks: "How do I wire double EOL on a DSC panel?", "Calculate zone loop resistance for a 200m cable run", "Troubleshoot a constant zone tamper fault", or "What resistor values does Honeywell Vista use?".
|
|
25
|
+
- Differentiating between Normal, Alarm, Tamper (Short), and Cut (Open) circuit states across varying panel threshold windows.
|
|
26
|
+
- Sizing copper loop resistance drops on long perimeter runs (e.g. 22 AWG over 150+ meters) to prevent phantom false alarms.
|
|
27
|
+
|
|
28
|
+
Do NOT use this skill when:
|
|
29
|
+
- Designing wireless sensors or addressable polling loop multiplexers (polling loops use digital transponders, not passive EOL resistors).
|
|
30
|
+
- Bypassing safety or life-safety supervision circuits (never advise strapping out resistors or bypassing line supervision).
|
|
31
|
+
- Working on 2-wire smoke detector loops without consulting panel-specific smoke circuit polarity and current-limiting specs.
|
|
32
|
+
|
|
33
|
+
## Core Mental Models & Non-Negotiable Rules
|
|
34
|
+
|
|
35
|
+
1. **The Far-End Placement Axiom (Strict Anti-Panel Stacking)**:
|
|
36
|
+
- Resistors MUST be installed **inside the sensor housing at the farthest physical end of the cable run**.
|
|
37
|
+
- Placing resistors across screw terminals inside the alarm panel enclosure protects only the metal cabinet itself; the entire 50-meter cable run to the sensor is left vulnerable to undetected wire cuts or staple shorts.
|
|
38
|
+
- Any wiring diagram showing EOL resistors at the panel board for field sensors is flagged as a Grade 2/Grade 3 compliance violation.
|
|
39
|
+
|
|
40
|
+
2. **The 4-State Double-EOL (DEOL) Truth Table**:
|
|
41
|
+
- Double EOL uses two resistors: an End-of-Line resistor ($R_{EOL}$) and an Alarm contact resistor ($R_{ALARM}$).
|
|
42
|
+
- Standard series-parallel configuration (e.g., DSC standard 5.6k / 5.6k):
|
|
43
|
+
$$\text{Loop State} = \begin{cases}
|
|
44
|
+
0\ \Omega\ (\text{Short Circuit}) & \implies \mathbf{Tamper\ (Short)} \\
|
|
45
|
+
R_{EOL}\ (5.6\text{k}\ \Omega) & \implies \mathbf{Normal\ (Secure)} \\
|
|
46
|
+
R_{EOL} + R_{ALARM}\ (11.2\text{k}\ \Omega) & \implies \mathbf{Alarm\ (Tripped)} \\
|
|
47
|
+
\infty\ \Omega\ (\text{Open Circuit}) & \implies \mathbf{Tamper\ (Cut\ Wire)}
|
|
48
|
+
\end{cases}$$
|
|
49
|
+
- This provides complete supervised discrimination between intruder activation and physical sabotage.
|
|
50
|
+
|
|
51
|
+
3. **Copper Wire Resistance Compensation Formula**:
|
|
52
|
+
- Long field cable runs add series loop resistance across both conductors:
|
|
53
|
+
$$R_{loop} = 2 \times D \times \rho_{gauge}$$
|
|
54
|
+
where $D$ is one-way distance in meters, and $\rho_{gauge}$ is resistance per meter:
|
|
55
|
+
- **22 AWG (0.326 mm²)**: $0.053\ \Omega/\text{meter}$ ($16.14\ \Omega/1000\text{ft}$)
|
|
56
|
+
- **20 AWG (0.518 mm²)**: $0.033\ \Omega/\text{meter}$ ($10.15\ \Omega/1000\text{ft}$)
|
|
57
|
+
- **18 AWG (0.823 mm²)**: $0.021\ \Omega/\text{meter}$ ($6.38\ \Omega/1000\text{ft}$)
|
|
58
|
+
- A 150m run of 22 AWG adds $2 \times 150 \times 0.053 \approx 15.9\ \Omega$. Ensure total loop resistance does not push readings beyond the panel's $\pm 15\%$ ADC tolerance window.
|
|
59
|
+
|
|
60
|
+
4. **Panel Reference Resistor Standards Matrix**:
|
|
61
|
+
- **DSC PowerSeries / Neo**: $5.6\text{k}\ \Omega$ SEOL / $5.6\text{k} + 5.6\text{k}$ DEOL.
|
|
62
|
+
- **Honeywell Ademco Vista**: $2.0\text{k}\ \Omega$ SEOL (Standard zones), $1.0\text{k}$ (Zone 1 on some models).
|
|
63
|
+
- **Paradox EVO / Spectra**: $1.0\text{k}\ \Omega$ SEOL / $1.0\text{k} + 1.0\text{k}$ DEOL (or ATZ mode with $1.0\text{k} / 2.2\text{k}$).
|
|
64
|
+
- **Bosch B / G Series**: Dual supervision with $1.0\text{k} / 2.0\text{k}$ or panel-selectable windows.
|
|
65
|
+
- **Texecom Premier Elite**: $2.2\text{k} / 4.7\text{k}$ or selectable Grade 3 Triple-EOL ($4.7\text{k} / 4.7\text{k} / 2.2\text{k}$ anti-mask).
|
|
66
|
+
|
|
67
|
+
5. **ADC Voltage Divider Acceptance Windows**:
|
|
68
|
+
- Security panels measure zone voltage through an internal pull-up resistor ($R_{pullup}$, typically $1\text{k}$ to $3.3\text{k}\ \Omega$) connected to a reference voltage ($V_{ref}$, typically $5.0\text{V}$ or $13.8\text{V}$).
|
|
69
|
+
- Terminal voltage is given by:
|
|
70
|
+
$$V_{zone} = V_{ref} \times \frac{R_{loop\_total}}{R_{pullup} + R_{loop\_total}}$$
|
|
71
|
+
- Always confirm whether a measured terminal voltage falls inside the manufacturer's specified ADC threshold window before replacing field hardware.
|
|
72
|
+
|
|
73
|
+
## Named Sins & Anti-Patterns (Что категорически ЗАПРЕЩЕНО)
|
|
74
|
+
|
|
75
|
+
| Anti-Pattern | Manifestation in Code/Workflow | Mandatory Production Counter-Rule |
|
|
76
|
+
| :--- | :--- | :--- |
|
|
77
|
+
| **Panel-Terminal Resistor Stacking** | Crimping EOL resistors into the screw terminals on the panel PCB. | Install resistors exclusively inside the remote sensor housing. |
|
|
78
|
+
| **Vendor Value Cross-Contamination** | Putting 2.0k Honeywell resistors onto a DSC panel requiring 5.6k. | Verify panel model and enforce manufacturer-specific resistance ratings. |
|
|
79
|
+
| **DEOL Series/Parallel Inversion** | Swapping series and parallel resistors on an alarm PIR contact. | Wire $R_{ALARM}$ in parallel with NC alarm switch; wire $R_{EOL}$ in series with loop. |
|
|
80
|
+
| **Neglecting Wire Drop on Long Runs** | Ignoring 40+ $\Omega$ wire resistance on a 300-meter warehouse fence zone. | Calculate loop resistance $2 \times D \times \rho$ and verify against panel budget. |
|
|
81
|
+
| **Twist-and-Tape Resistor Splices** | Twisting resistor leads by hand and wrapping with electrical tape. | Use soldered heat-shrink sleeves or grease-filled B-connectors/crimps. |
|
|
82
|
+
| **Fire/Burg Supervised Mix-up** | Applying burglar DEOL tamper logic to 2-wire latching fire zones. | Fire loops strictly require Normally Open (NO) contacts with SEOL supervision. |
|
|
83
|
+
| **Unshielded AC Parallel Run** | Running 22/4 unshielded alarm cable in parallel with 230V mains. | Maintain 300mm physical separation or use twisted shielded pair (STP). |
|
|
84
|
+
| **Strapping Out Trouble Zones** | Advising a user to twist zone wires together to clear a trouble condition. | Diagnose root cause (open wire, bad contact, corroded resistor) methodically. |
|
|
85
|
+
| **Confusing NO and NC Contacts** | Treating a magnetic reed switch (NC) like an exit request button (NO). | Verify sensor contact behavior in quiescent, non-alarm states. |
|
|
86
|
+
| **Unrecorded Commissioning Values** | Leaving an install without recording measured DC resistance values. | Deliver an audit log of measured loop ohms across Normal, Alarm, and Tamper. |
|
|
87
|
+
|
|
88
|
+
## Concrete Archetypes / Presets
|
|
89
|
+
|
|
90
|
+
### Archetype 1: Double-EOL (DEOL) Sensor Wiring Schematic (DSC 5.6k)
|
|
91
|
+
```
|
|
92
|
+
(+) ZONE TERMINAL (Panel)
|
|
93
|
+
│
|
|
94
|
+
▼ [Core 1: Field Wire]
|
|
95
|
+
┌───────┴────────────────────────┐
|
|
96
|
+
│ SENSOR HOUSING (Far End) │
|
|
97
|
+
│ │
|
|
98
|
+
│ TAMPER SWITCH (NC) │
|
|
99
|
+
│ ┌────[ / ]────┐ │
|
|
100
|
+
│ │ │ │
|
|
101
|
+
│ ▼ ▼ │
|
|
102
|
+
│ ( ) ( ) │
|
|
103
|
+
│ │ │ │
|
|
104
|
+
│ │ ALARM RELAY (NC) │
|
|
105
|
+
│ │ ┌────[ / ]────┐ │
|
|
106
|
+
│ │ │ │ │
|
|
107
|
+
│ │ │ R_ALARM │ │
|
|
108
|
+
│ │ └───[5.6k]────┘ │
|
|
109
|
+
│ │ │ │
|
|
110
|
+
│ ▼ ▼ │
|
|
111
|
+
│ R_EOL [5.6k] │ │
|
|
112
|
+
│ │ │ │
|
|
113
|
+
└─────┼─────────────┼────────────┘
|
|
114
|
+
│ │
|
|
115
|
+
└─────────────┘
|
|
116
|
+
▲
|
|
117
|
+
│ [Core 2: Field Wire]
|
|
118
|
+
(─) COMMON TERMINAL (Panel)
|
|
119
|
+
|
|
120
|
+
State Resistance:
|
|
121
|
+
• Secure: 5.6k Ω
|
|
122
|
+
• Alarm: 11.2k Ω (Alarm contact opens, forcing current through R_ALARM)
|
|
123
|
+
• Tamper: 0 Ω (Short circuit) or ∞ Ω (Cut wire or Tamper contact opens)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Archetype 2: Loop Resistance & Tolerance Calculator (Python 3.10+)
|
|
127
|
+
```python
|
|
128
|
+
def calculate_loop_parameters(
|
|
129
|
+
panel_eol_nominal: float,
|
|
130
|
+
panel_tolerance_pct: float,
|
|
131
|
+
one_way_distance_m: float,
|
|
132
|
+
wire_gauge_awg: int = 22,
|
|
133
|
+
deol_mode: bool = True
|
|
134
|
+
) -> dict:
|
|
135
|
+
# Ohms per meter for solid annealed copper conductors
|
|
136
|
+
RESISTANCE_PER_M = {18: 0.0209, 20: 0.0333, 22: 0.0530, 24: 0.0842}
|
|
137
|
+
rho = RESISTANCE_PER_M.get(wire_gauge_awg, 0.0530)
|
|
138
|
+
|
|
139
|
+
wire_loop_ohms = 2.0 * one_way_distance_m * rho
|
|
140
|
+
normal_resistance = panel_eol_nominal + wire_loop_ohms
|
|
141
|
+
alarm_resistance = (panel_eol_nominal * 2.0 if deol_mode else float('inf')) + wire_loop_ohms
|
|
142
|
+
|
|
143
|
+
tol_window = panel_eol_nominal * (panel_tolerance_pct / 100.0)
|
|
144
|
+
normal_min = panel_eol_nominal - tol_window
|
|
145
|
+
normal_max = panel_eol_nominal + tol_window
|
|
146
|
+
|
|
147
|
+
is_normal_acceptable = (normal_min <= normal_resistance <= normal_max)
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
"wire_loop_resistance_ohms": round(wire_loop_ohms, 2),
|
|
151
|
+
"measured_normal_expected": round(normal_resistance, 2),
|
|
152
|
+
"measured_alarm_expected": round(alarm_resistance, 2),
|
|
153
|
+
"panel_acceptance_window": (round(normal_min, 2), round(normal_max, 2)),
|
|
154
|
+
"is_acceptable": is_normal_acceptable,
|
|
155
|
+
"recommendation": "OK" if is_normal_acceptable else "Wire resistance exceeds panel tolerance! Upsize to 20 AWG or 18 AWG."
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Archetype 3: Multimeter Field Diagnostic Workflow
|
|
160
|
+
```markdown
|
|
161
|
+
1. Disconnect zone loop wires from panel terminal Z1 and COM.
|
|
162
|
+
2. Set digital multimeter to 20k Ω DC resistance range.
|
|
163
|
+
3. Clip probes to black and red loop wires.
|
|
164
|
+
4. Read resistance:
|
|
165
|
+
- Reading = 0 Ω: Direct short on cable or tamper circuit pinched.
|
|
166
|
+
- Reading = ~5.6k Ω: Loop is secure and healthy.
|
|
167
|
+
- Reading = ~11.2k Ω: Sensor is currently tripped (door open, motion active).
|
|
168
|
+
- Reading = O.L (∞ Ω): Broken conductor, disconnected terminal, or open tamper switch.
|
|
169
|
+
5. Reconnect to panel and verify terminal voltage across Z1 and COM:
|
|
170
|
+
- Normal secure: 2.2V - 2.8V DC (on 5V pullup).
|
|
171
|
+
- Alarm: 3.5V - 4.1V DC.
|
|
172
|
+
- Tamper/Short: 0.0V DC.
|
|
173
|
+
- Cut/Open: 5.0V DC.
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## The Pre-Emit Quality Gate Checklist
|
|
177
|
+
|
|
178
|
+
Before emitting any alarm wiring advice, schematic, or resistor calculation:
|
|
179
|
+
- [ ] **Placement Verification**: Explicitly mandate resistor placement at the remote detector, strictly barring panel-terminal stacking.
|
|
180
|
+
- [ ] **Manufacturer Compliance**: Verified nominal EOL values match the specific panel model (Honeywell 2.0k, DSC 5.6k, Paradox 1.0k, etc.).
|
|
181
|
+
- [ ] **Wire Gauge Compensation**: Calculated two-conductor wire loop resistance for distances $> 50$ meters.
|
|
182
|
+
- [ ] **DEOL State Coverage**: Documented all 4 states (Normal, Alarm, Tamper Short, Tamper Open).
|
|
183
|
+
- [ ] **Fire Circuit Distinction**: Confirmed burglary DEOL logic is never recommended for latching fire loops.
|
|
184
|
+
- [ ] **Physical Connection Standards**: Specified soldered heat-shrink or B-connector crimps over raw tape twists.
|
|
185
|
+
- [ ] **Zero Supervision Bypass**: Zero instructions provided to defeat or bypass loop supervision resistors.
|
|
186
|
+
|
|
187
|
+
## Self-Correction & Verification Loop
|
|
188
|
+
|
|
189
|
+
### Bad (Vibe-Coded AI Slop Output):
|
|
190
|
+
> "To wire an alarm sensor, just twist the resistor onto the zone screw terminals on the panel board. A 1k resistor usually works for all panels. If you get a zone fault, just bypass the zone or short the wires together."
|
|
191
|
+
*Problems: Fatal panel-terminal stacking, generic wrong resistor value, advises bypassing safety supervision, ignores tamper discrimination.*
|
|
192
|
+
|
|
193
|
+
### Good (Production EOL Resistor Calculator Output):
|
|
194
|
+
> For a **DSC PowerSeries Neo** panel using a **Double-EOL (DEOL)** PIR detector over an **80m run of 22 AWG** cable:
|
|
195
|
+
> 1. **Resistor Placement**: Install two 5.6k $\Omega$ resistors (5% tolerance, 0.25W) strictly inside the PIR housing at the far end of the run.
|
|
196
|
+
> 2. **Wiring Topology**:
|
|
197
|
+
> - Connect Tamper switch in series with the loop.
|
|
198
|
+
> - Connect first 5.6k $\Omega$ resistor ($R_{EOL}$) in series with the loop.
|
|
199
|
+
> - Connect second 5.6k $\Omega$ resistor ($R_{ALARM}$) in parallel across the NC Alarm relay contacts.
|
|
200
|
+
> 3. **Wire Resistance Drop**: 80m of 22 AWG adds $2 \times 80 \times 0.053 = 8.48\ \Omega$. Total secure loop resistance will be $5,608.5\ \Omega$, well within DSC's $\pm 10\%$ acceptance window ($5,040\ \Omega$ to $6,160\ \Omega$).
|
|
201
|
+
> 4. **Multimeter Diagnostic Verification**:
|
|
202
|
+
> - Secure: $5.61\text{k}\ \Omega$.
|
|
203
|
+
> - Walk-test (Alarm): $11.21\text{k}\ \Omega$.
|
|
204
|
+
> - Sensor cover removed (Tamper): $\infty\ \Omega$ (Open).
|
|
205
|
+
> - Crushed wire (Short): $8.5\ \Omega$ (Panel registers Tamper Short).
|
|
206
|
+
|
|
207
|
+
## Limitations
|
|
208
|
+
|
|
209
|
+
- EOL values, wiring topologies, and zone states are panel- and detector-specific. Use the installation manual and approved wiring diagram for the exact model; the examples are not universal specifications.
|
|
210
|
+
- Work on alarm systems only with owner authorization and qualified personnel. Do not bypass supervision, disable an active alarm, or leave a protected site without a verified restored state.
|
|
211
|
+
- Cable resistance and resistor tolerances are estimates. Measure the installed loop and confirm the panel's published acceptance ranges before changing configuration.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: esl-price-sync
|
|
3
|
+
description: "Synchronizes retail prices between ERP/POS systems and Electronic Shelf Labels (SES-imagotag, ZKONG, Pricer, Hanshow, SOLUM) with delta watermarking, idempotency, and battery modeling. Trigger phrases: esl price sync, electronic shelf labels, zkong sync, ses imagotag price, ghost pricing audit."
|
|
4
|
+
category: architecture
|
|
5
|
+
risk: safe
|
|
6
|
+
source: community
|
|
7
|
+
source_repo: wwewtech/esl-price-sync
|
|
8
|
+
source_type: community
|
|
9
|
+
date_added: "2026-09-22"
|
|
10
|
+
author: wwewtech
|
|
11
|
+
tags: [retail-tech, esl, iot, supply-chain, systems-integration, enterprise-software]
|
|
12
|
+
tools: [claude, cursor, gemini, windsurf]
|
|
13
|
+
license: "MIT"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# ESL Price Sync: Deterministic Retail Shelf-Edge Pricing Architecture
|
|
17
|
+
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
## When to Use This Skill
|
|
21
|
+
|
|
22
|
+
Activate this skill when:
|
|
23
|
+
- Designing, implementing, or auditing integration pipelines between enterprise retail masters (SAP, Oracle Retail, Dynamics 365, Lightspeed) and ESL server platforms.
|
|
24
|
+
- The user asks: "How do I sync price updates to ESL tags without draining batteries?", "Debug ghost pricing where POS doesn't match the shelf tag", "Design an idempotent delta feed for ZKONG or SES-imagotag", or "Schedule promotional pricing with automatic rollback".
|
|
25
|
+
- Reconciling price discrepancy logs between central ERP databases, ESL middleware, and wireless base station ACK telemetry.
|
|
26
|
+
- Calculating battery life depletion curves for e-paper tags running on CR2450 coin cells under varying refresh frequencies.
|
|
27
|
+
|
|
28
|
+
Do NOT use this skill when:
|
|
29
|
+
- Managing e-commerce web store frontends or dynamic pricing algorithms (this skill governs faithful delivery of decided prices to physical tags).
|
|
30
|
+
- Troubleshooting individual dead hardware tags before gateway RF coverage and RSSI signal propagation have been verified.
|
|
31
|
+
- Performing live write operations on production store fleets without a preceding read-only audit verification pass.
|
|
32
|
+
|
|
33
|
+
## Core Mental Models & Non-Negotiable Rules
|
|
34
|
+
|
|
35
|
+
1. **The 5-Layer ESL Architecture Pipeline**:
|
|
36
|
+
- Every price synchronization event traverses five distinct operational tiers:
|
|
37
|
+
$$\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}$$
|
|
38
|
+
- **Traceability Invariant**: Every price payload MUST carry a deterministic `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.
|
|
39
|
+
|
|
40
|
+
2. **Strict Delta Discipline & Cryptographic Watermarking**:
|
|
41
|
+
- Pushing a full 50,000-SKU store catalog on a scheduled cron is strictly forbidden.
|
|
42
|
+
- Updates MUST be generated by calculating a cryptographic row hash:
|
|
43
|
+
$$\text{RowHash} = \text{SHA256}(\text{SKU} + \text{BasePrice} + \text{PromoPrice} + \text{Currency} + \text{UnitOfMeasure} + \text{Barcode} + \text{TemplateID})$$
|
|
44
|
+
- Only records where $\text{RowHash}_{new} \neq \text{RowHash}_{pushed}$ are queued for transmission.
|
|
45
|
+
- Full pushes are strictly restricted to initial store commissioning and disaster recovery restores.
|
|
46
|
+
|
|
47
|
+
3. **Monotonic Idempotency & Out-of-Order Packet Defense**:
|
|
48
|
+
- High-volume retail message brokers inevitably deliver packets out of order during network re-balancing.
|
|
49
|
+
- Every transmission packet MUST include an `idempotency_key` and a monotonically increasing `version_timestamp` (ISO 8601 UTC).
|
|
50
|
+
- If an incoming price payload has $\text{version\_timestamp} \le \text{last\_applied\_version}$, the ESL middleware MUST discard the payload to eliminate race condition reversions.
|
|
51
|
+
|
|
52
|
+
4. **RF Gateway Rate-Limiting & Battery Longevity Budget**:
|
|
53
|
+
- Each physical e-paper display refresh costs between $12\ \mu\text{Ah}$ and $25\ \mu\text{Ah}$.
|
|
54
|
+
- A dual-CR2450 battery pack provides $1,200\text{ mAh}$ nominal capacity ($960\text{ mAh}$ usable considering passivation and low-temperature shelf environments).
|
|
55
|
+
- **The 3-Update Daily Rule**: Limiting tag updates to $\le 3$ refreshes per day guarantees a $5.5\text{--}7\text{ year}$ operational lifespan.
|
|
56
|
+
- **Base Station Queue Throttling**: Gateways operate over shared Sub-GHz (868/915 MHz) or proprietary 2.4 GHz RF channels. Batch transmissions must not exceed 150 tag updates per gateway per minute to prevent RF collision retries from draining batteries.
|
|
57
|
+
|
|
58
|
+
5. **Read-Only Audit Mode by Default**:
|
|
59
|
+
- Diagnostic and reconciliation tasks MUST execute in read-only audit mode.
|
|
60
|
+
- Output discrepancy reports containing SKU, ERP Price, Gateway ACK Price, and Divergence Layer.
|
|
61
|
+
- State-changing write updates require explicit operator consent.
|
|
62
|
+
|
|
63
|
+
## Named Sins & Anti-Patterns (Что категорически ЗАПРЕЩЕНО)
|
|
64
|
+
|
|
65
|
+
| Anti-Pattern | Manifestation in Code/Workflow | Mandatory Production Counter-Rule |
|
|
66
|
+
| :--- | :--- | :--- |
|
|
67
|
+
| **Scheduled Full Catalog Floods** | Blasting 60,000 tags every night at midnight. | Stream strict deltas using SHA256 content watermarks. |
|
|
68
|
+
| **Ghost Price Blindness** | Assuming API `200 OK` means the customer sees the new price. | Track gateway ACK packet receipts (`status: ACK_CONFIRMED`). |
|
|
69
|
+
| **Non-Idempotent Retries** | Retrying failed HTTP calls without idempotency keys. | Attach `UUIDv5(sku, store_id, price_timestamp)` to all mutations. |
|
|
70
|
+
| **Timezone Ambiguity** | Pushing promo prices without UTC/local time offsets. | Enforce ISO 8601 UTC timestamps with explicit store local offsets. |
|
|
71
|
+
| **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}$). |
|
|
72
|
+
| **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. |
|
|
73
|
+
| **Destructive Rollback Omission** | Deploying flash sales without pre-computing revert state. | Cache previous active state to enable 1-click atomic rollback. |
|
|
74
|
+
| **Orphan Tag Neglect** | Leaving decommissioned tags in the active database. | Reconcile missing heartbeat tags after 72 hours; flag as `ORPHAN`. |
|
|
75
|
+
| **Mid-Day Peak Syncing** | Pushing massive price shifts during peak Saturday shopping hours. | Schedule bulk promotions before store opening or during off-peak hours. |
|
|
76
|
+
| **Unshielded Write Broadcasts** | Executing write scripts without an audit dry-run. | Enforce dry-run simulation mode prior to initiating physical RF broadcasts. |
|
|
77
|
+
|
|
78
|
+
## Concrete Archetypes / Presets
|
|
79
|
+
|
|
80
|
+
### Archetype 1: Idempotent Delta Synchronizer (Python 3.10+)
|
|
81
|
+
```python
|
|
82
|
+
import hashlib
|
|
83
|
+
import time
|
|
84
|
+
from typing import Dict, List, Optional
|
|
85
|
+
|
|
86
|
+
def compute_sku_hash(item: dict) -> str:
|
|
87
|
+
payload = f"{item['sku']}:{item['price']}:{item['promo_price']}:{item['uom']}:{item['template']}"
|
|
88
|
+
return hashlib.sha256(payload.encode('utf-8')).hexdigest()
|
|
89
|
+
|
|
90
|
+
class ESLDeltaSyncPipeline:
|
|
91
|
+
def __init__(self, watermark_db: dict, max_rate_per_min: int = 150):
|
|
92
|
+
self.watermark_db = watermark_db # SKU -> last_pushed_hash
|
|
93
|
+
self.max_rate_per_min = max_rate_per_min
|
|
94
|
+
self.last_tx_time = 0.0
|
|
95
|
+
|
|
96
|
+
def process_catalog_stream(self, incoming_feed: List[dict], dry_run: bool = True) -> dict:
|
|
97
|
+
to_push = []
|
|
98
|
+
unchanged = 0
|
|
99
|
+
|
|
100
|
+
for item in incoming_feed:
|
|
101
|
+
sku = item['sku']
|
|
102
|
+
current_hash = compute_sku_hash(item)
|
|
103
|
+
last_hash = self.watermark_db.get(sku)
|
|
104
|
+
|
|
105
|
+
if current_hash != last_hash:
|
|
106
|
+
idempotency_key = hashlib.sha1(f"{sku}:{item['version']}:{current_hash}".encode()).hexdigest()
|
|
107
|
+
to_push.append({
|
|
108
|
+
"sku": sku,
|
|
109
|
+
"tag_id": item['tag_id'],
|
|
110
|
+
"price_data": item,
|
|
111
|
+
"idempotency_key": idempotency_key,
|
|
112
|
+
"content_hash": current_hash
|
|
113
|
+
})
|
|
114
|
+
else:
|
|
115
|
+
unchanged += 1
|
|
116
|
+
|
|
117
|
+
if dry_run:
|
|
118
|
+
return {"mode": "DRY_RUN", "queued_for_rf": len(to_push), "unchanged": unchanged}
|
|
119
|
+
|
|
120
|
+
# Rate-limited physical transmission
|
|
121
|
+
sent = 0
|
|
122
|
+
min_interval = 60.0 / self.max_rate_per_min
|
|
123
|
+
for job in to_push:
|
|
124
|
+
now = time.time()
|
|
125
|
+
elapsed = now - self.last_tx_time
|
|
126
|
+
if elapsed < min_interval:
|
|
127
|
+
time.sleep(min_interval - elapsed)
|
|
128
|
+
|
|
129
|
+
transmit_to_esl_gateway(job)
|
|
130
|
+
self.watermark_db[job['sku']] = job['content_hash']
|
|
131
|
+
self.last_tx_time = time.time()
|
|
132
|
+
sent += 1
|
|
133
|
+
|
|
134
|
+
return {"mode": "LIVE_COMMITTED", "sent_deltas": sent, "unchanged": unchanged}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Archetype 2: Reconciliation Audit Report Schema
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"audit_timestamp": "2026-09-22T10:15:00Z",
|
|
141
|
+
"store_id": "STORE-0842",
|
|
142
|
+
"total_audited_skus": 14200,
|
|
143
|
+
"in_sync": 14188,
|
|
144
|
+
"ghost_pricing_discrepancies": [
|
|
145
|
+
{
|
|
146
|
+
"sku": "SKU-99014",
|
|
147
|
+
"barcode": "4006381333931",
|
|
148
|
+
"tag_mac": "00:1A:7D:DA:71:04",
|
|
149
|
+
"aisle": "Aisle 4 - Cereals",
|
|
150
|
+
"erp_master_price": 4.99,
|
|
151
|
+
"esl_server_price": 4.99,
|
|
152
|
+
"tag_ack_price": 3.99,
|
|
153
|
+
"divergence_layer": "RF Base Station (Packet dropped due to antenna shadow)",
|
|
154
|
+
"last_ack_timestamp": "2026-09-20T04:12:00Z",
|
|
155
|
+
"recommended_action": "Force targeted re-transmit on Channel 11"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Archetype 3: Battery Longevity Estimation Model
|
|
162
|
+
```python
|
|
163
|
+
def estimate_tag_battery_years(
|
|
164
|
+
updates_per_day: float,
|
|
165
|
+
ambient_temp_celsius: float = 21.0,
|
|
166
|
+
battery_mah: float = 1200.0,
|
|
167
|
+
uAh_per_refresh: float = 18.0,
|
|
168
|
+
standby_uA: float = 1.2
|
|
169
|
+
) -> float:
|
|
170
|
+
# Temperature de-rating factor (freezer sections de-rate capacity significantly)
|
|
171
|
+
temp_factor = 0.65 if ambient_temp_celsius < 0.0 else (0.85 if ambient_temp_celsius < 10.0 else 1.0)
|
|
172
|
+
effective_mah = battery_mah * 0.85 * temp_factor # 85% usable chemistry margin
|
|
173
|
+
|
|
174
|
+
daily_drain_uAh = (updates_per_day * uAh_per_refresh) + (standby_uA * 24.0)
|
|
175
|
+
daily_drain_mAh = daily_drain_uAh / 1000.0
|
|
176
|
+
|
|
177
|
+
lifespan_days = effective_mah / daily_drain_mAh
|
|
178
|
+
return round(lifespan_days / 365.25, 2)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## The Pre-Emit Quality Gate Checklist
|
|
182
|
+
|
|
183
|
+
Before finalizing any ESL integration, sync workflow, or audit output:
|
|
184
|
+
- [ ] **Delta Discipline**: Confirmed that only changed row hashes are queued; no scheduled full catalog pushes.
|
|
185
|
+
- [ ] **Idempotency Proof**: Monotonic versioning and idempotency keys attached to every modification payload.
|
|
186
|
+
- [ ] **5-Layer Traceability**: Explicit separation between ERP status, server queue, and base station physical tag ACK.
|
|
187
|
+
- [ ] **RF Rate-Limiting**: Gateway transmission queued at $\le 150$ updates/min per AP.
|
|
188
|
+
- [ ] **Battery Budget Checked**: Verified tag refresh schedule does not breach 3 updates/day lifespan limit.
|
|
189
|
+
- [ ] **Layout Safety**: Text width and font truncation verified against display canvas dimensions.
|
|
190
|
+
- [ ] **Dry-Run Audit Default**: Executed read-only reconciliation prior to proposing live write broadcasts.
|
|
191
|
+
|
|
192
|
+
## Self-Correction & Verification Loop
|
|
193
|
+
|
|
194
|
+
### Bad (Vibe-Coded AI Slop Output):
|
|
195
|
+
> "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."
|
|
196
|
+
*Problems: Fatal catalog flooding, battery destruction, zero delta tracking, zero idempotency, ignores gateway rate-limiting, blind to physical tag ACK status.*
|
|
197
|
+
|
|
198
|
+
### Good (Production ESL Price Sync Output):
|
|
199
|
+
> 1. Execute read-only audit comparing ERP pricing against ESL gateway ACK states; identify 12 divergent SKUs.
|
|
200
|
+
> 2. Compute SHA256 delta hashes for all modified SKUs since watermark `2026-09-22T08:00:00Z`.
|
|
201
|
+
> 3. Generate idempotent mutation payloads with `UUIDv5` tokens and monotonic timestamp versioning.
|
|
202
|
+
> 4. Verify tag layout: Confirm that promo prices fit within the 2.9-inch 3-color e-paper template without numeric truncation.
|
|
203
|
+
> 5. Queue rate-limited dispatch at 120 tags/min on Base Station 03, logging transmission to physical tag ACK confirmation.
|
|
204
|
+
|
|
205
|
+
## Limitations
|
|
206
|
+
|
|
207
|
+
- ESL APIs, radio limits, acknowledgements, battery figures, and rate limits depend on the vendor, firmware, tag model, and local radio rules. Confirm each value in the deployed system's documentation before use.
|
|
208
|
+
- Start with read-only reconciliation and a small authorized pilot. A server acknowledgement does not prove the physical label displayed the intended value; require tag-level confirmation and a rollback plan before wider writes.
|
|
209
|
+
- Protect retail pricing, product, and device identifiers as business data. Do not transmit credentials or customer data in diagnostic logs or reports.
|
|
210
|
+
- The scripts and payloads in this guide are illustrative and are not vendor-certified integrations.
|
|
@@ -11,7 +11,7 @@ author: socai-io
|
|
|
11
11
|
tags: [social-media, research, instagram, tiktok, linkedin, browser-automation, jev]
|
|
12
12
|
tools: [claude, codex]
|
|
13
13
|
license: "MIT"
|
|
14
|
-
license_source: "https://github.com/socai-io/jev-social/blob/
|
|
14
|
+
license_source: "https://github.com/socai-io/jev-social/blob/782d809c68e2015536359aa7dceede9a3cdbb7f1/LICENSE"
|
|
15
15
|
---
|
|
16
16
|
# Jev Social
|
|
17
17
|
|
|
@@ -19,7 +19,7 @@ license_source: "https://github.com/socai-io/jev-social/blob/05581cac6b8c21c85e5
|
|
|
19
19
|
|
|
20
20
|
Jev Social turns a natural-language social research goal into bounded Jev routing decisions, then delegates platform-read-only browser work to the local socai CLI. Use the captured posts, profiles, comments, videos, and opened details to produce a compact, source-linked report instead of exposing raw CLI output. "Read-only" means no social-account mutation; the CLI still writes private local run records and may download requested media.
|
|
21
21
|
|
|
22
|
-
The executable examples below are pinned to the tested runtime commit included in Jev Social `v0.1.
|
|
22
|
+
The executable examples below are pinned to the tested runtime commit included in Jev Social `v0.1.5`. A pin improves reproducibility but is not a trust guarantee; keep the package, browser data, and returned content inside the safety boundaries below.
|
|
23
23
|
|
|
24
24
|
## When to Use
|
|
25
25
|
- Use when a user requests evidence-backed research on Instagram, TikTok, or LinkedIn and wants real public posts or profiles rather than a general web summary.
|
|
@@ -45,7 +45,7 @@ If the exact pinned package is not already available locally, explain that the n
|
|
|
45
45
|
Run the status command before every research task:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
npx github:socai-io/jev-social#
|
|
48
|
+
npx github:socai-io/jev-social#782d809c68e2015536359aa7dceede9a3cdbb7f1 status
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
Require all of the following before continuing:
|
|
@@ -68,7 +68,7 @@ Pass the goal as one argument with an argv-capable process runner; never constru
|
|
|
68
68
|
```text
|
|
69
69
|
program: npx
|
|
70
70
|
argv:
|
|
71
|
-
- github:socai-io/jev-social#
|
|
71
|
+
- github:socai-io/jev-social#782d809c68e2015536359aa7dceede9a3cdbb7f1
|
|
72
72
|
- search
|
|
73
73
|
- <exact research goal as one argument>
|
|
74
74
|
- --platform
|
|
@@ -126,7 +126,7 @@ Use only TikTok if its capability is reported as supported. Open details before
|
|
|
126
126
|
When the user explicitly asks for the local demo UI, start it on loopback only:
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
|
-
npx github:socai-io/jev-social#
|
|
129
|
+
npx github:socai-io/jev-social#782d809c68e2015536359aa7dceede9a3cdbb7f1 serve --port 8766
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
Report `http://127.0.0.1:8766`. Leave the process running only when the user asked for a local demo server, and do not expose it on a public interface.
|