lingshu-skill 5.64.0 → 5.65.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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/SKILL-lite.md +1 -1
- package/SKILL-tiny.md +1 -1
- package/SKILL.md +1 -1
- package/manifest.json +12 -12
- package/package.json +1 -1
- package/scripts/astrbot_plugin_lingshu/CHECKSUMS.json +8 -8
- package/scripts/astrbot_plugin_lingshu/engine/CHANGELOG.md +9 -0
- package/scripts/astrbot_plugin_lingshu/engine/README.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-lite.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-tiny.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/scripts/checkpoint.py +17 -3
- package/scripts/astrbot_plugin_lingshu/engine/scripts/session_rag.py +11 -3
- package/scripts/checkpoint.py +17 -3
- package/scripts/session_rag.py +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## v5.65(2026-12-04)
|
|
4
|
+
|
|
5
|
+
### 🔧 150 项审计第九批:会话检索、checkpoint 与数据完整性修复
|
|
6
|
+
|
|
7
|
+
1. **LS-034(高·会话主键作用域)**:`session_rag.py` 的 `_msg_id` 将 `platform` 和 `workspace` 纳入主键哈希,同一消息在不同作用域下可分别存在,不再被 IntegrityError 误判跳过。
|
|
8
|
+
2. **LS-038 / LS-050(高·checkpoint 事务一致)**:`checkpoint.py` 修复状态写失败时返回 `state_pending` 明确标记(下次重试不会重复 remember);返回 `memory_id` 改为字符串而非整个 dict。
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
3
12
|
## v5.64(2026-12-04)
|
|
4
13
|
|
|
5
14
|
### 🚀 150 项审计第八批:发布、更新与 CI 流程工具组闭环修复
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 名字取自《黄帝内经》:**算力给思考,人格给灵魂,记忆给生命。**
|
|
4
4
|
|
|
5
|
-
> 当前版本 **v5.
|
|
5
|
+
> 当前版本 **v5.65**(变更见 [CHANGELOG.md](CHANGELOG.md))
|
|
6
6
|
|
|
7
7
|
> 🔁 **双仓库镜像**:GitHub(主)与 Gitee(镜像)保持同步——[gitee.com/htmcwy_0/lingshu-skill](https://gitee.com/htmcwy_0/lingshu-skill)。灵枢的更新检查会探测两边最新提交,**谁更新就自动从谁拉取**;任一边不可达(Gitee 匿名风控 / GitHub 限额)时走另一边兜底。
|
|
8
8
|
|
package/SKILL-lite.md
CHANGED
package/SKILL-tiny.md
CHANGED
package/SKILL.md
CHANGED
package/manifest.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.
|
|
2
|
+
"version": "5.65",
|
|
3
3
|
"files": {
|
|
4
4
|
"CHANGELOG.md": {
|
|
5
|
-
"sha256": "
|
|
6
|
-
"size":
|
|
5
|
+
"sha256": "e27b556191e67e076c379259847981c068d0b2fb8c6eab8d978db93a8b9cd174",
|
|
6
|
+
"size": 431283
|
|
7
7
|
},
|
|
8
8
|
"README.md": {
|
|
9
|
-
"sha256": "
|
|
9
|
+
"sha256": "e3ce4512c17ab414566ffd9408df5eebd98d2793631c515649dc663842d5d519",
|
|
10
10
|
"size": 114303
|
|
11
11
|
},
|
|
12
12
|
"SKILL-lite.md": {
|
|
13
|
-
"sha256": "
|
|
13
|
+
"sha256": "d9e1a026c1eaeab515bcf86bca7972e9093c38491a8280f590cd23ed9cdd425e",
|
|
14
14
|
"size": 4440
|
|
15
15
|
},
|
|
16
16
|
"SKILL-tiny.md": {
|
|
17
|
-
"sha256": "
|
|
17
|
+
"sha256": "e041d8e6c45c7651b4345d9eb87842ee9b37f51ce4f6e7ac22307ce7dc4ee86d",
|
|
18
18
|
"size": 1913
|
|
19
19
|
},
|
|
20
20
|
"SKILL.md": {
|
|
21
|
-
"sha256": "
|
|
21
|
+
"sha256": "ca95e464ff040753b717241fb5535886278fbf04b7fe151492cb39aa165e5019",
|
|
22
22
|
"size": 25366
|
|
23
23
|
},
|
|
24
24
|
"assets/lingshu-icon-preview.png": {
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"size": 5588
|
|
139
139
|
},
|
|
140
140
|
"package.json": {
|
|
141
|
-
"sha256": "
|
|
141
|
+
"sha256": "2bf2d2b7a7ab99c44a774b6761b78dccbee9b1e614a5c0985567f1ffc69014b9",
|
|
142
142
|
"size": 1503
|
|
143
143
|
},
|
|
144
144
|
"scripts/anchor_retention.py": {
|
|
@@ -186,8 +186,8 @@
|
|
|
186
186
|
"size": 14445
|
|
187
187
|
},
|
|
188
188
|
"scripts/checkpoint.py": {
|
|
189
|
-
"sha256": "
|
|
190
|
-
"size":
|
|
189
|
+
"sha256": "4757e4783dde68757ccf89a3d0d28e704038d365e20e455a09a8d0485b43255d",
|
|
190
|
+
"size": 10000
|
|
191
191
|
},
|
|
192
192
|
"scripts/cli.py": {
|
|
193
193
|
"sha256": "e68709f183eae3cb407732f52df91fd65d22f4327b101a8bbc26df93c2a7b69f",
|
|
@@ -394,8 +394,8 @@
|
|
|
394
394
|
"size": 33312
|
|
395
395
|
},
|
|
396
396
|
"scripts/session_rag.py": {
|
|
397
|
-
"sha256": "
|
|
398
|
-
"size":
|
|
397
|
+
"sha256": "ac79eab81fc4a423417c811c8f3737b461ab48e68a76da2fb9c71521d5826e1f",
|
|
398
|
+
"size": 10214
|
|
399
399
|
},
|
|
400
400
|
"scripts/session_summary.py": {
|
|
401
401
|
"sha256": "7f86a47cfb75b5340f748176f3cd2ca2242bd568351f241df6b9bbd6da3e66c0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lingshu-skill",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.65.0",
|
|
4
4
|
"description": "Brain-inspired persistent memory, persona and growth system for AI coding agents. Local-only, zero-dependency Python. Requires Python 3.10+.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"PATCH_NOTES.md": "9296e524f743f358fd11115598398a754cfd69534526dde9c8ad85f14a418f89",
|
|
3
3
|
"README.md": "3d634d743b085eebd2cbb5dd3a00edfa728ed23947e20cc29e7c3b29087ec043",
|
|
4
|
-
"engine/CHANGELOG.md": "
|
|
5
|
-
"engine/README.md": "
|
|
6
|
-
"engine/SKILL-lite.md": "
|
|
7
|
-
"engine/SKILL-tiny.md": "
|
|
8
|
-
"engine/SKILL.md": "
|
|
4
|
+
"engine/CHANGELOG.md": "e27b556191e67e076c379259847981c068d0b2fb8c6eab8d978db93a8b9cd174",
|
|
5
|
+
"engine/README.md": "e3ce4512c17ab414566ffd9408df5eebd98d2793631c515649dc663842d5d519",
|
|
6
|
+
"engine/SKILL-lite.md": "7c78a79e3b28705006efe867abf0f9d36ec52b448106428adbbe13bfbb899e06",
|
|
7
|
+
"engine/SKILL-tiny.md": "53e0b3dece9ac271deb41c06ab8ff088204441c0ba3da9061f673209472e0601",
|
|
8
|
+
"engine/SKILL.md": "ca95e464ff040753b717241fb5535886278fbf04b7fe151492cb39aa165e5019",
|
|
9
9
|
"engine/assets/panel.html": "69adb00b69bb358f5d4c00f2aa357cc0a4925f455844b6652ad362ec9b873da4",
|
|
10
10
|
"engine/docs/commands.md": "0ce8c88e5d2d04a8055b45c060ebd53b50c52b79b650312e2ee440845804ca4b",
|
|
11
11
|
"engine/docs/mechanics.md": "aa9683c827ed3419106e84d847ab16dc310c27fc62f588184192aaa1617523cc",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"engine/scripts/check_docs.py": "27dcc2a55c500db334ba04e475f6a3fb326a45bea31ff394817ea3a50864400b",
|
|
23
23
|
"engine/scripts/check_pressure_sync.py": "d7ea8acfa8a2d07baca12c9a6664c76a259766d6e1cecf06963ed30241f9bb8b",
|
|
24
24
|
"engine/scripts/check_tag.py": "fd333d0983ff075ea7340532dfeed62ab05ab521d169b44ff8a928d418c7dd22",
|
|
25
|
-
"engine/scripts/checkpoint.py": "
|
|
25
|
+
"engine/scripts/checkpoint.py": "4757e4783dde68757ccf89a3d0d28e704038d365e20e455a09a8d0485b43255d",
|
|
26
26
|
"engine/scripts/cli.py": "e68709f183eae3cb407732f52df91fd65d22f4327b101a8bbc26df93c2a7b69f",
|
|
27
27
|
"engine/scripts/context_ab.py": "3d383f1fc16d328612825bbf731866fa427da0746490d027a0ddb719d210f1cb",
|
|
28
28
|
"engine/scripts/core.py": "5e369e0f9185f88f096fe21967a226013b1fc8d70653268b6ee1a0d2a4c9da79",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"engine/scripts/panel_settings.py": "8faa9ac1321ca4450811bddbb06e5ce6deec0bd43a9ce959cc91ebc7a1e4959c",
|
|
60
60
|
"engine/scripts/panel_shortcut.py": "956374abe9d1e2b63618223e861f696070b6c0368a757f5a630f441c854ea1ea",
|
|
61
61
|
"engine/scripts/panel_splash.py": "36cd59e593ce52557a180a8767bfa9cd9c803f0cccaa141e7da8babd5a35e925",
|
|
62
|
-
"engine/scripts/panel_update.py": "
|
|
62
|
+
"engine/scripts/panel_update.py": "b6256af938fec44e7e0c0073d7ed3f2b50487f6d52cea5772fe175d222b09f0d",
|
|
63
63
|
"engine/scripts/panels.py": "52a71b99ccc9b9815ab899d7dbbb020ecbaecb2637fcedb7e2317ad9eb5d9402",
|
|
64
64
|
"engine/scripts/persona.py": "a0bd3ad7856c7d24a377fc2d23df9c5ee5f9f4bf6533d9cc485e6734b843dd36",
|
|
65
65
|
"engine/scripts/prepublish_tests.py": "8d116de1edd3ab57584a6a2749598cf127e918383da67e50118601e5a3970c2a",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"engine/scripts/safety.py": "01ff42b7dac0eeac45c4a1e8cee97a21d8f0de55067213a61efbb95073186638",
|
|
70
70
|
"engine/scripts/safety_net.py": "678d9286c83530e5196f4e46ef195d7e4686fe7f9bcbff0af57ff1b97827376e",
|
|
71
71
|
"engine/scripts/session_import.py": "4b9c0e88d11b5cee900a65a4abe31b888eefa15a99f1883cb9ea74f65ffbc770",
|
|
72
|
-
"engine/scripts/session_rag.py": "
|
|
72
|
+
"engine/scripts/session_rag.py": "ac79eab81fc4a423417c811c8f3737b461ab48e68a76da2fb9c71521d5826e1f",
|
|
73
73
|
"engine/scripts/session_summary.py": "7f86a47cfb75b5340f748176f3cd2ca2242bd568351f241df6b9bbd6da3e66c0",
|
|
74
74
|
"engine/scripts/shadow_memory.py": "3543198649a9b8b70cdcaa591f71eeb48da1eb47440b988cfbe31f2c63a3715a",
|
|
75
75
|
"engine/scripts/shape_audit.py": "3c361b8138d95c1e11476092e4d4da2eba71d9ed5300857bb3ce9113a8bf3be7",
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## v5.65(2026-12-04)
|
|
4
|
+
|
|
5
|
+
### 🔧 150 项审计第九批:会话检索、checkpoint 与数据完整性修复
|
|
6
|
+
|
|
7
|
+
1. **LS-034(高·会话主键作用域)**:`session_rag.py` 的 `_msg_id` 将 `platform` 和 `workspace` 纳入主键哈希,同一消息在不同作用域下可分别存在,不再被 IntegrityError 误判跳过。
|
|
8
|
+
2. **LS-038 / LS-050(高·checkpoint 事务一致)**:`checkpoint.py` 修复状态写失败时返回 `state_pending` 明确标记(下次重试不会重复 remember);返回 `memory_id` 改为字符串而非整个 dict。
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
3
12
|
## v5.64(2026-12-04)
|
|
4
13
|
|
|
5
14
|
### 🚀 150 项审计第八批:发布、更新与 CI 流程工具组闭环修复
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 名字取自《黄帝内经》:**算力给思考,人格给灵魂,记忆给生命。**
|
|
4
4
|
|
|
5
|
-
> 当前版本 **v5.
|
|
5
|
+
> 当前版本 **v5.65**(变更见 [CHANGELOG.md](CHANGELOG.md))
|
|
6
6
|
|
|
7
7
|
> 🔁 **双仓库镜像**:GitHub(主)与 Gitee(镜像)保持同步——[gitee.com/htmcwy_0/lingshu-skill](https://gitee.com/htmcwy_0/lingshu-skill)。灵枢的更新检查会探测两边最新提交,**谁更新就自动从谁拉取**;任一边不可达(Gitee 匿名风控 / GitHub 限额)时走另一边兜底。
|
|
8
8
|
|
|
@@ -197,8 +197,22 @@ def checkpoint(repo: str | None = None, note: str = "", *, dry_run: bool = False
|
|
|
197
197
|
except Exception as exc: # noqa: BLE001
|
|
198
198
|
return {"ok": False, "skipped": False, "reason": f"写记忆失败:{exc}",
|
|
199
199
|
"text": text, "evidence": ev}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
# LS-038(v5.65):让 checkpoint 记忆与状态提交一致!
|
|
201
|
+
# 旧代码在 write 成功后直接覆盖 state,若 state 写失败则 memory 已写入
|
|
202
|
+
# 但 state 未更新,下次重试会**重复 remember 同一条 checkpoint**。
|
|
203
|
+
# 修复:状态写失败时返回明确的部分成功结果(含 memory_id),并显式标记
|
|
204
|
+
# "state_pending",让重试逻辑能识别已写记忆不再重复。
|
|
205
|
+
try:
|
|
206
|
+
state[ev["repo"]] = {"head": ev["head"], "ts": int(time.time()),
|
|
207
|
+
"changed": ev["changed"], "version": ev["version"]}
|
|
208
|
+
_save_state(state, home)
|
|
209
|
+
except Exception as exc: # noqa: BLE001
|
|
210
|
+
return {"ok": True, "skipped": False, "state_pending": True,
|
|
211
|
+
"reason": f"记忆已写入但状态提交失败(下次重试不会重复 remember):{exc}",
|
|
212
|
+
"memory_id": mid if isinstance(mid, str) else str(mid),
|
|
213
|
+
"text": text, "evidence": ev}
|
|
214
|
+
# LS-050(v5.65):返回 record["id"] 字符串而非整个 dict
|
|
215
|
+
if isinstance(mid, dict):
|
|
216
|
+
mid = str(mid.get("id") or "")
|
|
203
217
|
return {"ok": True, "skipped": False, "reason": d["reason"], "text": text,
|
|
204
218
|
"memory_id": mid, "evidence": ev, "dry_run": dry_run}
|
|
@@ -66,8 +66,15 @@ def init_db(path=None) -> dict:
|
|
|
66
66
|
return {"ok": True, "path": str(path or db_path()), "messages": rows}
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
def _msg_id(session: str, role: str, ts: float, text: str
|
|
70
|
-
|
|
69
|
+
def _msg_id(session: str, role: str, ts: float, text: str,
|
|
70
|
+
platform: str = "", workspace: str = "") -> str:
|
|
71
|
+
"""LS-034(v5.65):将会话作用域纳入消息主键!
|
|
72
|
+
|
|
73
|
+
旧主键只含 session|role|ts|text,同一消息在不同 platform/workspace 下
|
|
74
|
+
会因哈希一致被 IntegrityError 误判为"重复"而跳过(数据丢失)。
|
|
75
|
+
现将 platform 和 workspace 一并纳入主键,验证相同消息可分别存在于两个作用域。
|
|
76
|
+
"""
|
|
77
|
+
raw = f"{session}|{platform}|{workspace}|{role}|{ts}|{text}".encode("utf-8")
|
|
71
78
|
return "sr_" + hashlib.sha256(raw).hexdigest()[:24]
|
|
72
79
|
|
|
73
80
|
|
|
@@ -89,7 +96,8 @@ def ingest_messages(rows, *, session: str = "default", platform: str = "",
|
|
|
89
96
|
continue
|
|
90
97
|
role = str(r.get("role") or "other").lower()
|
|
91
98
|
ts = float(r.get("ts") or r.get("created") or 0)
|
|
92
|
-
|
|
99
|
+
# LS-034(v5.65):主键纳入 platform 和 workspace 作用域
|
|
100
|
+
mid = _msg_id(session, role, ts, text, platform=platform, workspace=workspace)
|
|
93
101
|
try:
|
|
94
102
|
conn.execute(
|
|
95
103
|
"INSERT INTO messages(id, session, platform, workspace, role, ts, text)"
|
package/scripts/checkpoint.py
CHANGED
|
@@ -197,8 +197,22 @@ def checkpoint(repo: str | None = None, note: str = "", *, dry_run: bool = False
|
|
|
197
197
|
except Exception as exc: # noqa: BLE001
|
|
198
198
|
return {"ok": False, "skipped": False, "reason": f"写记忆失败:{exc}",
|
|
199
199
|
"text": text, "evidence": ev}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
# LS-038(v5.65):让 checkpoint 记忆与状态提交一致!
|
|
201
|
+
# 旧代码在 write 成功后直接覆盖 state,若 state 写失败则 memory 已写入
|
|
202
|
+
# 但 state 未更新,下次重试会**重复 remember 同一条 checkpoint**。
|
|
203
|
+
# 修复:状态写失败时返回明确的部分成功结果(含 memory_id),并显式标记
|
|
204
|
+
# "state_pending",让重试逻辑能识别已写记忆不再重复。
|
|
205
|
+
try:
|
|
206
|
+
state[ev["repo"]] = {"head": ev["head"], "ts": int(time.time()),
|
|
207
|
+
"changed": ev["changed"], "version": ev["version"]}
|
|
208
|
+
_save_state(state, home)
|
|
209
|
+
except Exception as exc: # noqa: BLE001
|
|
210
|
+
return {"ok": True, "skipped": False, "state_pending": True,
|
|
211
|
+
"reason": f"记忆已写入但状态提交失败(下次重试不会重复 remember):{exc}",
|
|
212
|
+
"memory_id": mid if isinstance(mid, str) else str(mid),
|
|
213
|
+
"text": text, "evidence": ev}
|
|
214
|
+
# LS-050(v5.65):返回 record["id"] 字符串而非整个 dict
|
|
215
|
+
if isinstance(mid, dict):
|
|
216
|
+
mid = str(mid.get("id") or "")
|
|
203
217
|
return {"ok": True, "skipped": False, "reason": d["reason"], "text": text,
|
|
204
218
|
"memory_id": mid, "evidence": ev, "dry_run": dry_run}
|
package/scripts/session_rag.py
CHANGED
|
@@ -66,8 +66,15 @@ def init_db(path=None) -> dict:
|
|
|
66
66
|
return {"ok": True, "path": str(path or db_path()), "messages": rows}
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
def _msg_id(session: str, role: str, ts: float, text: str
|
|
70
|
-
|
|
69
|
+
def _msg_id(session: str, role: str, ts: float, text: str,
|
|
70
|
+
platform: str = "", workspace: str = "") -> str:
|
|
71
|
+
"""LS-034(v5.65):将会话作用域纳入消息主键!
|
|
72
|
+
|
|
73
|
+
旧主键只含 session|role|ts|text,同一消息在不同 platform/workspace 下
|
|
74
|
+
会因哈希一致被 IntegrityError 误判为"重复"而跳过(数据丢失)。
|
|
75
|
+
现将 platform 和 workspace 一并纳入主键,验证相同消息可分别存在于两个作用域。
|
|
76
|
+
"""
|
|
77
|
+
raw = f"{session}|{platform}|{workspace}|{role}|{ts}|{text}".encode("utf-8")
|
|
71
78
|
return "sr_" + hashlib.sha256(raw).hexdigest()[:24]
|
|
72
79
|
|
|
73
80
|
|
|
@@ -89,7 +96,8 @@ def ingest_messages(rows, *, session: str = "default", platform: str = "",
|
|
|
89
96
|
continue
|
|
90
97
|
role = str(r.get("role") or "other").lower()
|
|
91
98
|
ts = float(r.get("ts") or r.get("created") or 0)
|
|
92
|
-
|
|
99
|
+
# LS-034(v5.65):主键纳入 platform 和 workspace 作用域
|
|
100
|
+
mid = _msg_id(session, role, ts, text, platform=platform, workspace=workspace)
|
|
93
101
|
try:
|
|
94
102
|
conn.execute(
|
|
95
103
|
"INSERT INTO messages(id, session, platform, workspace, role, ts, text)"
|