Proof success and fix verification are decided in several places
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
調査の方向性
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 ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信