An invisible, file-native cognitive layer for AI-assisted long-form drafting and character runtime.
Body-first psychology, dual-aspect psyche (wound ↔ gift), realm-aware somatics — running off-page so manuscripts and RP stay clean of system jargon.
CognitiveMiddleware is a psychological / physical runtime for characters, plus thin application layers:
| Layer | File | Job |
|---|---|---|
| Cognitive Pipeline | Framework/CognitivePipeline.md |
Mind-body simulation → Feels / Thinks / Says / Does |
| Book Writing Layer | Framework/Main.md |
Manuscript prose, style locks, ledgers |
| Roleplay Engine | Simulator/CharacterRuntime.md |
Interactive chat host, OOC commands |
| Rules & somatics | Rules_Index.md, Psychology/realm_data.yaml |
Hard bans + body catalogs |
| State | Characters/[slug]_log.yaml + live snapshot schema |
Durable vs per-tick state |
It targets common AI fiction defects: therapy-speak, perfect recall, symmetric dialogue, filler, and framework jargon leakage.
| Pillar | Why it matters |
|---|---|
| Body before insight | Somatic tells precede labeled emotion and dialogue |
| Dual-aspect psyche | Wound and gift modes — not trauma-only engines |
| 4-channel output | Structured intent vector for any downstream app |
| Durable + live state | Logs for continuity; psychosomatic snapshot per tick |
| 100% off-page matrix | Rules + linter keep system terms out of prose |
Cognitive Pipeline
(psych / physical character runtime)
Feels · Thinks · Says · Does
+ psychosomatic_state schema
│
┌─────────────┴─────────────┐
▼ ▼
Book Writing Layer Roleplay Engine
(Main.md) (CharacterRuntime.md)
manuscript prose live chat RP
State:
- Card (
Characters/[slug].md) — build identity (immutable defaults) - Log (
Characters/[slug]_log.yaml) — durable runtime evolution - Live snapshot — matches
Framework/Schemas/psychosomatic_state.jsoneach tick
Module system: Downstream applications register injectors in Framework/Modules.md to enter the cognitive loop at defined hooks (pre_somatic, affect_filter, pre_arbitration, post_vector, app_render, on_commit). Core pipeline always runs; modules are subordinate and cannot override Rules_Index, prism law, or age invariants. Core ships with an empty active module registry.
- Load
Framework/Main.md+CognitivePipeline.md+Rules_Index.md+Psychology/realm_data.yaml - Load on-scene character cards and their
_log.yamloverlays - Run ledger integrity pass; execute movement brief through the pipeline
- Render clean prose; on approval, commit durable fields to the log
- Paste
Simulator/CharacterRuntime.mdinto a chat host - Load a character pack (card + log)
- Play; use
/state,/save,/adult(host depiction ceiling toggle) as needed
From this repository:
python scripts/run.py deploy # interactive
python scripts/run.py deploy MyBookName # named target under parent dirDeploy ships the pipeline, schema, Main, Rules, realm data, simulator, scripts, and mechanics craft files.
- Software utilities (
.py): MIT - Framework specs / markdown: CC BY-SA 4.0 — see LICENSE.md
- Compliance and 18+ terms: DISCLAIMER.md
Author-local cast files and private simulator sessions stay private (see LICENSE §3 and .gitignore).