--changed refusals name --since, and the diff mode is chosen by comparing a display string
還沒有人認領這個 Issue。
評估
研究方向
Start in internal/engine/diffscan.go, where changedSince compares rev against the uncommitted label, then check the refusal text at internal/engine/run.go lines 70 and 115-120 to see which flag name is hard-coded. Next, read the MCP scan handler in internal/mcp/tools.go around lines 369-379 to see how since and changed are passed through. Done means every refusal names the flag or argument the caller used, no code compares against the display label, and TestSinceRefusals plus new cases for --changed on a git URL and a blank MCP since pass under go test ./internal/engine ./internal/mcp.
由索引模型根據 Issue 內容生成。
描述
Summary
The diff-scan mode is carried as the human-readable label "the last commit (uncommitted changes)", and the code decides which git command to run by comparing the revision with that text. One refusal still names --since when --changed caused it, and the MCP scan tool reports CLI flag names and treats a blank since as a full scan.
Where
internal/engine/diffscan.go:13-27(const uncommitted = ...,diffBase)internal/engine/diffscan.go:28-51(changedSincecomparesrev == uncommittedthree times)internal/engine/run.go:115-120(refusals)internal/mcp/tools.go:369-379(MCPscanpassessince/changedthrough)
Details
const uncommitted = "the last commit (uncommitted changes)"
...
flag := "--since"
if rev == uncommitted {
flag = "--changed"
}
// run.go:118-119
if diffBase(opts) != "" && tgt.Kind != target.KindPath {
return Result{}, fmt.Errorf("%w: --since compares a checkout with a base revision, and %s is not a directory. ...", ErrRefused, tgt.Display)
}
Checklist:
-
spackle scan --changed https://github.com/example/none.gitprints "run refused: --since compares a checkout with a base revision ...", naming a flag the user did not pass.run.go:70-72was updated to name both flags; this check was not. -
--since "the last commit (uncommitted changes)"silently runs a--changedscan. - An MCP client gets "--since and --changed choose different file sets" (
run.go:116), with CLI flag names instead of the tool's argument names. - MCP
since: " "is trimmed to""and silently runs a full scan instead of reporting an empty revision.
Impact
Users get error text that misnames their input. Rewording the report note would change behavior, and a third diff mode (for example --staged) would need another sentinel string.
Suggested fix
- Build a
diffSpec{flag, rev, label string; list func(ctx, root) ([]string, error)}once inRunfromopts(nil for a full scan). Pass it tochangedSinceandkeepChanged, and delete therev == uncommittedcomparisons. - Use
spec.flagin the refusals atrun.go:70andrun.go:118. For--changed, say it lists uncommitted work in a local checkout. - In the MCP
scantool, reject a blanksinceandsincetogether withchangedbefore calling the engine, with messages that use the argument names.
Acceptance criteria
- Every refusal names the flag (CLI) or argument (MCP) the caller actually used.
- No code path compares a revision with the display label.
- Tests cover
--changedon a git URL and MCPsince: " ".
Getting started
- Relevant files:
internal/engine/diffscan.go,internal/engine/run.go,internal/mcp/tools.go - How to run tests:
go test ./internal/engine ./internal/mcp(existing:TestSinceRefusals,TestChangedLimitsTheScanToUncommittedFiles)
Filed by repo-audit/full-audit at fffef43. Severity: low. Effort: S. audit-key: bug|internal/engine/diffscan.go|diffBase
- 主要語言
- Go
- 星號
- 0
- 分支
- 1
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TMHSDigital/Spackle 的其他 Issue
-
enhancement good first issue severity: low
難度 2/5 半天 新手友好度 72/100
TMHSDigital/Spackle#139 ·
-
enhancement good first issue severity: low
難度 2/5 1-3 小時 新手友好度 72/100
TMHSDigital/Spackle#138 ·
-
documentation good first issue severity: low
難度 2/5 1-3 小時 新手友好度 78/100
TMHSDigital/Spackle#135 ·
-
bug good first issue severity: low
難度 2/5 1-3 小時 新手友好度 72/100
TMHSDigital/Spackle#131 ·
-
bug good first issue severity: low
難度 2/5 1-3 小時 新手友好度 78/100
TMHSDigital/Spackle#129 ·
查看 TMHSDigital/Spackle 的全部 Issue
相似的 Issue
-
bug raised-by:reviewer
難度 2/5 1-3 小時 新手友好度 66/100
medici-finance/assay#7655 ·
維護者通常 1 天內回覆
-
helm chart: make DaemonSet pod affinity configurable via values.yaml可能已有人在做 @Young-Zen 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
flannel-io/flannel#2632 ·
維護者通常 6 天內回覆
-
go-vulnerability security-scan
難度 1/5 1 小時以內 新手友好度 72/100
teslashibe/agent-go#36 ·
-
enhancement
難度 2/5 1-3 小時 新手友好度 72/100
nwverse/persona#15194 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug flaky-test
難度 2/5 1-3 小時 新手友好度 78/100
rosskukulinski/tailworks#411 ·
維護者通常 1 天內回覆