The repository includes a runnable demo at:
examples/minimal-latex-project/
Run it with:
python run_check_once.py \
--project-root examples/minimal-latex-project \
--ruleset university-generic \
--skip-compileThe repository includes two focused reference-check demos:
examples/citation-integrity-broken/
examples/citation-integrity-clean/
python 10-check-references/check_references.py \
--project-root examples/citation-integrity-broken \
--ruleset university-genericExpected outputs:
reports/check_references-report.jsonfor pipeline compatibilityreports/citation-integrity-report.jsonfor machine-readable statusreports/citation-integrity-report.mdfor human reviewreports/citation-issues.csvfor spreadsheet-style triage
This demo should end in BLOCK and populate the CSV with concrete citation risks.
python 10-check-references/check_references.py \
--project-root examples/citation-integrity-clean \
--ruleset university-genericExpected outputs:
reports/check_references-report.jsonreports/citation-integrity-report.jsonreports/citation-integrity-report.mdreports/citation-issues.csv
This demo should end in PASS. The CSV is still written, but on a clean run it only contains the header row.
Boundary: Citation Integrity is still local-only and report-first. It does not verify references against external databases and does not auto-edit citations or bibliography entries.
The external verification runner adds a separate evidence layer on top of the local Citation Integrity checks:
python 18-verify-references/verify_external_references.py \
--project-root examples/citation-integrity-broken \
--ruleset university-genericExpected outputs:
reports/external-verification-report.jsonreports/.external-cache/
This report combines CrossRef / OpenAlex / Semantic Scholar candidates and surfaces them as the external_verification readiness advisory dimension. It keeps the local readiness verdict unchanged and does not rewrite citations or bibliography entries.
Run the same command against examples/citation-integrity-clean/ to see the clean case with the same external verification envelope and fewer review items.
When .aux and .bbl files are present, Thesis Skills can determine the final reference set that actually entered the compiled bibliography:
python 17-final-reference-set/build_final_reference_set.py \
--project-root examples/citation-integrity-broken \
--ruleset university-genericExpected outputs:
reports/final-reference-set-report.jsonreports/final-reference-set-report.csv
Then run external verification in final scope:
python 18-verify-references/verify_external_references.py \
--project-root examples/citation-integrity-broken \
--ruleset university-generic \
--scope final \
--resumeAdditional advisory outputs:
reports/missing-doi-candidates.jsonreports/missing-doi-candidates.csvreports/url-verification-report.jsonreports/url-verification-flagged.csv
These reports never rewrite .bib files. DOI candidates are suggestions only, and URL verification checks reachability, not document authenticity.
The hallucination risk scorer adds a V3.0 evidence layer on top of the V2.0 external verification:
examples/citation-hallucination-field-mismatch/
examples/citation-hallucination-fabricated/
examples/citation-hallucination-chinese-unsupported/
python 19-check-hallucination-risk/check_hallucination_risk.py \
--project-root examples/citation-hallucination-field-mismatch \
--ruleset university-genericExpected outputs:
reports/hallucination-risk-report.jsonreports/high-risk-references.csv
This demo produces REVIEW entries where the external metadata partially matches but fields differ.
python 19-check-hallucination-risk/check_hallucination_risk.py \
--project-root examples/citation-hallucination-fabricated \
--ruleset university-genericExpected outputs:
reports/hallucination-risk-report.jsonwithHIGH_RISKstatusreports/high-risk-references.csv
This demo exits with code 1 because at least one entry has no credible external match.
python 19-check-hallucination-risk/check_hallucination_risk.py \
--project-root examples/citation-hallucination-chinese-unsupported \
--ruleset university-genericExpected outputs:
reports/hallucination-risk-report.jsonwithUNSUPPORTEDentriesreports/high-risk-references.csv
Chinese-language references are marked UNSUPPORTED because external databases do not cover them. This is not a failure; it means the reference needs manual verification.
Boundary: the hallucination risk scorer does not use LLMs and never auto-rewrites citations or bibliography entries. It reads reports/external-verification-report.json if present; otherwise it scores from local metadata only.
The claim-citation triage runner adds a V3.1 evidence layer on top of the V3.0 hallucination risk scoring:
examples/claim-citation-mixed/
examples/claim-citation-orphaned/
examples/claim-citation-chinese/
python 20-check-claim-citation/check_claim_citation.py \
--project-root examples/claim-citation-mixed \
--ruleset university-genericExpected outputs:
reports/claim-citation-triage-report.jsonreports/claim-citation-triage.mdreports/claim-citation-triage.csv
This demo produces all five triage labels (WELL_SUPPORTED, SUPPORTED, WEAK, ORPHANED, UNVERIFIABLE) and exits with code 1 because at least one pair is ORPHANED.
The JSON report also includes support-review enrichment fields such as claim_type, support_review_label, support_review_reason, support_signals, risk_signals, cluster_keys, cluster_risk_summary, and next_actions. These fields are advisory explanations for manual review; the original triage_label remains backward-compatible. When available, .bib title, abstract, and keywords are used as weak local lexical evidence through token-overlap fields. Reports may also include citation_needed_candidates for uncited high-assertion sentences; these candidates do not change the CLI exit code.
python 20-check-claim-citation/check_claim_citation.py \
--project-root examples/claim-citation-orphaned \
--ruleset university-genericThis demo has citation keys with no corresponding bib entries. It produces ORPHANED triage entries and exits with code 1.
python 20-check-claim-citation/check_claim_citation.py \
--project-root examples/claim-citation-chinese \
--ruleset university-genericAll references in this demo are Chinese-language and marked UNSUPPORTED by V3.0. The triage labels them all as UNVERIFIABLE. The exit code is 0 because UNVERIFIABLE is not a blocking signal.
Boundary: the claim-citation triage runner does not use LLMs, does not judge semantic similarity between claims and references, and never auto-rewrites citations.
The final cleanup checker is the first final-audit foundation. It scans final LaTeX sources for process residue such as TODO, FIXME, 待修改, 待核查, 见截图, 这里再改, 临时, 占位, ???, \textcolor{blue}, \color{blue}, draft, and debug.
python 23-check-final-cleanup/check_final_cleanup.py \
--project-root examples/minimal-latex-project \
--ruleset university-genericExpected output:
reports/final-cleanup-report.json
Boundary: this checker is deterministic and report-only. It does not delete markers, rewrite prose, or change source files. The JSON report can be aggregated as the final_cleanup section of reports/final-audit-report.json and rendered through the current static HTML report surfaces as issue cards grouped by risk level.
The statistical consistency checker reports mixed notation families and suggests reviewing deviations from the dominant style in the current project.
python 25-check-statistical-consistency/check_statistical_consistency.py \
--project-root examples/minimal-latex-project \
--ruleset university-genericExpected output:
reports/statistical-consistency-report.json
Boundary: this checker does not decide that one notation is universally correct. It reports mixed styles such as p值/P值, p=/P=, 95%CI/95\%CI/95%置信区间, Bootstrap/自助法, and SMD/标准化均数差 so a human can normalize final wording if needed.
The manual anchor checker reports manual contents entries that may be missing a nearby preceding \phantomsection, which can make TOC / LOF / LOT links jump to the previous section, figure, or table.
python 26-check-manual-anchor/check_manual_anchor.py \
--project-root examples/minimal-latex-project \
--ruleset university-genericExpected output:
reports/manual-anchor-report.json
Boundary: this checker does not repair labels, captions, numbering, tables, figures, or \ref{} usage. It only reports likely hyperlink-anchor risks for manual verification.
After generating source-of-truth JSON evidence, build a single final-audit handoff artifact:
python 27-final-audit-report/build_final_audit_report.py \
--project-root examples/minimal-latex-project \
--ruleset university-genericExpected output:
reports/final-audit-report.json
This report aggregates available JSON evidence, including final cleanup, statistical consistency, manual anchor checks, readiness, citation integrity, final reference set, external verification, DOI candidates, URL verification, hallucination risk, and claim-citation support. It does not rerun checkers, call external services, modify sources, or replace the raw JSON reports.
Build a spreadsheet-friendly ledger from existing reference evidence:
python 28-reference-audit-ledger/build_reference_audit_ledger.py \
--project-root examples/citation-integrity-broken \
--ruleset university-genericExpected output:
reports/reference-audit-ledger.csv
Ledger columns:
key,title,authors,year,venue,doi,scope,source_checked,status,issue,action_suggested
Boundary: this ledger aggregates existing evidence only. It does not rerun reference checks, call external services, edit .bib, insert DOI values, replace URLs, or label externally not-found references as fake.
Generate a local HTML landing page for available report artifacts:
python 29-report-index/build_report_index.py \
--project-root examples/minimal-latex-projectExpected output:
reports/index.html
Boundary: the HTML index is a reading surface only. JSON / CSV remain the source of truth. It links known artifacts, shows present / missing / unreadable counts, and avoids a frontend framework or hosted backend.
Generate a local detail page for the aggregated final-audit JSON:
python 30-final-audit-html/build_final_audit_html.py \
--project-root examples/minimal-latex-projectExpected output:
reports/final-audit-report.html
Boundary: this page is generated from final-audit-report.json and remains a reading surface only. It does not replace the JSON, rerun checks, or modify thesis sources.
Generate a local detail page for the spreadsheet-friendly reference ledger:
python 31-reference-ledger-html/build_reference_audit_ledger_html.py \
--project-root examples/citation-integrity-brokenExpected output:
reports/reference-audit-ledger.html
Boundary: this page is generated from reference-audit-ledger.csv and remains a reading surface only. It does not replace the CSV, rerun checks, call external services, or modify bibliography or thesis source files.
Generate a local detail page for claim-citation support review:
python 32-claim-citation-html/build_claim_citation_html.py \
--project-root examples/claim-citation-mixedExpected output:
reports/claim-citation-triage.html
The mixed demo can also be rendered as reports/claim-citation-triage.html. The HTML reading surface shows P0 / P1 / P2 / P3 review groups, issue-card style summaries, citation-needed candidates, uncited references, cluster review details, and deep links to readiness, final-audit, and reference-ledger surfaces.
Boundary: this page is generated from claim-citation-triage-report.json and remains a reading surface only. It does not replace the JSON / Markdown / CSV artifacts, rerun claim-citation checks, or modify thesis source files.
Run final reference set plus all four citation evidence layers in a single command:
python run_evidence_pipeline.py \
--project-root examples/claim-citation-mixed \
--ruleset university-generic \
--skip-externalExpected outputs:
reports/check_references-report.jsonreports/final-reference-set-report.jsonreports/hallucination-risk-report.jsonreports/claim-citation-triage-report.jsonreports/claim-citation-triage.mdreports/claim-citation-triage.csv
After the pipeline completes, run the readiness gate to see all evidence dimensions:
python 16-check-readiness/check_readiness.py \
--project-root examples/claim-citation-mixed \
--ruleset university-genericThe readiness-report.json now includes hallucination_risk and claim_citation dimensions alongside external_verification, giving a complete citation health profile in a single artifact.
{
"mode": "advisor-handoff",
"overall_verdict": "WARN",
"summary": {
"headline": "Readiness verdict: WARN",
"evidence_status": "partial",
"dimension_count": 7,
"missing_evidence_count": 3
},
"next_actions": [
"Generate or locate missing evidence for compile.",
"Generate or locate missing evidence for export.",
"Generate or locate missing evidence for review_debt."
]
}WARN is normal for this smoke test because compile evidence is intentionally skipped and export/review-loop evidence is not produced by run_check_once.py. For final submission, rerun without --skip-compile after compiling your thesis, and generate the Word export or review-loop artifacts when those handoffs are part of your workflow.
{
"status": "FAIL",
"severity": "warning",
"code": "LANG_CJK_LATIN_SPACING",
"message": "Possible missing spacing between CJK and Latin tokens",
"file": "chapters/introduction.tex",
"line": 42,
"suggestion": "Add a space between Chinese and English tokens where appropriate"
}python 02-latex-to-word/migrate_project.py \
--project-root thesis \
--output-file thesis-review.docx \
--profile review-friendly \
--apply trueInspect reports/latex_to_word-report.json after export. It records conversion caveats so the Word handoff is explicit instead of silently lossy.
python run_check_once.py \
--project-root thesis \
--ruleset university-generic \
--skip-compileUse this when you want fast feedback before setting up the full TeX toolchain. The reports are still useful for references, language, format, and content checks.