You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8fb0cc6
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: scripts/agent-evals/README.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,8 +80,10 @@ them:
80
80
message still appears in `completionMessageSeen`.
81
81
-`SESSION_LOST` covers disconnects and interrupts. A manual stop after
82
82
completion output stays `SESSION_LOST`.
83
-
- The usage drain runs only after a `taskCompleted` event. It stays inside the
84
-
bounded drain window.
83
+
- The usage drain runs after a `taskCompleted` event and after an observer stop
84
+
that followed the final `completion_result` message. It stays inside the
85
+
bounded drain window. A plain stop, a run timeout, and a session loss get no
86
+
drain.
85
87
86
88
## Checks
87
89
@@ -147,9 +149,17 @@ A comparison runs the extension code of two commits with the provider credential
147
149
148
150
The comparison driver, fixtures, grader, and report builder all run from the trusted checkout that invokes `coding-evals:compare`. Only the extension host loads an evaluated worktree. The side process receives only the allowlisted environment plus the one named credential variable. Each side installs dependencies from its own worktree's frozen lockfile and builds its own exact commit, so each side runs its own compiled extension. Each side has its own wall clock (`--side-timeout-minutes`, default 120).
149
151
152
+
The side script runs the same gate on its own inputs. It requires `--trust-file`, resolves the full commit of its `--evaluated-root`, and rejects an unapproved or unreadable commit before it creates a host or reads the credential. The `--credential-env` name must come from the supported provider variable allowlist; an arbitrary name can never forward an unrelated parent secret. Worktree install and build children also receive only an allowlisted environment, so the driver's secrets never reach them.
153
+
154
+
Every driver child, preparation steps and the side alike, runs detached in its own process group and is tracked by one guard. A SIGINT or SIGTERM that reaches only the driver terminates the tracked group through a bounded SIGTERM-then-SIGKILL escalation, and the worktree cleanup waits for that escalation before it removes any tree.
155
+
150
156
### Output publication contract
151
157
152
-
Artifacts are published atomically: content lands in a same-directory temp file and is renamed into place. A reader never sees a partial file. `side-results.json` appears only after every repetition of that side finished, so its existence means a complete side. A missing `side-results.json` means an interrupted side; consumers must treat it as a failed side and never pair partial output. The comparison reports are written atomically and only after both sides published complete results; a failed comparison leaves no report files.
158
+
Artifacts are published atomically: content lands in a same-directory temp file and is renamed into place. A reader never sees a partial file.
159
+
160
+
A side run invalidates its output directory first. Before the first repetition executes, the side removes any previous `side-results.json` and the whole `artifacts` tree, so stale results from an earlier rerun can never survive. `side-results.json` is the completion marker: it appears only after every repetition of the current invocation finished, and consumers must require it and treat its absence as a failed side. A side rerun that cannot remove a stale artifact fails before any repetition runs.
161
+
162
+
The comparison reports are published as one generation. `comparison-report.json` and `comparison-report.md` carry the report's `generatedAt` stamp, and `comparison-report.complete` holds that stamp; it is written last. Consumers must require the marker and match its stamp against the report files. `readPublishedComparisonReport` enforces this: it returns the report only when the marker exists and its stamp matches both files. The marker is removed before publication starts, so a crash between the two file publications leaves a detectable incomplete generation instead of a mixed one. A thrown failure rolls both files back; a failed comparison leaves no report files.
153
163
154
164
### Commands
155
165
@@ -158,9 +168,9 @@ Artifacts are published atomically: content lands in a same-directory temp file
158
168
pnpm test:agent-evals:unit
159
169
pnpm agent-evals:check-types
160
170
161
-
# One comparison side against the real provider. Requires the credential
162
-
# environment variable and the container runtime for grading.
0 commit comments