@orbit-build/cli 0.8.5 → 0.9.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbit-build/cli",
3
- "version": "0.8.5",
3
+ "version": "0.9.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Local-first AI coding agent CLI, TUI, Web UI, diagnostics, and LSP runtime",
6
6
  "keywords": [
@@ -246,6 +246,16 @@ the outcome. Record explicit upstream artifact contracts between subproblems.
246
246
  into the support ZIP before removing any reproducible workspace figures.
247
247
  Do not remove reproducible figures that are cited by the paper or required by
248
248
  the support archive.
249
+ - Treat `paper/` as the human-facing delivery area, not a build workspace. The
250
+ hidden `.cumcm/finalize.py` is only a workspace-scoped launcher for Orbit's
251
+ trusted build/audit/package gate. It is not modeling code, never belongs under
252
+ `code/`, never appears in the source appendix or support ZIP, and may be
253
+ ignored by users reviewing the model implementation.
254
+ - A completed `code/qN` must never contain only `main.py`. The entry point must
255
+ remain orchestral while responsibility-named sibling modules contain the
256
+ actual preprocessing, model/optimization, validation, and reporting logic
257
+ that the question needs. The finalizer rejects main-only and TODO scaffold
258
+ projects before spending time on LaTeX compilation.
249
259
 
250
260
  ```powershell
251
261
  python <project-root>/code/run_all.py
@@ -38,6 +38,7 @@ def main() -> None:
38
38
  created: list[str] = []
39
39
  updated: list[str] = []
40
40
  preserved: list[str] = []
41
+ removed: list[str] = []
41
42
  for directory in (
42
43
  root / "question",
43
44
  root / "code",
@@ -50,6 +51,7 @@ def main() -> None:
50
51
 
51
52
  migrate_legacy_control_files(root, created, preserved)
52
53
  copy_template_tree(root, created, preserved)
54
+ remove_empty_legacy_layout_directories(root, removed)
53
55
  declared = read_declared_count(root)
54
56
  discovered = max(question_numbers(root), default=0)
55
57
  question_count = max(args.questions, declared, discovered)
@@ -67,6 +69,20 @@ def main() -> None:
67
69
  )
68
70
  if updated:
69
71
  print(" Updated orchestrators: " + ", ".join(updated))
72
+ if removed:
73
+ print(" Removed empty legacy layout shells: " + ", ".join(removed))
74
+
75
+
76
+ def remove_empty_legacy_layout_directories(root: Path, removed: list[str]) -> None:
77
+ """Drop empty legacy shells without touching authored files or build output."""
78
+ for directory in (root / "paper" / "sections", root / "paper" / "build"):
79
+ if not directory.is_dir() or directory.is_symlink():
80
+ continue
81
+ try:
82
+ next(directory.iterdir())
83
+ except StopIteration:
84
+ directory.rmdir()
85
+ removed.append(directory.relative_to(root).as_posix() + "/")
70
86
 
71
87
 
72
88
  def migrate_legacy_control_files(
@@ -6,6 +6,8 @@ import sys
6
6
  from pathlib import Path
7
7
 
8
8
  from evidence_freeze import require_refresh_authorization, write_freeze
9
+ from project_utils import question_numbers
10
+ from validate_project import code_architecture_errors
9
11
 
10
12
 
11
13
  SCRIPT_ROOT = Path(__file__).resolve().parent
@@ -38,6 +40,16 @@ def main() -> None:
38
40
  completed = subprocess.run([sys.executable, str(entry)], cwd=root / "code", check=False)
39
41
  if completed.returncode:
40
42
  raise SystemExit("code/run_all.py failed; paper was not rebuilt from stale evidence.")
43
+ discovered_questions = question_numbers(root)
44
+ architecture_errors = code_architecture_errors(
45
+ root, max(discovered_questions, default=0)
46
+ )
47
+ if architecture_errors:
48
+ for error in architecture_errors:
49
+ print(f"[ERROR] {error}")
50
+ raise SystemExit(
51
+ "Finalization stopped before compilation because modeling code is incomplete."
52
+ )
41
53
  run("capture_environment.py", root)
42
54
  run("build_paper.py", root, *(["--strict-layout"] if args.strict_layout else []))
43
55
  audit_flags = ["--fail-on-errors"]
@@ -880,9 +880,9 @@ def validate_evidence(root: Path, count: int, errors: list[str], warnings: list[
880
880
  warnings.append(f"unresolved evidence claim: {claim_id or location}")
881
881
 
882
882
 
883
- def code_architecture_warnings(root: Path, count: int) -> list[str]:
884
- """Find review-hostile Python layouts without prescribing one fixed architecture."""
885
- warnings: list[str] = []
883
+ def code_architecture_errors(root: Path, count: int) -> list[str]:
884
+ """Reject incomplete qN implementations that cannot support a final paper."""
885
+ errors: list[str] = []
886
886
  for number in range(1, count + 1):
887
887
  question_dir = root / "code" / f"q{number}"
888
888
  if not question_dir.is_dir():
@@ -894,10 +894,33 @@ def code_architecture_warnings(root: Path, count: int) -> list[str]:
894
894
  )
895
895
  names = {path.name for path in modules}
896
896
  if names == {"main.py"}:
897
- warnings.append(
897
+ errors.append(
898
898
  f"q{number} contains only main.py; keep it orchestral and add "
899
899
  "responsibility-named modules for the actual model and validation"
900
900
  )
901
+ main_path = question_dir / "main.py"
902
+ if main_path.is_file():
903
+ main_text = main_path.read_text(encoding="utf-8", errors="replace")
904
+ if "NotImplementedError" in main_text or "TODO" in main_text:
905
+ errors.append(
906
+ f"code/q{number}/main.py is still an unimplemented scaffold"
907
+ )
908
+ return errors
909
+
910
+
911
+ def code_architecture_warnings(root: Path, count: int) -> list[str]:
912
+ """Find review-hostile Python layouts without prescribing one fixed architecture."""
913
+ warnings: list[str] = []
914
+ for number in range(1, count + 1):
915
+ question_dir = root / "code" / f"q{number}"
916
+ if not question_dir.is_dir():
917
+ continue
918
+ modules = sorted(
919
+ path
920
+ for path in question_dir.glob("*.py")
921
+ if path.name != "__init__.py" and path.is_file()
922
+ )
923
+ names = {path.name for path in modules}
901
924
  if names == {"main.py", "model.py", "output.py"}:
902
925
  warnings.append(
903
926
  f"q{number} uses the generic main.py + model.py + output.py trio; "
@@ -915,10 +938,6 @@ def code_architecture_warnings(root: Path, count: int) -> list[str]:
915
938
  main_path = question_dir / "main.py"
916
939
  if main_path.is_file():
917
940
  main_text = main_path.read_text(encoding="utf-8", errors="replace")
918
- if "NotImplementedError" in main_text or "TODO" in main_text:
919
- warnings.append(
920
- f"code/q{number}/main.py is still an unimplemented scaffold"
921
- )
922
941
  main_lines = [
923
942
  line
924
943
  for line in main_text.splitlines()
@@ -1175,6 +1194,7 @@ def main() -> None:
1175
1194
  errors.append(
1176
1195
  f"Python syntax failed for {source.relative_to(root).as_posix()}: {error}"
1177
1196
  )
1197
+ errors.extend(code_architecture_errors(root, count))
1178
1198
  warnings.extend(code_architecture_warnings(root, count))
1179
1199
  warnings.extend(delivery_hygiene_warnings(root))
1180
1200
  if result_artifact_profile is not None: