总结层篇幅预算治理:prompt 收敛 + max_tokens + 压缩重试 + 分带监控 - #63
Merged
Conversation
建立预算函数为唯一事实源,prompt 注入篇幅目标、LLM call 加 max_tokens、 超硬顶压缩重试一次并 accept 落盘,新增 /api/audit/summary-ratio 监控端点, 修复 skipped_short 误导性统计展示。 Co-authored-by: Cursor <cursoragent@cursor.com> Agent-Executor: cursor Agent-Model: composer-2.5 Agent-Effort: unknown Dispatch-Id: dlg-20260824-085655-4fbb2d Task-Id: VideoTranscriptAPI-20260824-02
Required Gate v2 — 状态面板当前状态:pass · 可合并 当前裁决: Gate 历史(v1;来源为持久化
|
| Run | Attempt | Head | 状态 | 收件人动作 |
|---|---|---|---|---|
| 32712072736 | 1 | 68e2107 |
skipped |
无需动作(主审未跑,绿≠过审) |
| 32714211440 | 1 | 79f5c97 |
skipped |
无需动作(主审未跑,绿≠过审) |
| 32714670098 | 1 | 79f5c97 |
pass |
可合并 |
历史行按 run_id + run_attempt 去重并只增不删;删除本评论后可由 gate_terminal 制品重建。
⚙️ Review ledger state(机器状态记录,非评审结论)
机器状态明细
完整数据保存在 |
Co-authored-by: Cursor <cursoragent@cursor.com> Agent-Executor: cursor Agent-Model: composer-2.5 Agent-Effort: unknown Dispatch-Id: dlg-20260824-094037-24901c Task-Id: VideoTranscriptAPI-20260824-02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
生产 8/13 DeepSeek v4 Pro 更新后总结层输出失控膨胀(短视频总结超原文占比 78%→97%,极端 653%;详见任务卡基线数据)。根因:summary prompt 的绝对字数下限(每小节≥500字)+ 无任何输出预算控制,模型更新后更严格执行扩写指令。
产品定位(已拍板):总结层是主阅读面,允许为结构化重述适度超限;超预算是降质不是失败。
改动(四层防线,预算函数为唯一事实源)
summary_budget.py:S/M/L 三带预算(目标/硬顶/max_tokens=硬顶×1.5),可配置覆盖LLMClient.call(max_tokens=None)透传至请求 payload(None 时字段完全缺席,其他调用方零行为变化)summary_over_budget_acceptedwarning;禁止截断、状态仍 GENERATEDGET /api/audit/summary-ratio?days=30分带比例监控验证
uv run python -m pytest tests/llm/ tests/unit/:2824 passedTask-Id: VideoTranscriptAPI-20260824-02