dsh-industry-knowledge 0.0.0-stage → 0.4.1-poc
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 +135 -2
- package/cordis.patch.yml +83 -0
- package/cordis.registry.patch.yml +13 -0
- package/docs/INSTALL.md +99 -0
- package/docs/README.md +15 -0
- package/icon.svg +6 -0
- package/lib/client.js +6037 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +79 -4
- package/spec/v1/README.md +171 -0
- package/spec/v1/migrations/001_init.sql +1609 -0
- package/spec/v1/migrations/002_p1_1_revisions.sql +125 -0
- package/spec/v1/migrations/003_run_resume_target.sql +26 -0
- package/spec/v1/migrations/004_budget_ledger_v2_gates.sql +176 -0
- package/spec/v1/migrations/005_gate_verdict.sql +31 -0
- package/spec/v1/migrations/006_gate_bindings.sql +35 -0
- package/spec/v1/migrations/007_receipt_run_lifecycle.sql +37 -0
- package/spec/v1/migrations/008_research_requests.sql +32 -0
- package/spec/v1/migrations/009_research_request_quota.sql +10 -0
- package/spec/v1/migrations/010_research_request_reservation.sql +11 -0
- package/spec/v1/migrations/011_deliverables.sql +48 -0
- package/spec/v1/migrations/012_review_requests.sql +77 -0
- package/spec/v1/migrations/013_evidence_discipline.sql +24 -0
- package/spec/v1/migrations/014_methodology_and_conflicts.sql +46 -0
- package/spec/v1/migrations/015_relations_and_telemetry.sql +39 -0
- package/spec/v1/migrations/README.md +51 -0
- package/spec/v1/ontology/condition-fields.json +27 -0
- package/spec/v1/ontology/cq-registry.json +388 -0
- package/spec/v1/ontology/entity-types.json +343 -0
- package/spec/v1/ontology/metric-contract.md +21 -0
- package/spec/v1/ontology/predicates.json +1612 -0
- package/spec/v1/ontology/template-registry.json +301 -0
- package/src/agents/consulting-agent.mjs +178 -0
- package/src/agents/fake-agent.mjs +126 -0
- package/src/client/DeliverableTab.jsx +59 -0
- package/src/client/DeliverablesTab.jsx +37 -0
- package/src/client/EvidenceCard.jsx +71 -0
- package/src/client/GapsTab.jsx +102 -0
- package/src/client/KnowledgeTab.jsx +296 -0
- package/src/client/OverviewTab.jsx +89 -0
- package/src/client/Panel.jsx +213 -0
- package/src/client/PendingTab.jsx +273 -0
- package/src/client/PipelineTab.jsx +165 -0
- package/src/client/SetupGuide.jsx +108 -0
- package/src/client/artifactTab.jsx +376 -0
- package/src/client/claimBindings.js +37 -0
- package/src/client/claimTab.jsx +222 -0
- package/src/client/config.jsx +800 -0
- package/src/client/configAccess.js +33 -0
- package/src/client/configForm.js +839 -0
- package/src/client/data.js +108 -0
- package/src/client/format.js +159 -0
- package/src/client/index.jsx +298 -0
- package/src/client/integrations.jsx +79 -0
- package/src/client/locales.js +1240 -0
- package/src/client/panelModel.js +111 -0
- package/src/client/reviewAccess.js +42 -0
- package/src/client/reviewQueue.js +98 -0
- package/src/client/settings.jsx +103 -0
- package/src/client/styles.css +669 -0
- package/src/client/surface.js +89 -0
- package/src/client/toolViews.jsx +624 -0
- package/src/client/ui.jsx +110 -0
- package/src/core/artifact-store.mjs +110 -0
- package/src/core/budget.mjs +286 -0
- package/src/core/closure.mjs +210 -0
- package/src/core/comparison-matrix.mjs +189 -0
- package/src/core/coverage-v3.mjs +110 -0
- package/src/core/coverage.mjs +162 -0
- package/src/core/critic-review.mjs +150 -0
- package/src/core/deliverable-card.mjs +141 -0
- package/src/core/deliverable-templates.mjs +135 -0
- package/src/core/deliverables.mjs +334 -0
- package/src/core/entity-graph.mjs +161 -0
- package/src/core/eval-metrics.mjs +77 -0
- package/src/core/evidence-access.mjs +55 -0
- package/src/core/evidence-append.mjs +52 -0
- package/src/core/factory-acquisition-table.mjs +121 -0
- package/src/core/factory-annual-table.mjs +94 -0
- package/src/core/factory-change-drivers.mjs +35 -0
- package/src/core/factory-compile-entry.mjs +244 -0
- package/src/core/factory-compiler.mjs +789 -0
- package/src/core/factory-context.mjs +172 -0
- package/src/core/factory-counted-disclosures.mjs +32 -0
- package/src/core/factory-diagram-evidence.mjs +133 -0
- package/src/core/factory-discovery.mjs +148 -0
- package/src/core/factory-docling-adapter.mjs +181 -0
- package/src/core/factory-document-profile.mjs +311 -0
- package/src/core/factory-evidence-drafts.mjs +65 -0
- package/src/core/factory-executive-roster.mjs +68 -0
- package/src/core/factory-generic-table.mjs +390 -0
- package/src/core/factory-governance-evidence.mjs +80 -0
- package/src/core/factory-grounded-narrative.mjs +361 -0
- package/src/core/factory-layout-views.mjs +27 -0
- package/src/core/factory-operating-profile.mjs +67 -0
- package/src/core/factory-plan.mjs +90 -0
- package/src/core/factory-position-evidence.mjs +75 -0
- package/src/core/factory-publish.mjs +281 -0
- package/src/core/factory-reported-emissions.mjs +155 -0
- package/src/core/factory-reported-performance.mjs +236 -0
- package/src/core/factory-risk-assessment.mjs +75 -0
- package/src/core/factory-ruled-table.mjs +191 -0
- package/src/core/factory-screen.mjs +34 -0
- package/src/core/factory-segment-table.mjs +100 -0
- package/src/core/factory-shared-subject.mjs +23 -0
- package/src/core/factory-snapshot.mjs +29 -0
- package/src/core/factory-statistics.mjs +76 -0
- package/src/core/factory-structural-relations.mjs +34 -0
- package/src/core/factory-supplier-audit-table.mjs +105 -0
- package/src/core/factory-supplier-policy.mjs +81 -0
- package/src/core/factory-technical-event.mjs +65 -0
- package/src/core/factory-text-blocks.mjs +96 -0
- package/src/core/factory-training-curriculum.mjs +49 -0
- package/src/core/factory-visual-evidence.mjs +271 -0
- package/src/core/gates.mjs +371 -0
- package/src/core/hashes.mjs +120 -0
- package/src/core/html-renderer.mjs +219 -0
- package/src/core/human-review.mjs +275 -0
- package/src/core/interactive-research.mjs +686 -0
- package/src/core/judgment-card.mjs +275 -0
- package/src/core/knowledge-pack.mjs +127 -0
- package/src/core/methodology.mjs +215 -0
- package/src/core/orchestrator.mjs +91 -0
- package/src/core/publish.mjs +541 -0
- package/src/core/recovery.mjs +113 -0
- package/src/core/reference-compiler.mjs +58 -0
- package/src/core/reference-workflow.mjs +231 -0
- package/src/core/release-diff.mjs +168 -0
- package/src/core/release-view.mjs +118 -0
- package/src/core/research-entry.mjs +123 -0
- package/src/core/research-planner.mjs +123 -0
- package/src/core/research-requests.mjs +153 -0
- package/src/core/research-runner.mjs +83 -0
- package/src/core/research-sediment.mjs +111 -0
- package/src/core/research-slot-projection.mjs +292 -0
- package/src/core/retrieval.mjs +269 -0
- package/src/core/reuse.mjs +117 -0
- package/src/core/scope-match.mjs +75 -0
- package/src/core/scope-subset.mjs +56 -0
- package/src/core/search-match.mjs +43 -0
- package/src/core/state-machine.mjs +169 -0
- package/src/core/store.mjs +254 -0
- package/src/core/telemetry.mjs +122 -0
- package/src/core/transfer.mjs +143 -0
- package/src/core/update-check.mjs +136 -0
- package/src/plugin/config-service.mjs +265 -0
- package/src/plugin/config.mjs +319 -0
- package/src/plugin/effective-config.mjs +116 -0
- package/src/plugin/http-api.mjs +737 -0
- package/src/plugin/ik-remote-registration.mjs +14 -0
- package/src/plugin/index.mjs +1391 -0
- package/src/plugin/review-service.mjs +116 -0
- package/src/plugin/role-guard.mjs +60 -0
- package/src/plugin/search-provider.mjs +72 -0
- package/src/plugin/workspace-init.mjs +488 -0
- package/src/providers/agent-executor.mjs +238 -0
- package/src/providers/engines/http.mjs +128 -0
- package/src/providers/engines/index.mjs +196 -0
- package/src/providers/engines/metaso.mjs +102 -0
- package/src/providers/engines/tavily.mjs +84 -0
- package/src/providers/fetch.mjs +236 -0
- package/src/providers/http-transport.mjs +62 -0
- package/src/providers/importer.mjs +198 -0
- package/src/providers/model-budget.mjs +68 -0
- package/src/providers/parser.mjs +171 -0
- package/src/providers/search.mjs +122 -0
- package/src/shared/ik-config-remote.js +55 -0
- package/src/shared/ik-remote.js +10 -0
- package/src/shared/ik-review-remote.js +33 -0
- package/tools/ik-deliverable.mjs +78 -0
- package/tools/ik-import-client.mjs +70 -0
- package/tools/ik-review.mjs +97 -0
package/README.md
CHANGED
|
@@ -1,3 +1,136 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DSH 行业管理知识引擎 POC
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 让咨询顾问在一个行业里,把「找资料 → 判断可信 → 写成可复用知识 → 用在新客户情境」变成一条**可审计、可复用、缺口可见**的确定性流水线。
|
|
4
|
+
|
|
5
|
+
当前状态、测试计数与剩余阻塞项见唯一活状态快照:**[`STATUS.md`](STATUS.md)**。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 快速验证
|
|
10
|
+
|
|
11
|
+
要求:Node `>= 24.19.0`(内置 `node:sqlite`)、`dsh 0.2.2-rc.5`(P3a 真实运行阶段)。
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm run check
|
|
15
|
+
# 依次执行:
|
|
16
|
+
# npm run verify -> node tools/verify-spec.mjs (18 项契约/schema/migration v7 检查)
|
|
17
|
+
# npm test -> node --test (344 项确定性核心、信任边界与插件测试)
|
|
18
|
+
# npm run probes -> node tools/p2a1-probes.mjs && node tools/p2a1-guard-probes.mjs (0/17 + 0/5 红队负例)
|
|
19
|
+
# npm run exp2:sample -- --if-present -> 有本地原件时执行 EXP2 的 110 项检查
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 作为 DSH 插件安装
|
|
23
|
+
|
|
24
|
+
### 从 GitHub 安装
|
|
25
|
+
|
|
26
|
+
仓库:<https://github.com/lewisoepwqi/industry-knowledge>
|
|
27
|
+
|
|
28
|
+
在 DSH 官方 **Plugins → Add plugin → Install a third-party plugin** 中粘贴固定 commit 的安装地址:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
git+https://github.com/lewisoepwqi/industry-knowledge.git#<完整 commit SHA>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`lib/client.js` 已提交进仓库,Git 安装不需要 `prepare`、`prepack` 或 pnpm 构建授权。请使用完整 commit,而不是分支名;更新时移除旧版后安装新 commit。
|
|
35
|
+
|
|
36
|
+
### 官方页面安装(推荐)
|
|
37
|
+
|
|
38
|
+
在仓库根目录执行 `npm ci && npm run verify:package && npm run pack:release`,得到 `dsh-industry-knowledge-0.3.2-poc.tgz`。然后:
|
|
39
|
+
|
|
40
|
+
1. 打开 DSH 左侧 **Plugins → Add plugin → Install a third-party plugin**。
|
|
41
|
+
2. 粘贴 tarball 的**绝对路径**(或已发布时的 npm 包名),确认风险并安装。
|
|
42
|
+
3. 插件启用后会在 `$DSH_HOME/data/industry-knowledge/<profile>/knowledge.sqlite` 自动创建本地知识库,无需点击或填写配置;状态未就绪时刷新页面或重启 DSH 即可重试。
|
|
43
|
+
4. 状态显示 **已配置** 后,打开 **行业知识** 面板或调用 `knowledge_search` 验证。
|
|
44
|
+
|
|
45
|
+
完整步骤、权限与故障排查见 [`docs/INSTALL.md`](docs/INSTALL.md)。安装包包含 Host、Client、locale、图标与迁移文件;`pack:release` 会先重建 Client 再打包。交付其他机器时请使用 tarball,本地目录安装仅用于开发。
|
|
46
|
+
|
|
47
|
+
### 命令行安装(本地开发)
|
|
48
|
+
|
|
49
|
+
`dsh plugin --profile <name> add "$PWD"` 把仓库根作为 bundle 装进目标 profile(本地目录以 `link:` 落盘)。开启 HMR 且 `hmr.root` 覆盖本仓库 `src/` 的 profile(见下节,web 已开)改 JS 后保存即热替换;未开 HMR 的 profile 仍需重启进程。
|
|
50
|
+
|
|
51
|
+
**隔离 profile(POC 默认)**
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
dsh plugin --profile ik-poc add "$PWD"
|
|
55
|
+
dsh --profile ik-poc --dump-config | grep -A 6 dsh-ik-host
|
|
56
|
+
# 卸载:
|
|
57
|
+
dsh plugin --profile ik-poc remove dsh-industry-knowledge
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**web-app 系 profile(含当前 GUI 的 `web`)**
|
|
61
|
+
|
|
62
|
+
- bundle 本身**不插入** `agent-preset-registry`:web-app 自带该实例(默认 preset `standard`),再插一个会报 `service "agentPresets" has been registered`,并留下一个 failed entry(GUI 会提示移除)。4 个 `preset-ik-*` 仍会注册进 web-app 已有的注册表。
|
|
63
|
+
- 没有 `agentPresets` 的 profile(`base` / `headless` 等)另加注册表 overlay:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
dsh --profile ik-headless --patch /path/to/cordis.registry.patch.yml "..."
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- `package.json` 的 `dsh.profile.bundles` 变化在开启 HMR 时会随 profile manifest watch 热应用(web 已开);没开 HMR 的 profile 装完需重启进程:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
dsh plugin --profile web add "$PWD"
|
|
73
|
+
# HMR 开启时无需重启;未开启时重启 dsh web
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- 安装后打开 **Settings → Industry knowledge**:
|
|
77
|
+
- **即时配置**:固定发布版本、`knowledge_search` 默认条数;保存后下一次操作生效。
|
|
78
|
+
- **高级部署配置**:Owner 可编辑 `dbPath`、`workspaceId`、`research` 工作流/授权/来源/工厂管线/超时;`mode` 为只读部署策略,保存前会校验,保存后由 Loader 重挂载。活动研究 Run 或保存进行中时禁止保存。
|
|
79
|
+
- **Open profile config**:打开原生 profile patch;Headless 或无法打开编辑器时仍可手工维护 YAML。
|
|
80
|
+
- host 插件默认未配 `dbPath`,`knowledge_search` 会报 `WORKSPACE_NOT_CONFIGURED`。Headless 部署可在 profile 的 `cordis.patch.yml` 覆盖(override 会整体替换 `config`,字段写全):
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
- id: dsh-ik-host
|
|
84
|
+
config:
|
|
85
|
+
mode: host
|
|
86
|
+
dbPath: /abs/path/to/ik.sqlite
|
|
87
|
+
workspaceId: workspace:default
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 本地调试热重载(web profile 已开)
|
|
91
|
+
|
|
92
|
+
`dsh-hmr` 默认只 watch profile 层配置(`package.json` 的 bundles、profile/home 的 `cordis.patch.yml`),插件源码要显式加 watch 根。在 profile 的 `cordis.patch.yml` 追加:
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
- id: hmr
|
|
96
|
+
disabled: false
|
|
97
|
+
config:
|
|
98
|
+
root:
|
|
99
|
+
- "."
|
|
100
|
+
- "/abs/path/to/dsh-industry-knowledge/src"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- 生效后改 `src/**` 保存即重新导入 `dsh-ik-host`(共用该模块的 preset entry 一起换),**不重启进程、不刷新页面**。2026-12-01 实测:临时改 `ik_iso_status` 返回的 `mode`,下一次工具调用即见新值;还原文件后又变回原值。
|
|
104
|
+
- 不在 watch 范围:bundle 自己的 `cordis.patch.yml` —— 它不是模块。改它需要触发一次 recomposition(改一行 profile patch,或在 Plugins 页 toggle 一次)或重启进程。
|
|
105
|
+
- `~/.dsh/remote-web-3080.log` 不打印 hmr 日志;验证看行为,或查 `/proc/<pid>/fdinfo` 里是否有目标目录的 inotify watch。
|
|
106
|
+
- `root` 是路径数组:新增其它 `link:` 包、或把代码挪到 `lib/` 时,要把对应目录追加进去。
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 仓库目录结构
|
|
111
|
+
|
|
112
|
+
| 目录 / 文件 | 定位 | 说明 |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| [`STATUS.md`](STATUS.md) | 活状态快照 | 阶段状态、测试计数、已关闭信任边界、未完成项与下一步 |
|
|
115
|
+
| [`package.json`](package.json) | 工程入口 | `npm test` / `verify` / `probes` / `check` |
|
|
116
|
+
| [`spec/v1/`](spec/v1/README.md) | 可执行规格(权威契约) | 8 个 JSON Schema、本体 registry(16 类 / 64 谓词 / 20 CQ)、状态机、11 份契约、SQLite migrations `001..007`、fixture 与 L0/P2a/P2a.1 测试 |
|
|
117
|
+
| `spec/industry-knowledge-complete-v0.2/` | 只读历史基线 | 完整规格库 V0.2(PD01–PD06、D01–D08 不可变基线) |
|
|
118
|
+
| `src/core/` | 确定性核心 | 存储、状态机、哈希、产物库、预算、门禁、闭包、发布事务、release 视图、检索、范围匹配、复用判定 |
|
|
119
|
+
| `src/plugin/` | DSH 插件与隔离 | [`role-guard.mjs`](src/plugin/role-guard.mjs)(allowlist 角色隔离与注册表枚举) |
|
|
120
|
+
| `src/agents/` | 测试替身 | `fake-agent.mjs` |
|
|
121
|
+
| `docs/product/` | 产品与业务 | [`pilot-product-spec.md`](docs/product/pilot-product-spec.md)、[`BUSINESS-BRIEF.md`](docs/product/BUSINESS-BRIEF.md)、[`scope-matrix.md`](docs/product/scope-matrix.md) |
|
|
122
|
+
| `docs/architecture/` | 架构与集成 | [`compatibility.md`](docs/architecture/compatibility.md)、[`p3a-integration-plan.md`](docs/architecture/p3a-integration-plan.md) |
|
|
123
|
+
| `docs/adr/` | 架构决策记录 | ADR-0001 至 ADR-0010 |
|
|
124
|
+
| `docs/planning/` | 计划与验收矩阵 | [`plan.md`](docs/planning/plan.md)、[`core-correctness-backlog.md`](docs/planning/core-correctness-backlog.md)、[`acceptance-matrix.md`](docs/planning/acceptance-matrix.md)、[`acceptance-matrix-v0.3.md`](docs/planning/acceptance-matrix-v0.3.md) |
|
|
125
|
+
| `docs/reviews/` | 审查证据 | [`poc-review-v0.3.md`](docs/reviews/poc-review-v0.3.md)、[`design-review-p1.1.md`](docs/reviews/design-review-p1.1.md)、[`design-review.md`](docs/reviews/design-review.md) 与 `review/` |
|
|
126
|
+
| `experiments/` | 实验与探针 | [`exp1/`](experiments/exp1/README.md)、[`exp2/`](experiments/exp2/README.md)(含[首个真实样本 run-001](experiments/exp2/run-001/README.md))、[`exp3/`](experiments/exp3/evaluation-spec.md)、[`exp4/`](experiments/exp4/transfer-spec.md)、`dsh-probe*` |
|
|
127
|
+
| `tools/` | 验收与红队脚本 | `verify-spec.mjs`、`p2a1-probes.mjs`、`p2a1-guard-probes.mjs`、`freeze-spec.mjs` |
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 核心设计原则
|
|
132
|
+
|
|
133
|
+
1. **发布是唯一入口**:Agent 无写库权限;所有状态迁移与发布事务由 `src/core/` 执行,只认 DB 内完整绑定的门禁与审核事实。
|
|
134
|
+
2. **高风险 fail-closed**:`normative` / `prescriptive` / `causal` / 内部来源 / 范围扩张在真人审核通道验证前一律停在 `pending_review`。
|
|
135
|
+
3. **历史可重建**:`stateAt(releaseId)` 仅折叠不可变 release 链,检索与复用判定不读活表可变状态。
|
|
136
|
+
4. **未知不按零算**:Token、成本、网络隔离与抓取失败率均诚实披露,不以假数据或模型常识补缺。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
- insert:
|
|
2
|
+
# 宿主层:只注册只读检索与隔离诊断工具,不注册业务写工具(PR-01 第 1 层)。
|
|
3
|
+
- id: dsh-ik-host
|
|
4
|
+
name: dsh-industry-knowledge
|
|
5
|
+
config:
|
|
6
|
+
mode: host
|
|
7
|
+
# 注意:这里不插入 agent-preset-registry。web-app 系 bundle 已自带该实例,
|
|
8
|
+
# 再插一个会在挂载时报 `service "agentPresets" has been registered` 并留下
|
|
9
|
+
# 一个 failed entry(GUI 会提示移除)。没有 agentPresets 的 profile
|
|
10
|
+
# (base/headless 等)请另加 cordis.registry.patch.yml(见 README)。
|
|
11
|
+
- id: preset-ik-consulting
|
|
12
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
13
|
+
config:
|
|
14
|
+
id: ik-consulting
|
|
15
|
+
name: IK Consulting Agent
|
|
16
|
+
description: Read-only consulting agent backed by published industry knowledge releases.
|
|
17
|
+
order: 90
|
|
18
|
+
plugins:
|
|
19
|
+
- id: persona
|
|
20
|
+
name: '@deepseek-ai/dsh-persona'
|
|
21
|
+
config:
|
|
22
|
+
prefix: >
|
|
23
|
+
You are a read-only consulting agent.
|
|
24
|
+
Always search existing knowledge first via knowledge_search (with includePending: true to reuse recent research drafts).
|
|
25
|
+
Present your final answer using render_judgment_card citing real claimIds, and never assert pending_review or inference_only claims as verified facts.
|
|
26
|
+
When using render_judgment_card, render_comparison_matrix, render_deliverable_card, or knowledge_diff, the complete structured card, table, brief, or diff is automatically presented in the right knowledge copilot sidebar.
|
|
27
|
+
In the conversation body, give only 2–3 sentences of core introduction and next-step suggestion; do not repeat the full structured table, brief, card, diff, or its complete entries.
|
|
28
|
+
When evidence is missing, call render_judgment_card with status: "gap" and a concrete suggestedPrompt so the user can trigger research.
|
|
29
|
+
Call knowledge_research(mode="execute") directly with high-value findings (verifiable sourceUrl and verbatim quote; record unresolved questions in gaps). Only if it returns status="needs_confirmation", explain the contradictions or quota to the user and retry with confirmConflicts=true after approval.
|
|
30
|
+
In prose, cite claims with [K]/[I]/[G]/[P]/[H] tags only.
|
|
31
|
+
Never mention releaseId, workspaceId, dbPath, pending_review, or claim IDs in prose; keep them in the structured card/sidebar details. Do not read the plugin repository, spec/, experiments/, or SQLite files; use knowledge_* tools and public web pages only.
|
|
32
|
+
- id: dsh-ik-consulting
|
|
33
|
+
name: dsh-industry-knowledge
|
|
34
|
+
config:
|
|
35
|
+
mode: consulting
|
|
36
|
+
- id: preset-ik-verifier
|
|
37
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
38
|
+
config:
|
|
39
|
+
id: ik-verifier
|
|
40
|
+
name: IK Verifier
|
|
41
|
+
description: Independent read-only verifier role with allowlist isolation.
|
|
42
|
+
order: 91
|
|
43
|
+
plugins:
|
|
44
|
+
- id: persona
|
|
45
|
+
name: '@deepseek-ai/dsh-persona'
|
|
46
|
+
config:
|
|
47
|
+
prefix: You are an independent verifier. Verify quotes against source snapshots; do not modify claims or run shell commands.
|
|
48
|
+
- id: dsh-ik-verifier
|
|
49
|
+
name: dsh-industry-knowledge
|
|
50
|
+
config:
|
|
51
|
+
mode: verifier
|
|
52
|
+
- id: preset-ik-compiler
|
|
53
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
54
|
+
config:
|
|
55
|
+
id: ik-compiler
|
|
56
|
+
name: IK Compiler
|
|
57
|
+
description: Scoped compiler role with allowlist isolation.
|
|
58
|
+
order: 92
|
|
59
|
+
plugins:
|
|
60
|
+
- id: persona
|
|
61
|
+
name: '@deepseek-ai/dsh-persona'
|
|
62
|
+
config:
|
|
63
|
+
prefix: You are a knowledge compiler. Compile admitted evidence into candidate claims and bindings only.
|
|
64
|
+
- id: dsh-ik-compiler
|
|
65
|
+
name: dsh-industry-knowledge
|
|
66
|
+
config:
|
|
67
|
+
mode: compiler
|
|
68
|
+
- id: preset-ik-researcher
|
|
69
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
70
|
+
config:
|
|
71
|
+
id: ik-researcher
|
|
72
|
+
name: IK Researcher
|
|
73
|
+
description: Scoped researcher role with allowlist isolation.
|
|
74
|
+
order: 93
|
|
75
|
+
plugins:
|
|
76
|
+
- id: persona
|
|
77
|
+
name: '@deepseek-ai/dsh-persona'
|
|
78
|
+
config:
|
|
79
|
+
prefix: You are an industry researcher. Gather verifiable sources and evidence snippets only.
|
|
80
|
+
- id: dsh-ik-researcher
|
|
81
|
+
name: dsh-industry-knowledge
|
|
82
|
+
config:
|
|
83
|
+
mode: researcher
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# cordis.registry.patch.yml — 给「没有 agentPresets 服务」的 profile 补注册表
|
|
2
|
+
#
|
|
3
|
+
# 只在 base/headless 这类没有自带的 profile 里用,例如:
|
|
4
|
+
# dsh --profile ik-headless --patch /path/to/dsh-industry-knowledge/cordis.registry.patch.yml "task"
|
|
5
|
+
#
|
|
6
|
+
# web-app 系 profile(web、ik-poc 等)已经自带 @deepseek-ai/dsh-web-app 的
|
|
7
|
+
# `agent-preset-registry`;再插入本文件的实例会报
|
|
8
|
+
# `service "agentPresets" has been registered`,并把该 entry 标成 failed。
|
|
9
|
+
- insert:
|
|
10
|
+
- id: agent-preset-registry-ik
|
|
11
|
+
name: '@deepseek-ai/dsh-agent-preset-registry'
|
|
12
|
+
config:
|
|
13
|
+
default: ik-consulting
|
package/docs/INSTALL.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# 通过 DSH 官方页面安装
|
|
2
|
+
|
|
3
|
+
适用环境:DeepSeek Harness `0.2.2-rc.5`,Node `>= 24.19.0`。插件包自带 Host 与 Client 产物,不需要单独构建。
|
|
4
|
+
|
|
5
|
+
## 1. 从 GitHub 安装(无需构建授权)
|
|
6
|
+
|
|
7
|
+
仓库:<https://github.com/lewisoepwqi/industry-knowledge>
|
|
8
|
+
|
|
9
|
+
1. 在 GitHub Releases 或提交列表找到要安装的完整 commit SHA。
|
|
10
|
+
2. 打开 DSH 左侧 **Plugins → Add plugin → Install a third-party plugin**。
|
|
11
|
+
3. 粘贴以下地址,将 `<commit-sha>` 替换为 40 位完整提交号:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
git+https://github.com/lewisoepwqi/industry-knowledge.git#<commit-sha>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
4. 确认安装来源与风险说明,选择 **Install**。
|
|
18
|
+
|
|
19
|
+
Git 安装直接使用仓库中已提交的 `lib/client.js`,因此没有 `prepare` 或 `prepack` 脚本,不要求 pnpm 构建授权。不要只写仓库地址或分支名:固定 commit 才能保证安装内容可复核、可复现。
|
|
20
|
+
|
|
21
|
+
更新时先移除旧版,再安装新 commit;安装后仍按下方步骤完成首次配置。
|
|
22
|
+
|
|
23
|
+
## 2. 从 tarball 安装
|
|
24
|
+
|
|
25
|
+
在仓库根目录执行:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm ci
|
|
29
|
+
npm run verify:package
|
|
30
|
+
npm run pack:release
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
得到 `dsh-industry-knowledge-0.3.2-poc.tgz`。`pack:release` 会先显式重建 Client 再打包;`verify:package` 会校验产物新鲜度与打包内容。包不声明 `prepare` 或 `prepack`,避免 pnpm 在 Git 安装时要求构建授权。请分发这个 tarball,而不是整个开发仓库。
|
|
34
|
+
|
|
35
|
+
已发布到 npm 时,可直接使用包名 `dsh-industry-knowledge@0.3.2-poc`。
|
|
36
|
+
|
|
37
|
+
## 3. 在官方页面安装
|
|
38
|
+
|
|
39
|
+
1. 打开 DSH 左侧 **Plugins**。
|
|
40
|
+
2. 选择 **Add plugin → Install a third-party plugin**。
|
|
41
|
+
3. 在安装框粘贴 GitHub 安装 spec、tarball 的**绝对路径**,或 npm 包名。
|
|
42
|
+
4. 确认安装来源与风险说明,选择 **Install**;等待下载、校验与启用完成。
|
|
43
|
+
5. 启用成功后,Host 会自动在 `$DSH_HOME/data/industry-knowledge/<profile>/knowledge.sqlite` 创建本地知识库,无需点击或填写路径;状态未就绪时会后台重试,刷新页面或重启 DSH 可观察结果。也可以稍后从 **Installed plugins** 打开该插件。
|
|
44
|
+
|
|
45
|
+
安装框接受包名、Git 地址、tarball 和绝对本地路径。本地目录安装使用 `link:`,适合开发;交付给其他机器请使用固定 commit 的 GitHub 地址或 tarball。
|
|
46
|
+
|
|
47
|
+
## 4. 完成首次配置
|
|
48
|
+
|
|
49
|
+
默认情况下无需手工配置:插件启用后会在 `$DSH_HOME/data/industry-knowledge/<profile>/knowledge.sqlite` 创建空白知识库,并在同目录写入 `effective.json` 供只读角色使用;不会改写 profile 配置。已有数据库不会被覆盖,旧版本库会先备份再升级。
|
|
50
|
+
|
|
51
|
+
如果需要连接已有知识库,打开插件详情,展开 **高级设置(可选)**:
|
|
52
|
+
|
|
53
|
+
1. 填写已初始化 SQLite 文件的绝对路径与 `workspaceId`。
|
|
54
|
+
2. 选择 **校验并保存**。Host 会检查文件可读、schema 版本、工作区和发布版本是否存在。
|
|
55
|
+
3. 保存成功后选择 **打开知识面板**,确认发布版本与主张计数。
|
|
56
|
+
|
|
57
|
+
`mode` 是部署策略,在页面中只读。研究授权、来源白名单、视觉模型和工厂管线均属于高级配置;保存前会检查活动 Run。没有配置研究授权时,只读检索即可使用,不应为了试用而填写无关的研究参数。
|
|
58
|
+
|
|
59
|
+
## 5. 研究会话的工作目录
|
|
60
|
+
|
|
61
|
+
业务研究不要以插件开发仓库作为工作目录:Host 的通用文件工具会看到 `spec/`、`experiments/`,模型容易把它们当成知识源。建议使用:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
$DSH_HOME/data/industry-knowledge/<profile>/workspace
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
或任意空目录。插件仓库只用于开发、测试和排障;业务问题应通过 `knowledge_*` 工具和公开网页完成。
|
|
68
|
+
|
|
69
|
+
## 6. 人工审核
|
|
70
|
+
|
|
71
|
+
主面板「待确认」和右栏审核台提供页面签字。签字绑定当前登录用户,写 `web_ui` / `session_principal` / `agent_capable_channel`,不要求额外验证,也不冒充 `verified_human`。
|
|
72
|
+
|
|
73
|
+
需要本地真人证明记录时,在运行 DSH 的主机终端执行:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# 查看待审主张
|
|
77
|
+
node <repo>/tools/ik-review.mjs --db <knowledge.sqlite> --workspace workspace:default --list
|
|
78
|
+
|
|
79
|
+
# 批准 / 驳回(必须交互式终端,输入随机确认码)
|
|
80
|
+
node <repo>/tools/ik-review.mjs --db <knowledge.sqlite> --workspace workspace:default \
|
|
81
|
+
--decision approve --claims claim:ir.xxx,claim:ir.yyy --note "原文核对无误"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
只有本地 TTY 通道会写入 `identity_assurance='verified_human'`;页面 Remote 通道写入 `agent_capable_channel`,不能自证真人。HTTP 审核写入保持关闭。
|
|
85
|
+
|
|
86
|
+
## 7. 验证与卸载
|
|
87
|
+
|
|
88
|
+
- 在 **Settings → Industry knowledge** 查看数据源状态与五类计数。
|
|
89
|
+
- 在对话中调用 `knowledge_search`,或打开 **行业知识** 侧栏面板。
|
|
90
|
+
- 卸载:在 **Plugins → Installed plugins → Industry knowledge** 选择 **Remove**。该操作只移除插件依赖与启用选择,不删除 SQLite 文件或知识原件。
|
|
91
|
+
|
|
92
|
+
## 故障排查
|
|
93
|
+
|
|
94
|
+
- **GitHub 安装失败**:确认仓库公开可读,或使用带 SSH 凭据的 Git 地址;展开安装日志检查网络与 Git 认证。固定 commit 的 HTTPS 地址最适合公开仓库。
|
|
95
|
+
- **安装失败**:展开安装日志。tarball 必须位于运行 DSH 的主机上;容器或远程 Host 看不到本机路径。
|
|
96
|
+
- **提示需要重启**:当前 profile 未启用 HMR。保存的安装与配置已持久化,重启 DSH 后生效。
|
|
97
|
+
- **配置不可用**:确认以 owner 身份打开页面,且 `dsh-ik-host` 行已启用。非 owner 不能读取或修改部署配置。若高级设置暂时报 404,等待 Host 重挂载后刷新;默认自动配置不依赖该页面。错误态可在设置页重试初始化,或重启 DSH。
|
|
98
|
+
- **数据库无法打开**:路径必须是绝对路径、文件可读且 schema 为插件要求的最新版本;新文件请使用页面中的创建入口。
|
|
99
|
+
- **Client 页面未更新**:官方页面安装的是所安装版本内的 `lib/client.js`。修改源码后需重新构建、提交,再从新 commit 安装;不能只替换正在运行的旧包。
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 文档入口
|
|
2
|
+
|
|
3
|
+
按这个顺序读,能最快建立上下文:
|
|
4
|
+
|
|
5
|
+
1. [README.md](../README.md):项目定位、安装与工具列表。
|
|
6
|
+
2. [STATUS.md](../STATUS.md):当前阶段、知识库状态、优化批次与下一步。
|
|
7
|
+
3. [CONTEXT.md](../CONTEXT.md):主张、证据、发布、实体、缺口等核心术语。
|
|
8
|
+
4. [优化计划](planning/optimization-plan-2026-12.md):W0–W6 的范围、验收与已知限制。
|
|
9
|
+
5. [安装与人工审核](INSTALL.md):tarball/GitHub 安装、本地 TTY 签字命令。
|
|
10
|
+
6. [真实使用指南](USAGE.md):一轮研究的固定流程、审核与交付物登记。
|
|
11
|
+
7. [ADR](adr/):插件分层、角色隔离、人工审核、发布事务等架构决策。
|
|
12
|
+
8. [首轮真实研究指标](metrics/2026-12-03-songhe-run.md):产出、复用率与质量缺口。
|
|
13
|
+
9. [历史状态归档](history/status-2026-12-03-archive.md):2026-12-03 之前的详细流水。
|
|
14
|
+
|
|
15
|
+
文档分工:`STATUS.md` 只放当前状态;历史流水进 `history/`;实验结论留在 `experiments/`;交付物正文登记到知识库,本地文件只作工作副本。
|
package/icon.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none">
|
|
2
|
+
<path d="M18 6.5 7.5 12 18 17.5 28.5 12 18 6.5Z" fill="#6398F5" fill-opacity=".18" stroke="#6398F5" stroke-width="1.8" stroke-linejoin="round"/>
|
|
3
|
+
<path d="m7.5 17.5 10.5 5.5 10.5-5.5M7.5 23l10.5 5.5L28.5 23" stroke="#8AA7D6" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<circle cx="27.5" cy="26.5" r="4.5" fill="#63B68E" stroke="#63B68E" stroke-width="1.5"/>
|
|
5
|
+
<path d="m25.5 26.5 1.4 1.4 2.7-2.8" stroke="#fff" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
</svg>
|