Skip to main content Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/plurigrid/asi --skill behaviour-surprisal-analysisThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... CONCOMITANT_SKILLS.md 1.1 KB Related occupations SOC
Based on SOC occupation classification
name behaviour-surprisal-analysis description Behaviour Surprisal Analysis version 1.0.0
Behaviour Surprisal Analysis
Status : Production Ready (v3.0 - Cat# Integration)
Trit : 0 (ERGODIC - measurement/observation)
Principle : S(x) = -logโ(P(x|attention_mode))
Frame : Tri-channel prediction evaluation with AGM belief revision + Cat# bicomodule structure
Overview
Behaviour Surprisal Analysis calculates information-theoretic surprise between predictions and observed outcomes using three complementary attention channels mapped to Cat# = Comod(P) structure:
Channel Trit Home Poly Op Kan Role Description Direct (ฮฑ)โ1 Span ร (product) Ran_K Exact artifact matching Diffuse (ฮฒ)0 Prof โ (parallel) Adj Thematic/structural matching Meta (ฮณ)+1 Presheaves โ (substitution) Lan_K Capability/infrastructure tracking
Total Surprisal = ฮฑยทS_direct + ฮฒยทS_diffuse + ฮณยทS_meta
where ฮฑ + ฮฒ + ฮณ = 1 and typically ฮฑ=0.3, ฮฒ=0.5, ฮณ=0.2
SDF Interleaving
This skill connects to Software Design for Flexibility (Hanson & Sussman, 2021):
Primary Chapter: 5. Evaluation Concepts : eval, apply, interpreter, environment
GF(3) Balanced Triad behaviour-surprisal-analysis (โ) + SDF.Ch5 (โ) + [balancer] (โ) = 0
Skill Trit : -1 (MINUS - verification)
Secondary Chapters
Ch1: Flexibility through Abstraction
Ch4: Pattern Matching
Ch6: Layering
Ch10: Adventure Game Example
Connection Pattern Evaluation interprets expressions. This skill processes or generates evaluable forms.
Cat# Integration (v3.0)
Galois Adjunction ฮฑ โฃ ฮณ The Direct and Meta channels form a Galois adjunction through the Diffuse bridge:
ฮฑ (abstract)
Direct โโโโโโโโโโโโโโ Diffuse
โ โ
โ CatSharp โ ฮณ (concretize)
โ Scale โ
โโโโโโโโโโโโโโโโโโโโโโโโ
Meta
GF(3): (โ1) + (0) + (+1) = 0 โ
ฮฑ (abstraction) : Direct predictions โ Diffuse patterns
ฮณ (concretization) : Diffuse patterns โ Direct predictions
Unit ฮท : id โ ฮณโฮฑ verifies coherence
Three Homes (Spivak ACT 2023) Each channel lives in a specific Cat# home:
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ Channel โ Poly Op โ Kan Role โ Structure โ Home โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโค
โ Direct โ ร (prod) โ Ran_K โ cofree t_p โ Span โ
โ Diffuse โ โ (para) โ Adj โ bicomodule โ Prof โ
โ Meta โ โ (subst) โ Lan_K โ free m_p โ Presheaves โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโ
Bicomodule Coherence Predictions and observations form bicomodule pairs. Coherence is verified by:
Galois unit check : ฮท: id โ ฮณโฮฑ preserves trits
Bicomodule compatibility : pred_trit โ obs_trit compatible homes
CatSharp Scale Sonification Surprisal values map to pitch classes via the CatSharp scale:
Trit Pitch Classes Chord Type Hz Range +1 (PLUS) {0, 4, 8} Augmented triad C-E-G# 0 (ERGODIC) {3, 6, 9} Diminished 7th D#-F#-A-C โ1 (MINUS) {1,2,5,7,10,11} Fifths cycle C#,D,F,G,A#,B
;; Surprisal โ Pitch class โ Frequency
(defn surprisal->pitch-class [surp]
(mod (Math/round (* (min surp 10.0) 1.2)) 12))
(defn pitch-class->freq [pc]
(* 261.63 (Math/pow 2 (/ pc 12.0)))) ;; C4 = 261.63 Hz
Enable with --sonify flag to hear the surprisal as tones via sox.
AGM Belief Revision (Levi Identity) K * ฯ = (K โ ยฌฯ) + ฯ (Levi Identity)
Contraction (K โ ยฌฯ) : Remove predictions contradicted by observations
Expansion (+ ฯ) : Add new beliefs from observed data
Revision (K * ฯ) : Combined operation via Levi identity
Spohn ฮบ-Ranking Predictions ranked by entrenchment:
(defn kappa-rank [belief]
(- (Math/log (/ 1 (max 0.01 (:confidence belief))))))
Lower ฮบ = more entrenched = harder to revise.
Usage
bb ~/.claude/skills/behaviour-surprisal-analysis/analyse.bb \
--predictions predictions.json \
--observed observed.json \
--alpha 0.3 --beta 0.5 --gamma 0.2 \
--sonify
bb analyse.bb \
--predictions predictions.json \
--observed observed.json \
--skills-before skills_t0.txt \
--skills-after skills_t30.txt
bb analyse.bb --alpha 0.7 --beta 0.2 --gamma 0.1
bb analyse.bb --alpha 0.1 --beta 0.3 --gamma 0.6 --sonify
Input Format {
"predictions" : {
"direct" : [
{ "content" : "Ruby MCP SDK for skill markets" , "confidence" : 0.8 } ,
{ "content" : "VirtualizationBridge sandbox test" , "confidence" : 0.7 }
] ,
"diffuse" : [
{ "theme" : "GF(3) conservation" , "keywords" : [ "trit" , "lattice" , "conservation" ] } ,
{ "theme" : "skill markets" , "keywords" : [ "confidential" , "commitment" , "beacon" ] }
] ,
"meta" : {
"skills_before" : 45 ,
"mcp_servers_before" : 12 ,
"config_hash" : "a3f2c1"
}
} ,
"observed" : {
"threads" : [
"Ruby MCP SDK for confidential skill markets" ,
"GF(3) skill composition and Galois connection verification" ,
"Derangement operators and GF(3) entropy management"
] ,
"capability_events" : [
{ "type" : "skill_install" , "count" : 373 , "source" : "plurigrid/asi" } ,
{ "type" : "mcp_addition" , "server" : "world_a_aptos" }
]
}
}
Output Format โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BEHAVIOUR SURPRISAL ANALYSIS v3.0 (Cat# + AGM) โ
โ ฮฑ=0.30 (Span/Ran) ฮฒ=0.50 (Prof/Adj) ฮณ=0.20 (Presh/Lan) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
DIRECT ATTENTION (Home: Span, Kan: Ran_K)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Prediction โ Match โ S_dir โ Trit โ PC โ Home
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโผโโโโโโโโผโโโโโโโผโโโโโผโโโโโ
VirtualizationBridge sandbox โ 34.9% โ 1.52 โ + โ 2 โ Span
...
CAT# COHERENCE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Galois adjunction ฮฑ โฃ ฮณ: โ coherent
Bicomodule compatibility: 85.0% (โ)
CATSHARP SONIFICATION
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โช Direct (Ran_K): 293.7 Hz
โช Diffuse (Adj): 329.6 Hz
โช Meta (Lan_K): 261.6 Hz
GF(3) Triads The skill participates in balanced triads:
behaviour-surprisal-analysis (0) โ catsharp-galois (0) โ gay-mcp (-1) + operad-compose (+1) = 0 โ
# Internal channel triad
Direct (โ1) + Diffuse (0) + Meta (+1) = 0 โ
Attention Calibration Prediction Style Recommended (ฮฑ,ฮฒ,ฮณ) Cat# Focus Specific artifacts (0.6, 0.3, 0.1) Span heavy Thematic directions (0.2, 0.6, 0.2) Prof heavy Capability exploration (0.2, 0.3, 0.5) Presheaves heavy Mixed/balanced (0.3, 0.5, 0.2) Bicomodule equilibrium
API (require '[behaviour-surprisal-analysis :as bsa])
;; Full Cat# analysis
(bsa/combined-analysis
predictions observed
0.3 0.5 0.2 ;; ฮฑ ฮฒ ฮณ
before-state after-state
capability-events
true) ;; sonify?
;; Galois adjunction verification
(bsa/verify-galois-unit direct-result)
;; Bicomodule coherence check
(bsa/check-bicomodule-coherence direct diffuse meta)
;; Sonify channel
(bsa/sonify-channel results "Direct" 0.3)
Philosophical Foundation The tri-channel Cat# model reflects:
Cat# Three Homes : Span (comodules), Prof (bimodules), Presheaves (right modules)
Kan Extensions : Ran_K (limit/consume), Lan_K (colimit/generate), Adj (bridge)
Galois Adjunction : ฮฑ โฃ ฮณ for abstraction/concretization
AGM Epistemology : Contraction, Expansion, Revision via Levi identity
CatSharp Scale : Mazzola's categorical music theory for sonification
Key Insight: GF(3) = Naturality GF(3) conservation IS the naturality condition of Cat# equipment:
For a triad (sโโ, sโ, sโโ):
Ran_K(sโโ) โ[bicomodule]โ sโ โ[bicomodule]โ Lan_K(sโโ)
The commuting square:
G(f) โ ฮท_A = ฮท_B โ F(f)
Becomes the GF(3) equation:
(โ1) + (0) + (+1) โก 0 (mod 3)
Skill Name : behaviour-surprisal-analysis
Version : 3.0.0 (Cat# Integration)
Type : Prediction Evaluation / Information Theory / Belief Revision / Category Theory
Trit : 0 (ERGODIC)
GF(3) : Conserved via Cat# bicomodule structure
Dependencies : sox (optional, for sonification)
Sources :
More from this repository