Repository navigation
Add a source-verified Rune repository-context pilot - #7875
huangruiteng merged 1 commit into
Conversation
Signed-off-by: Lihua <1017343802@qq.com>
loopx-agent
left a comment
There was a problem hiding this comment.
1) 问题定义(为什么改、要解决什么)
- 为仓库上下文检索(repository-context)交付一个带源码哈希校验的 Rune(无模型 MCP 图检索)对照试点脚本与完整实测报告,评估其与直接文件搜索在真实查询、token 预算裁剪与不存在符号胡乱召回上的表现。
2) 改动摘要(按模块分组)
- 源码哈希校验的 Rune 对照试点与诚实负面结果留存 (
examples/**):固定导出归档哈希与 4,096 估算 token 预算,在 3 类查询(Windows worktree、Provider key shapes、不存在符号)上对比直接检索与 Rune MCP,并完整记录负向结果(Rune 因预算裁剪丢失关键文件、在不存在符号查询上返回 5 个无关文件、耗时 73.15s 以及依赖树npm audit9 项告警),明确结论为当前工作负载下不支持默认集成 Rune。
3) 逐点审阅结论(架构、语义、正确性、测试、风险)
- 研究诚实性与隔离边界:未引入任何生产依赖或默认开关变更,完整保留了失败尝试、预算裁剪失真与安全审计限制,完全符合 AGENTS.md 对负面实验结果保真的要求。
4) 建议修改项(分 P0/P1/P2,带文件路径和行号)
- 无阻塞项。
5) 最终结论(Verdict)
Approved — ready to merge once CI completes (exact head 9d392737a0ad9a0ac1dbbbea68b87c69950c0c86 verified).
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max
动机 / Motivation
考虑为跨会话 issue-fix 工作增加 repository intelligence 的维护者。 原来只能根据 provider 宣传和零散搜索决定是否接入;现在固定两个历史公开问题及一个不存在符号,分别运行检索、源码核验和真实只读 planner,并保留失败/不相关结果。 我独立跑通固定 Rune revision 与声明的三个查询:两组参考文件 Rune 均未召回,absent-symbol 返回五个无关文件;六个真实 native readback 均 accepted_read_only/ungrounded,10 个隔离 tests 通过。负结果不足以支持默认集成。 不完成 issue #4926 的真实修复任务/长程效果和完整成本比较,也不交付安装版 provider/frontend。
本次可作为 justified_increment:真实任务采用、修复正确性、跨会话收益、生产依赖/lifecycle/frontend 与完整成本资格仍由原 issue #4926 承担。 issue 明确接受 first small experiment;当前交付一个可重跑、可证伪的负向选择依据,生产集成和父 issue 关闭均未宣称。
改动思路 / Approach
现有 issue-fix 已能消费 advisory repository context,因此这个实验把 provider 限定为可选的证据提供者,不新增 control-plane owner。流程是固定 Git 导出 → direct/Rune 检索 → 以启动前 hash 和实际行重新核验 → 原只读 planner。当前源码与相关性、权限、修复正确性分别验证,不能用 freshness 代替后面三者。
不指定 Rune 选项就只运行 direct search;指定固定版本时用 local stdio、deep:false。单次检索和 MCP 调用不是相同工作单位,固定三题与八文件 cap 也不是 matched model treatment。这个边界能回答是否值得继续接入,不能提前交付安装版 provider/frontend 或关闭原 issue。
具体改动 / Changes
完整 diff 为8文件 +664/-0:evidence.ts 拥有不可变 Git export、symlink/index 排除和 source hash;providers.ts 拥有直接搜索及显式固定 Rune 的 prepare/start/search/close;run.ts 保存每次尝试与失败,并调用原 CLI 读回。queries.json 固定两组历史公开问题和一个不存在符号,README 保留负结果与获取成本边界,issue-fix 英中 README 仅增加实验链接,没有新的生产模块。
exportSnapshot / verifyCitations在 provider 启动前记录源文件 hash,核对 containment、行、snippet 和完整文件 bytes;provider 修改后的自身文本不能为原 revision 作证。引用当前不意味着内容相关,context 仍为 advisory/change_scope。RuneSession.start/search检查固定 provider SHA 和 tracked edits,deep:false/force:false;无配置时不隐式安装或调用模型。关闭失败和 provider unavailable 单独保留。main要求新输出目录;direct 和 Rune 的失败行都保留,native readback 失败不伪装成成功检索。原 issue-fix input/schema/authority 没有改变。
规格为 issue #4926,spec_revision issue-body-sha256:6eb30dc26bf7bd6ce24c3fcadee92de81c13886b8f41b1bf45544f088d056c21,读取的是当前完整问题正文。first public-issue experiment 已实现;optional evidence and control-plane separation 已实现;real-work benefit and complete cost 仍 deferred,原因及下一步保留在同一原 issue,未为本次实验增加平行程序。
对主干的风险 / Risks
最强反例是 provider 先修改 snapshot,再给出匹配自己替换文本的 citation;pre-provider hash 和负向 test 阻止这个情况。dirty/untracked 文件、已有 .rune index、外部 symlink、错行/过期片段、重复输出目录都在独立测试中验证。失败 native readback 和 unavailable provider 不抹掉成功 direct observation。
- PASS:隔离 HOME/XDG 的10个 Node tests,包含真实原 CLI/default-off 和 retained failure。初次继承用户环境的测试失败保留为环境诊断,未当作产品回归。
- PASS:独立使用固定 Rune revision
4042a088f1672d32110f38a5ec10c59717ea5412、固定 source789694fa42972db17acd47aa2604b1907060028d的真实 run。导出7174源文件;Rune 索引6240。两组参考文件0召回,预算各丢8个 insights;不存在符号返回5个无关文件。相关参考 owners 与 #7814/#7817 实际 diff 文件独立核对。 - PASS:同6个 context 在不可变 base/head 经真实 planner 消费。排除每次调用生成的 generated_at,其余 context 字段相同,均 read-only/ungrounded。
本次 run 约51.6秒,使用已准备 provider,不含首次获取/安装成本,不能称完整冷启动成本或稳定延迟。没有模型调用、repair outcome 或长期收益试验。README 披露的依赖 audit 风险是生产采用的保留资格,本次没有把它改称已修复或 clean。真实 provider 的负结果是实验结论,pipeline failed:false 只表示观察完成。
持久价值与复用
已阅读原 Decision Context provider comparison 和 issue-fix context/outcome/workflow smokes;它们不覆盖固定 Rune/source-hash-before-provider/真实 MCP 路径。这组实验以已有消费者为落点,不是复制测试赚取 PR。完整初始 queue 中同作者另有 #5248 的不同 Goal-channel UI 工作,没有同形实验批量或重复违规证据。建议保留一个实验组并复用它,避免扩成新的 provider 框架或 active benchmark 条目。
我的整体评价 / Verdict
APPROVE,作为原 issue 明确允许的有界 first experiment。真实负结果支持继续保持默认不接入 Rune,而不是宣称 repository intelligence 已解决长期任务问题。long_horizon/user_experience 为 preserved:生产入口、权限、默认上下文和 planner 保持,模型采用与修复收益未验证。visual_review not_applicable:本 PR 是 examples/研究文档与 CLI/artifact 实验,没有改变发布 UI/设置或页面。原 issue 的真实任务、完整成本与生产生命周期/frontend 缺口继续保留。
English verdict: APPROVE — 9d392737a0ad9a0ac1dbbbea68b87c69950c0c86; a justified, optional source-verified experiment with independently reproduced negative retrieval results. Ten tests and six read-only native context comparisons pass; task benefit and production adoption remain unqualified.
Goal And Delivered Outcome
Related to #4926. A resumed issue-fix agent currently prepares repository-context JSON by hand. This adds an explicit, reproducible Rune MCP experiment that verifies returned citations against an immutable source export, emits the existing context contract, and reads it back through the real
issue-fix workflow-planCLI.The experiment produced useful negative evidence: under the frozen settings Rune returned no reference-file citations for the two historical repair questions and returned unrelated files for the absent-symbol question. This supports keeping production adoption unqualified.
Target:
loopx-project/loopx:main, basee9eda527afd5fcb262ee7c199e1822b1a936cc24.Author Declaration
issue_fix_repository_context_input_v0; source-current evidence stays advisory and covers discovery onlyChange And Continuation
The TypeScript example is the active caller; no production capability, provider selection, Kernel decision or mandatory dependency is added. Rune is installed only in disposable storage after explicit opt-in. The default experiment runs direct search. Existing production default and thin/context contracts are unchanged.
The bounded improvement is shared citation verification for both inputs, including source hashing before provider startup, escape rejection, and a streamed archive instead of buffering the entire source in memory. Records from failed attempts are not overwritten.
This completes the first experiment. Continue adoption decisions in #4926: budget-aware citation delivery, unknown-symbol abstention, dependency qualification and real task-outcome evidence remain necessary. A future production provider also needs its owning frontend journey.
Validation
Tested source head:
9d392737a0ad9a0ac1dbbbea68b87c69950c0c86. Input classes: synthetic and public_fixture. Reported runs are finished.ungrounded, with no Todo or external writesThe full comparison predates only the final clean-provider preflight. A current-head real-provider probe separately passed clean MCP startup and rejection of modified tracked provider source. A separate synthetic
answerlookup failed to return a verified citation; it is not counted as a successful symbol-lookup qualification.All earlier observations are retained privately: the initial archive-buffer failure happened before retrieval; the next completed run lacked budget telemetry; the instrumented run used identical questions, references, result cap and token budget. They are not pooled or substituted. Rune reported eight dropped insights for each real question; the budget was not raised after failure.
A separate audit of the same pinned upstream dependency tree reported nine findings (one critical, three high, five moderate). The local stdio experiment does not qualify production applicability or remediation. No dependency/security clearance, model benefit, installed adoption, native Windows execution or full-repository CI pass is claimed.
Frontend / Visual Evidence
UI impact: none. The deliverable is an explicit CLI/artifact experiment, linked from the existing bilingual issue-fix guide. No production frontend, settings editor or documentation chrome changes. Screenshots: N/A.
Boundary
Only example code, public query declarations and guide text are committed. No private state, raw benchmark/provider logs, credentials, machine paths or generated reports are included. No paired RFC changes. The commit has DCO sign-off; no merge or deployment is performed.