@orbit-build/cli 0.8.3 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/index.js +558 -151
- package/package.json +1 -1
- package/skills/cumcm-draft/SKILL.md +92 -48
- package/skills/cumcm-draft/agents/openai.yaml +1 -1
- package/skills/cumcm-draft/assets/project-template/{code → .cumcm}/finalize.py +33 -4
- package/skills/cumcm-draft/assets/project-template/{paper/contest-profile.json → .cumcm/profile.json} +9 -6
- package/skills/cumcm-draft/assets/project-template/code/requirements.txt +1 -11
- package/skills/cumcm-draft/assets/project-template/paper/AI/345/267/245/345/205/267/344/275/277/347/224/250/350/257/246/346/203/205.tex +1 -11
- package/skills/cumcm-draft/assets/project-template/paper/main.tex +70 -11
- package/skills/cumcm-draft/references/code-and-output-style.md +9 -14
- package/skills/cumcm-draft/references/cumcm-compliance.md +28 -25
- package/skills/cumcm-draft/references/latex-figures-tables.md +1 -1
- package/skills/cumcm-draft/references/modeling-quality.md +1 -1
- package/skills/cumcm-draft/references/paper-architecture.md +3 -3
- package/skills/cumcm-draft/references/project-architecture.md +70 -89
- package/skills/cumcm-draft/scripts/audit_paper.py +37 -9
- package/skills/cumcm-draft/scripts/bootstrap_project.py +182 -56
- package/skills/cumcm-draft/scripts/build_paper.py +38 -23
- package/skills/cumcm-draft/scripts/capture_environment.py +3 -1
- package/skills/cumcm-draft/scripts/clean_project.py +7 -2
- package/skills/cumcm-draft/scripts/evidence_freeze.py +8 -4
- package/skills/cumcm-draft/scripts/finalize_project.py +4 -0
- package/skills/cumcm-draft/scripts/inspect_inputs.py +6 -4
- package/skills/cumcm-draft/scripts/package_support.py +41 -15
- package/skills/cumcm-draft/scripts/project_utils.py +40 -8
- package/skills/cumcm-draft/scripts/validate_project.py +374 -57
- package/skills/cumcm-draft/assets/project-template/code/always/__init__.py +0 -1
- package/skills/cumcm-draft/assets/project-template/code/always/config.py +0 -18
- package/skills/cumcm-draft/assets/project-template/code/always/data.py +0 -24
- package/skills/cumcm-draft/assets/project-template/code/always/plotting.py +0 -25
- package/skills/cumcm-draft/assets/project-template/code/always/validation.py +0 -21
- package/skills/cumcm-draft/assets/project-template/paper/sections/abstract.tex +0 -6
- package/skills/cumcm-draft/assets/project-template/paper/sections/ai-disclosure.tex +0 -3
- package/skills/cumcm-draft/assets/project-template/paper/sections/appendix.tex +0 -3
- package/skills/cumcm-draft/assets/project-template/paper/sections/assumptions.tex +0 -5
- package/skills/cumcm-draft/assets/project-template/paper/sections/data.tex +0 -19
- package/skills/cumcm-draft/assets/project-template/paper/sections/evaluation.tex +0 -9
- package/skills/cumcm-draft/assets/project-template/paper/sections/problem-analysis.tex +0 -3
- package/skills/cumcm-draft/assets/project-template/paper/sections/problem-restatement.tex +0 -3
- package/skills/cumcm-draft/assets/project-template/paper/sections/references.tex +0 -12
- package/skills/cumcm-draft/assets/project-template/paper/sections/source-code.tex +0 -1
- package/skills/cumcm-draft/assets/project-template/paper/sections/support-files.tex +0 -3
- /package/skills/cumcm-draft/assets/project-template/{paper → .cumcm}/ai-use-log.md +0 -0
|
@@ -144,7 +144,7 @@ Every paper claim must map to:
|
|
|
144
144
|
- validation evidence;
|
|
145
145
|
- paper section and figure/table label.
|
|
146
146
|
|
|
147
|
-
Keep this mapping in
|
|
147
|
+
Keep this mapping in `.cumcm/evidence-map.yaml`. Do not type important numbers
|
|
148
148
|
into LaTeX from memory.
|
|
149
149
|
|
|
150
150
|
Use `status: verified` only after the producing code has run and the claim's
|
|
@@ -47,9 +47,9 @@ For CUMCM-style papers use:
|
|
|
47
47
|
only content genuinely reused across questions.
|
|
48
48
|
8. One major section per qN.
|
|
49
49
|
9. Model evaluation, limitations, and possible extensions.
|
|
50
|
-
10.
|
|
51
|
-
used
|
|
52
|
-
11. References.
|
|
50
|
+
10. The exact official AI-use declaration immediately before the references;
|
|
51
|
+
used-AI work also includes `AI工具使用详情.pdf` in support materials.
|
|
52
|
+
11. References. The 2026 rule does not require an AI-tool bibliography entry.
|
|
53
53
|
12. Appendix:
|
|
54
54
|
the exact support-archive file list followed by complete runnable source.
|
|
55
55
|
Group the list by directory instead of omitting names or printing one noisy
|
|
@@ -1,37 +1,49 @@
|
|
|
1
1
|
# Project architecture
|
|
2
2
|
|
|
3
|
-
Use one stable project root
|
|
4
|
-
|
|
3
|
+
Use one stable project root and separate private workflow state from authored
|
|
4
|
+
and submitted artifacts.
|
|
5
5
|
|
|
6
6
|
```text
|
|
7
7
|
project-root/
|
|
8
|
-
├──
|
|
8
|
+
├── .cumcm/ # Orbit-owned workflow state; never modeling code
|
|
9
|
+
│ ├── profile.json
|
|
10
|
+
│ ├── project.json
|
|
11
|
+
│ ├── evidence-map.yaml
|
|
12
|
+
│ ├── ai-use-log.md
|
|
13
|
+
│ ├── finalize.py
|
|
14
|
+
│ ├── generated/ # generated TeX appendices
|
|
15
|
+
│ └── build/ # LaTeX caches, page renders, audit report
|
|
16
|
+
├── question/ # immutable problem and supplied data
|
|
9
17
|
├── code/
|
|
10
|
-
│ ├── requirements.txt
|
|
18
|
+
│ ├── requirements.txt # actual direct runtime dependencies only
|
|
11
19
|
│ ├── run_all.py
|
|
12
|
-
│ ├── always/ # Shared configuration, data, plotting, checks
|
|
13
20
|
│ ├── q1/
|
|
21
|
+
│ │ ├── main.py # orchestration only
|
|
22
|
+
│ │ ├── forecasting.py # examples; names follow real responsibilities
|
|
23
|
+
│ │ └── evaluation.py
|
|
14
24
|
│ ├── q2/
|
|
15
|
-
│ └──
|
|
25
|
+
│ └── common/ # only when two or more questions genuinely reuse it
|
|
16
26
|
├── results/
|
|
17
|
-
│ ├── q1/
|
|
27
|
+
│ ├── q1/ # Chinese-named tables, metrics, models, workbooks
|
|
18
28
|
│ ├── q2/
|
|
19
29
|
│ └── ...
|
|
20
30
|
├── figures/
|
|
21
|
-
│ ├── q1/
|
|
31
|
+
│ ├── q1/ # final Chinese-named paper figures only
|
|
22
32
|
│ ├── q2/
|
|
23
33
|
│ └── ...
|
|
24
34
|
└── paper/
|
|
25
35
|
├── main.tex
|
|
26
|
-
├──
|
|
27
|
-
├──
|
|
28
|
-
├──
|
|
29
|
-
|
|
30
|
-
│ ├── q2.tex
|
|
31
|
-
│ └── ...
|
|
32
|
-
└── build/ # LaTeX intermediates and final PDF
|
|
36
|
+
├── AI工具使用详情.tex
|
|
37
|
+
├── main.pdf
|
|
38
|
+
├── AI工具使用详情.pdf
|
|
39
|
+
└── 支撑材料.zip
|
|
33
40
|
```
|
|
34
41
|
|
|
42
|
+
The two TeX sources are the only default authored files under `paper/`.
|
|
43
|
+
External editors may create compiler intermediates there, but Orbit builds into
|
|
44
|
+
`.cumcm/build/` and cleans known intermediates. Do not create `paper/sections/`
|
|
45
|
+
or `paper/build/`.
|
|
46
|
+
|
|
35
47
|
## Ownership rules
|
|
36
48
|
|
|
37
49
|
- `question/` is read-only. Never normalize, rename, fill, or save over input.
|
|
@@ -39,93 +51,62 @@ project-root/
|
|
|
39
51
|
role. Record that they were blank.
|
|
40
52
|
- A required filled table belongs in `results/qN`, even when its blank template
|
|
41
53
|
came from `question/`.
|
|
42
|
-
- `code/
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- `
|
|
53
|
-
|
|
54
|
-
- `figures/qN` owns final visuals for
|
|
55
|
-
in
|
|
56
|
-
- `paper/
|
|
57
|
-
|
|
54
|
+
- Create `code/common` only after two or more questions use the same behavior.
|
|
55
|
+
A pre-generated utility package is clutter and often becomes dead code.
|
|
56
|
+
- Each `code/qN/main.py` must run independently after prerequisites exist.
|
|
57
|
+
- `main.py` orchestrates loading, domain computation, validation, and reporting.
|
|
58
|
+
Put substantive models in sibling modules named after their actual role.
|
|
59
|
+
- A strict finalization must not pass when qN still contains only the scaffold
|
|
60
|
+
`main.py`, `NotImplementedError`, or TODO logic.
|
|
61
|
+
- Keep domain-module dependencies acyclic and add concise Chinese comments where
|
|
62
|
+
a reviewer needs the assumption, unit, leakage guard, or numerical safeguard.
|
|
63
|
+
- `code/run_all.py` runs questions in dependency order.
|
|
64
|
+
- `results/qN` owns numeric and tabular evidence for question N. Do not create a
|
|
65
|
+
synthetic `summary.json`; point `.cumcm/evidence-map.yaml` to real results.
|
|
66
|
+
- `figures/qN` owns final visuals for question N. Diagnostic-only images belong
|
|
67
|
+
in `.cumcm/build/` and must not enter the support archive.
|
|
68
|
+
- `paper/main.tex` consumes only declared evidence from matching or explicitly
|
|
69
|
+
upstream result directories.
|
|
58
70
|
- Treat every cross-question result as a typed interface. The consumer checks
|
|
59
|
-
|
|
60
|
-
freshness before computing. Missing coverage is an error, not permission to
|
|
61
|
-
rebuild an undeclared proxy.
|
|
71
|
+
columns, unique entity/date keys, units, coverage, and freshness.
|
|
62
72
|
- Keep model-selection, validation, and test artifacts under the producing
|
|
63
73
|
`results/qN`; these are evidence, not disposable debug output.
|
|
74
|
+
- `.cumcm/` belongs to Orbit's workflow. Never cite it as modeling output or
|
|
75
|
+
include `finalize.py`, audit reports, evidence freezes, or build caches in the
|
|
76
|
+
modeling-code appendix or support archive. `environment.json` is copied into
|
|
77
|
+
the ZIP as `复现环境.json`.
|
|
64
78
|
|
|
65
79
|
## Naming
|
|
66
80
|
|
|
67
|
-
- Use `q1`, `q2`, ...
|
|
68
|
-
|
|
81
|
+
- Use `q1`, `q2`, ... for structural directories; do not mix `Q1`,
|
|
82
|
+
`question1`, or translated variants.
|
|
69
83
|
- Use descriptive Chinese filenames for generated tabular artifacts under
|
|
70
84
|
`results/qN`; use Chinese CSV/TSV headers and Chinese Excel worksheet/table
|
|
71
|
-
headers, with units where applicable.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
headers, with units where applicable.
|
|
86
|
+
- Use descriptive Chinese figure filenames such as `需求预测误差对比.png` or
|
|
87
|
+
`价格弹性敏感性分析.pdf`. Generic names such as `summary.png`, `plot.png`,
|
|
88
|
+
`figure.png`, `output.png`, and `final.png` are invalid.
|
|
89
|
+
- Preserve a prescribed non-Chinese result schema only when the problem fixes
|
|
90
|
+
it, and document the narrow exception in
|
|
91
|
+
`.cumcm/profile.json.result_artifacts.fixed_schema_exceptions`.
|
|
77
92
|
- Use stable ASCII Python module names.
|
|
78
93
|
- Use UTF-8 for text and UTF-8 with BOM for CSV intended for Excel.
|
|
79
94
|
- Include units in column labels or metadata.
|
|
80
95
|
|
|
81
|
-
##
|
|
82
|
-
|
|
83
|
-
Some existing projects place `question/` next to a `reproduce/` directory.
|
|
84
|
-
Read those inputs in place, but do not move them automatically. For a new
|
|
85
|
-
project, make `question/` a peer of `code/`, `results/`, `figures/`, and
|
|
86
|
-
`paper/` as the canonical structure above.
|
|
87
|
-
|
|
88
|
-
When the user explicitly requests a compact handoff patterned after an
|
|
89
|
-
existing project, this layout is also valid:
|
|
96
|
+
## Submission boundary
|
|
90
97
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
├── AI工具使用详情.tex
|
|
96
|
-
├── AI工具使用详情.pdf
|
|
97
|
-
├── 支撑材料.zip
|
|
98
|
-
├── question/ # still immutable
|
|
99
|
-
└── produce/
|
|
100
|
-
├── code/
|
|
101
|
-
│ ├── always/
|
|
102
|
-
│ ├── q1/
|
|
103
|
-
│ └── ...
|
|
104
|
-
└── results/
|
|
105
|
-
├── q1/
|
|
106
|
-
└── ...
|
|
107
|
-
```
|
|
98
|
+
The formal submission pair is `paper/main.pdf` plus `paper/支撑材料.zip`.
|
|
99
|
+
The archive contains runnable code, necessary results, cited figures,
|
|
100
|
+
`AI工具使用详情.pdf` when required, and `复现环境.json`. It excludes immutable
|
|
101
|
+
question inputs and all `.cumcm/` control state.
|
|
108
102
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`produce/`; inline the complete paper into one root `main.tex` for the compact
|
|
113
|
-
handoff. Split section files are an authoring aid, not a delivery requirement,
|
|
114
|
-
and should be removed after a verified merge unless the user requests them.
|
|
115
|
-
Build the support ZIP while `produce/figures/` still exists so the archive and
|
|
116
|
-
appendix list remain complete. After the PDF and ZIP are both inspected, remove
|
|
117
|
-
reproducible workspace figures from a minimal handoff if requested. Running
|
|
118
|
-
`produce/code/run_all.py` must recreate them before recompiling `main.tex`.
|
|
103
|
+
Place separately required filled Excel/Word artifacts outside the ZIP only when
|
|
104
|
+
the statement or submission system explicitly requires them. Do not promote
|
|
105
|
+
every CSV, JSON, diagnostic, or figure to the root.
|
|
119
106
|
|
|
120
|
-
|
|
121
|
-
Keep `AI工具使用详情.pdf` inside that archive; a root copy may remain for editing
|
|
122
|
-
and inspection. Place separately required filled Excel/Word artifacts at root
|
|
123
|
-
only when the problem statement or submission system requires them there.
|
|
124
|
-
Internal evidence remains in `produce/results/qN`; do not promote every CSV or
|
|
125
|
-
diagnostic file to the root.
|
|
107
|
+
## Legacy projects
|
|
126
108
|
|
|
127
|
-
|
|
128
|
-
`
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
the file-format engines actually required to read the supplied inputs.
|
|
109
|
+
Orbit 0.8.4 continues to read the 0.8.3 locations under `paper/sections/`,
|
|
110
|
+
`paper/build/`, and `paper/*.json`. Bootstrap copies legacy control state into
|
|
111
|
+
`.cumcm/` without deleting user files. It does not destructively flatten an
|
|
112
|
+
authored legacy paper. New projects always use the compact layout.
|
|
@@ -8,6 +8,8 @@ import subprocess
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from typing import Any
|
|
10
10
|
|
|
11
|
+
from project_utils import build_directory, generated_directory
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
FIGURE_SUFFIXES = {".pdf", ".png", ".jpg", ".jpeg", ".eps", ".svg"}
|
|
13
15
|
PROBLEM_SUFFIXES = {".pdf", ".doc", ".docx", ".csv", ".tsv", ".xls", ".xlsx"}
|
|
@@ -96,6 +98,23 @@ def question_outline_findings(label: str, content: str) -> list[dict[str, str]]:
|
|
|
96
98
|
return findings
|
|
97
99
|
|
|
98
100
|
|
|
101
|
+
def flattened_question_sections(main_tex: Path) -> list[tuple[str, str]]:
|
|
102
|
+
"""Extract qN blocks from a single-file paper without creating section files."""
|
|
103
|
+
if not main_tex.is_file():
|
|
104
|
+
return []
|
|
105
|
+
content = main_tex.read_text(encoding="utf-8", errors="replace")
|
|
106
|
+
sections = list(re.finditer(r"\\section\*?\{([^{}]+)\}", content))
|
|
107
|
+
extracted: list[tuple[str, str]] = []
|
|
108
|
+
for index, match in enumerate(sections):
|
|
109
|
+
title = match.group(1).strip()
|
|
110
|
+
number = re.match(r"问题([1-9]\d*)(?:[::]|$)", title)
|
|
111
|
+
if not number:
|
|
112
|
+
continue
|
|
113
|
+
end = sections[index + 1].start() if index + 1 < len(sections) else len(content)
|
|
114
|
+
extracted.append((f"paper/main.tex#q{number.group(1)}", content[match.start() : end]))
|
|
115
|
+
return extracted
|
|
116
|
+
|
|
117
|
+
|
|
99
118
|
def inspect_pdf(pdf: Path) -> dict[str, Any]:
|
|
100
119
|
if not pdf.is_file():
|
|
101
120
|
return {"status": "missing"}
|
|
@@ -179,7 +198,13 @@ def main() -> None:
|
|
|
179
198
|
reference_dirs = [path for path in root.rglob("*") if path.is_dir() and re.search(r"优秀|参考论文|excellent|reference.?paper", path.name, re.IGNORECASE)]
|
|
180
199
|
inventory["reference_papers"] = [relative(root, path) for base in reference_dirs for path in sorted(base.rglob("*")) if path.is_file() and not path.is_symlink()]
|
|
181
200
|
|
|
182
|
-
tex_files = [
|
|
201
|
+
tex_files = [
|
|
202
|
+
path
|
|
203
|
+
for base in (paper, generated_directory(root))
|
|
204
|
+
if base.is_dir()
|
|
205
|
+
for path in base.rglob("*.tex")
|
|
206
|
+
if path.is_file() and not path.is_symlink()
|
|
207
|
+
]
|
|
183
208
|
tex_texts = {path: path.read_text(encoding="utf-8", errors="replace") for path in tex_files}
|
|
184
209
|
combined = "\n".join(tex_texts.values())
|
|
185
210
|
for source, content in tex_texts.items():
|
|
@@ -210,14 +235,17 @@ def main() -> None:
|
|
|
210
235
|
if latest_mtime(sources) > figure.stat().st_mtime + FIGURE_STALE_TOLERANCE_SECONDS:
|
|
211
236
|
findings.append({"severity": "warning", "kind": "possibly_stale_figure", "message": relative(root, figure)})
|
|
212
237
|
|
|
213
|
-
question_sections = [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
238
|
+
question_sections = [
|
|
239
|
+
(relative(root, path), tex_texts.get(path, ""))
|
|
240
|
+
for path in sorted((paper / "sections").glob("q*.tex"))
|
|
241
|
+
if re.fullmatch(r"q[1-9]\d*\.tex", path.name)
|
|
242
|
+
] if (paper / "sections").is_dir() else flattened_question_sections(paper / "main.tex")
|
|
243
|
+
for section_label, content in question_sections:
|
|
244
|
+
findings.extend(question_outline_findings(section_label, content))
|
|
217
245
|
plain = re.sub(r"\\[A-Za-z@]+\*?(?:\[[^]]*\])?", "", content)
|
|
218
246
|
plain = re.sub(r"[{}%]", "", plain)
|
|
219
247
|
if len(re.sub(r"\s+", "", plain)) < 500:
|
|
220
|
-
findings.append({"severity": "warning", "kind": "thin_question_section", "message":
|
|
248
|
+
findings.append({"severity": "warning", "kind": "thin_question_section", "message": section_label})
|
|
221
249
|
required_groups = (
|
|
222
250
|
("变量", "符号", "参数", "约束", "条件", "假设"),
|
|
223
251
|
("选择", "理由", "原因", "采用", "建立", "基于", "考虑", "模型"),
|
|
@@ -226,7 +254,7 @@ def main() -> None:
|
|
|
226
254
|
)
|
|
227
255
|
for group in required_groups:
|
|
228
256
|
if not any(token in content for token in group):
|
|
229
|
-
findings.append({"severity": "warning", "kind": "missing_reasoning_stage", "message": f"{
|
|
257
|
+
findings.append({"severity": "warning", "kind": "missing_reasoning_stage", "message": f"{section_label} lacks {'/'.join(group)}"})
|
|
230
258
|
|
|
231
259
|
main_pdf = paper / "main.pdf"
|
|
232
260
|
source_files = tex_files + [path for base_name in ("code", "results", "figures") for path in (root / base_name).rglob("*") if path.is_file()] if all((root / name).exists() for name in ("code", "results", "figures")) else tex_files
|
|
@@ -245,7 +273,7 @@ def main() -> None:
|
|
|
245
273
|
if not pdftoppm:
|
|
246
274
|
findings.append({"severity": "warning", "kind": "render_dependency_missing", "message": "pdftoppm not found"})
|
|
247
275
|
else:
|
|
248
|
-
output_dir =
|
|
276
|
+
output_dir = build_directory(root) / "page-review"
|
|
249
277
|
output_dir.mkdir(parents=True, exist_ok=True)
|
|
250
278
|
for previous in output_dir.glob("page-*.png"):
|
|
251
279
|
if previous.is_file() and not previous.is_symlink():
|
|
@@ -265,7 +293,7 @@ def main() -> None:
|
|
|
265
293
|
"findings": findings,
|
|
266
294
|
"summary": {"errors": sum(item["severity"] == "error" for item in findings), "warnings": sum(item["severity"] == "warning" for item in findings)},
|
|
267
295
|
}
|
|
268
|
-
output =
|
|
296
|
+
output = build_directory(root) / "revision-audit.json"
|
|
269
297
|
output.parent.mkdir(parents=True, exist_ok=True)
|
|
270
298
|
output.write_text(json.dumps(report, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
|
271
299
|
print(f"[RUN] Paper audit: {report['summary']['errors']} error(s), {report['summary']['warnings']} warning(s)")
|