From 6af4d8a03f24ac7846b4d73334ed945070842845 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 21 Nov 2026 00:37:12 -0800 Subject: [PATCH] Eval graders treat the agent's repo as hostile, plus two more team-learned habits (GST-3354) (#4602) Eval plans now say a grader that runs git in an agent's repo works on a sanitized copy with no config, hooks or API keys; the agents' start card says to find a drive copy in its version history before deleting the source; and each eval result row takes its model from the captured requests. Why: one team reproduced a planted git setting running code next to the key-holding proxy, and two lost drive writes. Nothing to do as a reader. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- capy/skill/gstack/lane-card.md | 1 + changelog.d/agent-habits-third-batch.md | 1 + docs/working-across-agent-systems.md | 8 +++++--- eval-plan/SKILL.md | 12 +++++++++++- eval-plan/SKILL.md.tmpl | 12 +++++++++++- lib/eval-plan.ts | 1 + test/captain-skill.test.ts | 4 +++- 7 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 changelog.d/agent-habits-third-batch.md diff --git a/capy/skill/gstack/lane-card.md b/capy/skill/gstack/lane-card.md index d6ad6a55e..d68659df9 100644 --- a/capy/skill/gstack/lane-card.md +++ b/capy/skill/gstack/lane-card.md @@ -10,6 +10,7 @@ For a crew lane (a thread working for a Captain). Read this once `gstack: ok ` first. - Run directories and scratch live under `~/.capy/work/`, never `/tmp`, which Capy wipes when a machine sleeps. +- A write into a drive mount can succeed locally while the drive never keeps it: before you delete a source because the copy is in the drive, find that copy in the drive's version history (`tools.drive.history`). ## Plan, approve, ship diff --git a/changelog.d/agent-habits-third-batch.md b/changelog.d/agent-habits-third-batch.md new file mode 100644 index 000000000..a33857d04 --- /dev/null +++ b/changelog.d/agent-habits-third-batch.md @@ -0,0 +1 @@ +**Three more habits from teams that run evals.** `/eval-plan` says a grader that runs git inside an agent's repo treats that repo as hostile: a sanitized copy of `.git` with no config, hooks, attributes, textconv or signature display, the original index timestamps, no API keys in its environment, and a test that plants each setting. The agents' start card says to find a drive copy in the drive's version history before deleting its source. `docs/working-across-agent-systems.md` says to take each result row's model from the requests the run captured, on every scored row, timeouts included. diff --git a/docs/working-across-agent-systems.md b/docs/working-across-agent-systems.md index 7157c1b4a..d0bd8551a 100644 --- a/docs/working-across-agent-systems.md +++ b/docs/working-across-agent-systems.md @@ -42,9 +42,11 @@ What we learned, in short: 6. **Pin the other harness's version and model.** A coding-agent CLI can change its default model in a release. Name the version and the model in every brief and every eval plan. Decide a new pin from a repro on the candidate release, not from its release notes, and record the version and model that - actually ran from the session record, not from the plan. In one team's case a fix merged upstream was - missing from the next stable build, and a release that fixed one bug dropped turns in three of three - runs; in another, a CLI release changed its default model. + actually ran from the session record, not from the plan. Take each result row's model from the + requests the run captured, on every scored row, timeouts included. In one team's case a fix merged + upstream was missing from the next stable build, and a release that fixed one bug dropped turns in + three of three runs; in another, a CLI release changed its default model, and a model check that + skipped timed-out rows would have let a timeout on the wrong model into a paired comparison. ## Keep runs cheap diff --git a/eval-plan/SKILL.md b/eval-plan/SKILL.md index e1d98c7e7..7727e02ee 100644 --- a/eval-plan/SKILL.md +++ b/eval-plan/SKILL.md @@ -160,7 +160,7 @@ Write (or open) the preregistration file. Each section is required and must be f | Interim look | only when `paid:` is above 500 dollars: `at: 50%`, `looks: 1`, `bounds: O'Brien-Fleming`, `futility:` | | Decoys | inputs the scorer must reject or score low; how many, how they were made, what a decoy pass proves | | Stop rules | the spend cap, a bar missed on the pilot, a scorer below its bar, `budget_exhausted`, the first quota or rate-limit error on a seat-metered arm | -| Held-out exposure | every held-out set the plan touches: prior exposure (which runs, which models), the reservation on it; and how each task machine was checked, before any session, for answers the agent could read there (other git refs such as `git log --all`, build and package caches, archives and the task's own work tree; never a sweep of `/`, runner state or `~/.ssh`) | +| Held-out exposure | every held-out set the plan touches: prior exposure (which runs, which models), the reservation on it; and how each task machine was checked, before any session, for answers the agent could read there (other git refs such as `git log --all`, build and package caches, archives and the task's own work tree; never a sweep of `/`, runner state or `~/.ssh`); and, when a grader runs git in the agent's repo, how it treats that repo as hostile (below) | | No-gstack arm | required with `stack: loaded` (below) | ```bash @@ -183,6 +183,16 @@ gstack skill file is contaminated and gets zero credit. `PREREG_NO_GSTACK_ARM` (exit 1) names what is missing. The PREREG line shows `stack=loaded no_gstack_arm=ok` when it is complete, or `stack=none` for an opt-out. +**A grader treats the agent's repo as hostile.** A grader that runs git inside a repo the +agent worked in runs it against a sanitized copy of `.git`: no repo, system or global +config, no hooks, no attributes (`.gitattributes` or `info/attributes`), no textconv or +external diff, and no signature display. The copied index files keep their original +timestamps, because a fresh mtime turns off git's same-second check and a same-second, +same-size edit then reads as committed. The grader's environment holds no API keys, and a +test plants each of these settings and asserts that nothing runs. On one eval, a planted +`core.fsmonitor`, a clean filter, or `gpg.program` with `log.showSignature` each ran code +on the grading machine next to the proxy that held the keys. + When the summarizer counts diagnostics, declare them before the freeze commit in a `## Diagnostics` section: `summarizer: `, `fixture: `, and one `| diagnostic | expected |` row per diagnostic, with the count the diff --git a/eval-plan/SKILL.md.tmpl b/eval-plan/SKILL.md.tmpl index 933862961..dee552470 100644 --- a/eval-plan/SKILL.md.tmpl +++ b/eval-plan/SKILL.md.tmpl @@ -75,7 +75,7 @@ Write (or open) the preregistration file. Each section is required and must be f | Interim look | only when `paid:` is above 500 dollars: `at: 50%`, `looks: 1`, `bounds: O'Brien-Fleming`, `futility:` | | Decoys | inputs the scorer must reject or score low; how many, how they were made, what a decoy pass proves | | Stop rules | the spend cap, a bar missed on the pilot, a scorer below its bar, `budget_exhausted`, the first quota or rate-limit error on a seat-metered arm | -| Held-out exposure | every held-out set the plan touches: prior exposure (which runs, which models), the reservation on it; and how each task machine was checked, before any session, for answers the agent could read there (other git refs such as `git log --all`, build and package caches, archives and the task's own work tree; never a sweep of `/`, runner state or `~/.ssh`) | +| Held-out exposure | every held-out set the plan touches: prior exposure (which runs, which models), the reservation on it; and how each task machine was checked, before any session, for answers the agent could read there (other git refs such as `git log --all`, build and package caches, archives and the task's own work tree; never a sweep of `/`, runner state or `~/.ssh`); and, when a grader runs git in the agent's repo, how it treats that repo as hostile (below) | | No-gstack arm | required with `stack: loaded` (below) | ```bash @@ -98,6 +98,16 @@ gstack skill file is contaminated and gets zero credit. `PREREG_NO_GSTACK_ARM` (exit 1) names what is missing. The PREREG line shows `stack=loaded no_gstack_arm=ok` when it is complete, or `stack=none` for an opt-out. +**A grader treats the agent's repo as hostile.** A grader that runs git inside a repo the +agent worked in runs it against a sanitized copy of `.git`: no repo, system or global +config, no hooks, no attributes (`.gitattributes` or `info/attributes`), no textconv or +external diff, and no signature display. The copied index files keep their original +timestamps, because a fresh mtime turns off git's same-second check and a same-second, +same-size edit then reads as committed. The grader's environment holds no API keys, and a +test plants each of these settings and asserts that nothing runs. On one eval, a planted +`core.fsmonitor`, a clean filter, or `gpg.program` with `log.showSignature` each ran code +on the grading machine next to the proxy that held the keys. + When the summarizer counts diagnostics, declare them before the freeze commit in a `## Diagnostics` section: `summarizer: `, `fixture: `, and one `| diagnostic | expected |` row per diagnostic, with the count the diff --git a/lib/eval-plan.ts b/lib/eval-plan.ts index fc6ee6e01..0673d8856 100644 --- a/lib/eval-plan.ts +++ b/lib/eval-plan.ts @@ -77,6 +77,7 @@ export function preregTemplate(title = 'Eval preregistration'): string { ## Held-out exposure + `; } diff --git a/test/captain-skill.test.ts b/test/captain-skill.test.ts index 4716fff60..fd8aa089d 100644 --- a/test/captain-skill.test.ts +++ b/test/captain-skill.test.ts @@ -144,7 +144,9 @@ describe('/captain skill', () => { expect(cited).toContain('Plan, approve, ship'); expect(cited.filter(h => !headings.has(h!))).toEqual([]); expect(capySkill).toMatch(/## Session start[^#]*?read \[lane-card\.md\]\(lane-card\.md\), not the rest of this file/); - expect(Buffer.byteLength(card)).toBeLessThanOrEqual(6800); + // 7,000 for the drive-write line (confirm a copy in the drive's version history before deleting its source), reached by two + // crews on their own (crew habit H5). + expect(Buffer.byteLength(card)).toBeLessThanOrEqual(7000); const doc = read('crew/docs/captain.md').replace(/\s+/g, ' '); for (const s of ['`duration_seconds: 240`', 'stops re-issuing the timer', 'The controller never warm-waits', '4k characters or less', 'twice the crew\'s median lane spend', '`handoffs//next.md`']) expect(doc, s).toContain(s); expect(read('captain/templates/brief.md')).toMatch(/^Read: <[^>]+>$/m);