Cybernetic Core

32 files

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

Util

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

TS99 lines3,339 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

Exporter

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

TS108 lines3,453 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

Messages

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

TS96 lines2,425 bytes
pi-cyberneticsource

Goal State

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

TS60 lines1,669 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

Tool Registry

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

TS50 lines1,294 bytes
pi-cyberneticsource

Metrics

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

TS73 lines1,903 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

Index

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

TS4 lines110 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-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

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

Semantic Store

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

TS51 lines1,626 bytes
pi-cyberneticsource

Procedural Store

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

TS78 lines2,391 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

Episodic Store

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

TS51 lines1,621 bytes
pi-cyberneticsource

Performance Log

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

TS68 lines1,718 bytes
pi-cyberneticsource

Meta

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

TS315 lines12,010 bytes
pi-cyberneticsource

Consolidation

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

TS78 lines2,583 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

Strategic

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

TS387 lines13,868 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-cyberneticsource

Management

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

TS371 lines14,227 bytes
pi-cyberneticsource

Memory

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

TS186 lines7,712 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

Index

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

TS5 lines155 bytes
pi-cyberneticsource

Confidence Calibrator

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

TS59 lines1,723 bytes