Skip to main content

delivery-assurance

Meta-model-agent 完成编译、版式、匿名、页数、引用与提交前合规验收。适用于提交质量验收。

Aller à l'installation

Informations de source

Dépôt
WuXinbo-bo/Math-model-skills
Dernière activité de la source
29 août 2026 à 09:54
Langue détectée de SKILL.md
Plusieurs langues
Étoiles
90
Forks
2

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
name
delivery-assurance
description
Meta-model-agent 完成编译、版式、匿名、页数、引用与提交前合规验收。适用于提交质量验收。
# 提交质量验收 ## 数据准备一致性验收 有数据时,核对论文独立“数据预处理”小节、`全部结果.json.data_preparation`、`数据/processed/` 文件哈希和模型代码读取路径一致,并确认处理前后质量统计与泄漏说明真实可复核。无数据时确认存在明确豁免且没有伪造的处理后数据或清洗结论。 ## 模型身份与摘要一致性验收 逐问核验审计身份与论文表达卡。正式名称必须显式暴露线性/整数/鲁棒/随机规划、回归、时间序列、状态空间、车辆路径、网络流、多指标决策等标准结构;论文展示名称应简洁并保留主要结构。比较、验证或应用类问题必须说明继承关系,不得强造独立模型。摘要和正文先说明模型或继承关系,再说明核心方法;关键词至少包含一个标准模型族。 `建模报告.md` 的审计身份与 `全部结果.json.model_identity` 必须逐字一致;摘要和正文与论文表达卡保持语义一致,不得复制身份卡字段标签。最终摘要还必须拦截内部术语、完整算法链、未解释方案缩写、数字流水账和缺失的模型边界。 ## 发布声明、公式与页面构成验收 - 核对 `全部结果.json.publication_claims` 的来源键、派生关系与正文显示值;同一指标在摘要、正文、图表、表格和结论中不得冲突。 - 核对真实问题数、逐问章节文件和主文件 `\input/\include` 一一闭合,禁止章节存在但最终 PDF 漏问。 - 读取 `latex-math.md`,检查原生公式、符号与量纲、`\eqref/\ref/\cref`、重复标签和硬编码图表公式编号。 - 读取 `page-composition.md` 并在实际 PDF 上执行页面审计。编译成功、页数合规和页面质量是三个独立门禁。 - Overfull box、裁切、标题孤悬、图题分离和不可读小字在冠军模式下不得带入终稿;低占用页面必须人工确认是否来自章节自然结束,而不是用空白或大图填页。 ## 必读的版面子协议 - 始终读取 `参考资料/paper-layout/core.md` 与 `body-density.md`。 - PDF/LaTeX 验收读取 `latex-figures.md`。 - PDF/LaTeX 验收同时读取 `latex-math.md` 与 `page-composition.md`。 - DOCX 验收读取 `docx-figures.md`。 - 子协议中的尺寸和页数语义优先于本文件中的旧示例。 DOCX 路线使用 `python 工具/docx_export.py --workspace .` 生成 `论文/数模论文.docx` 和 `论文/docx_report.json`。不得对 DOCX 路线执行 XeLaTeX/BibTeX;验收以 Markdown 正文、DOCX 包、尺寸报告以及可选的 LibreOffice PDF 预览为准。 ## 竞赛专用硬门禁 编译前必须读取 `状态/工作流状态.json` 中的竞赛 Profile 和 `参考资料/竞赛规则.md`: - CUMCM:核验当届官方通知、匿名电子正文、模板、引用、图表及编号/附件要求。 - 51MCM:核验 `51mcmthesis`、`withoutpreface`、报名号/题号/组别字段,以及正文不存在学校、成员、邮箱和电话信息。 - MCM/ICM:核验全英文、12pt、Summary Sheet、已填写 Control Number、A--F 题号、无个人/学校身份信息,完整 PDF 不超过 25 页。 编译成功不能覆盖竞赛 Profile 门禁失败。 ## 稳定执行契约 - **执行目标**:完成论文编译、版式、匿名、页数、引用与提交文件的终局验收。 - **调用参数**:[paper-directory]。 - **权威输入**:论文/论文正文.tex、论文/章节/、图表资产、模板规则与竞赛要求。 - **允许交付**:论文/数模论文.pdf、论文/编译日志.log及必要的验收记录;仅可做有边界的修复。 - **禁止写入**:不得越权修改已冻结的上游事实、用户原始文件或本协议未授权的目录。 - **可用工具边界**:Bash(*), Read, Write, Edit, Grep, Glob。 - **最小交付**:PDF可打开、编译无关键错误、引用闭合、模板完整、匿名与页数合规。 - **恢复入口**:优先读取当前工作、状态记录和已有产物,从最近一次通过门禁的位置继续。 - **失败回退**:最多按既定次数修复编译;模型或结果问题必须回退上游,不得在验收阶段擅改事实。 - **收口顺序**:先核对输入,再完成产物,再运行本环节门禁,最后登记状态;门禁未通过不得宣告完成。 Compile and validate: **$ARGUMENTS** ## 运行参数 - **ENGINE = `xelatex`** - **MAX_COMPILE_ATTEMPTS = 3** - **PAPER_DIR = `论文/`** - **MAX_PAGES** / **COMPETITION** — From Additional Parameters. ## 执行流程 ### 工作节点 1:Validate environment ```bash if ! which xelatex 2>/dev/null; then echo "xelatex not found, attempting install..." if which miktex 2>/dev/null; then miktex packages install xetex ctex xecjk gbt7714 fontspec miktex fndb refresh elif which initexmf 2>/dev/null; then initexmf --set-config-value=[MPM]AutoInstall=1 fi fi which xelatex && which bibtex && echo "ready" || echo "xelatex/bibtex not found" fc-list :lang=zh | head -5 kpsewhich gbt7714.sty 2>/dev/null || echo "gbt7714.sty not found (will auto-install on first compile)" ``` ### 工作节点 2:Pre-compile cleanup ```bash if [ -f "工具/compile_utils.sh" ]; then bash 工具/compile_utils.sh 论文/ elif [ -f "skills/shared-scripts/compile_utils.sh" ]; then bash skills/shared-scripts/compile_utils.sh 论文/ else echo "compile_utils.sh not found, manual cleanup needed" fi ``` This utility auto-handles: special chars cleanup, table format fixes, includegraphics path correction (`图表/` → `../图表/`), hidelinks, 图表/图表/ nesting, math_commands conflicts, wide table resizebox wrapping, narrow table resizebox removal, light-color text fixes, TikZ library injection. If script not found, perform these steps manually. **⛔ 表格行结束符修复(Misplaced \noalign 的根因):** ```bash # 检测并修复 tabular/longtable 中的单 \ 行结束符(应该是 \\) # 这是 heredoc 不加引号导致 \\ 被转义为 \ 的常见问题 for f in 论文/章节/*.tex; do [ -f "$f" ] || continue # 检测:tabular 环境内,行末只有单个 \ 后跟换行(应该是 \\) if grep -P '(?<!\\)\\(?!\\)(?=\s*$)' "$f" | grep -v '\\begin\|\\end\|\\hline\|\\toprule\|\\midrule\|\\bottomrule\|\\caption\|\\label\|\\centering\|\\input\|\\include\|\\usepackage\|\\section\|\\subsection' > /dev/null 2>&1; then echo "⚠ $(basename $f): 可能有表格行结束符问题(单 \\ 应为 \\\\)" # 在 tabular/longtable 环境内,把行末的单 \ 替换为 \\ python3 -c " import re with open('$f', 'r', encoding='utf-8') as fh: content = fh.read() # 只在 tabular/longtable 环境内修复 def fix_table_endings(match): table = match.group(0) # 把数据行末尾的单 \ (后跟换行) 替换为 \\\\ fixed = re.sub(r'(?<=&[^&\n]*)\\\s*\n', r'\\\\\\\\\n', table) return fixed for env in ['tabular', 'longtable']: pattern = r'(\\\\begin\{' + env + r'[*]?\}.*?\\\\end\{' + env + r'[*]?\})' content = re.sub(pattern, fix_table_endings, content, flags=re.DOTALL) with open('$f', 'w', encoding='utf-8') as fh: fh.write(content) " 2>/dev/null fi done ``` Additionally validate ref/label matching and embed missing visuals: ```bash mkdir -p 临时文件 grep -oh '\\ref{[^}]*}' 论文/章节/*.tex 论文/论文正文.tex 2>/dev/null | sort -u > 临时文件/_refs.txt grep -oh '\\label{[^}]*}' 论文/章节/*.tex 论文/论文正文.tex 2>/dev/null | sort -u > 临时文件/_labels.txt comm -23 <(sed 's/\\ref/\\label/g' 临时文件/_refs.txt) 临时文件/_labels.txt > 临时文件/_missing_labels.txt cat 临时文件/_missing_labels.txt ``` **⛔ 中文引号统一为全角引号(避免 PDF 出现 ''乱码或两个堆叠反引号):** 中文论文用 xeCJK,全角引号 `"..."` 会自动化渲染为漂亮的对称弯引号。 LaTeX 风格 `` ``...'' `` 在中文字体下会呈现成两个堆叠的反引号,很丑。 ASCII 直引号 `"..."` 在 LaTeX 中渲染为右右引号 `''...''`。 统一替换为全角引号。 ```bash # 把所有错误引号统一为全角引号 for f in 论文/章节/*.tex; do [ -f "$f" ] || continue python3 -c " import re content = open('$f', 'r', encoding='utf-8').read() # 保护数学环境 placeholders = [] def stash(m): placeholders.append(m.group(0)); return f'\\x00M{len(placeholders)-1}\\x00' content = re.sub(r'\\\$[^\\\$]*\\\$', stash, content) content = re.sub(r'\\\\\\[.*?\\\\\\]', stash, content, flags=re.DOTALL) # 保护 \begin{verbatim}/lstlisting 等代码环境 content = re.sub(r'\\\\begin\{(verbatim|lstlisting|minted)\}.*?\\\\end\{\\1\}', stash, content, flags=re.DOTALL) # 1. LaTeX 风格 ``...'' → 全角双引号 content = re.sub(r\"\`\`([^\`'\\\\n]+?)''\", '\u201c\\\\g<1>\u201d', content) # 2. ASCII 直引号 \"...\" → 全角双引号(成对处理) parts = content.split('\"') if len(parts) > 2: result = parts[0] for i, p in enumerate(parts[1:], 1): result += ('\u201c' if i % 2 == 1 else '\u201d') + p content = result # 还原 for i, ph in enumerate(placeholders): content = content.replace(f'\\x00M{i}\\x00', ph) open('$f', 'w', encoding='utf-8').write(content) " 2>/dev/null done ``` If labels are missing, find corresponding figure/table code in `图表/*.tex` and embed into the correct section file. Also verify compile_utils.sh output for "UNEMBEDDED" warnings against `figure_manifest.json`. Only an item selected for publication is a blocking omission. **MANDATORY FIX LOOP — do NOT proceed to compilation until every `publish=true` figure and every table selected by the manuscript embedding plan is embedded:** ```bash UNEMBED=0 # Validate PDF visuals for pdf in 图表/*.pdf; do [ -f "$pdf" ] || continue bn=$(basename "$pdf") python3 -c "import json,sys; d=json.load(open('图表/figure_manifest.json',encoding='utf-8')); sys.exit(0 if any(x.get('publish') and x.get('path','').replace('\\\\','/').endswith('/'+sys.argv[1]) for x in d.get('figures',[])) else 1)" "$bn" || continue grep -rq "$bn" 论文/章节/*.tex 论文/论文正文.tex 2>/dev/null || { echo "UNEMBEDDED PDF: $bn"; UNEMBED=$((UNEMBED+1)); } done # Validate only TABLE_*.tex files selected by the manuscript embedding plan for tbl in 图表/TABLE_*.tex; do [ -f "$tbl" ] || continue bn=$(basename "$tbl") python3 -c "import json,sys; d=json.load(open('图表/figure_manifest.json',encoding='utf-8')); sys.exit(0 if any(x.get('publish') and x.get('path','').replace('\\\\','/').endswith('/'+sys.argv[1]) for x in d.get('tables',[])) else 1)" "$bn" || continue # Validate if any label from this table file appears in sections for lbl in $(grep -oh '\\label{[^}]*}' "$tbl" 2>/dev/null); do grep -rq "$lbl" 论文/章节/*.tex 论文/论文正文.tex 2>/dev/null || { echo "UNEMBEDDED TABLE: $lbl (from $bn)"; UNEMBED=$((UNEMBED+1)); } done done # Raw 图表引用.tex labels are diagnostic; the published asset loops above remain authoritative echo "Total unembedded: $UNEMBED" ``` If UNEMBED > 0, you MUST fix all selected publication items before compiling. For each unembedded item: - **PDF figure**: copy the `\begin{figure}...\end{figure}` block from `图表/图表引用.tex` into the target section - **TABLE_*.tex**: copy the `\begin{table}...\end{table}` block from `图表/TABLE_*.tex` into the target section (use `\input{../图表/TABLE_xxx.tex}` or paste the tabular code directly) - Add 1-2 sentences of lead-in text before and 3-5 sentences of analysis after each embedded item - Re-run the count verify above — repeat until UNEMBED = 0 **Do NOT compile with unembedded publication figures or selected正文 tables. Unpublished diagnostic assets are allowed to remain outside the paper.** ```bash # Diagnose generated PDFs; only publish=true omissions are blocking for pdf in 图表/*.pdf; do [ -f "$pdf" ] || continue bn=$(basename "$pdf") python3 -c "import json,sys; d=json.load(open('图表/figure_manifest.json',encoding='utf-8')); sys.exit(0 if any(x.get('publish') and x.get('path','').replace('\\\\','/').endswith('/'+sys.argv[1]) for x in d.get('figures',[])) else 1)" "$bn" || continue grep -rq "$bn" 论文/章节/*.tex 论文/论文正文.tex 2>/dev/null || echo "⚠ $bn not referenced" done ``` ### 执行节点 3:Compile (manual steps, no latexmk) ```bash cd 论文/
Voir sur GitHub
Ce SKILL.md est tres volumineux, SkillsMP affiche donc ici seulement la premiere section. Voir sur GitHub