@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.
Files changed (44) hide show
  1. package/README.md +4 -1
  2. package/dist/index.js +558 -151
  3. package/package.json +1 -1
  4. package/skills/cumcm-draft/SKILL.md +92 -48
  5. package/skills/cumcm-draft/agents/openai.yaml +1 -1
  6. package/skills/cumcm-draft/assets/project-template/{code → .cumcm}/finalize.py +33 -4
  7. package/skills/cumcm-draft/assets/project-template/{paper/contest-profile.json → .cumcm/profile.json} +9 -6
  8. package/skills/cumcm-draft/assets/project-template/code/requirements.txt +1 -11
  9. 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
  10. package/skills/cumcm-draft/assets/project-template/paper/main.tex +70 -11
  11. package/skills/cumcm-draft/references/code-and-output-style.md +9 -14
  12. package/skills/cumcm-draft/references/cumcm-compliance.md +28 -25
  13. package/skills/cumcm-draft/references/latex-figures-tables.md +1 -1
  14. package/skills/cumcm-draft/references/modeling-quality.md +1 -1
  15. package/skills/cumcm-draft/references/paper-architecture.md +3 -3
  16. package/skills/cumcm-draft/references/project-architecture.md +70 -89
  17. package/skills/cumcm-draft/scripts/audit_paper.py +37 -9
  18. package/skills/cumcm-draft/scripts/bootstrap_project.py +182 -56
  19. package/skills/cumcm-draft/scripts/build_paper.py +38 -23
  20. package/skills/cumcm-draft/scripts/capture_environment.py +3 -1
  21. package/skills/cumcm-draft/scripts/clean_project.py +7 -2
  22. package/skills/cumcm-draft/scripts/evidence_freeze.py +8 -4
  23. package/skills/cumcm-draft/scripts/finalize_project.py +4 -0
  24. package/skills/cumcm-draft/scripts/inspect_inputs.py +6 -4
  25. package/skills/cumcm-draft/scripts/package_support.py +41 -15
  26. package/skills/cumcm-draft/scripts/project_utils.py +40 -8
  27. package/skills/cumcm-draft/scripts/validate_project.py +374 -57
  28. package/skills/cumcm-draft/assets/project-template/code/always/__init__.py +0 -1
  29. package/skills/cumcm-draft/assets/project-template/code/always/config.py +0 -18
  30. package/skills/cumcm-draft/assets/project-template/code/always/data.py +0 -24
  31. package/skills/cumcm-draft/assets/project-template/code/always/plotting.py +0 -25
  32. package/skills/cumcm-draft/assets/project-template/code/always/validation.py +0 -21
  33. package/skills/cumcm-draft/assets/project-template/paper/sections/abstract.tex +0 -6
  34. package/skills/cumcm-draft/assets/project-template/paper/sections/ai-disclosure.tex +0 -3
  35. package/skills/cumcm-draft/assets/project-template/paper/sections/appendix.tex +0 -3
  36. package/skills/cumcm-draft/assets/project-template/paper/sections/assumptions.tex +0 -5
  37. package/skills/cumcm-draft/assets/project-template/paper/sections/data.tex +0 -19
  38. package/skills/cumcm-draft/assets/project-template/paper/sections/evaluation.tex +0 -9
  39. package/skills/cumcm-draft/assets/project-template/paper/sections/problem-analysis.tex +0 -3
  40. package/skills/cumcm-draft/assets/project-template/paper/sections/problem-restatement.tex +0 -3
  41. package/skills/cumcm-draft/assets/project-template/paper/sections/references.tex +0 -12
  42. package/skills/cumcm-draft/assets/project-template/paper/sections/source-code.tex +0 -1
  43. package/skills/cumcm-draft/assets/project-template/paper/sections/support-files.tex +0 -3
  44. /package/skills/cumcm-draft/assets/project-template/{paper → .cumcm}/ai-use-log.md +0 -0
@@ -4,7 +4,12 @@ import argparse
4
4
  import zipfile
5
5
  from pathlib import Path
6
6
 
7
- from project_utils import iter_regular_files, load_profile, numeric_limit
7
+ from project_utils import (
8
+ control_path,
9
+ iter_regular_files,
10
+ load_profile,
11
+ numeric_limit,
12
+ )
8
13
 
