Skip to content

fix(scenarios): skill-eval turns are spawned without the host's memory variables - #38165

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-3yurjb
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-3yurjb

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

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.

runs

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).

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

…y variables

A turn inherited CLAUDE_COWORK_MEMORY_PATH_OVERRIDE and CLAUDE_MEMORY_STORES
from a project container, so both arms read the project's memory and the
no-skill arm could score as if it had the skill. turnEnv now drops them,
listed as CLAUDE_MEMORY_ENV beside the billing and effort variables.

Claude-Session: https://claude.ai/code/session_01L6bhgXWFXqMUE85PmLT9AE
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

5 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️ 1 changed file(s) yielded no anchor (packages/qa/scenarios/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/qa/scenarios/README.md) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 33a0d4fa625cdfb69873a89a1e0f5d9f49fea744 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 5a8201072a5ebe6e17b2ed321ffc0311e65bded6 — the merge of head ac1dd475766e60f1db15123977b7b3ab95025a9d into base 33a0d4fa625cdfb69873a89a1e0f5d9f49fea744, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 5a8201072a5ebe6e17b2ed321ffc0311e65bded6 && git checkout 5a8201072a5ebe6e17b2ed321ffc0311e65bded6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 33a0d4fa625cdfb69873a89a1e0f5d9f49fea744 ac1dd475766e60f1db15123977b7b3ab95025a9d && git checkout -B drift-repro 33a0d4fa625cdfb69873a89a1e0f5d9f49fea744 && git merge --no-ff ac1dd475766e60f1db15123977b7b3ab95025a9d

node scripts/docs-audit/affected-docs.mjs --json 33a0d4fa625cdfb69873a89a1e0f5d9f49fea744

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

…the host's memory variables too

ClaudeCodeDriver.turnEnv drops CLAUDE_MEMORY_ENV beside the billing and
effort variables, so a scenario round run in a project container does not
read the project's memory either.

Claude-Session: https://claude.ai/code/session_01L6bhgXWFXqMUE85PmLT9AE
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m and removed size/s labels Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head ac1dd47 · card #37842 · area s2-ai · 2026-11-28T05:36Z

L1 checklist (no review face on this file list: this record is the review of record)

  • Shape and checks. Every check on the head is green apart from expected skips. The two red runs on the old head 637a5bd are lane cancellations, not failures. The PR is test tooling in packages/qa/scenarios (driver.ts, skill-evals/run.ts, their tests, the README) plus a changeset. It is not governed.

  • Isolation holds on both runners. CLAUDE_MEMORY_ENV (CLAUDE_COWORK_MEMORY_PATH_OVERRIDE, CLAUDE_MEMORY_STORES) sits in driver.ts beside the billing and effort lists, and both turnEnvs delete it: the skill-eval runner's and the scenario runner's ClaudeCodeDriver. The second was folded in under claim amendment 7234432536. Tests pin each side:

    • turnEnv of a host env carrying the variables returns the env without them and leaves the caller's env unedited;
    • executeRound hands every turn an env with no memory variable;
    • an author turn and an ask turn of the scenario driver both go without them.

    The dev's ablations turned 3 tests and 1 test red.

  • Left out, rightly.

    • The CLI reads other *MEMORY* variables. The container does not set them, so they are not measured and not handled; the PR body says so.
    • The card's "the round's record says the turn environment was scrubbed" is not in its Done-when, and the PR body says it is not done.
    • No eval round was run (rounds are paused).
  • Declarations. Clause-②: no, Metadata-protocol: none, @objectstack/scenarios patch. Fixes #37842 is right: all three Done-when boxes hold.

Tier: S. Landing: ready and auto-merge in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 05:37
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46112971270 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (2/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ a member on no slate is refuse
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ [#33690] the approver's call d
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ [#33690] the submitter's recal
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/mcp-system-object-action-exposure.dogfood.test.ts > [#27681, #27900] sys_user identity actions over MCP: what each bucket's declaration lets an agent 
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/mcp-system-object-action-exposure.dogfood.test.ts > [#27681, #27900] sys_user identity actions over MCP: what each bucket's declaration lets an agent 
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 35 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgXWFXqMUE85PmLT9AE

Queue ejection, read at 2026-11-28T06:12Z: build 46112971270 (main a29f9b8 plus this PR alone) failed Dogfood Regression Gate (2/3) on two assertion signatures, test/approval-decide-over-mcp.dogfood.test.ts (anchor #38187) and test/mcp-system-object-action-exposure.dogfood.test.ts (anchor #38188). Not this PR's: the diff touches only packages/qa/scenarios (eval tooling), which packages/qa/dogfood neither depends on nor imports, and #38167 hit the same two. Not re-queued: it goes back once #38187 and #38188 are fixed or shown to be flakes.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — re-queue · head ac1dd47 · card #37842 · area s2-ai · 2026-11-28T06:34Z

The merge queue ejected this PR on three dogfood suites (approval-decide-over-mcp, approval-read-over-mcp, mcp-system-object-action-exposure), none of which this diff touches. Triage closed their anchors #38187, #38188 and #38190 as a deterministic break caused by PR #38162 stacked ahead of this one, not by this PR. PR #38162 now carries its fix (e25ef84) and is queued again. The head is unchanged since ACCEPT 7234783873, so that ACCEPT still covers it.

Landing: auto-merge re-armed in this stroke.

Merged via the queue into main with commit a9901ed Nov 28, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-3yurjb branch November 28, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skill-evals: a turn inherits the host's memory variables, so project memory reaches both arms of a round

2 participants