Skip to content

v0.2.0 — Metacognitive Layer

Latest

Choose a tag to compare

@logoserg-cmd logoserg-cmd released this 08 Aug 19:21
· 1 commit to main since this release

What's New

v0.2 is a new product, not an evolution of v0.1. An external metacognitive layer for autonomous AI agents.

Formula: observe → remember → recognize pattern → formulate cognitive problem → gentle reflection → agent decides → Cogneti remembers outcome.

No second LLM. The entire cognitive engine is deterministic, mathematical, local.


Core Engine (10 modules, ~2500 lines)

  • Working Memory — structured cognitive workspace with bounded sliding windows
  • Cognitive State — 8 deterministic dimensions (goalAlignment, progress, exploration, stability, contradiction, uncertainty, contextLoad, stagnation)
  • Pattern Recognition — 8 detectors (5 coding + 3 universal) with severity, confidence, evidence
  • FSM — 4-state cognitive progression: HEALTHY → WATCH → STAGNATING → STUCK (always recoverable)
  • Metacognitive Intervention — evidence-based reflections (never commands, 2-4 sentences, one at a time)
  • Recovery — deterministic reframing with alternative strategies
  • Budgets — infrastructure hard limits (tokens, tool calls, wall time)
  • Trajectory — JSONL recorder for calibration data

Adapters

  • OpenCode V1 (adapters/opencode-v1.ts) — tested ✅
  • OpenCode V2 (adapters/opencode.ts) — for future V2 API

Tested With

Component Details
Agent OpenCode v1.18.15
Model Qwen3.6 27B (Q4 GGUF, 17GB) via llama.cpp
Hardware 2× RTX 3060 12GB (24GB VRAM), 64GB RAM
Context 96K tokens, temperature 0.6
Result Plugin loads, hooks fire, FSM tracks state, trajectories record ✅

Documentation

  • README.md — installation, usage, tested-with, comparison
  • ARCHITECTURE.md — 541 lines, full module-by-module breakdown
  • CHANGELOG.md — version history

Bug Fixes (code review)

  • simpleHash deduplication → extracted to core/utils.ts
  • trajectory.ts flush() — dynamic → static import (sync writes)
  • parseGitDiff regex — matched both --- and +++, fixed to +++ only
  • computeContradiction — broken negation logic fixed
  • Plugin loading — added id field to default export (required by OpenCode V1)

Full changelog: CHANGELOG.md

Architecture: ARCHITECTURE.md