Asi hydra-graphql-interactome

Hydra-GraphQL Interactome 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/hydra-graphql-interactome" ~/.claude/skills/plurigrid-asi-hydra-graphql-interactome && rm -rf "$T"
manifest: skills/hydra-graphql-interactome/SKILL.md
source content

Hydra-GraphQL Interactome Skill

Hierarchical query language for security DAO interactomes with Move/Aptos bridge

Overview

┌─────────────────────────────────────────────────────────────────────────────┐
│                    HYDRA-GRAPHQL HIERARCHY                                   │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   Degree 0 (Root)                                                            │
│        │                                                                     │
│   ┌────┴────┐                                                                │
│   │  HEAD   │ ←── Security DAO Core                                          │
│   └────┬────┘                                                                │
│        │                                                                     │
│   ┌────┴────┬────────┬────────┐                                              │
│   ▼         ▼        ▼        ▼                                              │
│ Degree 1  Degree 1  Degree 1  Degree 1                                       │
│ (Audit)   (Bridge)  (Move)    (Aptos)                                        │
│    │         │        │         │                                            │
│    ▼         ▼        ▼         ▼                                            │
│ Degree 2+ (Personalized Author Nodes)                                        │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

GF(3) Trit Classification

TritRoleQuery Pattern
-1 (MINUS)Sink/AuditSecurity vulnerability queries
0 (ERGODIC)BridgeCross-chain interoperability
+1 (PLUS)Source/DeployNew module deployment

Hydra Query Structure

# Hydra multi-head query for security DAO interactome
query SecurityDAOInteractome($org: String!, $degree: Int!) {
  # Head 1: Organization core
  organization(login: $org) {
    repositories(first: 100, orderBy: {field: STARGAZERS, direction: DESC}) {
      nodes {
        name
        description
        stargazerCount
        primaryLanguage { name }
        
        # Degree expansion - contributors
        collaborators(first: $degree) @include(if: $degree > 0) {
          nodes {
            login
            contributionsCollection {
              totalCommitContributions
            }
          }
        }
        
        # Security advisories (MINUS trit)
        vulnerabilityAlerts(first: 10) {
          nodes {
            securityVulnerability {
              severity
              package { name }
            }
          }
        }
      }
    }
  }
  
  # Head 2: Related security topics
  search(query: "topic:security topic:dao topic:move", type: REPOSITORY, first: 20) {
    nodes {
      ... on Repository {
        nameWithOwner
        description
        homepageUrl
      }
    }
  }
}

Move/Aptos Bridge Queries

Degree-Personalized Author Expansion

# Personalize by contributor degree from security DAO
query PersonalizedMoveSecurityDegree($author: String!, $degree: Int!) {
  user(login: $author) {
    # Degree 0: Direct repos
    repositories(first: 50, orderBy: {field: PUSHED_AT, direction: DESC}) {
      nodes {
        name
        languages(first: 5) {
          nodes { name }
        }
        # Filter for Move language
        @include(if: containsMove)
      }
    }
    
    # Degree 1: Following network
    following(first: $degree) @include(if: $degree >= 1) {
      nodes {
        login
        repositories(first: 10) {
          nodes @filter(language: "Move") {
            nameWithOwner
          }
        }
      }
    }
    
    # Degree 2: Followers' repos
    followers(first: $degree) @include(if: $degree >= 2) {
      nodes {
        login
        repositories(first: 10) @filter(hasTopic: "aptos") {
          nodes {
            nameWithOwner
            description
          }
        }
      }
    }
  }
}

Security DAO Organizations Index

OrganizationFocusTritKey Repos
aptos-labs
Move runtime0aptos-core, aptos-wallet
MystenLabs
Sui Move0sui, sui-move
move-language
Spec/VM0move
otter-sec
Security audit-1solana-verify
openzeppelin
Contracts-1openzeppelin-contracts
sherlock-protocol
Audit platform-1sherlock-v2-core
code4rena
Audit contests-1code-contests
consensys
Enterprise0quorum
daostack
DAO framework+1arc, alchemy
aragon
DAO infra+1aragon-core

Hierarchical Degree Navigation

#!/usr/bin/env python3
"""
Hydra query executor with degree personalization.
"""
# /// script
# requires-python = ">=3.11"
# dependencies = ["gql[aiohttp]", "rich"]
# ///

from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport

GITHUB_GRAPHQL = "https://api.github.com/graphql"

HYDRA_QUERY = gql("""
query HydraSecurityDAO($org: String!, $degree: Int!) {
  organization(login: $org) {
    repositories(first: 50) {
      nodes {
        name
        description
        stargazerCount
        collaborators(first: $degree) {
          nodes { login }
        }
      }
    }
  }
}
""")

async def expand_degree(client, org: str, degree: int) -> dict:
    """Expand interactome to specified degree."""
    result = await client.execute_async(
        HYDRA_QUERY,
        variable_values={"org": org, "degree": degree}
    )
    return result

def personalize_by_author(nodes: list, author: str) -> list:
    """Filter and weight nodes by author proximity."""
    return [
        n for n in nodes 
        if author in [c['login'] for c in n.get('collaborators', {}).get('nodes', [])]
    ]

def compute_degree_trit(degree: int) -> int:
    """Map degree to GF(3) trit."""
    return (degree % 3) - 1  # {-1, 0, +1}

bmorphism Interactome Bridge

Key Authors by Degree

DegreeAuthorsConnection
0bmorphismCore - plurigrid founder
1olynch, epattersAlgebraicJulia/Topos
1klazuka, simonsterAnthropic engineers
2jules-hedgesOpen games, optics
2mzarghamBlockScience/cadCAD
3dspivakPoly, MIT

Aptos Security Authors

AuthorRoleRepos
aptos-labs/security
Core teamaptos-core security
MoveBit
Audit firmmove-lint
zellic-audit
Security auditorMove audits
OtterSec
Audit firmVarious

Justfile Recipes

# Hydra query at degree
hydra-query org degree:
    @echo "🐉 Hydra query: {{org}} degree={{degree}}"
    gh api graphql -f query='
    {
      organization(login: "{{org}}") {
        repositories(first: 20) {
          nodes { name stargazerCount }
        }
      }
    }'

# Personalize by author
hydra-personalize author org:
    @echo "👤 Personalizing {{org}} for {{author}}"
    gh api graphql -f query='
    {
      user(login: "{{author}}") {
        following(first: 50) {
          nodes { login }
        }
      }
    }'

# Move security network
hydra-move-security degree:
    @echo "🔒 Move security degree={{degree}}"
    gh api graphql -f query='
    {
      search(query: "language:Move topic:security", type: REPOSITORY, first: 20) {
        nodes {
          ... on Repository { nameWithOwner description }
        }
      }
    }'

# Aptos bridge
hydra-aptos-bridge module:
    @echo "🌉 Aptos bridge: {{module}}"
    curl -s "https://api.mainnet.aptoslabs.com/v1/accounts/0x1/modules" | jq '.[].abi.name' | head -10

GF(3) Conservation

Every Hydra query expansion must conserve:

Σ trits = 0 (mod 3)

Example 3-head query:

  • Head 1 (Audit): trit = -1
  • Head 2 (Bridge): trit = 0
  • Head 3 (Deploy): trit = +1
  • Sum: -1 + 0 + 1 = 0 ✓

End-of-Skill Interface

Commands

# Query security DAO interactome at degree 2
just hydra-query plurigrid 2

# Personalize by author
just hydra-personalize bmorphism aptos-labs

# Expand Move security network
just hydra-move-security 3

# Bridge to Aptos
just hydra-aptos-bridge "0x1::coin"

Integration with Gay.jl Colors

using Gay

# Seed from interactome hash
seed!(hash("security-dao-interactome") % 2^32)

# Color each degree
for degree in 0:3
    c = color_at(degree + 1)
    trit = mod(degree, 3) - 1
    println("Degree $degree: $(c.hex) trit=$trit")
end

Related Skills

  • bmorphism-interactome
    - Core bmorphism network
  • gh-interactome
    - General GitHub network discovery
  • aptos-agent
    - Aptos blockchain interaction
  • acsets-algebraic-databases
    - ACSet patterns for graph data
  • gay-mcp
    - Deterministic color generation

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.