Markdown review CLI · rule-based checks
Editorial checker
Status: v1.0 · manual run
At a glance
- What it is
- A local command-line tool that reviews Markdown with explicit rules. Standard-library Python, no model calls, JSON output.
- What I did
- Developed and reviewed with AI assistance, from lessons of the archived IO3/ALMA prototype.
- Proof
- Exit codes 0 no findings / 1 needs review / 2 error; always clinical_or_publication_approval: false. 12 acceptance tests reported passing.
- Limits
- No precision or false-negative estimate. It does not check facts, DOIs online or personal data, and never approves publication.
How it works
- Markdown files. Input: Markdown files from the informes and lab collections.
- Local rules. Explicit rules using only the Python standard library. No models or services are loaded.
- JSON report. Writes a JSON report with file, line and status to standard output. It does not modify files.
- Exit code 0 / 1 / 2. 0: no findings under these rules (not a quality or publication approval). 1: needs human review. 2: error; never a default approval.
- approval: false. The report always returns clinical_or_publication_approval: false. A person reviews the findings.
Synthetic samples and saved outputs
Interactive evidence · local editorial reviewer 1.0.0
Markdown in, findings and exit code out
SAVED Saved output of the local reviewer on synthetic samples. This page does not analyse your text.
No warnings ≠ approved. The reviewer always returns approval: false. It does not check facts, resolve DOIs or detect personal data.
| Exit code | Status (verbatim) | Meaning |
|---|---|---|
0 | SIN_HALLAZGOS_EN_ESTAS_REGLAS | No findings under these rules |
1 | REQUIERE_REVISION_HUMANA | Needs human review |
2 | ERROR | Error: not fully reviewed |
The samples are invented and written in Spanish because the rules target Spanish patient-facing copy. The DOIs in them are fictitious placeholders.
Sample A · clean
Declares a (fictitious) DOI and avoids the flagged expressions.
- Origin
- SAVED synthetic sample
- Status
SIN_HALLAZGOS_EN_ESTAS_REGLAS(No findings under these rules)- Exit code
0- Approval
approval: false
Source · informes/pausas-activas.md
sha256 052999065d02… · src/data/demos/editorial/samples/no-findings/informes/pausas-activas.md
Warnings (0)
No warnings under these rules. That is not an approval.
Saved run: command, date and raw JSON
- Command
python3 scripts/editorial/revisar_contenido.py --content-root src/data/demos/editorial/samples/no-findings(from the repository root)- Date
- Reviewer
scripts/editorial/revisar_contenido.pyv1.0.0 · Python 3.13.11- Exit code
0- stdout sha256
ca32350abfb7e390dce76973f1c72e571e5163853af308039fdd15eec575489d
{
"version": "1.0.0",
"scope": "Solo Markdown de informes y lab; reglas clínicas solo en informes",
"status": "SIN_HALLAZGOS_EN_ESTAS_REGLAS",
"files": [
{
"file": "informes/pausas-activas.md",
"collection": "informes",
"draft_literal": null,
"findings": [],
"errors": [],
"sha256": "052999065d02d3b46e1eadafd04ebfb12231fb674ca51cf54343b7e20852c081"
}
],
"errors": [],
"clinical_or_publication_approval": false,
"not_checked": [
"Veracidad clínica o legal",
"Resolución y correspondencia de DOI",
"Datos personales",
"Calidad semántica de respuestas",
"Frontmatter completo: lo valida Astro",
"Páginas fuera de informes/lab y contenido dentro de bloques de código"
]
}
Sample B · flagged
No DOI declared, a promise-like sentence and a negated one. A phrase inside a code block is ignored by design.
- Origin
- SAVED synthetic sample
- Status
REQUIERE_REVISION_HUMANA(Needs human review)- Exit code
1- Approval
approval: false
Source · informes/oferta-ficticia.md
sha256 e602140e36f9… · src/data/demos/editorial/samples/needs-review/informes/oferta-ficticia.md
Warnings (4)
- Line 1 ·
REFERENCIAS_PENDIENTESNo DOI declared in the literal format the rule expects. Sources must be checked by a person; no DOI is resolved.
No se detecta DOI declarado en el formato literal esperado; revisar fuentes. No se ha resuelto ningún DOI.
- Line 12 ·
EXPRESION_A_REVISAR· «garantizados»Expression from the watch list. A person decides whether it is a problem; nothing is blocked or rewritten.
Revisión humana: puede ser cita, negación o explicación. No se bloquea ni reescribe automáticamente.
- Line 12 ·
EXPRESION_A_REVISAR· «en 3 sesiones»Expression from the watch list. A person decides whether it is a problem; nothing is blocked or rewritten.
Revisión humana: puede ser cita, negación o explicación. No se bloquea ni reescribe automáticamente.
- Line 14 ·
EXPRESION_CON_CONTEXTO· «curación»Watch-list expression next to a negation, quote or example marker. Still needs a human reading.
Revisión humana: puede ser cita, negación o explicación. No se bloquea ni reescribe automáticamente.
Saved run: command, date and raw JSON
- Command
python3 scripts/editorial/revisar_contenido.py --content-root src/data/demos/editorial/samples/needs-review(from the repository root)- Date
- Reviewer
scripts/editorial/revisar_contenido.pyv1.0.0 · Python 3.13.11- Exit code
1- stdout sha256
54fe53f7fb5090340507070bcc510c84446c9c0a1b946f25756ea0727e25f8ae
{
"version": "1.0.0",
"scope": "Solo Markdown de informes y lab; reglas clínicas solo en informes",
"status": "REQUIERE_REVISION_HUMANA",
"files": [
{
"file": "informes/oferta-ficticia.md",
"collection": "informes",
"draft_literal": null,
"findings": [
{
"rule": "REFERENCIAS_PENDIENTES",
"line": 1,
"message": "No se detecta DOI declarado en el formato literal esperado; revisar fuentes. No se ha resuelto ningún DOI."
},
{
"rule": "EXPRESION_A_REVISAR",
"line": 12,
"expression": "garantizados",
"excerpt": "Resultados garantizados en 3 sesiones.",
"message": "Revisión humana: puede ser cita, negación o explicación. No se bloquea ni reescribe automáticamente."
},
{
"rule": "EXPRESION_A_REVISAR",
"line": 12,
"expression": "en 3 sesiones",
"excerpt": "Resultados garantizados en 3 sesiones.",
"message": "Revisión humana: puede ser cita, negación o explicación. No se bloquea ni reescribe automáticamente."
},
{
"rule": "EXPRESION_CON_CONTEXTO",
"line": 14,
"expression": "curación",
"excerpt": "No prometo una curación: cada caso es distinto.",
"message": "Revisión humana: puede ser cita, negación o explicación. No se bloquea ni reescribe automáticamente."
}
],
"errors": [],
"sha256": "e602140e36f940cda35a22205d95c1933b9dbb6e27674ca069c38b98b17a6c06"
}
],
"errors": [],
"clinical_or_publication_approval": false,
"not_checked": [
"Veracidad clínica o legal",
"Resolución y correspondencia de DOI",
"Datos personales",
"Calidad semántica de respuestas",
"Frontmatter completo: lo valida Astro",
"Páginas fuera de informes/lab y contenido dentro de bloques de código"
]
}
Sample C · error
A code block is opened and never closed, so the rest of the file cannot be reviewed.
- Origin
- SAVED synthetic sample
- Status
ERROR(Error: not fully reviewed)- Exit code
2- Approval
approval: false
Source · informes/bloque-sin-cierre.md
sha256 728a91ec7dcb… · src/data/demos/editorial/samples/error/informes/bloque-sin-cierre.md
Warnings (1)
- Line 15 ·
EXPRESION_CON_CONTEXTO· «sin riesgo»Watch-list expression next to a negation, quote or example marker. Still needs a human reading.
Revisión humana: puede ser cita, negación o explicación. No se bloquea ni reescribe automáticamente.
Errors (1)
- Bloque de código sin cierre: no se acredita cobertura del resto del texto
The file was not fully reviewed, so the run ends in
ERRORrather than a pass.
Saved run: command, date and raw JSON
- Command
python3 scripts/editorial/revisar_contenido.py --content-root src/data/demos/editorial/samples/error(from the repository root)- Date
- Reviewer
scripts/editorial/revisar_contenido.pyv1.0.0 · Python 3.13.11- Exit code
2- stdout sha256
33efb09ef34486c702197ddf121c08d1ebf65928c69207b0a887d28249c60d76
{
"version": "1.0.0",
"scope": "Solo Markdown de informes y lab; reglas clínicas solo en informes",
"status": "ERROR",
"files": [
{
"file": "informes/bloque-sin-cierre.md",
"collection": "informes",
"draft_literal": null,
"findings": [
{
"rule": "EXPRESION_CON_CONTEXTO",
"line": 15,
"expression": "sin riesgo",
"excerpt": "Un tratamiento sin riesgo no existe.",
"message": "Revisión humana: puede ser cita, negación o explicación. No se bloquea ni reescribe automáticamente."
}
],
"errors": [
"Bloque de código sin cierre: no se acredita cobertura del resto del texto"
],
"sha256": "728a91ec7dcb6f49f75e444988ac077fd83efb5273f2347bedfc01889f1953a6"
}
],
"errors": [],
"clinical_or_publication_approval": false,
"not_checked": [
"Veracidad clínica o legal",
"Resolución y correspondencia de DOI",
"Datos personales",
"Calidad semántica de respuestas",
"Frontmatter completo: lo valida Astro",
"Páginas fuera de informes/lab y contenido dentro de bloques de código"
]
}
Proof in detail
- Exit code 0: no warnings under this limited rule set (not a quality or publishing approval). Exit code 1: located warnings that a person must interpret. Exit code 2: files not examined, incomplete input or failures; never approval by default.
- The output always includes clinical_or_publication_approval: false.
- Twelve acceptance tests are reported passing, including read failures, out-of-scope links, incomplete headers, missing paths, quotes and negations, and CLI exit codes.
- Run on nine current Markdown files from this site: no warnings under these rules. Checked with Python 3.13.11.
- Read-only: it writes JSON to stdout, does not modify files and is not connected to the build, CI, hooks or publishing.
Process
- Select Markdown files
- Apply local rules
- Report file, line and status
- Human review of the findings
Limits
- No warnings does not allow estimating precision or false negatives without a reference set reviewed by people.
- It does not verify factual or clinical accuracy, DOIs over the network, citation matching or personal data. It grants no clinical approval or permission to publish.
- The original IO3/ALMA platform stays archived and is not reactivated.
Next step
Measure how useful it is as support for editorial review, and add rules only when documented needs appear.
Measurement
Twelve tests passed and nine files examined. Relevant findings caught and missed, compared with a human review, are not measured yet.
How it was built
Part of my portfolio, developed and reviewed with AI assistance. The checks cited here show what was run and the scope of the delivery; on their own they do not attribute authorship of each component.