MDEMG: Multi-Dimensional Emergent Memory Graph

Cognitive Substrate for Artificial Intelligence (AI)-Assisted Development

Onboarding deck · engineering-dense · ~115 min walkthrough

Last verified: 2026-10-22

Entry point: README.md · Speaker notes: mdemg-onboarding-notes.md

Speaker notes

Choose Your Path

Two walkthroughs branch from here.

Software Dev Onboarding End User
For Engineers / technical PMs building WITH MDEMG Operators who will USE a running MDEMG
Depth ~115 min engineering-dense lighter stub (expanding)
Covers substrate, retrieval, Low-Rank Adaptation (LoRA), Jiminy, UxTS, ops Command-Line Interface (CLI), dashboards, memory, alerts
Next Continue below ↓ (TOC → F1 Opening) Jump to End User →
Speaker notes

Table of Contents

F1 Opening → F2 Substrate → F3 Retrieval → F4 Jiminy + Enforcement + J17 → F5 LoRA + Qwen + Model Dist → F6 UxTS → F7 Ops → F8 CLI + Hooks + Model Context Protocol (MCP) → F9 Beta + Security + Dormant → F10 Conclusion

End User Path: U1 Opening → U2 Stack → U3 Memory → U4 Jiminy → U5 Recursive Self-Improvement Cycle (RSIC) → U6 UxTS → U7 Human-In-The-Loop (HITL) → U8 Learning → U9 Backup → U10 Logs → U11 Config → U12 Plugins → U13 Grafana → U14 CLI → U15 APIs+gRPC → U16 Alerts → U17 Next

§ Section Target Natural Q&A anchor
F1 Opening, mission + analogy + history + 10k-ft ~10 min after F1.5 recap
F2 Substrate Core, Neo4j Cognitive Memory Substrate (CMS), Hebbian, consolidation, Time-Series Database (TSDB) ~15 min ,
F3 Retrieval Pipeline, Reciprocal Rank Fusion (RRF) 4-column + fingerprinting + rerank ~12 min ,
F4 Jiminy + Enforcement + J17 (headline) ~25 min after F4.1 "why"
F5 LoRA + Qwen + Model Distribution ~14 min ,
F6 UxTS Framework Family, the forcing-function matrix ~8 min ,
F7 Ops, RSIC, Human-In-The-Loop (HITL), backup/restore, Grafana ~16 min ,
F8 CLI + Hooks + Model Context Protocol (MCP) + Multi-Instance ~7 min ,
F9 Beta + Security + Dormant Census ~5 min ,
F10 Conclusion, honest state + vision + Q&A ~8 min final (longest)

Use the left-margin sidebar for section + Graphs navigation. Clicking any acronym jumps to its glossary entry; a floating ← Return to Previous button appears at the top-right to jump back.

Speaker notes

F1 · Opening

Nav: ⇤ Table of Contents (TOC) · Notes ▸ F1 · F2 →

Speaker notes

What MDEMG Is Trying To Do

Help developers create software that connects in a manner that increases the likelihood of making better decisions.


MDEMG : artificial Neural Network (NN) :: internal dialogue : biological NN

MDEMG is the Large Language Model (LLM)'s persistent memory and cognitive substrate. Markdown files are REMINDERS AND KEYS only: real memory lives in Cognitive Memory Substrate (CMS) (Neo4j, mdemg-dev space).


History · Build Trajectory

Diagram 1
Speaker notes

Honest Pivots


Where We Are Today

Architecture pins ~105 in CLAUDE.md
LLM call sites 16 (all single-shot, no-tool-calling)
UxTS frameworks 16 (all Continuous Integration (CI)-gated)
Ingested languages 28 (verified via Universal Parser Test Specification (UPTS) specs)
Production model mdemg-llm-v1.Q5_K_M (Qwen3-14B base + Phase 5 Supervised Fine-Tuning (SFT) LoRA)
Benchmark aggregate 0.9188 on 16-task augmented eval
Open arc JIMINY-CEILING-BREAK-2 (follow rate ~13% → target ≥80%)
Speaker notes

MDEMG · System Overview

Diagram 2
Speaker notes

The 5-Layer Memory Hierarchy

Diagram 3
Speaker notes

Hot Path · What Happens On a Tool Use

Diagram 4
Speaker notes

The Recursive-Improvement Arc

Diagram 5
Speaker notes

How We Know It's Working

Metrics

Dashboards (8)

Alerts


F1 Recap → F2

  1. MDEMG = cognitive substrate, not a tool
  2. 5-layer hierarchy (L0 → L5) is what retrieval traverses
  3. Every tool use completes a hook → classify → observe → guide → feedback loop
  4. Four learning loops run at different time constants against the same substrate

Next: F2, Substrate Core (Neo4j CMS + Hebbian + consolidation)

Speaker notes

F2 · Substrate Core

Nav: ← F1 · ⇤ Table of Contents (TOC) · Notes ▸ F2 · F3 →

Speaker notes

F2.1 Neo4j CMS · What It Is


F2.1 Why Graph Over Vector-Only

Connections ARE the deliverable (vs. doc chunks).

The "better decisions through better connections" vision requires edges as first-class citizens, not metadata on docs.

Speaker notes

F2.1 How It Works · Node + Edge Schema

Diagram 6
Speaker notes

F2.1 The Tombstone Invariant

Never delete. Always is_archived=true + archive_reason + archived_at.


F2.1 Why It's Important


F2.1 How It Will Improve


F2.2 Hebbian Learning · 4 Paths

Diagram 7
Speaker notes

F2.2 Consolidation · 22-Phase Pipeline


F2.2 Incremental Hidden Clustering (CHURN-003)


F2.3 TSDB Telemetry Plane


F2.3 TSDB Writer + Reader Contract

Writer Buffered → periodic flush → CopyFrom
Reader Direct Structured Query Language (SQL) via pgxpool
Alert rules TSDB-query-Structured Query Language (SQL) (idle-safe COALESCE+aggregate)
Hypertables 7d chunks default (match telemetry family), 180d retention
Compression After 7d, segmentby + orderby policy

Idempotency: every writer resumes cleanly across restarts via SUPERVISOR-002 goroutine supervisor.

Speaker notes

F2.4 Ingest · 8 Entry Points Into The Substrate

Everything that lands as an L0 observation flows through one of these 8 surfaces. Each writes to Neo4j via conversation.Service.Observe after calling embedder.Embed.

# Function / Surface Transport Shape Typical caller
1 IngestCodebase mdemg ingest --path . Recursive tree-walk + tree-sitter symbol extraction Human + CI
2 IngestFileWatcher fsnotify daemon Debounced file-change events mdemg watch
3 IngestGitHook .claude/hooks/ post-commit Diff-driven incremental mdemg hooks install
4 IngestClaudeMemory MCP tool call Markdown + structured_data Claude Code
5 IngestLinear REST / webhook Issue / comment payload Linear integration
6 IngestWebScrape Plugin (INGESTION type) URL → markdown → chunks mdemg plugin
7 IngestWebhook POST /v1/ingest/webhook Arbitrary JSON Third-party CI
8 IngestObserveAPI POST /v1/conversation/observe Single-observation primitive Direct API callers

Shared pipeline (all 8 surfaces): detect obs_type → embed → surprise-score → write L0 node → fire reinforcement edges → trigger consolidation (if gates pass).

Code pointer: internal/ingest/ for file-walk and watchers; internal/plugins/scraper/ for the web scraper plugin; internal/api/handlers_conversation.go for the observe API.

Speaker notes

F2.5 UPTS · 28 Language Parsers + Parser SDK

UPTS = Universal Parser Test Specification. Each spec is a JSON contract pinning a language's parser output against golden fixtures — change the parser, the UPTS test fails, no silent drift.

C C++ C# CUDA
Cypher Dockerfile Go GraphQL
INI Java JSON Kotlin
Lua Makefile Markdown OpenAPI
PHP Protobuf Python Rust
SQL Shell Terraform TOML
TypeScript Extensible Markup Language (XML) YAML Ain't Markup Language (YAML) scraper_markdown

Purpose: tree-sitter extracts symbols (functions, classes, imports, declarations) for every indexed file. The symbol graph fuels F3's structural retrieval column + the IMPLEMENTS edges Jiminy uses for architectural guidance.

What a UPTS spec declares: query file path, fixture file path, expected symbol count, expected per-type counts, expected names. The CI gate make test-upts validates every spec against its fixture.

Building a new parser

The parser pipeline is plugin-based — add a language without touching core:

  1. Author the tree-sitter query at internal/symbols/queries/{lang}/ (one .scm file per node class).
  2. Add a UPTS spec at docs/lang-parser/lang-parse-spec/upts/specs/{lang}.upts.json + a fixture file at fixtures/{lang}/.
  3. Register the language in internal/symbols/registry.go (one map entry).
  4. CI gate make test-upts picks it up automatically; new specs land in the drift matrix.

Parser sidecar system: Go-based tree-sitter is the primary path. For languages without official Go bindings (ex: GraphQL), a sidecar binary pattern exists at internal/symbols/sidecar/ — invoked over a stable JSON protocol so the plugin stays language-agnostic.

Code pointer: internal/symbols/ for registry + ingest; internal/symbols/queries/ for per-language tree-sitter queries.

Speaker notes

F3 · Retrieval Pipeline

Nav: ← F2 · ⇤ TOC · Notes ▸ F3 · F4 →

Speaker notes

F3.1 RRF Retrieval · What It Is

Reciprocal Rank Fusion over 4 parallel columns.

Column Weight (default) Signal
Embedding 0.50 Cosine over vector-index
Best Matching 25 (BM25) 0.20 Lexical sparse
Graph 0.15 CO_ACTIVATED_WITH spreading
Structural 0.15 Typed-edge walk (via RETRIEVAL-TYPED-EDGES-002)

Default-on since Phase 13.1 (2026-05-03).

Speaker notes

F3.1 RRF · Why 4 Columns Beat 1

Single-signal retrieval misses different classes:

RRF fusion = 1 / (k + rank) with k=60, robust to score-scale differences across columns.

Speaker notes

F3.1 RRF · How It Works

Diagram 8
Speaker notes

F3.1 RRF · Score-Scale Contract

Downstream consumers MUST NOT hardcode absolute thresholds against RetrieveResult.Score.

The score scale changes when the scorer changes. Phase 13.1 Column-Voting dropped scales from >1.0 (legacy) to ~0.49–0.58 (RRF strong matches). This silently broke:

Fix: gate via config (RRF-calibrated default). RE-AUDIT every RetrieveResult.Score comparison on scorer change.

Speaker notes

F3.1 RRF · Why It's Important


F3.1 RRF · How It Will Improve

Shipped default-off (opt-in via Uniform Resource Locator (URL) param or .env flag):

Measurement first: operator decides enable-by-default based on real traffic.

Speaker notes

F3.2 Context Fingerprinting (Mini)

