Repository navigation
fix(scenarios): a thrown live turn is recorded and replays as the same failure; a wrongly cased skill file is refused - #35007
Conversation
…e failure; a wrongly cased skill file is refused Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…the control builds the old recording by key Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…ll-file spelling refusal Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
📓 Docs Drift Check8 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 1 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7ed5be3045e7e5e390cdbea4143b6432ec119f2a && git checkout 7ed5be3045e7e5e390cdbea4143b6432ec119f2a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4443014630c094cde840f9dd0b0b45ade45b48d9 a0892887cc8251852c1602e3dd332a7141e72d58 && git checkout -B drift-repro 4443014630c094cde840f9dd0b0b45ade45b48d9 && git merge --no-ff a0892887cc8251852c1602e3dd332a7141e72d58
node scripts/docs-audit/affected-docs.mjs --json 4443014630c094cde840f9dd0b0b45ade45b48d9 |
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT · 2026-11-17T22:53ZHead-sha: 3644012 席位核对PR shape.
This stays inside the claim's file surface: CI. It was still running when I read it (16 pending, 14 success, nothing failed). This verdict holds on the condition that Half 1: a thrown turn is recorded and replays as the same failure.
Half 2: the skill file must be spelled exactly Red first and ablation. On the Must-fixNone. Should-fix
Notes
Next: the S1 amendment, which is text only and gets a delta read. Then o3-G lands once the three aggregates are green. No seat L2 is owed, unless the seat wants to rule Clause-② itself. |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
|
repo:objectstack#3 · os-support-ai · session_01WGufzfWpJ96QY9T7d8DvFg L1: ACCEPT (delta) · 2026-11-17T23:00ZHead-sha: a089288 席位核对Delta. One commit on top of my ACCEPTed head. It touches one path, the changeset, and changes one line. No code or test moved. S1: closed. The changeset, the PR body (line 6) and claim amendment 6963351666 all read CI. It was just starting on this head (18 pending, nothing failed). This verdict holds on the condition that Must-fixNone. Should-fixNone. Notes
Next: o3-G lands once those checks are green. No seat L2 is owed. A later push owes an L1-c delta read. |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract-review-claim: session_01WGufzgh1zkZzDXL36ckWAG · head |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: Face: declaration ( ① Derived judgmentsThe published surface is the
② Semver level
③ Boundary flags
Must-fix: none. Should-fix: none. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgNCAXyGfBQFZBwixH Landing · 2026-11-17T23:18Z
Ready + auto-merge into the queue. Area o3-G (repo:objectstack#3) watches it to MERGED and closes out #34878. |
Requested by Yibo Wang · project thread
Fixes #34878
Clause-②: yes (widening: published @objectstack/scenarios ./runner types ThrownTurn, RecordedTurn and RecordedThrowError, plus one optional field on Recording.turns)
Metadata-protocol: none
维护者速读
--ask-skills读取各修一处。一是录制时如果一次提问抛了异常,现在会把它记成一个失败的回合,回放时原样再抛一次。二是技能文件名必须正好是SKILL.md,大小写不对就直接拒绝,并说出找到的文件名。skill.md在 macOS 上会让运行崩溃(TypeError),在 Linux 上又被悄悄跳过。packages/qa/scenarios/src/runner/driver.ts(RecordingDriver的 try/catch,以及RecordedDriver.ask和author开头的重新抛出)、packages/qa/scenarios/src/runner/ask-skills.ts(skillFileOf和拒绝的那句话)、packages/qa/scenarios/test/runner/orchestrate.test.ts文件末尾新加的 describe。pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/orchestrate.test.ts test/runner/ask-skills.test.ts,预期 157 个测试全部通过。What changes
Half 1: a thrown live turn is recorded and replays as the same failure (
src/runner/driver.ts)RecordingDriver.askandRecordingDriver.author(driver.ts:826-856) catch a throw from the live driver. They record the step as an empty turn carryingthrown: { name, message }, then rethrow the original error object unchanged. The new optional field lives onRecordedTurn extends ParsedTurn(driver.ts:522-535), andRecording.turnsis typed by it.ParsedTurnitself is untouched. A non-Errorthrow recordsname: 'Error'andString(e).RecordedDriver.askandRecordedDriver.author(driver.ts:752, :768) throwRecordedThrowError(driver.ts:573) when a turn carriesthrown. The error has the recordednameandmessage. Nothing is re-sent, and no recorded file is written.MissingRecordingError,ReplayNotFaithfulError, when a replay is being recorded) is left unrecorded, as before (driver.ts:588). Recording it as a plain throw would turn a live "not measured" into an error on the next replay.thrownturns and replays exactly as it did.How the runner counts a live throw and a missing turn. These sites decided the replay behaviour. All of them are in
orchestrate.ts, which this PR does not edit:res.error = errText(e)(orchestrate.ts:1536-1540)no recorded turn for …res.error(orchestrate.ts:1557-1561)MissingRecordingError⇒notMeasured(:1558)!notMeasured(scorecard.ts:347-355): 4/5 → 4/4res.error(:1697-1698)confirmed.error(:1692-1693)MissingRecordingError⇒notMeasured(:1679)half.error+half.notMeasuredwith the message (:1042-1052)errText(orchestrate.ts:586) reads onlye.message. A replay that throws an error with the recorded message, and that is neitherMissingRecordingErrornorReplayNotFaithfulError, therefore takes the live branch at every site and gives the identical row, the identicalerrorstring included. That is why replay rethrows rather than returning a failed turn. A returned turn would be graded, and the grade would differ from the liveerror.Half 2: a wrongly cased skill file is refused clearly (
src/runner/ask-skills.ts)skillFileOf(ask-skills.ts:159) reads the directory listing. It answersSKILL.md, or the name of a file spelled in some other case ofskill.md, or nothing.existsSync(join(dir, 'SKILL.md'))is gone from the skill test, so the answer is the same on every filesystem.readAskSkillsrefuses such a directory before any turn runs. This applies to a top-level skill and to one skill among a directory of skills (ask-skills.ts:181-200). The refusal uses the existing--ask-skills names …style:--ask-skills names `DIR`, which holds `mixed/Skill.md`: a skill file is spelled `SKILL.md` exactly, or a session reads it on one filesystem and misses it on another; rename it to `SKILL.md`.f.get('SKILL.md')!wasundefinedand the read threwCannot read properties of undefined (reading 'toString'). On a case-sensitive filesystem, a top-levelskill.mdanswered "holds no skill", and a misspelt skill among others was skipped without a word.Tests
All new tests are in existing harness files, as top-level
describeblocks.test/runner/orchestrate.test.ts, at the end of the file,runHalf — a live turn that throws is recorded as a failed turn, and its replay counts the row it counted live:dq_staff, questiontech_accountsand operationadd_contactthrow. The recording holds each step as{ replyText: '', toolCalls: [], meta: {}, thrown }. Replaying it gives the samedatasetTally(1/2, never 1/1), the same question and dataset-question results (error,notMeasured,grade) and the same operationerror. This is the card's Done-when.dq_staffnot measured (1/1 · 1 not measured), andtech_accountserroringno recorded turn for ….rejects.toBe). The replay's error has the samenameandmessageand is notReplayNotFaithfulError. A replayed authoring turn writes no file. A recording of the replay holds the same turns.error: 'author: spawn claude ENOENT', samenotMeasured).test/runner/ask-skills.test.ts,readAskSkills — a skill file is matched by its exact spelling, on every filesystem. A hoistedvi.mock('node:fs')stands in for a case-insensitive filesystem on any host: when switched on,existsSyncanswers true for any casing. Each case runs with it on and off.skill.mdgets the full refusal sentence.mixed/Skill.mdamong other skills is refused by its path, not skipped.SKILL.mdstill loads, as a directory of skills and as a single skill.Acceptance notes
SKILL.mdexistsSyncsites in the package, not changed (listed as the card asked):src/runner/packages.ts:332(skillDirs): it compares the workspace catalog with the project's synced copy by real file names. It reads no file through theSKILL.mdspelling, so there is no TypeError. A wrongly cased catalog skill would be counted on a case-insensitive host and skipped on a case-sensitive one, on both sides alike, so the copy check still holds. The catalog is the publishedskills/tree, which has its own gates.src/skill-evals/cases.ts:145: on a case-insensitive host it readsjoin(root, b, 'SKILL.md')successfully (no TypeError). On a case-sensitive host a wrongly cased bundle is skipped silently, so its evals are not loaded. The root is the same published catalog. Fixing it would be outside this claim's file surface.thrownTurnleavesReplayNotFaithfulErrorunrecorded, as today, when a replay is itself recorded. A recording of a replay therefore still meets a gap at that step. This is unchanged behaviour, and only a replay of a replay hits it.Recording.turnsnow maps each step key to aRecordedTurn, a subtype ofParsedTurn. Readers typedParsedTurn(export/transcript.tsmergeRecordings) compile unchanged. The export path looks a turn up only for a question with a grade, which a thrown turn never has.Verification
All readings are at head
3644012a50unless a line says otherwise.Red first: the fix's two source files restored to origin/main (db1a05c), tests kept
The control (old recording replays unchanged) is green on both trees.
Ablation: the replay's rethrow deleted from RecordedDriver.ask (scripts/ablation-replace.mjs; src is imported directly, so no dist leg)
The two that stay green are the control and the authoring case. The authoring case runs through
RecordedDriver.author, which the ablation does not touch.Package suite and typecheck
Derived gate families (dispatch-gates --commands, 64)
dispatch-gates --ran: 64 derived, 62 run with exit 0, 2 NOT MEASURED (exit 3, prerequisite):node scripts/check-plugin-teardown-shape.mjs --self-test: exit 3. The positive control is pinned to a commit this shallow checkout cannot reach. CI runs it.pnpm check:dual-build-cjs-loads: exit 3. It reads every package'sdist/, and only this card's dependency closure is built here. CI runs it.node scripts/check-nul-bytes.mjs: exit 0.overlap-check:VERDICT clean exit 0(origin/main and #34985 merge cleanly).Not run locally, declared to CI: the repo-wide lint and the
test:repoproject. The branch is not merged with the 7 commits main gained since db1a05c. They touchpackages/specandui/, and in this package onlytest/dataset-cards.test.ts. overlap-check reads a clean merge, and PR CI runs on the merge ref.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH