Skip to content

修复说话人采样配置被 top2 加额覆盖 - #262

Merged
zj1123581321 merged 2 commits into
mainfrom
feat/vta-261017-issue244-sampling
Oct 17, 2026
Merged

zj1123581321 merged 2 commits into
mainfrom
feat/vta-261017-issue244-sampling

Conversation

@zj1123581321

@zj1123581321 zj1123581321 commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

说话人采样配置现在作为普通说话人的基准配额。发言量 top2 的条数和字符预算分别取配置值与 8 条/1200 字符下限中的较大值,例如配置 12/2000 时仍保留 12 条与 2000 字符上限;配置 12/400 时 top2 使用 12 条/1200 字符,其他人使用 12 条/400 字符。单条 120 字符限制和全局预算保持不变。

任一采样配置设为 0 时,只停用本轮新采样与新的说话人 LLM 调用;不会清除与输入指纹匹配的已验证历史姓名,identity_fallback 姓名恢复及分层缓存行为保持不变。top2 排名移到说话人循环外计算一次,并保留并列时的原顺序。

验证:

  • uv run pytest -q tests/unit/test_speaker_inferencer.py:46 passed。
  • make test:通过。
  • 将 top2 条数 max 临时注入为 min 后,较大配置回归按预期失败;还原后通过。

OCR 维护意见(接受不修):

  • 主脑前置 OCR 意见 1(低):infer() / _identity_fallback() docstring 未列零配额来源;只影响说明完整性。
  • 主脑前置 OCR 意见 2(低):私有 _extract_sample_dialogs() 被直接以零配额调用时仍可能采样 top2;唯一生产调用方 infer() 已早退,没有生产缺陷。
  • 上述两项来自主脑前置 OCR;独审报告中的 OCR 是另一轮扫描,其 findings=[] 记录保持不变。

Refs #244(子项 2、7)

Agent-Executor: codex-lead
Agent-Session: 01a1481d-411a-78b2-bce7-3089f4f4ac06
Agent-Executor: codex-lead
Agent-Session: 01a1481d-411a-78b2-bce7-3089f4f4ac06
@zj1123581321
zj1123581321 marked this pull request as ready for review October 17, 2026 04:56
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Required Gate v2 — 状态面板

当前状态:pass · 可合并

当前裁决:code_pass / disposition_resolved

PR 累计主审轮(影子):1/5 · collecting

Disposition receipts consumed:

  • disposition=false-positive finding={"category":["value","correctness"],"file":["value","src/video_transcript_api/llm/core/speaker_inferencer.py"],"line":["value",704],"severity":["value","major"]} pointer=
    top_speakers = self._top_sample_speakers(candidate_dialogs)
    ; command=git grep -n -F -e _top_sample_speakers dbf79e6 -- .; output=dbf79e67effb30010a63c0913c8845cc2b82e39d:docs/sessions/card-vta-261015-speaker-evidence/reviews/card-vta-261015-speaker-evidence-verdict.md:16:7. top2 排名在每个说话人循环内重复计算 — src/video_transcript_api/llm/core/speaker_inferencer.py:576、:631;违反 spec 8;P2,不阻断。单消费者 helper _top_sample_speakers() 每次调用都会重新排序全部 speaker;它在 for speaker in speakers 内调用,形成 N 次排序(发言量相同时整体为 O(N²))。该 helper 没有第二个调用方,且 speakers 参数未使用;可在循环前计算一次 top2 集合并移除不必要参数,避免重复计算及单消费者封装。常见小规模影响有限。 dbf79e6 receipt=gate-disposition-receipt-v3-7f6d4acea9d1cccd5c5e40bdb51ad87e0cfc0b404e64ff4a75e784aa74feb413-530ec518d551-acceef8f5fe1 reason=固定提交全仓检索仅有一个定义和一个实际调用;调用只传 candidate_dialogs,与新签名一致;另两处是文档,无旧签名调用。Opus 独立核对确认。

Gate 历史(v1;来源为持久化 gate_terminal 制品)

Run Attempt Head 状态 PR 累计主审轮(影子) 收件人动作
39003361874 1 e681476 skipped — 无需动作(主审未跑,绿≠过审)
39004390336 1 dbf79e6 fail — 要修代码
39004431028 1 dbf79e6 fail — 要修代码
39004431028 2 dbf79e6 pass 1/5 · collecting 可合并

历史行按 run_id + run_attempt 去重并只增不删;删除本评论后可由 gate_terminal 制品重建。

@zj1123581321
zj1123581321 merged commit 31db22c into main Oct 17, 2026
29 of 34 checks passed
@zj1123581321
zj1123581321 deleted the feat/vta-261017-issue244-sampling branch October 17, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant