@deepseek-ai/dsh-message-feedback 0.1.5-rc.1 → 0.1.6-alpha.1
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.i18n.yaml +2 -2
- package/README.md +3 -3
- package/README.zh.md +11 -11
- package/lib/types/index.js +2 -0
- package/lib/types/types.d.ts +1 -1
- package/package.json +14 -14
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/feedback/message-feedback/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: bd10014ce627dd6b4283e04781a1d98991588446
|
|
6
|
+
README.zh.md: a0c228629467f4ff4a1f82c370a45542375d4e96
|
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Mount `dsh-message-feedback` alongside `sessions` and `sessionPersistence`. It n
|
|
|
28
28
|
|
|
29
29
|
| Field | Default | Meaning |
|
|
30
30
|
|---|---|---|
|
|
31
|
-
| `maxNoteBytes` | required | Positive safe
|
|
31
|
+
| `maxNoteBytes` | required | Positive safe integer specifying the maximum UTF-8 byte length of one optional note. |
|
|
32
32
|
|
|
33
33
|
A supplied note must contain a non-whitespace character and fit the configured byte limit. Blank notes return `note-blank`; oversized notes return `note-too-large`. Accepted text is preserved exactly, including surrounding whitespace. Omitting a note clears it. Note validation precedes Session lookup. A supplied category must be one of the [fixed feedback categories](../command-feedback/README.md#the-web-feedback-dialog); the Remote schema rejects any other value, and omitting the category clears it.
|
|
34
34
|
|
|
@@ -55,7 +55,7 @@ Live operations append through `Session.append` and await `sessions.flush`, then
|
|
|
55
55
|
|
|
56
56
|
A per-Session queue serializes operations within one service instance; the persistence write handle excludes competing cold writers. Disposal stops admission and drains admitted operations before releasing the service. Persistence failures reject instead of becoming business failures. A failed flush does not roll back an accepted event; callers can list and retry with its version. Successful no-op mutations also flush the current prefix.
|
|
57
57
|
|
|
58
|
-
Cold material mutations
|
|
58
|
+
Cold material mutations emit `feedback/committed` after flush with a borrowed read-only canonical prefix; observers must deep-clone it before transferring ownership. Observers finish before write ownership is released, must not await another feedback operation for that Session, and cannot reject an already committed mutation. Live consumers observe `session/event`.
|
|
59
59
|
|
|
60
60
|
### Source map
|
|
61
61
|
|
|
@@ -93,7 +93,7 @@ Independent. Feedback does not change the model request prefix.
|
|
|
93
93
|
- **Deletion retains history:** delete removes current feedback, not earlier ratings or notes from the append-only log; it is not a privacy-erasure operation.
|
|
94
94
|
- **Writer ownership:** another process holding a Session write handle causes cold mutations to reject. The service does not wake that owner or coordinate Remote calls across processes.
|
|
95
95
|
- **Trusted callers:** requests contain no authenticated actor or audit identity. Deployments must protect the Host gateway.
|
|
96
|
-
- **Telemetry export:** for all users and providers, including `deepseek-official`, the shipped OTel backend in `FEEDBACK_ONLY` releases the complete canonical prefix only after new explicit text feedback, rating
|
|
96
|
+
- **Telemetry export:** for all users and providers, including `deepseek-official`, the shipped OTel backend in `FEEDBACK_ONLY` releases the complete canonical prefix only after new explicit text feedback, rating, note, or category edits, or withdrawal. The prefix includes context and verbatim notes; later records wait for the next feedback, and `DISABLED` prevents capture. Deployments own redaction; see the [OTel export policy](../../session/session-telemetry-otel/README.md).
|
|
97
97
|
- **Scan cost:** each `list`, `put`, or `delete` that reaches an existing Session scans its full event log to derive current feedback; cold operations also read the full log from persistence. Work grows with total Session history, not just the number of feedback items.
|
|
98
98
|
- **Retention:** `maxNoteBytes` limits one note, not aggregate log size or mutation count.
|
|
99
99
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
本服务为已完成的 assistant 消息记录好评、差评、固定反馈分类表中的可选分类,以及可选的原样备注。每次创建、编辑和删除都由权威 Session 日志保存;`list`、`put` 和 `delete` 提供当前反馈,不会构造或唤醒
|
|
12
|
+
本服务为已完成的 assistant 消息记录好评、差评、固定反馈分类表中的可选分类,以及可选的原样备注。每次创建、编辑和删除都由权威 Session 日志保存;`list`、`put` 和 `delete` 提供当前反馈,不会构造或唤醒 agent(智能体)。反馈仅写入日志,不进入模型历史。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -28,7 +28,7 @@ kind: "package-reference"
|
|
|
28
28
|
|
|
29
29
|
| 字段 | 默认值 | 含义 |
|
|
30
30
|
|---|---|---|
|
|
31
|
-
| `maxNoteBytes` | 必填 | 单条可选备注的 UTF-8
|
|
31
|
+
| `maxNoteBytes` | 必填 | 单条可选备注的 UTF-8 字节上限,必须为大于零的安全整数。 |
|
|
32
32
|
|
|
33
33
|
提交的备注必须包含非空白字符,且不超过配置的字节上限。空白备注返回 `note-blank`;过长备注返回 `note-too-large`。通过校验的文本会完整保留,包括首尾空白。省略备注会清除它。备注校验先于 Session 查找。提交的分类必须是[固定反馈分类](../command-feedback/README.zh.md#the-web-feedback-dialog)之一;Remote schema 拒绝其他值,省略分类会清除它。
|
|
34
34
|
|
|
@@ -42,7 +42,7 @@ kind: "package-reference"
|
|
|
42
42
|
|
|
43
43
|
创建时传入 `ifVersion: null`;编辑或删除时使用返回的版本。陈旧修改返回 `version-conflict` 及当前条目。每次实质 put 都生成新 token,并保留原始创建时间。重复已存评分、备注与分类的 put 是无变化操作:返回相同条目,不追加事件。删除不存在的条目始终成功,不受所传版本影响,也不追加事件。重新创建已删除条目会产生新的创建时间和排序位置。
|
|
44
44
|
|
|
45
|
-
目标必须是由 append 来源事件产生的非空 assistant 消息。用户消息、空 assistant 占位及 replacement 来源消息返回 `target-not-found`。反馈跨重启保留;fork
|
|
45
|
+
目标必须是由 append 来源事件产生的非空 assistant 消息。用户消息、空 assistant 占位及 replacement 来源消息返回 `target-not-found`。反馈跨重启保留;fork 即使继承了包含父会话反馈的前缀,初始时也没有自有反馈。
|
|
46
46
|
|
|
47
47
|
<a id="understand-the-implementation"></a>
|
|
48
48
|
## 理解实现
|
|
@@ -51,11 +51,11 @@ kind: "package-reference"
|
|
|
51
51
|
|
|
52
52
|
`feedback/message-put` 保存所属 Session id 及完整条目,包括版本和时间戳。`feedback/message-delete` 保存所属 Session 和消息 id。当前状态从这些事件推导,忽略属于其他 Session 的事件。持久化 payload 在使用前经过校验。不存在第二个反馈存储或缓存。
|
|
53
53
|
|
|
54
|
-
活跃会话通过 `Session.append` 追加,并等待 `sessions.flush
|
|
54
|
+
活跃会话通过 `Session.append` 追加,并等待 `sessions.flush`,然后通过持久化读句柄核实捕获的日志末端与 Session header,才会报告成功。冷会话修改在读取、校验、比较、追加、flush 和关闭期间持有持久化写句柄。冷读取使用读句柄。两条路径都不会构造 Session 或追加生命周期事件。
|
|
55
55
|
|
|
56
|
-
每个 Session
|
|
56
|
+
每个 Session 的队列在同一服务实例内串行化操作;持久化写句柄排除其他冷写入方。销毁时停止接收操作并排空已接收操作,然后释放服务。持久化故障会 reject,而非变成业务失败。flush 失败不会回滚已接受的事件;调用方可以读取并使用其版本重试。成功的无变化修改也会 flush 当前前缀。
|
|
57
57
|
|
|
58
|
-
冷会话的实质修改在 flush
|
|
58
|
+
冷会话的实质修改在 flush 后发出 `feedback/committed` 通知,其中携带借用的只读权威日志前缀;观察方在转移所有权前必须对其进行深拷贝。观察方在写入所有权释放前完成,不得等待同一 Session 的其他反馈操作,也不能使已提交的修改失败。活跃会话消费方观察 `session/event`。
|
|
59
59
|
|
|
60
60
|
### 源码地图
|
|
61
61
|
|
|
@@ -90,12 +90,12 @@ kind: "package-reference"
|
|
|
90
90
|
<a id="known-limitations-and-deferred-work"></a>
|
|
91
91
|
|
|
92
92
|
- **仅日志具有权威性:**不读取或迁移现有 `message_feedback` 伴随数据。这些文件保持不变,但其反馈无法通过本服务访问。
|
|
93
|
-
- **删除保留历史:**delete
|
|
94
|
-
- **写入所有权:**另一个进程持有 Session
|
|
95
|
-
- **受信任调用方:**请求不包含经过认证的 actor 或审计身份。部署方必须保护 Host
|
|
96
|
-
- **遥测导出:**对于所有用户和提供方,包括 `deepseek-official`,随附 OTel 后端在 `FEEDBACK_ONLY`
|
|
93
|
+
- **删除保留历史:**delete 移除当前反馈,不会从仅追加日志中清除更早的评分或备注;它不是隐私擦除操作。
|
|
94
|
+
- **写入所有权:**另一个进程持有 Session 写句柄时,冷会话修改会 reject。服务不会唤醒该所有者,也不协调跨进程 Remote 调用。
|
|
95
|
+
- **受信任调用方:**请求不包含经过认证的 actor 或审计身份。部署方必须保护 Host 网关。
|
|
96
|
+
- **遥测导出:**对于所有用户和提供方,包括 `deepseek-official`,随附 OTel 后端在 `FEEDBACK_ONLY` 模式下仅在新的显式文本反馈、评分、备注或分类编辑、撤回后释放完整权威日志前缀。前缀包含上下文和原样备注;后续记录等待下一次反馈,`DISABLED` 阻止捕获。部署方负责脱敏;见 [OTel 导出策略](../../session/session-telemetry-otel/README.zh.md)。
|
|
97
97
|
- **扫描成本:**每次访问已有 Session 的 `list`、`put` 或 `delete` 都会扫描完整事件日志来推导当前反馈;冷会话操作还会从持久化存储读取完整日志。工作量随 Session 历史总量增长,而不只是反馈条目数。
|
|
98
|
-
- **保留量:**`maxNoteBytes`
|
|
98
|
+
- **保留量:**`maxNoteBytes` 只限制单条备注,不限制日志总大小或变更次数。
|
|
99
99
|
|
|
100
100
|
<a id="dev-note"></a>
|
|
101
101
|
### 开发备注
|
package/lib/types/index.js
CHANGED
|
@@ -209,10 +209,12 @@ let MessageFeedbackService = (() => {
|
|
|
209
209
|
}
|
|
210
210
|
const live = this.ctx.sessions.get(sessionId);
|
|
211
211
|
if (live !== undefined) {
|
|
212
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
212
213
|
return operation(live.snapshotEvents(), async (event) => {
|
|
213
214
|
if (event !== undefined) {
|
|
214
215
|
live.append(event.type, event.data);
|
|
215
216
|
}
|
|
217
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
216
218
|
const last = live.snapshotEvents().at(-1);
|
|
217
219
|
if (!(await this.ctx.sessions.flush(live))) {
|
|
218
220
|
throw new Error(`message-feedback: no durability listener participated for live session '${sessionId}'`);
|
package/lib/types/types.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface MessageFeedbackItem {
|
|
|
20
20
|
readonly rating: MessageFeedbackRating;
|
|
21
21
|
/** Optional explanation, preserved verbatim after validation. */
|
|
22
22
|
readonly note?: string;
|
|
23
|
-
/** Category the human filed
|
|
23
|
+
/** Category the human filed the judgment under. */
|
|
24
24
|
readonly category?: FeedbackCategory;
|
|
25
25
|
/** Equality-only token replaced by every material create or update. */
|
|
26
26
|
readonly version: MessageFeedbackVersion;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-message-feedback",
|
|
3
3
|
"description": "Canonical Session-log ratings and notes for finalized assistant messages",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
],
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@deepseek-ai/dsh-brand": "^0.1.
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-session-persistence": "^0.1.
|
|
51
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.1.
|
|
47
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.1",
|
|
48
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
49
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.1",
|
|
52
52
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
53
|
-
"@deepseek-ai/dsh-command-feedback": "^0.1.
|
|
53
|
+
"@deepseek-ai/dsh-command-feedback": "^0.1.6-alpha.1"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"zod": "^4.4.3",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
61
61
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.1.
|
|
62
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
|
|
63
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
|
|
64
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.1",
|
|
65
|
+
"@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.1",
|
|
66
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.1",
|
|
67
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.1",
|
|
67
68
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
68
|
-
"@deepseek-ai/dsh-command-feedback": "^0.1.
|
|
69
|
-
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.5-rc.1"
|
|
69
|
+
"@deepseek-ai/dsh-command-feedback": "^0.1.6-alpha.1"
|
|
70
70
|
}
|
|
71
71
|
}
|