其他
插件
dsh-bili-scroll
c1overzz
DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Fisfzy/math-lean
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DSH(Cordis)单插件:把数学/物理推导结果钉死在 Lean 内核 clean replay 验证上。 任何 Agent 声称的结果都必须通过可复现、防造假的 Lean 验证才被接受;推导由 Agent/外部工具 产出,本插件只负责"裁定 + 证据存证"。
#print axioms <name> 会报告目标定理依赖的 axiom
集;任何依赖 sorryAx(sorry/admit)、*(unsound)或未授权 axiom 的候选都会被拒绝——即使它
源码里没有字面 sorry(例如 axiom bogus + theorem := bogus 编译退出码 0 且无警告,仍会被拦)。import 必须落在领域允许集(baseline Std/Mathlib)内,超出的拒绝。.lean 时执行候选代码里的
#eval,因此候选可借此执行宿主命令。#eval、
#reduce/#compute、run_cmd、unsafe、IO./System./文件读写等执行/逃逸向量,宁误杀
也不放行。bwrap --ro-bind /some/readonly-elan /usr/bin/lean ... + 独立可写工作目录)。这是
"真正隔离"的正确形态,当前代码保留了 runner 见 lean/lean-runner.ts 的抽象点以便接入。| 机制 | 文件 | 作用 |
|---|---|---|
| M1 状态机不可跳步 | src/run/run-state.ts |
推导必须从 lock 开始顺序走 |
| M2 强签名产物链 | src/run/artifact-chain.ts |
每个产物带 SHA-256 + 产出插件 id,防改/防混挂 |
| M3 领域覆盖校验 | src/domain/domain-registry.ts |
领域声明的必需检查缺一个 → 拒跑 |
| M4 只读检查+唯一裁定器 | src/run/orchestrator.ts |
只有 orchestrator 能写最终结论 |
| M5 Lean 内核权威 + 反作弊 | src/lean/* |
lean 真实编译 + #print axioms 权威门 + import 白名单 |
dimensional_consistency 域检查——该检查是提示,
不是证明权威,可否决但不可认证)。npm install # 或 corepack pnpm install
npm run typecheck # tsc
npm test # node --import tsx/esm test/run.smoke.ts
node --import tsx/esm test/acceptance.ts # 8 条验收断言 A1–A7(含真实 Lean)
node --import tsx/esm test/anti-cheat.ts # 16 条反作弊权威断言(#print axioms + import 白名单 + #eval 逃逸)
node --import tsx/esm test/dimension.ts # 7 条量纲一致性断言
node --import tsx/esm test/fluid-domain.ts # 3 条流体域门断言
node --import tsx/esm test/multi-agent.ts # 4 条多 agent 编排断言
node --import tsx/esm test/research.ts # 4 条第多 agent 端到端(含修复循环,agent 意见不能替代内核)
node --import tsx/esm test/project-mode.ts # 2 条 lake 项目模式断言
node --import tsx/esm test/tool-registration.ts # DSH ctx.tools 注册契约
node --import tsx/esm demo/verify-a5.ts # 单文件真实验证 2+2=4
node --import tsx/esm demo/research.ts # 完整工作台:多 agent 编排 + Lean 裁定
前提:本机有 Lean 工具链(lean/lake 在 ~/.elan/bin)。已实测 Lean 4.27.0 + Lake 5.0.0。
mathlib 未随附,需 lake new + 拉取 mathlib 才能验证 mathlib 依赖的定理。
dsh_lean_lock_statement、dsh_lean_verify、dsh_lean_domain_register、
dsh_lean_run_status、dsh_lean_evidence_export。src/index.ts 的 bootstrapTools(api, register) 按 DSH ctx.tools.register(defineTool(..))
契约发出这 5 个工具。@deepseek-ai/dsh-tools + vendor cordis,并在
~/.dsh/cordis.patch.yml 注册插件入口,再重载/重启 dsh web。#eval、#reduce/#compute、run_cmd、unsafe、
IO./System./文件读写等宿主执行/逃逸向量(见 test/anti-cheat.ts 16 断言)。-- @check_dim: LHS == RHS 注释会被解析成基础量纲向量
(M, L, T)并核对;能量 vs 动量等不一致会被拒绝(见 test/dimension.ts 7 断言 +
test/fluid-domain.ts 3 断言)。verifyProject(runId, projectRoot, target) 以整项目 lake build 为权威
(见 demo/lake-project/ 自含模板,无 mathlib 依赖;test/project-mode.ts)。#print axioms 做该断言)。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。