Skip to content
ducklake-meta-cognitive logo

Ducklake Meta-Cognitive

ducklake-meta-cognitive

Meta-cognitive analysis patterns for DuckLake temporal introspection

plurigrid/asi0installs67stars

SKILL.md

Full skill instructions

Ducklake Meta-Cognitive

Version: 1.0.0 Status: Production Ready Created: 2025-12-21 System-Level Orchestration

Overview

Loads meta-cognitive synthesis and provides system-level orchestration functions for mapping mentions to categories, computing derivation chains, verifying SPI compliance, and scheduling triadic execution.

Purpose

Enable meta-cognitive operations across the entire ducklake ecosystem:

  • Category mapping (3 meta-cognitive worlds)
  • Derivation chain computation (unworld semantics)
  • SPI compliance verification (strong parallelism invariance)
  • Triadic execution scheduling (GF(3) balanced streams)

Data Sources

  • Primary: /​Users/​bob/​ies/​DUCKLAKE_META_COGNITIVE_SYNTHESIS.json
  • Subagent Inputs: Temporal analysis, semantic analysis, pattern discovery
  • Integration: All 4 other ducklake skills

Functions

map_to_category(mention: str) -> str

Map mention to meta-cognitive category.

category = map_to_category("ducklake time-travel query")
# Returns: "world_hopping_duckdb_analysis"

category = map_to_category("ACSet morphism composition")
# Returns: "acset_neighbor_pluralism"

category = map_to_category("reafferent color detection")
# Returns: "ies_augmentation_cognitive_superposition"

Categories:

  1. world_hopping_duckdb_analysis (RED, GF3=0, 27.8%)
    • Temporal navigation, time-travel, versioning
  2. acset_neighbor_pluralism (YELLOW, GF3=1, 38.9%)
    • Structural relationships, graph topology, morphisms
  3. ies_augmentation_cognitive_superposition (BLUE, GF3=2, 33.3%)
    • Signal integration, color identity, reafferent detection

Implementation:

import re
from typing import Literal

CategoryType = Literal[
    "world_hopping_duckdb_analysis",
    "acset_neighbor_pluralism",
    "ies_augmentation_cognitive_superposition"
]

CATEGORY_PATTERNS = {
    "world_hopping_duckdb_analysis": [
        r"time[- ]travel", r"temporal", r"version", r"snapshot",
        r"history", r"navigate", r"rollback", r"replay"
    ],
    "acset_neighbor_pluralism": [
        r"acset", r"morphism", r"categorical", r"schema",
        r"topology", r"graph", r"network", r"structural",
        r"neighbor", r"edge", r"vertex"
    ],
    "ies_augmentation_cognitive_superposition": [
        r"reafferent", r"color", r"gay[_\s]seed", r"detection",
        r"identity", r"cognitive", r"signal", r"integration",
        r"retromap", r"battery", r"gf3", r"trit"
    ]
}

def map_to_category(mention: str) -> CategoryType:
    mention_lower = mention.lower()
    scores = {cat: 0 for cat in CATEGORY_PATTERNS}

    for category, patterns in CATEGORY_PATTERNS.items():
        for pattern in patterns:
            if re.search(pattern, mention_lower):
                scores[category] += 1

    # Return category with highest score
    max_category = max(scores, key=scores.get)
    if scores[max_category] > 0:
        return max_category

    # Default: temporal (most common)
    return "world_hopping_duckdb_analysis"

compute_derivation_chain(seed: int, n_steps: int) -> list

Compute unworld derivation chain.

chain = compute_derivation_chain(seed=0x6475636b6c616b65, n_steps=18)
# Returns: [
#   {"step": 0, "seed": "0x6475636b6c616b65", "gf3": 0, "world": "world_hopping"},
#   {"step": 1, "seed": "0x9e3779b97f4a7c1a", "gf3": 1, "world": "acset_neighbor"},
#   ...
# ]

Derivation Formula:

seed_{n+1} = splitmix64(seed_n ⊕ fnv1a(event_n))
gf3_n = (seed_n >> 32) mod 3
world_n = WORLD_MAP[gf3_n]

Properties:

  • Deterministic (same seed → same chain)
  • GF(3) conserved: Σ gf3_i ≡ 0 (mod 3)
  • Temporal-free (no clock required)
  • Frame-invariant (observer-independent)

