@orbit-build/cli 1.5.0 → 1.6.4

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 (26) hide show
  1. package/README.md +114 -3
  2. package/THIRD_PARTY_NOTICES.md +1 -0
  3. package/commands/cumcm-draft.md +3 -1
  4. package/dist/index.js +20538 -5446
  5. package/package.json +5 -3
  6. package/skills/cumcm-draft/SKILL.md +62 -36
  7. package/skills/cumcm-draft/agents/openai.yaml +1 -1
  8. package/skills/cumcm-draft/assets/project-template/.cumcm/profile.json +1 -0
  9. package/skills/cumcm-draft/references/code-and-output-style.md +13 -2
  10. package/skills/cumcm-draft/references/latex-figures-tables.md +4 -2
  11. package/skills/cumcm-draft/references/modeling-quality.md +17 -0
  12. package/skills/cumcm-draft/references/project-architecture.md +29 -23
  13. package/skills/cumcm-draft/scripts/audit_paper.py +6 -6
  14. package/skills/cumcm-draft/scripts/bootstrap_project.py +86 -28
  15. package/skills/cumcm-draft/scripts/build_paper.py +6 -8
  16. package/skills/cumcm-draft/scripts/capture_environment.py +31 -21
  17. package/skills/cumcm-draft/scripts/clean_project.py +91 -2
  18. package/skills/cumcm-draft/scripts/evidence_freeze.py +2 -2
  19. package/skills/cumcm-draft/scripts/finalize_project.py +35 -9
  20. package/skills/cumcm-draft/scripts/inspect_inputs.py +9 -1
  21. package/skills/cumcm-draft/scripts/package_support.py +50 -9
  22. package/skills/cumcm-draft/scripts/project_utils.py +9 -2
  23. package/skills/cumcm-draft/scripts/validate_project.py +67 -68
  24. package/skills/cumcm-draft/assets/project-template/.cumcm/finalize.py +0 -90
  25. /package/skills/cumcm-draft/assets/project-template/{paper → happy}/AI/345/267/245/345/205/267/344/275/277/347/224/250/350/257/246/346/203/205.tex" +0 -0
  26. /package/skills/cumcm-draft/assets/project-template/{paper → happy}/main.tex +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbit-build/cli",
3
- "version": "1.5.0",
3
+ "version": "1.6.4",
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": [
@@ -64,7 +64,9 @@
64
64
  "@orbit-build/context-engine": "workspace:*",
65
65
  "@orbit-build/permissions": "workspace:*",
66
66
  "@orbit-build/session": "workspace:*",
67
- "@orbit-build/sandbox": "workspace:*",
68
- "@orbit-build/mcp": "workspace:*"
67
+ "@orbit-build/mcp": "workspace:*",
68
+ "@orbit-build/acp": "workspace:*",
69
+ "@orbit-build/daemon": "workspace:*",
70
+ "@orbit-build/sandbox": "workspace:*"
69
71
  }
70
72
  }
@@ -20,13 +20,16 @@ After one project inventory, begin implementation immediately:
20
20
 
21
21
  1. Trust bundled helpers as public interfaces. Do **not** read their source,
22
22
  test verifiers, every template section, or all optional references first.
23
- 2. Do **not** probe or install the scientific Python stack up front. Use the
24
- available dependencies; for a small deterministic task, prefer the standard
25
- library. Add a dependency only when the selected model truly requires it.
23
+ 2. Before the first Python execution, ask once which interpreter to use unless
24
+ the user already specified it. Offer the current `python`, a named Conda
25
+ environment, or an explicit executable path; if multiple Conda environments
26
+ exist, never guess the intended one. Record the selected executable and
27
+ version privately under `.cumcm/`, not in `results/`. Do not install a new
28
+ scientific stack unless the selected model truly requires it.
26
29
  3. Start the first substantive write within five tool calls after inventory.
27
30
  Work in bounded batches: at most four write/edit calls per model response,
28
31
  no giant all-project tool call, and leave enough output budget for valid
29
- tool-call closure. Implement code/results first, then `paper/main.tex` in
32
+ tool-call closure. Implement code/results first, then `happy/main.tex` in
30
33
  coherent groups; do not spend turns on cosmetic inspection between them.
