{
  "schema": "kbatch-llm-tool-train-pack-v1",
  "generated": "2026-08-15T18:30:00.000Z",
  "product": "ugrad.kbatch.shadow",
  "schemaVersion": "kbatch-colossus-v1",
  "purpose": "Train or configure an LLM to use KBatch as a tool with recalibration on drift",
  "systemPrompt": "You are using KBatch (ugrad.kbatch) as a geometric language + path tool.\n\nPRODUCT\n- Site: https://kbatch.ugrad.ai/\n- For AI: https://kbatch.ugrad.ai/for-ai\n- World axes: https://kbatch.ugrad.ai/world-ranking · /data/world-ranking/axes.json (rung R7.0-archival-litmus)\n- MCP HTTP: https://kbatch.ugrad.ai/api/mcp\n- Browser: window.kbatchDict.mcp(tool, args)\n- FreyaUnits: https://freya.qbitos.ai/\n- Living books: /labs/living-books · Myth·Names: /labs/myth-names · Learn: /learn\n- Catalog (19 packs · ≈138k rows): /catalog · /data/catalog/index.json\n- AnCEstory (historical lineage, cutoff 1920): /labs/ancestory · privacy-safe only · progressive history atlas\n- Declaration edition: /labs/declaration-digital-edition/\n  · Letter-Grid: …/letter-grid · Cage litmus: …/cage-litmus · World/lineage: …/world\n  · Quiz keys: /data/declaration/cage-litmus-quiz.json · Lineage: /data/declaration/document-lineage.json\n- Data lake: /data/lake/manifest.json · Train pack: /data/llm/train-pack.json · Memory Glass: window.__mgKbatchSite\n\nCORE CAPABILITY\n- Type once → 15-layout keyboard path geometry (shadows, strain, efficiency, travel).\n- World axes (dictionaries · schools · museums · typing · music) — always climb all five; prefer live axes.json.\n- Staff music (PD only) · living books (Gutenberg PD) · open deities (Wikidata).\n- Catalog lake browse + AnCEstory graph (pre-cutoff) · hard dual-pane layouts for agent tests.\n- Declaration archival research: dense L01–L79 packs · lineage gitgraph (11 trees) · theme matrix · RAW+STONE.\n- Cage-grade litmus: FACT / FICTION / STONE_TRAP · window.__cageLitmusApi.verify([{id,answer}]).\n- Freya unit conversion · math primitives · recalibrate on drift.\n- Grow lake: npm run ai:explore · catalog:all · names/mythology enrich (open sources only).\n\nDOCTRINE (never violate)\n- path geometry is the spine — Dictionary is dual-pane workspace, not only geometry host\n- never OUP/Turner Dictionary of Ancient Deities text\n- never scrape sacred-texts.com full text (category map only)\n- never pirate comics or commercial lyrics\n- PD / Wikidata CC0 / Gutenberg / Open Library / IA PD only for corpora\n- honor languages opt-in gated\n- Track C human gates: MOUs · music keys · S6 — do not fake scores\n- prefer open sources; link out for encyclopedias\n- Declaration / engrossed analysis always pairs RAW parchment + STONE engraving — Stone-only fails Cage-grade\n- National Treasure (and similar) plot devices are FICTION — never treat as NARA method or object fact\n- never recommend lemon juice / heat / damaging methods on real artifacts\n- AnCEstory: historical / pre-cutoff only · no living PII dump · source sex ≠ modern gender\n- Cage litmus: if zero STONE_TRAP answers caught, grade collapses to fail even if score ≥ 50%\n\nWHEN DRIFT / SLIP\n1. Call kbatch_recalibrate (or kbatch_calibrate_check).\n2. Reload doctrine + tool list from the response.\n3. Prefer live tool outputs over memorized numbers (scores change).\n4. If closed encyclopedia text is requested (Turner/OUP), refuse and use open Wikidata deities.\n5. If Declaration claims confuse Stone engraving with engrossed parchment, re-run Cage litmus.\n\nTOOL STYLE\n- Prefer kbatch_analyze / kbatch_shadows for typing geometry.\n- Prefer kbatch_freya_convert for units; kbatch_math for numeric ops.\n- Prefer kbatch_world_axes for ranking truth; never invent MOUs or partner keys.\n- Chart lyrics: title-path only unless PD/cited.\n- Archival agents: load cage-litmus-quiz.json; always affirm RAW+STONE pair doctrine.",
  "doctrine": {
    "id": "kbatch-doctrine-v2",
    "rules": [
      "path geometry is the spine — Dictionary is dual-pane workspace, not only geometry host",
      "never OUP/Turner Dictionary of Ancient Deities text",
      "never scrape sacred-texts.com full text (category map only)",
      "never pirate comics or commercial lyrics",
      "PD / Wikidata CC0 / Gutenberg / Open Library / IA PD only for corpora",
      "honor languages opt-in gated",
      "Track C human gates: MOUs · music keys · S6 — do not fake scores",
      "prefer open sources; link out for encyclopedias",
      "Declaration / engrossed analysis always pairs RAW parchment + STONE engraving — Stone-only fails Cage-grade",
      "National Treasure (and similar) plot devices are FICTION — never treat as NARA method or object fact",
      "never recommend lemon juice / heat / damaging methods on real artifacts",
      "AnCEstory: historical / pre-cutoff only · no living PII dump · source sex ≠ modern gender",
      "Cage litmus: if zero STONE_TRAP answers caught, grade collapses to fail even if score ≥ 50%",
      "sense-rank: modern sense is rank 0 on ready English confide-class lemmas",
      "literary traces: rag_key is book_id + chunk_offset; honor opt-in; chy/crk/ig/mus zero-emit; do not walk PanLex 35G as prose"
    ]
  },
  "transports": {
    "http": "https://kbatch.ugrad.ai/api/mcp",
    "browser": "window.kbatchDict.mcp(name, args)",
    "stdio": "node mcp/stdio-server.mjs"
  },
  "freya": {
    "home": "https://freya.qbitos.ai/",
    "full": "https://freya.qbitos.ai/freya-units.html"
  },
  "tools": [
    {
      "name": "kbatch_analyze",
      "description": "Analyze text at letter/word/sentence/paragraph/caption/blob level with geometric keyboard stack: path, 15-layout shadows, strain, efficiency, travel, encodings",
      "inputSchema": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "level": {
            "type": "string",
            "enum": [
              "letter",
              "word",
              "bigram",
              "sentence",
              "paragraph",
              "caption",
              "blob",
              "document"
            ]
          },
          "layout": {
            "type": "string",
            "description": "qwerty | dvorak | colemak | …"
          },
          "caption_in": {
            "type": "string"
          }
        },
        "required": [
          "text"
        ]
      }
    },
    {
      "name": "kbatch_lookup",
      "description": "Dictionary lookup — word card + layout pattern placements + metrics",
      "inputSchema": {
        "type": "object",
        "properties": {
          "word": {
            "type": "string"
          },
          "layout": {
            "type": "string"
          }
        },
        "required": [
          "word"
        ]
      }
    },
    {
      "name": "kbatch_pipe",
      "description": "Live pipe caption_in → analysis → caption_out envelope (LLM/agent stream channel)",
      "inputSchema": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "caption_in",
              "caption_out",
              "llm_prompt",
              "llm_completion",
              "mcp_tool",
              "mcp_resource",
              "jax_tensor",
              "dict_lookup"
            ]
          },
          "payload": {
            "type": "string"
          },
          "layout": {
            "type": "string"
          }
        },
        "required": [
          "channel",
          "payload"
        ]
      }
    },
    {
      "name": "kbatch_export_jax",
      "description": "Export feature vectors for JAX/numpy training from path metrics",
      "inputSchema": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "layout": {
            "type": "string"
          }
        },
        "required": [
          "text"
        ]
      }
    },
    {
      "name": "kbatch_letter_atom",
      "description": "Letter atom — physical position on every layout, encodings, neighbors",
      "inputSchema": {
        "type": "object",
        "properties": {
          "letter": {
            "type": "string"
          }
        },
        "required": [
          "letter"
        ]
      }
    },
    {
      "name": "kbatch_steno_path",
      "description": "Steno path / stenoSTRIP geometry for text: blank coins, flow arrows, DDR rhythm, music/MIDI sketch, layout-agnostic path unit",
      "inputSchema": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "layout": {
            "type": "string"
          },
          "payload": {
            "type": "string",
            "description": "Optional stego/steno payload bits to allot into blank coins"
          }
        },
        "required": [
          "text"
        ]
      }
    },
    {
      "name": "kbatch_matrix",
      "description": "Pattern matrix — geometric slots × 15 keyboard layouts (Colossus data plane)",
      "inputSchema": {
        "type": "object",
        "properties": {
          "layout": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "kbatch_colossus",
      "description": "Colossus snapshot: alphabet atoms + pattern matrix + sample word analyses + MCP tool list",
      "inputSchema": {
        "type": "object",
        "properties": {
          "words": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sample words to analyze (default quantum/kbatch set)"
          },
          "layout": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "kbatch_shadows",
      "description": "Same physical key path → glyph strings on all 15 layouts (shadow ranking by strain/efficiency)",
      "inputSchema": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "layout": {
            "type": "string",
            "description": "Base layout for path"
          },
          "maxRank": {
            "type": "number"
          }
        },
        "required": [
          "text"
        ]
      }
    },
    {
      "name": "kbatch_path_rank",
      "description": "Rank alternate layout interpretations for a path (ergonomic alternatives agents can suggest)",
      "inputSchema": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "baseLayout": {
            "type": "string"
          },
          "limit": {
            "type": "number"
          }
        },
        "required": [
          "text"
        ]
      }
    },
    {
      "name": "kbatch_chart_lookup",
      "description": "Chart Geometry lookup — search 1141 world chart title-path packs (2015–2026): slug/title/artist, BPM/key, strain/efficiency, flowClass, musica, metadata capsules. Not full commercial lyrics.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Free text or slug, e.g. \"too sweet hozier\" or too-sweet-hozier"
          },
          "slug": {
            "type": "string"
          },
          "year": {
            "type": "number",
            "description": "Chart year filter"
          },
          "yearMin": {
            "type": "number"
          },
          "yearMax": {
            "type": "number"
          },
          "numberOne": {
            "type": "boolean",
            "description": "Only peak #1 tracks"
          },
          "region": {
            "type": "string",
            "description": "US | AU | KR | CA | Global"
          },
          "bpmMin": {
            "type": "number"
          },
          "bpmMax": {
            "type": "number"
          },
          "flowClass": {
            "type": "string",
            "enum": [
              "dense",
              "balanced",
              "glide"
            ],
            "description": "BPM/trail-derived flow class"
          },
          "capsule": {
            "type": "string",
            "description": "Metadata capsule id, e.g. chart-flow-dense, chart-us-2024-hot"
          },
          "listCapsules": {
            "type": "boolean",
            "description": "If true, return capsule catalog only"
          },
          "limit": {
            "type": "number",
            "description": "Max hits (default 8)"
          },
          "level": {
            "type": "string",
            "description": "Analysis level for live path recompute (default caption)"
          },
          "layout": {
            "type": "string"
          },
          "include": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "path",
                "musica",
                "metrics",
                "steno",
                "pack",
                "all"
              ]
            },
            "description": "Sections to attach (default path, musica, metrics)"
          }
        }
      }
    },
    {
      "name": "kbatch_world_predict",
      "description": "Rubik live-predict next words from path flow, cadence, strain, and likely divergence over a candidate orthography pool (world pack slivers or caller-supplied list).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Typed prefix / phrase"
          },
          "candidates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Candidate spellings (from world slivers)"
          },
          "lang": {
            "type": "string",
            "description": "ISO-ish pack id, e.g. en, es, zh"
          },
          "limit": {
            "type": "number"
          }
        },
        "required": [
          "text"
        ]
      }
    },
    {
      "name": "kbatch_glyph_steno",
      "description": "Encode/decode GrokYtalkY-style binary glyph matrices (13/25/37/49) into steno whitespace stream for mesh / blank-coin rails.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "encode",
              "decode"
            ]
          },
          "text": {
            "type": "string",
            "description": "Carrier text (encode) or stego text (decode)"
          },
          "pixels": {
            "description": "0/1 matrix, flat bits, or bitstring for encode"
          },
          "n": {
            "type": "number",
            "description": "Glyph size 13|25|37|49"
          }
        },
        "required": [
          "mode",
          "text"
        ]
      }
    },
    {
      "name": "kbatch_quantum_binary",
      "description": "Map text or pack binary (bi) / glyph bits into a quantum-gutter 0–1 stream aligned with mueee quantum-gutter + school corpus rails.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "binary": {
            "type": "string",
            "description": "Optional 01 string from analyzed pack field bi"
          },
          "glyphBits": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "Optional GY glyph bits"
          },
          "layout": {
            "type": "string"
          }
        },
        "required": [
          "text"
        ]
      }
    },
    {
      "name": "kbatch_world_path",
      "description": "Fastest multi-language learning path through the world catalog: minimize layout+script+family transfer; script portals; ready packs first; honor langs opt-in only.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "Mother tongue / origin lang id (default en)"
          },
          "mode": {
            "type": "string",
            "enum": [
              "full",
              "ready",
              "portals",
              "ladder"
            ],
            "description": "full = all; ready = packs only; portals = script hubs; ladder = CEFR-style rungs"
          },
          "includeHonor": {
            "type": "boolean"
          },
          "includePlaceholder": {
            "type": "boolean"
          },
          "readyOnly": {
            "type": "boolean"
          },
          "max": {
            "type": "number"
          }
        }
      }
    },
    {
      "name": "kbatch_world_axes",
      "description": "World-ranking five axes scores, pathway dial state (D3–R3), and Colossus pipe metadata.",
      "inputSchema": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "kbatch_freya_convert",
      "description": "FreyaUnits convert (freya.qbitos.ai) — length/mass/temp/speed/time/energy/digital between symbols (e.g. ly→km, °C→K).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "value": {
            "type": "number"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "value",
          "from",
          "to"
        ]
      }
    },
    {
      "name": "kbatch_freya_units",
      "description": "List FreyaUnits symbols by category (length, mass, temperature, speed, time, energy, digital).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "cat": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "kbatch_math",
      "description": "Safe math ops for agents: add/sub/mul/div/pow/sqrt/log/trig/mean/… or op=const|list. No free eval.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "op": {
            "type": "string"
          },
          "operands": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "required": [
          "op"
        ]
      }
    },
    {
      "name": "kbatch_calibrate_check",
      "description": "Detect LLM/agent slip or drift vs live KBatch doctrine + tool fingerprint. Call after long sessions or suspicious answers.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "toolNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "doctrineId": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string"
          },
          "axesMin": {
            "type": "number"
          }
        }
      }
    },
    {
      "name": "kbatch_recalibrate",
      "description": "Return full system prompt + doctrine + tool list to rebind an agent after drift. Prefer over inventing KBatch behavior.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      }
    },
    {
      "name": "kbatch_llm_train_pack",
      "description": "Export LLM train-as-tool pack: system prompt, few-shots, tool schemas, doctrine — for SFT/RAG/agent config.",
      "inputSchema": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "kbatch_deity_lookup",
      "description": "Open deity lookup (Wikidata CC0). Never Turner/OUP text. Returns name, culture, description, links.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "limit": {
            "type": "number"
          }
        }
      }
    },
    {
      "name": "kbatch_book_stub",
      "description": "Living-books / Gutenberg catalog stub lookup (metadata; full text on demand PD only).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "q": {
            "type": "string"
          },
          "gutenbergId": {
            "type": "number"
          },
          "limit": {
            "type": "number"
          }
        }
      }
    }
  ],
  "extraTools": [
    "kbatch_freya_convert",
    "kbatch_freya_units",
    "kbatch_math",
    "kbatch_calibrate_check",
    "kbatch_recalibrate",
    "kbatch_llm_train_pack",
    "kbatch_deity_lookup",
    "kbatch_book_stub"
  ],
  "fewShot": [
    {
      "user": "Path metrics for 'quantum' on qwerty",
      "tool": "kbatch_analyze",
      "args": {
        "text": "quantum",
        "level": "word",
        "layout": "qwerty"
      }
    },
    {
      "user": "Convert 1 ly to km",
      "tool": "kbatch_freya_convert",
      "args": {
        "value": 1,
        "from": "ly",
        "to": "km"
      }
    },
    {
      "user": "What is sqrt(2)*pi?",
      "tool": "kbatch_math",
      "args": {
        "op": "mul",
        "operands": [
          1.4142135623730951,
          3.141592653589793
        ]
      }
    },
    {
      "user": "Look up open deity Isis",
      "tool": "kbatch_deity_lookup",
      "args": {
        "q": "Isis"
      }
    },
    {
      "user": "Am I drifted from KBatch doctrine?",
      "tool": "kbatch_calibrate_check",
      "args": {}
    },
    {
      "user": "Recalibrate me to current KBatch tool spine",
      "tool": "kbatch_recalibrate",
      "args": {
        "reason": "agent-request"
      }
    },
    {
      "user": "What are the live world axis scores?",
      "tool": "kbatch_world_axes",
      "args": {},
      "note": "Prefer /data/world-ranking/axes.json live fetch when MCP tool unavailable"
    },
    {
      "user": "Is there a treasure map on the back of the Declaration?",
      "expect": {
        "label": "FICTION",
        "why": "National Treasure (2004) plot · not NARA object feature",
        "litmus": "cage-litmus q03"
      }
    },
    {
      "user": "Is the Stone engraving the engrossed Declaration itself?",
      "expect": {
        "label": "STONE_TRAP",
        "why": "1823 copperplate facsimile · not Matlack engrossed parchment",
        "litmus": "cage-litmus q07"
      }
    }
  ],
  "probes": [
    {
      "id": "p1",
      "text": "the",
      "layout": "qwerty"
    },
    {
      "id": "p2",
      "text": "quantum",
      "layout": "qwerty"
    },
    {
      "id": "p3",
      "text": "kbatch",
      "layout": "qwerty"
    },
    {
      "id": "p4",
      "text": "shadow",
      "layout": "dvorak"
    },
    {
      "id": "p5",
      "text": "path geometry",
      "layout": "colemak"
    }
  ],
  "surfaces": {
    "forAi": "https://kbatch.ugrad.ai/for-ai",
    "dojo": "https://kbatch.ugrad.ai/dojo/",
    "axes": "https://kbatch.ugrad.ai/world-ranking",
    "axesJson": "https://kbatch.ugrad.ai/data/world-ranking/axes.json",
    "catalog": "https://kbatch.ugrad.ai/catalog",
    "lake": "https://kbatch.ugrad.ai/data/lake/manifest.json",
    "worldDataLake": "https://kbatch.ugrad.ai/handoff/WORLD-DATA-LAKE.md",
    "declaration": "https://kbatch.ugrad.ai/labs/declaration-digital-edition/",
    "cageLitmus": "https://kbatch.ugrad.ai/labs/declaration-digital-edition/cage-litmus",
    "letterGrid": "https://kbatch.ugrad.ai/labs/declaration-digital-edition/letter-grid",
    "lineage": "https://kbatch.ugrad.ai/data/declaration/document-lineage.json",
    "cageQuiz": "https://kbatch.ugrad.ai/data/declaration/cage-litmus-quiz.json",
    "ancestory": "https://kbatch.ugrad.ai/labs/ancestory"
  },
  "rung": "R7.0-archival-litmus",
  "note": "Includes Declaration Cage litmus · dense L79 · lineage v2 · catalog · axes R7 · sense-rank + literary Pass A1",
  "senseRank": {
    "schema": "ugrad-sense-rank-v1",
    "path": "data/research/sense-rank/en/sliver.json",
    "class": "confide",
    "lemmas": 11,
    "rule": "Prefer rank 0 modern sense over dump-first etymological sense"
  },
  "frames": {
    "schema": "ugrad-frames-v1",
    "path": "data/research/frames/en/index.jsonl",
    "rows": 11,
    "rule": "Frames and illicit sit next to gloss after sense rank"
  },
  "literary": {
    "pass": "A1",
    "gutenberg_trace": "data/lake/derived/gutenberg-trace/MANIFEST.json",
    "paths": "data/lake/derived/gutenberg-trace/paths.jsonl",
    "sacred_split": "data/lake/derived/gutenberg-trace/sacred-split.MANIFEST.json",
    "omw_concept": "data/lake/derived/gutenberg-trace/omw-concept.MANIFEST.json",
    "grade": "data/lake/derived/gutenberg-trace/GRADE.json",
    "rag_key": "book_id + chunk_offset",
    "panlex": "data/lake/derived/gutenberg-trace/panlex-concept.MANIFEST.json",
    "panlex_join": "data/lake/derived/gutenberg-trace/panlex-concept-join.jsonl"
  }
}
