Glossary build
Build a paper’s glossary index from its manifests and render the LaTeX. --check reports drift instead of writing, comparing everything except the generated timestamp so a re-run is not mistaken for a change.
Skills it satisfies
A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.
document-intake
Process uploaded documents (PDFs, scans, LaTeX, structured/normative guidelines, etc.) from uploads/ into structured content objects. Handles OCR extraction, environment detection, structural analysis, and content-object generation. Supports multi-stage pipelines: raw upload → extracted text → structured blocks → .ts/.md content objects.
Source: folio-assistant-core/skills/library/ingestion/document-intake.md.
The skill declares no I/O contract (schemas/skills/document-intake/{input,output}.schema.json).
Inputs and outputs
Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.
| port | type | required | description | constraint | |
|---|---|---|---|---|---|
| in | targetPath | RepoPath | yes | The paper directory, which must hold a <paper>.ts manifest. Absent, the command exits 2 with its usage — could-not-determine, not an empty glossary. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. |
| in | check | Flag | Report drift and write nothing. | boolean · A boolean switch — projects to a bare flag, with no value word | |
| out | glossary | RepoPath | glossary.json beside the paper, and chapters/glossary.tex at the repo root. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. |
Processes and tasks
Steps this Tool can carry out, because each names a skill it satisfies:
| process | step | lane | via skill |
|---|---|---|---|
| Getting started | Scan the repo for content worth importing | Onboarding agent (system) | document-intake |
| Evidence for a recommendation | Search trusted L1 sources | Evidence agent (system) | document-intake |
| Evidence for a recommendation | Search trusted L2 and L3 content | Evidence agent (system) | document-intake |
| Evidence for a recommendation | Query data repositories and statistical datasets | Evidence agent (system) | document-intake |
| L1 document ingestion — a document to the L1 source knowledge graph | Detect media type, mint a doc id | Ingestion Engine (agent, runs unattended) | document-intake |
| L1 document ingestion — a document to the L1 source knowledge graph | Establish the licence from the upload | Ingestion Engine (agent, runs unattended) | document-intake |
| L1 document ingestion — a document to the L1 source knowledge graph | Extract structure | Ingestion Engine (agent, runs unattended) | document-intake |
| L1 document ingestion — a document to the L1 source knowledge graph | Derive content from the assets | Ingestion Engine (agent, runs unattended) | document-intake |
| L1 document ingestion — a document to the L1 source knowledge graph | Build the L1 knowledge graph | Ingestion Engine (agent, runs unattended) | document-intake |
| L1 document ingestion — a document to the L1 source knowledge graph | [Move into library/ | Ingestion Engine (agent, runs unattended) | document-intake |
| L1 document ingestion — a document to the L1 source knowledge graph | Available to cite as an L1 source | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — build the L1 knowledge graph | Write dublin-core.jsonld (the record of truth) | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — build the L1 knowledge graph | Write manifest.jsonld referencing it | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — build the L1 knowledge graph | Record assets[] — local path or remote URL | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — build the L1 knowledge graph | Bind the folder to its bibliography slug | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — build the L1 knowledge graph | Link L1 nodes into the corpus graph | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — derive content from the assets | Archive → greppable contents manifest | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — derive content from the assets | File info, sizes, hashes, timestamps, mimetype | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — derive content from the assets | Narrative description per image, localized | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — derive content from the assets | Transcribe and translate audio | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — derive content from the assets | Sheet names, headers, shape, narrative | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — derive content from the assets | Extract figures and tables | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — derive content from the assets | Cite the author of every narrative | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — extract structure | Extract the text layer | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — extract structure | OCR to ocr/page-*.txt | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — extract structure | Split into sections/*.md with doc_brief front-matter | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — extract structure | Write structure.json | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — extract structure | Extract claim candidates | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — the L1 completeness gate | Is every derived artefact present? | Ingestion Engine (agent, runs unattended) | document-intake |
| Ingestion subprocess — the L1 completeness gate | Adjudicate the flagged passage | Reviewer (SME or editor) | document-intake |
| Ingestion subprocess — the L1 completeness gate | Record the L1 completeness verdict | Ingestion Engine (agent, runs unattended) | document-intake |
How it is deployed and reached
- Command line. From the repository root:
bun run folio-assistant-core/scripts/build-glossary.ts. - GitHub Actions. No workflow in this checkout runs its command.
As an API: its operation in the OpenAPI document and the MCP tool list of its layer.
| install | none |
| runtime | bun |
| network | no |
What it is made of
| role | file | |
|---|---|---|
| definition | folio-assistant-core/tools/glossary-build/glossary-build.ts | |
| script | folio-assistant-core/scripts/build-glossary.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/folio-assistant-core/tools/glossary-build.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.
{
"@context": "https://litlfred.github.io/folio-assistant/folio-assistant-core/folio-assistant-core.context.jsonld",
"@id": "https://litlfred.github.io/folio-assistant/folio-assistant-core/tools/glossary-build.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/folio-assistant-core/folio-assistant-core.jsonld",
"name": "glossary-build",
"title": "Glossary build",
"description": "Build a paper's glossary index from its manifests and render the LaTeX. `--check` reports drift instead of writing, comparing everything except the `generated` timestamp so a re-run is not mistaken for a change.",
"install": {
"none": true
},
"invoke": {
"shell": "bun run folio-assistant-core/scripts/build-glossary.ts"
},
"io": {
"inputs": [
{
"name": "targetPath",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "The paper directory, which must hold a `<paper>.ts` manifest. Absent, the command exits 2 with its usage — could-not-determine, not an empty glossary.",
"required": true,
"arg": {
"positional": 0
}
},
{
"name": "check",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Flag",
"description": "Report drift and write nothing.",
"required": false,
"arg": {
"flag": "--check"
}
}
],
"outputs": [
{
"name": "glossary",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "`glossary.json` beside the paper, and `chapters/glossary.tex` at the repo root."
}
]
},
"satisfies": [
"document-intake"
],
"requirements": {
"runtime": [
"bun"
],
"network": false
}
}