pi-cybernetic subproject

101 files

pi-cyberneticdoc

2026 06 12 030341 Cusersmikesdownloadsmulti Loop Interactive

▐▛███▜▌ Claude Code v2.1.174 ▝▜█████▛▘ Fable 5 · Claude Pro ▘▘ ▝▝ ~/leverage-loops-projects/pi-cybernetic ▎ Fa…

TXT2,490 lines128,085 bytes
pi-cyberneticdoc

Agents

# pi-cybernetic — agent notes > Stub created by atlas-onboard.sh — extend with project-specific facts. - **Codebase qu…

MD7 lines378 bytes
pi-cyberneticdoc

Agents

# phase0-gate-governance — agent notes > Stub created by atlas-onboard.sh — extend with project-specific facts. - **Co…

MD7 lines387 bytes
pi-cyberneticsource

Analyze Batches

import { Agent } from "@earendil-works/pi-agent-core"; import { getModel } from "@earendil-works/pi-ai"; import { Type }…

TS139 lines5,068 bytes
pi-cyberneticconfig

Assemble Review

[]

{}2 lines3 bytes
pi-cyberneticconfig

Assembled Graph

{ "nodes": [ { "id": "document:FILE_INDEX.md", "type": "document", "name": "FILE_INDEX", "…

{}201 lines4,900 bytes
pi-cyberneticconfig

Batch 1

{ "nodes": [ { "id": "document:FILE_INDEX.md", "type": "document", "name": "FILE_INDEX", "filePath": "FILE_INDEX.m…

{}12 lines1,066 bytes
pi-cyberneticconfig

Batch 2

{ "nodes": [ { "id": "file:examples/live-run.ts", "type": "file", "name": "live-run.ts", "filePath": "examples/liv…

{}16 lines2,106 bytes
pi-cyberneticconfig

Batch 3

{ "nodes": [ { "id": "file:src/util.ts", "type": "file", "name": "util.ts", "filePath": "src/util.ts", "summary": …

{}10 lines601 bytes
pi-cyberneticconfig

Batches

{ "schemaVersion": 1, "algorithm": "louvain", "totalFiles": 40, "totalBatches": 3, "exportsByPath": { "exa…

{}408 lines10,721 bytes
pi-cyberneticscript

Bootstrap

#!/usr/bin/env bash # bootstrap.sh — install Phase 0 gate governance into a target repo. # # Usage: ./bootstrap.sh /hom…

SH104 lines4,432 bytes
pi-cyberneticdoc

Changes

# CHANGES.md — Deviations from the Approved Phase 0 Amendment Per standing instruction: architecture improvements appli…

MD121 lines5,619 bytes
pi-cyberneticdoc

Claude

# pi-cybernetic Read `AGENTS.md` in this directory — it is the source of truth for working here. Codebase index: `CODEA…

MD5 lines132 bytes
pi-cyberneticdoc

Claude

# phase0-gate-governance Read `AGENTS.md` in this directory — it is the source of truth for working here. Codebase inde…

MD5 lines141 bytes
pi-cyberneticconfig

Clean Scan

{ "name": "@leverageai/pi-cybernetic", "description": "Concentric cybernetic control harness (5 loops, 6 principles)…

{}259 lines5,865 bytes
pi-cyberneticdoc

Codeatlas

# CODEATLAS.md — queryable codebase index for this repo This repo is indexed by **code-atlas** (deterministic tree-sitt…

MD33 lines1,871 bytes
pi-cyberneticdoc

Codeatlas

# CODEATLAS.md — queryable codebase index for this repo This repo is indexed by **code-atlas** (deterministic tree-sitt…

MD33 lines1,979 bytes
pi-cyberneticsource

Confidence Calibrator

/** P5 — Brier-score confidence calibration over (stated confidence, outcome) pairs. */ import type { Escalation } from…

TS59 lines1,723 bytes
pi-cyberneticsource

Config

/** Harness configuration — one section per loop. */ import type { ToolExecutionMode } from "@earendil-works/pi-agent-c…

TS129 lines4,146 bytes
pi-cyberneticsource

Consolidation

/** * Offline consolidation: Hippocampus -> Neocortex. * * This engine is intentionally not called from transformCont…

TS78 lines2,583 bytes
pi-cybernetictest

Consolidation.Test

import { describe, expect, test } from "bun:test"; import { ConsolidationEngine } from "../src/engines/consolidation.ts"…

TS31 lines1,388 bytes
pi-cyberneticsource

Cut Gate Version

#!/usr/bin/env python3 """cut_gate_version.py — the ONLY sanctioned way a gate pack changes (N15/N17). Creates gates/v<…

PY154 lines6,863 bytes
pi-cyberneticsource

Cybernetic Harness

/** * ADR-001 — Concentric Wrapper. One pi-agent Agent instance, four regulatory * layers attached through its hook su…

TS231 lines9,352 bytes
pi-cyberneticsource

Desideratum Gate

/** * ADR-004 — D1→D2→D3 enforced at runtime. Failed prerequisites put dependent * modules into degraded passthrough m…

TS59 lines1,580 bytes
pi-cyberneticsource

Dispatch Scanner

import { Agent } from "@earendil-works/pi-agent-core"; import { getModel } from "@earendil-works/pi-ai"; import { Type }…

TS114 lines3,693 bytes
pi-cyberneticsource

Dispatch Scanner V2

import { Agent } from "@earendil-works/pi-agent-core"; import { getModel } from "@earendil-works/pi-ai"; import { Type }…

TS99 lines3,846 bytes
pi-cyberneticsource

Dispatch Scanner V3

import { Agent } from "@earendil-works/pi-agent-core"; import { getModel } from "@earendil-works/pi-ai"; import { Type }…

TS99 lines3,833 bytes
pi-cyberneticsource

Drift Detector

/** P3 — semantic drift between execution trajectory and original spec. */ import type { Escalation } from "../types/in…

TS43 lines1,258 bytes
pi-cybernetictest

Enforcement.Test

/** * Unit tests for the enforcement bridge: classifySkill, buildArtifact, emitArtifact. * Tests deterministic mapping…

TS247 lines8,996 bytes
pi-cyberneticsource

Entropy Monitor

/** P6 — channel capacity tracking: context utilization, query/source entropy. */ import { estimateTokens, extractText,…

TS49 lines1,457 bytes
pi-cyberneticsource

Episodic Store

/** Episodic memory — raw traces with deterministic term-overlap retrieval. */ import type { InteractionTrace } from ".…

TS51 lines1,621 bytes
pi-cyberneticsource

Exporter

/** * exporter.ts — emits enforcement artifacts to a file-based queue. * * Callable from MetaEngine.consolidateLesson…

TS108 lines3,453 bytes
pi-cyberneticdoc

File Index

# FILE_INDEX — @leverageai/pi-cybernetic | File …

MD44 lines8,534 bytes
pi-cybernetictest

Fixtures

/** Shared deterministic test fixtures — mock the LLM, never the hooks. */ import { createAssistantMessageEventStream }…

TS128 lines3,508 bytes
pi-cyberneticsource

Gate Integrity

/** * gate-integrity.ts — Layer 1 runtime enforcement (A13 / N15 / N16). * * Verifies a spec's pinned gate reference …

TS137 lines5,182 bytes
pi-cyberneticsource

Gate Manifest

#!/usr/bin/env python3 """gate_manifest.py — single hashing authority for the gate governance system. Every component (…

PY264 lines10,973 bytes
pi-cyberneticsource

Gear Shifter

/** * Loop 4 — GearShifter. Deterministic memory router (ADR-005..009). * Preserves the MemoryEngine hook surface whil…

TS313 lines12,599 bytes
pi-cybernetictest

Gear Shifter.Test

import { describe, expect, test } from "bun:test"; import type { AgentMessage } from "@earendil-works/pi-agent-core"; im…

TS42 lines1,852 bytes
pi-cyberneticsource

Goal State

/** Loop 1 — goal homeostasis types (P3). */ export type GoalItemStatus = "pending" | "active" | "complete" | "failed";…

TS60 lines1,669 bytes
pi-cyberneticdoc

Governance

# Gate Governance (Phase 0) **Rule N15**: a gate pack file under `gates/v*/` is IMMUTABLE once it appears in `gates/MAN…

MD48 lines1,879 bytes
pi-cybernetictest

Harness.Test

/** * End-to-end: real Agent, real hooks, mock LLM (scripted streamFn). * Verifies the concentric wrapper against pi-a…

TS218 lines8,984 bytes
pi-cyberneticconfig

Import Input

{ "projectRoot": "/home/mikes/leverage-loops-projects/pi-cybernetic", "files": [ { "path": "examples/live-…

{}205 lines4,633 bytes
pi-cyberneticconfig

Import Output

{ "scriptCompleted": true, "stats": { "filesScanned": 40, "filesWithImports": 21, "totalEdges": 76 }, …

{}147 lines3,972 bytes
pi-cyberneticsource

Index

export * from "./types/index.ts"; export * from "./monitors/index.ts"; export * from "./storage/index.ts"; export * from…

TS8 lines246 bytes
pi-cyberneticsource

Index

/** * Enforcement artifact types — the bridge from pi-cybernetic Loop-5 lessons to * loom-builder gate enforcement art…

TS167 lines5,861 bytes
pi-cyberneticsource

Index

export * from "./goal-state.ts"; export * from "./metrics.ts"; export * from "./tool-registry.ts"; export * from "./memo…

TS7 lines188 bytes
pi-cyberneticsource

Index

export * from "./cybernetic-harness.ts"; export * from "./desideratum-gate.ts"; export * from "./ladders.ts";

TS4 lines110 bytes
pi-cyberneticsource

Index

export * from "./episodic-store.ts"; export * from "./semantic-store.ts"; export * from "./procedural-store.ts"; export …

TS5 lines151 bytes
pi-cyberneticsource

Index

export * from "./management.ts"; export * from "./strategic.ts"; export * from "./memory.ts"; export * from "./gear-shif…

TS7 lines192 bytes
pi-cyberneticsource

Index

export * from "./loop-detector.ts"; export * from "./confidence-calibrator.ts"; export * from "./drift-detector.ts"; exp…

TS5 lines155 bytes
pi-cyberneticdoc

Integration

# gate-integrity.ts — Harness Integration (Layer 1, A13) This module is the **unroutable layer**. Wire it into the disp…

MD47 lines2,089 bytes
pi-cyberneticconfig

Knowledge Graph

{ "version": "1.0.0", "project": { "name": "pi-cybernetic", "languages": ["typescript"], "frameworks": […

{}675 lines38,427 bytes
pi-cyberneticsource

Ladders

/** * Model escalation ladders — P2 variety expansion. * A ladder is an ordered list of rungs with strictly increasing…

TS61 lines1,995 bytes
pi-cyberneticconfig

Layers

[ { "id": "layer:core", "name": "Core", "description": "Core logic", "nodeIds": ["file:src/engines/man…

{}9 lines139 bytes
pi-cyberneticsource

Live Run

/** * Live-wire smoke run: real opencode-go model through the full 5-loop harness. * * set -a && source /home/mikes…

TS92 lines3,596 bytes
pi-cyberneticdoc

Llm Memory System Spec And User Guide

# LLM Memory System Guide Pointer Canonical guide: `C:\Users\mikes\.codex\codex_memory\projects\pi-cybernetic-memory-s…

MD12 lines511 bytes
pi-cyberneticsource

Loop Detector

/** P5 — action-sequence loop detection over a sliding window. */ import type { Escalation } from "../types/index.ts"; …

TS100 lines3,235 bytes
pi-cyberneticsource

Management

/** * Loop 2 — ManagementEngine. Variety allocator + feedback enforcer (P1, P2, P4). * Attaches via beforeToolCall (di…

TS371 lines14,227 bytes
pi-cybernetictest

Management.Test

import { describe, expect, test } from "bun:test"; import { ManagementEngine } from "../src/engines/management.ts"; impo…

TS325 lines14,039 bytes
pi-cyberneticsource

Memory

/** Loop 4 — three-level memory hierarchy types (P6). */ export interface InteractionTrace { id: string; kind: "too…

TS80 lines1,558 bytes
pi-cyberneticsource

Memory

/** * Loop 4 — MemoryEngine. Channel-capacity manager (P6). * Attaches via transformContext (entropy gate) and convert…

TS186 lines7,712 bytes
pi-cybernetictest

Memory.Test

import { describe, expect, test } from "bun:test"; import type { AgentMessage } from "@earendil-works/pi-agent-core"; im…

TS111 lines4,808 bytes
pi-cyberneticsource

Messages

/** * ADR-003 — inter-loop communication as custom AgentMessage types via * declaration merging. Carried in the transc…

TS96 lines2,425 bytes
pi-cyberneticconfig

Meta

{ "lastAnalyzedAt": "2026-06-12T09:00:00.000Z", "gitCommitHash": "da8405fb336c35c3119c207df7df307a1aa6cb30", "vers…

{}7 lines159 bytes
pi-cyberneticsource

Meta

/** * Loop 5 — MetaEngine. Second-order regulator (P5): watches the regulators, * extracts failure patterns, revises c…

TS315 lines12,010 bytes
pi-cybernetictest

Meta.Test

import { describe, expect, test } from "bun:test"; import { ManagementEngine } from "../src/engines/management.ts"; impo…

TS124 lines5,119 bytes
pi-cyberneticsource

Metrics

/** Cross-loop metric, escalation, and meta-learning types. */ export type LoopId = "strategic" | "management" | "execu…

TS73 lines1,903 bytes
pi-cybernetictest

Monitors.Test

import { describe, expect, test } from "bun:test"; import { LoopDetector } from "../src/monitors/loop-detector.ts"; impo…

TS97 lines3,898 bytes
pi-cyberneticconfig

Package

{ "name": "@leverageai/pi-cybernetic", "version": "0.1.0", "description": "Concentric cybernetic control harness (…

{}25 lines586 bytes
pi-cyberneticsource

Performance Log

/** Loop 5 raw data — structured event log for pattern analysis. */ export interface ToolExecutionRecord { toolName: …

TS68 lines1,718 bytes
pi-cyberneticdoc

Phase 0 Gate Governance.Ged Amendment

--- ged_version: 1 amends: pi-cybernetic-analysis-framework_ged.md amendment: phase-0-gate-governance status: SPEC_COMPL…

MD242 lines12,512 bytes
pi-cyberneticother

Pre Commit

#!/usr/bin/env bash # Versioned pre-commit shim (installed via `git config core.hooksPath .githooks`). # All logic lives…

·5 lines254 bytes
pi-cyberneticsource

Pre Commit Gate Guard

#!/usr/bin/env python3 """pre_commit_gate_guard.py — git pre-commit enforcement of N15 (layer 3). Rules: 1. Any stage…

PY126 lines4,956 bytes
pi-cyberneticsource

Pretooluse Gate Guard

#!/usr/bin/env python3 """pretooluse_gate_guard.py — Claude Code PreToolUse hook enforcing N15. Blocks Edit/Write/Multi…

PY105 lines3,779 bytes
pi-cyberneticsource

Procedural Store

/** Procedural memory — verified skills + working memory (active hypotheses). */ import type { ActiveHypothesis, Eviden…

TS78 lines2,391 bytes
pi-cyberneticdoc

Readme

# @leverageai/pi-cybernetic Concentric cybernetic control harness wrapping a single `@earendil-works/pi-agent-core` `Ag…

MD79 lines5,084 bytes
pi-cyberneticdoc

Readme

# Phase 0 — Gate Governance & Repo Hardening Execution package for the approved GED amendment (`phase-0-gate-governance…

MD57 lines2,596 bytes
pi-cyberneticsource

Register Pretooluse

#!/usr/bin/env python3 """register_pretooluse.py — safely register the gate guard in .claude/settings.json. Discipline …

PY80 lines3,193 bytes
pi-cyberneticconfig

Scan Result

{ "name": "@leverageai/pi-cybernetic", "description": "Concentric cybernetic control harness (5 loops, 6 principles)…

{}259 lines5,865 bytes
pi-cyberneticsource

Semantic Store

/** Semantic memory — compressed summaries + entity-relation tuples, with promotion. */ import type { CompressedSummary…

TS51 lines1,626 bytes
pi-cyberneticconfig

Skill Mraushge 3 1783441112415

{ "lessonId": "skill-mraushge-3", "occurrences": 1, "createdAt": "2026-07-07T16:18:32.415Z", "summary": "Lesson …

{}22 lines522 bytes
pi-cyberneticconfig

Skill Mrausy1Y 3 1783441133926

{ "lessonId": "skill-mrausy1y-3", "occurrences": 1, "createdAt": "2026-07-07T16:18:53.926Z", "summary": "Lesson …

{}22 lines522 bytes
pi-cyberneticconfig

Skill Mrauvlfl 3 1783441257537

{ "lessonId": "skill-mrauvlfl-3", "occurrences": 1, "createdAt": "2026-07-07T16:20:57.537Z", "summary": "Lesson …

{}22 lines522 bytes
pi-cyberneticconfig

Skill Mrauwn4U 3 1783441306399

{ "lessonId": "skill-mrauwn4u-3", "occurrences": 1, "createdAt": "2026-07-07T16:21:46.398Z", "summary": "Lesson …

{}22 lines522 bytes
pi-cyberneticsource

Spec Lint Gates

#!/usr/bin/env python3 """spec_lint_gates.py — lint dispatch specs for gate governance (N16 + fidelity). Checks, per sp…

PY149 lines6,453 bytes
pi-cyberneticsource

Strategic

/** * Loop 1 — StrategicEngine. Homeostatic regulator over Ω_goal (P3, P5). * * pi-agent-core 0.79 exposes `shouldSto…

TS387 lines13,868 bytes
pi-cybernetictest

Strategic.Test

import { describe, expect, test } from "bun:test"; import type { AgentMessage } from "@earendil-works/pi-agent-core"; im…

TS174 lines7,912 bytes
pi-cybernetictest

Test Gate Governance

#!/usr/bin/env python3 """test_gate_governance.py — N10 discipline applied to the governance system. Every enforcement …

PY238 lines11,790 bytes
pi-cyberneticsource

Tool Registry

/** Loop 2 — variety + reversibility registries (P2, P4). */ export type Reversibility = "read" | "recoverable" | "dest…

TS50 lines1,294 bytes
pi-cyberneticconfig

Tour

[ { "order": 1, "title": "Welcome", "description": "Start tour", "nodeIds": ["document:README.md"] }…

{}9 lines123 bytes
pi-cyberneticconfig

Tsconfig

{ "compilerOptions": { "target": "ES2023", "module": "ESNext", "moduleResolution": "bundler", "lib": […

{}20 lines501 bytes
pi-cyberneticconfig

Ua File Analyzer Input 1

{ "projectRoot": "/home/mikes/leverage-loops-projects/pi-cybernetic", "batchFiles": [ {"path": "FILE_INDEX.md", …

{}11 lines495 bytes
pi-cyberneticconfig

Ua File Analyzer Input 2

{ "projectRoot": "/home/mikes/leverage-loops-projects/pi-cybernetic", "batchFiles": [ {"path": "examples/live-ru…

{}13 lines777 bytes
pi-cyberneticconfig

Ua File Analyzer Input 3

{ "projectRoot": "/home/mikes/leverage-loops-projects/pi-cybernetic", "batchFiles": [ {"path": "src/util.ts", "l…

{}9 lines322 bytes
pi-cyberneticconfig

Ua File Extract Results 1

{ "scriptCompleted": true, "filesAnalyzed": 4, "filesSkipped": [], "results": [ { "path": "FILE_INDEX.…

{}161 lines3,306 bytes
pi-cyberneticconfig

Ua File Extract Results 2

{ "scriptCompleted": true, "filesAnalyzed": 6, "filesSkipped": [], "results": [ { "path": "examples/li…

{}1,617 lines42,673 bytes
pi-cyberneticconfig

Ua File Extract Results 3

{ "scriptCompleted": true, "filesAnalyzed": 2, "filesSkipped": [], "results": [ { "path": "src/util.ts…

{}338 lines7,536 bytes
pi-cyberneticconfig

Ua Import Map Input

{ "projectRoot": "/home/mikes/leverage-loops-projects/pi-cybernetic", "files": [ { "path": "examples/live-…

{}221 lines5,064 bytes
pi-cyberneticconfig

Ua Import Map Output

{ "scriptCompleted": true, "stats": { "filesScanned": 36, "filesWithImports": 21, "totalEdges": 76 }, …

{}143 lines3,877 bytes
pi-cyberneticconfig

Ua Scan Files

{ "scriptCompleted": true, "files": [ { "path": ".understand-anything/.understandignore", "language"…

{}376 lines8,856 bytes
pi-cyberneticsource

Util

/** Deterministic shared helpers — no LLM reasoning, no randomness beyond ids. */ let idCounter = 0; export function n…

TS99 lines3,339 bytes