{
  "manifest": "magalia.wiki knowledge-pool runtime selector",
  "kind": "integration-manifest",
  "version": "1.1",
  "last_updated": "2026-05-22",
  "knowledge_base_path": "/knowledge/",
  "purpose": "The runtime selector that the magalia.wiki DeepSeek assistant reads to decide which knowledge pools to load as grounding on a given page. knowledge-loader.js fetches this file, reads the page's data-mwai-subject and optional data-mwai-pools attributes, loads the named pools, and assembles a grounding block for the assistant's system prompt. The companion document is INTEGRATION.md; the library itself is indexed in KNOWLEDGE-POOL-PLAN.md.",
  "how_selection_works": [
    "A page declares its profile with data-mwai-subject on <body> (for example data-mwai-subject=\"epigraphy\").",
    "If data-mwai-pools is also present on <body>, it is an explicit comma-separated list of pool keys and overrides the subject default (for example data-mwai-pools=\"funerary-epigraphy,honorific-and-civic-epigraphy\").",
    "Otherwise the loader uses the subject's default_pools below.",
    "Each pool contributes its prose primer (.md, for understanding) and, where it exists, its citation pool (.json, for attribution). The assistant may cite ONLY from the loaded citation pools.",
    "The loader caps total grounding at loader_settings.max_grounding_chars; if exceeded it keeps the primers and drops citation pools from the end of the list."
  ],
  "loader_settings": {
    "max_grounding_chars": 75000,
    "include_primers": true,
    "include_citations": true,
    "subjects_without_knowledge_grounding": ["latin", "greek", "pottery", "exam", "concierge"]
  },
  "pools": {
    "published-epigraphy": {
      "primer": "published-epigraphy.md",
      "citations": null,
      "tier": 0,
      "period_banded": false,
      "citation_count": 0,
      "topic": "The published epigraphic record: the great corpora, sigla, indexes, and how inscriptions reach print."
    },
    "digital-epigraphy": {
      "primer": "digital-epigraphy.md",
      "citations": null,
      "tier": 0,
      "period_banded": false,
      "citation_count": 0,
      "topic": "Digital epigraphy: EpiDoc, the online databases, and the digital turn in the discipline."
    },
    "leiden-and-encoding": {
      "primer": "leiden-and-encoding.md",
      "citations": "citations-leiden-and-encoding.json",
      "tier": 1,
      "period_banded": false,
      "citation_count": 49,
      "topic": "The Leiden conventions and the EpiDoc encoding of inscriptions."
    },
    "epigraphic-method": {
      "primer": "epigraphic-method.md",
      "citations": "citations-epigraphic-method.json",
      "tier": 1,
      "period_banded": false,
      "citation_count": 46,
      "topic": "Epigraphic method: autopsy, squeezes, drawings, editing, and the epigraphic habit."
    },
    "dating-and-palaeography": {
      "primer": "dating-and-palaeography.md",
      "citations": "citations-dating-and-palaeography.json",
      "tier": 1,
      "period_banded": true,
      "citation_count": 5,
      "topic": "Dating and palaeography: ancient scripts, letter-forms, and the dating of inscriptions."
    },
    "history-of-epigraphy": {
      "primer": "history-of-epigraphy.md",
      "citations": "citations-history-of-epigraphy.json",
      "tier": 3,
      "period_banded": false,
      "citation_count": 43,
      "topic": "The history of epigraphy: antiquarianism, the Renaissance indexers, the Berlin Academy corpora."
    },
    "funerary-epigraphy": {
      "primer": "funerary-epigraphy.md",
      "citations": "citations-funerary-epigraphy.json",
      "tier": 2,
      "period_banded": true,
      "citation_count": 23,
      "topic": "Funerary epigraphy: epitaphs, commemorative formulae, the epigraphic habit."
    },
    "legal-and-administrative-epigraphy": {
      "primer": "legal-and-administrative-epigraphy.md",
      "citations": "citations-legal-and-administrative-epigraphy.json",
      "tier": 2,
      "period_banded": true,
      "citation_count": 8,
      "topic": "Legal and administrative epigraphy: inscribed laws, decrees, senatus consulta, official letters."
    },
    "honorific-and-civic-epigraphy": {
      "primer": "honorific-and-civic-epigraphy.md",
      "citations": "citations-honorific-and-civic-epigraphy.json",
      "tier": 2,
      "period_banded": true,
      "citation_count": 11,
      "topic": "Honorific and civic epigraphy: honorific decrees, statue bases, proxeny, euergetism, the imperial cult."
    },
    "religious-and-sacred-epigraphy": {
      "primer": "religious-and-sacred-epigraphy.md",
      "citations": "citations-religious-and-sacred-epigraphy.json",
      "tier": 2,
      "period_banded": true,
      "citation_count": 9,
      "topic": "Religious and sacred epigraphy: votive dedications, sacred law, sacrificial calendars, cult."
    },
    "verse-inscriptions": {
      "primer": "verse-inscriptions.md",
      "citations": "citations-verse-inscriptions.json",
      "tier": 2,
      "period_banded": true,
      "citation_count": 11,
      "topic": "Verse inscriptions: metrical epitaphs, inscribed epigrams, the Greek and Latin carmina epigraphica."
    },
    "onomastics-and-prosopography": {
      "primer": "onomastics-and-prosopography.md",
      "citations": "citations-onomastics-and-prosopography.json",
      "tier": 2,
      "period_banded": true,
      "citation_count": 10,
      "topic": "Onomastics and prosopography: Greek and Roman naming systems and the identification of persons."
    },
    "forgery-and-authenticity": {
      "primer": "forgery-and-authenticity.md",
      "citations": "citations-forgery-and-authenticity.json",
      "tier": 3,
      "period_banded": true,
      "citation_count": 9,
      "topic": "Forgery and authenticity: false inscriptions, the falsae, Pirro Ligorio, the detection of fakes."
    }
  },
  "subjects": {
    "epigraphy": {
      "prompt_profile": "epigraphy",
      "default_pools": ["epigraphic-method"],
      "note": "General epigraphy pages. Thematic pages should override with data-mwai-pools (for example a page on tombstones sets data-mwai-pools=\"funerary-epigraphy\"); a page on the corpora may add published-epigraphy."
    },
    "epidoc": {
      "prompt_profile": "epidoc",
      "default_pools": ["leiden-and-encoding"],
      "note": "EpiDoc editors, the EpiDoc guide, the Leiden playground, and encoding-focused workshop pages. A page on the databases may add digital-epigraphy via data-mwai-pools."
    },
    "scholarship": {
      "prompt_profile": "scholarship",
      "default_pools": ["history-of-epigraphy"],
      "note": "The CIL, Ligorio, and Mommsen history essays and the SDAM walkthroughs. Pages on forgery may add data-mwai-pools=\"forgery-and-authenticity\"."
    },
    "inscriptions": {
      "prompt_profile": "epigraphy",
      "default_pools": ["epigraphic-method"],
      "note": "The inscriptions Reading Room. A viewer that knows an inscription's genre at runtime should call window.MagaliaKnowledge.load() with the matching thematic pool key."
    },
    "latin": { "prompt_profile": "latin", "default_pools": [], "note": "No epigraphy knowledge grounding." },
    "greek": { "prompt_profile": "greek", "default_pools": [], "note": "No epigraphy knowledge grounding." },
    "pottery": { "prompt_profile": "pottery", "default_pools": [], "note": "No epigraphy knowledge grounding." },
    "exam": { "prompt_profile": "exam", "default_pools": [], "note": "No epigraphy knowledge grounding." },
    "concierge": { "prompt_profile": "concierge", "default_pools": [], "note": "Site-navigation profile for index.html; no knowledge grounding." }
  },
  "prompt_profiles": {
    "_note": "Language-neutral system-prompt personas, one per subject profile. knowledge-loader.js resolves the page's data-mwai-subject to a profile name (the prompt_profile field of each subject above) and exposes the persona via window.MagaliaKnowledge.getProfile(). The assistant appends its own 'Reply in ...' language clause, the page content, and the knowledge grounding.",
    "latin": "You are a precise, encouraging Latin teaching assistant embedded in a Latin reader on magalia.wiki, a bilingual classics teaching site. Help the student read the Latin on this page: grammar, morphology, syntax, vocabulary, idiomatic translation, and historical context, and parse selected Latin word by word. Be accurate and pedagogical; never invent Latin that is not in the source text, and say 'uncertain' rather than guess.",
    "greek": "You are a precise, encouraging Ancient Greek teaching assistant embedded in a Greek reader on magalia.wiki, a bilingual classics teaching site. Help the student read the Greek on this page: grammar, morphology, syntax, vocabulary, idiomatic translation, and historical context, and parse selected Greek word by word. Be accurate and pedagogical; never invent Greek that is not in the source text, and say 'uncertain' rather than guess.",
    "epigraphy": "You are a precise epigraphy study assistant embedded on magalia.wiki, a bilingual classics teaching site. Help the reader understand the inscription or epigraphic discussion on this page: the text and its formulae, its date and period band, and its historical and social context. Read inscriptions by the standards of the discipline and as the curated knowledge pools below direct. Treat restored text as conjecture; never invent an inscription, a reading, a date, or a citation, and say 'uncertain' rather than guess.",
    "epidoc": "You are an EpiDoc and Leiden-conventions assistant embedded on magalia.wiki, a bilingual classics teaching site. Help the user encode and read inscriptions: convert Leiden transcriptions to EpiDoc XML, explain editorial signs and EpiDoc elements, and explain validation errors in plain language. Be exact about the encoding standard; never invent an element, an attribute, or a reading, and say 'uncertain' rather than guess.",
    "scholarship": "You are a reading companion for scholarly prose on the history of epigraphy, embedded on magalia.wiki, a bilingual classics teaching site. Help the reader follow the argument on this page: explain a paragraph, translate a German or Latin quotation, and lay out a chronology of scholars and corpora. Be accurate about dates, scholars, and works; never invent a source, a date, or a fact, and say 'uncertain' rather than guess.",
    "pottery": "You are an ancient-pottery and art-history assistant embedded on magalia.wiki, a bilingual classics teaching site. Help the reader understand Greek vase-painting and ceramic practice on this page: black-figure and red-figure technique, the chaine operatoire, kiln chemistry, and the economics of the Athenian workshop. Be accurate; never invent an object or an attribution, and say 'uncertain' rather than guess.",
    "exam": "You are a Latin examiner embedded in an exam-practice page on magalia.wiki, a bilingual classics teaching site. Generate fresh practice items in the style of the page's material, mark the student's attempts, explain each mark, and diagnose the grammar topics the student keeps missing. Be exam-accurate; never invent text that is not Latin of the appropriate period, and say 'uncertain' rather than guess.",
    "concierge": "You are the site guide for magalia.wiki, a bilingual English and Chinese classics and digital-humanities teaching site. Help the visitor find the right page or bundle for what they want to learn, and explain how the site is organised. Never invent pages or features; if you are unsure where something is, say so plainly."
  },
  "thematic_pool_keys": [
    "funerary-epigraphy",
    "legal-and-administrative-epigraphy",
    "honorific-and-civic-epigraphy",
    "religious-and-sacred-epigraphy",
    "verse-inscriptions",
    "onomastics-and-prosopography"
  ],
  "grounding_guardrails": [
    "The loaded primers ground understanding; the loaded citation pools supply attribution. Cite ONLY from the loaded citation pools; never introduce a citation, author, work, or page number that is not in them.",
    "Quote a pool's quotation field verbatim; never paraphrase inside quotation marks.",
    "Honour each period-banded pool's period field; name the period band when a question concerns a specific period.",
    "Treat restored text as conjecture and never invent an inscription, a reading, a date, or a citation.",
    "magalia.wiki is bilingual English and Chinese; gloss technical terms on first use."
  ]
}
