Resuming a --since or --changed scan silently widens it to the whole tree
還沒有人認領這個 Issue。
評估
研究方向
Start with the resume hint in internal/cli/scan.go around lines 80-82, then check RunStart in internal/ledger/payload.go, which has no diff-base field, and the --resume checks in internal/engine/run.go around 105-120. Reproduce by running a --since scan that exhausts its budget, then resuming it without the flag and seeing old.go leads reported. Done means a resumed diff scan reports only changed-file leads, a mismatched diff base is refused or applied with a note, the hint includes the flag, and a test in internal/engine asserts no out-of-diff lead appears.
由索引模型根據 Issue 內容生成。
描述
Summary
A --since or --changed scan that runs out of budget prints a resume command that drops the diff flag. The run does not record its diff base, so running that command continues as a whole-tree scan, and findings from files the change never touched appear in what reads as a diff scan.
Where
internal/cli/scan.go:80-82(resume hint)internal/ledger/payload.go:8-35(RunStarthas no diff-base field)internal/engine/run.go:105-120(--resumechecks; nothing compares the diff base)internal/engine/run.go:184-188(keepChangedruns only whenchanged != nil)internal/engine/agentic.go:475-517(leftoverFindingsreports uninvestigated leads)
Details
// internal/cli/scan.go:80-82
if engine.Resumable(res.Run) {
fmt.Fprintf(env.Stderr, "... To continue with the rest under a new budget:\n spackle scan %s --resume %s\n", tgt, res.RunID)
}
RunStart stores no since or changed value, and internal/engine/resume.go never refers to either. A resumed run without the flag has changed == nil, so the diff filter is skipped. Every lead in the tree then reaches leftoverFindings, which reports each lead the resumed run did not investigate as an unconfirmed finding. The findings carried over from the first run were diff-filtered; the new ones are not.
Impact
A PR or pre-commit scan, resumed as the tool instructs, turns into a whole-repository report. fail_on can fail a CI job on code outside the diff, and nothing in the report says the file set changed between the two runs.
Steps to reproduce
- In a git repository, put a flaw a built-in rule catches in an unchanged file (
old.go) and make a small change innew.go. spackle scan . --since HEAD~1 --max-usd <small>with a model, so the run ends budget-exhausted.- Run the printed
spackle scan . --resume <id>. - The resumed report lists the
old.golead, although the first run's note said only changed files were reported.--changedbehaves the same.
Suggested fix
Record the diff base in RunStart (for example DiffBase string, holding since:<rev> or changed). Restore it in loadResume, and either apply the stored base or refuse a --resume whose --since/--changed differs from it. Include the flag in the hint at scan.go:81.
Acceptance criteria
- A resumed diff scan reports only leads in the changed files.
-
--resumewith a different diff base from the stored run is refused, or the stored base is applied with a note. - The resume hint printed after a budget-exhausted diff scan includes
--since <rev>or--changed. - A test resumes a budget-exhausted
--sincerun and asserts that no lead outside the diff is reported.
Getting started
- Relevant files:
internal/engine/run.go,internal/engine/resume.go,internal/ledger/payload.go,internal/cli/scan.go - How to run tests:
go test ./internal/engine ./internal/cli(ormake test-short) - Related docs:
docs/ci.md(diff scans),docs/superpowers/specs/
Filed by repo-audit/full-audit at fffef43. Severity: medium. Effort: M. audit-key: bug|internal/engine/run.go|Run resume diff base
- 主要語言
- 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 天內回覆