Repository navigation
test(evals): record the sandbox ref in evidence and warn on runner/ref mismatch - #4769
Conversation
Specs execute from the runner checkout while the sandbox builds OPENWORK_EVAL_REF, so evidence that only names the runner gitSha can attribute a verdict to the wrong product commit. Record sandboxRef next to gitSha under Daytona placement, keep it through parse/judge/publish, and show it in the evidence header.
…ox ref Under --daytona the specs run from the runner checkout while the sandbox builds OPENWORK_EVAL_REF (default dev). evals.mjs now resolves that ref against origin, prints it in the placement line, warns on stderr when it differs from HEAD, and fails instead with --strict-ref or OPENWORK_EVAL_STRICT_REF=1. The Daytona CI lane opts into the strict mode since it checks out the same sha it pins.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Passed · 10/10 tests · 15/15 assertions · 5 images Commit |
Warden review summary — ClearNative findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (183427 ms), confidentiality-review (179940 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
Resync with
|
Root cause
Triage
reports/e2e-red-2026-09-09/triage.md→ "Not clusters → Evidence attribution bug" and "Order of work #7". Under--daytonathe spec files execute from the runner's local checkout while the sandbox checks out and buildsOPENWORK_EVAL_REF(defaultdev). Nothing compared the two, andtest-run.jsononly recorded the runner'sgitSha/branch, so a spec could be judged against product from another commit and the evidence bundle would still name the wrong one (PR #4741's false red; every bundle in the Sep 9 lane recordedea1e9546e / feat/api-quality-spectralwhile the sandbox built61b41901c).What changed
@openwork/test-evidence,@openwork/test-artifacts):test-run.jsonrecordssandboxRef(the ref the sandbox built) next to the runnergitShaunder Daytona placement; it survives parse/judge/publish and shows in the evidence header and PR markdown (SHA <runner> · sandbox ref <ref> · engine v1). Local placement omits it.@openwork/env/eval-ref):daytonaPlacement/resolveEvalRef/resolveSandboxRef;resolvePlacenow uses them instead of its private copy.evals/bin/evals.mjs): resolves the sandbox ref the way the provisioning gate does (immutable shas as-is, branches viagit ls-remote origin), appendsref=<ref>[@<sha>]to theplacement:line, and prints a stderrwarning:when it differs fromHEAD.--strict-reforOPENWORK_EVAL_STRICT_REF=1fails before any sandbox is provisioned. The summary JSON gainssandboxRef,sandboxSha,refMismatch.daytona-e2e.ymlpasses--strict-ref(it checks out the same sha it pins asOPENWORK_EVAL_REF).Proof
Unit (
node --test):evals/bin/evals.test.mjs22/22,packages/env/test/eval-ref.test.ts2/2,packages/test-evidence/test/test-evidence.test.ts6/6,packages/test-artifacts/test/*green.Daytona, single spec, at
dbcc8b731(the last commit6cb38fdecis README-only):OPENWORK_EVAL_REF=634df629a919db504e27d0f00962dc772344e42a pnpm evals:e2e app-smoke --daytona"sandboxRef":"634df629a…","refMismatch":true;test-run.json:gitSha: dbcc8b731f8a…,sandboxRef: 634df629a919…,branch: e2e/eval-ref-mismatch-guard.OPENWORK_EVAL_REF=$(git rev-parse HEAD) pnpm evals:e2e app-smoke --daytona"refMismatch":false;test-run.jsongitSha == sandboxRef == dbcc8b731….OPENWORK_EVAL_REF=634df629a… pnpm evals:e2e app-smoke --daytona --strict-ref→ placement line with[RUNNER/REF MISMATCH],Error: runner HEAD dbcc8b731 … differs …, exit 1. Same withOPENWORK_EVAL_STRICT_REF=1and the defaultdevref (resolved vials-remoteto4c74cb9c5, which had already moved past the localorigin/dev).Both sandboxes were deleted by the harness; none left behind.
Noticed, not touched
git ls-remoteshowed remotedevat4c74cb9c5while localorigin/devwas634df629a— the exact staleness the guard is for; localrev-parse origin/devwould have missed it.publish-pr.tsstill refuses stale evidence by comparing onlygitShato the PR head; withsandboxRefpresent it could also refuse whensandboxRefis a sha that differs from the head.OPENWORK_EVAL_REF || GITHUB_SHA || "dev"fallback is still duplicated inevals/runner/prepare-stack.tsandevals/worlds/first-run.ts(×2); they could useresolveEvalRef.origin/dev@634df629a:packages/labs/test/mock-google.test.ts"attributes drafts to one mailbox" fails (deep-equal on extradraftId/messageId/mime);spec-boundary-ratchet(opencode-v2-provider-hot-inject.test.ts) andspec-channel-ratchet(workspace-new-task-hit-target.e2e.test.ts3 → 6) exit 1;pnpm --dir evals typecheckreports errors only in unbuilt sibling packages.