Asi energy-awareness

Energy Awareness Skill

install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/energy-awareness" ~/.claude/skills/plurigrid-asi-energy-awareness && rm -rf "$T"
manifest: skills/energy-awareness/SKILL.md
source content

Energy Awareness Skill

Battery cycle clock with interaction entropy and ontology reconfiguration for computational resource awareness.

Overview

Integrates three temporal dynamics into a unified energy awareness system:

  1. Battery Cycle Clock - Cyclical energy/attention budget with golden spiral timing
  2. Interaction Entropy - Shannon entropy of tool/action frequency (2.59 bits baseline)
  3. Ontology Reconfiguration Rate - Sheaf condition violations per cycle

GF(3) Conservation Invariant

cycle_trit + entropy_trit + reconfig_trit ≡ 0 (mod 3)

When violated, system needs MINUS/PLUS injection to rebalance.

36-Cycle Color Chain

Each battery cycle (0-35) maps to a deterministic Gay.jl color:

CycleHexLCHRole
0#2321009.9589.12109.17Genesis dark
1#FFC19695.6475.6940.58Warm peach
34#002D7913.4560.90259.71Primary vertex
35#65947D60.4525.67155.23Sage green

Covariance Stream Vertices (High MI Hubs)

COVARIANCE_VERTICES = {
    34: 156.19,  # Primary: deep blue
    14: 153.03,  # Bright peach
    24: 151.91,  # Near-white
    19: 147.06,  # Deep red
    33: 142.47,  # Pink-white
    1: 131.00,   # Orange peach
}

Non-Adiabatic Breaks

Ergodicity-breaking jumps at:

  • [33 → 34]
    - 92.47 distance (LARGEST)
  • [0 → 1]
    - 88.41 distance (Genesis)
  • [14 → 15]
    - 83.83 distance
  • [19 → 20]
    - 79.66 distance

Golden Ratio Timing

  • Phase advancement: 137.508° per cycle (golden angle)
  • Duration: Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, 21... minutes)
  • Trit assignment:
    • 0° - 120°
      → +1 (PLUS, charging)
    • 120° - 240°
      → 0 (ERGODIC, steady)
    • 240° - 360°
      → -1 (MINUS, depleting)

Usage

Python: Unified Awareness Clock

from battery_cycle_ontology_clock import UnifiedAwarenessClock

clock = UnifiedAwarenessClock(seed=1337)

# Record interactions
clock.record_interaction("tool_call", "Read", trit=0)
clock.record_interaction("action", "gay-mcp-palette", trit=1)

# Record ontology changes
clock.record_ontology_change("add_edge", ["T-019b313a"], sheaf_violated=False)

# Tick the clock
state = clock.tick(energy_delta=0.1)

print(f"Cycle: {state.cycle.cycle_id}")
print(f"Phase: {state.cycle.phase_degrees}°")
print(f"Energy: {state.cycle.energy_budget}")
print(f"Entropy: {state.interaction_entropy} bits")
print(f"GF(3) balanced: {state.gf3_balanced}")

Julia: Gay.jl Color at Cycle

using Gay

# Get color for battery cycle
color = Gay.color_at(34)  # Primary vertex
println(color)  # #002D79

Babashka: Quick Energy Check

#!/usr/bin/env bb

(def PHI (/ (+ 1 (Math/sqrt 5)) 2))
(def GOLDEN_ANGLE 137.508)

(defn cycle->phase [n]
  (mod (* n GOLDEN_ANGLE) 360))

(defn phase->trit [phase]
  (cond
    (< phase 120) 1    ; PLUS
    (< phase 240) 0    ; ERGODIC  
    :else -1))         ; MINUS

(defn fibonacci [n]
  (loop [a 1 b 1 i 0]
    (if (>= i n) a
        (recur b (+ a b) (inc i)))))

;; Check current cycle
(let [cycle 23
      phase (cycle->phase cycle)
      trit (phase->trit phase)
      duration (fibonacci (mod cycle 12))]
  (println (str "Cycle " cycle ": phase=" phase "° trit=" trit " duration=" duration "min")))

DuckDB: Query Energy States

-- Check GF(3) conservation
SELECT SUM(gf3_trit) % 3 as remainder FROM intake_log;

-- Energy state over time
SELECT 
  logical_clock,
  gay_color,
  gf3_trit,
  SUM(gf3_trit) OVER (ORDER BY logical_clock ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) as rolling_sum
FROM intake_log
ORDER BY logical_clock;

Trit Semantics

Component-1 (MINUS)0 (ERGODIC)+1 (PLUS)
CycleDepleting phaseSteady phaseCharging phase
EntropyLow diversity (<1.0 bits)Moderate (1.0-2.5 bits)High diversity (>2.5 bits)
ReconfigChaotic (>30% violations)StableRapid healthy adaptation

Interrupt Handling

On tool interruption, GF(3) conservation is maintained:

NORMAL:    1 → -1 → 0  = 0 ✓
INTERRUPT: -1 → 0 → 1  = 0 ✓
RECOVERY:  0 → 1 → -1  = 0 ✓

Files

  • ~/ies/battery_cycle_ontology_clock.py
    - Main implementation
  • ~/ies/music-topos/lib/battery_cycle_color_driver.hy
    - Hy color driver
  • ~/ies/BATTERY_CYCLE_INTERRUPT_INTEGRATION.md
    - Architecture docs
  • ~/ies/rio/battery-menubar/
    - Swift menubar app

Verification

# Run the clock
python ~/ies/battery_cycle_ontology_clock.py

# Check GF(3) in DuckDB
duckdb ~/ies/music-topos/ducklake_increment.duckdb \
  "SELECT SUM(gf3_trit) % 3 FROM intake_log"

# Julia color check
julia -e 'using Gay; println(Gay.color_at(34))'

Mathematical Foundation

Based on:

  • Gay.jl scoped_propagators.jl (AncestryACSet materialization)
  • Knuth tesseract_discohy.hy (action/perception Galois loop)
  • Bumpus sheaf cohomology (adhesion_filter obstruction detection)
  • von Holst reafference/corollary discharge (interrupt detection)

End-of-Skill Interface

Integration with Other Skills

SkillRoleTrit
gay-mcpColor generation+1
reafference-corollary-dischargeInterrupt detection+1
bisimulation-gameBehavioral equivalence-1
duckdb-temporal-versioningTime-travel audit+1
acsetsRelationship navigation0

Autopoietic Marginalia

The interaction IS the skill improving itself.

Every use of this skill is an opportunity for worlding:

  • MEMORY (-1): Record what was learned
  • REMEMBERING (0): Connect patterns to other skills
  • WORLDING (+1): Evolve the skill based on use

Add Interaction Exemplars here as the skill is used.