dsh-vibe-math 2.2.1 → 2.3.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/AUDIT-CHECKLIST.md +48 -2
- package/README.md +368 -81
- package/RELEASE-NOTES-2.2.2.md +88 -0
- package/RELEASE-NOTES-2.3.0.md +207 -0
- package/audit-formal-sensitivity.mjs +247 -0
- package/audit-persona-sensitivity.mjs +249 -0
- package/audit-persona-surface.test.mjs +349 -0
- package/audit-v5-integrity.mjs +40 -1
- package/audit-v5-sensitivity.mjs +84 -6
- package/docs/formal-verification.md +321 -0
- package/docs/generate_framework_diagram_v5.mjs +290 -0
- package/docs//346/236/266/346/236/204/345/233/276.md +75 -0
- package/formal-verify-v2.test.mjs +672 -0
- package/formal-verify-v3.test.mjs +824 -0
- package/formal-verify-v4.test.mjs +603 -0
- package/formal-verify-v5.test.mjs +526 -0
- package/package.json +33 -15
- package/prompt-corpus-persona/persona-corpus.json +32 -0
- package/prompt-corpus-persona/persona-corpus.md +674 -0
- package/prompt-corpus-v3/formal-verify-v3.json +280 -0
- package/prompt-corpus-v3/formal-verify-v3.md +2826 -0
- package/prompt-corpus-v5/prompt-corpus-v5.json +131 -713
- package/prompt-corpus-v5/prompt-corpus-v5.md +1828 -5225
- package/prompt-v5-integrity.test.mjs +154 -11
- package/vibe-math-v2/agent.cordis.yml +40 -2
- package/vibe-math-v2/vibe-math-v2.js +627 -19
- package/vibe-math-v2//345/256/236/347/216/260/346/226/271/346/241/210.md +145 -1
- package/vibe-math-v3/agent.cordis.yml +46 -2
- package/vibe-math-v3/vibe-math-v3.js +749 -21
- package/vibe-math-v3//345/256/236/347/216/260/346/226/271/346/241/210.md +87 -2
- package/vibe-math-v4/agent.cordis.yml +46 -4
- package/vibe-math-v4/vibe-math-v4.js +652 -15
- package/vibe-math-v4//345/256/236/347/216/260/346/226/271/346/241/210.md +226 -0
- package/vibe-math-v5/agent.cordis.yml +41 -5
- package/vibe-math-v5/vibe-math-v5.js +572 -9
- package/vibe-math-v5//345/256/236/347/216/260/346/226/271/346/241/210.md +122 -4
- package/vibe-math-v5//346/236/266/346/236/204/345/233/276.md +426 -0
- package//347/244/272/344/276/213/345/233/276//346/241/206/346/236/266/345/233/276-v5.svg +173 -0
|
@@ -111,6 +111,9 @@ flowchart TB
|
|
|
111
111
|
```
|
|
112
112
|
VibeMath/ # 工作区级
|
|
113
113
|
├─ Methods/ # 【全局】跨项目理论发明库(可选层级,见 §16 假设)
|
|
114
|
+
├─ Formal/ # 【全局】Lean 形式化可复用库(见 §11.1,跨项目复用)
|
|
115
|
+
│ ├─ Lib/<name>.lean + Index.md # 可复用定义/对象/假设
|
|
116
|
+
│ └─ Proved/<name>.lean + Index.md # 已成立的引理(机器已核对)
|
|
114
117
|
├─ current.<sessionId>.json # 每会话当前项目(多会话并行互不覆盖)
|
|
115
118
|
└─ Projects/<项目>/
|
|
116
119
|
├─ Problems/ # 问题清单:每问题一个 md(可建领域子目录)
|
|
@@ -122,14 +125,20 @@ VibeMath/ # 工作区级
|
|
|
122
125
|
│ └─ 分析/p-yyyy.md
|
|
123
126
|
├─ Methods/ # 【新】项目级通用理论发明库(见 §7)
|
|
124
127
|
│ └─ m-xxxx.md
|
|
128
|
+
├─ Formal/ # 【新】该项目的 Lean 形式化工作区(见 §11.1)
|
|
129
|
+
│ ├─ <对象id>.lean # 对象的形式化工作文件
|
|
130
|
+
│ ├─ Index.md # 对象 → 状态 → 文件 → 归档证明 → 运行 → 难度判断
|
|
131
|
+
│ └─ TODO.md # require 模式下的「形式化待办」
|
|
125
132
|
├─ Verified/ # 绝对可信:调度器生成、只读
|
|
126
133
|
│ ├─ 命题/p-xxxx.md # 已验证真/假的完整可信版本
|
|
127
|
-
│
|
|
134
|
+
│ ├─ 问题/q-xxxx.md # 已解决的完整可信解法
|
|
135
|
+
│ └─ Lean/<对象id>.lean # 【新】归档证明:与定论卡片同处 Verified/
|
|
128
136
|
├─ Reliable/ # 用户放置的可信参考文献(只读)
|
|
129
137
|
├─ Notes/ # 自由笔记(不参与调度,纯记录)
|
|
130
138
|
├─ Logs/
|
|
131
139
|
│ ├─ Verification/ # 验证辩论记录(审计)
|
|
132
140
|
│ ├─ Plans/ # 每次调度计划 + 执行结果(规划学习闭环)
|
|
141
|
+
│ ├─ 形式化.md # 【新】形式化公告(归档/门禁搁置,追加式)
|
|
133
142
|
│ └─ 报告.md # (可选)汇报代理产出的人读论文式摘要
|
|
134
143
|
└─ State/ # 调度器私有状态(JSON,仅调度器读写)
|
|
135
144
|
├─ scheduler_state.json # 运行状态/活跃计数/纪元
|
|
@@ -139,11 +148,12 @@ VibeMath/ # 工作区级
|
|
|
139
148
|
├─ index.json # 锚点扫描重建的机器索引(调度唯一读取面)
|
|
140
149
|
├─ verifier_accuracy.json # 验证器历史准确率
|
|
141
150
|
├─ method_log.json # 方法库操作日志(上报/沉淀/晋升)
|
|
151
|
+
├─ formal.json # 【新】形式化记录(records/todo/libRuns,按对象 id)
|
|
142
152
|
├─ process_epoch.json # 进程纪元(断点续跑判据)
|
|
143
153
|
└─ project.lock # 会话级项目锁(防并发写冲突)
|
|
144
154
|
```
|
|
145
155
|
|
|
146
|
-
**路径职责**:`Problems/` 问题清单类、`Progress/` progress 类、`Propos/` 结论/命题类、`Methods/` 理论发明类、`Verified/`
|
|
156
|
+
**路径职责**:`Problems/` 问题清单类、`Progress/` progress 类、`Propos/` 结论/命题类、`Methods/` 理论发明类、`Formal/`(项目内)与 `Formal/{Lib,Proved}`(工作区级,见 §11.1)Lean 形式化类、`Verified/` 绝对可信类(含 `Verified/Lean/` 归档证明)、`Reliable/` 可信参考、`Notes/` 自由记录、`Logs/` 审计、`State/` 机器状态——**不同类型,不同路径**(需求 1)。
|
|
147
157
|
|
|
148
158
|
---
|
|
149
159
|
|
|
@@ -453,6 +463,25 @@ VibeMath/ # 工作区级
|
|
|
453
463
|
|
|
454
464
|
设置文件仍为 `vibe_math_setting.json`(JSONC 含注释,项目级,回退全局),是参数的唯一持久化来源。
|
|
455
465
|
|
|
466
|
+
### 10.1 Lean 形式化验证参数(契约:`docs/formal-verification.md`)
|
|
467
|
+
|
|
468
|
+
| 参数 | 默认 | 含义 |
|
|
469
|
+
|---|---|---|
|
|
470
|
+
| `formalVerify` | `'off'` | 三档开关:`off` / `encourage` / `require`;非法值一律回退 `'off'`(**绝不**回退到更强档位) |
|
|
471
|
+
| `leanCommand` | `'lean'` | 要执行的 Lean 可执行文件(例:`'lake'`);空白回退 `'lean'` |
|
|
472
|
+
| `leanArgs` | `[]` | 插在 `.lean` 文件名之前的附加参数(例:`['env','lean']` 配 `leanCommand='lake'`) |
|
|
473
|
+
| `leanTimeoutMs` | `120000` | 单次 Lean 运行超时上限(毫秒,正整数);非正数回退默认 |
|
|
474
|
+
|
|
475
|
+
四个参数进入既有的参数体系:`vibe_math_set_params`(运行中即可切换)、`vibe_math_setup` 的参数 schema、`vibe_math_setting.json` 模板(含注释)、`status`/`report` 的可读参数表。
|
|
476
|
+
|
|
477
|
+
**三档语义**
|
|
478
|
+
|
|
479
|
+
- **`off`(默认)—— 真正的无操作。** 任何提示词里都不出现 Lean / 形式化字样,验证流程、门禁、索引、卡片全部与改动前一致;三个 Lean 工具**仍然注册**(注册是静态的,与既有 `ctx.effect` 纪律一致),人/代理主动调用时照常工作,只是框架不主动告诉代理它们存在。
|
|
480
|
+
- **`encourage` —— 鼓励但不强制。** 验证提示词注入「Lean 形式化验证(鼓励模式)」段落:先判断该对象的**实现难度**,能在可接受工作量内形式化就优先写 Lean 并执行;**一旦 Lean 通过,唯一需要确认的就是忠实性**(定义/对象/条件/假设/结论是否与命题原文逐条一致),请把注意力放在核对而不是重做推导上;不值得/无法形式化可以不做,但要在回执的 `formal` 字段写明难度判断。solver / explorer / 重派生 / 方法整理提示词注入「顺手形式化」一行;方法整理代理(Method Keeper)额外被要求把可复用定义与已证引理沉淀到全局 Lean 库。**不设门禁**:没有任何 Lean 产物时验证照常收口。
|
|
481
|
+
- **`require` —— 强制上述要求并加门禁。** 注入文本与 encourage 相同,但语气为"必须",并附加门禁:一个对象要被判定为**真**(严格证明)或**假**(严格反驳),必须满足 `formal.status ∈ {'passed','blocked'}`;否则本次裁定**不生效**——框架把它记为未定论(原因 `formal-required`)、写入「形式化待办」、在公告里说明、并且**在形式化补齐之前不再重复表决该对象**(防空转),对象留在原库(**既有权重/概率字段不变**),补齐后自动重新进入验证。`passed` = 有 Lean 产物且最近一次运行 `exitCode === 0`;`blocked` = 代理给出**显式的**难度判断/阻塞原因(`note` 非空)——"根据实现难度决定是否通过 Lean"的落点就在这里,决定权在代理,但决定必须显式、可审计,不允许静默跳过。门禁是**兜底**而非唯一手段:require 模式的验证提示词会先告知表决者定论前的必要条件。
|
|
482
|
+
|
|
483
|
+
**模式是动态的**:所有与模式相关的文本都在**构造提示词的那一刻**由 `params.formalVerify` 现算,绝不写进"入职时冻结"的人格/章程快照,因此运行中切换立刻反映到新提示词上。
|
|
484
|
+
|
|
456
485
|
---
|
|
457
486
|
|
|
458
487
|
## 11. 工具与命令清单
|
|
@@ -467,6 +496,62 @@ VibeMath/ # 工作区级
|
|
|
467
496
|
| `vibe_math_method_list` | 列出方法库(ID/名称/类型/状态/体系归属) |
|
|
468
497
|
| `vibe_math_lock_status` | 查看项目锁占用情况 |
|
|
469
498
|
| `vibe_math_decide` | 扩展支持 `node: 'plan'`(计划审批)与 `node: 'method-promote'` |
|
|
499
|
+
| `vibe_math_lean_run` | `{file, target?, timeout_ms?}`:在一个 `.lean` 文件上执行 Lean 工具链并**如实**回报 `{ok, exitCode, signal, ms, command, stdout, stderr, file}`;给了 `target` 就把这次运行记到该对象上。**绝不抛异常到调度循环**:宿主没有 subprocess 服务 → `NO_SUBPROCESS`,工具链解析失败 → `LEAN_NOT_FOUND`,超时 → `LEAN_TIMEOUT`(并调用 `handle.terminate()`) |
|
|
500
|
+
| `vibe_math_lean_archive` | `{kind, ...}` 一个工具覆盖四种归档:`kind='def'`/`'lemma'` → 全局 `<VibeMath 根>/Formal/{Lib,Proved}/<name>.lean` 并重建对应索引(`content` 或 `from` 二选一;`run:false` 跳过执行);`kind='proof'` → 写 `Formal/<target>.lean`,该文件最近一次运行 ok 时**同时**写 `Verified/Lean/<target>.lean` 并把对象标为 `passed`;`kind='blocked'` → 记录显式难度判断/阻塞原因(`note` 必填,空则拒绝) |
|
|
501
|
+
| `vibe_math_lean_lib` | `{refresh?}`:扫描并重建三处索引(项目 `Formal/Index.md`、全局 `Lib/Index.md`、`Proved/Index.md`),返回可复用库清单(供写新定义前查重、直接复用);`refresh:false` 只读不重建 |
|
|
502
|
+
|
|
503
|
+
### 11.1 Lean 形式化验证(v3 实现要点)
|
|
504
|
+
|
|
505
|
+
**路径布局**(契约 §3;全局库**故意**放在项目树之外——跨项目复用是这套设计的核心收益):
|
|
506
|
+
|
|
507
|
+
```
|
|
508
|
+
<VibeMath 根>/
|
|
509
|
+
├─ Formal/Lib/<name>.lean + Index.md # 全局可复用定义(def / structure / notation)
|
|
510
|
+
├─ Formal/Proved/<name>.lean + Index.md # 全局已证引理(机器已核对)
|
|
511
|
+
└─ Projects/<项目>/
|
|
512
|
+
├─ Formal/<对象id>.lean # 该对象的形式化工作文件
|
|
513
|
+
├─ Formal/Index.md # 对象 → 状态 → 文件 → 归档证明 → 最近运行 → 难度判断
|
|
514
|
+
├─ Formal/TODO.md # require 模式下的「形式化待办」
|
|
515
|
+
└─ Verified/Lean/<对象id>.lean # 归档证明:与定论卡片同处 Verified/,一眼可见
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
项目内的 `Formal/`、`Verified/Lean/` 与全局的 `Formal/{Lib,Proved}` 由 `ensureDirs` 随目录骨架一起创建。
|
|
519
|
+
|
|
520
|
+
**对象的形式化记录**落在 `State/formal.json`(v3 没有会话投影,因此用它自己的持久状态,按对象 id 索引,`resume` 后仍然有效):
|
|
521
|
+
|
|
522
|
+
```jsonc
|
|
523
|
+
{ "records": { "p-1": { "status": "none|attempted|passed|blocked", "file": "Formal/p-1.lean",
|
|
524
|
+
"proof": "Verified/Lean/p-1.lean", "decision": "used|blocked", "note": "…",
|
|
525
|
+
"run": { "at": 0, "ok": true, "exitCode": 0, "ms": 0, "stdoutTail": "", "stderrTail": "" },
|
|
526
|
+
"updatedAt": 0 } },
|
|
527
|
+
"todo": [ { "id": "p-4", "at": 0, "why": "formal-required:…", "verdict": 1 } ],
|
|
528
|
+
"libRuns": { "Lib/ZMod5.lean": { "ok": true, "exitCode": 0, "ms": 12, "at": 0 } } }
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
**卡片锚点**:对象 md 卡(`Problems/`、`Propos/`、`Verified/`)在非 off 模式且该对象**有形式化记录**时,头部锚点块里多一行 `- 形式化: <状态>`(`Lean 通过(…)` / `阻塞(…)` / `已尝试未通过`),位置紧随 `- 概率:`(无概率锚点时紧随 `- 状态:`),不影响调度器只读头部锚点的既有解析。锚点用**文本级插入/替换**维护(不整卡重写),因此代理按"直接写 md"协议写进卡片的正文不会被抹掉;off 模式或状态为 `none` 时不写这一行。
|
|
532
|
+
|
|
533
|
+
**回执通道**(契约 §6.3):非 `off` 模式下,验证回执的 JSON 契约里带 `"formal":{...}`(由 `handleVerifier` 处理),solver / explorer / 重派生提示词的**回执说明**里也给出同一字段(`handleSolver` / `handleExplorer` 通过 `absorbFormalFromReply` 接受顶层 `formal` 与 `meta.formal` 两种写法)。因此代理即使一次 Lean 工具都没调用,也能留下显式、可审计的难度判断;`decision='blocked'` 而 `note` 为空一律**拒绝记录**并公告,`decision='used'` 只记 `attempted`(不足以打开 require 门禁)。
|
|
534
|
+
|
|
535
|
+
**门禁落点**(契约 §8 要求唯一收口点,不散落):
|
|
536
|
+
- 判定入口:`settleVerdict`(辩论/评审裁定,在**改对象之前**拦下)与 `processStatusUpdates`(自报概率 1 的第二条"宣告定论"入口);
|
|
537
|
+
- 写卡收口点:`writeVerifiedPropositionCardIfNeeded` / `writeVerifiedProblemCardIfNeeded` → `writeVerifiedCardIfChanged`(require 模式下没有 `passed`/`blocked` 就**不写** Verified 卡片,作为防御性双保险);
|
|
538
|
+
- 不通过时统一走 `deferForFormal`:记未定论(`formal-required`)+ 写 `Formal/TODO.md` + 公告(活动日志 + `Logs/形式化.md`),**不改变对象的既有权重/概率字段**,绝不卡死调度——对象留在原库,完成形式化或记录阻塞后重新提议验证即可;达到 `passed`/`blocked` 时自动把该对象从待办中移除(待办的含义就是"还不满足门禁")。
|
|
539
|
+
- **防空转**:已经被记为「形式化待办」而形式化又没补齐的对象,`createVerifyTask` 不再为它建验证任务(否则同一个 `rId` 每个 tick 都会被重建、每轮再派一批验证器,而结果每轮都被同一道门拦下——纯烧验证预算)。一旦 `passed`/`blocked` 落库,门禁条件满足,候选自然重新出现并继续验证,无需人工干预。回退启发式在跳过这类候选时**不占用本轮名额**(`created` 才 `return`),否则排在待办对象后面的候选会被永久饿死。
|
|
540
|
+
|
|
541
|
+
**错误码**(一律作为结果返回,不抛进调度循环):
|
|
542
|
+
|
|
543
|
+
| 码 | 触发条件 |
|
|
544
|
+
|---|---|
|
|
545
|
+
| `V3_INVALID_ARGUMENT` | 越界路径(爬到 VibeMath 根之上、无关绝对路径)、非 `.lean` 文件、缺 `file`/`name`/`target`/`note`、未知 `kind`、`from` 越界或不存在 |
|
|
546
|
+
| `V3_NOT_FOUND` | 目标 `.lean` 文件不存在 |
|
|
547
|
+
| `V3_WRITE_FAILED` | 归档文件写盘失败 |
|
|
548
|
+
| `NO_SUBPROCESS` | 宿主没有 subprocess 服务(只记录 `attempted`,不崩) |
|
|
549
|
+
| `LEAN_NOT_FOUND` | `resolveExecutable` 失败(工具链未安装 / 宿主未提供该能力);仍可把形式化代码写下来归档 |
|
|
550
|
+
| `LEAN_SPAWN_FAILED` / `LEAN_RUN_FAILED` | `spawn` 抛错 / `handle.done` 拒绝 |
|
|
551
|
+
| `LEAN_TIMEOUT` | 超过 `leanTimeoutMs`(结果里 `timedOut:true`,已调用 `handle.terminate()`) |
|
|
552
|
+
| `LEAN_FAILED` | 非零退出(编译输出原样返回 ~4KB,供代理修复) |
|
|
553
|
+
|
|
554
|
+
**执行与守卫**:`subprocess.resolveExecutable(leanCommand)` → `spawn({argv:[exe, ...leanArgs, abs], cwd:<项目根>, stdio:{stdin:'ignore',stdout/stderr:{maxBytes:64KB}}, graceMs:leanTimeoutMs})` → `await handle.done` → 收集 stdout/stderr(`readFrom(0).text`,截断到 4KB)。路径守卫 = `normalizeAbsPath`(纯词法折叠 `.`/`..`/重复斜杠)+ 边界为 **VibeMath 根**(不是项目根);`lean_run` 的 `file` 先按项目根解析、再按 VibeMath 根解析,两条路径都过同一道守卫。
|
|
470
555
|
|
|
471
556
|
---
|
|
472
557
|
|
|
@@ -61,13 +61,18 @@
|
|
|
61
61
|
Main controls (recommended flow: configure FIRST, then start):
|
|
62
62
|
- vibe_v4_configure {project?, problem?, params?} — create/configure the project (name, problem, params) WITHOUT starting a run; set everything here first.
|
|
63
63
|
- vibe_v4_start {problem?, residentCount?, seedDirections?} — begin the run (spawn residents, brainstorm). If problem was configured, omit it.
|
|
64
|
-
- vibe_v4_set {residentCount, compactThreshold, compactAfterRounds, meetingKeepEvery, maxParallel, activityTimeoutMs, stallAutoMeetingMs, verdictMaxRounds, provider, model, residentPersona, toolAllow, toolDeny} — 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).
|
|
64
|
+
- 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.
|
|
65
65
|
- vibe_v4_resume / vibe_v4_pause / vibe_v4_abort / vibe_v4_status / vibe_v4_report.
|
|
66
66
|
- vibe_v4_message {to|all, content} — inject a message to a resident (human/assistant intervention).
|
|
67
67
|
- vibe_v4_meeting {agenda} — force a meeting.
|
|
68
68
|
- vibe_v4_add_member {direction?} / vibe_v4_remove_member {id} — add / close a resident.
|
|
69
69
|
- vibe_v4_list_members — list residents.
|
|
70
|
-
|
|
70
|
+
- vibe_v4_lean_run / vibe_v4_lean_archive / vibe_v4_lean_lib — Lean formal verification
|
|
71
|
+
(execute / archive / list the reuse library). Residents use them too; they work in every mode.
|
|
72
|
+
- vibe_v4_formal_report — human-readable Lean formal-verification mirror (mode, Lean-passed
|
|
73
|
+
objects, recorded blockers, formalization TODO, library paths).
|
|
74
|
+
- vibe_v4_prompts {which: brainstorm|normal|heartbeat|verify|coreRules, member?, target?, stage?} — read the exact prompt text a resident would receive (prompt auditing; prompt text is the product).
|
|
75
|
+
A /v4 slash command mirrors the main controls (configure|start|resume|pause|abort|status|report|message <to|all> <content>|meeting|members|add|remove|set).
|
|
71
76
|
|
|
72
77
|
TRUST RULE: only Verified/ (and Propos/ entries marked 已验证·真/假) are absolutely
|
|
73
78
|
trustworthy; everything else — unverified resident claims, Progress/, Method claims —
|
|
@@ -75,6 +80,22 @@
|
|
|
75
80
|
ALL residents unanimously agree true (or all agree false); otherwise it stays in its
|
|
76
81
|
library with a probability estimate.
|
|
77
82
|
|
|
83
|
+
LEAN FORMAL VERIFICATION (formalVerify, a tunable parameter):
|
|
84
|
+
- 'off' (default, no extra requirement) | 'encourage' (the residents decide by implementation
|
|
85
|
+
difficulty whether to formalize in Lean; once a Lean run passes, their unanimous vote becomes
|
|
86
|
+
a FIDELITY review — do the Lean definitions/objects/conditions/assumptions/conclusion match
|
|
87
|
+
the proposition as stated) | 'require' (same, plus a gate: a unanimous true/false verdict is
|
|
88
|
+
withheld as 未定论 with reason formal-required until the object is Lean-passed or carries an
|
|
89
|
+
explicit, reasoned blocker record; the run is never wedged by it).
|
|
90
|
+
- Paths: work file Formal/<id>.lean; archived proof Verified/Lean/<id>.lean; reusable
|
|
91
|
+
definitions VibeMath/Formal/Lib/; proved lemmas VibeMath/Formal/Proved/.
|
|
92
|
+
- The toolchain knobs leanCommand / leanArgs / leanTimeoutMs are tunable as well
|
|
93
|
+
(e.g. leanCommand='lake' with leanArgs=['env','lean']); a missing Lean binary is
|
|
94
|
+
reported as LEAN_NOT_FOUND and still lets the code be written and archived.
|
|
95
|
+
- vibe_v4_status / vibe_v4_report / vibe_v4_formal_report show the mode, the per-object formal
|
|
96
|
+
status and the formalization TODO (Formal/TODO.md). The framework never installs Lean and
|
|
97
|
+
never judges fidelity for you.
|
|
98
|
+
|
|
78
99
|
When the user asks about progress, call vibe_v4_report and summarize in plain language.
|
|
79
100
|
suffix: Your working directory is {{cwd}}.
|
|
80
101
|
text: |-
|
|
@@ -122,13 +143,18 @@
|
|
|
122
143
|
Main controls (recommended flow: configure FIRST, then start):
|
|
123
144
|
- vibe_v4_configure {project?, problem?, params?} — create/configure the project (name, problem, params) WITHOUT starting a run; set everything here first.
|
|
124
145
|
- vibe_v4_start {problem?, residentCount?, seedDirections?} — begin the run (spawn residents, brainstorm). If problem was configured, omit it.
|
|
125
|
-
- vibe_v4_set {residentCount, compactThreshold, compactAfterRounds, meetingKeepEvery, maxParallel, activityTimeoutMs, stallAutoMeetingMs, verdictMaxRounds, provider, model, residentPersona, toolAllow, toolDeny} — 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).
|
|
146
|
+
- 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.
|
|
126
147
|
- vibe_v4_resume / vibe_v4_pause / vibe_v4_abort / vibe_v4_status / vibe_v4_report.
|
|
127
148
|
- vibe_v4_message {to|all, content} — inject a message to a resident (human/assistant intervention).
|
|
128
149
|
- vibe_v4_meeting {agenda} — force a meeting.
|
|
129
150
|
- vibe_v4_add_member {direction?} / vibe_v4_remove_member {id} — add / close a resident.
|
|
130
151
|
- vibe_v4_list_members — list residents.
|
|
131
|
-
|
|
152
|
+
- vibe_v4_lean_run / vibe_v4_lean_archive / vibe_v4_lean_lib — Lean formal verification
|
|
153
|
+
(execute / archive / list the reuse library). Residents use them too; they work in every mode.
|
|
154
|
+
- vibe_v4_formal_report — human-readable Lean formal-verification mirror (mode, Lean-passed
|
|
155
|
+
objects, recorded blockers, formalization TODO, library paths).
|
|
156
|
+
- vibe_v4_prompts {which: brainstorm|normal|heartbeat|verify|coreRules, member?, target?, stage?} — read the exact prompt text a resident would receive (prompt auditing; prompt text is the product).
|
|
157
|
+
A /v4 slash command mirrors the main controls (configure|start|resume|pause|abort|status|report|message <to|all> <content>|meeting|members|add|remove|set).
|
|
132
158
|
|
|
133
159
|
TRUST RULE: only Verified/ (and Propos/ entries marked 已验证·真/假) are absolutely
|
|
134
160
|
trustworthy; everything else — unverified resident claims, Progress/, Method claims —
|
|
@@ -136,6 +162,22 @@
|
|
|
136
162
|
ALL residents unanimously agree true (or all agree false); otherwise it stays in its
|
|
137
163
|
library with a probability estimate.
|
|
138
164
|
|
|
165
|
+
LEAN FORMAL VERIFICATION (formalVerify, a tunable parameter):
|
|
166
|
+
- 'off' (default, no extra requirement) | 'encourage' (the residents decide by implementation
|
|
167
|
+
difficulty whether to formalize in Lean; once a Lean run passes, their unanimous vote becomes
|
|
168
|
+
a FIDELITY review — do the Lean definitions/objects/conditions/assumptions/conclusion match
|
|
169
|
+
the proposition as stated) | 'require' (same, plus a gate: a unanimous true/false verdict is
|
|
170
|
+
withheld as 未定论 with reason formal-required until the object is Lean-passed or carries an
|
|
171
|
+
explicit, reasoned blocker record; the run is never wedged by it).
|
|
172
|
+
- Paths: work file Formal/<id>.lean; archived proof Verified/Lean/<id>.lean; reusable
|
|
173
|
+
definitions VibeMath/Formal/Lib/; proved lemmas VibeMath/Formal/Proved/.
|
|
174
|
+
- The toolchain knobs leanCommand / leanArgs / leanTimeoutMs are tunable as well
|
|
175
|
+
(e.g. leanCommand='lake' with leanArgs=['env','lean']); a missing Lean binary is
|
|
176
|
+
reported as LEAN_NOT_FOUND and still lets the code be written and archived.
|
|
177
|
+
- vibe_v4_status / vibe_v4_report / vibe_v4_formal_report show the mode, the per-object formal
|
|
178
|
+
status and the formalization TODO (Formal/TODO.md). The framework never installs Lean and
|
|
179
|
+
never judges fidelity for you.
|
|
180
|
+
|
|
139
181
|
When the user asks about progress, call vibe_v4_report and summarize in plain language.
|
|
140
182
|
|
|
141
183
|
# ── agent-instructions ──────────────────────────────────────────────────────
|