31
34
  4. Run `code/run_all.py`, repair and freeze its evidence, then perform one
32
35
  evidence-to-paper synchronization pass before calling the finalizer without
@@ -35,7 +38,7 @@ After one project inventory, begin implementation immediately:
35
38
  mismatches remain.
36
39
  5. Spend remaining turns only on failed checks and rendered-page defects.
37
40
 
38
- When the project-local finalizer exits with code 0 and prints
41
+ When the Skill-root finalizer exits with code 0 and prints
39
42
  `[ORBIT_TERMINAL_SUCCESS]`, the strict build, audit, page rendering, packaging,
40
43
  and validation are already complete. Stop tool use immediately and return the
41
44
  required final report. Do not edit code, evidence, figures, or paper sources;
@@ -48,7 +51,7 @@ earlier phase and run the finalizer again before claiming completion.
48
51
  Do not repeat environment, path, template, or helper probes that already
49
52
  succeeded. A progress plan must not delay the first substantive write.
50
53
  If `.cumcm/input-inventory.json`, `.cumcm/profile.json`, `code/qN`, and
51
- `paper/main.tex` already exist, the scaffold is ready: do not read the Skill
54
+ `happy/main.tex` already exist, the scaffold is ready: do not read the Skill
52
55
  directory, helper sources, or every placeholder section. Read only the problem
53
56
  inventory/data and the target files needed for the next bounded write batch.
54
57
  Never create an environment-probe script; run the required project entry point
@@ -143,11 +146,23 @@ the repair target instead of launching ad-hoc TeX probes.
143
146
  Resolve `<skill-root>` to this Skill's directory and `<project-root>` to the
144
147
  project being handled.
145
148
 
146
- ### 1. Inventory and configure
149
+ ### 1. Select Python, inventory, and configure
150
+
151
+ Set `<python-command>` to exactly one user-approved interpreter:
152
+
153
+ - current PATH interpreter: `python`;
154
+ - named Conda environment: `conda run -n <environment> python`;
155
+ - explicit executable: `C:\path\to\python.exe`.
156
+
157
+ Use the same choice for inventory, `code/run_all.py`, helpers, and finalization.
158
+ On Windows set `$env:PYTHONDONTWRITEBYTECODE='1'`; on other systems export the
159
+ same variable. Invoke Python with `-B` when supported. Never generate a project
160
+ virtual environment, `results/environment.json`, `__pycache__/`, or `*.pyc`.
161
+ After execution, run the bundled cleaner so pre-existing caches are also gone.
147
162
 
148
163
  ```powershell
149
- python "<skill-root>/scripts/inspect_inputs.py" <project-root>
150
- python "<skill-root>/scripts/bootstrap_project.py" <project-root> --questions <N>
164
+ <python-command> -B "<skill-root>/scripts/inspect_inputs.py" <project-root>
165
+ <python-command> -B "<skill-root>/scripts/bootstrap_project.py" <project-root> --questions <N>
151
166
  ```
152
167
 
153
168
  The inventory accepts canonical inputs under `question/` and supported problem
@@ -164,7 +179,7 @@ bundled `cumcm-2026` profile only while those sources remain current.
164
179
  ### 2. Plan evidence before prose
165
180
 
166
181
  Maintain `.cumcm/evidence-map.yaml`. Every material claim needs an identifier,
167
- an in-project `results/` source, `paper/main.tex` as its paper target, and status
182
+ an in-project `results/` source, `happy/main.tex` as its paper target, and status
168
183
  `TODO` or `verified`. Define each subproblem's variables, units, constraints,
169
184
  parameter sources, candidate methods, selection reason, data dependencies,
170
185
  outputs, and validation. For decision or forecasting tasks, classify every
@@ -222,9 +237,15 @@ the outcome. Record explicit upstream artifact contracts between subproblems.
222
237
  generic `summary.json` into results merely to satisfy the workflow; evidence
223
238
  claims must point to the real Chinese-named result artifact. Workflow state
224
239
  and reproducibility metadata belong under `.cumcm/`, not `results/`.
