verify: --redact-paths always widens to the full suite, with a misleading reason
維護者通常 1 天內回覆
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- node.js, typescript
研究方向
Start with the observe calls in packages/diffci-cli/src/client/verify.ts, then trace how selectedTests, proposedCommands, and executableSelection are handled in observe.ts and verify.ts. Reproduce the reported --changed --no-checks --redact-paths --json case and inspect the tests covering redacted selection. Done means selected verification stays targeted with redacted paths in the receipt, or any widening clearly reports its redaction cause; pull request #276 is already open.
由索引模型根據 Issue 內容生成。
描述
What went wrong?
diffci verify --redact-paths never runs a selected set of tests. Every redacted run widens to the full suite, and the reason it gives is misleading.
There are two parts:
-
Every redacted run widens to the full suite.
verifyChanged,verifyRange(andverifyScoped, throughverifyChangedSnapshot) passredactPathstoobserve(packages/diffci-cli/src/client/verify.ts, theobserve({...})calls inverifyChangedSnapshotandverifyCommitRange).observethen returnsselectedTestsas sha256-12 digests (observe.ts,selectedTests.map(hashPath)), whileproposedCommandsstill carry the real paths.executableSelection(verify.ts) matches the real command against the digests.unmatchedNodeTeststherefore finds that no selected file matches, and the run falls back to the full test command. (For other runners,inferSelectedCommandreceives digests in place of paths.) -
The reason is misleading. It reads as if the selection could not be expressed as a command:
selected verification was not executable (node --test would not match 1 selected test file(s), such as 19e48d04740e); broadened to full verificationThe real cause is that the paths were redacted before planning. The digest in the message is not something the user can act on.
The documented purpose of --redact-paths is to keep file paths out of the report. Silently running the full suite on every redacted run defeats the purpose of verify's selection.
Question for maintainers: is the widening intended, for example as a deliberately conservative choice under redaction? Some code already turns features off under redaction on purpose (the coverage map and the first pass in executeWithPolicy, and the enforce global-risk fallback). If the widening is intended, the reason should still say that --redact-paths caused it.
DiffCI version
main at 40aa308
Command you ran
A repository with "test": "node --test", src/a.js and src/b.js, test/a.test.js and test/b.test.js (each test imports its own source), and an uncommitted change to src/a.js:
diffci verify --changed --no-checks --json
diffci verify --changed --no-checks --redact-paths --json
Environment
Linux, Node 24, npm.
Output
Without --redact-paths:
"selection": "selected",
"reason": "dependency impact",
"command": "node --test test/a.test.js",
"selected_tests": ["test/a.test.js"]
With --redact-paths:
"selection": "full",
"reason": "selected verification was not executable (node --test would not match 1 selected test file(s), such as 19e48d04740e); broadened to full verification",
"command": "npm test"
What you expected
With --redact-paths, the same selection should run (node --test test/a.test.js), and the receipt should carry digests in place of the paths (selected_tests: ["19e48d04740e"]). If widening under redaction is intended, the reason should say that the selection was widened because of --redact-paths.
- 主要語言
- TypeScript
- 星號
- 0
- 分支
- 4
- 平均合併
- 18 小時 41 分鐘
- 30 天內合併 PR
- 48
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
DiffCI/core 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
Planner: splitParts regex is quadratic on a quote followed by many backticks, so the fuzz test fails at random可能已有人在做 @FredApps 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
Agent tools: changed_files lists only the new path of a renamed file可能已有人在做 @FredApps 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
adapter good first issue
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
相似的 Issue
-
agent-ready area: ui-server priority: p3 type: test
難度 2/5 1-3 小時 新手友好度 78/100
schlessera/brain-kit#4249 ·
維護者通常 1 天內回覆
-
documentation tool triaged
難度 2/5 1-3 小時 新手友好度 73/100
can1357/oh-my-pi#19608 · 2 則留言 ·
維護者通常 1 天內回覆
-
dependencies tech-debt
難度 2/5 1-3 小時 新手友好度 65/100
bcgov/nr-waste-plus#1549 ·
維護者通常 1 天內回覆
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 78/100
blixvip/solana-tx-parse#18 ·