test(miner-hands): behavioral contract suite for the two CodingAgentDriver implementations - #4562
Conversation
…river implementations
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4562 +/- ##
=======================================
Coverage 94.08% 94.08%
=======================================
Files 427 427
Lines 37961 37961
Branches 13864 13864
=======================================
Hits 35715 35715
Misses 1586 1586
Partials 660 660 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-10 03:12:21 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Closes #4296
What
A behavioral contract/parity suite proving the CLI-subprocess (#4266) and Agent-SDK (#4267)
CodingAgentDriverimplementations are interchangeable behind the #4262 seam — the property the iterate-loop orchestrator (#2333) depends on. Test-only:test/contract/coding-agent-driver-parity.test.ts(homed alongsideengine-parity.test.tsper the issue's guidance) plus thetest:driver-parityscript wired intotest:ci, mirroringtest:engine-parity's invocation pattern.Design
DRIVER_HARNESSEStable builds each driver around its own injected fake backend (fakeCliSubprocessSpawnFn/ fakeAgentSdkQueryFn— no real subprocess, no real model call), each expressing the same three behaviors (success,clean_failure,budget_exhausted); every contract case runs viadescribe.eachover the table.CodingAgentDriverResultvalidator, structured never-throwing failures withchangedFiles: [], a non-empty machine-readableerroron both wall-clock (CLItimedOut) and turn-budget (SDKerror_max_turns) exhaustion, distinguishable success-vs-failure summaries, and feat(miner-hands): immutable acceptance-criteria file written before the coding agent starts #4271's empty/malformed acceptance-criteria input degrading to a structured result on both.invokeCodingAgentDriverwith a shared attempt-log sink and must produce the identicalattempt_started → attempt_succeeded/attempt_failedevent sequences.changedFilessemantics,turnsUsedavailability, differing budget mechanisms), and a dedicated describe block pins theturnsUseddivergence with explicit per-driver assertions so it can't drift silently.Testing
18 cases, all green (
npm run test:driver-parity); roottypecheckandgit diff --checkclean. Test-only diff — nosrc/**or engine source changes.