behaviour-surprisal-analysis
БесплатноБез исполняемых скриптовНе проверенBehaviour Surprisal Analysis
от plurigrid★ 73 звезды на GitHubОб этом скилле
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
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)
Based on Baker 2023:
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
# Full Cat# analysis with sonification
bb ~/.claude/skills/behaviour-surprisal-analysis/analyse.bb \
--predictions predictions.json \
--observed observed.json \
--alpha 0.3 --beta 0.5 --gamma 0.2 \
--sonify
# With capability tracking
bb analyse.bb \
--predictions predictions.json \
--observed observed.json \
--skills-before skills_t0.txt \
--skills-after skills_t30.txt
# Direct-heavy (Span home focus)
bb analyse.bb --alpha 0.7 --beta 0.2 --gamma 0.1
# Meta-heavy (Presheaves home focus)
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": "plur
Установить behaviour-surprisal-analysis в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл behaviour-surprisal-analysis?
Behaviour Surprisal Analysis
Как установить скилл behaviour-surprisal-analysis?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл behaviour-surprisal-analysis запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic