dsh-vibe-math 2.5.0 → 2.6.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/README.en.md +41 -2
- package/README.md +41 -2
- package/cordis.patch.yml +22 -8
- package/docs/AUDIT-CHECKLIST.md +2 -2
- package/docs/final-paper.md +171 -0
- package/docs/release-notes/RELEASE-NOTES-2.6.0.md +268 -0
- package/docs/test-timing.md +8 -4
- package/package.json +5 -3
- package/prompt-corpus-persona/persona-corpus.json +13 -13
- package/prompt-corpus-persona/persona-corpus.md +49 -21
- package/prompt-corpus-v2/formal-verify-v2.json +12 -0
- package/prompt-corpus-v2/formal-verify-v2.md +144 -53
- package/prompt-corpus-v3/formal-verify-v3.json +36 -0
- package/prompt-corpus-v3/formal-verify-v3.md +405 -78
- package/tests/audit-persona-sensitivity.mjs +60 -7
- package/tests/audit-persona-surface.test.mjs +16 -7
- package/tests/e2e-v5-round2.test.mjs +471 -1
- package/tests/formal-verify-v2.test.mjs +3 -0
- package/tests/formal-verify-v3.test.mjs +4 -0
- package/tests/prompt-v5-integrity.test.mjs +9 -3
- package/tests/selfdrive-v5.mjs +55 -4
- package/vibe-math-v2/agent.cordis.yml +14 -4
- package/vibe-math-v2/vibe-math-v2.js +819 -11
- package/vibe-math-v3/agent.cordis.yml +10 -4
- package/vibe-math-v3/vibe-math-v3.js +800 -11
- package/vibe-math-v4/agent.cordis.yml +12 -4
- package/vibe-math-v4/vibe-math-v4.js +793 -8
- package/vibe-math-v5/agent.cordis.yml +8 -4
- package/vibe-math-v5/vibe-math-v5.js +1116 -8
- package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +70 -1
package/README.en.md
CHANGED
|
@@ -725,6 +725,15 @@ The main agent `vibe_math_status`: in `qs/qs.json`, `q1` has been written back w
|
|
|
725
725
|
| `leanCommand` | `'lean'` | The Lean executable to run (e.g. `'lake'`) |
|
|
726
726
|
| `leanArgs` | `[]` | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
|
|
727
727
|
| `leanTimeoutMs` | `120000` | Upper limit for a single Lean run (milliseconds) |
|
|
728
|
+
| `finalPaper` | `true` | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
|
|
729
|
+
| `paperFormat` | `both` | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
|
|
730
|
+
| `paperLanguage` | `zh` | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
|
|
731
|
+
| `paperCompilePdf` | `true` | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
|
|
732
|
+
| `paperLatexCommand` | `''` | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
|
|
733
|
+
|
|
734
|
+
#### Final paper
|
|
735
|
+
|
|
736
|
+
All four presets have it **on by default**: after the closure signal fires and **before the run is marked complete**, the run enters the paper phase. In v2 a dedicated "paper writer" subagent assembles the concluded evidence into `Paper/<project>/{paper.md,paper.tex,paper.meta.json,paper.log.md}` (plus `paper.pdf` only when an engine is detected). Manual: `/vibe paper [lang=zh|en] [format=both|md|tex] [force]`. A PDF needs a LaTeX engine on the host (`xelatex` preferred for Chinese); with no engine or a failed compile the tex+md are still delivered with only a logged warning — the finalisation is never blocked and an existing pdf is never overwritten. Full contract: `docs/final-paper.md`.
|
|
728
737
|
|
|
729
738
|
### v3 (paper-style md + planner agent + method library) defaults
|
|
730
739
|
|
|
@@ -749,6 +758,15 @@ Added/adjusted on top of all v2 parameters:
|
|
|
749
758
|
| `leanCommand` | `'lean'` | The Lean executable to run (e.g. `'lake'`) |
|
|
750
759
|
| `leanArgs` | `[]` | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
|
|
751
760
|
| `leanTimeoutMs` | `120000` | Upper limit for a single Lean run (milliseconds) |
|
|
761
|
+
| `finalPaper` | `true` | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
|
|
762
|
+
| `paperFormat` | `both` | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
|
|
763
|
+
| `paperLanguage` | `zh` | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
|
|
764
|
+
| `paperCompilePdf` | `true` | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
|
|
765
|
+
| `paperLatexCommand` | `''` | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
|
|
766
|
+
|
|
767
|
+
#### Final paper
|
|
768
|
+
|
|
769
|
+
v3 uses the same switch and the same ordering as v2 (strict termination; the writer is spawned **before** the scheduler stops): a dedicated "paper writer" subagent produces `Paper/<project>/{paper.md,paper.tex,paper.meta.json,paper.log.md}` (plus `paper.pdf` when an engine is detected). Manual: `/vibe paper [lang=zh|en] [format=both|md|tex] [force]`. No engine or a failed compile still delivers tex+md, logs a warning and never blocks the finalisation. Full contract: `docs/final-paper.md`.
|
|
752
770
|
|
|
753
771
|
### v4 (resident self-organization · experimental) defaults
|
|
754
772
|
|
|
@@ -771,6 +789,16 @@ Adjustable via `vibe_v4_set` (persisted to `State/settings.json`):
|
|
|
771
789
|
| `leanCommand` | `'lean'` | The Lean executable to run (e.g. `'lake'`) |
|
|
772
790
|
| `leanArgs` | `[]` | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
|
|
773
791
|
| `leanTimeoutMs` | `120000` | Upper limit for a single Lean run (milliseconds) |
|
|
792
|
+
| `finalPaper` | `true` | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
|
|
793
|
+
| `paperFormat` | `both` | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
|
|
794
|
+
| `paperLanguage` | `zh` | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
|
|
795
|
+
| `paperCompilePdf` | `true` | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
|
|
796
|
+
| `paperLatexCommand` | `''` | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
|
|
797
|
+
| `paperEditor` | `office` | Who finalises: `office` (the session root / human side, default) or `resident:<id>` (if that resident has left, it degrades to office and the meta/log say so) |
|
|
798
|
+
|
|
799
|
+
#### Final paper
|
|
800
|
+
|
|
801
|
+
On by default; v4 enters the paper phase after the closing meeting casts its unanimous stop vote and **before** the run is marked complete. Team flow: each resident writes its own part → merge (deduplicate, unify terms and notation) → at least one **cross-review** round → the editor named by `paperEditor` (default `office`, or `resident:<id>`) turns it into the final draft → the paper is finalised only on **unanimous "deliverable"** (objections keep iterating; past the round cap a warning is recorded and the disagreement goes into the appendix). Manual: `/v4 paper [lang=] [format=] [editor=office|resident:<id>] [force]`. Output: `Paper/<run id>/{paper.md,paper.tex,paper.meta.json,paper.log.md}` (plus `paper.pdf` when an engine is available). Full contract: `docs/final-paper.md`.
|
|
774
802
|
|
|
775
803
|
### v5 (institute system · experimental) defaults
|
|
776
804
|
|
|
@@ -802,6 +830,16 @@ Adjustable via `vibe_v5_set` (persisted in the institute state file `State/<inst
|
|
|
802
830
|
| `leanCommand` | `'lean'` | The Lean executable to run (e.g. `'lake'`) |
|
|
803
831
|
| `leanArgs` | `[]` | Additional arguments inserted before the file name (e.g. `['env','lean']` together with `leanCommand='lake'`) |
|
|
804
832
|
| `leanTimeoutMs` | `120000` | Upper limit for a single Lean run (milliseconds) |
|
|
833
|
+
| `finalPaper` | `true` | **Final paper**: written automatically at closure (`false` disables only the automatic trigger; the manual command still works). Full contract: `docs/final-paper.md` |
|
|
834
|
+
| `paperFormat` | `both` | Which text versions to produce: `both` (md+tex) / `md` (skips compilation and must not warn about a missing tex) / `tex` |
|
|
835
|
+
| `paperLanguage` | `zh` | Paper language: `zh` (ctexart, engine prefers xelatex) / `en` (article, pdflatex first) |
|
|
836
|
+
| `paperCompilePdf` | `true` | Compile `paper.pdf` when a LaTeX engine is detected; with no engine or a failed compile, tex+md are still delivered and a warning is logged |
|
|
837
|
+
| `paperLatexCommand` | `''` | Force one LaTeX engine executable (empty = auto-detect per language: xelatex→latexmk→pdflatex→lualatex→tectonic) |
|
|
838
|
+
| `paperEditor` | `academician` | Who finalises: `academician` (default, the only editor an unattended run can reach) or `office` (manual `/v5 paper editor=office` only, and only after consulting the whole institute) |
|
|
839
|
+
|
|
840
|
+
#### Final paper
|
|
841
|
+
|
|
842
|
+
On by default; v5 enters the paper phase after `checkSolved` concludes the problem is solved and **before** the run is marked complete. The permanent staff and the academician write their own parts, merge them and cross-review; the editor is set by `paperEditor`: the **automatic flow always uses `academician`** (the office is the root session and has no wake path), while `office` is available only through the manual `/v5 paper editor=office`. That path requires the office to consult the whole institute first (>=1 `vibe_v5_message` plus >=1 `vibe_v5_meeting`), state the conclusion in the finalisation note, and then call `vibe_v5_finalize_paper`; without both counts it is refused (`V5_PAPER_CONSULT_REQUIRED`). Tools: `vibe_v5_paper`, `vibe_v5_finalize_paper`. Output: `Paper/<institute id>/{paper.md,paper.tex,paper.meta.json,paper.log.md}` (plus `paper.pdf` when an engine is available). Full contract: `docs/final-paper.md`.
|
|
805
843
|
|
|
806
844
|
Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (start work) → `vibe_v5_report` / `vibe_v5_status`; `vibe_v5_message` / `vibe_v5_meeting` / `vibe_v5_members` / `vibe_v5_hire` / `vibe_v5_fire` (temp worker) / `vibe_v5_add_researcher` / `vibe_v5_remove_researcher` (add/remove residents, institute office only) / `vibe_v5_pause` / `vibe_v5_resume` / `vibe_v5_stop`; slash command `/v5`.
|
|
807
845
|
|
|
@@ -825,8 +863,9 @@ Common controls: `vibe_v5_configure` (configure first) → `vibe_v5_start` (star
|
|
|
825
863
|
- **Four sets of Lean prompt corpora**: [`prompt-corpus-v2/formal-verify-v2.md`](prompt-corpus-v2/formal-verify-v2.md) · [`prompt-corpus-v3/formal-verify-v3.md`](prompt-corpus-v3/formal-verify-v3.md) · [`prompt-corpus-v4/formal-verify-v4.md`](prompt-corpus-v4/formal-verify-v4.md) (each covering off / encourage / **require** / fidelity branches / work rounds / receipt contract; the workspace is normalized to `<WS>` and the VibeMath root to `<VIBEMATH>`)
|
|
826
864
|
- **The persona source text of the four presets**: [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) (the prompts the main agent actually receives: which tools, which parameters, which slash subcommands; generated by `audit-persona-surface.test.mjs` and shipped with the package)
|
|
827
865
|
- **Lean formal verification (a contract shared by the four architectures)**: [`docs/formal-verification.md`](docs/formal-verification.md)
|
|
828
|
-
- **
|
|
829
|
-
- **
|
|
866
|
+
- **Final paper (a contract shared by the four architectures)**: [`docs/final-paper.md`](docs/final-paper.md) (the five parameters plus `paperEditor` on v4/v5, the "paper phase before the run is marked complete" ordering, the `Paper/<id>/` artifacts and the nine-section skeleton, LaTeX detection with repair-then-degrade, the v4/v5 team co-authoring flow and the v5 office-consultation rule)
|
|
867
|
+
- **Test timing baseline and parallel run recipes**: [`docs/test-timing.md`](docs/test-timing.md) (`node tests/run-tests.mjs` runs **every suite AND every probe** in parallel: `TOTAL 57` (39 suites + 18 probes/variants) in ≈3.5 min; which 18 of them ship in the package and which are repository-only is in §1.1 of that document; every runner prints its elapsed time/speedup so the next strategy can be chosen from data)
|
|
868
|
+
- **Static prompt-surface consistency (persona ↔ tool registry ↔ slash command hint/usage)**: [`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs) (208 assertions, and generates [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) for manual review) + [`audit-persona-sensitivity.mjs`](tests/audit-persona-sensitivity.mjs) (16 sensitivity probes) — guarding "every registered tool must appear in the persona / every name in the persona must really be registered / the `prefix` and `text` blocks must match line by line / hint, usage, and the actual branch must agree in all three places"
|
|
830
869
|
- **Mandatory checklist for a full review**: [`AUDIT-CHECKLIST.md`](docs/AUDIT-CHECKLIST.md) (this repository's mandatory audit process; §1.9 specifically checks "whether the tool parameter schema can accommodate them")
|
|
831
870
|
- **Prompt/interaction invariants (all four sets together, re-checkable in one command)**: [`audit-prompt-invariants.mjs`](tests/audit-prompt-invariants.mjs) (157 assertions) — encoding, one by one, "the classes of prompt/tool-surface defects that have really occurred historically" as static invariants (abbreviated tool names, projecting a fidelity defect as 0, `defect` written only in the prompt but not implemented, a receipt contract missing `defect`, passing without a note, wrong field names, the `off` tier still being able to write state in its receipt, uncertain corpora, missing probes, **a tool's closed schema that cannot accommodate the parameters in its own documentation**, **keys that the schema declares at the parameter level but silently drops**). Adding `--self-probe` injects these defect shapes in memory and requires the corresponding invariants to **turn red** while the unmutated control run **stays green** (5/5); the script itself additionally carries six self-checks X5–X8b (the comment scanner must recognize regex literals — including regexes **after a keyword** such as `return /…/` — `//` inside strings must be preserved, stripping comments must not change line structure, and the parse-level criterion that "the four sets of source, with comments stripped, must still parse under `node --check`")
|
|
832
871
|
- **Specification ↔ code traceability (all four sets together)**: [`audit-spec-traceability.mjs`](tests/audit-spec-traceability.mjs) (94 assertions) — tools promised in `实现方案.md`/README must really be registered; the four Lean parameters must be accepted by both the documentation and the code
|
package/README.md
CHANGED
|
@@ -726,6 +726,15 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
|
|
|
726
726
|
| `leanCommand` | `'lean'` | 要执行的 Lean 可执行文件(例:`'lake'`) |
|
|
727
727
|
| `leanArgs` | `[]` | 插在文件名之前的附加参数(例:`['env','lean']` 配合 `leanCommand='lake'`) |
|
|
728
728
|
| `leanTimeoutMs` | `120000` | 单次 Lean 运行的上限(毫秒) |
|
|
729
|
+
| `finalPaper` | `true` | **最终论文**:收口时自动撰写(`false` 只关自动触发,手动命令仍可用)。完整契约见 `docs/final-paper.md` |
|
|
730
|
+
| `paperFormat` | `both` | 论文产出格式:`both`(md+tex)/ `md`(跳过编译,且不报"缺 tex")/ `tex` |
|
|
731
|
+
| `paperLanguage` | `zh` | 论文语言:`zh`(ctexart,引擎优先 xelatex)/ `en`(article,pdflatex 优先) |
|
|
732
|
+
| `paperCompilePdf` | `true` | 检测到 LaTeX 时编译 `paper.pdf`;无引擎或编译失败则保留 tex+md 并记日志告警 |
|
|
733
|
+
| `paperLatexCommand` | `''` | 指定 LaTeX 引擎可执行文件(空 = 按语言自动探测 xelatex→latexmk→pdflatex→lualatex→tectonic) |
|
|
734
|
+
|
|
735
|
+
#### 最终论文(final paper)
|
|
736
|
+
|
|
737
|
+
四个预设都**默认开启**:收口判定命中后、**在 run 被标记完成之前**进入 paper 阶段。v2 由一名专职「论文撰写」子代理把已定论证据整理成 `Paper/<项目>/{paper.md,paper.tex,paper.meta.json,paper.log.md}`(检测到引擎时才有 `paper.pdf`)。手动:`/vibe paper [lang=zh|en] [format=both|md|tex] [force]`。PDF 需要宿主上有 LaTeX 引擎(中文优先 `xelatex`);没有引擎或编译失败时 tex+md 照常交付,只记日志告警——不阻塞定稿、不覆盖已有 pdf。完整契约见 `docs/final-paper.md`。
|
|
729
738
|
|
|
730
739
|
### v3(论文式 md + 规划代理 + 方法库)默认值
|
|
731
740
|
|
|
@@ -750,6 +759,15 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
|
|
|
750
759
|
| `leanCommand` | `'lean'` | 要执行的 Lean 可执行文件(例:`'lake'`) |
|
|
751
760
|
| `leanArgs` | `[]` | 插在文件名之前的附加参数(例:`['env','lean']` 配合 `leanCommand='lake'`) |
|
|
752
761
|
| `leanTimeoutMs` | `120000` | 单次 Lean 运行的上限(毫秒) |
|
|
762
|
+
| `finalPaper` | `true` | **最终论文**:收口时自动撰写(`false` 只关自动触发,手动命令仍可用)。完整契约见 `docs/final-paper.md` |
|
|
763
|
+
| `paperFormat` | `both` | 论文产出格式:`both`(md+tex)/ `md`(跳过编译,且不报"缺 tex")/ `tex` |
|
|
764
|
+
| `paperLanguage` | `zh` | 论文语言:`zh`(ctexart,引擎优先 xelatex)/ `en`(article,pdflatex 优先) |
|
|
765
|
+
| `paperCompilePdf` | `true` | 检测到 LaTeX 时编译 `paper.pdf`;无引擎或编译失败则保留 tex+md 并记日志告警 |
|
|
766
|
+
| `paperLatexCommand` | `''` | 指定 LaTeX 引擎可执行文件(空 = 按语言自动探测 xelatex→latexmk→pdflatex→lualatex→tectonic) |
|
|
767
|
+
|
|
768
|
+
#### 最终论文(final paper)
|
|
769
|
+
|
|
770
|
+
v3 与 v2 同一开关、同一时序(严格收口;**在调度器停止之前**派遣撰写者):专职「论文撰写」子代理产出 `Paper/<项目>/{paper.md,paper.tex,paper.meta.json,paper.log.md}`(检测到引擎时才有 `paper.pdf`)。手动:`/vibe paper [lang=zh|en] [format=both|md|tex] [force]`。无引擎或编译失败仍交付 tex+md、记警告、不阻塞定稿。完整契约见 `docs/final-paper.md`。
|
|
753
771
|
|
|
754
772
|
### v4(常驻自组织 · 实验)默认值
|
|
755
773
|
|
|
@@ -772,6 +790,16 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
|
|
|
772
790
|
| `leanCommand` | `'lean'` | 要执行的 Lean 可执行文件(例:`'lake'`) |
|
|
773
791
|
| `leanArgs` | `[]` | 插在文件名之前的附加参数(例:`['env','lean']` 配合 `leanCommand='lake'`) |
|
|
774
792
|
| `leanTimeoutMs` | `120000` | 单次 Lean 运行的上限(毫秒) |
|
|
793
|
+
| `finalPaper` | `true` | **最终论文**:收口时自动撰写(`false` 只关自动触发,手动命令仍可用)。完整契约见 `docs/final-paper.md` |
|
|
794
|
+
| `paperFormat` | `both` | 论文产出格式:`both`(md+tex)/ `md`(跳过编译,且不报"缺 tex")/ `tex` |
|
|
795
|
+
| `paperLanguage` | `zh` | 论文语言:`zh`(ctexart,引擎优先 xelatex)/ `en`(article,pdflatex 优先) |
|
|
796
|
+
| `paperCompilePdf` | `true` | 检测到 LaTeX 时编译 `paper.pdf`;无引擎或编译失败则保留 tex+md 并记日志告警 |
|
|
797
|
+
| `paperLatexCommand` | `''` | 指定 LaTeX 引擎可执行文件(空 = 按语言自动探测 xelatex→latexmk→pdflatex→lualatex→tectonic) |
|
|
798
|
+
| `paperEditor` | `office` | 定稿代表:`office`(会话根/人类侧,默认)或 `resident:<id>`(该 resident 已离职则降级 office 并在 meta/log 记明) |
|
|
799
|
+
|
|
800
|
+
#### 最终论文(final paper)
|
|
801
|
+
|
|
802
|
+
默认开启;v4 在一致性会议投出「一致停止」票后、**标记完成之前**进入 paper 阶段。团队流程:各 resident 写自己库里的部分 → 合并(去重、统一术语与记号)→ 至少一轮**交叉互审** → 定稿代表按 `paperEditor`(默认 `office`,或 `resident:<id>`)梳理成最终稿 → **全体明确"可交付"**才定稿(有反对则继续迭代,超轮次上限记警告并把分歧写进附录)。手动:`/v4 paper [lang=] [format=] [editor=office|resident:<id>] [force]`。产物 `Paper/<run id>/{paper.md,paper.tex,paper.meta.json,paper.log.md}`(引擎可用时另有 `paper.pdf`)。完整契约见 `docs/final-paper.md`。
|
|
775
803
|
|
|
776
804
|
### v5(研究所体系 · 实验)默认值
|
|
777
805
|
|
|
@@ -803,6 +831,16 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
|
|
|
803
831
|
| `leanCommand` | `'lean'` | 要执行的 Lean 可执行文件(例:`'lake'`) |
|
|
804
832
|
| `leanArgs` | `[]` | 插在文件名之前的附加参数(例:`['env','lean']` 配合 `leanCommand='lake'`) |
|
|
805
833
|
| `leanTimeoutMs` | `120000` | 单次 Lean 运行的上限(毫秒) |
|
|
834
|
+
| `finalPaper` | `true` | **最终论文**:收口时自动撰写(`false` 只关自动触发,手动命令仍可用)。完整契约见 `docs/final-paper.md` |
|
|
835
|
+
| `paperFormat` | `both` | 论文产出格式:`both`(md+tex)/ `md`(跳过编译,且不报"缺 tex")/ `tex` |
|
|
836
|
+
| `paperLanguage` | `zh` | 论文语言:`zh`(ctexart,引擎优先 xelatex)/ `en`(article,pdflatex 优先) |
|
|
837
|
+
| `paperCompilePdf` | `true` | 检测到 LaTeX 时编译 `paper.pdf`;无引擎或编译失败则保留 tex+md 并记日志告警 |
|
|
838
|
+
| `paperLatexCommand` | `''` | 指定 LaTeX 引擎可执行文件(空 = 按语言自动探测 xelatex→latexmk→pdflatex→lualatex→tectonic) |
|
|
839
|
+
| `paperEditor` | `academician` | 定稿代表:`academician`(默认,无人值守也能完成)或 `office`(仅手动 `/v5 paper editor=office`,须先与全所交流 + 开会) |
|
|
840
|
+
|
|
841
|
+
#### 最终论文(final paper)
|
|
842
|
+
|
|
843
|
+
默认开启;v5 在 `checkSolved` 判定「已解决」后、**标记完成之前**进入 paper 阶段。常驻研究员与院士各自写、合并、交叉互审,定稿代表由 `paperEditor` 决定:**自动流程固定用 `academician`**(所办是根会话,没有唤醒路径);`office` 只能通过手动 `/v5 paper editor=office` 选择,此时**所办必须先与全所交流、商讨、优化、审查**(≥1 条 `vibe_v5_message` + ≥1 次 `vibe_v5_meeting`),把结论写进定稿说明,再调用 `vibe_v5_finalize_paper`;缺一即被拒(`V5_PAPER_CONSULT_REQUIRED`)。工具入口:`vibe_v5_paper`、`vibe_v5_finalize_paper`。产物 `Paper/<研究所 id>/{paper.md,paper.tex,paper.meta.json,paper.log.md}`(引擎可用时另有 `paper.pdf`)。完整契约见 `docs/final-paper.md`。
|
|
806
844
|
|
|
807
845
|
常用控制:`vibe_v5_configure`(先配置)→ `vibe_v5_start`(开工)→ `vibe_v5_report` / `vibe_v5_status`;`vibe_v5_message` / `vibe_v5_meeting` / `vibe_v5_members` / `vibe_v5_hire` / `vibe_v5_fire`(临时工)/ `vibe_v5_add_researcher` / `vibe_v5_remove_researcher`(增删常驻,仅所办)/ `vibe_v5_pause` / `vibe_v5_resume` / `vibe_v5_stop`;斜杠命令 `/v5`。
|
|
808
846
|
|
|
@@ -826,8 +864,9 @@ v5 的完整架构(含成员生命周期、一轮时序、共识状态机、
|
|
|
826
864
|
- **四套 Lean 提示词语料**:[`prompt-corpus-v2/formal-verify-v2.md`](prompt-corpus-v2/formal-verify-v2.md) · [`prompt-corpus-v3/formal-verify-v3.md`](prompt-corpus-v3/formal-verify-v3.md) · [`prompt-corpus-v4/formal-verify-v4.md`](prompt-corpus-v4/formal-verify-v4.md)(各自覆盖 off / encourage / **require** / 忠实性分支 / 工作轮 / 回执契约;工作区归一化为 `<WS>`、VibeMath 根为 `<VIBEMATH>`)
|
|
827
865
|
- **四个预设的 persona 原文**:[`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md)(主代理实际收到的提示词:有哪些工具、哪些参数、哪些斜杠子命令;由 `audit-persona-surface.test.mjs` 生成,随包发布)
|
|
828
866
|
- **Lean 形式化验证(四架构共用契约)**:[`docs/formal-verification.md`](docs/formal-verification.md)
|
|
829
|
-
-
|
|
830
|
-
-
|
|
867
|
+
- **最终论文(四架构共用契约)**:[`docs/final-paper.md`](docs/final-paper.md)(五个参数与 v4/v5 的 `paperEditor`、收口顺序"先论文后完成"、`Paper/<id>/` 产物与 9 节骨架、LaTeX 检测顺序与"先修复后降级"、v4/v5 团队合写流程与 v5 所办咨询规则)
|
|
868
|
+
- **测试耗时基线与并行跑法**:[`docs/test-timing.md`](docs/test-timing.md)(`node tests/run-tests.mjs` 并行跑**全部套件 + 全部探针**:`TOTAL 57`(39 套件 + 18 探针/变体)≈3.5 min;哪 18 项随包发布、哪些仅仓库见该文档 §1.1;每个 runner 都会打印耗时/加速比供下次选策略)
|
|
869
|
+
- **静态提示词面一致性(persona ↔ 工具注册表 ↔ 斜杠命令 hint/usage)**:[`audit-persona-surface.test.mjs`](tests/audit-persona-surface.test.mjs)(208 条断言,并生成 [`prompt-corpus-persona/persona-corpus.md`](prompt-corpus-persona/persona-corpus.md) 供人工复核)+ [`audit-persona-sensitivity.mjs`](tests/audit-persona-sensitivity.mjs)(16 条灵敏度探针)——守"注册的工具必须在 persona 里出现 / persona 里的名字必须真的注册 / `prefix` 与 `text` 两块逐行一致 / hint、usage、实际分支三处必须一致"
|
|
831
870
|
- **全面检查必查清单**:[`AUDIT-CHECKLIST.md`](docs/AUDIT-CHECKLIST.md)(本仓库的强制审计流程;§1.9 专门查"工具参数 schema 收不收得下")
|
|
832
871
|
- **提示词/交互不变式(四套一起,可一键复核)**:[`audit-prompt-invariants.mjs`](tests/audit-prompt-invariants.mjs)(157 条断言)——把"历史上真实发生过的提示词/工具面缺陷类别"逐条编码成静态不变式(缩写工具名、把忠实性缺陷投成 0、`defect` 只写在提示词里没实现、回执契约缺 `defect`、无 note 放行、字段名错、`off` 档回执仍能写状态、语料不确定、探针缺失、**工具的封闭 schema 收不下它自己文档里的参数**、**schema 声明了参数层却静默丢弃的键**)。加 `--self-probe` 会在内存里注入这些缺陷形状,要求对应不变式**变红**、未变异的对照跑**仍为绿**(5/5);脚本自身另带 X5–X8b 六条自检(注释扫描器必须认正则字面量——包括 `return /…/ ` 这种**关键字后面**的正则——字符串里的 `//` 必须保留、抹注释不改变行结构,以及"四套源码抹掉注释后仍必须能被 `node --check` 解析"这条解析级判据)
|
|
833
872
|
- **规格 ↔ 代码可追溯(四套一起)**:[`audit-spec-traceability.mjs`](tests/audit-spec-traceability.mjs)(94 条断言)——`实现方案.md`/README 里承诺的工具必须真的注册;四个 Lean 参数必须同时被文档与代码接受
|
package/cordis.patch.yml
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
- vibe_math_status / vibe_math_report — read scheduler status / full progress report (report also writes Progress_Logs/report.json).
|
|
71
71
|
- vibe_math_pause / vibe_math_abort — pause / abort (abort interrupts all children).
|
|
72
72
|
- vibe_math_set_mode {mode: manual|auto} — switch manual / auto control.
|
|
73
|
-
- vibe_math_set_params {...} — tune any parameter (see vibe_math_setup for the full schema; e.g. reportMode file|push|both, promoteValueThreshold, verdictMode flat|forced, formalVerify off|encourage|require).
|
|
73
|
+
- vibe_math_set_params {...} — tune any parameter (see vibe_math_setup for the full schema; e.g. reportMode file|push|both, promoteValueThreshold, verdictMode flat|forced, formalVerify off|encourage|require, finalPaper true|false, paperFormat both|md|tex, paperLanguage zh|en, paperCompilePdf true|false, paperLatexCommand <engine>).
|
|
74
74
|
- vibe_math_setup / vibe_math_save_settings / vibe_math_template — guided configuration / persist defaults / generate template.
|
|
75
75
|
- vibe_math_new_project / vibe_math_set_project / vibe_math_list_projects — per-project folders.
|
|
76
76
|
- vibe_math_list_decisions / vibe_math_decide {id, action: approve|reject|override, verdict?} — resolve manual decisions.
|
|
@@ -79,7 +79,12 @@
|
|
|
79
79
|
verification (execute / archive / list the reuse library). The scheduler's child agents
|
|
80
80
|
use them too; they work in every mode.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Final paper: strict termination writes Paper/<project>/{paper.md,paper.tex,paper.pdf,paper.meta.json,paper.log.md}
|
|
83
|
+
automatically — a dedicated paper-writing child assembles the solved material (finalPaper=false disables only that
|
|
84
|
+
automatic run). /vibe paper [lang=zh|en] [format=both|md|tex] [force] writes or rewrites it by hand. md/tex follow
|
|
85
|
+
paperFormat; a PDF is produced only when a LaTeX engine is detected and paperCompilePdf is true.
|
|
86
|
+
A /vibe slash command mirrors the main controls (/vibe start|resume|pause|abort|status|report|mode <auto|manual>|setup|save|template [global|project]|add <id> <desc>|add-proposition <id> <概述>|list-propositions|project [list|new <name>|<name>]|decisions|agents|paper [lang=zh|en] [format=both|md|tex] [force]).
|
|
87
|
+
Data lives under {{cwd}}/VibeMath/Projects/<project>/
|
|
83
88
|
(qs/qs.json, Propos/<分类>_Propos.json, Reliable/, Verified/, Verification_logs/, Progress_Logs/, VibeMath_State/)
|
|
84
89
|
and survives restarts via vibe_math_resume.
|
|
85
90
|
|
|
@@ -341,7 +346,10 @@
|
|
|
341
346
|
plannerEnabled/plannerProvider/plannerModel/plannerPersona, planMinIntervalMs, plannerMaxFails,
|
|
342
347
|
methodKeepIntervalMs/methodKeepEvery, methodAutoPromote, indexAutoRebuild, projectLockTimeoutMs,
|
|
343
348
|
formalVerify/leanCommand/leanArgs/leanTimeoutMs — Lean 形式化验证(off = 默认不额外要求,
|
|
344
|
-
encourage = 按实现难度自行形式化、Lean 通过后审查对象变为忠实性,require =
|
|
349
|
+
encourage = 按实现难度自行形式化、Lean 通过后审查对象变为忠实性,require = 同上并加结论门禁),
|
|
350
|
+
finalPaper/paperFormat/paperLanguage/paperCompilePdf/paperLatexCommand — 最终论文(收口时自动派遣
|
|
351
|
+
「论文撰写」子代理,把已收口的解法/命题/成果整理成 Paper/<project>/;finalPaper=false 只关自动触发,
|
|
352
|
+
/vibe paper 仍可手动触发)。
|
|
345
353
|
- vibe_math_setup / vibe_math_save_settings / vibe_math_template — guided configuration / persist defaults / generate template.
|
|
346
354
|
- vibe_math_plan {force?} — show queued plan / last plan, or force a planning round.
|
|
347
355
|
- vibe_math_index — rebuild State/index.json from the Markdown knowledge base.
|
|
@@ -356,7 +364,7 @@
|
|
|
356
364
|
use them too; they work in every mode.
|
|
357
365
|
|
|
358
366
|
A /vibe slash command mirrors the main controls (/vibe start [override]|resume [override]|pause|abort|status|report|mode
|
|
359
|
-
<auto|manual>|setup|save|add <id> <desc>|add-proposition <id> <概述>|list-propositions|methods|index|plan|lock
|
|
367
|
+
<auto|manual>|setup|save|template [global|project]|add <id> <desc>|add-proposition <id> <概述>|list-propositions|methods|index|plan|lock|project [list|new <name>|<name>]|decisions|agents|paper [lang=zh|en] [format=both|md|tex] [force]).
|
|
360
368
|
Data survives restarts via vibe_math_resume.
|
|
361
369
|
|
|
362
370
|
Key rules when reporting: a problem is "solved" when one of its 解法候选 entries reaches 概率 = 1
|
|
@@ -627,7 +635,7 @@
|
|
|
627
635
|
Main controls (recommended flow: configure FIRST, then start):
|
|
628
636
|
- vibe_v4_configure {project?, problem?, params?} — create/configure the project (name, problem, params) WITHOUT starting a run; set everything here first.
|
|
629
637
|
- vibe_v4_start {problem?, residentCount?, seedDirections?} — begin the run (spawn residents, brainstorm). If problem was configured, omit it.
|
|
630
|
-
- vibe_v4_set {residentCount, compactThreshold, compactAfterRounds, meetingKeepEvery, maxParallel, activityTimeoutMs, stallAutoMeetingMs, verdictMaxRounds, provider, model, residentPersona, toolAllow, toolDeny, formalVerify, leanCommand, leanArgs, leanTimeoutMs} — tune params (persisted to the settings file). provider/model override the residents' LLM route (empty = they inherit YOUR model/provider); toolAllow/toolDeny are per-resident tool permissions (empty = they inherit all tools). stallAutoMeetingMs is the stalled-group auto-sync-meeting threshold (分级保活 B). formalVerify (off|encourage|require, default off) enables Lean formal verification; leanCommand/leanArgs/leanTimeoutMs configure the toolchain.
|
|
638
|
+
- vibe_v4_set {residentCount, compactThreshold, compactAfterRounds, meetingKeepEvery, maxParallel, activityTimeoutMs, stallAutoMeetingMs, verdictMaxRounds, provider, model, residentPersona, toolAllow, toolDeny, formalVerify, leanCommand, leanArgs, leanTimeoutMs, finalPaper, paperFormat, paperLanguage, paperCompilePdf, paperEditor, paperLatexCommand} — tune params (persisted to the settings file). provider/model override the residents' LLM route (empty = they inherit YOUR model/provider); toolAllow/toolDeny are per-resident tool permissions (empty = they inherit all tools). stallAutoMeetingMs is the stalled-group auto-sync-meeting threshold (分级保活 B). formalVerify (off|encourage|require, default off) enables Lean formal verification; leanCommand/leanArgs/leanTimeoutMs configure the toolchain. The FINAL PAPER is tuned by finalPaper (true|false, default true), paperFormat (both|md|tex), paperLanguage (zh|en), paperCompilePdf (true|false), paperEditor (office|resident:<id>, default office = the human/assistant side finalises) and paperLatexCommand.
|
|
631
639
|
- vibe_v4_resume / vibe_v4_pause / vibe_v4_abort / vibe_v4_status / vibe_v4_report.
|
|
632
640
|
- vibe_v4_message {to|all, content} — inject a message to a resident (human/assistant intervention).
|
|
633
641
|
- vibe_v4_meeting {agenda} — force a meeting.
|
|
@@ -638,7 +646,11 @@
|
|
|
638
646
|
- vibe_v4_formal_report — human-readable Lean formal-verification mirror (mode, Lean-passed
|
|
639
647
|
objects, recorded blockers, formalization TODO, library paths).
|
|
640
648
|
- vibe_v4_prompts {which: brainstorm|normal|heartbeat|meeting|verify|coreRules, member?, target?, stage?} — read the exact prompt text a resident would receive (prompt auditing; prompt text is the product).
|
|
641
|
-
A /v4 slash command mirrors the main controls (configure|start [problem]|resume|pause|abort|status|report|message <to|all> <content>|meeting|members|add|remove|set <k=v>...).
|
|
649
|
+
A /v4 slash command mirrors the main controls (configure|start [problem]|resume|pause|abort|status|report|message <to|all> <content>|meeting|paper [lang=zh|en] [format=md|tex|both] [editor=office|resident:<id>] [force]|members|add|remove|set <k=v>...).
|
|
650
|
+
Final paper: after the unanimous stop vote the run enters a PAPER phase — every resident writes their part, each
|
|
651
|
+
cross-reviews at least one other part, and the paperEditor finalises (office = the human/assistant side, or one named
|
|
652
|
+
resident); only then is the run marked complete. finalPaper=false skips the phase; /v4 paper [lang=zh|en]
|
|
653
|
+
[format=md|tex|both] [editor=office|resident:<id>] [force] starts or re-runs it by hand.
|
|
642
654
|
|
|
643
655
|
TRUST RULE: only Verified/ (and Propos/ entries marked 已验证·真/假) are absolutely
|
|
644
656
|
trustworthy; everything else — unverified resident claims, Progress/, Method claims —
|
|
@@ -941,17 +953,19 @@
|
|
|
941
953
|
Main controls (recommended flow: configure FIRST, then start):
|
|
942
954
|
- vibe_v5_configure {project?, institute?, problem?, params?} — create/configure the institute WITHOUT starting it.
|
|
943
955
|
- vibe_v5_start {problem?, researcherCount?, academician?, seedDirections?} — found the institute (academician + researchers) and begin.
|
|
944
|
-
- vibe_v5_set {…} — tune params (persisted). provider/model override staff LLM routes (empty = inherit YOUR route); toolAllow/toolDeny restrict staff tools.
|
|
956
|
+
- vibe_v5_set {…} — tune params (persisted). provider/model override staff LLM routes (empty = inherit YOUR route); toolAllow/toolDeny restrict staff tools; finalPaper/paperFormat/paperLanguage/paperCompilePdf/paperEditor/paperLatexCommand tune the FINAL PAPER.
|
|
945
957
|
- vibe_v5_pause / vibe_v5_resume / vibe_v5_stop / vibe_v5_status / vibe_v5_report.
|
|
946
958
|
- vibe_v5_message {to|all, content} — relay a human message into the institute.
|
|
947
959
|
- vibe_v5_meeting {agenda, kind} — convene a meeting.
|
|
948
960
|
- vibe_v5_members — roster (office/employer/status/direction).
|
|
949
961
|
- vibe_v5_hire / vibe_v5_fire — temp workers: hire one (office, academician or a permanent researcher) / dismiss one for real.
|
|
950
962
|
- vibe_v5_add_researcher / vibe_v5_remove_researcher — OFFICE only: add or dismiss a PERMANENT researcher (the academician can only propose those).
|
|
963
|
+
- vibe_v5_paper {lang?, format?, editor?, force?} — write the FINAL PAPER: the permanent staff write their own parts, cross-review each other, then the editor finalises. lang/format/editor override this one paper only.
|
|
964
|
+
- vibe_v5_finalize_paper {decision, note, conclusion?} — OFFICE only when paperEditor=office: consult the institute first (>=1 office message + >=1 meeting), then finalise and put the conclusion in note.
|
|
951
965
|
- vibe_v5_lean_run / vibe_v5_lean_archive / vibe_v5_lean_lib — Lean formal
|
|
952
966
|
verification (execute / archive / list the reuse library). Members use them
|
|
953
967
|
too; they work in every mode.
|
|
954
|
-
A /v5 slash command mirrors these (configure|start|resume|pause|stop|status|report|members|message|meeting|hire|fire|add|remove|set).
|
|
968
|
+
A /v5 slash command mirrors these (configure|start|resume|pause|stop|status|report|members|message|meeting|hire|fire|add|remove|set|paper).
|
|
955
969
|
|
|
956
970
|
LEAN FORMAL VERIFICATION (formalVerify, a tunable parameter):
|
|
957
971
|
- 'off' (default, no extra requirement) | 'encourage' (members decide by
|
package/docs/AUDIT-CHECKLIST.md
CHANGED
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
- [ ] 人设里写的路径/模式名(`Formal/Lib`、`off|encourage|require`)是否与实现中的字符串**逐字**一致?
|
|
96
96
|
|
|
97
97
|
`audit-persona-surface.test.mjs` 把上述各条变成断言("未文档化工具"用**显式快照**表示:
|
|
98
|
-
新增工具必须主动改快照、或在 persona 里写清);`audit-persona-sensitivity.mjs` 用
|
|
98
|
+
新增工具必须主动改快照、或在 persona 里写清);`audit-persona-sensitivity.mjs` 用 16 条探针
|
|
99
99
|
证明这套断言真的会变红。**v2.3.0 修的就是这一类缺陷**:三个 `*_lean_*` 工具无条件注册,
|
|
100
100
|
而 v2/v3/v4 的 persona 从未列出它们(只有 v5 列了),v4 的 `vibe_v4_set` 参数表也漏了
|
|
101
101
|
`formalVerify`/`leanCommand`/`leanArgs`/`leanTimeoutMs`——当时**所有既有套件全绿**。
|
|
@@ -217,7 +217,7 @@ v2/v3/v4/v5 是**同构实现**(同一份契约、四份独立代码,刻意
|
|
|
217
217
|
**逐行比对**(`_oneoff/layout-invariance.mjs`);③ 相对链接扫描 0 失效(`_oneoff/scan-links.mjs`)。
|
|
218
218
|
- [ ] 讲"全套件 / 门禁 / 多少次全绿"时,是否区分了**随包发布面**与**仓库**?`package.json` 的 `files`
|
|
219
219
|
只发 `tests/` 的 **18 项**(其中 `.test.mjs` **10** 个),完整门禁(`node tests/run-tests.mjs`,
|
|
220
|
-
Round B 起 **
|
|
220
|
+
Round B 起 **57 项 = 39 套件 + 18 探针/变体**)只在开发检出里成立。两边的清单见
|
|
221
221
|
`docs/test-timing.md` §1.1;发布物里的 runner 会把缺失/跳过项**打印出来**(不会静默少跑),
|
|
222
222
|
所以"安装用户照文档跑得到全套件"这类说法必须避免。
|
|
223
223
|
- [ ] **runner 本身也要跑一遍**:直接跑套件通过 ≠ 并行 runner 通过(2.3.13 就出现过
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# 最终论文(final paper)——四套预设的统一契约
|
|
2
|
+
|
|
3
|
+
> **这是随包发布的绑定契约。** v2 / v3 / v4 / v5 四个预设的 final-paper 参数、命令、触发时序、
|
|
4
|
+
> 产物与守卫都以本文为准;`实现方案.md` 与工具描述是它的实现说明,冲突时以本文为准。
|
|
5
|
+
>
|
|
6
|
+
> 本文由**用户已确认的规格**(仓库外的 `_oneoff/spec-final-paper.md`)与其后的**设计审计修订**
|
|
7
|
+
> (`_oneoff/spec-final-paper-v2-amendments.md`)合并而成。两份原始文件不在发布物里,所以契约
|
|
8
|
+
> 现在落在仓库内;两者冲突处以**修订**为准,合并时不做美化——修订推翻 v1 的地方在下面写明。
|
|
9
|
+
>
|
|
10
|
+
> 实现位置:v2/v3 的 paper 段(`/vibe paper`)、`vibe-math-v4.js` 的 paper 流程(`/v4 paper`)、
|
|
11
|
+
> `vibe-math-v5.js` 的 paper 流程(`/v5 paper` + `vibe_v5_paper` / `vibe_v5_finalize_paper`)。
|
|
12
|
+
|
|
13
|
+
## 1. 一句话
|
|
14
|
+
|
|
15
|
+
四个预设都**默认开启**最终论文:当各自的收口信号命中时,**先进入 paper 阶段,论文完成(或降级结束)
|
|
16
|
+
之后才把这次 run 标记为完成**。论文只整理已有证据,产物落在 `Paper/<运行或研究所 id>/`,
|
|
17
|
+
文本版永远交付,PDF 只在宿主真的检测到 LaTeX 引擎时才尝试编译。
|
|
18
|
+
|
|
19
|
+
## 2. 参数
|
|
20
|
+
|
|
21
|
+
参数进入各预设既有的参数体系(`setParams` 工具的 schema + 帮助文本 + 命令 hint),默认值如下:
|
|
22
|
+
|
|
23
|
+
| 参数 | 类型 | 默认 | 作用域 | 说明 |
|
|
24
|
+
|---|---|---|---|---|
|
|
25
|
+
| `finalPaper` | boolean | `true` | 四套 | 收口时是否**自动**撰写最终论文。`false` 只关自动触发,手动命令仍可用(返回里会写明"自动已关闭") |
|
|
26
|
+
| `paperFormat` | enum `both`\|`md`\|`tex` | `both` | 四套 | 产出哪几种文本版本;`md` 不产出 tex、因此跳过编译,且**不得**报"缺 tex"警告 |
|
|
27
|
+
| `paperLanguage` | enum `zh`\|`en` | `zh` | 四套 | 论文语言,同时决定 LaTeX 模板(`ctexart`/`article`)与引擎优先顺序 |
|
|
28
|
+
| `paperCompilePdf` | boolean | `true` | 四套 | 检测到 LaTeX 时是否编译 `paper.pdf` |
|
|
29
|
+
| `paperLatexCommand` | string | `''` | 四套 | 强制指定**一个**引擎可执行文件;空 = 按语言自动探测。指定但解析不到时按"未检测到"降级 |
|
|
30
|
+
| `paperEditor` | enum | v4 `office`;v5 `academician` | **仅 v4/v5** | 定稿代表。v4:`office`(会话根/人类侧)或 `resident:<id>`;v5:`academician` 或 `office`(见 §7) |
|
|
31
|
+
|
|
32
|
+
归一化:**枚举**的非法值一律回退到上表默认值(绝不回退到更强的档位);**未知键不会直通参数层**
|
|
33
|
+
(v2/v3 的参数归一化只遍历已知默认键,v4 把被忽略的键列在返回的 `ignored` 里,v5 的 set-schema 是闭集,
|
|
34
|
+
新键必须同时进闭集与枚举校验,参照 `quorumMode`)。**boolean** 接受 `true`/`false`;v4/v5 另外接受
|
|
35
|
+
`1/0/yes/no/on/off` 等拼写——命令行的 `k=v` 传的是原始字符串,`'false'` 必须真的变成 `false`,
|
|
36
|
+
不能保持真值;v2/v3 只接受真正的 JSON boolean,其余值回退默认。
|
|
37
|
+
|
|
38
|
+
## 3. 自动触发:用**真实的**收口信号,且先论文、后完成
|
|
39
|
+
|
|
40
|
+
各预设的收口信号以代码中的精确分支为准(v1 规格曾写成"更强的完整性判据",那会永不触发;此处按修订修正):
|
|
41
|
+
|
|
42
|
+
- **v2**:严格终止(任务清空且无在途)。**「论文撰写」子代理本身不计入"在途"**——否则撰写者会阻止收口。
|
|
43
|
+
- **v3**:`checkTermination` 的完整收口分支;真实的完整性判据是 `leftoverVerify`(不是"`Verified/` 全覆盖")。
|
|
44
|
+
- **v4**:一致性会议的**一致停止票**(`finalizeMeeting` 的 `allSolved` 分支);该分支会忽略并清空待验证对象与邮箱。
|
|
45
|
+
- **v5**:`checkSolved` 在**每一次解题票**上判定(不要求 verify/meeting 前置)。
|
|
46
|
+
|
|
47
|
+
**时序(修订 §A,HIGH)**:论文阶段必须发生在"标记完成"**之前**。收口分支一旦同时置
|
|
48
|
+
`running=false; autoDone=true`(v4)或 `phase='solved'`(v5),`startMeeting` / `wakeIfIdle` /
|
|
49
|
+
`onResidentEnd` / `scheduleNext` 都会拒绝,团队就再也无法合写与互审。因此:
|
|
50
|
+
|
|
51
|
+
- v4 在 `finalizeMeeting` 的 `allSolved` 分支内、v5 在 `checkSolved` 与 `finishRun` 之间**拦截**,
|
|
52
|
+
先进入 paper 阶段,用既有的会议/唤醒机制完成合写与审稿,论文结束(或降级结束)后才真正置完成标志;
|
|
53
|
+
- v2/v3 **在停止翻转之前**派遣「论文撰写」子代理(`scheduler.running=false` 之后 `scheduleTick()` 是空操作,
|
|
54
|
+
而且 v2/v3 没有激活上限处理,被拒/失败的撰写者会静默消失)。
|
|
55
|
+
|
|
56
|
+
**幂等**:同一 run 只写一次。`paper.meta.json` 记 `finalizedAt`;重复触发**只补写缺失产物**。
|
|
57
|
+
`finalPaper=false` 只关闭上面这条自动路径。
|
|
58
|
+
|
|
59
|
+
## 4. 手动命令
|
|
60
|
+
|
|
61
|
+
| 预设 | 命令 | 说明 |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| v2 / v3 | `/vibe paper [lang=zh\|en] [format=both\|md\|tex] [force]` | 单作者流程 |
|
|
64
|
+
| v4 | `/v4 paper [lang=zh\|en] [format=both\|md\|tex] [editor=office\|resident:<id>] [force]` | 团队流程,`editor=` 只作用于本次 |
|
|
65
|
+
| v5 | `/v5 paper [lang=zh\|en] [format=both\|md\|tex] [editor=office\|academician] [force]` | 团队流程;`editor=office` 走人工定稿路径(§7) |
|
|
66
|
+
|
|
67
|
+
- 命令行覆盖只作用于**本次**调用,不写回持久参数(v5 的 `editor=` 是一次性的)。
|
|
68
|
+
- 非法参数一律 `kind:'error'`(绝不静默成功);`force` 重写已定稿的论文。
|
|
69
|
+
- v5 另有工具入口 `vibe_v5_paper`(与命令同义)与 `vibe_v5_finalize_paper`(所办定稿)。
|
|
70
|
+
|
|
71
|
+
## 5. 产物
|
|
72
|
+
|
|
73
|
+
目录:`Paper/<运行或研究所 id>/`(id 经各预设既有的 `slugify`/`safeId`/`idSafe` 归一化,
|
|
74
|
+
所有路径经同一个 `Paper/` 构造器,只写这个目录内,不污染 `Verified/`、`State/`)。
|
|
75
|
+
|
|
76
|
+
| 文件 | 何时出现 |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `paper.md` | `paperFormat` 含 `md`(`both`/`md`) |
|
|
79
|
+
| `paper.tex` | `paperFormat` 含 `tex`(`both`/`tex`) |
|
|
80
|
+
| `paper.pdf` | 仅在编译器**真的跑通**时出现 |
|
|
81
|
+
| `paper.meta.json` | 总是:参数、触发原因、运行 id、`finalizedAt`、编译状态与引擎、v5 的咨询计数等 |
|
|
82
|
+
| `paper.log.md` | 总是:谁写了什么、谁提了什么意见、如何采纳(人读审计链) |
|
|
83
|
+
|
|
84
|
+
宿主 fs 只支持**文本写**(没有 `writeBytes`),所以 `paper.pdf` **只能由编译器子进程**在论文目录内产生,
|
|
85
|
+
插件只做存在性校验,绝不自己写二进制,也**绝不覆盖已存在的 pdf**。
|
|
86
|
+
|
|
87
|
+
## 6. 论文骨架(四套一致,9 节)
|
|
88
|
+
|
|
89
|
+
1. 标题、作者(预设名 + 运行/研究所标识)、日期、摘要(原问题 + 主要结论)
|
|
90
|
+
2. 引言与问题背景(原问题的完整陈述)
|
|
91
|
+
3. **原问题的完整解法**(最终答案 + 完整推理链)
|
|
92
|
+
4. **已检验通过的命题**(逐条列出,含判定为真的估计值与证据来源)
|
|
93
|
+
5. **已解决的子问题 / 中间成果**
|
|
94
|
+
6. **创造或发现的有价值之物**:方法、理论、思想、有价值经验、数学理解
|
|
95
|
+
7. **规律总结**(从上述条目归纳出的可复用规律)
|
|
96
|
+
8. 讨论、局限与展望
|
|
97
|
+
9. 附录:证据与文件索引(`Verified/`、`Logs/`、关键卡片路径)
|
|
98
|
+
|
|
99
|
+
写法要求:只写有证据支撑的内容;**未决 / 被否证的条目必须显式标注**;不得编造。
|
|
100
|
+
|
|
101
|
+
## 7. 写作流程
|
|
102
|
+
|
|
103
|
+
**v2 / v3(单作者)**:派遣一名专职「论文撰写」子代理,输入 = 汇总材料(命题 / 子问题 / 成果 /
|
|
104
|
+
规律线索 + 证据索引),产出 = 完整 md 正文(含 tex 用的结构标记);插件负责落盘 md/tex 与编译。
|
|
105
|
+
|
|
106
|
+
**v4 / v5(团队合写)**:
|
|
107
|
+
|
|
108
|
+
1. 各自写自己负责的部分(v4:各 resident 写自己库里的内容;v5:各常驻研究员/院士写自己负责的部分);
|
|
109
|
+
2. **合并**(去重、统一术语、统一符号);
|
|
110
|
+
3. **互检/审稿**:至少一轮交叉审阅(每人审他人的部分,指出问题并优化);
|
|
111
|
+
4. **定稿**:定稿代表按 `paperEditor` 梳理成最终稿;
|
|
112
|
+
5. **一致认同**才定稿:所有参与成员明确表示"可交付";有反对则继续迭代(有轮次上限,超限记警告并把分歧写进附录)。
|
|
113
|
+
|
|
114
|
+
定稿代表:
|
|
115
|
+
|
|
116
|
+
- **v4**:`paperEditor` 默认 `office`(= 会话根 / 人类侧;`facilitator` 不在编制里、没有 LLM,不能当作作者),
|
|
117
|
+
另可选 `resident:<id>`。指定的 resident 已离职时**降级到 office** 并在 `paper.meta.json` 与 `paper.log.md` 记明。
|
|
118
|
+
- **v5**:`paperEditor` 默认 `academician` —— 这是**无人值守也能完成**的路径(所办是根会话,没有唤醒路径,
|
|
119
|
+
自动收口触发必须用院士)。`office` 只在手动 `/v5 paper editor=office` 时可用,并且
|
|
120
|
+
**所办必须先与全所交流、商讨、优化、审查**:至少 1 条所办消息(`vibe_v5_message`)**且**至少 1 次会议
|
|
121
|
+
(`vibe_v5_meeting`),结论写进定稿说明,然后调用 `vibe_v5_finalize_paper`。
|
|
122
|
+
两个计数记在 `paper.meta.json`;缺一即 `V5_PAPER_CONSULT_REQUIRED`(不是静默跳过)。
|
|
123
|
+
|
|
124
|
+
## 8. LaTeX 检测、编译与降级
|
|
125
|
+
|
|
126
|
+
- **检测**走 `subprocess.resolveExecutable`:`paperLatexCommand` 非空时**只用它**(不猜);
|
|
127
|
+
空则按语言探测 —— 中文 `xelatex` → `latexmk` → `pdflatex` → `lualatex` → `tectonic`
|
|
128
|
+
(xelatex 对 CJK 开箱可用),英文 `pdflatex` 优先,其余同理。
|
|
129
|
+
- **编译**在论文目录内执行、`-interaction=nonstopmode`、跑两遍(`latexmk`/`tectonic` 用各自参数)。
|
|
130
|
+
- **先修复、后降级**(有收敛上限):换引擎重试 → `nonstopmode` 重跑 → 换最小模板
|
|
131
|
+
(`ctexart` / `article`)再试一次;到达上限就**保留 tex+md**,`paper.meta.json` 记
|
|
132
|
+
`compile: 'failed'`(或未检测到时的 `'not-detected'`),**警告 + 上报**,但**不阻塞定稿**、
|
|
133
|
+
**不抛错**、**不覆盖已有 pdf**,也绝不改写论文内容。
|
|
134
|
+
- `paperFormat=md` 时根本不产出 tex,编译直接 `skipped`,不得产生"缺 tex 无法编译"的警告。
|
|
135
|
+
- tex 模板:中文 `ctexart`(xelatex),英文 `article`;只用常见宏包(`amsmath`、`amssymb`、`amsthm`、
|
|
136
|
+
`geometry`、`hyperref`、`longtable`、`booktabs`);转义所有 `_ % & # $ { } ~ ^ \`。
|
|
137
|
+
- 记录:规格确认时本机**没有任何 LaTeX 引擎**,所以真机走的是"未检测到 → 只交 tex+md"分支;
|
|
138
|
+
编译成功 / 修复后成功 / 持续失败三条路径由守卫里的**假编译器**覆盖(见 §10)。
|
|
139
|
+
|
|
140
|
+
## 9. 幂等与可审计
|
|
141
|
+
|
|
142
|
+
- 幂等键 = **run id + `finalizedAt` + 逐产物存在性检查**(不使用多文件稳定哈希);
|
|
143
|
+
重复触发只补写缺失产物,`force` 才重写。
|
|
144
|
+
- v2 的收口判据含 `agentRegistry=={}` ⇒ 撰写子代理被排除在收口判据之外(§3);v3 在触发前已释放项目锁,
|
|
145
|
+
因此论文落盘要**原子 + 幂等**(可加 paper 作用域锁),避免两个会话写同一棵树。
|
|
146
|
+
- 每次触发、每次派遣、每次编译、每次降级都追加 `paper.log.md`,并在活动日志里留一条。
|
|
147
|
+
|
|
148
|
+
## 10. 守卫与验证要求
|
|
149
|
+
|
|
150
|
+
每条不变式都要有断言,且要么有灵敏度探针证明它会变红,要么在探针里写明为什么不可达:
|
|
151
|
+
|
|
152
|
+
- 参数默认值 / schema 存在性 / 非法值回退;五个(v4/v5 六个)参数同时出现在工具 schema 与帮助文本里;
|
|
153
|
+
- 触发判定的正负用例:未收口不触发、收口触发、`finalPaper=false` 不触发、重复触发幂等;
|
|
154
|
+
- 内容生成:假 LLM/假成员回应驱动,断言 md/tex 两版产出、9 节骨架齐全、证据索引存在、未决项被标注;
|
|
155
|
+
- 编译分支:假编译器覆盖"成功 → pdf""失败 → 修复后成功""持续失败 → 降级 + 警告"三条路径;
|
|
156
|
+
真机无 LaTeX 时断言走"未检测到"分支且不报错;
|
|
157
|
+
- 路径与越权:只写 `Paper/<id>/` 内、id 归一化(防路径逃逸)、与 `Verified/`/`State/` 不互相污染;
|
|
158
|
+
- 命令:`/vN paper` 的参数覆盖、`force` 与非法参数 `kind:'error'`;
|
|
159
|
+
- 团队流程(v4/v5):断言"各部分 → 合并 → 互审 → 定稿"的消息序列;`paperEditor` 两种取值都可用;
|
|
160
|
+
v5 选 `office` 时**确有**交流与会议记录(负用例:未咨询就定稿必须被拒),未达成一致认同时不定稿。
|
|
161
|
+
|
|
162
|
+
现有守卫:`tests/v4-final-paper.test.mjs`(v4 团队流程与产物)、`tests/e2e-v5-round2.test.mjs`
|
|
163
|
+
(v5 的手动/自动路径与所办咨询门)、`tests/v2-fix-probes.test.mjs` / `tests/v3-fix-probes.test.mjs`
|
|
164
|
+
(v2/v3 的收口派遣与降级)、`tests/audit-persona-sensitivity.mjs`(提示词面必须随新命令/工具更新)。
|
|
165
|
+
|
|
166
|
+
## 11. 纪律
|
|
167
|
+
|
|
168
|
+
- 写域按预设切分,同一文件只有一个写者;实现者**不提交**(由 Lead 统一提交并跑门禁)。
|
|
169
|
+
- **不得编造论文内容**:论文只整理已有证据,未决/被否证的条目显式标注。
|
|
170
|
+
- 成本纪律:只跑本预设相关套件 + 自建聚焦探针;全量 `run-tests`、`audit-formal-sensitivity`、
|
|
171
|
+
`e2e-v4-fixes` 等慢脚本留给轮末门禁(见 `docs/test-timing.md`)。
|