@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.
- package/README.md +114 -3
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/commands/cumcm-draft.md +3 -1
- package/dist/index.js +20538 -5446
- package/package.json +5 -3
- package/skills/cumcm-draft/SKILL.md +62 -36
- package/skills/cumcm-draft/agents/openai.yaml +1 -1
- package/skills/cumcm-draft/assets/project-template/.cumcm/profile.json +1 -0
- package/skills/cumcm-draft/references/code-and-output-style.md +13 -2
- package/skills/cumcm-draft/references/latex-figures-tables.md +4 -2
- package/skills/cumcm-draft/references/modeling-quality.md +17 -0
- package/skills/cumcm-draft/references/project-architecture.md +29 -23
- package/skills/cumcm-draft/scripts/audit_paper.py +6 -6
- package/skills/cumcm-draft/scripts/bootstrap_project.py +86 -28
- package/skills/cumcm-draft/scripts/build_paper.py +6 -8
- package/skills/cumcm-draft/scripts/capture_environment.py +31 -21
- package/skills/cumcm-draft/scripts/clean_project.py +91 -2
- package/skills/cumcm-draft/scripts/evidence_freeze.py +2 -2
- package/skills/cumcm-draft/scripts/finalize_project.py +35 -9
- package/skills/cumcm-draft/scripts/inspect_inputs.py +9 -1
- package/skills/cumcm-draft/scripts/package_support.py +50 -9
- package/skills/cumcm-draft/scripts/project_utils.py +9 -2
- package/skills/cumcm-draft/scripts/validate_project.py +67 -68
- package/skills/cumcm-draft/assets/project-template/.cumcm/finalize.py +0 -90
- /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
- /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.
|
|
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/
|
|
68
|
-
"@orbit-build/
|
|
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.
|
|
24
|
-
|
|
25
|
-
|
|
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 `
|
|
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
|
|
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
|
-
`
|
|
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.
|
|
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, `
|
|
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
|
|
226
|
-
|
|
227
|
-
or
|
|
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 `
|
|
240
|
-
`AI工具使用详情.tex`, their final PDFs,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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 `
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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 <
|
|
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 <
|
|
360
|
+
<python-command> -B "<skill-root>/scripts/finalize_project.py" <project-root> --strict-layout --render-pages
|
|
338
361
|
```
|
|
339
362
|
|
|
340
|
-
The
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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
|
-
|
|
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
|
-
|
|
365
|
-
|
|
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,
|
|
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
|
|
@@ -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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
39
|
-
- Use PNG at 300 dpi or higher for raster
|
|
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
|
-
│ ├──
|
|
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
|
|
31
|
+
│ ├── q1/ # final Chinese-named figures only
|
|
32
32
|
│ ├── q2/
|
|
33
33
|
│ └── ...
|
|
34
|
-
└──
|
|
34
|
+
└── happy/
|
|
35
35
|
├── main.tex
|
|
36
36
|
├── AI工具使用详情.tex
|
|
37
37
|
├── main.pdf
|
|
38
38
|
├── AI工具使用详情.pdf
|
|
39
|
-
|
|
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 `
|
|
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 `
|
|
45
|
-
or `
|
|
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
|
-
- `
|
|
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
|
|
76
|
-
modeling-code appendix or support archive.
|
|
77
|
-
the
|
|
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 `需求预测误差对比.
|
|
87
|
-
`价格弹性敏感性分析.pdf`.
|
|
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 `
|
|
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
|
|
105
|
+
`AI工具使用详情.pdf` when required. It excludes immutable
|
|
101
106
|
question inputs and all `.cumcm/` control state.
|
|
102
107
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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"
|
|
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
|
|
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": "
|
|
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": "
|
|
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"
|
|
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():
|