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.

porttyperequireddescriptionconstraint
inpaperSlugOne 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
infileRepoPathA 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.
incompileFlagAlso 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
injsonFlagboolean · A boolean switch — projects to a bare flag, with no value word
inwarningsLogRepoPathWrite 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.
outreportTextPer 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:validate runs bun run folio-assistant-sci/pipeline/validate-tex.ts (declared in folio-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.

installnone
runtimebun
networkno

What it is made of

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
  }
}

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev