Skip to content

feat(scenarios): run-scenarios --model / --author-model / --ask-model, with the served model recorded per turn - #31204

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-daow8a
Nov 7, 2026
Merged

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

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #31160

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:场景跑批器 run-scenarios 新增 --model(每一轮都用)、--author-model(建造/迭代轮)、--ask-model(人设问答与操作轮),原样作为 claude --model 传给本地 Claude Code。每一轮在运行记录里同时写明「要的模型」和「实际服务的模型」(读自流的 init 行),计分卡的作者行写出实际模型,新增 Run · model 行按实际模型统计人设轮次,不一致处标 ⚠。
  • 为什么改:2026-11-06/07 的所有轮次都跑在登录默认模型上,无法固定或对比模型;维护者同意此建议并立卡。
  • 风险与回滚:只动私有包 @objectstack/scenarios,不发布任何东西;不传新参数时命令行与之前逐字节相同。回滚即还原本 PR。
  • 先看:packages/qa/scenarios/src/runner/driver.ts(按轮次类型传 --model、servedAsRequested 判不一致)、src/runner/scorecard.ts(Run · model 行与作者行)、src/runner/cli.ts(三个参数、回放拒收)。
  • 两分钟验证:pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/units.test.ts test/runner/orchestrate.test.ts -t model,预期全部通过(含参数到达 CLI 参数表、记录带实际模型、不一致被标出)。
  • 需要你做的:无,席位落地。

What changes

  • Three flags on run-scenarios (runner/cli.ts): --model M for every live turn, --author-model M for the authoring turns (build and iterate) and --ask-model M for the question and operation turns, each of the last two in place of --model. A value is an alias (sonnet) or a name (claude-sonnet-4-5), passed through as claude --model takes it; an empty value or one that starts with - (a forgotten value swallowing the next flag) is refused. With none, no turn passes --model and the login's default serves, as today.
  • Threaded to the driver (runner/driver.ts): ClaudeCodeDriver already took model; it now also takes authorModel / askModel and passes the one for the kind of turn. DriverInfo states authorModel / askModel, so the record's env.driver and the run's first console line say what was asked for. RecordedDriver refuses the three model flags as it refuses the live-driver limits (makeDriver): a replay re-reads each turn as it was recorded.
  • The model asked for, beside the model served, per turn: the live driver stamps each turn's meta.process.requestedModel (the --model it was given; runner/transcript.ts), next to the stream's own meta.model it already parsed. The turn summary in the record (TurnSummary, runner/orchestrate.ts) carries model (served), requestedModel and modelMismatch: true when the served name is not the requested one. A recording keeps both on every turn, so a replay re-reads them as the run saw them.
  • Mismatch rule (servedAsRequested, runner/driver.ts): the CLI takes an alias and the stream names the model it resolved to, so a turn is served as asked when the served name holds the requested one as a whole run of its dash-separated parts (sonnet and claude-sonnet-4-5 in claude-sonnet-4-5-20250929; never opus, never a fragment like son); a context-size suffix ([1m]) is dropped. Any other answer, including an alias that names no model family (default, opusplan), is shown as a mismatch beside both names, for the reader to judge.
  • The scorecard (runner/scorecard.ts): the author rows end with the served model (success · 17/80 turns · 3m 02s · claude-opus-5-5, ⚠ asked for sonnet on a mismatch, model not reported (asked for sonnet) when the stream named none); new rows Run · model and Iterate · Run · model count the half's question and operation turns per served model (claude-sonnet-4-5-20250929 ×12, claude-opus-5-5 ×2 ⚠ 2 not sonnet); — when no turn named a model and none was asked for. HalfScores.models (ModelTally) carries the same in the record's scorecard.
  • README: the two command lines and a Model paragraph.

Why

The card's three asks, verbatim: "--model ALIAS for every turn, plus optional --author-model / --ask-model to set the build and persona turns apart. Thread them to the driver."; "The run record and the scorecard state the model actually served per turn. The stream's meta.model is already parsed; show any mismatch with the requested model."; "Tests: the flag reaches the CLI argument list; the record carries the served model." Every recorded turn of the 2026-11-06/07 runs used the login's default model and nothing let a run pin or compare one.

