Skip to content

Commit 640d8cc

Browse files
Copilotfermga
andcommitted
Verify canonical operators from source code
Co-authored-by: fermga <203334638+fermga@users.noreply.github.com>
1 parent e0810dc commit 640d8cc

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/grammar/03-OPERATORS-AND-GLYPHS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,25 @@ Emission()(G, 0)
9393
print(f"EPI after emission: {G.nodes[0]['EPI']:.3f}") # > 0
9494
```
9595

96+
### Anti-Patterns
97+
```python
98+
# ✗ WRONG: Using Emission in middle of sequence without purpose
99+
[Emission, Coherence, Emission, Coherence, Silence] # Redundant second emission
100+
101+
# ✓ CORRECT: Single emission to initialize
102+
[Emission, Coherence, Silence]
103+
```
104+
105+
### Relationships
106+
- **Can precede**: All operators (generator role)
107+
- **Should follow**: Nothing (starts sequences from vacuum/dormant state)
108+
- **Often followed by**: Coherence (IL) to stabilize new structure
109+
110+
### Test References
111+
- `tests/unit/operators/test_emission_irreversibility.py` - Structural irreversibility
112+
- `tests/unit/operators/test_emission_metrics.py` - EPI and νf validation
113+
- `tests/unit/operators/test_emission_preconditions.py` - Precondition enforcement
114+
96115
---
97116

98117
## 2. Reception (EN) 📡
@@ -143,6 +162,27 @@ Reception()(G, 0) # Node 0 receives from node 1
143162
print(f"EPI after reception: {G.nodes[0]['EPI']:.3f}")
144163
```
145164

165+
### Anti-Patterns
166+
```python
167+
# ✗ WRONG: Reception without coupling (no network connectivity)
168+
G = nx.Graph()
169+
G.add_node(0, EPI=0.5, vf=1.0, theta=0.0, dnfr=0.0)
170+
Reception()(G, 0) # No neighbors - violates precondition
171+
172+
# ✓ CORRECT: Couple first, then receive
173+
Coupling()(G, 0, 1)
174+
Reception()(G, 0)
175+
```
176+
177+
### Relationships
178+
- **Must precede**: Coupling (UM) or existing network connectivity
179+
- **Can follow**: Any operator that establishes network structure
180+
- **Often follows**: Coupling (UM) to receive from newly coupled nodes
181+
182+
### Test References
183+
- `tests/unit/operators/test_reception_preconditions.py` - Network connectivity validation
184+
- `tests/unit/operators/test_reception_sources.py` - Source integration correctness
185+
146186
---
147187

148188
## 3. Coherence (IL) 🔒

0 commit comments

Comments
 (0)