225
- - Give every final figure a descriptive Chinese filename that states what is
226
- shown. Names such as `summary.png`, `plot.png`, `figure.png`, `output.png`,
227
- or `final.png` are invalid even when the graphic itself is correct.
240
+ - Give every final figure a descriptive Chinese filename and Chinese title,
241
+ axes, legend, annotations, and category labels. Configure a CJK font fallback
242
+ such as Microsoft YaHei, SimHei, or Noto Sans CJK SC. Produce PDF plus SVG by
243
+ default: both are vector formats suitable for paper layout and later editing.
244
+ If the user explicitly requests PNG-only output, generate at least 300 dpi
245
+ PNG files, update every paper/support reference, and remove stale PDF/SVG
246
+ copies so formats are not mixed. Names such as `summary.png`, `plot.png`,
247
+ `figure.png`, `output.png`, or `final.png` are invalid even when the graphic
248
+ itself is correct.
228
249
  - Preserve a non-Chinese filename, header, or worksheet name only when the
229
250
  problem statement or supplied fill-in template fixes it. Do not translate or
230
251
  silently reshape that prescribed schema. Register the exact output path,
@@ -236,21 +257,23 @@ the outcome. Record explicit upstream artifact contracts between subproblems.
236
257
  source; citation without schema congruence is rejected. Internal convenience
237
258
  and cross-question code contracts are not
238
259
  exceptions; use a Chinese persisted schema and validate it explicitly.
239
- - Keep `paper/` compact throughout the workflow: `main.tex`,
240
- `AI工具使用详情.tex`, their final PDFs, and `支撑材料.zip` only (plus
241
- unavoidable compiler files when an external editor creates them). Never
242
- expose `paper/sections/` or `paper/build/`; generated appendices and build
243
- caches belong under `.cumcm/`. Keep
260
+ - Keep `happy/` compact throughout the workflow: `main.tex`,
261
+ `AI工具使用详情.tex`, their final PDFs, `支撑材料.zip`, and only the
262
+ per-question `qN/` folders that contain actual submission tables. Each
263
+ `happy/qN/` is a finalizer-produced copy of the necessary CSV/XLSX/DOCX files
264
+ under `results/qN`; do not move the source result away. Never expose
265
+ `happy/sections/` or `happy/build/`; generated appendices and build caches
266
+ belong under `.cumcm/`. Keep
244
267
  internal CSV/JSON evidence under `results/qN`. Package code, necessary
245
268
  machine-readable results, larger intermediate figures, and the AI details PDF
246
269
  into the support ZIP before removing any reproducible workspace figures.
247
270
  Do not remove reproducible figures that are cited by the paper or required by
248
271
  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.
272
+ - Treat `happy/` as the human-facing delivery area, not a build workspace.
273
+ Call `<skill-root>/scripts/finalize_project.py` directly. Never create
274
+ `code/finalize.py`, `.cumcm/finalize.py`, or another project-local launcher;
275
+ finalization is Skill infrastructure and never belongs in the modeling code,
276
+ source appendix, support ZIP, or project file tree.
254
277
  - A completed `code/qN` must never contain only `main.py`. The entry point must
255
278
  remain orchestral while responsibility-named sibling modules contain the
256
279
  actual preprocessing, model/optimization, validation, and reporting logic
@@ -258,8 +281,8 @@ the outcome. Record explicit upstream artifact contracts between subproblems.
258
281
  projects before spending time on LaTeX compilation.
259
282
 
260
283
  ```powershell
261
- python <project-root>/code/run_all.py
262
- python "<skill-root>/scripts/capture_environment.py" <project-root>
284
+ <python-command> -B <project-root>/code/run_all.py
285
+ <python-command> -B "<skill-root>/scripts/capture_environment.py" <project-root> --write
263
286
  ```
264
287
 
265
288
  Once numerical outputs and figures have been accepted, treat them as a frozen
@@ -327,21 +350,22 @@ finalizer after the substantive code and paper are complete. `run_tests`
327
350
  records verification evidence and the trusted terminal-completion contract:
328
351
 
