feat(edit): 工作树 blast radius,不需要先跑一次管线 (#58) - #86
Conversation
`code-intel edit impact --repo-path <checkout> --changed <path>...` answers "what does this touch, and which tests should I run" from the working tree: no artifact root, no committed run, no snapshot identity, no capability envelope. Issue #58's thesis was that the pipeline contributes nothing while an agent writes code, and that this is structural. The measured reason is narrower than the issue says: since #63 the skill already carries write verbs, but the route they point at, `change impact --staleness advisory`, calls snapshot freshness unconditionally before the staleness branch. That was ~10s on this repo. #84 cut it to 0.6s; this route avoids it entirely, at 195-308ms over 833 files. Authority is the thing traded away, and the payload says so: `"authority":"none"`, `"source":"working-tree"`, and a limitations entry stating it must never gate. A test asserts the schema name appears in no admissibility, gate, index, artifact-ref or committed-evidence path, so there is nothing for a later change to start consuming by accident. It is not a second implementation. The traversal moved to a shared `impact_graph` module that `change impact` now calls too — same reverse-import walk, same test selection, same reason and confidence labels. The import heuristics are the ones evidence.native-code already publishes. Two answers about the same tree that disagreed would be worse than one answer that is late. KNOWN GAP, measured, not hidden: on this repository the graph resolves 16 of 821 import edges. `import_target`'s Rust arm returns everything between `use ` and `;`, so `use crate::a::{b, c};` yields a target with a brace group that `resolve_import` cannot map to a path, and `mod` lines are not read at all. `change impact` has the identical weakness — it shares the resolver — so this is a pre-existing limit this route makes visible rather than one it introduces. Both `resolvedImportEdges` and `unresolvedImportEdges` are in the payload for exactly that reason. Fixing the Rust arm is the next slice and changes evidence.native-code output, so it belongs in its own change. Refs #58
|
🔒 Repowise is not analyzing this repository The PR bot is free on public repositories. This one is private, which needs a Pro plan. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Important Review skippedToo many files! This PR contains 154 files, which is 54 over the limit of 100. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (154)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…report binds `orchestration/acceptance/native-code-evidence-candidate.json` carries a sourceDigest for native_code_evidence.rs, which this branch changed when it made `language` and `extract_imports` crate-visible. The language adapter acceptance gate reported provenance sourceBound=False, and the fast conformance profile failed with it. This is the seventh place in the repository that pins that one file. The others — integrations.json, four internalization records, a test constant and the launcher — were re-synced when the visibility changed; this one is under orchestration/acceptance/ and was missed because nothing links the pin sites together. A `code-intel repin` sweep that knows every pin site is the obvious fix and is not this change. Refs #58
从工作树回答「我动的这几个文件会牵动什么、该跑哪些测试」:无 artifact root、无先行 run、无 snapshot identity、无 capability envelope。
为什么需要它
#58 的论点是管线在 agent 写代码时毫无贡献,而且这是结构性的。实测下来原因比票里写的更窄:
#63 之后 SKILL.md 已经有写动词了,但它指向的那条路
change impact --staleness advisory,在 staleness 分支之前无条件调用 snapshot freshness——本仓约 10 秒。#84 把它降到 0.6 秒,这条路由则完全绕开:833 个文件、195–308ms。交易掉的是权威,而且明说
payload 里
"authority":"none"、"source":"working-tree",limitations 第一条就是「必须永不 gate」。不止是写在字符串里——有一条测试断言这个 schema 名不出现在 admissibility、sentrux_gate、artifact_index、artifact_ref、committed_evidence 任何一条路径里,所以没有东西可供日后某次改动"顺手"开始消费。
不是第二套实现
遍历逻辑抽到共享的
impact_graph模块,change impact现在也调它——同一个反向 import walk、同一套测试选择、同样的 reason/confidence 标签。import 启发式用的是evidence.native-code已经在发布的那套。对同一棵树给出两个互相矛盾的答案,比只有一个慢答案更糟。
已知缺口,量化了,没藏
本仓 821 条 import 边只解析出 16 条。
import_target的 Rust 分支返回use与;之间的全部内容,于是use crate::a::{b, c};产出一个带花括号组的 target,resolve_import映射不到路径;mod行则完全不读。change impact有一模一样的弱点——它们共用同一个 resolver——所以这是这条路由暴露出来的既有限制,不是它引入的。resolvedImportEdges和unresolvedImportEdges都在 payload 里,正是为了让这件事看得见。修 Rust 分支会改变
evidence.native-code的输出,属于下一个切片,单独做。验证
cargo test全绿No degradation detectedtest-atomic-capability-contract.ps1exit 0test-retirement-packets.ps18 packets + 2 audits 全 PASSRefs #58