?context=auto    , vector-based query→fingerprint derivation
?strict_context=true, drop below Jaccard 0.25 pre-score
Speaker notes

F3.3 Sparse Retrieval Gate (Mini)


F3.4 Rerank (Mini)


F4 · Jiminy + Enforcement + J17

Nav: ← F3 · ⇤ TOC · Notes ▸ F4 · F5 →

Speaker notes

F4.1 Jiminy · What It Is

Inner-voice classifier: turns raw retrieval into imperative-ish guidance.

Endpoints:


F4.1 Jiminy · Why We Use It

The connection-layer bet: a well-tuned inner voice beats dumping raw retrieval into the agent's prompt.

Forcing function (pre-Jiminy):

Post-Jiminy: outcomes flow back → trust Exponential Moving Average (EMA) → surface weighting → feedback-driven corpus curation.

Speaker notes

F4.1 Jiminy · Flow (Mermaid)

Diagram 9
Speaker notes

F4.1 Jiminy · Four Levers

Lever What Default
A Surface composition quota (per-type weight + actionable fraction + abstraction cap) ON (quota=0.3)
B Effectiveness prior (soft re-rank by followed/surfaced ratio) ON (weight=0.3)
C Actionable direct-fetch (role-filtered cosine over constraint/correction partition) ON (topK=4, floor=0.55)
D L2+ concept bias (role+layer-filtered cosine; separate pool) OFF (default)

All config-driven. All measurement-decided default states. All reversible.

Speaker notes

F4.1 Jiminy · Classifier Semantics

Classifier = tier1 (embedding) + tier2 (LLM) with 3 credit clauses:

Clause Routes Config flag
Non-violation credit must_not + action-didn't-violate → not_applicable JIMINY_NONVIOLATION_CREDIT_ENABLED
Context-mismatch credit Durable rule + wrong context → not_applicable JIMINY_CONTEXT_MISMATCH_CREDIT_ENABLED
Mechanism-scope gate Mechanism-verb absent from action → not_applicable JIMINY_MECHANISM_SCOPE_CREDIT_ENABLED

All default-off in code (preserves Universal LLM Test Specification (ULTS) prompt hash pin); default-on in .env after live smoke.

Speaker notes

F4.1 Jiminy · Why It's Important

Follow rate is the receiver-side view of substrate quality.

The LLM-classifier metric partition (JIMINY-METRIC-PARTITION-001) splits the follow rate across 4 verifiability classes: classifier / process / hybrid / human. Only "classifier" has writer traffic today; others wait for their respective sinks.

Speaker notes

F4.1 Jiminy · How It Will Improve (JIMINY-CEILING-BREAK-2)

5-phase arc shipped progressively:

  1. Phase 1, Corpus purge (shipped JIMINY-CORPUS-003): 64 → 33 constraint nodes; audit kept quality rules, tombstoned noise
  2. Phase 2, Retrieval precision (LEVER-C-TIGHTEN-002): scope-gate for over-surfacing
  3. Phase 3, Classifier semantics (CLASSIFIER-CONTEXT-002): mechanism-scope hard-precedence gate
  4. Phase 4a, HITL velocity (shipped): keyboard-driven bulk-grade User Interface (UI) (0..4 keys, auto-advance)
  5. Phase 4b, Retrain: blocked on classifier follow-rate honest ≥20% + N=500+ gold corpus
  6. Phase 5, Model swap: future (post-beta)

Composite ceiling arithmetic: 12% + 5% + 10% + 15% + 10% + 25% = 77-80%+.

Speaker notes

F4.2 Enforcement Arc · 5 Sprints (Overview)

Sprint Delivered
ENFORCE-001 (2026-08-01) /strict default-on + alert-on-deny + fail-open-with-marker
ENFORCE-002 (2026-08-02) Bash coverage (2-check: destructive-guard fail-closed + classify fail-open + read-only whitelist)
ENFORCE-003 (2026-08-03) Operator escape-hatch override CLI (mdemg jiminy override apply) + JSONL audit
ENFORCE-004 (2026-08-03) blocked_true_positive + blocked_false_positive outcome types → RSIC-consumable
ENFORCE-005 (2026-08-03) Post-hoc missed-violation detector via correction observations

13 arch rules pinned to CLAUDE.md across the arc.

Speaker notes

F4.2 Enforcement · Deny Taxonomy

Diagram 10
Speaker notes

F4.2 Enforcement · Operator Escape Hatch

Time-boxed overrides so classifier false-positives don't deadlock.

mdemg jiminy override apply --constraint <code> \
  --reason "<required>" --duration 15m
mdemg jiminy override list [--session-id X]
mdemg jiminy override revoke --constraint <code>

F4.2 Enforcement · Auto-Execute (default-off)

ENFORCE-AUTO-EXECUTE elevates enforcement_false_positive_high from insight to real substrate mutation:

5-layer guard sequence:

  1. Empty TargetCode → skip
  2. ENFORCEMENT_AUTO_EXECUTE_ENABLED=false → skip (default)
  3. Protected space → skip
  4. Rate limit (3/hr) + per-code cooldown (24h) → skip
  5. _DRY_RUN=true → log-only (default)

Only when all 5 pass: archive_constraint_by_code fires with reversible is_archived=true + archive_reason.

Speaker notes

F4.2 Enforcement · Mode Selector

First-class enum: JIMINY_MODE=strict|suggest (default strict).

Settable from 3 surfaces:

Boot log: jiminy: mode strict|suggest ... session_id=claude-core

Speaker notes

F4.3 J17 Protocol · What It Is

Compressed-stateful message format over Jiminy's semantic payload.

J17:INIT|v1
CODES: C=constraint X=correction F=frontier D=decision P=pattern L=learning
SEV:   !=must ?=should ~=info
ESC:   0=clear 1=warned 2=escalated 3=blocked
FMT:   TYPE:SEV|code|[annotations]|esc:N|src:NODE_ID
ANN:   alt=use-instead neg=forbidden scope=applicability ctx=domain-context
TICKET: signed, echo back on resume
SEQ:    monotonic, report last_seq on resume
Speaker notes

F4.3 J17 · Tier Promotion Keyed on Comprehension

J17-TIER-GATE-001 flipped the T1-promotion gate from compliance-trust to Natural Language Inference (NLI)-measured comprehension.

Why: dense encoding's risk is incomprehension; trust (followed→1.0/ignored→0.2 Exponential Moving Average (EMA) ~0.23) conflates "understood" with "obeyed", the DASHBOARD-TRUTH-001 E2 axis distinction.

Speaker notes

F4.3 J17 · Agent Briefing Packet (v1.1)

Evidence-with-provenance reframe (vs. v1.0 compliance-doc shape).

Hash pinned: 5843d9d7acf61fb04a31fdc23f0860759bc82d74054b67650aee1a880ae70395

Speaker notes

F5 · LoRA + Qwen + Model Distribution

Nav: ← F4 · ⇤ TOC · Notes ▸ F5 · F6 →

Speaker notes

F5.1 LoRA on Qwen3-14B · mdemg-llm-v1 (What)

Production: single-tier LoRA on mlx-community/Qwen3-14B-4bit

Served as: GPT-Generated Unified Format (GGUF) Q5_K_M via llama-server :8102

Baseline aggregate: 0.9188 on 16-task augmented eval Beats: gpt-5.4-mini (0.8317)

Speaker notes

F5.1 LoRA · Why Fine-Tune Our Own

The connection-layer bet applied to the LLM itself.

Rejected alternative: OpenAI fine-tuning (FT-OAI-003 dropped 2026-04-22), all FT now local MLX LoRA, teacher-only for OpenAI.

Speaker notes

F5.1 LoRA · Pipeline

Diagram 11

Conversion time: ~5 min on M5 Max.

Speaker notes

F5.1 LoRA · Standing Policies

No tool-calling architectural policy:

Overfitting prevention (forcing function: FT-OAI-001 step-1200 overfit):


F5.1 LoRA · Why It's Important


F5.1 LoRA · How It Will Improve


F5.2 Recursive-Retraining Loop

Diagram 12

Default-off: FT_LOOP_ENABLED=false. 4-phase arc complete (Phases 6a / 6b / 7 / 9).

Speaker notes

F5.2 Recursive Loop · Why Default-Off

Single-flight invariant: ledger (ft_training_cycles) is source of truth for "is a cycle running," NOT RSIC 300s in-memory cooldown.

Compute lease (ftloop.AcquireLease, single-host lockfile) reclaimable on expiry so crashed trainer can't wedge RSIC forever.

Quiesce: OrchestrationPolicy.Quiesce(until) pauses new RSIC triggers while retrain holds box (on-box training saturates machine + degrades production llama-server).

Speaker notes

F5.2 Recursive Loop · Promotion Defense in Depth (Phase 7)

3 layers protect production serving:

  1. Pre-swap structural canary: zero-restart block if candidate doesn't resolve
  2. Fail-closed SwapServing via NEW serving symlink FT_LOOP_SERVING_SYMLINK
  3. Post-swap tripwire: auto-rollback on failure within configurable window

Autonomy knob: FT_LOOP_AUTO_PROMOTE_AFTER (tick-based, after N operator confirms; 0=never)

Every layer drilled live same-day.

Speaker notes

F5.3 Model Distribution · mdemg model

mdemg model pull [--adapter] [--quant Q5_K_M]
mdemg model list
mdemg model verify
mdemg model remove --name mdemg-llm-v1 --yes
mdemg model where

Channel: Ollama Library (v1; pluggable via Fetcher interface)


F5.3 Model Dist · How It Works

Steps per mdemg model pull:

  1. ollama pull reh3376/mdemg-llm-v1:Q5_K_M under the hood
  2. Locate GGUF via Ollama manifest layout (<OLLAMA_MODELS>/manifests/<OLLAMA_HOST>/<ns>/<name>/<tag>)
  3. Follow layer with mediaType: application/vnd.ollama.image.model
  4. Symlink blob to <MDEMG_MODEL_DIR>/<name>.<quant>.gguf
  5. Secure Hash Algorithm (SHA)-verify against embedded internal/cli/quant_manifest.json

RAM auto-detection via sysctl hw.memsize (darwin) or /proc/meminfo (linux); dispatch via MDEMG_MODEL_RAM_TIERS JavaScript Object Notation (JSON).

Speaker notes

F5.3 Why Not Ollama/LM Studio/MLC-LLM Runtime

Decision table from 2026-05-03 bake-off (phase_13_5_bakeoff_results.md):

Alternative Rejected because
Ollama runtime Broken on M5 + macOS 26.3.x (8+ open issues, matmul2d static_assert)
LM Studio Closed-source operability risk for a cognitive-substrate framework
MLC-LLM 1.6× slower every percentile; smaller community; hardware-target-locked TVM .dylib
mlx_lm.server (incumbent) Officially "not recommended for production"; crashed every ~14 min Metal OOM
llama.cpp llama-server (chosen) Architecturally-bounded KV (--ctx-size × --parallel); graceful Hypertext Transfer Protocol (HTTP) 500 on OOM

