dknowc-dsh 1.3.0 → 1.4.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.md +4 -2
- package/package.json +3 -3
- package/skills/dknowc-official-doc-writer/README.md +1 -1
- package/skills/dknowc-official-doc-writer/SKILL.md +26 -6
- package/skills/dknowc-official-doc-writer/reference/sample_trace_report.html +901 -269
- package/skills/dknowc-official-doc-writer/reference/search_guide.md +31 -3
- package/skills/dknowc-official-doc-writer/reference/search_policy.md +14 -1
- package/skills/dknowc-official-doc-writer/reference/task_router.md +1 -1
- package/skills/dknowc-official-doc-writer/scripts/adapt_mcp_result.py +52 -2
- package/skills/dknowc-official-doc-writer/scripts/dkag_search.py +9 -1
- package/skills/dknowc-official-doc-writer/scripts/initialize.py +6 -14
- package/skills/dknowc-official-doc-writer/scripts/mcp_direct.py +1 -1
- package/skills/dknowc-official-doc-writer/scripts/register.mjs +2 -2
- package/skills/dknowc-official-doc-writer/scripts/render_trace_html.py +1317 -607
- package/skills/dknowc-official-doc-writer/scripts/source_note_html.py +140 -4
- package/skills/dknowc-ppt-assistant/SKILL.md +3 -3
- package/skills/dknowc-ppt-assistant/references/material_usage.md +2 -2
- package/skills/dknowc-ppt-assistant/references/sample_trace_report.html +1335 -292
- package/skills/dknowc-ppt-assistant/references/svg-authoring.md +1 -1
- package/skills/dknowc-ppt-assistant/scripts/initialize.py +7 -17
- package/skills/dknowc-ppt-assistant/scripts/register_key.mjs +99 -60
- package/skills/dknowc-ppt-assistant/scripts/render_trace_html.py +1458 -653
- package/skills/dknowc-ppt-assistant/workflows/generate-pptx.md +2 -2
- package/skills/dknowc-trusted-consulting/README.md +1 -1
- package/skills/dknowc-trusted-consulting/SKILL.md +9 -4
- package/skills/dknowc-trusted-consulting/reference/sample_trace_report.html +672 -307
- package/skills/dknowc-trusted-consulting/scripts/initialize.py +24 -34
- package/skills/dknowc-trusted-consulting/scripts/register_key.mjs +5 -3
- package/skills/dknowc-trusted-consulting/scripts/render_trace_html.py +1647 -729
- package/skills/dknowc-trusted-search/README.md +2 -1
- package/skills/dknowc-trusted-search/SKILL.md +3 -2
- package/skills/dknowc-trusted-search/reference/sample_trace_report.html +1110 -251
- package/skills/dknowc-trusted-search/scripts/initialize.py +2 -3
- package/skills/dknowc-trusted-search/scripts/register_key.mjs +2 -2
- package/skills/dknowc-trusted-search/scripts/render_trace_html.py +1590 -692
- package/skills/dknowc-trusted-search/scripts/trusted_search.py +6 -3
- package/src/index.js +1 -1
- package/skills/dknowc-official-doc-writer/scripts/check_release.py +0 -93
- package/skills/dknowc-ppt-assistant/scripts/check_release.py +0 -106
- package/skills/dknowc-trusted-consulting/scripts/check_release.py +0 -66
- package/skills/dknowc-trusted-search/scripts/check_release.py +0 -79
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
6
|
import argparse
|
|
7
|
+
import concurrent.futures
|
|
7
8
|
import importlib.util
|
|
8
9
|
import json
|
|
9
10
|
import re
|
|
10
11
|
import sys
|
|
11
12
|
import unicodedata
|
|
13
|
+
import urllib.error
|
|
14
|
+
import urllib.request
|
|
12
15
|
from pathlib import Path
|
|
13
16
|
|
|
14
17
|
|
|
@@ -85,7 +88,12 @@ def normalize_title(value: str) -> str:
|
|
|
85
88
|
|
|
86
89
|
|
|
87
90
|
def load_source_index() -> dict:
|
|
88
|
-
"""从本地搜索结果按文章标题建立原文 URL 索引,补齐上游整理时遗漏的字段。
|
|
91
|
+
"""从本地搜索结果按文章标题建立原文 URL 索引,补齐上游整理时遗漏的字段。
|
|
92
|
+
|
|
93
|
+
同时从同响应的 policyFiles 区提取发文字号(writtenText)并入索引——
|
|
94
|
+
文号与检索文章分开展示在同一响应里,本地标题匹配即可拿到,无需接口改动;
|
|
95
|
+
新闻/解读类不在 policyFiles 中(本就无文号),匹配不上则不显示。
|
|
96
|
+
"""
|
|
89
97
|
index = {}
|
|
90
98
|
if not SEARCH_RESULTS_DIR.exists():
|
|
91
99
|
return index
|
|
@@ -94,11 +102,26 @@ def load_source_index() -> dict:
|
|
|
94
102
|
data = json.loads(path.read_text(encoding="utf-8"))
|
|
95
103
|
except (OSError, ValueError):
|
|
96
104
|
continue
|
|
97
|
-
|
|
98
|
-
if
|
|
105
|
+
# 兼容两种落盘格式:--clean 白名单(顶层 articles)与接口原始响应(content.data)
|
|
106
|
+
articles = data.get("articles") if isinstance(data.get("articles"), list) else None
|
|
107
|
+
policy_files = []
|
|
108
|
+
if articles is None:
|
|
99
109
|
content = data.get("content", {})
|
|
100
110
|
payload = content.get("data", {}) if isinstance(content, dict) else {}
|
|
101
|
-
|
|
111
|
+
if isinstance(payload, dict):
|
|
112
|
+
articles = payload.get("检索文章", []) if isinstance(payload.get("检索文章"), list) else []
|
|
113
|
+
if isinstance(payload.get("policyFiles"), list):
|
|
114
|
+
policy_files = payload["policyFiles"]
|
|
115
|
+
elif isinstance(data.get("policyFiles"), list):
|
|
116
|
+
policy_files = data["policyFiles"]
|
|
117
|
+
doc_numbers = {}
|
|
118
|
+
for pf in policy_files:
|
|
119
|
+
if not isinstance(pf, dict):
|
|
120
|
+
continue
|
|
121
|
+
doc_no = first_value(pf, "writtenText", "发文字号")
|
|
122
|
+
title = first_value(pf, "title", "标题")
|
|
123
|
+
if doc_no and title:
|
|
124
|
+
doc_numbers.setdefault(normalize_title(title), doc_no)
|
|
102
125
|
for article in articles:
|
|
103
126
|
if not isinstance(article, dict):
|
|
104
127
|
continue
|
|
@@ -111,9 +134,101 @@ def load_source_index() -> dict:
|
|
|
111
134
|
record = {"source_url": source_url, "policy_url": policy_url}
|
|
112
135
|
index.setdefault(title, record)
|
|
113
136
|
index.setdefault(normalize_title(title), record)
|
|
137
|
+
for key, record in list(index.items()):
|
|
138
|
+
if "doc_number" not in record:
|
|
139
|
+
no = doc_numbers.get(key)
|
|
140
|
+
if no:
|
|
141
|
+
record["doc_number"] = no
|
|
114
142
|
return index
|
|
115
143
|
|
|
116
144
|
|
|
145
|
+
# 快照兜底开关:默认启用。接口 screenShotPath 曾存在路径缺 /A/ 层级的拼接 bug
|
|
146
|
+
# (2026-09-16 反馈后端修复中);本开关内的 verify_snapshots 会在展示前完成
|
|
147
|
+
# "补 /A/ 修订 + 逐条可达实测 + 不可达弃用",保证报告中出现的快照全部验证可打开。
|
|
148
|
+
SNAPSHOT_ENABLED = True
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
# 软 404 关键词:政府站常以 HTTP 200 返回"页面不存在"错误页,状态码识别不了,
|
|
152
|
+
# 需读页面标题嗅探。关键词取自实测样例,且仅匹配 <title>(政策正文不会出现在标题里),
|
|
153
|
+
# 误杀风险极低。
|
|
154
|
+
SOFT_404_KEYWORDS = ("页面不存在", "页面未找到", "您访问的页面", "已删除", "已下线", "无法找到", "not found", "404")
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def check_link_alive(url: str, timeout: int = 8) -> bool:
|
|
158
|
+
"""检测原文链接是否仍然可达。失效判据(客观信号,与请求方无关):
|
|
159
|
+
① HTTP 404/410;② 软 404——HTTP 200 但页面标题为典型失效页。
|
|
160
|
+
连接失败、超时、403、5xx 等一律视为"无法确认"按有效处理——政府站
|
|
161
|
+
常对脚本请求反爬,凭这些判死会误杀可用链接。
|
|
162
|
+
"""
|
|
163
|
+
for method in ("HEAD", "GET"):
|
|
164
|
+
try:
|
|
165
|
+
req = urllib.request.Request(
|
|
166
|
+
url, method=method,
|
|
167
|
+
headers={"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"},
|
|
168
|
+
)
|
|
169
|
+
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
|
170
|
+
if resp.status in (404, 410):
|
|
171
|
+
return False
|
|
172
|
+
if method == "GET":
|
|
173
|
+
chunk = resp.read(4096).decode("utf-8", errors="replace")
|
|
174
|
+
title = re.search(r"<title>(.*?)</title>", chunk, re.I | re.S)
|
|
175
|
+
text = title.group(1) if title else chunk[:200]
|
|
176
|
+
lowered = text.lower()
|
|
177
|
+
return not any(k in text or k in lowered for k in SOFT_404_KEYWORDS)
|
|
178
|
+
except urllib.error.HTTPError as e:
|
|
179
|
+
if method == "GET":
|
|
180
|
+
return e.code not in (404, 410)
|
|
181
|
+
except Exception:
|
|
182
|
+
if method == "GET":
|
|
183
|
+
return True
|
|
184
|
+
return True
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def normalize_snapshot_url(url: str) -> str:
|
|
188
|
+
"""快照路径容错:接口部分返回值缺 /A/ 层级(实测 60 条中 5 条,补全后即可访问),
|
|
189
|
+
统一规范化为 https://attach.dknowc.cn/snapshot/A/<2位>/<2位>/<哈希>.jpg。"""
|
|
190
|
+
u = (url or "").strip()
|
|
191
|
+
if u.startswith("https://attach.dknowc.cn/snapshot/") and "/snapshot/A/" not in u:
|
|
192
|
+
return u.replace("/snapshot/", "/snapshot/A/", 1)
|
|
193
|
+
return u
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def mark_dead_links(articles: list[dict]) -> int:
|
|
197
|
+
"""并发检测全部材料的原文链接,404/410 的标记 链接失效=True。返回失效数。"""
|
|
198
|
+
targets = [(i, a["源网址"]) for i, a in enumerate(articles) if (a.get("源网址") or "").strip()]
|
|
199
|
+
if not targets:
|
|
200
|
+
return 0
|
|
201
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as pool:
|
|
202
|
+
alive = dict(zip((i for i, _ in targets), pool.map(check_link_alive, (u for _, u in targets))))
|
|
203
|
+
dead = 0
|
|
204
|
+
for i, _ in targets:
|
|
205
|
+
if not alive.get(i, True):
|
|
206
|
+
articles[i]["链接失效"] = True
|
|
207
|
+
dead += 1
|
|
208
|
+
return dead
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def verify_snapshots(articles: list[dict]) -> int:
|
|
212
|
+
"""快照展示前的路径校验(纯本地检查,不发网络请求):
|
|
213
|
+
组装阶段已由 normalize_snapshot_url 补全 /A/ 层级;此处校验修订后的路径
|
|
214
|
+
是否符合合法格式(https://attach.dknowc.cn/snapshot/A/…),不合法则弃用。
|
|
215
|
+
|
|
216
|
+
不做网络可达检测:attach 前置雷池 WAF 的拦截与请求方 IP 风控相关
|
|
217
|
+
(检测机高频请求会被拦而普通用户正常),可达性实测会误杀好快照;
|
|
218
|
+
快照文件本身的存在性由可信搜索侧的数据质量保障。
|
|
219
|
+
"""
|
|
220
|
+
dropped = 0
|
|
221
|
+
for a in articles:
|
|
222
|
+
u = (a.get("快照链接") or "").strip()
|
|
223
|
+
if not u:
|
|
224
|
+
continue
|
|
225
|
+
if u.startswith("https://attach.dknowc.cn/snapshot/A/"):
|
|
226
|
+
continue
|
|
227
|
+
a["快照链接"] = ""
|
|
228
|
+
dropped += 1
|
|
229
|
+
return dropped
|
|
230
|
+
|
|
231
|
+
|
|
117
232
|
def to_trace_payload(data: dict) -> tuple[dict, str, str]:
|
|
118
233
|
title = first_value(data, "title", "标题") or "可信溯源报告"
|
|
119
234
|
answer = first_value(data, "document_content", "documentContent", "正文", "body", "answer", "content_markdown")
|
|
@@ -133,8 +248,10 @@ def to_trace_payload(data: dict) -> tuple[dict, str, str]:
|
|
|
133
248
|
matched = source_index.get(material_name) or source_index.get(normalize_title(material_name), {})
|
|
134
249
|
source_url = first_value(item, "source_url", "sourceUrl", "源网址", "原文链接", "url") or matched.get("source_url", "")
|
|
135
250
|
policy_url = first_value(item, "policyUrl", "policy_url", "knowledgeBase", "知识专库链接") or matched.get("policy_url", "")
|
|
251
|
+
doc_number = first_value(item, "doc_number", "文号") or matched.get("doc_number", "")
|
|
136
252
|
articles.append({
|
|
137
253
|
"文章标题": material_name,
|
|
254
|
+
"文号": doc_number,
|
|
138
255
|
"来源": first_value(item, "source", "来源", "publisher"),
|
|
139
256
|
"发布日期": first_value(item, "date", "发布日期", "time"),
|
|
140
257
|
# 接口原始结构透传:发布日期可信度 + 段落(含段落标题,用于"原文位置"标题链)
|
|
@@ -144,6 +261,9 @@ def to_trace_payload(data: dict) -> tuple[dict, str, str]:
|
|
|
144
261
|
"正文对应": first_value(item, "section", "正文对应"),
|
|
145
262
|
"源网址": source_url,
|
|
146
263
|
"知识专库原文": policy_url,
|
|
264
|
+
# 快照链接(接口 screenShotPath):原文 404 时的存档兜底,渲染层择一展示。
|
|
265
|
+
# 接口刚上线数据不稳(实测部分快照 404/NoSuchKey),默认关闭,--enable-snapshot 打开。
|
|
266
|
+
"快照链接": normalize_snapshot_url(first_value(item, "snapshot_url", "快照链接", "screenShotPath", "screenshot_path")) if SNAPSHOT_ENABLED else "",
|
|
147
267
|
"policyUrl": first_value(item, "policyUrl", "policy_url"),
|
|
148
268
|
"类型": first_value(item, "type", "素材类型") or "材料",
|
|
149
269
|
"核验": first_value(item, "verification", "核验", "核验说明"),
|
|
@@ -172,10 +292,26 @@ def main() -> None:
|
|
|
172
292
|
parser = argparse.ArgumentParser(description="生成深知可信搜索同款可信溯源报告 HTML")
|
|
173
293
|
parser.add_argument("input", help="结构化可信溯源 JSON,必须位于 official-docs/input")
|
|
174
294
|
parser.add_argument("--output", "-o", help="输出 HTML 文件名,默认写入 official-docs/output")
|
|
295
|
+
parser.add_argument("--skip-link-check", action="store_true",
|
|
296
|
+
help="跳过原文链接活性检测(默认检测:404/410 标记失效)")
|
|
297
|
+
parser.add_argument("--disable-snapshot", action="store_true",
|
|
298
|
+
help="关闭快照兜底展示(默认启用:原文 404 时以验证过的存档快照替换)")
|
|
175
299
|
args = parser.parse_args()
|
|
300
|
+
if args.disable_snapshot:
|
|
301
|
+
global SNAPSHOT_ENABLED
|
|
302
|
+
SNAPSHOT_ENABLED = False
|
|
176
303
|
input_path = resolve_input(args.input)
|
|
177
304
|
data = json.loads(input_path.read_text(encoding="utf-8"))
|
|
178
305
|
payload, title, answer = to_trace_payload(data)
|
|
306
|
+
articles = payload.get("content", {}).get("data", {}).get("检索文章", [])
|
|
307
|
+
if not args.skip_link_check:
|
|
308
|
+
dead = mark_dead_links(articles)
|
|
309
|
+
if dead:
|
|
310
|
+
print(f"链接检测:{dead} 条原文链接已失效(404/410),将改用存档快照或如实标注")
|
|
311
|
+
if SNAPSHOT_ENABLED:
|
|
312
|
+
dropped = verify_snapshots(articles)
|
|
313
|
+
total = sum(1 for a in articles if (a.get("快照链接") or "").strip())
|
|
314
|
+
print(f"快照校验:{total} 条路径合法放行 / 弃用 {dropped} 条非法路径(已自动补全 /A/,不做网络检测)")
|
|
179
315
|
# 生成前校验:有素材但正文无角标 = 无法建立核验对应,拒绝生成,要求先修 JSON
|
|
180
316
|
materials_count = len(data.get("materials") or [])
|
|
181
317
|
if materials_count and not re.search(r"\[\d+\]", answer):
|
|
@@ -7,7 +7,7 @@ description: "当用户要求制作 PPT、演示文稿、汇报 PPT、工作总
|
|
|
7
7
|
description_zh: "深知可信PPT,是由北京彩智科技有限公司旗下“深知可信智能”提供的演示文稿制作助手,高效、专业地完成企事业单位与政府机关等场景下的汇报演示制作、课件宣讲和材料转化需求,所有事实素材与数据依据,都全程可溯源到权威部门发布的规范性文件。本技能用于工作汇报PPT、专题汇报、总结汇报、述职汇报、政策宣讲、培训课件、数据汇报等演示文稿制作,也支持把用户上传的 Word 文稿、会议记录、调研报告等工作材料直接转为 PPT,帮助用户把零散想法、汇报要点、工作素材转化为逻辑清楚、重点突出、风格得体、可直接修改使用的演示文稿。内置党政简洁、数据图表、商务汇报、庄重典雅、培训课件等风格预设,支持 16:9、4:3、小红书、朋友圈、竖版故事、A4 等多画布规格。依托深知可信搜索,获取准确有效的法规政策依据、行业信息与数据、标准规范和案例参考,并单独生成可交互的溯源核验报告,帮助用户讲得有依据、能复核、可交付。演示文稿支持生成真实可编辑的 PowerPoint 文档(.pptx),原生形状、文本、图表与表格均可在 PowerPoint/WPS 中继续修改,并配套交付可点击核验的溯源核验报告。"
|
|
8
8
|
description_en: "dknowc PPT assistant is a presentation-generation Skill provided by dknowc Trusted Intelligence under Beijing Caizhi Technology Co., Ltd. It combines reasoning-first presentation methodology with a trusted content layer: authoritative materials with sources are gathered through dknowc Trusted Search, confirmed as a content pack, then hand-authored page by page as constrained SVG and compiled by a deterministic converter into a genuinely editable native PowerPoint (real shapes, text, charts and tables). Built-in party/government-compliant style presets; multi-canvas support (16:9, 4:3, RED, square, story, A4); delivers .pptx plus a clickable provenance HTML."
|
|
9
9
|
category: "通用办公"
|
|
10
|
-
version: "1.
|
|
10
|
+
version: "1.3.0-dsh"
|
|
11
11
|
author: "彩智科技"
|
|
12
12
|
permissions:
|
|
13
13
|
network:
|
|
@@ -66,7 +66,7 @@ node {skillDir}/scripts/register_key.mjs send --phone <手机号>
|
|
|
66
66
|
node {skillDir}/scripts/register_key.mjs register --phone <手机号> --vcode <验证码> --organ 个人 --name 用户
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
手机号已注册时默认查回已有 Key。脚本各分支输出 `user_message`(成功/格式错/验证码错/网络异常/新建 Key 失败沿用原 Key
|
|
69
|
+
手机号已注册时默认查回已有 Key。脚本各分支输出 `user_message`(成功/格式错/验证码错/网络异常/新建 Key 失败沿用原 Key),**必须原样转述给用户**;手机号全程脱敏。**注册成功自动把 Key 写入 `~/.zshrc` 标记块**(与其他三个深知 skill 共用同一标记块,幂等替换;`--no-zshrc` 跳过,回执 `envWriteSucceeded`)。dsh 场景当前任务经 `scripts/mcp_direct.py` 直调完成(脚本自动解析 Key),交付后建议重启 dsh 或新建会话走 MCP 转接。不在对话中回显完整访问密钥(与密码同理,防截屏泄露)。默认不重新生成 Key;用户明确要求时才加 `--new-key`。用户不希望脚本注册时,给出降级地址 `https://platform.dknowc.cn/auth/#/login`。
|
|
70
70
|
|
|
71
71
|
### 开通引导规则(需要检索的任务)
|
|
72
72
|
|
|
@@ -108,7 +108,7 @@ node {skillDir}/scripts/register_key.mjs register --phone <手机号> --vcode <
|
|
|
108
108
|
2. **结构方案确认门**:内容包(核心信息/叙事/页面规划/素材清单)+ 风格预设一起确认后,才创建项目、写 SVG。
|
|
109
109
|
3. **主 Agent 逐页手写 SVG**:遵循 [`references/svg-authoring.md`](references/svg-authoring.md) 的元素契约与排版纪律;禁止脚本批量生成页面。
|
|
110
110
|
4. **质检不过不导出**:`svg_quality_checker.py` errors 必须修复;导出用 `svg_to_pptx.py`(quick 无锁模式),产物是**原生可编辑** .pptx,不得降级为整页图片。
|
|
111
|
-
5.
|
|
111
|
+
5. **双报告全程可溯源**:执行过检索的任务,结构方案确认门前生成**提纲版**溯源核验报告(事前核验,用户确认提纲即可逐条点开原文),交付时生成**成稿版**(事后溯源);两版同脚本同形式,首屏为核验报告单与过程回顾条(五项真实计算指标);正文连续文档流+句后引文胶囊(点击原地展开溯源卡:多段分块+面包屑标题链+查看全文/存档全文);材料专库独立视图(大搜索/热词/检索分组 tabs/已引用筛选);章节引用徽章;只看正文/复制全文/打印归档工具;生成时链接活性检测(--skip-link-check)与快照兜底(--disable-snapshot);提纲表格角标就地变胶囊,素材无角标对应时脚本拒绝生成([`references/material_usage.md`](references/material_usage.md));与 .pptx 三件套一并交付并说明其为辅助核验文件。
|
|
112
112
|
|
|
113
113
|
## 参考资料索引
|
|
114
114
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
## 三、溯源核验报告(双版)与答案文件编制规范
|
|
24
24
|
|
|
25
|
-
执行过检索的任务生成**两版报告**,同一脚本(`render_trace_html.py`)、同一形式与交互;输入均为「检索 JSON +
|
|
25
|
+
执行过检索的任务生成**两版报告**,同一脚本(`render_trace_html.py`)、同一形式与交互;输入均为「检索 JSON + 带角标的答案文件」。报告为**核验式**呈现(3.7.0 同源重构):顶栏身份章 + 工具组(只看正文/复制全文/打印归档下拉)+ 阅读进度条;核验报告单(依据溯源/引用对应/材料新旧/材料构成/交付前检查五项指标 + 现行效力建议复核)与过程回顾条(检索→入库→逐条比对→核验完成,数字全部真实计算);正文为连续文档流(章节标题带「本章引用 N 处 · 已核验」徽章),句后**引文胶囊**(编号圆徽章+材料标题,点击原地展开溯源卡:原文直达区+文号·数据源·日期+多段分块摘录,再点收起;同一块内同一材料只保留最后一处角标与胶囊);**材料专库**独立视图(大搜索、热词真实计算、检索分组 tabs、已引用/未引用筛选、单列宽卡);材料卡含面包屑标题链(文章 › 章 › 节)、高可信徽标(发布日期可信度=高)、未引用灰标;**生成时自动检测原文链接活性**(HTTP 404/410 + 政府站软 404 标题嗅探,连接失败保守放行防误杀),失效链接改用接口存档快照(screenShotPath)回看,按钮如实区分「查看全文/查看存档全文」;未绑定角标红色警示;`@media print` 打印归档(只打印正文 / 完整归档含核验材料附录)。
|
|
26
26
|
|
|
27
27
|
| 版本 | 生成时机 | 作用 | 答案文件内容 | 自检项(self_check) |
|
|
28
28
|
| --- | --- | --- | --- | --- |
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
- **无链接材料交付前必补(不可抗力除外)**:接口偶有材料不带 `源网址`——合并时逐条检查,**交付前必须先尝试人工补链**(经权威官方入口检索核实后补真实 URL,填 `源网址`/`policyUrl`,同步核实数据源名称);只有确实无法找到官方链接的(材料下线、无公开 URL)才保留「无原文链接 · 需注意」提醒交付,并向用户说明原因。禁止伪造链接。
|
|
38
38
|
- **`self_check` 交付前必写**:提纲版与成稿版交付时,合并 JSON 必须写入 `self_check`(5 项如实结果)——「未记录」状态不应出现在交付物中。
|
|
39
39
|
- 每条材料按素材清单加 `类型` 字段(政策依据/数据支撑/参考案例/表述参考)——用于核验报告单「材料构成」指标与来源卡色系(绿/蓝/橙/灰)。
|
|
40
|
-
- 多路检索合并时给每条材料加 `搜索条件`(search_key
|
|
40
|
+
- 多路检索合并时给每条材料加 `搜索条件`(search_key,本路的阅读友好名,如「国家·政策」「青岛·数据」)——材料专库按其生成分组 tabs;**合并时保留接口原始字段不得丢弃**:`段落[].标题`(该段在原文件中的章节位置,渲染为多段分块面包屑链)、`发布日期可信度`(「高」=模型治理入库,渲染高可信徽标)、`screenShotPath`(接口存档快照,原文链接失效时兜底回看,渲染器自动处理无需改写)。
|
|
41
41
|
- 检索召回但正文未采用的相关材料(排除明显无关后)全量放入顶层 `recalled_materials` 数组——报告「未引用素材」分组展示,不占正文角标编号、不参与核验统计(其缺链不影响核验结论,卡上如实标注)。
|
|
42
42
|
- 同一篇文章若在素材清单中占多个编号(不同角标),合并 JSON 各留一条——渲染器按「角标+标题+链接」完整键去重,同一材料不同编号不会被合并。
|
|
43
43
|
- 可选顶层字段:`self_check`(自检 5 项如实结果,键支持中文,值支持 `pass`/`通过:说明文字`/`✓`)、`verification_checks`(需人工复核事项,逐条透传)、`knowledgeBase`(保留任一非空值)。
|