9
14
 
10
15
  EXCLUDED_PARTS = {
@@ -18,17 +23,23 @@ EXCLUDED_PARTS = {
18
23
 
19
24
 
20
25
  def main() -> None:
21
- parser = argparse.ArgumentParser(description="Package reproducible support files safely.")
26
+ parser = argparse.ArgumentParser(
27
+ description="Package only reproducible submission support files."
28
+ )
22
29
  parser.add_argument("project_root", type=Path)
23
30
  args = parser.parse_args()
24
31
  root = args.project_root.resolve()
25
- output = root / "paper" / "support-materials.zip"
32
+ output = root / "paper" / "支撑材料.zip"
26
33
  try:
27
34
  profile = load_profile(root)
28
35
  support_profile = profile["support"]
29
36
  assert isinstance(support_profile, dict)
30
37
  limit = numeric_limit(support_profile, "max_archive_mb")
31
- candidates = [path for directory in ("code", "results", "figures") for path in iter_regular_files(root, directory, EXCLUDED_PARTS)]
38
+ candidates = [
39
+ (path, path.relative_to(root).as_posix())
40
+ for directory in ("code", "results", "figures")
41
+ for path in iter_regular_files(root, directory, EXCLUDED_PARTS)
42
+ ]
32
43
  except (ValueError, TypeError) as error:
33
44
  raise SystemExit(str(error)) from error
34
45
 
@@ -38,25 +49,40 @@ def main() -> None:
38
49
  ai_pdf = root / "paper" / "AI工具使用详情.pdf"
39
50
  if not ai_pdf.is_file() or ai_pdf.is_symlink():
40
51
  raise SystemExit("Active profile requires a built paper/AI工具使用详情.pdf")
41
- candidates.append(ai_pdf)
52
+ candidates.append((ai_pdf, "AI工具使用详情.pdf"))
53
+
54
+ environment = control_path(root, "environment.json")
55
+ if environment.is_file() and not environment.is_symlink():
56
+ candidates.append((environment, "复现环境.json"))
57
+
42
58
  if bool(support_profile.get("include_ai_log")):
43
- log = root / "paper" / "ai-use-log.md"
59
+ log = control_path(
60
+ root,
61
+ "ai-use-log.md",
62
+ root / "paper" / "ai-use-log.md",
63
+ )
44
64
  if log.is_file() and not log.is_symlink():
45
- candidates.append(log)
46
- freeze = root / "paper" / "evidence-freeze.json"
47
- if not freeze.is_file() or freeze.is_symlink():
48
- raise SystemExit("Missing paper/evidence-freeze.json; run the finalizer before packaging support files")
49
- candidates.append(freeze)
65
+ candidates.append((log, "AI工具使用记录.md"))
66
+
67
+ archive_names = [name for _, name in candidates]
68
+ if len(archive_names) != len(set(archive_names)):
69
+ raise SystemExit("Support archive contains duplicate destination names.")
50
70
 
51
71
  output.parent.mkdir(parents=True, exist_ok=True)
52
72
  with zipfile.ZipFile(output, "w", compression=zipfile.ZIP_DEFLATED) as archive:
53
- for path in sorted(set(candidates)):
54
- archive.write(path, path.relative_to(root).as_posix())
73
+ for path, archive_name in sorted(candidates, key=lambda item: item[1]):
74
+ archive.write(path, archive_name)
55
75
  size_mb = output.stat().st_size / (1024 * 1024)
56
76
  if limit is not None and size_mb > limit:
57
77
  output.unlink()
58
- raise SystemExit(f"Support archive would be {size_mb:.2f} MB; active profile limit is {limit:g} MB.")
59
- print(f"[OK] Packaged {len(set(candidates))} support file(s): {output} ({size_mb:.2f} MB)")
78
+ raise SystemExit(
79
+ f"Support archive would be {size_mb:.2f} MB; "
80
+ f"active profile limit is {limit:g} MB."
81
+ )
82
+ print(
83
+ f"[OK] Packaged {len(candidates)} support file(s): "
84
+ f"{output} ({size_mb:.2f} MB)"
85
+ )
60
86
 
61
87
 
62
88
  if __name__ == "__main__":
@@ -6,10 +6,14 @@ from pathlib import Path
6
6
  from typing import Any, Iterable
7
7
 
8
8
 
9
+ CONTROL_DIRECTORY_NAME = ".cumcm"
10
+
11
+
9
12
  DEFAULT_PROFILE: dict[str, Any] = {
10
13
  "schema_version": 1,
11
14
  "profile": "cumcm-2026",
12
- "rules_checked_at": "2026-08-12",
15
+ "rules_checked_at": "2026-08-15",
16
+ "rules_expires_at": "2026-09-30",
13
17
  "paper": {
14
18
  "max_pdf_mb": 20,
15
19
  "max_body_pages": 30,
@@ -21,27 +25,55 @@ DEFAULT_PROFILE: dict[str, Any] = {
21
25
  "require_chinese_filenames": True,
22
26
  "require_chinese_headers": True,
23
27
  "require_chinese_sheet_names": True,
28
+ "require_chinese_figure_filenames": True,
24
29
  "require_utf8_sig_csv": True,
25
30
  "fixed_schema_exceptions": [],
26
31
  },
27
32
  "ai": {
28
- "policy": "cumcm-2025-trial",
33
+ "policy": "cumcm-2026-trial",
29
34
  "used": True,
30
- "inline_markers_required": True,
31
- "reference_entry_required": True,
32
- "reference_key": "ai-tool",
35
+ "submission_intent": "training",
36
+ "core_modeling_led_by_team": False,
37
+ "manual_review_completed": False,
38
+ "declaration_required": True,
39
+ "declaration_before_references": True,
33
40
  "details_pdf_required": True,
34
41
  },
35
42
  "sources": [
36
43
  "https://www.mcm.edu.cn/html_cn/node/4cd596519c9eb9fbd866398f6df0caa3.html",
37
44
  "https://www.mcm.edu.cn/html_cn/node/9d8e511fe7a1447b35f53a82c908e2e0.html",
38
- "https://en.mcm.edu.cn/html_en/node/b87f1a9b1dbbd987f56513609f416722.html",
45
+ "https://www.mcm.edu.cn/html_cn/node/fef94648f2836ab6cc81586f4c38512b.html",
39
46
  ],
40
47
  }
41
48
 
42
49
 
50
+ def control_directory(root: Path) -> Path:
51
+ """Return the private workflow-state directory for a modeling project."""
52
+ return root / CONTROL_DIRECTORY_NAME
53
+
54
+
55
+ def control_path(root: Path, name: str, legacy: Path | None = None) -> Path:
56
+ """Prefer the compact layout while retaining read compatibility with 0.8.3."""
57
+ current = control_directory(root) / name
58
+ if current.exists() or legacy is None or not legacy.exists():
59
+ return current
60
+ return legacy
61
+
62
+
63
+ def build_directory(root: Path) -> Path:
64
+ return control_directory(root) / "build"
65
+
66
+
67
+ def generated_directory(root: Path) -> Path:
68
+ return control_directory(root) / "generated"
69
+
70
+
43
71
  def load_profile(root: Path) -> dict[str, Any]:
44
- path = root / "paper" / "contest-profile.json"
72
+ path = control_path(
73
+ root,
74
+ "profile.json",
75
+ root / "paper" / "contest-profile.json",
76
+ )
45
77
  if not path.is_file():
46
78
  return json.loads(json.dumps(DEFAULT_PROFILE))
47
79
  try:
@@ -49,7 +81,7 @@ def load_profile(root: Path) -> dict[str, Any]:
49
81
  except (OSError, json.JSONDecodeError) as error:
50
82
  raise ValueError(f"invalid contest profile {path}: {error}") from error
51
83
  if not isinstance(payload, dict) or payload.get("schema_version") != 1:
52
- raise ValueError("contest-profile.json requires schema_version 1")
84
+ raise ValueError(f"{path.name} requires schema_version 1")
53
85
  merged = json.loads(json.dumps(DEFAULT_PROFILE))
54
86
  for key, value in payload.items():
55
87
  if isinstance(value, dict) and isinstance(merged.get(key), dict):