@ssamurias/dsh-fish 1.0.0 → 1.0.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/lib/browse.js CHANGED
@@ -22,7 +22,8 @@ import { dateKey } from './settings.js'
22
22
  import { recordVoice } from './voices.js'
23
23
  // 素材旁边的那一行钩子(2026-11-09,0.9.6 S2):把她以前说过的话挂在对得上的那一条上。
24
24
  import { buildHooks, hookStats } from './hook.js'
25
- // 争议取法(2026-11-10,0.9.8 / M3):热评按赞排,等于只给同意的声音;这里挑反例。
25
+ // 争议取法(2026-11-10,0.9.8 / M3):热评只有同意的那一面;这里挑反例。
26
+ // (2026-11-13 issue #135:热评是 B 站热度序,不是按赞排,别按位置取尾部。)
26
27
  import { materialIndexLine, indexedMaterialKeys, pickDisputes, toMaterial } from './material.js'
27
28
  import { fillOwner } from './pronoun.js'
28
29
 
@@ -160,6 +161,8 @@ export async function absorb(client, v, cfg, o = {}) {
160
161
  pubdate: null,
161
162
  tags: [],
162
163
  comments: [],
164
+ pinned: [],
165
+ disputes: [],
163
166
  danmaku: [],
164
167
  cid: null,
165
168
  aid: Number(v?.aid) || 0,
@@ -190,18 +193,21 @@ export async function absorb(client, v, cfg, o = {}) {
190
193
  const nComments = Math.max(0, Math.min(20, Number(cfg?.browse?.deepRead ?? 0)))
191
194
  if (nComments > 0 && out.aid) {
192
195
  try {
193
- // 多要 6 条:前 nComments 条是热评(按赞排,等于只给同意的声音),
194
- // 后面这些用来找「不同意见」——0.9.8 / M3 的争议取法。
196
+ // 2026-11-13(issue #135):多要 6 条不是为了「按赞排的前 N 条」——
197
+ // sort=2 是 B 站热度序,赞数并不单调。多要的这 6 条只用来找反例。
195
198
  const r = await client.replies(out.aid, { sort: 2, ps: nComments + 6 })
196
199
  if (r?.ok) {
197
- const all = (r.data ?? [])
198
- .map((c) => ({
199
- text: clipText(String(c.text ?? '').replace(/\s+/g, ' ').trim(), 200),
200
- like: Number(c.like) || 0,
201
- }))
202
- .filter((c) => c.text)
200
+ const one = (c, pinned = false) => ({
201
+ text: clipText(String(c?.text ?? '').replace(/\s+/g, ' ').trim(), 200),
202
+ like: Number(c?.like) || 0,
203
+ ...(pinned ? { pinned: true } : {}),
204
+ })
205
+ const all = (r.data ?? []).map((c) => one(c)).filter((c) => c.text)
206
+ out.pinned = (r.top ?? []).map((c) => one(c, true)).filter((c) => c.text).slice(0, 2)
203
207
  out.comments = all.slice(0, nComments)
204
- out.disputes = pickDisputes(all.slice(nComments))
208
+ // 反例从「还没摆到她眼前的那几条」里挑,不按位置切尾部(位置在热度序里没有含义)。
209
+ const shown = new Set([...out.pinned, ...out.comments].map((c) => c.text))
210
+ out.disputes = pickDisputes(all.filter((c) => !shown.has(c.text)))
205
211
  }
206
212
  } catch { /* ignore */ }
207
213
  }
@@ -241,9 +247,14 @@ export function renderItem(p, i) {
241
247
  // 以后接新来源(帖子/小说)时,渲染这一段不用跟着改。
242
248
  for (const q of toMaterial(p).quotes) {
243
249
  if (q.kind === 'desc') lines.push(` 简介(UP 主自己写的):${cleanText(q.text)}`)
244
- else if (q.kind === 'comment') lines.push(` [热评 ${q.like}] ${cleanText(q.text)}`)
250
+ // 2026-11-13(issue #135):原来是 `[热评 ${like}]`——「热评」暗示了排序,
251
+ // 而这里的顺序是 B 站热度序。她会照着唯一的那个数字判「热评第一」,判错。
252
+ else if (q.kind === 'comment') lines.push(` [评论 ${q.like} 赞] ${cleanText(q.text)}`)
253
+ else if (q.kind === 'pinned') lines.push(` [置顶评论 ${q.like} 赞] ${cleanText(q.text)}`)
245
254
  else if (q.kind === 'dissent') lines.push(` [不同意见 ${q.like}] ${cleanText(q.text)}`)
246
255
  }
256
+ // 顺序说清楚:说清了她才不会拿赞数去推位置;不说,赞数就是唯一读得通的依据。
257
+ if ((p.comments?.length ?? 0) > 0) lines.push(' (这些评论按 B 站的热度排,不是按赞数排)')
247
258
  if (p.danmaku.length) {
248
259
  // issue #67:弹幕是按时间均匀抽的,这里再截前 8 条就只剩开头;等距挑 8 条。
249
260
  const all = p.danmaku
package/lib/capture.js CHANGED
@@ -64,6 +64,10 @@ export function registerCapture(ctx, deps = {}) {
64
64
  // 把规则提到工具说明里,让她每次调用前都先看见这句话。
65
65
  '如果你在修正之前说过的话,用 revise 带上那句的 id。' +
66
66
  '想改以前的说法,就提交 type=revise 并用 refs 指向原来那条的 id。' +
67
+ // 2026-11-14(用户 m00704):自主门的计数里,refusal 事件一直是 0——
68
+ // 不是她没拒绝过,是拒绝只落在对话里,从没被记成事件。工具说明里给出
69
+ // 触发场景,但不替她决定该不该拒绝(也不写进事件卡的处境)。
70
+ '如果你拒绝过一件具体的事——是对着某件事说了不做、或者没有照做的那一件——用 refusal 记下来,写清是哪件事;' +
67
71
  // 2026-10-27(0.5.8):narration 也要凭证。以前只要求 revise,于是
68
72
  // 「我变成了什么样」可以凭空写——这正是叙事漂移的入口。
69
73
  '写 narration(你对自己整体的说法)时,也要用 refs 指向 her_recall 翻到的那几条 id;' +
@@ -107,6 +111,7 @@ export function registerCapture(ctx, deps = {}) {
107
111
  required: false,
108
112
  description:
109
113
  '给这句话一个短标签(12 字以内),比如「叫老大」「评论区怎么说话」。' +
114
+ '同一件事尽量用同一个标签。' +
110
115
  '以后同一个标签下的话会放在一起对照。可以不给;给了也不会回显给你。',
111
116
  },
112
117
  }),