329
352
  ```powershell
330
- python <project-root>/.cumcm/finalize.py --run-code --strict-layout --render-pages
353
+ <python-command> -B "<skill-root>/scripts/finalize_project.py" <project-root> --run-code --strict-layout --render-pages
331
354
  ```
332
355
 
333
356
  Use `--run-code` for the first finalization only. For later typography,
334
357
  appendix, disclosure, packaging, or audit repairs, omit it:
335
358
 
336
359
  ```powershell
337
- python <project-root>/.cumcm/finalize.py --strict-layout --render-pages
360
+ <python-command> -B "<skill-root>/scripts/finalize_project.py" <project-root> --strict-layout --render-pages
338
361
  ```
339
362
 
340
- The private project-local launcher under `.cumcm/` executes the active Skill's trusted finalizer without
341
- requiring a shell command outside the workspace. It records the environment,
342
- rebuilds with local TeX Live, audits and optionally
343
- renders every page, packages support materials, and runs strict validation. Its
344
- individual scripts may be run separately while repairing a failure.
363
+ The Skill-root finalizer records the selected environment privately,
364
+ rebuilds with local TeX Live, audits and optionally renders every page, removes
365
+ only unreferenced legacy artifacts and caches under `happy/`/`.cumcm/`, freezes
366
+ the resulting evidence, packages support materials, and runs strict validation.
367
+ Its individual scripts may be run separately while repairing a failure. Use
368
+ `--no-clean` when a local debugging session must retain compiler caches.
345
369
 
346
370
  Use the machine-readable audit report to resolve missing inputs, stale figures,
347
371
  missing TeX assets, unresolved references, weak question sections, and stale
@@ -355,14 +379,16 @@ files, replace the body table with a compact summary.
355
379
  Ensure every bibliography entry is cited and every externally sourced method
356
380
  has a nearby citation; remove ornamental uncited references.
357
381
 
358
- Clean only known caches and temporary render products after verification:
382
+ The finalizer cleans before the evidence freeze so removed legacy files cannot
383
+ silently remain in the support ZIP. To run the cleaner manually:
359
384
 
360
385
  ```powershell
361
- python "<skill-root>/scripts/clean_project.py" <project-root> --apply
386
+ <python-command> -B "<skill-root>/scripts/clean_project.py" <project-root> --apply
362
387
  ```
363
388
 
364
- Never remove original questions, current code, effective results, paper figures,
365
- TeX sources, final PDFs, or unknown files.
389
+ The cleaner preserves artifacts referenced by `happy/` or `.cumcm/`; it never
390
+ removes original questions, current code, referenced results or figures, TeX
391
+ sources, final PDFs, or unknown files.
366
392
 
367
393
  ## AI-use compliance
368
394
 
@@ -1,6 +1,6 @@
1
1
  interface:
2
2
  display_name: "CUMCM Draft"
3
3
  short_description: "Complete CUMCM paper, code, PDF, AI record, and support ZIP"
4
- default_prompt: "Use $cumcm-draft to audit the current official CUMCM rules, read every problem and attachment, build runnable responsibility-based q1/q2 code and Chinese-named evidence/figures, keep paper/ limited to main.tex, AI details, and final deliverables, write and inspect the full Chinese paper, and package the matching PDF/ZIP pair. Treat AI-led core modeling as training work unless team leadership and manual review are documented for formal submission."
4
+ default_prompt: "Use $cumcm-draft to ask which Python or Conda interpreter to use, audit the current official CUMCM rules, build responsibility-based q1/q2 code without project-local finalizers or Python caches, generate Chinese-named tables and Chinese PDF+SVG figures, keep final PDFs/TeX and required qN submission copies under happy/, inspect the full Chinese paper, and package the matching PDF/ZIP pair."
5
5
  policy:
6
6
  allow_implicit_invocation: false
@@ -18,6 +18,7 @@
18
18
  "require_chinese_headers": true,
19
19
  "require_chinese_sheet_names": true,
20
20
  "require_chinese_figure_filenames": true,
21
+ "require_pdf_svg_figure_pair": true,
21
22
  "require_utf8_sig_csv": true,
22
23
  "fixed_schema_exceptions": []
23
24
  },
@@ -51,7 +51,10 @@ pipeline = make_pipeline(transformer, estimator)
51
51
 
