본문으로 건너뛰기
cccskills
무료GitHub에 공개

cognitive-surrogate

```yaml name: cognitive-surrogate description: Layer 6 Barton Cognitive Surrogate System - build, train, and validate psychological models that predict and generate authentic responses matching a subject's cognitive patterns version: 1.0.0 trit: 0 # Ergodic/coordinator role in GF(3) triadic system ```

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md9.5 KB
  • CONCOMITANT_SKILLS.md2.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Cognitive Surrogate

name: cognitive-surrogate
description: Layer 6 Barton Cognitive Surrogate System - build, train, and validate psychological models that predict and generate authentic responses matching a subject's cognitive patterns
version: 1.0.0
trit: 0  # Ergodic/coordinator role in GF(3) triadic system

Overview

The Cognitive Surrogate skill enables construction of high-fidelity psychological models from interaction patterns. It extracts values, predicts intellectual trajectories, and generates authentic responses that preserve the subject's voice with >90% fidelity.

Core Principle: A surrogate is not an imitation but a derivational continuation - the model learns the generative grammar of cognition, not surface patterns.

NEW (Langevin/Gibbs Integration): Predictions now use Gibbs distribution from Langevin analysis. Confidence scores reflect mixing time and temperature parameters.

Key Capabilities

1. build-psychological-profile

Extract structured psychological profile from interaction corpus:

profile = build_psychological_profile(
    corpus=[threads, emails, writings],
    dimensions=[
        "values",           # Core beliefs, ethical framework
        "interests",        # Topic affinities, curiosity patterns
        "communication",    # Tone, formality, humor markers
        "reasoning",        # Deductive vs intuitive, uncertainty handling
        "social",           # Collaboration style, conflict patterns
    ],
    seed=gay_seed          # Deterministic via gay-mcp
)

Output ACSets Schema:

@present SchProfile(FreeSchema) begin
    Value::Ob; Interest::Ob; Pattern::Ob
    name::Attr(Value, String)
    weight::Attr(Value, Float64)
    topic::Attr(Interest, String)
    frequency::Attr(Interest, Int)
    exemplar::Attr(Pattern, String)
end

2. train-predictor

Train next-topic and next-response predictors:

predictor = train_predictor(
    profile=profile,
    corpus=corpus,
    model_type="markov_transformer",  # or "hmm", "lstm", "gpt_finetune"
    context_window=8,                  # conversation turns
    validation_split=0.15
)

# Predict likely next topics given conversation state
next_topics = predictor.predict_topics(
    context=current_thread,
    top_k=5,
    temperature=0.7
)

3. validate-fidelity

Measure surrogate fidelity against held-out data:

fidelity = validate_fidelity(
    surrogate=predictor,
    test_corpus=held_out_threads,
    metrics=[
        "topic_prediction_accuracy",   # Target: >0.85
        "response_semantic_sim",       # Target: >0.90
        "style_consistency",           # Target: >0.88
        "value_alignment",             # Target: >0.92
    ],
    threshold=0.90  # Overall fidelity threshold
)

assert fidelity.overall >= 0.90, f"Fidelity {fidelity.overall} below threshold"

Fidelity Report:

┌─────────────────────────┬────────┬────────┐
│ Metric                  │ Score  │ Target │
├─────────────────────────┼────────┼────────┤
│ topic_prediction        │ 0.87   │ 0.85   │
│ semantic_similarity     │ 0.91   │ 0.90   │
│ style_consistency       │ 0.89   │ 0.88   │
│ value_alignment         │ 0.94   │ 0.92   │
├─────────────────────────┼────────┼────────┤
│ OVERALL                 │ 0.9025 │ 0.90   │
└─────────────────────────┴────────┴────────┘

4. generate-authentic-reply

Generate text matching subject's voice:

reply = generate_authentic_reply(
    surrogate=predictor,
    context=conversation_history,
    prompt=incoming_message,
    constraints={
        "max_tokens": 500,
        "preserve_uncertainty": True,  # Don't overclaim knowledge
        "style_lock": True,            # Enforce style consistency
    },
    gay_seed=thread_seed  # Reproducible generation
)

# Reply includes confidence and divergence markers
print(reply.text)
print(f"Confidence: {reply.confidence}")
print(f"Style divergence: {reply.style_delta}")

5. predict-via-gibbs-distribution (NEW)

Use Gibbs distribution from Langevin dynamics for predictions:

# Instead of generic pattern matching
# Use p(pattern | θ) ∝ exp(-L(θ)/T) from Langevin
prediction = gibbs_based_prediction(
    state=current_state,
    temperature=0.01,  # From Langevin analysis
    loss_fn=pattern_energy,
    mixing_time=500    # Estimated convergence time
)

# Adaptive confidence based on equilibration
confidence = estimate_equilibrium(
    steps_so_far=n,
    mixing_time=tau_mix,
    temperature=T
)

# Returns:
# - prediction: Most likely next state
# - confidence: P(equilibrium reached)
# - temperature_influence: How much T affected prediction

6. project-trajectory

Predict intellectual/professional trajectory:

trajectory = project_trajectory(
    profile=profile,
    horizon="6_months",
    dimensions=[
        "research_interests",
        "skill_acquisition", 
        "collaboration_patterns",
        "publication_topics",
    ],
    monte_carlo_samples=1000,
    seed=gay_seed
)

# Returns probability distributions over future states
for dim, distribution in trajectory.items():
    print(f"{dim}: {distribution.mode} (p={distribution.confidence:.2f})")

Integration: gay-mcp

All stochastic operations use gay-mcp deterministic seeding:

from gay_mcp import GaySeed, derive_color

# Create reproducible surrogate session
session_seed = GaySeed.from_thread(thread_id)
profile_color = derive_color(session_seed, "profile")  # trit=0
training_color = derive_color(session_seed, "train")   # trit=1
validation_color = derive_color(session_seed, "valid") # trit=2

# GF(3) conservation: 0 + 1 + 2 ≡ 0 (mod 3)
assert (profile_color.trit + training_color.trit + validation_color.trit) % 3 == 0

Integration: acsets

Profile data stored as attributed C-sets:

using ACSets

# Define cognitive schema
@acset_type CognitiveProfile(SchProfile)

# Populate from extraction
profile = CognitiveProfile()
add_part!(profile, :Value, name="intellectual_honesty", weight=0.95)
add_part!(profile, :Interest, topic="category_theory", frequency=47)
add_part!(profile, :Pattern, exemplar="tends to use analogies from music")

# Query patterns
high_values = incident(profile, x -> x.weight > 0.8, :Value)

GF(3) Trit Assignment

ComponentTritRole
cognitive-surrogate0Coordinator/ergodic - orchestrates profile building
gay-mcp1Generator - provides deterministic randomness
acsets2Storage - structured data persistence

Conservation: 0 + 1 + 2 ≡ 0 (mod 3) — closed triadic system.

Usage Example

# Complete surrogate construction workflow
from cognitive_surrogate import (
    build_psychological_profile,
    train_predictor,
    validate_fidelity,
    generate_authentic_reply,
    project_trajectory
)
from gay_mcp import GaySeed

# Initialize with deterministic seed
seed = GaySeed.from_string("barton_surrogate_v1")

# 1. Build profile from corpus
profile = build_psychological_profile(
    corpus=load_interaction_corpus("barton_threads/"),
    seed=seed
)

# 2. Train predictor
predictor = train_predictor(profile, model_type="markov_transformer")

# 3. Validate fidelity
fidelity = validate_fidelity(predictor, test_corpus, threshold=0.90)
print(f"Fidelity: {fidelity.overall:.2%}")

# 4. Generate replies
reply = generate_authentic_reply(
    predictor,
    context=current_conversation,
    prompt="What do you think about applying category theory to social systems?"
)

# 5. Project trajectory
trajectory = project_trajectory(profile, horizon="1_year")
print(f"Predicted focus: {trajectory['research_interests'].mode}")

Ethical Considerations

  1. Consent: Only build surrogates with explicit subject consent
  2. Disclosure: Always disclose when surrogate-generated content is used
  3. Boundaries: Surrogates should refuse to act on high-stakes decisions
  4. Audit Trail: All generations logged with gay-mcp seeds for reproducibility
  5. Kill Switch: Subject can invalidate surrogate at any time

Files

skills/cognitive-surrogate/
├── SKILL.md                    # This file
├── src/
│   ├── profile_builder.py      # Psychological extraction
│   ├── predictor.py            # Training and prediction
│   ├── fidelity.py             # Validation metrics
│   ├── generator.py            # Authentic reply generation
│   └── trajectory.py           # Future projection
├── schemas/
│   └── cognitive_acset.jl      # ACSets schema definitions
└── tests/
    └── test_fidelity.py        # >90% threshold tests

See Also

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Model ElevenLabs voice synthesis as an ACSet schema with Unison ability handlers for typed voice operations. Use when integrating ElevenLabs TTS into category-theoretic pipelines, building typed voice synthesis workflows, or managing multi-voice narration with GF(3) conservation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

Systematic process for analyzing and modernizing legacy applications to comply with the 12-Factor App methodology. Covers code analysis, configuration externalization, dependency management, and container/Kubernetes best practices.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

13c0e3

무료

Gay MCP skill at invocation 26

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

19d57d

무료

Gay MCP skill at invocation 5

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

1ea91a

무료

Gay MCP skill at invocation 27

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

1eab21

무료

Gay MCP skill at invocation 3

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

plurigrid의 스킬 모두 보기

이 스킬의 문제 신고