Bake-off result: 0 crashes / 160 min / 301 calls; p50 latency 17s → 3.0s (5.6× faster); UVTS parity (0.396 = 0.396).

Speaker notes

F6 · UxTS Framework Family

Nav: ← F5 · ⇤ TOC · Notes ▸ F6 · F7 →

Speaker notes

F6.1 UxTS · What It Is

16 framework specifications, each a schema + spec dir + CI runner + matrix adjudication.

UATS     API contract tests
UVTS     Validation retrieval-quality tests
ULTS     LLM task tests (system prompts, hashes)
UBTS     Benchmark tests
UOBS     Observability metric contracts
UITS     Ingestion tests
UDTS     Datasets tests
UETS     Error-handling tests
UOTS     Operational artifact contracts
UATS01   Agent task contracts
UBENCH   Benchmark framework
UAITS    Agent-interaction tests
UDTS     Dataset tests (second-generation)
UTDS     Training dataset specs
USTS     Symbol tests
UAMS     Agent memory specs

Source of truth: docs/development/UXTS_FRAMEWORK_MATRIX.md

Speaker notes

F6.1 UxTS · Why We Use It

Forcing function: when a drift class is caught, the fix is a UxTS spec that CI gates on.

Prevents regression by making the drift class itself impossible.

Examples caught by UxTS gates:


F6.1 UxTS · How It Works (Pattern)

Diagram 13

Pattern invariants:


F6.1 UxTS · Framework Matrix (Snapshot)

Framework Purpose CI gate Last drift caught
UATS Application Programming Interface (API) contract make test-api UATS-GAP-001 (reformulate 500)
UVTS Retrieval quality make test-uvts-quick Phase 13.1 column weights
ULTS LLM prompts make test-ults --verify-hashes APE-PROMPT-BUDGET-001
UBTS Backup tests make test-ubts BACKUP-RESTORE-VERIFY-001
UOBS Metric emission drift checker EMBED-CALLSITE-001/002
UBENCH Benchmark make test-ubench-contract FT-BENCH-REFRESH-001

(remaining frameworks per matrix)

Speaker notes

F6.1 UxTS · Why It's Important

CI gating means a class never re-opens once a drift is spec'd.

Speaker notes

F6.1 UxTS · How It Will Improve

The matrix is the honest answer to "what have we locked down?"

Speaker notes

F7 · Ops

Nav: ← F6 · ⇤ TOC · Notes ▸ F7 · F8 →

Speaker notes

F7.1 RSIC · What It Is

Recursive Self-Improvement Cycle: 7-dim health assessment.

/v1/self-improve/assess returns normalized weighted-confidence sum:

overall = Σ(w_i·c_i·s_i) / Σ(w_i·c_i) (DH-005 formula)

Dimensions:

Flow: Assess → LLM reflector → insights → recommended actions → dispatcher

Speaker notes

F7.1 RSIC · Why We Use It

Honest observability of substrate state.

The alert-correctness family (ALERT-TRUTH-001, DASHBOARD-TRUTH-001/002/003) is the sister work:


F7.1 RSIC · Alert Correctness Family

Shared contracts:

Contract What
NOSILENT-001 Distinct Service per rule (cooldown-key)
TSDB-CONSUME-001 Idle-safe aggregates (COALESCE, never ORDER BY ... LIMIT 1)
ORPHAN-ALERT-001 Min-nodes floor (never alert on tiny spaces)
MDEMG-ALERT-NOISE-REDUCTION-001 Honest emission (skip Set when samples==0)

Pattern: when a measurement surface misfires chronically, fix the SURFACE, not the alert threshold.

Speaker notes

F7.1 RSIC · Why It's Important

ORPHAN-ALERT-001 pattern generalizes: never alert on "no data = regression."

Speaker notes

F7.1 RSIC · How It Will Improve


F7.2 HITL Review + Curation · What It Is

Human-in-the-loop review surface: 17 datasets registered.

Endpoints: POST /v1/review/datasets, /v1/review/grade, /v1/review/reverse, /v1/review/autograde-preview, /v1/review/candidates

UI: Review tab at localhost:9999/ui

Speaker notes

F7.2 HITL · Why We Use It

Corpus-quality lever.

Operator-authored gold is the retrain-trigger signal (JIMINY-RELEVANCE-001 arc):

The suggested_guidance column on review_grades carries Subject Matter Expert (SME)-authored "what would have been better guidance", the highest-value retrain signal.

Speaker notes

F7.2 HITL · How It Works

Diagram 14
Speaker notes

F7.2 HITL · Keyboard-Driven Bulk Grade

JIMINY-HITL-VELOCITY-001 attacks operator throughput.

Pre-sprint ~0.5 items/day → post-sprint grind 40+/sitting.

Speaker notes

F7.2 HITL · Auto-Grade Schedule

AUTOGRADE-SCHEDULE-001 runs 6h scheduled autograde loop.

HITL-AUTO-DISMISS-001 added NonReinforcingApplier for dim=0 dismissals (invariant-preserving queue drain).

Speaker notes

F7.2 HITL · Why It's Important

Corpus quality is the ceiling on retrain quality.


F7.3 Backup + Scheduled Jobs (Mini)

Dual-sink backup (BACKUP-RESTORE-VERIFY-001):

Scheduled-job health (NOSILENT-001):


F7.3 Backup · Restore Correctness

Fails closed on:

Tier-3 drill caught:


F7.3 Supervisor (Mini)

SUPERVISOR-002 supervises 15 background loops.

Rule-health meta-alert: evaluator query failures log Warn + fire after 3 consecutive failures. Per-rule rule-health-<id> when peers succeed; ONE alert-evaluator-degraded per outage when nothing succeeds.

Speaker notes

F7.4 Grafana (Mini)

8 dashboards (Catppuccin theme, dark-first):

RELEASE-HYGIENE-001 shipped //go:embed + materialize-on-init:


F8 · CLI, Hooks, MCP, Multi-Instance

Nav: ← F7 · ⇤ TOC · Notes ▸ F8 · F9 →

Speaker notes

F8.1 Hooks · The Sensory + Motor Channel

7 hooks in .claude/hooks/:

Hook Fires on Does
session-start.sh New session Resumes CMS memory + RSIC health + synergy fingerprint
prompt-context.sh UserPromptSubmit Recalls CMS context + fetches Jiminy guidance
post-tool-observe.py PostToolUse Captures decisions, errors, progress; emits process events
pre-compact.sh PreCompact Saves snapshot to CMS + Jiminy health check
pre-bash-check.py Bash Blocks destructive ops; Jiminy classify under /strict
pre-write-check.py Write/Edit Jiminy classify under /strict; fail-open with marker

