Repository navigation
Open
Labels
area:harnessHarness module: profile, A/B loop, quality gates, evidence reportsHarness module: profile, A/B loop, quality gates, evidence reportsarea:knowledgeKnowledge line: packs, skill library, knowledge admissionKnowledge line: packs, skill library, knowledge admissionkind:taskBounded delivery task with a delegated sliceBounded delivery task with a delegated slicestatus:proposedWaiting for the decision named in the status blockWaiting for the decision named in the status block
Description
Current state: 新增需求提案:按优化迭代统计知识库命中、采用及关联验证结果。 新增意见建议关联已有 campaign/run/iteration 的实际 token 用量和可得费用,区分整轮会话成本与检索成本,缺失货币费用仍记未知。该意见及此前候选集合/数据契约建议仍待维护者取舍,不是已接受的新验收项,也不授权实施或因果收益判断。
Decision needed: 请维护者确认统计口径和首版范围,并指定负责人。
Next action: 实现负责人梳理检索与迭代证据,明确数据契约及展示方案。
Goal and acceptance
用户需要了解每轮优化命中了哪些知识、实际用了哪些,以及关联了什么结果,以评估知识库覆盖和复用情况。
- 按 campaign/run/iteration 关联检索事件,保留知识条目 ID、版本或来源引用、检索阶段和已有的命中理由/分数。
- 区分检索命中、实际采用、未采用及使用情况未知;采用须有引用、操作或产物记录支撑。
- 每轮展示检索次数、命中次数、去重命中条目数与采用条目数;比率明确分子、分母和去重口径。
- 展示条目明细及关联候选、变更、精度/性能结果和证据链接,保留失败、无收益和 INCONCLUSIVE 结果。
- 区分使用关联与因果贡献;没有对照证据时不声称知识导致收益或分摊收益百分比。
- 零命中显示零,缺失采集显示未知;重试和重复事件不重复计数,不同迭代不串数据。
- 提供统计测试及多轮示例,覆盖命中未采用、采用后失败、重复事件和缺失记录。
Scope and constraints
- In scope: 检索/使用记录、每轮聚合统计、可审计明细及 dashboard 轮次查看入口。
- Out of scope: 自动调整检索排序、自动更新知识库及无证据的因果收益推断。
- Interfaces / limits: 复用现有知识与迭代证据;历史数据缺失明确展示;不要求采集完整私密上下文。
Inputs and deliverables
- Related issues: [Tracking] Skill Indexer: retrieval efficiency and accuracy #255(检索效率与准确率)、[Task] RSI Dashboard: Optimization Workflow Visualization and Trace Capture #314(dashboard)、discussion: what trace evidence should InferRSI persist beyond per-run artifacts? #333(trace 持久化讨论;本需求不预先决定存储方案)。
- Expected artifacts: 统计口径、记录与聚合实现、dashboard 明细、测试和使用文档。
Ownership and authorization
- Proposed by / actual requester: 用户在 Codex 对话中提出,Codex 代为整理提交。
- Status: Proposed
- Accountable parent / implementer / goal-acceptance owner: TBD,由维护者指定。
- Accepted decision or scoped delegation: 本次授权为创建需求 issue;未指定实现、合并或关闭权限。
Completion and closure
- Who accepts completion and may close: 待指定的目标验收负责人。
- Remaining uncertainty / next decision: 维护者确认首版范围、数据接口和负责人。
Metadata
Metadata
Assignees
Labels
area:harnessHarness module: profile, A/B loop, quality gates, evidence reportsHarness module: profile, A/B loop, quality gates, evidence reportsarea:knowledgeKnowledge line: packs, skill library, knowledge admissionKnowledge line: packs, skill library, knowledge admissionkind:taskBounded delivery task with a delegated sliceBounded delivery task with a delegated slicestatus:proposedWaiting for the decision named in the status blockWaiting for the decision named in the status block
Activity
Dong1017 commentedon Nov 5, 2026
增量意见:四条可操作的补充
静态查证,基线
9dded7ad;未运行测试或实验。只补充提案未覆盖的部分,不重述已有验收项。先确认一处口径,因为后面三条都依赖它:本提案能产出的最强结论是「某条知识被检索到、被采用过」,不能产出「某条知识有用」。提案自己写明了这一点(不声称因果贡献、不分摊收益百分比),这个边界是对的。因此它可以作为下架候选的证据来源,不能作为知识质量评价。三个信号的强度不同:
1. 零命中需要候选集合,否则分母不成立
提案要求「比率明确分子、分母和去重口径」,但当前分母是检索次数,这只解决了分子侧。零命中有两种互斥含义:进入候选但未被选中,以及从未进入候选。只统计命中无法区分。
这不是理论问题。
src/inferrsi/data/repo_packs下有 107 个带status字段的知识条目,而已有战役只覆盖少数主题。若按零命中判断下架,绝大多数条目都会落入候选,原因却只是没有匹配的任务运行过。建议新增验收项:
2. 复用现有的检索评估汇总器,不另写聚合
tools/evaluate_indexer.py已经实现了配对分组重采样与分位数汇总(percentile、summarize),是 #255 检索效率与准确率那条线的统计实现,对应证据在evidence/indexer-255-*六个目录(约 15.9 MB)。它目前唯一的消费者是
tests/test_indexer_evaluation_summary.py,没有生产调用方。本提案要的每轮比率统计正好是它的用途。建议: 首版聚合复用该模块,并在提案里显式声明这一依赖,避免出现第二份口径不同的统计实现。
3. 下架需要状态定义,建议与本提案分开
知识条目的生命周期槽位已经存在,但从未被使用过:
107 个条目全部停在
imported,没有任何条目进入过其他状态;skill-index.json顶层只有schema_version与skills,没有生命周期字段。所以下架缺的不是统计数据,是状态定义与进入条件:有哪些状态、谁决定、需要什么证据、下架后检索与历史证据如何处理。本提案的 out of scope 已排除「自动更新知识库」,方向正确。
建议: 把状态定义单独开一个 issue,本提案只负责产出证据,不承担下架决定。知识晋升保留显式决定,下架应当对称。
附一处澄清,避免实现时误用:
tools/skill_eval_quarantine.py不是知识下架机制。它的文件头声明是「Explicit trusted incident stop; never admission, billing ingestion or unquarantine」,作用对象是付费预算账本,与知识条目无关。4. 这条需求暴露了目标职责图缺一条边
#6 第三轮的目标职责图里,Workbench 侧没有任何一条边回到 Knowledge 侧:现有的边是入口→知识检索、入口→实验编排、知识检索↔知识资产、执行管理↔被测系统。
而本提案要求把命中与采用记录按 campaign/run/iteration 关联后供知识侧使用,这需要一条从实验侧到知识资产的数据流。知识循环的「提取经验 → 审阅确认」两步同样依赖它。
建议: 在数据契约里显式定义这条回流的方向与所有者(谁写入、谁读取、保留多久),不要让它成为隐式耦合。这也是确定首版范围时需要先回答的接口问题。
关于首版范围的一个意见
提案把 dashboard 轮次查看入口列入 in scope。若要先服务下架判断,建议首版优先做记录与候选集合采集,展示可以后置:没有候选集合的历史数据无法事后补齐,而展示随时可以加。#314 与 #333 的结论不影响这个取舍。
Dong1017 commentedon Nov 5, 2026
补一条验收项:每轮的实际成本
读了 PR #338 新发布的 六条件 MoE 对照证据(三个模型 × 知识库 on/off)之后补这一条。静态读取已发布数据,未重跑任何实验。
缺口
当前验收项里每轮展示的是检索次数、命中次数、去重命中条目数、采用条目数——四个都是知识事件的计数。但那份对照里最大的差异不在计数上:
按现有口径记录,这三对会得到形如「检索 N 次、命中 M 条、采用 K 条」的小整数行,看不出其中两对多花了一千万 token。而这个量级的差异不需要任何因果假设就成立,属于使用事实。
建议的措辞
这不是新增采集,是把已有数据关联起来
该证据包里数据形状已经存在:
results/rounds.csv有round_input_tokens、round_cached_input_tokens、round_output_tokens、round_total_tokens、round_uncached_input_tokens及对应的cumulative_*;results/session-usage.csv有整会话聚合。关联键正是本提案第一条验收项已经要求保留的 campaign / run / iteration。
两处必须写进口径的限定
一、它回答「这一轮花了多少」,不是「检索花了多少」。 该证据包定义的轮边界是「完成评测的工具结果返回之后、下一条模型生成之前的延迟遥测快照,包含此前检索、失败、等待交互等全部会话工作」。作为迭代成本是对的,但不能拆成检索成本与推理成本。想要后者需要另一个埋点,建议不做。
rounds.csv已有token_boundary_status列跟踪边界质量,可沿用。二、费用字段可能为空。 该包
session-usage.csv的monetary_cost列六个会话全部为空,只有 token 计数,与其 README「token 不是货币账单」一致。所以验收项写「可得费用」,不假设存在货币金额。它仍然不改变本提案的因果边界
记录成本不支持「知识库有用或无用」。成本与命中、采用同属关联类事实。
反而值得记下的是:这份是目前最受控的知识开关对照,而它自己的结论仍然是不能归因。 该 README 明确写「每条件只有一条轨迹……没有逐份知识的消融实验……不能把最终高低直接归因于知识库好坏」,并指出 OFF 条件仍可访问公开技术资料、两组物理卡与时段不同、加速比是各自配对基线下的分数(跨条件候选原始延迟几何平均只差约 0.82%,medium 场景 OFF 更慢)。
所以本提案「没有对照证据时不声称因果」这条前提不需要修订——一次真实受控尝试得出的正是同一结论。成本那条的价值在别处:它是目前唯一一个量级足够大、不依赖归因推断就能读出的差别。
jiaran-king commentedon Nov 10, 2026
首版提议:把每轮搜索、命中材料和采用依据记进 campaign
现有
campaign record已经能把一轮优化和对应的候选代码、实验运行关联起来。#344 希望补上每轮的知识检索和使用记录。以 Qwen 出图优化为例,打开某一轮,我们希望能看到 Agent 搜了什么、找到了哪些材料、哪些材料被用来做决定,以及这个决定后来有没有经过实验验证。现有 campaign 记录一轮搜索是怎么记下来的?
首版拟由执行本轮优化的 Agent 在收尾时调用一次
campaign import-search(命令暂名),指定 campaign、轮次和对应的工具记录。Codex 保留实际工具调用,InferRSI 从调用和输出中整理搜索、命中和读取记录。Agent 照常使用rg或 Indexer,无需逐次填写日志。如果会话意外中止,可用已保留的本轮工具记录补录。下面借用 #380 的 Qwen B300 案例。H3 的历史失败和 Agent 据此提出的验证建议来自真实会话。图中轮次、查询和计数用于演示新接口,只展开一次搜索。Qwen 案例的实际轨迹
#380 的另一个会话也读到了 H3,但在给出最终决定前超预算停止。这一轮应当显示**“已读,采用未知”**。两次会话命中同一份材料,采用记录却不同。两次会话的对照
首版预计改哪些地方?
src/inferrsi/arguments.py和cli.py增加campaign import-search,接收 campaign 目录、轮次和本轮 trace。在 Codex 插件SKILL.md说明 Agent 如何在收尾时调用、跨轮会话如何划分,并提供一处可运行的调用示例。CLI 入口 · 插件说明src/inferrsi/harness/search_attribution.py。文件搜索从 Codex 命令及可见输出提取。Indexer 路径复用knowledge_capture.py写出的knowledge/<context_id>.json,保留条目引用、版本和已有的选择信息。两条路径都使用当时的结果。现有 capture 实现used_refs、rejected_refs、轮次决定和候选。依据只出现在最终答复时,支持附上对应的原文引用。将明细和计数写入该轮 JSON,供后续 Dashboard 读取。现有优化日志字段tests/test_search_attribution.py,覆盖两种检索入口、重复导入、跨轮会话及采用后验证失败。在docs/dashboard.md增加导入命令和对应输出。完整记录显示没有搜索时计为0,没有采到本轮记录时显示“未知”。campaign 使用文档首个 PR 建议交付可运行的导入入口、Agent 收尾时的调用示例、逐轮记录和测试。验收时可以直接看上面的两段 Qwen 轨迹。一段能查到“读过 H3,采用未知”,另一段能定位到“引用 H3,因此增加完整出图验证”的原文。Dashboard 的轮次查看入口放在后续 PR,读取同一份记录。
希望维护者确认一个接入问题:按现有 campaign 工作流,执行优化的 Agent 在收尾时能否取得本轮的工具记录,并交给导入命令?如果 trace 要到会话结束后才能取得,哪个现有入口能拿到这份 trace,同时知道它对应的 campaign 和轮次?
Dong1017 commentedon Nov 17, 2026
Posted by an agent on behalf of @Dong1017 (incremental only; points already raised by others or decided by the owner are not repeated).
Incremental note: the record half of this issue has merged, but the status block still asks for scope and owner. #384 (
Refs #344, per-round search and adoption records withsearch/archive/round-<n>.json) was merged on 2026-11-13 asa4410d69, approved by @amy-why-3459 and @david6666666. Its body says the first-version scope came from the search-domain owner's delegation and @jiaran-king's proposal here. The display side then landed as #428 under #406.What is left is for a maintainer to record. #428 explicitly does not deliver token or cost statistics, which was the open suggestion in this status block. The per-round count and ratio items in the acceptance list are not mentioned in either PR body. Please accept #384 as the first slice and say whether those items stay here or close as not planned.
Scope: PR state and bodies via the GitHub API, plus the issue body (last edited 2026-11-05). I did not check the per-round counts against the #384 code.
david6666666 commentedon Nov 17, 2026
I checked the merged implementation behind the per-round count item: #384 records
searches,hits,unique_hits, andused, and #428 displays complete counts separately from observations. Could we split this checklist item so it records the count slice as delivered, while leaving ratio definitions and display as a separate decision? If rates are retained, a partial or missing round, or a zero denominator, should not display a complete-round rate.zengchuang-hw commentedon Nov 17, 2026
独立设计审阅(不是 PR 批准,也不代表本 Issue 已验收)。
审阅基线:main
1bbc3b0c8de14d6194d7ee7987607365b665fbfe。按逐轮知识命中、采用和验证关联需求,独立检查源码及测试;未读取他人评论作为结论依据。现有能力,不建议重新造一套记录系统
apps/views/search_attribution.py已把事件、context、逐轮覆盖状态和 candidate/run/evaluation 关联起来;不完整采集的counts=null,而完整零命中为 0;同轮重导入、跨轮窗口/事件重复已有约束。knowledge_view.html已区分本地 v1 与可移植 v2、声明与证据,并明确同轮 v1/v2 不能相加。capture_delivery.py与 archive 路径进一步区分准备、实际可见资源和采用证据。后续统计应复用这些投影,而非把“检索到”直接升级成“采用”。建议先冻结两个容易误报的统计口径
_observations只把 search 事件纳入 hits/unique_hits,但_used_count对所有材料计采用,包括仅直接 read 的材料。独立最小调用确认:一个直接 read 后采用的条目可得到searches=0, hits=0, unique_hits=0, used=1。这本身不是缺陷,但不能直接计算used / unique_hits。建议分开提供“检索命中集合内已证据采用数/去重命中数”和“直接读取采用数”;缺采集及零分母均显示未知/不适用,不显示 0% 或把直接读取算成检索转化。search_attribution.py:237–266当前按 ref 去重;同一 ref 的 v1、v2 两次命中复现为hits=2, unique_hits=1。可以保留其作为“唯一条目数”,但审计关联须保留每次事件的 revision;如需要“唯一知识版本数”,另按 (ref, revision) 计算,缺版本保持未知,不能把采用旧版本和验证新版本合并成同一证据链。建议补的验收用例
已执行:上述两个纯函数最小检查;
PYTHONPATH=src python -m pytest -q tests/test_optimization_story.py tests/test_search_attribution.py tests/test_search_archive.py tests/test_search_capture_delivery.py tests/test_codex_search_delivery.py,128 项通过(使用已有测试虚拟环境,工作树未修改)。未执行:完整测试集、lint、真实优化任务、浏览器交互、L1–L4 性能/质量验收。CPU 测试不证明知识带来收益;本次也没有足够证据宣布 Issue 完成。
Dong1017 commentedon Nov 22, 2026
@Dong1017 please settle the open #344 scope question, then claim the remaining slice for the PR pool if you keep it.
src/inferrsi/apps/views/search_attribution.py, report adoption as two counts with their own denominators (evidenced adoption within the search-hit set over unique hits, and direct-read adoption), plus a per-(ref, revision) unique count, with unknown / not-applicable for incomplete capture and zero denominators (no 0% and no rate above 100%), following zengchuang-hw's 2026-11-17 design review; show them with their definitions inapps/views/knowledge_view.html; tests intests/test_search_attribution.pyfor direct-read-only adoption with zero search hits, and one ref with two revisions where one is adopted. No token or cost statistics, no causal credit, no .github/. Please have the PR pool implement it.Posted by Claude Code at Dong1017's request, while looking for pool-sized work. Maintainers, please reply here if you would rather scope this differently.
Dong1017 commentedon Nov 22, 2026
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).
Decision: the ratios stay in #344 as one bounded slice, queued for the PR pool. The count slice is accepted as delivered by #384 and #428. Dong-bot (authorized delegate).
searches,hits,unique_hitsandused; feat: 补齐知识检索解释与逐轮候选证据导航 #428 displays them. This is not full task: 支持每个优化迭代的知识库命中归因统计 #344 acceptance and not a performance claim.knowledge_view.html..github/.Still open: #344 has no accountable owner or goal-acceptance owner, so the issue stays open. The ratio PR needs independent maintainer reviews.
Details
Not delivered by this slice: the candidate-set item from the 11-05 comment, the lifecycle-status issue split, and the reverse data flow from the experiment side to the knowledge side. They stay open or deferred and need a maintainer decision. They do not block the ratio slice. The pool agent plans the work and opens a PR, or reports why it cannot. I did not inspect the #384 or #428 code. The record rests on david6666666's and zengchuang-hw's checks in the thread.
zengchuang-hw commentedon Nov 22, 2026
增量设计检视(仅针对 本轮比例范围决定,不代表 Issue 验收)。计数与比例分开交付是合理的;比例实现前,建议把两条可测试的口径写清:
0 / N = 0%是有效的「有证据采用率」,并不等于证明没有使用。现有测试 已有unique_hits=1, used=0的输入。建议在计划中的用例外,补「完整采集、分母非零但无采用」和「同条目同轮既命中又直接读」。本轮静态核对源码、页面和测试;未跑测试,也未验收交付。
Dong1017 commentedon Nov 22, 2026
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).
Opened #583 for this part (#344 ratio slice: split adoption counts/denominators (search-hit adoption vs direct-read), per-(ref, revision) unique count, unknown/N-A for incomplete or zero denominators, view definitions, tests; no token/cost, causal credit or .github/).
Ratio slice implemented. Each v1/v2 round search record now has an
adoptionblock. Search-hit adoption is over unique hits. Direct-read adoption is over refs read but never returned by a search. Adopted refs with no denominator, such as inventory-only refs, are a separate count, and a separate count covers distinct (ref, revision) search hits.Each part is
unknownfor incomplete capture ornot_applicablefor a zero denominator. No rate is stored. The dashboard shows a percentage only for complete parts, shows definitions in en and zh, and says the figures are associations with no causal credit and no token or cost data.The projection still reads older records without the block. It rejects a numerator above its denominator, a state that disagrees with coverage, and totals that disagree with
observed.Tests: 206 passed and 1 skipped (Playwright not installed) across the search, projection, story and profile tests. The dashboard and docs tests and
ruff check src testsalso passed. The profile review example was regenerated byte for byte.Not verified: full suite, browser rendering, real campaigns, and any L1–L4 work.
Left open: token/cost (needs its own decision), candidate-set capture, lifecycle status, and reverse data flow. Use stays per ref, not per revision. #344 still has no acceptance owner.
Dong1017 commentedon Nov 23, 2026
Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).
Merged #583 (squash) after independent approvals from @zengchuang-hw and @david6666666. Closing this issue is left to its acceptance owner.
Dong1017 commentedon Nov 23, 2026
#344 remains open. Merged #583 delivers the queued ratio slice only; it is not goal acceptance, and close stays unrecorded.
Dong-bot (authorized delegate).
Delivered
searches,hits,unique_hits, andused; feat: 补齐知识检索解释与逐轮候选证据导航 #428 displays them.unknown. A zero denominator isnot_applicable. A percentage is shown only for a complete part, so a complete round with hits and no evidenced adoption is 0%. Definitions are in the knowledge view. Figures are associations only: no causal credit, no token or cost fields.Still open (blocks issue acceptance)
This turn did not re-read the #583 diff or re-run tests. The delivery record follows the merge note and the #583 implementation comment already in this thread.
david6666666 commentedon Nov 23, 2026
One review-record correction for #583: GitHub shows two Approves on
9101657f, but one review starts withPASS. The current collaboration rule requiresLGTMalone on the first nonempty line. Could the delivery note distinguish the raw GitHub count from the rule-qualified count? This is separate from the shipped ratio projection.zengchuang-hw commentedon Nov 23, 2026
Review-record correction for #583
dot, acting for @zengchuang-hw
For the audit point above, I verified that my review on
9101657ff4d0883e81a899f1bee3936b05870526is a native GitHubAPPROVED. Its first line isPASS, not the exactLGTMrequired by the collaboration guide at the merge parent. Do not count my review toward that text-qualified requirement or describe the two cited native approvals as two rule-qualified approvals.The squash merge at
8a8e85795a851dc884278aea4e0db67d4c6e77f5is a separate fact. This corrects the review record only and does not change the ratio slice findings or the status of #344.