Tests

  • The flag reaches the CLI's argument list (test/runner/units.test.ts, the stand-in claude block, 2 new cases). The stand-in now serves a model the way the real CLI's init line names it (--model X → claude-X-4-5-20250929; retired falls back to claude-opus-5-5). Pins: parseArgs(['--model', 'sonnet']) → makeDriver → both an authoring and an ask turn's argv carry --model sonnet, each turn's meta.process.requestedModel is sonnet and meta.model is the served claude-sonnet-4-5-20250929; --author-model opus --ask-model haiku beside --model sonnet splits them; --author-model alone leaves the ask turn with no --model and nothing requested; no flag passes no --model; a fallback keeps both names. Negative pins: a missing, empty, blank or flag-shaped value is refused per flag; a replay refuses --model, and names --author-model, --ask-model together.
  • The mismatch rule (units.test.ts, new describe, a 12-row table): alias, name, dated name, case, [1m] suffix, other family, wrong version, a fragment of a part, default, empty.
  • The record carries the served model (test/runner/orchestrate.test.ts, new describe, 2 cases): the real crm card through runCard, its driver wrapped in a RecordingDriver and a stamp that asks for opus on authoring turns and sonnet on persona turns, with one question's turns served claude-opus-5-5. Pins: every turn summary carries model and requestedModel, exactly that question's turns carry modelMismatch; first.models counts the served models; the rendered table's author row names claude-opus-4-1-20250805 and both Run · model rows show ⚠ N not sonnet; the written record (JSON round trip) holds env.driver.authorModel/askModel, the mismatched turn and the tally; the saved recording replayed through RecordedDriver.fromFile (the --driver recorded:F path) answers that turn with both names. A run whose turns name no model and ask for none keeps | Run · model | — | and the author rows unchanged.
Ablations (each restored: blob == HEAD, git diff HEAD empty)

All four run through scripts/ablation-replace.mjs (anchor x1 → x0, replacement x0 → x1) on head 4798cbf1; the suites import src/ directly, so no dist leg.

  • Ablation 1, the mismatch marking disarmed (&& !servedAsRequested(…) in orchestrate.ts summarize replaced by an always-false String("ABL1").length < 0): orchestrate.test.ts -t served → 1 failed | 2 passed (the served-model record case).
  • Ablation 2, the replay refusal of the model flags disarmed (LIVE_FLAGS.filter → LIVE_FLAGS.slice(0, 3 + …).filter in cli.ts): units.test.ts -t model → 1 failed | 6 passed (the refusal case).
  • Ablation 3, the empty / flag-shaped value refusal disarmed (raw.trim() === '' || raw.startsWith('-') → raw === String("ABL3")): units.test.ts -t model → 1 failed | 6 passed (the refusal case).
  • Ablation 4, the --model threading disarmed (if (model) a.push → if (model && String("ABL4").length < 0) a.push in driver.ts base): units.test.ts -t model → 1 failed | 6 passed (the argument-list case).

Acceptance notes

Verification

