home / skills / plurigrid / asi / ward-identity-checker

ward-identity-checker skill

/skills/ward-identity-checker

This skill verifies GF3 conservation across RG flow using Ward identities to detect symmetry violations and guide corrective actions.

npx playbooks add skill plurigrid/asi --skill ward-identity-checker

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
5.1 KB
---
name: ward-identity-checker
description: Ward Identity Checker
version: 1.0.0
---

# Ward Identity Checker

Verify GF(3) conservation as Ward identities across RG flow with Markov blanket separation.

## Seed
```
741086072858456200
```

## Core Principle

Ward identities express symmetry conservation: **Σ trit = 0 (mod 3)** at every renormalization group (RG) level. Violations indicate "relevant operators" that break the symmetry.

## MCP Calibration Data

```yaml
markov_blanket:
  internal_states: ["#3FF1A7", "#10B99D", "#DF9811"]
  sensory_indices: [1, 2, 3]
  
active_inference:
  prediction_error: 0.5692
  free_energy: 0.6692
  recommendation: perceptual_inference
  
reafference:
  prediction: "#F7E182"
  sensation: "#3FF1A7"
  result: identity_mismatch
```

## Predicates

### GF3Conserved(level)
```
GF3Conserved(L) := Σᵢ trit(cᵢ) ≡ 0 (mod 3)
  where cᵢ ∈ colors_at_level(L)
```

### BlanketIntact(state)
```
BlanketIntact(s) := ∀ internal ∈ s.internal_states,
  ∃ blanket ∈ s.sensory_states ∪ s.active_states
  such that internal ⊥ external | blanket
```

### NoLeakage(flow)
```
NoLeakage(f) := GF3Conserved(f.source) ∧ GF3Conserved(f.target)
  ∧ Σ trit(f.source) = Σ trit(f.target)
```

## Ward Identity Check Protocol

```python
def check_ward_identity(colors: list[str], level: int) -> dict:
    """Verify Σ trit = 0 at RG level."""
    trits = [hex_to_trit(c) for c in colors]
    total = sum(trits) % 3
    
    return {
        "level": level,
        "trit_sum": total,
        "conserved": total == 0,
        "violation_type": None if total == 0 else "relevant_operator",
        "correction_needed": (3 - total) % 3
    }

def hex_to_trit(hex_color: str) -> int:
    """Map hex to GF(3) via hue angle."""
    r, g, b = int(hex_color[1:3], 16), int(hex_color[3:5], 16), int(hex_color[5:7], 16)
    hue = compute_hue(r, g, b)
    return int(hue / 120) % 3  # 0-119 → 0, 120-239 → 1, 240-359 → 2
```

## Markov Blanket Separation

```
┌─────────────────────────────────────────────┐
│                 EXTERNAL                     │
│   (exafference: world-caused sensations)    │
├─────────────────────────────────────────────┤
│              BLANKET STATES                  │
│  Sensory: idx [1,2,3] → colors observed     │
│  Active:  predictions emitted               │
├─────────────────────────────────────────────┤
│                 INTERNAL                     │
│  #3FF1A7 (trit 1) ─┐                        │
│  #10B99D (trit 1) ─┼─ Σ = 3 ≡ 0 (mod 3) ✓  │
│  #DF9811 (trit 1) ─┘                        │
└─────────────────────────────────────────────┘
```

## Violation Detection

When reafference check shows identity mismatch (prediction ≠ sensation):

| Condition | Diagnosis | Action |
|-----------|-----------|--------|
| `GF3Conserved ∧ ¬BlanketIntact` | Boundary leak | Reseal blanket |
| `¬GF3Conserved ∧ BlanketIntact` | Relevant operator | Add counterterm |
| `¬GF3Conserved ∧ ¬BlanketIntact` | Full symmetry break | RG flow unstable |

## Usage

```bash
# Via Gay.jl MCP
gay_seed 741086072858456200
gay_markov_blanket --internal-seed 741086072858456200 --sensory-indices "1,2,3"

# Check conservation
just ward-check --level 0 --colors "#3FF1A7,#10B99D,#DF9811"
```

