Proof success and fix verification are decided in several places
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 15/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Go
- Sterne
- 0
- Forks
- 1
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TMHSDigital/Spackle
-
enhancement good first issue severity: low
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 72/100
TMHSDigital/Spackle#139 ·
-
enhancement good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
TMHSDigital/Spackle#138 ·
-
documentation good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Spackle#135 ·
-
bug good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
TMHSDigital/Spackle#131 ·
-
runs and runs compare print target text without the control-character cleaning the reports useOffenbug good first issue severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
TMHSDigital/Spackle#129 ·
Alle Issues in TMHSDigital/Spackle
Ähnliche Issues
-
bug raised-by:reviewer
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
medici-finance/assay#7655 ·
Maintainer antworten meist innerhalb von 1 Tag
-
helm chart: make DaemonSet pod affinity configurable via values.yamlEvtl. vergeben @Young-Zen hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
flannel-io/flannel#2632 ·
Maintainer antworten meist innerhalb von 6 Tagen
-
go-vulnerability security-scan
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
teslashibe/agent-go#36 ·
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
nwverse/persona#15194 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug flaky-test
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
rosskukulinski/tailworks#411 ·
Maintainer antworten meist innerhalb von 1 Tag