verify_spi_compliance(mentions: list) -> dict

Verify Strong Parallelism Invariance.

report = verify_spi_compliance([
    "mention 1", "mention 2", "mention 3", ...
])
# Returns: {
#   "spi_score": 0.94,
#   "parallelizable_percentage": 66.7,
#   "independent_mentions": 12,
#   "dependent_pairs": 3,
#   "gf3_conserved": true,
#   "convergence_verified": true
# }

SPI Tests:

  1. Reordering: Can mentions be arbitrarily reordered?
  2. Convergence: Do all reorderings reach same final state?
  3. GF(3) Conservation: Is Σ gf3_i ≡ 0 (mod 3)?
  4. XOR Commutativity: Does XOR reduction commute?

Guarantee:

∀ permutations π of mentions M:
  final_state(π(M)) = final_state(M)

schedule_triadic_execution(mentions: list) -> dict

Schedule 3 concurrent streams (RED, GREEN, BLUE).

schedule = schedule_triadic_execution([
    {"id": 1, "category": "impl", "complexity": 3},
    {"id": 2, "category": "doc", "complexity": 2},
    {"id": 3, "category": "test", "complexity": 5},
    ...
])
# Returns: {
#   "streams": {
#     "RED": [1, 4, 7, ...],
#     "GREEN": [2, 5, 8, ...],
#     "BLUE": [3, 6, 9, ...]
#   },
#   "total_time": 26,
#   "sequential_time": 56,
#   "speedup": 2.15,
#   "gf3_verified": true
# }

Stream Assignment:

  • RED (GF3=0): Technical/​implementation mentions
  • GREEN (GF3=1): Documentation/​reference mentions
  • BLUE (GF3=2): Testing/​validation mentions

Performance Metrics:

  • Total time (parallel execution)
  • Sequential time (baseline)
  • Speedup factor
  • Stream utilization
  • GF(3) balance

Usage Example

from skills.ducklake_meta_cognitive import *

# Load all mentions
mentions = load_all_mentions()  # From temporal + semantic skills

print("=== CATEGORY MAPPING ===")
categories = {}
for mention in mentions:
    cat = map_to_category(mention["text"])
    categories[cat] = categories.get(cat, 0) + 1

for cat, count in categories.items():
    pct = 100 * count / len(mentions)
    print(f"{cat}: {count} ({pct:.1f}%)")

print("\n=== DERIVATION CHAIN ===")
chain = compute_derivation_chain(seed=0x6475636b6c616b65, n_steps=18)
for step in chain[:3]:  # Show first 3 steps
    print(f"Step {step['step']}: {step['seed']} → {step['world']}")

gf3_sum = sum(step["gf3"] for step in chain)
print(f"GF(3) sum: {gf3_sum} ≡ {gf3_sum % 3} (mod 3)")

print("\n=== SPI VERIFICATION ===")
spi_report = verify_spi_compliance(mentions)
print(f"SPI Score: {spi_report['spi_score']:.2%}")
print(f"Parallelizable: {spi_report['parallelizable_percentage']:.1f}%")
print(f"GF(3) Conserved: {'✓' if spi_report['gf3_conserved'] else '✗'}")

print("\n=== TRIADIC SCHEDULING ===")
schedule = schedule_triadic_execution(mentions)
print(f"Total time: {schedule['total_time']} units")
print(f"Sequential time: {schedule['sequential_time']} units")
print(f"Speedup: {schedule['speedup']:.2f}x")
print(f"Stream distribution:")
for stream, items in schedule['streams'].items():
    print(f"  {stream}: {len(items)} items")

Skills Dependencies

  • world-hopping (category mapping, reachability)
  • unworld (derivation chains, temporal-free semantics)
  • triad-interleave (triadic scheduling)
  • spi-parallel-verify (SPI verification)

Integration Points

This skill orchestrates all other ducklake skills:

  1. Temporal Introspection: Provide mentions for categorization
  2. Semantic Analyzer: Enhance category mapping with intent
  3. Pattern Expansion: Use derivation chains for world hopping
  4. Categorical Model: Map categories to ACSet morphisms

Meta-Cognitive Loop

1. OBSERVE   → Record (timestamp + color)
2. STRUCTURE → Organize (ACSet graph)
3. RECOGNIZE → Identify (reafferent detection)
4. NAVIGATE  → Query (time-travel)
5. CLOSURE   → Loop (mention 18 → mention 1)