52
52
  - Resolve paths from `Path(__file__)`, never the current shell directory alone.
53
53
  - Fix all library random seeds through one `RANDOM_STATE`.
54
- - Save environment/package versions.
54
+ - Ask the user to select the interpreter before execution. Keep its executable,
55
+ version, and package versions in private `.cumcm/environment.txt` only.
56
+ - Run with `PYTHONDONTWRITEBYTECODE=1` and `-B`, then remove all
57
+ `__pycache__/`, `*.pyc`, and `*.pyo` before handoff.
55
58
  - Make the default entry point non-interactive.
56
59
  - Put expensive optional analyses behind explicit flags.
57
60
  - Keep plotting headless and deterministic.
@@ -116,7 +119,10 @@ For each `figures/qN`:
116
119
  - save only figures used or directly useful in the paper;
117
120
  - use descriptive Chinese filenames; reject generic names such as
118
121
  `summary.png`, `plot.png`, `figure.png`, `output.png`, and `final.png`;
119
- - prefer vector PDF for line art plus a high-resolution PNG fallback;
122
+ - generate both PDF and SVG for line art by default; both are vector formats;
123
+ - when the user explicitly chooses PNG-only, generate at least 300 dpi PNG,
124
+ update paper and archive references, and remove stale PDF/SVG copies;
125
+ - write figure titles, axes, legends, annotations, and categories in Chinese;
120
126
  - use Chinese-capable fonts and minus-sign handling;
121
127
  - label axes and colorbars with units;
122
128
  - choose perceptually appropriate palettes;
@@ -141,6 +147,11 @@ legible in a LaTeX source-code appendix without relying on symbol fonts.
141
147
 
142
148
  - Retain model-selection tables, validation metrics, and independent test
143
149
  outputs that substantiate claims.
150
+ - Before adding an evaluation, test, audit, or environment artifact, identify
151
+ its consuming question, paper claim, official template field, or reproducible
152
+ workflow step. If none exists, keep the check transient or remove it before
153
+ handoff; do not create placeholder metrics or duplicate JSON just to make the
154
+ project look complete.
144
155
  - Remove one-off verifier, cleanup, ZIP-rebuild, and contact-sheet scripts after
145
156
  their reusable checks are covered by the trusted finalizer.
146
157
  - Never place nested project archives, `__pycache__`, `.pyc`, TeX intermediates,
@@ -35,8 +35,10 @@
35
35
 
36
36
  ## Figures
37
37
 
38
- - Prefer PDF vector output for plots and diagrams.
39
- - Use PNG at 300 dpi or higher for raster images.
38
+ - Generate PDF and SVG for plots and diagrams; both are vector outputs.
39
+ - Use PNG at 300 dpi or higher only for raster previews or genuinely raster data.
40
+ - Use Chinese filenames and Chinese titles, axes, legends, annotations, and
41
+ category labels, with a CJK-capable font fallback.
40
42
  - Make labels readable at final printed size.
41
43
  - Use consistent sizes and palette across questions.
42
44
  - Distinguish series by more than color when grayscale printing is plausible.
@@ -98,6 +98,23 @@ Choose evidence appropriate to the claim:
98
98
  Respect grouped, temporal, or spatial dependence. Do not randomly split rows
99
99
  that share the same entity or leak future information.
100
100
 
101
+ For motion, traffic, or multi-agent simulation, treat safety as a hard
102
+ invariant rather than an after-the-fact score:
103
+
104
+ - express the reference-point gap, vehicle length, net clearance, speed and
105
+ acceleration units explicitly; check that the required reference spacing is
106
+ `vehicle length + net clearance`;
107
+ - enforce the invariant at every control step for every pair, including
108
+ vehicles on adjacent directed links and vehicles waiting at a merge;
109
+ - include the remaining distance to a link boundary and the full downstream
110
+ route in braking and entry checks; do not stop the audit at a task target or
111
+ merge node;
112
+ - add a small execution-only numerical margin, but report feasibility against
113
+ the stated problem threshold; fail closed on any violation;
114
+ - independently recompute the minimum same-link and cross-link gaps from the
115
+ final log. A self-written `constraints.json` is evidence only when this
116
+ independent audit agrees.
117
+
101
118
  For sequential optimization or simulation, separate parameter estimation,