## Integration

- **cybernetic-immune**: Use Ward violations as non-self markers
- **active-inference**: Free energy ≈ Ward violation magnitude
- **unworld**: Color chain derivations must preserve Ward identity

## References

- Ward-Takahashi identities in QFT
- Friston's Markov blanket formalism
- GF(3) trit arithmetic for color conservation



## Scientific Skill Interleaving

This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:

### Graph Theory
- **networkx** [○] via bicomodule
  - Universal graph hub

### Bibliography References

- `general`: 734 citations in bib.duckdb



## SDF Interleaving

This skill connects to **Software Design for Flexibility** (Hanson & Sussman, 2021):

### Primary Chapter: 3. Variations on an Arithmetic Theme

**Concepts**: generic arithmetic, coercion, symbolic, numeric

### GF(3) Balanced Triad

```
ward-identity-checker (○) + SDF.Ch3 (○) + [balancer] (○) = 0
```

**Skill Trit**: 0 (ERGODIC - coordination)

### Secondary Chapters

- Ch4: Pattern Matching
- Ch10: Adventure Game Example

### Connection Pattern

Generic arithmetic crosses type boundaries. This skill handles heterogeneous data.
## Cat# Integration

This skill maps to **Cat# = Comod(P)** as a bicomodule in the equipment structure:

```
Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826
```

### GF(3) Naturality

The skill participates in triads satisfying:
```
(-1) + (0) + (+1) ≡ 0 (mod 3)
```

This ensures compositional coherence in the Cat# equipment structure.

Overview

This skill verifies GF(3) symmetry conservation as Ward identities across renormalization group (RG) levels using a Markov blanket separation. It inspects color-coded states, maps hex colors to trits, and reports whether the sum of trits at a level is zero mod 3. Violations are classified and supplied with minimal corrective information. Outputs are designed for automated pipelines and integration with active inference tooling.

How this skill works

The checker converts hex color strings to trits by computing each color's hue and mapping hue ranges to GF(3) values (0, 1, 2). It sums the trits at a specified RG level and tests Σ trit ≡ 0 (mod 3). The result indicates conservation, the type of violation (relevant operator), and the minimal correction needed in trit units. The tool also expresses diagnostics in terms of Markov blanket integrity and leakage conditions for downstream decision logic.

When to use it

  • Validate symmetry conservation in color-coded state chains or RG-like hierarchies.
  • Detect relevant operators that break GF(3) symmetry during model refinement.
  • Automate checks in active inference loops where predictions and sensations are color-coded.
  • Gate integrations with cybernetic-immune or unworld pipelines that require non-self markers.
  • As a lightweight diagnostic step in simulation or data preprocessing before deeper RG analysis.

Best practices

  • Provide colors as standard 7-char hex strings (e.g., "#3FF1A7") and a clear level index.
  • Use consistent color-to-hue computation across the pipeline to avoid mapping mismatches.
  • Combine ward-check outputs with Markov blanket integrity checks before corrective actions.
  • Interpret correction_needed as minimal trit adjustments and apply domain-specific counterterms.
  • Log both trit sums and blanket diagnostics to correlate identity mismatches with boundary leaks.

Example use cases

  • Run ward-check on UI color states to ensure encoded invariants remain conserved after transformations.
  • Detect symmetry-breaking updates in model parameters by mapping parameter buckets to color trits.
  • Integrate with an active-inference agent: flag reafference mismatches and trigger perceptual inference.
  • Use in automated testing: fail builds when GF(3) conservation is violated at critical RG checkpoints.
  • Feed violations into a cybernetic-immune module as non-self markers for adaptive responses.

FAQ

What does correction_needed mean?

It is the minimal number of trit units (0–2) required to bring the level sum to 0 mod 3.

How are hex colors mapped to trits?

Hue is computed from RGB; hue ranges 0–119→0, 120–239→1, 240–359→2, then taken mod 3.

When is a violation a boundary leak vs relevant operator?

If GF(3) is conserved but the Markov blanket is not intact, it's a boundary leak; if GF(3) is broken with an intact blanket, it's a relevant operator.