dsh-thesis 1.0.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/DESIGN.md +390 -0
- package/LICENSE +21 -0
- package/NOTICE.md +10 -0
- package/README.md +253 -0
- package/cordis.patch.yml +17 -0
- package/docs/host-api.md +640 -0
- package/lib/codewalk/commands.d.ts +23 -0
- package/lib/codewalk/commands.js +168 -0
- package/lib/codewalk/engine.d.ts +108 -0
- package/lib/codewalk/engine.js +449 -0
- package/lib/codewalk/errors.d.ts +31 -0
- package/lib/codewalk/errors.js +20 -0
- package/lib/codewalk/fs-types.d.ts +34 -0
- package/lib/codewalk/fs-types.js +10 -0
- package/lib/codewalk/gate.d.ts +30 -0
- package/lib/codewalk/gate.js +60 -0
- package/lib/codewalk/host-types.d.ts +198 -0
- package/lib/codewalk/host-types.js +11 -0
- package/lib/codewalk/prestep.d.ts +17 -0
- package/lib/codewalk/prestep.js +62 -0
- package/lib/codewalk/register.d.ts +23 -0
- package/lib/codewalk/register.js +31 -0
- package/lib/codewalk/skill.d.ts +15 -0
- package/lib/codewalk/skill.js +57 -0
- package/lib/codewalk/tools.d.ts +18 -0
- package/lib/codewalk/tools.js +314 -0
- package/lib/codewalk/types.d.ts +151 -0
- package/lib/codewalk/types.js +9 -0
- package/lib/commands.d.ts +33 -0
- package/lib/commands.js +60 -0
- package/lib/config.d.ts +125 -0
- package/lib/config.js +139 -0
- package/lib/dedup/commands.d.ts +21 -0
- package/lib/dedup/commands.js +93 -0
- package/lib/dedup/index.d.ts +75 -0
- package/lib/dedup/index.js +331 -0
- package/lib/dedup/normalize.d.ts +125 -0
- package/lib/dedup/normalize.js +329 -0
- package/lib/dedup/report.d.ts +114 -0
- package/lib/dedup/report.js +309 -0
- package/lib/dedup/rewrite.d.ts +71 -0
- package/lib/dedup/rewrite.js +228 -0
- package/lib/dedup/similarity.d.ts +169 -0
- package/lib/dedup/similarity.js +323 -0
- package/lib/gates/dangerous.d.ts +22 -0
- package/lib/gates/dangerous.js +47 -0
- package/lib/gates/detect.d.ts +54 -0
- package/lib/gates/detect.js +106 -0
- package/lib/gates/messages.d.ts +39 -0
- package/lib/gates/messages.js +74 -0
- package/lib/gates/prompt.d.ts +21 -0
- package/lib/gates/prompt.js +56 -0
- package/lib/gates/writing-intent.d.ts +49 -0
- package/lib/gates/writing-intent.js +68 -0
- package/lib/index.d.ts +36 -0
- package/lib/index.js +76 -0
- package/lib/ingest/code.d.ts +71 -0
- package/lib/ingest/code.js +356 -0
- package/lib/ingest/commands.d.ts +23 -0
- package/lib/ingest/commands.js +74 -0
- package/lib/ingest/docx.d.ts +29 -0
- package/lib/ingest/docx.js +92 -0
- package/lib/ingest/index.d.ts +179 -0
- package/lib/ingest/index.js +640 -0
- package/lib/ingest/ooxml.d.ts +58 -0
- package/lib/ingest/ooxml.js +393 -0
- package/lib/ingest/pdf.d.ts +86 -0
- package/lib/ingest/pdf.js +1016 -0
- package/lib/ingest/pptx.d.ts +32 -0
- package/lib/ingest/pptx.js +116 -0
- package/lib/ingest/text.d.ts +25 -0
- package/lib/ingest/text.js +180 -0
- package/lib/ingest/types.d.ts +48 -0
- package/lib/ingest/types.js +47 -0
- package/lib/ingest/xlsx.d.ts +72 -0
- package/lib/ingest/xlsx.js +411 -0
- package/lib/ingest/zip.d.ts +76 -0
- package/lib/ingest/zip.js +393 -0
- package/lib/intake/definitions.d.ts +65 -0
- package/lib/intake/definitions.js +42 -0
- package/lib/intake/gate-rules.d.ts +57 -0
- package/lib/intake/gate-rules.js +118 -0
- package/lib/intake/gate.d.ts +24 -0
- package/lib/intake/gate.js +86 -0
- package/lib/intake/index.d.ts +76 -0
- package/lib/intake/index.js +468 -0
- package/lib/intake/questions.d.ts +169 -0
- package/lib/intake/questions.js +720 -0
- package/lib/intake/spec.d.ts +66 -0
- package/lib/intake/spec.js +221 -0
- package/lib/intake/state.d.ts +192 -0
- package/lib/intake/state.js +420 -0
- package/lib/memory/recall.d.ts +69 -0
- package/lib/memory/recall.js +177 -0
- package/lib/memory/register.d.ts +37 -0
- package/lib/memory/register.js +52 -0
- package/lib/memory/service.d.ts +39 -0
- package/lib/memory/service.js +39 -0
- package/lib/memory/store.d.ts +45 -0
- package/lib/memory/store.js +123 -0
- package/lib/memory/tools.d.ts +19 -0
- package/lib/memory/tools.js +195 -0
- package/lib/memory/types.d.ts +55 -0
- package/lib/memory/types.js +6 -0
- package/lib/paper/commands.d.ts +13 -0
- package/lib/paper/commands.js +84 -0
- package/lib/paper/lib/aicheck.d.ts +38 -0
- package/lib/paper/lib/aicheck.js +241 -0
- package/lib/paper/lib/bibtex.d.ts +21 -0
- package/lib/paper/lib/bibtex.js +114 -0
- package/lib/paper/lib/check.d.ts +32 -0
- package/lib/paper/lib/check.js +215 -0
- package/lib/paper/lib/defense.d.ts +48 -0
- package/lib/paper/lib/defense.js +220 -0
- package/lib/paper/lib/docx.d.ts +35 -0
- package/lib/paper/lib/docx.js +213 -0
- package/lib/paper/lib/layout.d.ts +41 -0
- package/lib/paper/lib/layout.js +572 -0
- package/lib/paper/lib/ledger.d.ts +112 -0
- package/lib/paper/lib/ledger.js +349 -0
- package/lib/paper/lib/lit-api.d.ts +59 -0
- package/lib/paper/lib/lit-api.js +296 -0
- package/lib/paper/lib/lit-cache.d.ts +32 -0
- package/lib/paper/lib/lit-cache.js +91 -0
- package/lib/paper/lib/project.d.ts +29 -0
- package/lib/paper/lib/project.js +93 -0
- package/lib/paper/lib/review.d.ts +37 -0
- package/lib/paper/lib/review.js +194 -0
- package/lib/paper/lib/zip.d.ts +14 -0
- package/lib/paper/lib/zip.js +124 -0
- package/lib/paper/register.d.ts +20 -0
- package/lib/paper/register.js +183 -0
- package/lib/paper/tools/aicheck.d.ts +6 -0
- package/lib/paper/tools/aicheck.js +38 -0
- package/lib/paper/tools/build.d.ts +27 -0
- package/lib/paper/tools/build.js +166 -0
- package/lib/paper/tools/check.d.ts +7 -0
- package/lib/paper/tools/check.js +79 -0
- package/lib/paper/tools/decision.d.ts +13 -0
- package/lib/paper/tools/decision.js +53 -0
- package/lib/paper/tools/defense.d.ts +11 -0
- package/lib/paper/tools/defense.js +74 -0
- package/lib/paper/tools/init.d.ts +23 -0
- package/lib/paper/tools/init.js +99 -0
- package/lib/paper/tools/lit.d.ts +27 -0
- package/lib/paper/tools/lit.js +236 -0
- package/lib/paper/tools/progress.d.ts +18 -0
- package/lib/paper/tools/progress.js +77 -0
- package/lib/paper/tools/review.d.ts +11 -0
- package/lib/paper/tools/review.js +41 -0
- package/lib/ppt/actions.d.ts +97 -0
- package/lib/ppt/actions.js +263 -0
- package/lib/ppt/check.d.ts +64 -0
- package/lib/ppt/check.js +185 -0
- package/lib/ppt/commands.d.ts +28 -0
- package/lib/ppt/commands.js +71 -0
- package/lib/ppt/convert.d.ts +146 -0
- package/lib/ppt/convert.js +423 -0
- package/lib/ppt/index.d.ts +45 -0
- package/lib/ppt/index.js +57 -0
- package/lib/ppt/marp.d.ts +74 -0
- package/lib/ppt/marp.js +165 -0
- package/lib/ppt/outline.d.ts +206 -0
- package/lib/ppt/outline.js +695 -0
- package/lib/shared/define-tool.d.ts +77 -0
- package/lib/shared/define-tool.js +235 -0
- package/lib/shared/fs-errors.d.ts +50 -0
- package/lib/shared/fs-errors.js +90 -0
- package/lib/shared/index.d.ts +31 -0
- package/lib/shared/index.js +32 -0
- package/lib/shared/spawn.d.ts +38 -0
- package/lib/shared/spawn.js +50 -0
- package/lib/shared/text.d.ts +14 -0
- package/lib/shared/text.js +26 -0
- package/package.json +82 -0
- package/skills/code-walkthrough/SKILL.md +94 -0
- package/skills/code-walkthrough/references/examples.md +129 -0
- package/skills/paper-dedup/SKILL.md +58 -0
- package/skills/paper-intake/SKILL.md +64 -0
- package/skills/thesis-citation/SKILL.md +67 -0
- package/skills/thesis-defense/SKILL.md +87 -0
- package/skills/thesis-eng-design/SKILL.md +97 -0
- package/skills/thesis-inquiry/SKILL.md +55 -0
- package/skills/thesis-inquiry/references/intent-spec-template.md +39 -0
- package/skills/thesis-literature/SKILL.md +56 -0
- package/skills/thesis-opener/SKILL.md +77 -0
- package/skills/thesis-pipeline/SKILL.md +121 -0
- package/skills/thesis-writing/SKILL.md +86 -0
package/README.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# dsh-thesis
|
|
2
|
+
|
|
3
|
+
**把一堆材料变成一篇经得起查重与答辩的论文,和一个讲得清自己系统的你。**
|
|
4
|
+
|
|
5
|
+
`dsh-thesis` 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的单一插件。
|
|
6
|
+
给它学校模板、论文要求、实验数据、代码和参考文献,它会**先追问、再动手**——
|
|
7
|
+
把要求问成一份可证伪的《意图规格》,然后按九个阶段推进:
|
|
8
|
+
|
|
9
|
+
**选题 → 开题 → 文献 → 设计 → 实现 → 测试 → 论文 → 合规 → 答辩**
|
|
10
|
+
|
|
11
|
+
全程留痕(进度台账 + 决定日志 + 检索记录 + 检查报告),每一步都要你拍板。
|
|
12
|
+
|
|
13
|
+
纯 TypeScript,零运行时第三方依赖(唯一的 devDependency 是 TypeScript 本身)。
|
|
14
|
+
|
|
15
|
+
> **立场**:插件对外只呈现**一个领域模型——大学生写论文**。
|
|
16
|
+
> 学生的工具清单里只有两个命名空间:`thesis_*`(操作论文工作区里的东西)与
|
|
17
|
+
> `fact_*`(跨会话仍然成立的事实:学校规范、导师要求、你的写作偏好)。
|
|
18
|
+
> 答辩层的代码演练用 `defense_code_*`。没有第四套命名。
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 安装
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# 从 npm 安装(DSH 的插件安装会转发给 pnpm,机器上需要 pnpm)
|
|
26
|
+
dsh plugin --profile web add dsh-thesis
|
|
27
|
+
|
|
28
|
+
# 重启 dsh 后确认装上了 —— 应能看到 thesis_* / fact_* / defense_code_* 三个命名空间的工具
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**从源码安装**(想改代码、或本机没有 pnpm):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://github.com/Paloma966/dsh-thesis.git && cd dsh-thesis
|
|
35
|
+
npm install && npm run build # 插件必须发布编译后的 JS,DSH 没有 TS 加载器
|
|
36
|
+
dsh plugin --profile web add "$PWD" # 需要 pnpm
|
|
37
|
+
|
|
38
|
+
# 没有 pnpm 时的兜底:建 profile 联接 + 打印要粘贴的补丁片段,然后重启 dsh
|
|
39
|
+
node scripts/install-into-profile.mjs --profile web
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
卸载:`dsh plugin --profile web remove dsh-thesis`(兜底方式安装的用 `install-into-profile.mjs --remove`)。
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 30 秒上手
|
|
47
|
+
|
|
48
|
+
装好并重启 dsh 后,在对话里说:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
这是我的论文材料,帮我做毕业设计
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
然后把学校模板、要求文档、实验数据、代码、参考文献丢进工作区(或告诉它绝对路径)。
|
|
55
|
+
它会:`thesis_ingest` 读材料 → `thesis_intake` **一次问你一个问题** → 写 `00-管理/意图规格.md`
|
|
56
|
+
→ 建工作区(`thesis_init`)→ 按阶段推进。
|
|
57
|
+
|
|
58
|
+
没有材料也能用:直接说「我要做毕业设计,还没定题」→ 走选题工作坊。
|
|
59
|
+
|
|
60
|
+
> **注意工作区位置**:多数工具从会话的工作目录向上探测 `00-管理/进度台账.md` 来定位论文工作区。
|
|
61
|
+
> 所以**把会话开在论文目录里**最省事;也可以用配置显式指定:
|
|
62
|
+
> `config: { workspace: /path/to/你的论文 }`(路径写错会直接报错,不会写到别处)。
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 它怎么工作
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
你的材料(docx / xlsx / pptx / pdf / md / csv / 代码 / 文献)
|
|
70
|
+
│
|
|
71
|
+
thesis_ingest │ 读成纯文本 + 材料清单
|
|
72
|
+
▼
|
|
73
|
+
┌──────────────────────────────────────────────────────────┐
|
|
74
|
+
│ thesis_intake:逐题追问(一次只问一个问题) │
|
|
75
|
+
│ 每问都带:为什么问 · 影响哪个产出 · 合格答案长什么样 │
|
|
76
|
+
│ 材料里已能读出来的一律不问;答不全的显式列为阻塞项 │
|
|
77
|
+
└──────────────────────────────────────────────────────────┘
|
|
78
|
+
│
|
|
79
|
+
00-管理/意图规格.md(唯一真相)
|
|
80
|
+
▼
|
|
81
|
+
┌────────── 九阶段流水线(G1-G4 人工关卡不可跳) ──────────┐
|
|
82
|
+
│ 选题 → 开题 → 文献 → 设计 → 实现 → 测试 → 论文 → 合规 → 答辩 │
|
|
83
|
+
│ 零假文献(只认真实检索)· 零假数据(只认真实运行) │
|
|
84
|
+
└──────────────────────────────────────────────────────────┘
|
|
85
|
+
│
|
|
86
|
+
┌──────────────┬──────────┴──────────┬──────────────┐
|
|
87
|
+
▼ ▼ ▼ ▼
|
|
88
|
+
论文.docx 答辩幻灯 PPT.md 原创性报告 + 复测 跨会话事实
|
|
89
|
+
(内置零依赖 (Marp 兼容,可 (本地度量, (换个会话不用
|
|
90
|
+
生成器/pandoc) marp/pandoc → pptx) 不接收费系统) 重讲学校规范)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**为什么先追问**:写错方向的代价是整章重写,而问清楚只要十分钟。这是本插件与「AI 直接生成论文」的根本区别。
|
|
94
|
+
|
|
95
|
+
**而且它不靠自觉**:说「帮我写第三章」时,如果意图规格还没立全(缺学校模板/字数/查重阈值/时间线),
|
|
96
|
+
`agent/pre-step` 的写作意图闸门会注入一条指令**强制模型先去追问**;规格就绪后闸门自动安静;
|
|
97
|
+
想跳过就说「直接写」(插件会要求它列出采用的假设)。
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 工具全集(21 个)
|
|
102
|
+
|
|
103
|
+
### 论文工作区(`thesis_*`)
|
|
104
|
+
|
|
105
|
+
| 工具 | 作用 |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `thesis_ingest` | 摄取材料:`.docx`/`.xlsx`/`.pptx`/`.pdf`/`.md`/`.csv`/`.bib`/`.html` → 文本摘要;**源码目录 → 代码结构摘要**(文件/行数/声明/技术栈指纹,不贴源码正文);写 `00-管理/材料清单.md` 与逐文件摘要。旧格式 `.doc/.xls/.ppt` 会明确提示另存为新格式 |
|
|
108
|
+
| `thesis_intake` | 逐题追问状态机:`start`/`ask`/`answer`/`skip`/`status`/`spec`/`done` → 落盘 `00-管理/意图规格.md`(断点续问,永不丢答案) |
|
|
109
|
+
| `thesis_init` | 建论文工作区:九阶段目录、台账、决定日志、时间线、七章模板、文献库骨架、技能包 → `.dsh/skills/`,可选 git 首提交 |
|
|
110
|
+
| `thesis_progress` | 台账读写 + **G1-G4 闸门**(`report`/`update`/`gate`):未过 G1 不许推进阶段、未过 G2 不许验收章节 |
|
|
111
|
+
| `thesis_decide` | 追加决定日志(内容/理由/备选)——答辩「为什么这么做」的答案库 |
|
|
112
|
+
| `thesis_lit_search` | 真实检索:Semantic Scholar → DBLP → arXiv → Crossref 失败降级;结果带真实 DOI/URL 并缓存留痕 |
|
|
113
|
+
| `thesis_lit_save` | 把检索到的文献(按缓存 id)收录进 `02-文献/refs.bib`;DOI 去重;**不接受缓存外的 id**(零假文献机制) |
|
|
114
|
+
| `thesis_lit_note` | 生成文献阅读笔记骨架(五节模板,摘要自动填入) |
|
|
115
|
+
| `thesis_review` | 单章确定性评审六项:字数区间、大纲齐全、引用对应、图表编号、未完成标记、G2 清单 |
|
|
116
|
+
| `thesis_check` | 全文五项检查:引用双向一致、每章字数、图表编号、术语先定义后使用、学校模板探测 |
|
|
117
|
+
| `thesis_build` | 出 `论文.docx`:优先 pandoc + 学校模板;无 pandoc 用**内置零依赖** docx 生成器(自实现 ZIP/CRC32/WordprocessingML) |
|
|
118
|
+
| `thesis_stylecheck` | 写作风格自查六条启发式(套话/空洞结论/自我暴露/翻译腔/句式单一/无锚点),附行号与改写建议 |
|
|
119
|
+
|
|
120
|
+
### 合规(原创性)
|
|
121
|
+
|
|
122
|
+
| 工具 | 作用 |
|
|
123
|
+
|---|---|
|
|
124
|
+
| `thesis_originality` | `scan` 找高风险段落(行号 + 命中来源 + 改写处方)→ 改完 `verify` 复测降幅 → `report` 汇总(可回填学校检测结果)。**本地确定性估算,不接知网/维普** |
|
|
125
|
+
|
|
126
|
+
### 答辩
|
|
127
|
+
|
|
128
|
+
| 工具 | 作用 |
|
|
129
|
+
|---|---|
|
|
130
|
+
| `thesis_defense` | 提取答辩素材 + 六类必问问题库(实现细节/技术选型/需求背景/工作量/数据可信/不足展望),附证据锚点 |
|
|
131
|
+
| `thesis_slides` | `outline` 生成 10-12 页 Marp 兼容 `07-答辩/PPT.md`(含讲稿与证据锚点)→ `check` 六项检查 → `convert` 用 marp/pandoc 出 pptx;没有转换器就给出可直接复制的命令与兜底方案 |
|
|
132
|
+
| `defense_code_status` / `defense_code_next` / `defense_code_update` | **代码演练**:把(常常是 AI 写的)系统拆成讲得清的模块,用真实验证门逐个走通,并用可评分的追问确认你在答辩席上讲得出实现细节与取舍 |
|
|
133
|
+
|
|
134
|
+
### 跨会话事实(`fact_*`)
|
|
135
|
+
|
|
136
|
+
| 工具 | 作用 |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `fact_search` / `fact_remember` / `fact_context` | SQLite 事实库(默认 `$DSH_HOME/paper-memory.db`):记住学校规范、导师要求、你的写作偏好。**而且不只被动查询**——你说的话与已确认事实相关时(词面重叠),插件自动把相关条目作为卡片放回上下文(最多 4 条/600 字符,事实没变就不重复注入) |
|
|
139
|
+
|
|
140
|
+
### 斜杠命令(9 个)
|
|
141
|
+
|
|
142
|
+
`/thesis-status` `/thesis-decide` `/thesis-lit` `/thesis-check` `/thesis-build`
|
|
143
|
+
`/thesis-ingest` `/thesis-intake` `/thesis-originality` `/thesis-defense`
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 技能包(方法论,随插件发布)
|
|
148
|
+
|
|
149
|
+
| 技能 | 触发时机 |
|
|
150
|
+
|---|---|
|
|
151
|
+
| `thesis-pipeline` | 每次会话开始(阶段、关卡、工具地图) |
|
|
152
|
+
| `thesis-opener` | 选题、开题报告、G1/G3 |
|
|
153
|
+
| `thesis-literature` | 文献检索与综述 |
|
|
154
|
+
| `thesis-eng-design` | 需求/设计/实现/测试规范 |
|
|
155
|
+
| `thesis-writing` | 写作规范与去 AI 味规则 |
|
|
156
|
+
| `thesis-citation` | GB/T 7714-2015 著录 |
|
|
157
|
+
| `thesis-defense` | 答辩准备与幻灯链路 |
|
|
158
|
+
| `code-walkthrough` | 答辩前把系统讲清(代码演练) |
|
|
159
|
+
| `paper-intake` | 材料到手后的追问方法论 |
|
|
160
|
+
| `paper-dedup` | 原创性自查的诚实做法(什么能改、什么绝不能改) |
|
|
161
|
+
| `thesis-inquiry` | 写作要求/导师口径模糊时的对抗式追问 |
|
|
162
|
+
|
|
163
|
+
`thesis_init` 会把整套技能复制进论文仓库 `.dsh/skills/`(项目级 rank 100,优先级最高),
|
|
164
|
+
所以技能随论文一起 git 版本化、换机器不丢。
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 配置
|
|
169
|
+
|
|
170
|
+
所有字段都有默认值;在 profile 的 `cordis.patch.yml` 里覆盖:
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
- id: paper
|
|
174
|
+
name: dsh-thesis
|
|
175
|
+
config:
|
|
176
|
+
workspace: /path/to/thesis # 缺省从会话 cwd 向上探测 00-管理/进度台账.md
|
|
177
|
+
memoryPath: /path/to/paper-memory.db # 缺省 $DSH_HOME/paper-memory.db
|
|
178
|
+
ingest: { maxBytes: 33554432, maxChars: 60000 }
|
|
179
|
+
intake: { maxQuestions: 12, specRel: '00-管理/意图规格.md' }
|
|
180
|
+
similarity: { shingle: 4, threshold: 0.3, minChars: 30 } # 原创性自查度量
|
|
181
|
+
stylecheck: { reportRel: '08-合规/AI味自查报告.md', maxParagraphChars: 260 }
|
|
182
|
+
ppt: { engine: auto, theme: default, timeoutMs: 120000 } # auto|marp|pandoc|none
|
|
183
|
+
defense: { materialsRel: '07-答辩/答辩素材.md', defaultPages: 11 }
|
|
184
|
+
codeWalkthrough: { stateDir: '.paper', gates: { go: { build: [go, build, ./...] } } }
|
|
185
|
+
recall: { maxEntries: 4, maxChars: 600, minKeywordLength: 2 }
|
|
186
|
+
# 闸门
|
|
187
|
+
writingGate: true # 要求没立稳时拦截「开始写」
|
|
188
|
+
destructiveGate: true # 不可逆命令前提请拍板
|
|
189
|
+
maxQuestions: 3
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
`workspace` **真的生效**:配置了就只认它,且台账不存在时会明确报错——绝不悄悄退回到 cwd 探测去写到别的目录。
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## 红线(写在护栏里,不是写在文档里)
|
|
197
|
+
|
|
198
|
+
1. **零假文献**:正文引用只能来自 `thesis_lit_search` 的真实检索缓存;`thesis_lit_save` 拒绝缓存外的 id;`thesis_check` 复核双向一致。
|
|
199
|
+
2. **零假数据**:实验数据、截图、运行结果必须来自真实运行。工具与技能都不支持伪造,`thesis_originality` 明确禁止为降重改动数据与结论。
|
|
200
|
+
3. **人是作者**:G1-G4 关卡由 `thesis_progress` 强制,未过闸门不许推进;决定必须由用户拍板。
|
|
201
|
+
4. **规范以学校文件为准**:学校模板缺失时,用内置过渡模板并**显式标注"非学校模板"**,绝不假装合规。
|
|
202
|
+
5. **降重不是洗稿**:本插件不接收费查重系统,报告里的重复率是**本地估算**,与学校结果不可等同;用户自行送检后可回填对照。
|
|
203
|
+
6. **不静默销毁数据**:读不出来 ≠ 不存在。工作区里的追问答案、进度台账、文献库、检索记录都是你的资产——
|
|
204
|
+
读取失败时工具**抛错并保持原文件不动**,绝不"用默认值覆盖"。
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 已知边界(诚实清单)
|
|
209
|
+
|
|
210
|
+
- **PDF 抽取是尽力而为**:扫描版 PDF(无文本层)、对象流/加密 PDF 可能抽不出文字,工具会明确返回原因而不是编造内容。
|
|
211
|
+
- **旧格式不支持**:`.doc`/`.xls`/`.ppt` 请先另存为新格式。
|
|
212
|
+
- **幻灯不自研生成器**:产出 Marp 兼容 Markdown,`.pptx` 依赖外部 marp/pandoc;两者都没有时给出可执行命令与兜底路径(幻灯文字已是最终稿,成稿只是排版)。
|
|
213
|
+
- **原创性自查不接收费系统**:无账号,也不该接入;度量口径与算法参数全部写在报告里,可复现、可质疑。
|
|
214
|
+
- **子进程无取消能力**:pandoc/marp/git 走 `spawnSync`,目前**不能中途取消**(有超时上限,但没有信号传递;`exec.signal` 不进入子进程)。
|
|
215
|
+
- **受限环境下管道 stdio 被拒**:某些沙箱里 `stdio: 'pipe'` 会 `EPERM`,插件因此默认用 `stdio: 'ignore'`(见 `src/shared/spawn.ts`)。
|
|
216
|
+
- **类型来自本地 shim**:为了让本仓库零依赖即可 `tsc` 通过,宿主契约以 `src/types/shims.d.ts` 声明(宽松签名),真实签名核对记录在 [docs/host-api.md](./docs/host-api.md)。
|
|
217
|
+
- **代码演练的语言矩阵**:验证门表内置 Go/TS/Python/Rust,其余语言需在配置里补 `gates`。
|
|
218
|
+
- **`dsh plugin` 需要 pnpm**:DSH 的插件安装会转发给 pnpm;机器上只有 Node 时用 `node scripts/install-into-profile.mjs --profile <名>` 兜底。
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## 开发
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
npm install # 只装 typescript 与 schemastery
|
|
226
|
+
npm run build # tsc → lib/(相对导入 .ts → .js 由 rewriteRelativeImportExtensions 处理)
|
|
227
|
+
npm run typecheck # tsc --noEmit
|
|
228
|
+
npm test # node --test tests/(Node 24 直接跑 .ts,类型擦除)
|
|
229
|
+
|
|
230
|
+
# 沙箱/受限环境(禁止子进程管道,node --test 的默认隔离会 EPERM)下用同一进程跑:
|
|
231
|
+
npm run test:sandbox
|
|
232
|
+
|
|
233
|
+
# 完整验收:build + typecheck + 全部单测 + 全量端到端断言
|
|
234
|
+
npm run verify
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### 证据分层(本仓库的质量标准)
|
|
238
|
+
|
|
239
|
+
| 层 | 命令 | 内容 |
|
|
240
|
+
|---|---|---|
|
|
241
|
+
| 单元 / 契约 | `npm run test:sandbox` | 纯逻辑、装配契约(21 工具 / 9 命令 / 2 服务 / 4 类闸门监听)、数据安全与负路径 |
|
|
242
|
+
| **真实场景端到端** | `npm run test:e2e` | `tests/e2e/paper-full-flow.mjs`:内置虚构学校材料夹具,离线跑完 材料→追问→建库→七章→评审→闸门→检查→docx→幻灯→原创性→答辩,逐环校验产物(含独立 ZIP 解压读回 `document.xml`) |
|
|
243
|
+
| **真实宿主** | `npm run test:host` | 真实 cordis + dsh-tools 装配并执行工具、真实 `agent/pre-step` 闸门注入、验证卸载注销 |
|
|
244
|
+
| **真实引擎装载** | `npm run test:host-load` | 真实 `dsh` 引擎解析并校验本插件。⚠️ 引擎需要写 `$DSH_HOME/profiles/<name>/cordis.yml`,在受限沙箱下需放宽文件权限 |
|
|
245
|
+
| 对外表面审计 | `npm run audit` | `scripts/audit-surface.mjs`:工具/命令/技能契约一致 + 宿主解析的文件无 BOM |
|
|
246
|
+
| 真实网络(可选) | `npm run test:net` | 真实学术 API 检索 → 收录 → 笔记 |
|
|
247
|
+
|
|
248
|
+
详细设计见 [DESIGN.md](./DESIGN.md),宿主契约见 [docs/host-api.md](./docs/host-api.md),
|
|
249
|
+
来源声明见 [NOTICE.md](./NOTICE.md)。
|
|
250
|
+
|
|
251
|
+
## 许可
|
|
252
|
+
|
|
253
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# dsh-thesis bundle patch:向 profile 挂载本插件的唯一一行。
|
|
2
|
+
#
|
|
3
|
+
# 插件行按包名引用:安装为 profile 依赖后,Node 模块解析从 profile 的
|
|
4
|
+
# node_modules 找到本包;运行期依赖(cordis / dsh-*)经 DSH 安装本体的
|
|
5
|
+
# 扁平回退解析。
|
|
6
|
+
#
|
|
7
|
+
# 所有配置项均有出厂默认值;需要定制时为该行补 config(示例):
|
|
8
|
+
# - id: paper
|
|
9
|
+
# name: dsh-thesis
|
|
10
|
+
# config:
|
|
11
|
+
# promptGate: true
|
|
12
|
+
# destructiveGate: true
|
|
13
|
+
# memoryPath: /var/lib/dsh/paper-memory.db
|
|
14
|
+
# similarity: { shingle: 4, threshold: 0.25 }
|
|
15
|
+
- insert:
|
|
16
|
+
- id: paper
|
|
17
|
+
name: dsh-thesis
|