102
119
  policy selection, and policy evaluation by time or independent scenarios.
103
120
  Do not use final-test feasibility or Pareto filters to guarantee that every
@@ -10,7 +10,7 @@ project-root/
10
10
  │ ├── project.json
11
11
  │ ├── evidence-map.yaml
12
12
  │ ├── ai-use-log.md
13
- │ ├── finalize.py
13
+ │ ├── environment.txt # private interpreter/version note
14
14
  │ ├── generated/ # generated TeX appendices
15
15
  │ └── build/ # LaTeX caches, page renders, audit report
16
16
  ├── question/ # immutable problem and supplied data
@@ -28,21 +28,23 @@ project-root/
28
28
  │ ├── q2/
29
29
  │ └── ...
30
30
  ├── figures/
31
- │ ├── q1/ # final Chinese-named paper figures only
31
+ │ ├── q1/ # final Chinese-named figures only
32
32
  │ ├── q2/
33
33
  │ └── ...
34
- └── paper/
34
+ └── happy/
35
35
  ├── main.tex
36
36
  ├── AI工具使用详情.tex
37
37
  ├── main.pdf
38
38
  ├── AI工具使用详情.pdf
39
- └── 支撑材料.zip
39
+ ├── 支撑材料.zip
40
+ ├── q1/ # copies of required result tables
41
+ └── q2/
40
42
  ```
41
43
 
42
- The two TeX sources are the only default authored files under `paper/`.
44
+ The two TeX sources are the only default authored files under `happy/`.
43
45
  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
+ `.cumcm/build/` and cleans known intermediates. Do not create `happy/sections/`
47
+ or `happy/build/`.
46
48
 
47
49
  ## Ownership rules
48
50
 
@@ -53,7 +55,8 @@ or `paper/build/`.
53
55
  came from `question/`.
54
56
  - Create `code/common` only after two or more questions use the same behavior.
55
57
  A pre-generated utility package is clutter and often becomes dead code.
56
- - Each `code/qN/main.py` must run independently after prerequisites exist.
58
+ - Each `code/qN/main.py` must run independently after prerequisites exist,
59
+ both through `code/run_all.py` and as a direct script from its qN directory.
57
60
  - `main.py` orchestrates loading, domain computation, validation, and reporting.
58
61
  Put substantive models in sibling modules named after their actual role.
59
62
  - A strict finalization must not pass when qN still contains only the scaffold
@@ -65,16 +68,16 @@ or `paper/build/`.
65
68
  synthetic `summary.json`; point `.cumcm/evidence-map.yaml` to real results.
66
69
  - `figures/qN` owns final visuals for question N. Diagnostic-only images belong
67
70
  in `.cumcm/build/` and must not enter the support archive.
68
- - `paper/main.tex` consumes only declared evidence from matching or explicitly
71
+ - `happy/main.tex` consumes only declared evidence from matching or explicitly
69
72
  upstream result directories.
70
73
  - Treat every cross-question result as a typed interface. The consumer checks
71
74
  columns, unique entity/date keys, units, coverage, and freshness.
72
75
  - Keep model-selection, validation, and test artifacts under the producing
73
76
  `results/qN`; these are evidence, not disposable debug output.
74
77
  - `.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`.
78
+ include audit reports, evidence freezes, environment notes, or build caches in
79
+ the modeling-code appendix or support archive. Never create a project-local
80
+ `finalize.py`; call the active Skill's `scripts/finalize_project.py` directly.
78
81
 
79
82
  ## Naming
80
83
 
@@ -83,8 +86,10 @@ or `paper/build/`.
83
86
  - Use descriptive Chinese filenames for generated tabular artifacts under
84
87
  `results/qN`; use Chinese CSV/TSV headers and Chinese Excel worksheet/table
85
88
  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`,
89
+ - Use descriptive Chinese figure filenames such as `需求预测误差对比.svg` or
90
+ `价格弹性敏感性分析.pdf`. Write titles, axes, legends, annotations, and
91
+ categories in Chinese. Generate PDF and SVG vector outputs by default; PNG
92
+ is an optional raster preview. Generic names such as `summary.png`, `plot.png`,
88
93
  `figure.png`, `output.png`, and `final.png` are invalid.
