Expand description
Document assembly + rule-running engine — mirrors
core/engine.py’s parse_document/load_journal/run.
.tex/.ltx/.bib/.rnw/.rmd are all supported. .rnw chunk
rewriting lives in crate::rnw; .rmd tokenizing/fragment
construction lives in crate::rmd (see that module’s doc comment
for the line-offset scheme). Most rules iterate
all_tex_like_docs() (tex_files + every .Rmd fragment); a few
(GLOBAL_TEX_RULES, below) need every fragment together in one
call instead of one call per fragment — see that constant’s doc
comment for which and why.
No filesystem I/O here — from_sources takes already-read
(path, contents) pairs so every binding (including WASM, which
has no filesystem) can drive the same engine.
Structs§
- Parsed
BibFile Doc - Parsed
Document - Parsed
RmdFile Doc - Mirrors
api.py::ParsedRmdFile.latex_fragmentsare the raw-LaTeX islands extracted from prose blocks (spec 005 FR-006) — every rule that iteratesall_tex_like_docs()sees these alongside real.texfiles.violationsareJSS-PARSE-000findings from the Rmd tokenizer itself (unterminated frontmatter/fence, malformed YAML), not rule findings. - Parsed
TexFile Doc
Enums§
Functions§
- run
- Run every registered rule over
document, applying the ignore-rules and min-confidence gates, and assemble aComplianceReport. Mirrorscore/engine.py::run’s algorithm (category/rule iteration,SkippedRulebookkeeping, format gating, the syntheticJSS-PARSE-000“parse” category,compliance_percentage, sorted violations, severity overrides). One thing still deferred: inline suppression comments (% jss-lint: ignore [RULE-IDS]) aren’t implemented — every rule finding is reported regardless.JSS-PARSE-000findings currently only ever come from.Rmd’s tokenizer (unterminated frontmatter/fence, malformed YAML); the tex tokenizer itself (.tex/.ltx/.rnw) never emits one — it only implements pylatexenc’s tolerant-parsing path, which never raises, unlike Python’s strict-then-tolerant-retryparse_tex_source(seetex::parse_tex_source’s doc comment). - run_
with_ project - Like
run, but also dispatchesJSS-PROJECT-001(cycle) /JSS-PROJECT-002(missing reference) — the graph-level violations a filesystem-bound resolver (jsslint-cli’sresolvermodule, mirroringcore/resolver.py) already computed by walkingdocument’s\input/\include/\subfile/\bibliographygraph. Mirrorscore/engine.py::runbeing handed aParsedProjectinstead of a plainParsedDocument: these two rules only ever run when a project was actually resolved (spec 013’s auto-resolve path); a bare multi-filedocument(explicit CLI args,--no-resolve, or any other subcommand) uses plainrunabove and never invokes them — leaving the “project” category at 0 rules applied (SKIPPED), same as Python leavesrule.check_projectuncalled for a bareParsedDocument.