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 a9901ed
Browse filesBrowse the repository at this point in the historyBrowse files
fix(scenarios): skill-eval turns are spawned without the host's memory variables (#38165)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu1VhSQmxMmBJAWNw5MuyuHN)_Fixes#37842
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 是什么:用户无感。技能评测和场景卡评测在项目容器里跑时,起的每个回合都不再读到本项目的记忆。
-
为什么:属于「评测可信」工作。之前两组(带技能、不带技能)都能读到项目记忆,不带技能的一组照着记忆答对,看起来和带技能一样好,技能的价值被藏住了。
- 出错会怎样:只影响内部评测怎么起提问进程;最坏是某个记忆变量没去干净,结果和以前一样,可直接撤回。
- 要你做的:无。
## What changes
- `packages/qa/scenarios/src/runner/driver.ts`: new `CLAUDE_MEMORY_ENV =
['CLAUDE_COWORK_MEMORY_PATH_OVERRIDE', 'CLAUDE_MEMORY_STORES']`,
declared beside `API_BILLING_ENV` and `CLAUDE_EFFORT_ENV`, so the three
lists of what a turn is spawned without live in one place.
- `packages/qa/scenarios/src/runner/driver.ts`:
`ClaudeCodeDriver.turnEnv`, the scenario runner's live driver, also
deletes every name in `CLAUDE_MEMORY_ENV`, so its build (author) and ask
turns are spawned without the host's memory variables too. Folded in at
the seat's word after the first hand-off.
- `packages/qa/scenarios/src/skill-evals/run.ts`: `turnEnv` deletes
every name in `CLAUDE_MEMORY_ENV`, after the billing and effort
variables. `executeRound` already spawns every turn with `turnEnv()`, so
both arms of every case get the scrubbed environment. The file header
says so.
- `packages/qa/scenarios/README.md` (skill-evals section): a new
**Isolated from project memory** bullet says a round run inside a
project container is isolated from that project's memory, which
variables are removed and why, and that the scenario runner's build and
ask turns are isolated too.
- `.changeset/37842-skill-evals-memory-isolated.md`: `patch` for
`@objectstack/scenarios` (the README ships in its `files[]`).
Measured before the change, in this container: both variables are set
here (presence read only, values never printed). The card's evidence is
the two rounds of PR #37841: with the variables inherited, all three
no-skill answers to case 2 quoted a project memory note; with them
removed, case 2 scored 3/3 with the skill and 0/3 without. No eval round
was run for this PR.
## Tests
`packages/qa/scenarios/test/skill-evals/skill-evals.test.ts`:
- new block "a turn's environment": a host env carrying `PATH`, `HOME`,
both billing variables, the effort variable and both memory variables
yields exactly `{ PATH, HOME }`; every name of the three lists is
absent; the memory list names both variables; the caller's env object is
left as it was.
- the existing round test ("a round hands each turn its arm's
directory…") now also stubs both memory variables in `process.env` and
asserts that none of the four turns (two cases × two arms) receives
either one. This pins the wiring through `executeRound`, not only the
pure function.
`packages/qa/scenarios/test/runner/units.test.ts` (the live driver
against a stand-in `claude`): the stand-in's `ENV` turn now also answers
which memory variables it was started with; a new test stubs both in
`process.env`, runs one build turn and one ask turn through
`makeDriver`, and asserts neither turn was started with either.
Ablation, one line at a time: with `for (const k of CLAUDE_MEMORY_ENV)
delete out[k];` removed from the skill-evals `turnEnv`, 3 tests fail
(the two new ones and the round test) and 37 pass; restored, 40/40. With
the same line removed from `ClaudeCodeDriver.turnEnv`, the new
`units.test.ts` test fails and 95 pass; restored, 96/96.
<details><summary>runs</summary>
Head ac1dd47.
- `pnpm --filter '@objectstack/scenarios^...' build` then `pnpm --filter
@objectstack/scenarios build`: exit 0.
- `pnpm --filter @objectstack/scenarios test`: 45 files, 1411 tests
passed.
- `pnpm --filter @objectstack/scenarios typecheck`: exit 0.
- `pnpm --filter @objectstack/scenarios skill-evals --self-test`: 44
rows pass.
- `node scripts/pm/dispatch-gates.mjs --commands`: 65 derived (the same
65 as on the first head); 64 exit 0; 1 exit 3 (PREREQUISITE NOT MET), so
NOT MEASURED locally and left to CI: `node
scripts/check-plugin-teardown-shape.mjs --self-test` (its positive
control is pinned to a commit this shallow clone cannot reach).
</details>
## Acceptance notes
- Other memory-named variables the CLI reads (Claude Code 2.1.332's
binary names `CLAUDE_CODE_REMOTE_MEMORY_DIR`,
`CLAUDE_COWORK_MEMORY_INDEX_CONTENT`, `CLAUDE_COWORK_MEMORY_GUIDELINES`,
`CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES`,
`CLAUDE_CODE_MEMORY_API_BASE_URL`, `CLAUDE_CODE_MEMORY_API_TOKEN`): not
set in this container, not measured, not handled by this PR.
- The card's Expected section also asks that the round's record say the
turn environment was scrubbed. The three Done-when items do not, and the
dispatch scoped this PR to them, so `round.json` is unchanged; the
README now states it for every round.
## Verification
Read first: `packages/qa/scenarios/src/skill-evals/run.ts` (`turnEnv`),
then `ClaudeCodeDriver.turnEnv` in `src/runner/driver.ts`, then the two
new test spots.
Two-minute check: `pnpm --filter @objectstack/scenarios exec vitest run
--maxWorkers=2 test/skill-evals/skill-evals.test.ts
test/runner/units.test.ts` prints 136 passed.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgXWFXqMUE85PmLT9AE)_
<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgXWFXqMUE85PmLT9AE -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
A skill-eval round run inside a project container no longer reads that project's memory. Each turn used to inherit the container's memory variables (`CLAUDE_COWORK_MEMORY_PATH_OVERRIDE`, `CLAUDE_MEMORY_STORES`), so the turns of both arms could answer from the project's own notes and the without-skill arm scored as if it had the skill. Every turn is now spawned without them, listed as `CLAUDE_MEMORY_ENV` next to the API-billing and effort variables. The scenario runner's own build and ask turns (`npx @objectstack/scenarios run`) are spawned without them too, and the README says both kinds of turn are isolated from project memory.
it('an effort level the CLI’s own `--help` does not list is refused before any turn — the CLI would warn, run at its default and exit 0 — and so is any effort on a CLI with no `--effort`',()=>{
@@ -196,26 +219,29 @@ describe('the arms: one fresh directory per turn, differing only in the bundle',
196
219
}
197
220
});
198
221
199
-
it('a round hands each turn its arm\'s directory, the prompt on stdin and an environment with no API key or effort override; records land and directories go',async()=>{
222
+
it('a round hands each turn its arm\'s directory, the prompt on stdin and an environment with no API key, effort override or host memory; records land and directories go',async()=>{
0 commit comments