89
94
  - Preserve a prescribed non-Chinese result schema only when the problem fixes
90
95
  it, and document the narrow exception in
@@ -95,18 +100,19 @@ or `paper/build/`.
95
100
 
96
101
  ## Submission boundary
97
102
 
98
- The formal submission pair is `paper/main.pdf` plus `paper/支撑材料.zip`.
103
+ The formal submission pair is `happy/main.pdf` plus `happy/支撑材料.zip`.
99
104
  The archive contains runnable code, necessary results, cited figures,
100
- `AI工具使用详情.pdf` when required, and `复现环境.json`. It excludes immutable
105
+ `AI工具使用详情.pdf` when required. It excludes immutable
101
106
  question inputs and all `.cumcm/` control state.
102
107
 
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.
108
+ Copy separately required CSV/Excel/Word artifacts from `results/qN` into the
109
+ matching `happy/qN`. Do not copy internal JSON audits or promote every
110
+ diagnostic and figure into the human-facing delivery directory.
106
111
 
107
112
  ## Legacy projects
108
113
 
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.
114
+ Legacy projects under `paper/` must be migrated deliberately to `happy/` before
115
+ finalization. Bootstrap intentionally does not copy authored `paper/` TeX or
116
+ rewrite the old layout; preserve authored TeX while collapsing legacy sections
117
+ only after verifying the resulting `happy/main.tex`. New projects always use the
118
+ compact `happy/` layout.
@@ -8,7 +8,7 @@ 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
11
+ from project_utils import build_directory, delivery_directory, generated_directory
12
12
 
13
13
 
14
14
  FIGURE_SUFFIXES = {".pdf", ".png", ".jpg", ".jpeg", ".eps", ".svg"}
@@ -111,7 +111,7 @@ def flattened_question_sections(main_tex: Path) -> list[tuple[str, str]]:
111
111
  if not number:
112
112
  continue
113
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]))
114
+ extracted.append((f"happy/main.tex#q{number.group(1)}", content[match.start() : end]))
115
115
  return extracted
116
116
 
117
117
 
@@ -174,7 +174,7 @@ def main() -> None:
174
174
  parser.add_argument("--fail-on-errors", action="store_true")
175
175
  args = parser.parse_args()
176
176
  root = args.project_root.resolve()
177
- paper = root / "paper"
177
+ paper = delivery_directory(root)
178
178
  findings: list[dict[str, str]] = []
179
179
  inventory: dict[str, list[str]] = {}
180
180
  root_problem_files = [path for path in root.iterdir() if path.is_file() and not path.is_symlink() and path.suffix.lower() in PROBLEM_SUFFIXES]
@@ -259,13 +259,13 @@ def main() -> None:
259
259
  main_pdf = paper / "main.pdf"
260
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
261
261
  if not main_pdf.is_file():
262
- findings.append({"severity": "error", "kind": "missing_pdf", "message": "paper/main.pdf"})
262
+ findings.append({"severity": "error", "kind": "missing_pdf", "message": "happy/main.pdf"})
263
263
  elif latest_mtime(source_files) > main_pdf.stat().st_mtime:
264
- findings.append({"severity": "warning", "kind": "stale_pdf", "message": "paper/main.pdf is older than TeX/code/results/figures"})
264
+ findings.append({"severity": "warning", "kind": "stale_pdf", "message": "happy/main.pdf is older than TeX/code/results/figures"})
265
265
  pdf_check = inspect_pdf(main_pdf)
266
266
  for page in pdf_check.get("page_checks", []):
267
267
  if page.get("possibly_blank"):
268
- findings.append({"severity": "error", "kind": "possibly_blank_page", "message": f"paper/main.pdf page {page['page']}"})
268
+ findings.append({"severity": "error", "kind": "possibly_blank_page", "message": f"happy/main.pdf page {page['page']}"})
269
269
 
270
270
  rendered: list[str] = []
271
271
  if args.render_pages and main_pdf.is_file():