Current head 45ceeaff (second origin/main merge, at 065bba72, carrying #31188; plain merge, no rebase). The only conflict was the README command block, and all three new lines were kept. Inside the merge, the new orchestrate.test.ts runRecord call passes packages: PUBLISHED because #31188 made RunRecordMeta.packages required. On this head: 25 files / 516 tests pass, typecheck and scoped eslint exit 0, and dispatch-gates --ran shows 49 derived, 49 run, 0 NOT MEASURED (check:dual-build-cjs-loads now measured). Ablations were not rerun because the merge touched none of the ablated lines. The rounds below are on the earlier head.

All on head 0b43e745 (the final commit: the work at 4798cbf1 plus one merge of origin/main at 8acbfab9), in worktree objectstack-issue-31160, base 620b6e6d. origin/main has since moved (#31185 among others, which touches packages/qa/scenarios prompts and tests); git merge-tree against it is clean.

  • Package suite, under the verify lock after pnpm --filter "@objectstack/scenarios..." build on the merged head: pnpm --filter @objectstack/scenarios test → Test Files 23 passed (23), Tests 460 passed (460); pnpm --filter @objectstack/scenarios typecheck (tsc --noEmit, test files included: --listFiles lists test/runner/units.test.ts) exit 0; VERDICT command-exit 0.
  • Lint scoped to the package: eslint packages/qa/scenarios --no-inline-config exit 0.
  • Derived gates: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack → 49 commands, all run on this head; 48 exit 0; pnpm check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET (it reads every package's dist/, and only the scenarios closure was built here) — NOT MEASURED, left to CI. --ran reconciliation: 49 derived famil(ies) accounted for — 48 run, 1 NOT-MEASURED.
  • Changeset: none. The diff touches only the private @objectstack/scenarios ("private": true): skip-changeset.
  • Dogfood battery: n/a (no ! in the title, no (narrowing) arm).
  • No live model run (paused by the maintainer): the flag-to-argv path is measured against a stand-in claude, and the replay path through RecordedDriver.fromFile on a recording the test writes.
The 49 derived gates, as run
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 3
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:objectql-double-limit :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vouch-for-reference-callers :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (Not touched.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes (scoped to the package).
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (Publishes nothing: skip-changeset.)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

…, with the served model recorded per turn

The live driver passes `claude --model` per kind of turn; every turn records
the model it asked for beside the one its stream says it was served, and the
scorecard names the served model and marks a mismatch.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5mMXSZe9L7NVZxrmUk
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 7, 2026
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

29 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
  • 11 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 63 of 226 client-bound route-ledger rows — the other 163 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 163: 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; 104 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 — 0 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 065bba721e4ba180c6bdbbf2c5fb787d49bac596 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 451fafd3cfbea7b24d09038707c1a78bc942f5c9 — the merge of head 45ceeaff2988f4ac3884ff7815bda9308a7d5175 into base 065bba721e4ba180c6bdbbf2c5fb787d49bac596, 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 451fafd3cfbea7b24d09038707c1a78bc942f5c9 && git checkout 451fafd3cfbea7b24d09038707c1a78bc942f5c9
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 065bba721e4ba180c6bdbbf2c5fb787d49bac596 45ceeaff2988f4ac3884ff7815bda9308a7d5175 && git checkout -B drift-repro 065bba721e4ba180c6bdbbf2c5fb787d49bac596 && git merge --no-ff 45ceeaff2988f4ac3884ff7815bda9308a7d5175

node scripts/docs-audit/affected-docs.mjs --json 065bba721e4ba180c6bdbbf2c5fb787d49bac596

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

…-daow8a

# Conflicts:
#	packages/qa/scenarios/README.md
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#3 · os-project-manager · session_01FEkQ5njkh3xbcDN6EtSfw7

席位核对

Verdict: ACCEPT · head 45ceeaff2988f4ac3884ff7815bda9308a7d5175 · card #31160 · report 6710696219 plus delta pm-orders/devx/31160-report-delta-45ceeaff.md (now in the PR body's Verification).

  • Shape: draft → main, Fixes #31160; 8 files, +353/-20, all inside the claim's file surface (packages/qa/scenarios/src/runner/**, its tests, the package README's flag list). Serial: it carries two plain origin/main merges, the second after feat(scenarios): run-scenarios --packages published|workspace; the gallery exporter refuses workspace records #31188 landed; the only conflict was the README command block.
  • Card's asks, read in the diff:
    • (1) --model, --author-model, --ask-model are parsed in cli.ts, refusing an empty or flag-shaped value. They are threaded through makeDriver to ClaudeCodeDriver, which picks authorModel ?? model for build/iterate and askModel ?? model for question/operation turns and passes --model. A recorded replay refuses them, like the limit flags.
    • (2) Each turn's summary carries the served model (stream meta.model), the requestedModel (meta.process) and modelMismatch (servedAsRequested: the request must appear as a whole run of the served name's dash-separated parts, so sonnet is in claude-sonnet-4-5-… but opus is not). The scorecard names the author turn's served model and counts Run turns per served model, with ⚠ on a mismatch. DriverInfo states the requested models.
    • (3) Tests: the flags reach the CLI argument list, the record carries the served model, and mismatches are marked.
  • Gates (check-runs on this head): 17 skipped, 33 success, 0 failed, 0 pending, including Lint & Repo Gates, TypeScript Type Check and every Test Core shard; the PR-body guards re-ran green after the Verification refresh. Local on this head: 25 files / 516 tests, typecheck and scoped eslint exit 0, dispatch-gates --ran 49 derived, 49 run, 0 NOT MEASURED.
  • Changeset: @objectstack/scenarios is private: true ⇒ skip-changeset correct. Clause-②: no; check-governed-merges --pr 31204: NOT governed, 373 lines.
  • Serial: Scenario runner: an external driver contract (--driver external:<cmd>) and a Codex driver, so the same card can measure other agent tools; check WorkBuddy #31159 (--driver external) follows on cli.ts / driver.ts; it is dispatched after this lands.
  • Landing: under 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z): pr_ready + automerge_enable now.

Generated by Claude Code

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 skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scenario runner: --model / --author-model / --ask-model, with the served model recorded per turn

1 participant