Triadic Structure

           Temporal (world_hopping)
                /\
               /  \
              /    \
             / DUCK \
            /  LAKE  \
           /  (HUB)   \
          /            \
         /​______________\
   Spatial          Cognitive
  (acset)       (ies_augmentation)

DuckLake is the Cartesian origin where all three axes intersect.

Key Invariants

  1. GF(3) Conservation: (∑ gf3_i) mod 3 = 0 for all slices
  2. Color Determinism: color(seed) = f(seed) where f is SplitMix64
  3. XOR Commutativity: (a ⊕ b) ⊕ c = a ⊕ (b ⊕ c)
  4. Triangle Inequality: d(W1, W3) ≤ d(W1, W2) + d(W2, W3)
  5. Reafferent Threshold: Recognition if hamming(xor) < 32 or dist < 0.5

Canonical Constants

const GAY_SEED = UInt64(1069)        # Reafferent identity
const DUCKLAKE_SEED = 0x6475636b6c616b65
const GOLDEN = 0x9e3779b97f4a7c15    # Golden ratio
const MIX1 = 0xbf58476d1ce4e5b9      # SplitMix64 mix 1
const MIX2 = 0x94d049bb133111eb      # SplitMix64 mix 2

Derivation Chain Statistics

  • Total steps: 19 (includes genesis)
  • World transitions: 14
  • GF(3) distribution: RED=5, YELLOW=8, BLUE=6
  • Balance: (5+8+6) mod 3 = 0 ✓
  • Emergent properties: Self-similarity, fractal depth, phase transitions

SPI Performance

  • Independent mentions: 12/​18 (66.7%)
  • Dependent pairs: 3
  • Parallel streams: 3
  • Speedup: 2.15x
  • SPI score: 0.94 (EXCELLENT)

GF(3) Distribution

This skill operates across ALL THREE categories (meta-level):

  • Orchestrates RED, YELLOW, BLUE
  • Maintains GF(3) balance
  • Ensures system-level closure

Skill Type: System Orchestration Color: MULTI (triadic synthesis) Polarity: GF(3) = 0 (balanced across all categories) Access Pattern: Read-only coordination

More skills from plurigrid

cargo logo
plurigrid/asi

cargo

Rust package manager (36 subcommands).

67 0
View

Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma...

67 0
View

**Status**: 🌳 Production Ready (upstream in StringZilla v3+) **Type**: High-Performance String Operations / SIMD-Accelerated Text Processing **Principle**: Zero-copy views, SIMD/SWAR acceleration, deterministic hashing **Frame**: Cross-language interoperability (C, C++, Python, Rust, Go, Swift, ...

67 0
View
conformal-ga logo
plurigrid/asi

conformal-ga

Conformal Geometric Algebra (CGA) for circles, spheres, and Möbius transformations

67 0
View

Verifies code implements exactly what documentation specifies for blockchain audits. Use when comparing code against whitepapers, finding gaps between specs and implementation, or performing compliance checks for protocol implementations.

67 0
View
zig-systems logo
plurigrid/asi

zig-systems

Systems programming and performance optimization using Zig. Provides low-level abstractions, memory-safe compiled code, and performance benchmarking. Use for system-level operations, optimization, and interoperability with C/POSIX APIs.

67 0
View
soliton-detection logo
plurigrid/asi

soliton-detection

Topological soliton detection and agency bridge with anyonic fusion algebra for concept composition

67 0
View
paypal-mcp logo
plurigrid/asi

paypal-mcp

PayPal MCP server integration for invoices, payments, subscriptions, disputes, and transaction reporting via @paypal/mcp.

67 0
View
unison logo
plurigrid/asi

unison

Unison language - content-addressed functional programming with abilities for effects, distributed computing, and structural types. Use for pure functional code, effect management, distributed systems, and refactoring-safe codebases.

67 0
View
tasks-acset logo
plurigrid/asi

tasks-acset

Google Tasks management via TasksACSet. Transforms task operations into GF(3)-typed Interactions, routes to triadic queues, detects saturation for task-zero-as-condensed-state.

67 0
View
c logo
plurigrid/asi

c

World C Skill

67 0
View
syrup logo
plurigrid/asi

syrup

Syrup binary serialization for OCapN/CapTP wire format. Canonical encoding for capability messages.

67 0
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