Thesis Quality Gate
Use the deterministic CLI in this Skill as the control plane for thesis state and delivery
readiness. Keep project evidence, decisions, reports, and private data in the thesis project;
keep only reusable code and sanitized templates in this Skill.
Locate the project
Run commands from the thesis project root, which must contain .project/. Prefer the
project-local launcher when present:
python3 scripts/thesis_quality.py state refresh
Otherwise invoke the Skill entry directly:
python3 <skill-path>/scripts/thesis_quality.py --project <project-root> state refresh
Read references/project-contract.md before onboarding a
new project or changing paths and schemas.
Operate the quality loop
- Refresh state before relying on branch, commit, version, page count, stage, risk, or
last-build information.
- Refresh the numeric ledger after changing thesis numbers. Treat automatic classification
as provisional; never auto-mark evidence as verified.
- Sync the literature registry after changing
ref.bib. Mark a source verified only after
checking a real bibliographic source.
- Run Doctor after meaningful source, environment, build, or delivery changes.
- Before formal delivery, require confirmed research anchors, an accepted current-stage
artifact contract, a closed revision ledger, a current deterministic de-AI report, and an
isolated AI review report.
- Run the gate matching the requested delivery stage. A blocked gate is a result to explain
and resolve, not an instruction to weaken policy. Interpret the machine decision as
PASS, REOPEN_WRITING, or REOPEN_ANALYSIS; when both kinds fail, analysis takes
precedence while writing failures remain listed.
python3 scripts/thesis_quality.py evidence refresh
python3 scripts/thesis_quality.py evidence validate
python3 scripts/thesis_quality.py literature sync
python3 scripts/thesis_quality.py doctor
python3 scripts/thesis_quality.py gate --mode predefense
Use --json on evidence, literature, Doctor, and gate commands when another tool needs
machine-readable output.
Preserve validation integrity
- Never invent raw data, calculation scripts, enterprise records, citation verification, or
author confirmation.
- Preserve reviewed ledger entries when rescanning; retire reviewed entries that disappear
from the manuscript instead of silently deleting their audit history.
- Keep human-controlled state fields intact when refreshing machine-derived fields.
- Treat repository HEAD as an observed snapshot; bind manuscript artifacts and reviews to the
stable
manuscript_commit plus the current source-tree digest.
- Reuse an existing Doctor only when engine version, Skill commit, script digest, source tree,
policy, evidence, literature, PDF, and DOCX provenance all match.
- Treat PDF parsing or OCR failure as a failed or skipped check; never reconstruct missing
content from inference.
- Do not copy project data, company information, or absolute user paths into this Skill.
- Do not change gate policy merely to obtain
PASS.
Read references/evidence-ledger.md when classifying evidence.
Read references/gate-policy.md when adding checks, changing gate
modes, or interpreting a blocked delivery.
Read references/stage-artifact-contracts.md when
binding a stage handoff to exact inputs, outputs, hashes, acceptance checks, and reopen route.
Integrate with other thesis Skills
- Let
thesis-orchestrator decide when to call this Skill; keep check implementation here.
- After
thesis-analyze changes statistics, refresh and validate the evidence ledger.
- After
thesis-literature verifies sources, update and validate the literature registry.
- After
mem-thesis-build or thesis-docx creates artifacts, refresh state and run Doctor.
- Before
thesis-review approves delivery, run the appropriate gate and cite its report.
Do not duplicate the scripts inside those Skills. Add only short routing hooks and commands.
1---2name: thesis-quality-gate3description: Manage a thesis project's machine-readable state, numeric-evidence ledger, literature-verification registry, unified Doctor checks, stage artifact provenance, and tri-state submission gates. Use when Codex or Claude needs to refresh paper status, trace every thesis number to evidence, diagnose Python/LaTeX/font/citation/caption/statistics/DOCX/PDF readiness, or return PASS, REOPEN_WRITING, or REOPEN_ANALYSIS for an advisor-review, predefense, blind-review, or final-delivery package.4---56# Thesis Quality Gate78Use the deterministic CLI in this Skill as the control plane for thesis state and delivery9readiness. Keep project evidence, decisions, reports, and private data in the thesis project;10keep only reusable code and sanitized templates in this Skill.1112## Locate the project1314Run commands from the thesis project root, which must contain `.project/`. Prefer the15project-local launcher when present:1617```bash18python3 scripts/thesis_quality.py state refresh19```2021Otherwise invoke the Skill entry directly:2223```bash24python3 <skill-path>/scripts/thesis_quality.py --project <project-root> state refresh25```2627Read [references/project-contract.md](references/project-contract.md) before onboarding a28new project or changing paths and schemas.2930## Operate the quality loop31321. Refresh state before relying on branch, commit, version, page count, stage, risk, or33 last-build information.342. Refresh the numeric ledger after changing thesis numbers. Treat automatic classification35 as provisional; never auto-mark evidence as verified.363. Sync the literature registry after changing `ref.bib`. Mark a source verified only after37 checking a real bibliographic source.384. Run Doctor after meaningful source, environment, build, or delivery changes.395. Before formal delivery, require confirmed research anchors, an accepted current-stage40 artifact contract, a closed revision ledger, a current deterministic de-AI report, and an41 isolated AI review report.426. Run the gate matching the requested delivery stage. A blocked gate is a result to explain43 and resolve, not an instruction to weaken policy. Interpret the machine decision as44 `PASS`, `REOPEN_WRITING`, or `REOPEN_ANALYSIS`; when both kinds fail, analysis takes45 precedence while writing failures remain listed.4647```bash48python3 scripts/thesis_quality.py evidence refresh49python3 scripts/thesis_quality.py evidence validate50python3 scripts/thesis_quality.py literature sync51python3 scripts/thesis_quality.py doctor52python3 scripts/thesis_quality.py gate --mode predefense53```5455Use `--json` on evidence, literature, Doctor, and gate commands when another tool needs56machine-readable output.5758## Preserve validation integrity5960- Never invent raw data, calculation scripts, enterprise records, citation verification, or61 author confirmation.62- Preserve reviewed ledger entries when rescanning; retire reviewed entries that disappear63 from the manuscript instead of silently deleting their audit history.64- Keep human-controlled state fields intact when refreshing machine-derived fields.65- Treat repository HEAD as an observed snapshot; bind manuscript artifacts and reviews to the66 stable `manuscript_commit` plus the current source-tree digest.67- Reuse an existing Doctor only when engine version, Skill commit, script digest, source tree,68 policy, evidence, literature, PDF, and DOCX provenance all match.69- Treat PDF parsing or OCR failure as a failed or skipped check; never reconstruct missing70 content from inference.71- Do not copy project data, company information, or absolute user paths into this Skill.72- Do not change gate policy merely to obtain `PASS`.7374Read [references/evidence-ledger.md](references/evidence-ledger.md) when classifying evidence.75Read [references/gate-policy.md](references/gate-policy.md) when adding checks, changing gate76modes, or interpreting a blocked delivery.77Read [references/stage-artifact-contracts.md](references/stage-artifact-contracts.md) when78binding a stage handoff to exact inputs, outputs, hashes, acceptance checks, and reopen route.7980## Integrate with other thesis Skills8182- Let `thesis-orchestrator` decide when to call this Skill; keep check implementation here.83- After `thesis-analyze` changes statistics, refresh and validate the evidence ledger.84- After `thesis-literature` verifies sources, update and validate the literature registry.85- After `mem-thesis-build` or `thesis-docx` creates artifacts, refresh state and run Doctor.86- Before `thesis-review` approves delivery, run the appropriate gate and cite its report.8788Do not duplicate the scripts inside those Skills. Add only short routing hooks and commands.