Skip to content

feat(edit): 工作树 blast radius,不需要先跑一次管线 (#58) - #86

Open
2233admin wants to merge 2 commits into
mainfrom
feat/edit-impact
Open

feat(edit): 工作树 blast radius,不需要先跑一次管线 (#58)#86
2233admin wants to merge 2 commits into
mainfrom
feat/edit-impact

Conversation

@2233admin

Copy link
Copy Markdown
Owner
code-intel edit impact --repo-path <checkout> --changed <path>... [--scope <dir>]...

从工作树回答「我动的这几个文件会牵动什么、该跑哪些测试」:无 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——所以这是这条路由暴露出来的既有限制,不是它引入的。resolvedImportEdgesunresolvedImportEdges 都在 payload 里,正是为了让这件事看得见。

修 Rust 分支会改变 evidence.native-code 的输出,属于下一个切片,单独做。

验证

  • cargo test 全绿
  • sentrux 闸门 No degradation detected
  • test-atomic-capability-contract.ps1 exit 0
  • test-retirement-packets.ps1 8 packets + 2 audits 全 PASS
  • 推送前逐个核对:被指钉的源文件工作区字节 == HEAD 字节

Refs #58

`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-bot

repowise-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🔒 Repowise is not analyzing this repository

The PR bot is free on public repositories. This one is private, which needs a Pro plan.

See plans · Manage this repository

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 154 files, which is 54 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4deb437a-8f51-42b1-812c-6177a044d519

📥 Commits

Reviewing files that changed from the base of the PR and between b9c6aa9 and 3777fe1.

📒 Files selected for processing (154)
  • crates/code-intel-cli/src/capability_inventory.rs
  • crates/code-intel-cli/src/change_impact.rs
  • crates/code-intel-cli/src/edit_impact.rs
  • crates/code-intel-cli/src/impact_graph.rs
  • crates/code-intel-cli/src/main.rs
  • crates/code-intel-cli/src/native_code_evidence.rs
  • crates/code-intel-cli/tests/artifact_ref.rs
  • crates/code-intel-cli/tests/capability_exec.rs
  • legacy/run-code-intel.ps1
  • orchestration/acceptance/native-code-evidence-candidate.json
  • orchestration/integrations.json
  • orchestration/internalization/ast-grep.json
  • orchestration/internalization/c03-r05-r12-measurements.json
  • orchestration/internalization/cocoindex.json
  • orchestration/internalization/git.json
  • orchestration/internalization/github-research.json
  • orchestration/internalization/greenfield.json
  • orchestration/internalization/native-code-evidence.json
  • orchestration/internalization/repomix.json
  • orchestration/internalization/rg.json
  • orchestration/retirements/e02-recommender/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e02-recommender/compatibility-retirement-manifest.json
  • orchestration/retirements/e02-recommender/compatibility-retirement-ticket.json
  • orchestration/retirements/e02-recommender/e00-request.json
  • orchestration/retirements/e02-recommender/e01-request.json
  • orchestration/retirements/e02-recommender/e01-stderr.txt
  • orchestration/retirements/e02-recommender/evidence/c00-necessity.json
  • orchestration/retirements/e02-recommender/evidence/compatibility-window.json
  • orchestration/retirements/e02-recommender/evidence/contract-parity.json
  • orchestration/retirements/e02-recommender/evidence/dependency-d02-clean-machine.json
  • orchestration/retirements/e02-recommender/evidence/dependency-repo-snapshot.json
  • orchestration/retirements/e02-recommender/evidence/effect-parity.json
  • orchestration/retirements/e02-recommender/evidence/golden-parity.json
  • orchestration/retirements/e02-recommender/evidence/independent-approval.json
  • orchestration/retirements/e02-recommender/evidence/registry-reconciliation.json
  • orchestration/retirements/e02-recommender/evidence/replacement-atom.json
  • orchestration/retirements/e02-recommender/evidence/rollback-execution.json
  • orchestration/retirements/e02-recommender/evidence/usage-observation.json
  • orchestration/retirements/e02-recommender/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e03-provider-preflight/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e03-provider-preflight/compatibility-retirement-manifest.json
  • orchestration/retirements/e03-provider-preflight/compatibility-retirement-ticket.json
  • orchestration/retirements/e03-provider-preflight/e00-request.json
  • orchestration/retirements/e03-provider-preflight/e01-request.json
  • orchestration/retirements/e03-provider-preflight/e01-stderr.txt
  • orchestration/retirements/e03-provider-preflight/evidence/c00-necessity.json
  • orchestration/retirements/e03-provider-preflight/evidence/compatibility-window.json
  • orchestration/retirements/e03-provider-preflight/evidence/contract-parity.json
  • orchestration/retirements/e03-provider-preflight/evidence/dependency-a04-admissibility.json
  • orchestration/retirements/e03-provider-preflight/evidence/dependency-repo-snapshot.json
  • orchestration/retirements/e03-provider-preflight/evidence/effect-parity.json
  • orchestration/retirements/e03-provider-preflight/evidence/golden-parity.json
  • orchestration/retirements/e03-provider-preflight/evidence/independent-approval.json
  • orchestration/retirements/e03-provider-preflight/evidence/registry-reconciliation.json
  • orchestration/retirements/e03-provider-preflight/evidence/replacement-atom.json
  • orchestration/retirements/e03-provider-preflight/evidence/rollback-execution.json
  • orchestration/retirements/e03-provider-preflight/evidence/usage-observation.json
  • orchestration/retirements/e03-provider-preflight/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e04-codenexus-direct/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e04-codenexus-direct/compatibility-retirement-manifest.json
  • orchestration/retirements/e04-codenexus-direct/compatibility-retirement-ticket.json
  • orchestration/retirements/e04-codenexus-direct/e00-request.json
  • orchestration/retirements/e04-codenexus-direct/e01-request.json
  • orchestration/retirements/e04-codenexus-direct/e01-stderr.txt
  • orchestration/retirements/e04-codenexus-direct/evidence/c00-necessity.json
  • orchestration/retirements/e04-codenexus-direct/evidence/compatibility-window.json
  • orchestration/retirements/e04-codenexus-direct/evidence/contract-parity.json
  • orchestration/retirements/e04-codenexus-direct/evidence/dependency-b05.json
  • orchestration/retirements/e04-codenexus-direct/evidence/effect-parity.json
  • orchestration/retirements/e04-codenexus-direct/evidence/golden-parity.json
  • orchestration/retirements/e04-codenexus-direct/evidence/independent-approval.json
  • orchestration/retirements/e04-codenexus-direct/evidence/registry-reconciliation.json
  • orchestration/retirements/e04-codenexus-direct/evidence/replacement-atom.json
  • orchestration/retirements/e04-codenexus-direct/evidence/rollback-execution.json
  • orchestration/retirements/e04-codenexus-direct/evidence/usage-observation.json
  • orchestration/retirements/e04-codenexus-direct/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e04-codenexus-direct/rollback-rehearsal/run-code-intel.ps1
  • orchestration/retirements/e05-publication/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e05-publication/compatibility-retirement-manifest.json
  • orchestration/retirements/e05-publication/compatibility-retirement-ticket.json
  • orchestration/retirements/e05-publication/e00-request.json
  • orchestration/retirements/e05-publication/e01-request.json
  • orchestration/retirements/e05-publication/e01-stderr.txt
  • orchestration/retirements/e05-publication/evidence/c00-necessity.json
  • orchestration/retirements/e05-publication/evidence/compatibility-window.json
  • orchestration/retirements/e05-publication/evidence/contract-parity.json
  • orchestration/retirements/e05-publication/evidence/dependency-a06-stage.json
  • orchestration/retirements/e05-publication/evidence/dependency-a09.json
  • orchestration/retirements/e05-publication/evidence/effect-parity.json
  • orchestration/retirements/e05-publication/evidence/golden-parity.json
  • orchestration/retirements/e05-publication/evidence/independent-approval.json
  • orchestration/retirements/e05-publication/evidence/registry-reconciliation.json
  • orchestration/retirements/e05-publication/evidence/replacement-atom.json
  • orchestration/retirements/e05-publication/evidence/rollback-execution.json
  • orchestration/retirements/e05-publication/evidence/usage-observation.json
  • orchestration/retirements/e05-publication/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e05-publication/rollback-rehearsal/run-code-intel.ps1
  • orchestration/retirements/e07-native-code/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e07-native-code/compatibility-retirement-manifest.json
  • orchestration/retirements/e07-native-code/compatibility-retirement-ticket.json
  • orchestration/retirements/e07-native-code/e00-request.json
  • orchestration/retirements/e07-native-code/e01-request.json
  • orchestration/retirements/e07-native-code/e01-stderr.txt
  • orchestration/retirements/e07-native-code/evidence/c00-necessity.json
  • orchestration/retirements/e07-native-code/evidence/compatibility-window.json
  • orchestration/retirements/e07-native-code/evidence/contract-parity.json
  • orchestration/retirements/e07-native-code/evidence/dependency-inventory.json
  • orchestration/retirements/e07-native-code/evidence/dependency-snapshot.json
  • orchestration/retirements/e07-native-code/evidence/effect-parity.json
  • orchestration/retirements/e07-native-code/evidence/golden-parity.json
  • orchestration/retirements/e07-native-code/evidence/independent-approval.json
  • orchestration/retirements/e07-native-code/evidence/registry-reconciliation.json
  • orchestration/retirements/e07-native-code/evidence/replacement-atom.json
  • orchestration/retirements/e07-native-code/evidence/rollback-execution.json
  • orchestration/retirements/e07-native-code/evidence/usage-observation.json
  • orchestration/retirements/e07-native-code/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e07-native-code/rollback-rehearsal/run-code-intel.ps1
  • orchestration/retirements/e08-hospital/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e08-hospital/compatibility-retirement-manifest.json
  • orchestration/retirements/e08-hospital/compatibility-retirement-ticket.json
  • orchestration/retirements/e08-hospital/e00-request.json
  • orchestration/retirements/e08-hospital/e01-request.json
  • orchestration/retirements/e08-hospital/e01-stderr.txt
  • orchestration/retirements/e08-hospital/evidence/c00-necessity.json
  • orchestration/retirements/e08-hospital/evidence/compatibility-window.json
  • orchestration/retirements/e08-hospital/evidence/contract-parity.json
  • orchestration/retirements/e08-hospital/evidence/dependency-a04.json
  • orchestration/retirements/e08-hospital/evidence/dependency-b07.json
  • orchestration/retirements/e08-hospital/evidence/effect-parity.json
  • orchestration/retirements/e08-hospital/evidence/golden-parity.json
  • orchestration/retirements/e08-hospital/evidence/independent-approval.json
  • orchestration/retirements/e08-hospital/evidence/registry-reconciliation.json
  • orchestration/retirements/e08-hospital/evidence/replacement-atom.json
  • orchestration/retirements/e08-hospital/evidence/rollback-execution.json
  • orchestration/retirements/e08-hospital/evidence/usage-observation.json
  • orchestration/retirements/e08-hospital/gate-out/compatibility-retirement-decision.json
  • orchestration/retirements/e10-index/compatibility-retirement-deletion-diff.json
  • orchestration/retirements/e10-index/compatibility-retirement-manifest.json
  • orchestration/retirements/e10-index/compatibility-retirement-ticket.json
  • orchestration/retirements/e10-index/e00-request.json
  • orchestration/retirements/e10-index/e01-request.json
  • orchestration/retirements/e10-index/e01-stderr.txt
  • orchestration/retirements/e10-index/evidence/c00-necessity.json
  • orchestration/retirements/e10-index/evidence/compatibility-window.json
  • orchestration/retirements/e10-index/evidence/contract-parity.json
  • orchestration/retirements/e10-index/evidence/dependency-e05.json
  • orchestration/retirements/e10-index/evidence/effect-parity.json
  • orchestration/retirements/e10-index/evidence/golden-parity.json
  • orchestration/retirements/e10-index/evidence/independent-approval.json
  • orchestration/retirements/e10-index/evidence/registry-reconciliation.json
  • orchestration/retirements/e10-index/evidence/replacement-atom.json
  • orchestration/retirements/e10-index/evidence/rollback-execution.json
  • orchestration/retirements/e10-index/evidence/usage-observation.json
  • orchestration/retirements/e10-index/gate-out/compatibility-retirement-decision.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…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
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