TeX snippet validation (AST)
Parse every tex snippet in a folio’s blocks and report what will not compile — structural, not textual: it reads an AST rather than matching patterns. Complementary to latex-preflight, which gates a main.tex before a compile, and to latex-overfull, which reads a log after one.
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.
latex-validation
Source: folio-assistant-sci/skills/content/folio-paper-adapter/latex-validation.md.
Also satisfied by: latex-overfull, latex-preflight, tex-source-audit.
The skill declares no I/O contract (schemas/skills/latex-validation/{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 | paper | Slug | One folio by slug. Absent, every folio the content root holds. | string · pattern ^[a-z0-9][a-z0-9-]*$ · A folio slug, e.g. quantum-observable-universe | |
| in | file | RepoPath | A single .md block, for the narrow case. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| in | compile | Flag | Also compile each snippet with pdflatex — needs a TeX distribution, which the base requires does NOT claim. | boolean · A boolean switch — projects to a bare flag, with no value word | |
| in | json | Flag | boolean · A boolean switch — projects to a bare flag, with no value word | ||
| in | warningsLog | RepoPath | Write a QA-compatible log to this path. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| out | report | Text | Per snippet, what will not compile. With no folio to scan it reports Files scanned: 0 and exits 2 (could-not-determine). Read the scanned count before reading the verdict. | string · A short single-line human string. Not admissible as a command-line argument. |
Processes and tasks
No process step names a skill this Tool satisfies.
How it is deployed and reached
- Command line. From the repository root:
bun run cat latex:validate.cat latex:validaterunsbun run folio-assistant-sci/pipeline/validate-tex.ts(declared infolio-assistant-sci/package.json). - 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-sci/tools/tex-snippet-validate/tex-snippet-validate.ts | |
| script | folio-assistant-sci/pipeline/validate-tex.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/folio-assistant-sci/tools/tex-snippet-validate.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-sci/folio-assistant-sci.context.jsonld",
"@id": "https://litlfred.github.io/folio-assistant/folio-assistant-sci/tools/tex-snippet-validate.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/folio-assistant-sci/folio-assistant-sci.jsonld",
"name": "tex-snippet-validate",
"title": "TeX snippet validation (AST)",
"description": "Parse every `tex` snippet in a folio's blocks and report what will not compile — structural, not textual: it reads an AST rather than matching patterns. Complementary to `latex-preflight`, which gates a main.tex before a compile, and to `latex-overfull`, which reads a log after one.",
"install": {
"none": true
},
"invoke": {
"shell": "bun run cat latex:validate"
},
"io": {
"inputs": [
{
"name": "paper",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Slug",
"description": "One folio by slug. Absent, every folio the content root holds.",
"required": false,
"arg": {
"flag": "--paper"
}
},
{
"name": "file",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "A single `.md` block, for the narrow case.",
"required": false,
"arg": {
"flag": "--file"
}
},
{
"name": "compile",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Flag",
"description": "Also compile each snippet with pdflatex — needs a TeX distribution, which the base `requires` does NOT claim.",
"required": false,
"arg": {
"flag": "--compile"
}
},
{
"name": "json",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Flag",
"required": false,
"arg": {
"flag": "--json"
}
},
{
"name": "warningsLog",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "Write a QA-compatible log to this path.",
"required": false,
"arg": {
"flag": "--warnings-log"
}
}
],
"outputs": [
{
"name": "report",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/Text",
"description": "Per snippet, what will not compile. With no folio to scan it reports `Files scanned: 0` and exits 2 (could-not-determine). Read the scanned count before reading the verdict."
}
]
},
"satisfies": [
"latex-validation"
],
"requirements": {
"runtime": [
"bun"
],
"network": false
}
}