HOOKSYNC-001 contract: .claude/hooks/* + internal/cli/hook_templates/* byte-match modulo {{SPACE_ID}}, CI-gated.

Speaker notes

F8.1 Hooks · Hook-Channel Health

Templates in internal/cli/hook_templates/ = single source. CI gates byte-match.

Fail-open guardrail: pre-write-check writes ~/.mdemg/.jiminy-server-unreachable marker on CMS unreachable → prompt-context surfaces it every prompt until cleared.

Speaker notes

F8.2 MCP · Agent Memory Channel

MCP-REVIVE-001: unified channel. .mcp.json sets MDEMG_SPACE_ID=mdemg-dev so agent + hook share one space.

23 MCP tools:

Contract: every MCP tool resolves space as explicit space_id param > MDEMG_SPACE_ID env > ide-agent.

Speaker notes

F8.3 CLI · Command Surface

21 top-level command groups:

mdemg init|serve|teardown|upgrade
mdemg data|tsdb|synergy|graph|concepts|corrections
mdemg jiminy|j17|watchdog|hooks|service
mdemg model|ft-loop|review|eventgraph|symbols
mdemg beta-import|beta-janitor

Recent additions:


F8.4 Multi-Instance (Mention)

Each instance: 5 containers, 6 ports, ~2.3 GiB RAM fresh.

Instance identity pinning (INSTANCE-ID-PIN-001):


F9 · Beta Program + Security + Dormant Census

Nav: ← F8 · ⇤ TOC · Notes ▸ F9 · F10 →

Speaker notes

F9.1 Beta Corpus Loop

# Tester side
mdemg data export            # produces UTDS archive
mdemg data export-auto       # daily export with retention

# Maintainer side
mdemg beta-import <bundle>   # 2-gate verify + import
mdemg beta-janitor delete    # retention enforcement
mdemg beta-janitor sweep     # 30-day sweep

Trust gates before any DB write:

  1. Per-JSONL SHA-256 vs manifest.tables[t].sha256
  2. Privacy re-scrub: every text-field re-runs llmclient.ScrubStringExcluding

Any diff → REJECT.

Speaker notes

F9.1 Beta · Attribution Invariant

Every imported row's space_id + instance_id remapped to beta-tester-<submission_id>.

Backward compat: beta.1/.2/.3 bundles (schema 8) carry no corpus → "Lite mode" notice, SHA + rescrub still gated.

Speaker notes

F9.2 Security Hardening · Shipped Tranches

SEC-TRANCHE-2 (path injection): pathsafe.SafeJoinUnderDir CodeQL-recognized sanitizer. 8 Hypertext Transfer Protocol (HTTP)-reachable sites wired. 13 alerts dismissed via gh api with rationale.

SEC-TRANCHE-3 (33 alerts closed): regex-anchor \b prefixes, Uniform Resource Locator (URL)-scheme deny-list widening (data: + vbscript:), defensive 10000-element allocation caps, int32 bounds-checks, Python urlparse().hostname fixes, XSS-Document Object Model (DOM) fix with CUIDv2 validation.

Latest (today):


F9.3 Dormant Census (Forcing-Function Registries)

3 CI merge-blocking registries:

Registry Surface File
DORMANT-CENSUS-001 HTTP routes docs/api/route_consumer_inventory.json
DORMANT-CENSUS-002 TSDB tables docs/api/tsdb_consumer_inventory.json
DORMANT-CENSUS-003 Metrics docs/api/metrics_consumer_inventory.json

Pattern: every new route/table/metric declared → inventory entry adjudicated in same PR. CI fails on missing entries.

Dispositions: IN_USE, IN_USE_TSDB_ONLY, DORMANT_TO_REMOVE, REMOVED.

Speaker notes

F10 · Conclusion

Nav: ← F9 · ⇤ TOC · Notes ▸ F10 · End ⇥

Speaker notes

F10.1 Where We Are Today · Honest

Follow rate: ~13% actionable compliance (as of 2026-10-22). Target ≥80% via JIMINY-CEILING-BREAK-2 arc.

Benchmark aggregate: 0.9188 on 16-task augmented eval. Beats gpt-mini.

Alerts pending: ~44. Most measurement artifacts (dashboard-truth family paper trail). Latest sprint MDEMG-ALERT-NOISE-REDUCTION-001 closed 2 chronic false-fire classes today.

Fresh PRs: #694 (mcp-go 1.3) + #695 (cuid2 1.1.1) in-flight. 4 Dependabot bumps + 1 certifi fix merged today.

Trajectory language, not "by design" language.

Speaker notes

F10.2 What's Shipped vs. What's Left

Shipped Open frontier
~105 arch pins in CLAUDE.md JIMINY-CEILING-BREAK-2 Phase 2-5 (retrieval precision, classifier, HITL, retrain)
16 UxTS frameworks CI-gated FT-RECURSIVE-004 drift observation window
16 LLM call sites single-shot HITL corpus growth to N=500+ gold
28 ingested languages Qwen3.8-27B base swap (post-beta)
Phase 5 SFT LoRA → GGUF Q5_K_M HEBB-ETA-001 precision-weighted η wiring
4 learning loops operational More L2+ emergent concepts (growth under JIMINY-CEILING-BREAK-2)
Enforcement arc 5 sprints Autonomous FT promote (post operator-confirms-N)
8 Grafana dashboards Multi-instance LaunchAgent scoping
Speaker notes

F10.3 End Goal · Vision

By quarter N:

Beyond quarter N: cognitive substrate earns its persistence. The ≥80% follow rate IS the trust-threshold crossing, below that, the substrate is advisory + ignored; above, it's load-bearing.

Speaker notes

F10.4 Why It's Important · Tie-Back

MDEMG : artificial neural network :: internal dialogue : biological neural network.

Below the follow-rate trust threshold: database with pretensions. Above the trust threshold: cognitive substrate with authority.

The arc from one to the other is this quarter's work.

Speaker notes

F10.5 Continuous Improvement · The Four Loops

Diagram 15

Four loops at four time constants against the same substrate = continuous improvement.

Speaker notes

F10.6 Where To Go Next

Learn:

Operate:

Contribute:


Thank You

MDEMG: Cognitive Substrate for Artificial Intelligence (AI)-Assisted Development

Questions welcome. Everything here is traceable.

Deck owner: reh3376 Last verified: 2026-10-22 Quarterly refresh: next Q1


Return to: ⇤ TOC · README (entry point) · Speaker notes · Governance

Speaker notes

U1 · Operator Onboarding · Start Here

The next ~99 minutes answer four questions. Each U-section drills into a piece of the answer. You'll own the operator view by the end.

  1. What is MDEMG?
  2. What problem(s) does it attempt to solve?
  3. How does it solve those problems?
  4. How does it continuously get better at solving those problems?
  5. How does it all work together? (U1.6, the integrator)

Mini-TOC:

§ Topic ~slides
U1 Opening, The 4 Questions + Integrator 6
U2 The Stack + Status + Health 7
U3 Memory (CMS) 8
U4 Jiminy, Guidance + Enforcement 11
U5 RSIC, Self-Improvement 8
U6 UxTS Framework Family 9
U7 Review / HITL 7
U8 Learning / Training Data 7
U9 Backup + Ops 6
U10 Logs 5
U11 Config + Features 7
U12 Plugins 5
U13 Grafana 7
U14 CLI, The Full Command Surface 9
U15 APIs + gRPC 9
U16 Alerts + Enforcement Escape Hatches 7
U17 Where To Go Next 4

Return to: ⇤ Landing Fork · ⇤ TOC

Speaker notes

What Is MDEMG?

Help developers create software that connects in a manner that increases the likelihood of making better decisions.

The analogy: internal dialogue is to a conscious biological neural network as MDEMG is to an artificial neural network (an AI agent).

Speaker notes

What Problems Does It Solve?

Three core problem classes:

  1. Context loss across sessions: the AI agent forgets everything between runs; MDEMG remembers (persistent CMS) → expanded in U3 Memory
  2. Behavioral drift: the agent repeats mistakes; MDEMG surfaces durable guidance that reminds it before action → expanded in U4 Jiminy, U16 Alerts/Enforcement
  3. Silent failure modes: the system degrades without anyone noticing; MDEMG observes itself continuously via alerts + Grafana + RSIC → expanded in U13 Grafana, U16 Alerts, U5 RSIC

Honest note: the arcs that MOVE each needle are ongoing; U5 (RSIC) and U17 (Where to Go) carry the trajectory.

Speaker notes

How Does It Solve Them?

Four surfaces (each is a U-section):

  1. Memory substrate: Neo4j graph of observations + consolidation into layered abstractions → U3 Memory
  2. Retrieval + guidance: RRF 4-column retrieval + Jiminy surfaces durable rules on every prompt → U3 Memory + U4 Jiminy
  3. Enforcement: strict mode blocks violations; override escape hatches preserve operator agency → U16 Alerts + Enforcement
  4. Observability: Grafana + TSDB + alerts channel + /ui/ Status → U2 Stack, U13 Grafana, U16 Alerts

Mental model: "sense → store → retrieve → classify → act → observe → learn": the full loop.

Speaker notes

How Does It Continuously Improve?

Four self-improvement loops:

  1. RSIC: recursive self-improvement cycle: reflect → trigger → admit → outcome → learn → U5 RSIC
  2. UxTS forcing-functions: contract-first framework family (UATS/UVTS/ULTS/…) prevents drift at merge time → U6 UxTS
  3. HITL curation: operator grading of guidance outcomes feeds the retrain corpus → U7 Review/HITL
  4. Fine-tuning / recursive retrain: the production LLM gets measurably better via Phase 5 SFT + the recursive-retrain loop → U8 Learning/Training Data

Honest trajectory language (operator directive 2026-08-01):


How It All Works Together

Diagram 16

One sentence: you observe, MDEMG remembers, classifies, acts, measures, learns, fine-tunes, and you see all of it on the dashboards.

The HITL → Retrain arc is the newest piece, actively iterating.

Speaker notes

U2 · The Stack

Everything in U3-U17 lives inside the 5-container stack. This section is the foundation, the stack picture, how to confirm it's up, how to probe its health, and what the watchdog + breakers protect against.

Preview: stack diagram → docker compose ps → 4-command path → healthz → watchdog → breakers → gotchas.

Points back to U1.4, this is the implementation of surface #1 (observability + substrate it runs on).

Speaker notes

What's Running

Diagram 17

Roles:


Confirm The Stack

$ docker compose ps
NAME                        STATUS                 PORTS
mdemg-mdemg-1               Up (healthy)           0.0.0.0:9999->9999/tcp
mdemg-neo4j-1               Up (healthy)           0.0.0.0:7687->7687/tcp
mdemg-timescaledb-1         Up (healthy)           0.0.0.0:5433->5432/tcp
mdemg-neural-sidecar-1      Up (healthy)           0.0.0.0:8100->8100/tcp
mdemg-grafana-1             Up (healthy)           0.0.0.0:3030->3000/tcp

Expected: 5 × Up (healthy). Anything else (Restarting, Exit (0)) is a triage trigger, docker compose logs <service> is the next command.

Speaker notes

The 4-Command Happy Path

mdemg init --defaults        # creates .env + .mdemg config (idempotent)
docker compose up -d         # starts the 5-service stack
mdemg healthz                # verify server + subsystems
open http://localhost:9999/ui/   # dashboard (macOS)

Variants:


healthz · The Right-Now Probe

Healthy:

$ mdemg healthz
status: ok
checks: {neo4j: ok, tsdb: ok, sidecar: ok}
circuit_breakers: {open: 0}

Degraded:

status: degraded
checks: {neo4j: ok, tsdb: ok, sidecar: timeout}
circuit_breakers: {open: 1, names: [neural-sidecar]}

Fix order on degraded:

  1. docker compose ps, is the subsystem actually up?
  2. docker compose logs <subsystem>, is it erroring?
  3. curl -s http://localhost:9999/healthz | jq, fresh HTTP reading

Exit codes: 0 if status=ok, 1 otherwise, scriptable in until loops.

Speaker notes

Watchdog + Circuit Breakers

LLM watchdog (MLX_WATCHDOG_ENABLED=true default):

Circuit breakers:

/ui/ Status tab visualizes watchdog + breaker state.

Speaker notes

Honest State + Gotchas

Typical state (fresh install, well-provisioned machine):

Gotchas:

Where to go deeper: docs/features/mlx-watchdog.md, CLAUDE.md "Service Alert System".

Speaker notes

U3 · Memory · The Cognitive Substrate

MDEMG remembers. Not in RAM, not in logs, in a Neo4j graph that grows, consolidates, and forgets honestly.

Preview: hierarchy mental model → UI → observe/recall/correct → honest state.

Natural question this answers: "What does MDEMG actually store, and how do I inspect or change it?"

Speaker notes

How Memory Is Shaped

Diagram 18

Each layer: fewer nodes, more durable, higher-value. Role-filtered retrieval scopes by layer (e.g., Jiminy only surfaces L1+).

Speaker notes

How Memory Strengthens

Hebbian principle: nodes that co-activate on the same retrieval → CO_ACTIVATED_WITH edge weight increases.

Consolidation cycles (background, every ~5 min):

  1. Fire → identify clusters
  2. Promote stable patterns to L1/L2
  3. Dedup patterns identity-preservingly (HIDDEN-CHURN-001/002/003)
  4. Weekly maintenance: decay + prune archived nodes

EVENTGRAPH-001 federates each reinforcement into TSDB reinforcement_events.

CHURN-002: consolidation runs under context.WithoutCancel so it completes even if the triggering request walked away.

Speaker notes

The Memory Tab

Where: /ui/ → Memory

Shows: node counts by role_type / layer, spaces, recent activity, archived vs live.

Interaction: filter by space, drill into a space's node histogram.

When you'd open it:

Related: U7 Review tab shows the HITL queue over memory writes.

Speaker notes

Writing To Memory · observe

$ mdemg data observe --space-id mdemg-dev \
    --content "The thing you want remembered" \
    --obs-type decision
obs_id: ckh3uf9fv0003qr5x2a8dnmwl
node_id: ckh3uf9fv0004qr5x5kz3bgpe

obs_type cheat sheet (12 shipped):

Type Use
decision key decision made
correction something was wrong, now right
error runtime failure
preference user/operator style
task work-item tracking
technical_note implementation detail
insight learning
context contextual
progress task progress
constraint rule-shape
learning general learning
note free-form

Observations always land at L0; promotion to L1 (if obs_type=correction or tagged constraint:...) happens at next consolidation.

Speaker notes

Reading From Memory · recall

$ mdemg data recall --query "how do I toggle enforcement mode" --space-id mdemg-dev
[0] role=correction  score=0.82  "mdemg jiminy mode strict|suggest ..."
[1] role=learning    score=0.74  "..."
[2] role=constraint  score=0.71  "..."

Under the hood: 4-column RRF (embedding + BM25 + graph + structural); CONTEXT-FINGERPRINTING-001 adds a 5th column.

URL overrides for A/B:

Related: MCP tool memory_recall is the agent-facing version.

Speaker notes

Correcting Memory · correct

$ mdemg data correct --space-id mdemg-dev \
    --incorrect "mdemg uses mlx-server at :8101" \
    --correct "mdemg uses llama-server at :8102 (Phase 13.5 cutover)" \
    --context "Model serving"
obs_id: ...
(will promote to L1 on next consolidation)

Structured fields land on the L0 obs; JIMINY-STRUCTURED-CORRECTION-001 propagates them to the eventual L1 node.

The triple (incorrect + correct + context) is first-class, guidance synthesis uses both sides to produce imperative directives.

Related: U7 Review HITL, contradicted drafts auto-feed into this surface via JIMINY-CONTRADICTED-BRIDGE-001.

Speaker notes

Memory Honest State + Gotchas

Live substrate on mdemg-dev typically runs:

Gotchas:

Where to go deeper: docs/features/consolidation-performance.md, CLAUDE.md "RSIC admission + archival attribution".

Speaker notes

U4 · Jiminy · The Inner Voice

Jiminy is the subsystem that READS memory before every agent action, SURFACES applicable durable rules, CLASSIFIES whether the agent followed them, and (in strict mode) ENFORCES them.

15-slide walkthrough: loop → classifier → corpus → UI → CLI → current state → gotchas → J17 AI-to-AI protocol → where to go deeper.

Points back to U1.3, primary answer to "behavioral drift". Points to U1.4, surface #2 (retrieval + guidance).

Speaker notes

How Jiminy Thinks

How Jiminy Thinks: two-phase loop. BEFORE action: retrieve rules + synthesize directive. AFTER action: classify verdict + feed trust, RSIC, Grafana.

Jiminy is a loop in two halves. BEFORE retrieves durable rules and synthesizes a directive the agent should respect. AFTER classifies whether the agent respected it, then feeds the outcome to trust, self-improvement, and operator visibility.

Five verbs: retrieve, surface, classify, measure, strengthen.

Speaker notes

How Jiminy Grades · Classifier Mechanics

Three verdict tiers:

The 5 verdicts:

Verdict Meaning
followed action aligned with constraint
ignored action within relevant context but didn't apply the rule
partial_compliance action partially aligned
contradicted action directly opposed (highest-signal; auto-correction via JIMINY-CONTRADICTED-BRIDGE-001)
not_applicable rule doesn't govern the action's context

Verifiability classes (JIMINY-METRIC-PARTITION-001): classifier / process / hybrid / human.

Speaker notes

What Jiminy Reads · The Rules Corpus

Rules live as MemoryNode with role_type IN ['constraint', 'correction'].

Each rule carries:

Sources (3):

  1. Hook-promoted L0 observations, operator observe --obs-type=correction → consolidation → L1 correction node
  2. UI-authored, /ui/ Rules tab authored directly (JIMINY-RULES-UI-001)
  3. Auto-mined, tagged conversation_observation content triggering constraint: regex

Current corpus (mdemg-dev): ~30-40 active rules post-JIMINY-CORPUS-003 purge.

Speaker notes

The Jiminy Tab

Where: /ui/ → Jiminy

Shows:

Interaction:

Related: U16 Alerts + Enforcement is the operational twin, what alerts fire, how to respond.

Speaker notes

The Rules Tab · Author Durable Rules

Where: /ui/ → Rules

Shows: filterable table of all role_type=constraint|correction nodes with code, content preview, severity, is_informational.

Actions:

Dedup warn: on Create, if cosine sim ≥ 0.75 against existing rule, UI prompts "nearly duplicate, override?"

Related: mdemg jiminy constraint mark CLI for is_informational flipping.

Speaker notes

Mode Toggle From The CLI

Two modes:

$ mdemg jiminy mode
mode: suggest  session: claude-core  strict_enabled: false

$ mdemg jiminy mode strict
mode: strict  session: claude-core  strict_enabled: true
→ state file written: ~/.mdemg/.jiminy-strict-mode

$ mdemg jiminy mode suggest
mode: suggest ...
→ state file removed

State is PER-SESSION (session_id); default session is claude-core.

Speaker notes

Overrides + Rules From The CLI

Override escape hatch:

$ mdemg jiminy override apply --constraint never-direct-main-commits \
    --reason "post-merge cherry-pick, verified" \
    --duration 15m

Invariants:

Audit trail: dual-write to ~/.mdemg/jiminy-overrides.jsonl + constraint_overrides TSDB hypertable.

Related CLI:


Jiminy Today · Honest

Current state (mdemg-dev, 2026-10):

Arc progression:

Honest framing (trust-signal rule):


Jiminy Gotchas


J17 · The AI-to-AI Communication Protocol

Jiminy's semantic payload (rules, outcomes, guidance) is expensive in natural language: a surfaced constraint runs 150-400 tokens; multiplied by every prompt in a long session, that's a real budget leak.

J17 is a telegraphic, compressed-stateful message format that encodes the same semantic payload Jiminy produces in a dense machine-first row shape built for AI-to-AI consumption.

J17:INIT|v1
CODES: C=constraint X=correction F=frontier D=decision P=pattern L=learning
SEV:   !=must ?=should ~=info
ESC:   0=clear 1=warned 2=escalated 3=blocked
FMT:   TYPE:SEV|code|[annotations]|esc:N|src:NODE_ID
ANN:   alt=use-instead neg=forbidden scope=applicability ctx=domain-context
TICKET: signed, echo back on resume
SEQ:    monotonic, report last_seq on resume

A row like C:!|no-direct-main-commits|esc:2|src:n_abc123 carries the SAME meaning as a 200-token natural-language reminder, in ~10 tokens.

Speaker notes

J17 · Why It Exists (Token Economics)

Compression target: ratio 2.0× vs natural-language guidance (calibrated from live 30d p95 per DASHBOARD-TRUTH-002).

What that unlocks:

Design posture (JIMINY-TIER-GATE-001):

Env: J17_TIER_GATE_MODE=comprehension, J17_TIER_COMPREHENSION_HIGH=0.6, J17_TIER_COMPREHENSION_MIN_SAMPLES=20, J17_T1_COMPREHENSION_GATE=0.5 (demotion floor).

Speaker notes

J17 · The Agent Briefing Packet

Every session starts with a one-shot briefing packet that teaches the agent the J17 dictionary + the posture it should take toward Jiminy guidance.

Shape (v1.1, 473 words / ~450 tokens, hash-pinned):

Hash pinned: 5843d9d7acf61fb04a31fdc23f0860759bc82d74054b67650aee1a880ae70395 via internal/j17pin/briefing_packet_test.go (CI fails if packet drifts without an intentional re-pin).

Why hash-pinned: the packet shapes agent posture across every session. Silent drift would silently change behavior across the fleet.

Speaker notes

J17 · Where You See It

At session start: session-start.sh hook prints the J17:INIT|v1 dictionary + the briefing packet + the ACTIVE CONSTRAINTS (telegraphic ...) block.

During the session: every prompt-context.sh fire emits the compact-row form (C:!|code|esc:N|src:NODE_ID) when the agent is in T1; natural-language guidance when in T2.

On the Grafana mdemg-j17 dashboard (see U13):

From the CLI: mdemg j17 status prints the current session's tier + comprehension score + last_seq.

Resumption: on pre-compact.sh fire, the system writes a signed J17 ticket; the next session echoes it back on resume to carry state across the context cycle.

Speaker notes

Jiminy · Where To Go Deeper

Feature docs:

J17-specific:

CLAUDE.md arch pins: 12+ Jiminy sprints + J17-TIER-GATE-001 + J17 compression recalibration (DASHBOARD-TRUTH-002)

Master arc record: docs/development/jiminy-ceiling-break-2/

Feeds into: U5 RSIC (follow-rate improvement is a self-improvement loop), U7 HITL (manual verdict correction), U8 Learning/Training (retrain corpus), U13 Grafana (mdemg-j17 dashboard).

Speaker notes

U5 · RSIC · The Self-Improvement Engine

RSIC asks "how well is MDEMG working?" every few minutes. When it finds a problem WITH a known action, it triggers improvement, sometimes a diagnostic alert, sometimes a real substrate mutation.

Preview: cycle → admission → insight → action → UI → trajectory → gotchas.

Points back to U1.5, this is loop #1 (the top-level improvement orchestrator).

Speaker notes

How RSIC Thinks

Diagram 19

The 6 steps:

  1. Assess: 7-dim health read → SelfAssessmentReport
  2. Reflect: pattern-match (SQL + LLM) → list of Insights
  3. Admit: single-flight cooldown, protected-space check, rate limits
  4. Act: dispatch: alert / HITL / mutation
  5. Record: write cycle event to TSDB ft_training_cycles
  6. Reflect again: next cycle sees the outcome
    Speaker notes
    • PM-fallback: think of RSIC as the system's internal post-mortem engineer, writes a review after every shift and files one actionable fix.

Why RSIC Doesn't Storm

Pre-RSIC-STORM-001: cycles were CREATED on completion, not admission → race condition ran ~20-30k micro cycles/day → saturated llama-server (recurring LLM-timeout cascade).

Post-RSIC-STORM-001: EvaluateTrigger RESERVES the slot at admission under the checking lock; RecordTrigger updates with real cycle id; CompleteCycle frees; failed cycles still cool down.

Live result (mdemg-dev post-fix): ~1 admitted / 132 rejected in 4-min window.

Protected spaces: RSICProtectedSpaces (default mdemg-dev), RSIC can't mutate; it can only diagnose.

Rate limits per-action: ENFORCEMENT_AUTO_EXECUTE_MAX_PER_HOUR (default 3), per-code cooldown (_COOLDOWN_HOURS default 24).

Speaker notes

What RSIC Watches

32+ rule-based patterns (internal/ape/self_reflect.go):

1 LLM reflector: novel-pattern discovery via GPT-5.4-mini on the assessment JavaScript Object Notation (JSON). Deterministic alert emission REMOVED per RSIC-LLM-ALERT-GUARD-001 (LLM reflector can't mint hallucinated deterministic alerts).

AllowedLLMActions whitelist: ~18 actions; new actions require explicit addition.

Speaker notes

What RSIC Does

Three dispatch classes:

  1. Diagnostic alerts: informational; routed via alert dispatcher (service=rsic-<action> per NOSILENT-001); NO substrate mutation
  2. HITL queue items: generate contradicted drafts or review candidates for operator grading
  3. Substrate mutations (auto-execute), ONLY for safe, reversible, rate-limited actions:
    • archive_constraint_by_code, ships default-off + dry-run-true behind 5 guards
    • trigger_training_pipeline, gated by FT_LOOP_ENABLED default false

Reversibility check: archive_* boolean = auto-executable; adjust_* scalar = HITL-only.

Default auto-execute: OFF for all mutation actions on fresh install.

Speaker notes

The RSIC Tab

Where: /ui/ → RSIC

Shows:

Interaction: read-only + Health gauge summary; drill into any insight to see its evidence.

Companion: Grafana mdemg-rsic dashboard (U13) carries the historical view.

Panel titles embed design-intent numbers per DASHBOARD-TRUTH-002 (e.g. "Cycle Admission Ratio (expected 1-10% by design)").

Speaker notes

RSIC Today · Honest

Current state (mdemg-dev, 2026-10):

Known trajectory items:


RSIC · Gotchas + More

Gotchas:

Feature docs:

CLAUDE.md: "RSIC admission + archival attribution"

Grafana: mdemg-rsic dashboard (U13).

Speaker notes

U6 · UxTS · Forcing-Functions That Prevent Drift

A UxTS framework is a contract-first way to make a piece of system behavior impossible to drift without CI noticing: spec → fixture → runner → CI gate.

16 shipped families covering APIs, parsers, retrieval quality, LLM tasks, observability, security, benchmarks, training data, auth.

Preview: forcing-function diamond → full family inventory → how operators invoke → drift-gate principle → trajectory.

Points back to U1.5, this is loop #2 (prevents regression as system evolves).

Speaker notes

How UxTS Prevents Drift

Diagram 20

Flow is uni-directional:

Why it works: contract is HUMAN-READABLE JSON, maintained in-repo, runner is deterministic, operators + reviewers verify without re-running whole system.

Speaker notes

The UxTS Family · All 16

Family Full Name Scope Status Specs
UATS API HTTP endpoint acceptance CI-gated 215
UPTS Parser Language parser conformance CI-gated 28
UDTS DevSpace gRPC contract tests active 15
UOTS Observability Artifact-level contracts CI-gated 11
UOBS Observability Runtime behavior active 11
UVTS Validation Semantic retrieval quality live-gated 3
ULTS LLM Task Prompt + schema CI-gated hash 18
UBTS Benchmark Throughput/latency active 3
UBENCH Benchmark Framework Aggregate LLM eval CI-gated 1 (108 rows)
USTS Security Behavior CI-gated 5
UAMS Auth Method Contracts spec-only 4
UETS Emergence Concept-naming active 8
UITS Iterative Improvement T1 comprehension active 11
UTDS Training Data Export manifest active 3
Universal AI Training Specification (UAITS) AI Training Curation governance active 1 (4 datasets)
UNTS Hash Registry Hash integrity active N/A

Totals: 16 families · 15 active · 1 spec-only (UAMS)

Speaker notes

Running A UxTS Suite

Convention: make test-<family>-lint + make test-<family>-run.

Examples:

$ make test-api BASE_URL=http://localhost:9999       # UATS 215 specs
$ make test-ults-verify-hashes                       # ULTS prompt drift
$ make test-ubench-contract                          # UBENCH dataset vs holdout
$ make test-uvts-quick BASE_URL=http://localhost:9999 # UVTS 16q
$ python3 docs/api/api-spec/upts/runners/upts_runner.py # UPTS parser

Drift-Gate Principle

Three drift classes UxTS catches:

  1. Prompt drift: ULTS --verify-hashes detects LLM system-prompt changes without pinning the new hash
  2. Spec drift: UATS runs 215 real HTTP endpoints; response-shape change breaking a documented contract fails merge
  3. Framework drift: UxTS drift checker enforces adding a NEW family/spec updates UXTS_FRAMEWORK_MATRIX.md in the same PR

Universal eXtensible Test Specification (UXTS)-CI-001 (2026-06-11) un-zombied the gates. ALL merge-blocking today: UATS, UNTS hash-verify, USTS, UOTS, ULTS --verify-hashes, UBENCH contract, neural pytest+ruff, UxTS matrix drift.

Forcing-function invariant: don't add continue-on-error to a UxTS CI step; every zombie this project un-zombied was hiding real rot.

Speaker notes

UxTS In /ui/


Adding A UxTS Family

Trigger: a new domain of system behavior that needs contract-level enforcement AND doesn't fit any existing family's scope.

Shape: build the diamond, schema → specs → runner → CI gate.

Governance (UATS-GAP-001): new family MUST register in UXTS_FRAMEWORK_MATRIX.md + the drift checker; new specs land under specs/ not drafts/ once vetted.

Common gotcha: deep-merge semantics in runners, variant omitting a key inherits from base; required-field guards use empty-string overrides, not key omission.

Example successful adds: UBENCH (wraps Phase 10) + UITS (T1 encoding) + UOBS (runtime observability).

Speaker notes

UxTS Today · Honest

Known gap: UDTS doesn't have uxts-canonical-specs.yml wiring yet (deferred, DORMANT-CENSUS-002 captured).

Speaker notes

UxTS · Where To Go Deeper

The matrix: docs/development/UXTS_FRAMEWORK_MATRIX.md, ALL 16 families with schema path, spec dir, runner, CI gate, implementation status.

Per-family:

CLAUDE.md UxTS pins: UATS-GAP-001, Universal eXtensible Test Specification (UXTS)-CI-001, DORMANT-CENSUS-* family.

Feeds into: U7 Review (HITL grades feed UAITS datasets), U8 Learning/Training (UBENCH + ULTS gate the retrain), U13 Grafana (UVTS/UBENCH panels).

Speaker notes

U7 · HITL · You Grade What The System Can't

The classifier can't tell if a partial_compliance verdict was actually followed with reasonable judgment. The retrain corpus needs human verdicts. HITL is the UI + CLI that makes operator grading fast enough to be sustainable.

Preview: dataset registry → /ui/ Review → keyboard grading → auto-grader + schedule → sink invariant → trajectory.

Points back to U1.5, this is loop #3 (operator-fed training signal).

Speaker notes

What You Can Grade

17 shipped datasets: guidance corpus + 16 LLM call-site datasets (ape.reflect, jiminy.evaluate_llm, consulting.classify, retrieval.rerank_cross, etc.).

Each dataset = ReviewableDataset interface:

Rubrics are VERSIONED (rubric_version field), grades joined to source rows by (dataset_id, item_id).

Guidance corpus is the ONLY dataset with a REINFORCING sink: grade → trust-score mutation + substrate reinforcement.

All 16 LLM call-site datasets ship with NoopSink: gold-only, no live mutation.

Speaker notes

The Review Tab · Grade Fast

Where: /ui/ → Review

Flow:

  1. Pick a dataset from the registry dropdown
  2. See the next pending candidate (candidate_count displayed; backlog-capped at 200)
  3. Read the row, the rubric dimensions appear as 0-4 radio inputs below
  4. Grade with keyboard: 0-4 set every dimension; Space or Enter submits; n next; u reverse; ? help; Esc close-help/cancel-auto-advance
  5. Auto-advance 400ms after submit with visible status-line (reversible via u)

Pre-fill: POST /v1/review/autograde-preview → LLM proposal fills radios; operator confirms or corrects.

Session counter banner at top (bright-green).

Speaker notes

When The System Grades Itself

CLI: mdemg review autograde --dataset <ds> --space-id <id> [--min-confidence 0.80] [--limit 50]

The auto-grader is an LLM-driven grader with per-dataset AutogradePromptHinter, teaches the model dataset-specific semantics.

Scheduled loop (AUTOGRADE-SCHEDULE-001): opt-in via REVIEW_AUTOGRADE_SCHEDULE_ENABLED=true + REVIEW_AUTOGRADE_SCHEDULE_DATASETS=<comma,separated>; runs every _INTERVAL_HOURS (default 6).

Auto-grade invariant (HITL-CURATION-002): every auto-grade row has grader_id starting with "auto:", POSTs reinforce:false → NEVER mutates substrate.

Auto-dismiss (HITL-AUTO-DISMISS-001): dim=0 dismisses the row (MarkDismissed); dim=4 approvals stay operator-only.

Speaker notes

Review Tab Context

Review tab complements other HITL surfaces:

Related panels:

Related CLI:


HITL Today · Honest

Current state (mdemg-dev, 2026-10):

The AUTOGRADE-SCHEDULE-001 loop closes the drain mechanism: pre-sprint queue grew indefinitely; post-sprint it self-drains for auto-dismissible classes.

Trajectory arc: hitl-curation-stalled alert fires if operator-grade count drops to 0 over 7d (excludes auto:* rows), forces visibility.

Speaker notes

HITL · Gotchas + More

Gotchas:

Feature docs:

CLAUDE.md pins: HITL-REVIEW-001, HITL-CURATION-002/003, HITL-AUTO-DISMISS-001, AUTOGRADE-SCHEDULE-001, HITL-AUTOGRADE-PREVIEW-001, HITL-ANALYTICS-TILE-001.

Feeds into: U8 Learning/Training (gold grades feed retrain), U5 RSIC (grade cadence feeds self-assessment), U4 Jiminy (correction grades mutate the corpus Jiminy reads).

Speaker notes

U8 · Learning + Training Data · How The Model Gets Better

MDEMG's production LLM is mdemg-llm-v1 (Qwen3-14B-4bit + Phase 5 SFT), aggregate 0.9188 on the honest 16-task eval. The retrain pipeline (Phase 6b actuator SHIPPED default-off) can produce the next generation when triggered.

Preview: FT line state → Learning tab → Training Data tab → recursive-retrain loop → UBENCH freshness → gotchas.

Points back to U1.5, this is loop #4 (model-level improvement; the slowest and most expensive loop).

Speaker notes

What's Running · mdemg-llm-v1

Comparison:


The Learning Tab

Where: /ui/ → Learning

Shows:

Interaction: read-only; drills into benchmark run history, retrain cycle events, drift observations.

Related: Grafana mdemg-ft-training dashboard carries the historical panels.

Speaker notes

The Training Data Tab

Where: /ui/ → Training Data

Shows:

Interaction:

Related CLI:


When MDEMG Retrains Itself

Trigger sources (2):

Operator ceremony: mdemg ft-loop promote is the final human confirm (unless FT_LOOP_AUTO_PROMOTE_AFTER is non-zero).

Speaker notes

UBENCH · Keep The Benchmark Fresh

benchmark_runs TSDB hypertable: one row per aggregate run.

FT-BENCH-REFRESH-001 (2026-07-21) alert rule: ft_benchmark_stale fires HIGH if newest row > 7d old (direct benchmark_runs read; distinguishes "never ran" from "stale" per ALERT-NOISE-REDUCTION-001 E2).

Freshness panel on mdemg-ft-training: "Latest Benchmark Age" (green <3d, yellow 3-7d, red >7d).

Scheduled benchmark runner: FT_BENCH_SCHEDULE_* env knobs; weekly in dev .env; jobhealth scheduled-ft-benchmark.

CLI:

python -m neural.benchmarks.run_benchmark \
    --config configs/benchmark_phase10.yaml \
    --out training_data/eval/<name>.json \
    --apply-tsdb

⚠️ requires psycopg, pinned in neural/pyproject.toml [training]; run via neural/.venv/bin/python.

Speaker notes

Learning · Gotchas + More

Gotchas:

Feature docs:

CLAUDE.md pins: all FT-RECURSIVE-* sprints, PHASE-E1/E2/E3 corpus audits, HOMEBREW-INSTALLER-QWEN-UPDATE-001.

Feeds into: U13 Grafana (benchmark + FT loop dashboards), U15 APIs (recursive-retrain gRPC trigger surface), U16 Alerts (FT benchmark staleness).

Speaker notes

U9 · Backup + Ops

Backups + scheduled maintenance (decay + prune) are the operator's safety net. BACKUP-RESTORE-VERIFY-001 made the restore path provably correct; NOSILENT-001 ensures silent failures ALARM.

Preview: schedulers → UI → CLI → retention → gotchas → where deeper.

Speaker notes

What Runs On Schedule

Three scheduled jobs:

Jobhealth: all 3 record every run to scheduled_job_events (V0024 hypertable) via internal/jobhealth.Report; failures fire HIGH on distinct Services per NOSILENT-001 cooldown-key contract.

Speaker notes

The Backup Tab

Where: /ui/ → **Backup`

Shows:

Interaction:

Companion CLI: mdemg backup create/list/verify/restore.

Speaker notes

Backup + Restore CLI

$ mdemg backup create --db neo4j --out /path/to/backups/
$ mdemg backup list
$ mdemg backup verify --manifest /path/to/manifest.json
$ mdemg backup restore --manifest /path/to/manifest.json --db neo4j

Restore invariants (BACKUP-RESTORE-VERIFY-001):

transfer.nodeProps fix: observations carry path=NULL; proto serializes NULL as ""; writer OMITS empty path/name to avoid collision with memorynode_path_unique.

Speaker notes

Weekly Maintenance

Manual preview:

$ mdemg maintenance --space-id mdemg-dev --dry-run
decay: would reduce weight on 1234 CO_ACTIVATED_WITH edges
prune: would archive 56 orphan nodes (role_type IN [...])

Live run:

$ mdemg maintenance --space-id mdemg-dev --dry-run=false
decay: reduced weight on 1234 edges
prune: archived 56 nodes with reason='scheduled_maintenance'

LaunchAgent schedules the live run weekly; MAINT-LIVE-001 made this ACTUALLY RUN (pre-sprint it was dry-run only, never executed in the project's history).

Orphan disposition is CONTEXT-DEPENDENT: --exclude-role-types or PRUNE_EXCLUDE_ROLE_TYPES env; schedule excludes constraint,conversation_observation.

Alert: maintenance_no_live_run fires on only-ever-dry-runs pattern.

Speaker notes

Backup + Ops · Gotchas + More

Gotchas:

Feature docs:

Feeds into: U13 Grafana (mdemg-overview + mdemg-neo4j panels), U16 Alerts (scheduled-job staleness + maintenance_no_live_run).

Speaker notes

U10 · Logs

healthz is now, alerts are history, logs are DETAIL. When a request latency spike happens but nothing's fired, logs are where you look.

Preview: UI → filter → CLI tail → interpretation → gotchas.

Speaker notes

The Logs Tab

Where: /ui/ → Logs

Shows: recent server slog output; filterable by level (INFO/WARN/ERROR) and scope (jiminy:*, retrieval:*, rsic:*, tsdb:*, backup:*).

Interaction:

When you'd open it:


Tailing From Docker

$ docker compose logs -f mdemg | grep -E 'ERROR|WARN'
$ docker compose logs --tail=100 mdemg
$ docker compose logs -f mdemg --since=10m | jq -c 'select(.level=="ERROR")'

The server emits structured JSON slog when LOG_FORMAT=json; otherwise key=value pairs.

Scoping: filter by level, time window, or search text; jq works great against JSON mode.

Speaker notes

What Each Scope Means

Common scopes you'll see:

Boot-sequence slogs to watch for:


Logs · Gotchas + More

Gotchas:

Feeds into: U13 Grafana (log-derived metrics panels), U16 Alerts (log-triggered alert rules), U14 CLI (mdemg data clean scrubs TSDB rows that came from loggy flows).

Speaker notes

U11 · Config + Features · The Toggle Surface

~400 config knobs ship with MDEMG. Most defaults are correct. This section covers the ones operators flip + how to tell which can be flipped live vs needing a restart.

Preview: /ui/ Config → /ui/ Features → ENV-FROM-ENV priority chain → sensitive-value redaction → gotchas.

Speaker notes

The Config Tab

Where: /ui/ → Config

Shows: current effective config values (post-FromEnv overlay); grouped by domain (LLM / embeddings / retrieval / Jiminy / RSIC / backup / etc.).

Interaction:

Related CLI:


The Features Tab · Feature Flags

Where: /ui/ → Features

Shows: shipped feature flags with their current enabled state; *_ENABLED boolean knobs grouped by feature family.

Common operator-touched flags:

HEBB-ETA-001 arch rule: behavior-changing feature flags default OFF in BOTH code AND .env.

Interaction: toggle flags; most take effect at next restart, some live (per-flag).

Speaker notes

Where Does A Value Come From?

Priority (highest to lowest wins):

  1. CLI flag override (per-command, e.g. mdemg start --port 9999)
  2. Env var set in process environment (shell export)
  3. .env file (loaded by mdemg init and compose)
  4. Code default in internal/config/config.go struct literal

mdemg config validate (CONFIG-VALIDATE-TRANSIENT-DISTINGUISH-001):


What's Hidden From You

internal/config/yaml_config.go::isSensitive masks these in mdemg config show:

Any env var with PASSWORD / PASS / API_KEY / TOKEN / SECRET in name should be masked; SEC-TRANCHE-3 widened the list from 2 to 8.

Rule: when adding a new secret-shaped env var, extend isSensitive in the SAME COMMIT.

Speaker notes

Why Every Operator-Visible Value Is Config-Driven

CLAUDE.md invariant feedback_no_hardcoded_values: "Never hardcode values, use CLI flags, env vars, config with sensible defaults."

Why: makes the system operable without code changes; makes operator-authored overrides discoverable.

Rule applies to:

The MODEL-DIST-001 sprint pinned this: "every operator-visible value is dynamic", 11+ env vars for one feature.

Speaker notes

Config + Features · Gotchas + More

Gotchas:

Feature docs:

Feeds into: U15 APIs (/v1/admin/* surface flips flags via API), U16 Alerts (threshold values live here).

Speaker notes

U12 · Plugins · The Extension Surface

Plugins are gRPC services the mdemg server talks to over the mdemg-module protocol. Four shipped: docs-scraper, uxts-module, linear-module, obsidian-module.

Operators inspect state; developers build + ship.

Speaker notes

The Plugins Tab

Where: /ui/ → Plugins

Shows: installed plugins (name, version, status, port, PID), manifest metadata (declared permissions, binary SHA).

Interaction:

Related CLI:


mdemg plugin validate

$ mdemg plugin validate --manifest /path/to/manifest.json
✓ Schema valid
✓ Binary SHA matches manifest
✓ Declared permissions ⊂ allowed
✓ Entry point reachable (gRPC Health check passed)

Validates:

SEC-TRANCHE-2 made validator path-safe (routes through internal/pathsafe::SafeJoinUnderDir to CodeQL-recognizable sanitizer).

Speaker notes

What's Shipped

4 shipped plugins:

Plugin manager at internal/plugins/manager.go supervises each plugin as a subprocess over a Unix socket.

kickstart -k reaps prior-generation processes via pgrep by full socket path before spawning new (MCP-REVIVE-001).

Speaker notes

Plugins · Gotchas + More

Gotchas:

Feature docs:

Feeds into: U15 APIs + gRPC (plugin RPC is a gRPC surface), U16 Alerts (plugin-crash alerts).

Speaker notes

U13 · Grafana · The Historical View

Grafana is the time-series companion to /ui/. /ui/ answers "right now"; Grafana answers "the last 24 hours / 7 days / 30 days."

Nine dashboards covering ~70 panels, but 5 panels carry most operator attention.

Preview: 9 dashboards → the daily 5 → honest reading patterns → alert panel links → dashboard provenance → gotchas.

Points back to U1.5, Grafana is the observability substrate for every improvement loop.

Speaker notes

The 9 Dashboards

All datasource timescaledb literal UID per GRAFANA-SHIP:

  1. mdemg-overview: home dashboard; request rate, p95 latency, error rate, breakers; UVTS arc-trajectory panel
  2. mdemg-jiminy: follow-rate (classifier + per-class), outcome split, effectiveness, actionable compliance; JIMINY-CEILING-BREAK-2 trajectory panel
  3. mdemg-rsic: RSIC health dimensions (DH-005), cycle admission, insight stream
  4. mdemg-neo4j: Neo4j CPU/memory, null-weight edges, orphan ratio, graph node count
  5. mdemg-ft-training: Phase 10 benchmark aggregate, per-task pass rate, FT loop state, FT benchmark staleness
  6. mdemg-graph-topology: Hebbian weight entropy, dynamic-edge creation, reinforcement event rate
  7. mdemg-hitl: grade cadence (auto vs operator), pending drafts, reinforcement applied 7d
  8. mdemg-j17: J17 protocol compression ratio vs target, trust session count, NLI bias, tier promotion/demotion events, auto-compact AVG interval (LONGER=BETTER). J17 is the AI-to-AI protocol that encodes Jiminy's semantic payload in a telegraphic row shape, this dashboard shows the token-saving mechanism's live health. See U4 J17 slides for the protocol itself.
  9. mdemg-llm-routing: LLM request rate per task, error rate per task (filtered for caller_canceled), latency per task
    Speaker notes
    • You don't need to memorize all 9. Pin Overview + Jiminy to your Grafana sidebar; others open when a specific symptom demands.

What To Actually Watch · The Daily 5

The 5 panels that catch most operational issues:

  1. mdemg-overview → Error Rate (should be ≤0.001; honest post RETRIEVE-CALLER-CANCEL-001)
  2. mdemg-overview → P95 Latency (SLO: ≤120s per DH-004; retrieval goal <2s)
  3. mdemg-jiminy → Follow Rate panel (current ~13%; title embeds JIMINY-CEILING-BREAK-2 target ≥80%)
  4. mdemg-ft-training → Latest Benchmark Age (green <3d, yellow 3-7d, red >7d; FT-BENCH-REFRESH-001)
  5. mdemg-neo4j → Neo4j Memory + CPU (CPU AVG >500% over 5min actionable; CPU is per-SINGLE-core)

Alternative: watch the terminal alerts channel (U16), panels and alerts share thresholds, so operator attention stays coherent.

Speaker notes

Reading Panels Honestly

Rules per DASHBOARD-TRUTH-001/002/003:

Expect to see arc-trajectory numbers, this is BY DESIGN, not a bug.

Speaker notes

How Dashboards Stay Honest


When Alerts Fire · Where To Look

The alerts channel (U16) names the rule; each rule has a corresponding Grafana panel.

Rule-to-panel map (abbreviated):

Workflow: alert fires → open the named panel → read the trajectory + title + current value → decide (triage / override / wait / fix).

Speaker notes

Grafana · Gotchas + More

Gotchas:

Feature docs:

Feeds into: U14 CLI (healthz + synergy status + watchdog status), U15 APIs (Grafana reads TSDB directly via timescaledb datasource).

Speaker notes

U14 · CLI · The Full Command Surface

mdemg --help lists 90+ commands. Operators regularly use ~15, grouped into 5 clusters.

Preview: Lifecycle → Memory → Introspection → Ops → Specialized → inline help → MCP alternative → tutorial-command → gotchas.

Speaker notes

Lifecycle · Starting, Stopping, Checking

Group ID: start.

Speaker notes

Memory · Observe, Recall, Correct

Group ID: memory.

Speaker notes

Introspection · What's Going On?


Ops · Backup, Upgrade, Maintenance

Group ID: advanced.

Speaker notes

Specialized · RSIC, Models, FT Loop, etc.


--help Everywhere

$ mdemg --help                       # top-level + groups
$ mdemg data --help                  # subcommand group
$ mdemg data observe --help          # leaf command flags + examples

Cobra convention: Short is the one-line summary; Long is the paragraph; Example is the recipe.

Shell completion: mdemg completion {bash|zsh|fish|powershell} outputs the completion script.

Speaker notes

MCP · The Agent-Facing Alternative

mdemg mcp is the Model Context Protocol server MDEMG ships, exposes the memory + agent surfaces as MCP tools.

When MCP wins over CLI:

23 shipped MCP tools (MCP-REVIVE-001 census):

Contract suite: internal/cli/mcp_contract_test.go, new tools MUST add a contract.

Speaker notes

CLI · Gotchas + More

Gotchas:

Feature docs:

Feeds into: U15 APIs (the HTTP + gRPC surfaces every CLI operates against), U16 Alerts (CLI exit codes correspond to alert severity for scripting).

Speaker notes

U15 · APIs + gRPC · The Programmatic Surfaces

/ui/ and CLI are user-facing; APIs + gRPC are what EVERYTHING hits internally. 199 shipped HTTP routes + 4 gRPC services.

Operators mostly OBSERVE these surfaces; developers extend them.

Points back to U1.4, implementation of surfaces #3 and #4.

Speaker notes

Who Talks To What

Diagram 21
Speaker notes

The HTTP API · /v1/* Routes

199 routes shipped (DORMANT-CENSUS-001 census). Grouped by domain:

Prefix Scope
/v1/memory/* observe, recall, retrieve, correct, store (U3)
/v1/jiminy/* latest, warm, feedback, evaluate, classify, strict, mode, override, rules CRUD (U4)
/v1/conversation/* observe, correct
/v1/self-improve/* assess, reflect (RSIC)
/v1/retrieve direct retrieval; ?sparse=, ?intent=, ?reverse_ref=, ?context= URL overrides
/v1/review/* datasets, candidates, grade, reverse, autograde-preview (U7)
/v1/alerts/* list, clear (U16)
/v1/admin/* breakers (list, reset); gated by AUTH_API_KEYS
/v1/eventgraph/* reinforcement-neighborhood, guidance-outcome-neighborhood
/v1/metrics/snapshot JSON metrics (no /metrics endpoint by design)
/ui/* UI static assets + the embedded tutorial
/healthz subsystem probe
Speaker notes

The 4 gRPC Services

All 4 use gRPC over Unix sockets for in-process communication (performance + easier security boundary vs TCP localhost).

gRPC services NOT exposed over HTTP to external clients, internal to the mdemg process family.

Speaker notes

Probing The Surfaces

HTTP:

$ curl -s http://localhost:9999/healthz | jq
$ curl -s http://localhost:9999/v1/memory/retrieve -X POST \
    -H "Content-Type: application/json" \
    -d '{"query":"foo","space_id":"mdemg-dev"}' | jq
$ curl -s http://localhost:9999/v1/metrics/snapshot | jq .counters

gRPC (needs grpcurl installed):

$ grpcurl -plaintext unix:///path/to/plugin.sock list
$ grpcurl -plaintext unix:///path/to/plugin.sock describe mdemg.Module

Admin endpoints require auth: curl -H "Authorization: Bearer $MDEMG_ADMIN_KEY" ....

Speaker notes

How New Surfaces Stay Audited · DORMANT-CENSUS

DORMANT-CENSUS forcing functions catch unused surfaces at merge time:

Pre-commit hook check_inventory_adjudication catches at commit time (PRE-COMMIT-INVENTORY-GATE-001).

Rationale: prevent "ship-and-forget" surfaces that languish unused + prevent silent breakage when a consumer disappears but the surface stays.

Speaker notes

What's Reachable, What's Not


APIs + gRPC Today · Honest

Current state (mdemg-dev, 2026-10):

Trajectory items:

No /metrics endpoint by design: mdemg uses TSDB-recorded metric_samples + /v1/metrics/snapshot instead of Prometheus scrape (PROMETHEUS-SCRAPE-INVESTIGATION-001 verdict: DELIBERATE REMOVAL per 2026-03-28 migration).

Speaker notes

APIs + gRPC · Gotchas + More

Gotchas:

Feature docs:

Feeds into: U13 Grafana (reads TSDB directly, bypasses this API surface), U16 Alerts (admin breaker-reset uses /v1/admin/*).

Speaker notes

U16 · Alerts + Enforcement · Operator Triage

This is where you RESPOND. Alerts tell you what's wrong (historical, hours-scale). Enforcement is Jiminy preventing a durable constraint violation (right-now).

Both ship escape hatches that preserve operator agency.

Preview: alerts channel → terminal banner → severity map → clearing → enforcement in-session → override flow → audit trail.

Points back to U1.4, the ENFORCEMENT surface.

Speaker notes

The Alerts Channel

Storage: ~/.mdemg/alerts/current.json (configurable via ALERT_FILE_PATH); JSON array of alert objects.

Shape: {severity, service, title, body, timestamp, cleared_at: null}.

Severities:

Sources: RSIC alert actions (U5), circuit breaker state changes (U2), health prober transitions, server-native alert evaluator (24+ TSDB-query rules), Grafana webhook.

The 44 pending alerts on your session banner are a mix of MEDIUM (Jiminy follow-rate, arcs-in-progress) + HIGH (FT benchmark staleness, scheduled-job-staleness) + LOW (cache hit ratio).

Speaker notes

Reading The Banner

Reading rules:

Clearing: hooks auto-clear surfaced alerts via POST /v1/alerts/clear (cleared = delivered).

Speaker notes

When Jiminy Blocks You

When active:

Example block (hook output on Write/Edit/Bash):

[/strict] Durable constraint violation
  code: never-direct-main-commits
  severity: must_not
  reason: Attempted git commit directly to main branch
  override: mdemg jiminy override apply --constraint never-direct-main-commits \
            --reason "cherry-pick post-merge" --duration 15m

Blocked tool call RETURNS error (not silent) with copy-paste override command inline.

Classify endpoint /v1/jiminy/classify is the server-side decision site; pre-write-check.py + pre-bash-check.py hooks fire it before every mutation.

Speaker notes

The Override Escape Hatch

Diagram 22

Invariants:

Audit row stays forever for compliance review.

Speaker notes

When The System Mutates Itself

3 potential auto-executable actions, all DEFAULT OFF:

Rule: archive_* boolean mutations auto-executable; adjust_* scalar mutations require HITL.

Audit: every auto-execute emits a MEDIUM alert (rsic-auto-archive service) with REVERSAL CYPHER in the message body, operator sees + can reverse.

Speaker notes

Alerts + Enforcement · Gotchas + More

Gotchas:

Feature docs:

Feeds into: U5 RSIC, U7 HITL (contradicted drafts), U13 Grafana (alert panels).

Speaker notes

U17 · Where To Go · Documentation


Honest · What's Open Right Now

Current HIGH alerts (trajectory language per trust-signal-must-be-persisted-never-ignore-honest):

MEDIUM arc-in-progress (expected during JIMINY-CEILING-BREAK-2):

LOW arcs:

These are HONEST and TRACKED; they fire because the system is honest about its state, not because operation is broken.

Speaker notes

Contributing Observations + Issues

Operator contributions LAND at TWO points:

  1. Observations via mdemg data observe --obs-type correction --content "...", becomes L0 → consolidates to L1 → feeds Jiminy (U3-U4)
  2. Rules authored in /ui/ Rules: directly as L1 constraint nodes (JIMINY-RULES-UI-001; JIMINY_RULES_UI_WRITE_ENABLED=true to flip)

Issue filing:

Beta corpus: beta testers run mdemg data export → maintainer runs mdemg beta-import <bundle> → data lands in space_id=beta-tester-<submission_id> (never maintainer's own space).

Speaker notes

Thank You · End User Path

MDEMG: Cognitive Substrate for AI-Assisted Development

Questions welcome. Everything in this deck traces to CLAUDE.md, feature docs, sprint records, or shipped code.

Return to: ⇤ Landing Fork · ⇤ TOC · README · Speaker notes · Governance

Speaker notes

Glossary

Every acronym used in this tutorial, with its expansion. Each acronym occurrence after the first in the body text is a link to its entry here. Use the floating ← Return to Previous button at the top-right of the viewport to jump back to where you were reading.

AI
Artificial Intelligence
API
Application Programming Interface
BM25
Best Matching 25
CI
Continuous Integration
CLI
Command-Line Interface
CMS
Cognitive Memory Substrate
DOM
Document Object Model
DPO
Direct Preference Optimization
EMA
Exponential Moving Average
FT
Fine-Tuning
GGUF
GPT-Generated Unified Format
HITL
Human-In-The-Loop
HTTP
Hypertext Transfer Protocol
JSON
JavaScript Object Notation
JWT
JSON Web Token
KV
Key-Value
LLM
Large Language Model
LoRA
Low-Rank Adaptation
MCP
Model Context Protocol
MDEMG
Multi-Dimensional Emergent Memory Graph
NLI
Natural Language Inference
NN
Neural Network
OOM
Out-Of-Memory
RAFT
Retrieval-Augmented Fine-Tuning
RRF
Reciprocal Rank Fusion
RSIC
Recursive Self-Improvement Cycle
SDK
Software Development Kit
SFT
Supervised Fine-Tuning
SHA
Secure Hash Algorithm
SLO
Service Level Objective
SME
Subject Matter Expert
SQL
Structured Query Language
TOC
Table of Contents
TSDB
Time-Series Database
UAITS
Universal AI Training Specification
UATS
Universal API Test Specification
UBENCH
Universal Benchmark
UI
User Interface
ULTS
Universal LLM Test Specification
UPTS
Universal Parser Test Specification
URL
Uniform Resource Locator
UUID
Universally Unique Identifier
UVTS
Universal Validation Test Specification
UXTS
Universal eXtensible Test Specification
XML
Extensible Markup Language
YAML
YAML Ain't Markup Language