Skip to content
discohy-streams logo

discohy-streams - DiscoHy Operadic Color Streams

discohy-streams

DisCoPy categorical color streams via Hy with 3 parallel TAP streams

SKILL.md

Full skill instructions

discohy-streams - DiscoHy Operadic Color Streams

Overview

Provides personalized color streams using DisCoPy categorical diagrams via Hy (discohy). Each human gets a self-learning color embedding with 3 parallel streams, now extended with 7 operad variants for compositional structure.

Trit: 0 (ERGODIC - Coordinator) GF(3) Triad: three-match (-1) ⊗ discohy-streams (0) ⊗ gay-mcp (+1) = 0 ✓

Core Concepts

3 Parallel Streams (Balanced Ternary)

color://human-id/​LIVE      → +1 (forward, real-time)
color://human-id/​VERIFY    →  0 (verification, BEAVER)
color://human-id/​BACKFILL  → -1 (historical, archived)

7 DiscoHy Operad Variants

OperadFileTritStructure
Little Disks (E₂)discohy_operad_1_little_disks.py⊕ +1Configuration of non-overlapping disks
Cubes (E_∞)discohy_operad_2_cubes.py⊖ -1Hypercube parallel structures
Cactusdiscohy_operad_3_cactus.py⊖ -1Trees with cycles (self-modification)
Threaddiscohy_operad_4_thread.py⊙ 0Thread continuations + DuckDB
Gravitydiscohy_operad_5_gravity.lisp⊖ -1Moduli M_{0,n} with involutions
Modulardiscohy_operad_6_modular.bb⊕ +1Genus-labeled runtime polymorphism
Swiss-Cheesediscohy_operad_7_swiss_cheese.py⊕ +1Open/​closed for forward-only learning

GF(3) Total: (+1) + (-1) + (-1) + (0) + (-1) + (+1) + (+1) = 0 ✓

Libkind-Spivak Operads (AlgebraicDynamics)

From Sophie Libkind's thesis and AlgebraicJulia:

OperadTritDescription
Directed (⊳)+1Output→Input wiring diagrams
Undirected (○)-1Interface matching via pullback
Machines0State machines with dynamics
Dynamical+1Open ODEs: dx/​dt = f(x,u)

∞-Operads

ModelDescription
DendroidalTrees as colored operads (Cisinski-Moerdijk)
LuriecoCartesian fibrations over Fin_*
SegalQuillen equivalent to simplicial operads

DisCoPy Integration

from discopy.monoidal import Ty, Box, Id
from discopy.drawing import draw

# Types for operad network
LittleDisks = Ty('E₂')
Cubes = Ty('E_∞')
Thread = Ty('Thread')

# Morphisms (operad maps)
stabilize = Box('stabilization', LittleDisks, Cubes)
linearize = Box('linearization', LittleDisks, Thread)

# Compose diagram
diagram = stabilize >> linearize.dom @ linearize

Hy Usage

#!/​usr/​bin/​env hy
(import [discohy_thread_operad [RootedColorOperad build-operad-from-threads]])

;; Build operad from thread tree
(setv threads [
  {:id "T-001" :title "Root" :parent nil}
  {:id "T-002" :title "Child1" :parent "T-001"}
  {:id "T-003" :title "Child2" :parent "T-001"}])

(setv operad (build-operad-from-threads threads 0x42D))

;; Get operad variant
(.set-variant operad "dendroidal")

;; Compose operations
(setv composed (.compose operad "T-001" ["T-002" "T-003"]))

ACSet Schema for Operads

@present SchOperadNetwork(FreeSchema) begin
  Operad::Ob
  Morphism::Ob
  
  src::Hom(Morphism, Operad)
  tgt::Hom(Morphism, Operad)
  
  Name::AttrType
  Trit::AttrType
  
  name::Attr(Operad, Name)
  trit::Attr(Operad, Trit)
  morph_type::Attr(Morphism, Name)
end

@acset_type OperadNetwork(SchOperadNetwork)

Relational Interleaving

The 7 operads form a relational network (ACSet):

                    ┌─────────────┐
                    │   Modular   │⊕
                    └──────┬──────┘
                    ┌──────┴──────┐
               ┌────┴────┐   ┌────┴────┐
               │ Cactus  │⊖  │  Swiss  │⊕
               └────┬────┘   │ Cheese  │
                    │        └────┬────┘
                    ▼             │
               ┌─────────┐       │
               │ Thread  │⊙◄─────┘
               └────┬────┘
          ┌────────┼────────┐
          ▼        ▼        ▼
     ┌────────┐ ┌──────┐ ┌─────────┐
     │ Cubes  │⊖│Gravity│⊖│ Little  │⊕
     │  E_∞   │ │ M_0,n │ │ Disks   │
     └────────┘ └──────┘ └─────────┘

Triad Interleaving Schedule

Build balanced schedules with GF(3) = 0 per triplet:

from operads.relational_operad_interleave import build_triad_from_operads

triad = build_triad_from_operads()
schedule = triad.build_round_robin(7)

# Output:
#   0: cubes ⊗ thread ⊗ little_disks
#   1: cactus ⊗ thread ⊗ modular
#   2: gravity ⊗ thread ⊗ swiss_cheese
#   ...

DuckDB Integration

-- Query operad compositions
SELECT 
  src.name as source,
  tgt.name as target,
  m.morph_type,
  (src.trit + tgt.trit) % 3 as combined_trit
FROM operad_morphisms m
JOIN operads src ON m.src_id = src.id
JOIN operads tgt ON m.tgt_id = tgt.id;

-- Find GF(3)-conserving triads
SELECT o1.name, o2.name, o3.name
FROM operads o1, operads o2, operads o3
WHERE (o1.trit + o2.trit + o3.trit) % 3 = 0
  AND o1.id < o2.id AND o2.id < o3.id;

File Locations

src/​operads/
├── __init__.py                      # Registry
├── relational_operad_interleave.py  # ACSet + Triad
├── libkind_spivak_dynamics.py       # Directed/​Undirected/​Machines
└── infinity_operads.py              # Dendroidal + Lurie

scripts/
├── discohy_operad_1_little_disks.py
├── discohy_operad_2_cubes.py
├── discohy_operad_3_cactus.py
├── discohy_operad_4_thread.py
├── discohy_operad_5_gravity.lisp
├── discohy_operad_6_modular.bb
└── discohy_operad_7_swiss_cheese.py

Commands

# Run relational interleaving demo
python3 src/​operads/​relational_operad_interleave.py

# Run Libkind-Spivak operads
python3 src/​operads/​libkind_spivak_dynamics.py

# Test individual operad
python3 scripts/​discohy_operad_4_thread.py

See Also

  • acsets - Algebraic databases (schema category)
  • triad-interleave - GF(3) balanced scheduling
  • gay-mcp - Deterministic color generation
  • three-match - 3-SAT via colored subgraph isomorphism
  • world-hopping - Badiou triangle navigation

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

discohy-streams (+) + SDF.Ch3 (○) + [balancer] (−) = 0

Skill Trit: 1 (PLUS - generation)

Secondary Chapters

  • Ch9: Generic Procedures
  • Ch6: Layering
  • Ch1: Flexibility through Abstraction
  • 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.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View