Proof success and fix verification are decided in several places
還沒有人認領這個 Issue。
評估
研究方向
Start by comparing the five proof-success expressions listed in the issue, at internal/agent/prover.go:245, internal/agent/debugger.go:160, internal/engine/verify.go:137, internal/agent/fixer.go:251 and internal/engine/debug.go:422, to see where the exit-code check differs. The fix-verification logic in internal/agent/fixer.go (verifyFix) and internal/engine/debug.go (debugRun.check) is the other half. Done means one shared outcome function with a table test over timeout, exit code and marker, and an agreed decision on the looser rule.
由索引模型根據 Issue 內容生成。
描述
Summary
"Did the proof succeed" is evaluated in five places with two rules, and fix verification exists twice (scan fixer and debug mode) with different checks, so "demonstrated" and "verified" mean different things per command.
Where
internal/agent/prover.go:245internal/agent/debugger.go:159-160internal/engine/verify.go:137internal/agent/fixer.go:251internal/engine/debug.go:420-425internal/agent/prover.go:191-267internal/agent/debugger.go:110-181internal/agent/fixer.go:201-280internal/agent/debugger.go:331-373internal/engine/debug.go:689-740internal/engine/debug.go:85-97internal/agent/fixer.go:81-95internal/agent/prover.go:57-72internal/engine/debug.go:390-403
Details
The oracle for a marker-based proof is an inline expression at each call site. Three require exit code 0: !run.TimedOut && run.ExitCode == 0 && strings.Contains(run.Stdout+run.Stderr, marker) (prover.go:245, debugger.go:160, verify.go:137). Two do not: !run.TimedOut && strings.Contains(run.Stdout+run.Stderr, in.PoC.Marker) (fixer.go:251) and !res.TimedOut && strings.Contains(res.Stdout+res.Stderr, rep.poc.Marker) (engine/debug.go:422). So a proof that prints the marker and then exits non-zero against patched code is "still succeeds, patch rejected" for the fixer and for debug's fix check, but "no longer succeeds" for spackle verify, which then sets f.Status = finding.StatusFixed (verify.go:148-151). Separately, Prove (prover.go:191-267) and Reproduce (debugger.go:110-181) are the same 60-line two-attempt loop (stop reasons, decode, validatePoC, box.run, redact+clip to 4000, build PoC, classify the failure into three reasons, re-prompt) differing only in nouns, the reply struct (can_prove vs can_reproduce) and how the brief is built.
"Take the model's files, load originals, build the unified diff, refuse over 400 changed lines, compile-check, re-run the reproduction, run the test suite, compose a verified: / unverified: sentence" is implemented once as verifyFix (fixer.go:201-280) and a second time split across Diagnosis.consider (debugger.go:343-359, the same sort/diff/400-line block as fixer.go:206-223) and debugRun.check (engine/debug.go:689-740). debugCompileCheck (debug.go:85-97) is a line-for-line copy of compileCheck (fixer.go:81-95) and its comment says so ("mirrors the fixer's compile check"). debugRun.run (debug.go:390-403) re-implements Box.run (prover.go:57-72) because Box.run is unexported and pinned to b.Root, and bisect needs another source directory. The copies have drifted in behaviour, not only wording: (1) test-suite policy: the fixer only runs the suite when the baseline passed and then rejects the patch on failure (fixer.go:258-273); debug mode never takes a baseline, runs the suite regardless, and on failure keeps the patch as "unverified" (debug.go:726-737). (2) "still reproduces" is !TimedOut && marker in both, but see the next finding for the other three call sites.
Impact
The meaning of the product's central claim, "demonstrated" / "fixed", depends on which command evaluated it. Anyone tightening the oracle (for example to stdout only, or to require exit 0 everywhere) has to find five expressions in two packages. A change to the retry loop (a third attempt, different clipping) must be made twice.
Any change to what "verified" means (a new language's compile check, a lint step, a different patch-size limit, how a broken baseline is treated) must be made in two packages, and the user-visible claim "verified" already means different things in scan and debug. The 6-value return of verifyFix (fixer.go:201) makes it awkward to extend.
Suggested fix
(1) Add func (p *PoC) Succeeded(res sandbox.Result) bool in internal/agent with the strict rule, plus a table test over (timed out, exit code, marker present). (2) Replace prover.go:245, debugger.go:160 and verify.go:137 with it (no behaviour change). (3) Decide deliberately for fixer.go:251 and debug.go:422: either add func (p *PoC) MarkerSeen(res) bool and name the looser rule, or switch them to Succeeded; record the decision in a comment and a test. (4) Then fold Prove and Reproduce into one unexported attemptPoC(ctx, r, parent, sealer, reg, box, language, image, spec) where spec carries the system prompt, the base user text, the purpose ("poc"/"repro"), the nouns, and a decode(text) (ok bool, reason string, files, cmd, explanation) function. Tests to have before starting: TestProveThenFixThenVerify, TestVerifyRerunsStoredProofs, TestReproduceRunsTheScriptAndKeepsTheIssueInOneEnvelope, TestReproduceReportsWhenItCannotAndWhenTheScriptFails, TestModelCannotAwardItselfDemonstrated (names seen in the listing).
(1) Characterize first: keep TestPatchThatBreaksTheBuildIsRejected, TestPatchThatDoesNotCloseTheProofIsRejected, TestDebugFixThatBreaksTheSuiteIsUnverified, TestDebugFixThatDoesNotMakeTheTestPassIsRejected, TestDiagnoseFeedsARejectionBackAndComputesThePatch green (names seen in the listing); add a test that pins the fixer's feedback message shape. (2) Export one agent.CompileCheck and delete debugCompileCheck. (3) Extract agent.buildPatch(root, files) (clean map[string]string, patch string, problem string) from fixer.go:206-223 and use it in consider. (4) Give Box an exported Run(ctx, purpose, image, cmd, files, sourceDir) (empty sourceDir means b.Root) and make debugRun.run a thin call to it. (5) Introduce type Candidate struct{Files map[string]string; Patch string} and type Verdict struct{Problem, Verification string; Verified bool}; rewrite verifyFix to return (Candidate, Verdict, error). (6) Express the fixer's sandbox checks as an agent.Check (the type already exists, debugger.go:208) built by a constructor taking compile command, reproduction oracle and suite policy; have the engine's debugRun.check use the same constructor with its own oracle. (7) Decide the suite policy once and document it; if debug should keep its looser rule, make that an explicit parameter. (8) Wrap the fixer's feedback with sealer.Wrap as Diagnose does.
Acceptance criteria
- One function decides proof outcome, with an explicit inconclusive result
- Scan and debug share one fix verification path
-
make lint,make testandmake buildpass
Related: the bug about timed-out proofs being recorded as fixed would be removed by this refactor.
Getting started
- Relevant files:
internal/agent/prover.go,internal/agent/debugger.go,internal/engine/verify.go,internal/agent/fixer.go,internal/engine/debug.go - How to run tests:
make test(Unix) or.\make.ps1 test(Windows PowerShell); lint withmake lint - Related docs:
CONTRIBUTING.md,AGENTS.md,docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at 35948f7. Severity: medium. Effort: M. audit-key: tech-debt|internal/agent/prover.go|Prove
- 主要語言
- 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 天內回覆