Skip to content

feat(scenarios): run-scenarios --driver codex and --driver external:COMMAND, with the driver on each gallery app page - #31265

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-mickba
Nov 7, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-mickba

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #31159

Clause-②: yes
Metadata-protocol: none

维护者速读

  • 改了什么:场景执行器新增两种驱动。--driver codex 用本机 Codex CLI(codex exec --json)跑卡片,只认 ChatGPT 套餐登录;--driver external:命令 让任何能按约定读写 JSON 的命令接进来(每次调用一个进程,stdin 进 JSON、stdout 出 JSON,约定写在包 README)。画廊每个应用页多一行 - Driver:,写明驱动名和版本;回放记录写明原录制的驱动。
  • 为什么改:维护者原话「前面的建议都同意,立卡」(epic cloud#3600):同一张卡要能横向比较不同 agent 工具。WorkBuddy 只做核查:没找到无头模式加结构化输出的入口,所以不接,也不做 UI 桥。
  • 风险与回滚:只动 packages/qa/scenarios,默认驱动 claude 的行为不变(只是把进程启动函数挪到 drivers/process.ts 共用)。最大的风险是人物 API key 泄露:key 只写进 0600 文件(外部命令拿到的是文件路径;Codex 是 $CODEX_HOME 下的临时 profile),用完即删,从不进 argv、环境变量或 stdin;端到端测试把整张 crm 卡经外部命令跑完,再在运行记录、录制、评分卡和画廊导出里逐文件搜 key。回滚即 revert 本 PR。
  • 先看:packages/qa/scenarios/src/runner/drivers/external.ts(外部约定与 key 文件)、packages/qa/scenarios/src/runner/drivers/codex.ts(登录守卫、profile 文件、JSONL 解析)、packages/qa/scenarios/test/runner/external-driver.test.ts(端到端 key 搜索)。
  • 两分钟验证:pnpm --filter '@objectstack/scenarios^...' build && pnpm --filter @objectstack/scenarios exec vitest run test/runner/external-driver.test.ts test/runner/codex-driver.test.ts,预期 2 个文件 20/20 通过。
  • 需要你做的:无,席位落地。

What changes

  • --driver external:COMMAND (src/runner/drivers/external.ts, ExternalDriver): the AgentDriver seam as a process contract, objectstack-scenario-driver/1.
    • One process per call. The call is one JSON object on stdin, the answer one JSON object on stdout, logs on stderr (the record keeps the last 2,000 characters). Three calls: info once at start (the command names itself and its version: the record's driver is external:NAME, its version the one it gives; a command that cannot answer is refused before any card runs), author (step, prompt, cwd, tier, limits; runs in cwd) and ask (step, prompt, mcp: { url, configFile }, limits; runs in the config file's directory).
    • The answer is strict (ExternalTurnSchema: replyText, toolCalls[{name, input, output, isError}], optional model and numTurns; an unknown key is refused). Exit 0 with that shape is the turn. A non-zero exit, a signal or the runner's timeout is a failed turn no-result(exit N); stdout that is not one JSON object of that shape is invalid-output(…) with isError. A failed authoring turn leaves its Build half not measured (authorNotMeasured), a failed persona turn is graded on its empty reply. Never an empty pass.
    • ⛔ The key: ask writes {"mcpServers":{"app":{"type":"http","url":…,"headers":{"Authorization":"Bearer KEY"}}}} (the Claude driver's --mcp-config shape) to a 0600 file in a fresh temp directory, passes its PATH in mcp.configFile, and deletes the directory when the call returns. The key is never on argv, in the environment or on stdin.
    • limits carries timeoutMs (--author-timeout for author, 5 min for ask; the runner kills the call then) and, when given, maxTurns and model. The command may ignore them; the record states them (DriverInfo, meta.process.maxTurns / requestedModel).
    • The command is split on whitespace (no shell); a word starting ./ or ../, and a first word holding /, resolves against the directory the runner starts in. The runner removes ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, OPENAI_API_KEY and CODEX_API_KEY from the command's environment; it cannot see the command's login, so authMethod reads not verified (an external command: …).
  • --driver codex (src/runner/drivers/codex.ts, CodexDriver), built from the installed CLI (measurements below):
    • Login: refuses to start while OPENAI_API_KEY or CODEX_API_KEY is set, or when codex login status says anything but Logged in using ChatGPT (assertCodexSubscriptionLogin, pure, the counterpart of assertSubscriptionLogin); every turn also passes -c forced_login_method="chatgpt", and both variables are removed from every child.
    • A turn: codex exec --json --ephemeral --skip-git-repo-check -c forced_login_method="chatgpt" -c approval_policy="never" -p PROFILE -s … -C DIR [-m MODEL] -, the prompt on stdin. Authoring: -s workspace-write -c sandbox_workspace_write.network_access=true in the project (the Claude driver's Bash has the network too). Persona turns: -s read-only in an empty temp directory.
    • MCP and the key: a profile layer $CODEX_HOME/scenario-runner-HEX16.config.toml, mode 0600, deleted in finally, holding [mcp_servers."app"] with url and http_headers = { Authorization = "Bearer …" }, plus enabled = false for every server of the user's own config (codex mcp list --json, read once at start), the counterpart of --strict-mcp-config. argv carries the profile's NAME only. A user server already named app is refused at start.
    • parseCodexJsonl reads the events into the same ParsedTurn: agent_message texts joined into replyText; mcp_tool_call → the app's own tool name (rawName mcp__SERVER__TOOL), output the result's text (or structured_content, or the error message), isError on failed; command_execution, file_change, web_search kept as calls by their item type; a call started and never completed keeps output: undefined; turn.completed → success; turn.failed → turn.failed: MESSAGE with isError; a top-level error event is a reconnect notice, not the end.
    • Flags: --model, --author-model, --ask-model → -m per turn kind; --author-timeout is the runner's own clock. codex exec has no turn cap, so --author-max-turns and --ask-max-turns are refused at makeDriver (as the recorded driver refuses every live flag).
  • The driver on record (Ask 4): DriverInfo gains replayOf?: { driver, version? }, which RecordedDriver.info() fills from the recording (a recording of a replay keeps the original). The gallery exporter writes - Driver: NAME VERSION on every app page (driverText, exported from ./export); a replay reads RECORDED-DRIVER VERSION (re-graded from a recording of that run), never the recording's path; an old replay record with no replayOf says it does not name its driver. The record schema reads env.driver.version / replayOf (loose, both optional).
  • Shared process runner: runCli and noResult moved from driver.ts to src/runner/drivers/process.ts (runTurnProcess, now taking the child environment), unchanged otherwise; the tool-result text reader moved there too (contentText) and transcript.ts uses it. process.ts is not re-exported from ./runner.
  • makeDriver: codex and external:COMMAND (an empty command refused); the unknown-driver message lists claude, codex, external:COMMAND, recorded:FILE. ApiBillingRefusedError takes an optional { tool, login } (default Claude Code's, message unchanged).
  • README: the Codex section and the external contract (stdin shapes for info/author/ask, the stdout shape, exit codes, timeout, limits, the key file), and the WorkBuddy finding. Changeset patch with both declaration lines.

Public surface (Clause-②: yes, additive)

Nothing removed or renamed. Added to @objectstack/scenarios/runner: CodexDriver, CodexDriverOptions, CODEX_API_BILLING_ENV, CODEX_TURN_CONFIG, CODEX_APP_SERVER, codexSubscriptionOnlyEnv, assertCodexSubscriptionLogin, codexProfileToml, parseCodexJsonl, ExternalDriver, ExternalDriverOptions, EXTERNAL_DRIVER_CONTRACT, EXTERNAL_STRIPPED_ENV, ExternalLimits, ExternalInfoInput, ExternalAuthorInput, ExternalAskInput, ExternalInfoSchema, ExternalToolCallSchema, ExternalTurnSchema, ExternalTurn, parseExternalCommand; the optional member DriverInfo.replayOf; an optional second parameter on ApiBillingRefusedError. Added to ./export: driverText. CLI: --driver codex, --driver external:COMMAND.

Ask 2: what was measured on the Codex CLI

Installed @openai/codex@0.167.0 (npm, codex-cli 0.167.0, linux-x64) into a scratch prefix in this container. No model turn ran: no login was used, and the container's proxy refuses OpenAI's hosts (HTTP CONNECT failed with status 403), so every exec below stopped at the model call.

Readings, each with its source
  • codex --help, codex exec --help (installed binary): exec "Run Codex non-interactively"; [PROMPT] "If not provided as an argument (or if - is used), instructions are read from stdin"; --json "Print events to stdout as JSONL"; -m, --model; -s, --sandbox read-only|workspace-write|danger-full-access; -C, --cd; --skip-git-repo-check; --ephemeral "Run without persisting session files to disk"; -p, --profile "Layer $CODEX_HOME/NAME.config.toml on top of the base user config"; --ignore-user-config; -c key=value; --strict-config. No turn-cap flag; max_turns and its spellings appear nowhere in the binary's strings.
  • JSONL event shapes: codex-rs/exec/src/exec_events.rs at tag rust-v0.167.0 (raw.githubusercontent.com): thread.started {thread_id}, turn.started, turn.completed {usage}, turn.failed {error{message}}, item.started|updated|completed {item{id,type,…}}, error {message}; item types agent_message {text}, mcp_tool_call {server, tool, arguments, result{content, structured_content}, error{message}, status}, command_execution {command, aggregated_output, exit_code, status}, file_change, web_search, todo_list, reasoning, error. No event carries the served model. Seen live: thread.started, turn.started, then error events Reconnecting... 2/5 (…) while the turn continued, so a top-level error is read as a notice. The docs the repository ships (docs/exec.md, docs/config.md, docs/authentication.md at that tag) only point to developers.openai.com, which this container cannot reach (connect refused): the config reference was not read; every config key below was measured instead.
  • MCP from a profile: $CODEX_HOME/scen.config.toml with [mcp_servers.app] url = "http://127.0.0.1:39123/mcp", http_headers = { Authorization = "Bearer FAKEKEY123" }: codex -p scen mcp list --json shows it streamable_http with that header; codex exec --json -p scen … POSTed initialize to a local listener with authorization: Bearer FAKEKEY123 (clientInfo.name codex-mcp-client). A project .codex/config.toml in the working directory was not read by mcp list (untrusted directory), so the driver does not use one.
  • The user's servers: with a base config.toml server other (port 39124) and the profile's app (39123), plain exec -p scen contacted both; --ignore-user-config -p scen contacted neither (it drops the profile too); [mcp_servers.other] enabled = false in the profile → mcp list shows it enabled: false, and exec contacted app only. The key appeared in no file under $CODEX_HOME but the profile.
  • Login: codex login --with-api-key (a fake key) → codex login status prints on stderr API key configured - sk-fake-***-0000, exit 0; an empty CODEX_HOME → Not logged in, exit 1, also with CODEX_API_KEY or OPENAI_API_KEY set; the binary's strings hold Logged in using ChatGPT (and … using access token, … personal access token, … workload identity, … Amazon Bedrock …). With -c forced_login_method="chatgpt", the API-key login reads Not logged in, exit 1.
  • Config keys under exec --strict-config -c …: forced_login_method="chatgpt", approval_policy="never" and sandbox_workspace_write.network_access=true are accepted; forced_login_method="bogus" → "expected chatgpt or api", approval_policy="bogus" → "expected one of untrusted, on-failure, on-request, granular, never", sandbox_workspace_write.bogus_key and bogus_top → "unknown configuration field".
  • Not measured: a real codex exec turn end to end (no ChatGPT login here, and live model runs are paused by the maintainer, cloud#3600), so a turn.completed stream was not seen live; its shape is the source's. The stand-in in codex-driver.test.ts replays those shapes.

Ask 3: WorkBuddy

Checked on 2026-11-07; no wiring, no UI bridge.

  • npm search workbuddy: the one package calling itself a WorkBuddy command line, @workbuddy/cli-vnext@1.0.153 (maintainer workbuddy_developer, developer@workbuddy.com), read from its tarball without running it: a REST client for a WorkBuddy tenant API (commander; commands auth, profiles, use, whoami; options --base-url, --client-id, --output json|table|raw), with no agent, no prompt mode and no MCP client. Its only URL is https://yourcompany.workbuddy.com; it is not Tencent's WorkBuddy.
  • Tencent's WorkBuddy (CN and the international WorkBuddy AI) is a desktop app: the community dsh-workbuddy-provider README (npm) describes reusing "WorkBuddy 桌面 App" credentials on macOS, and the app's model catalogue is fetched with "内置 CLI 版本号" (a built-in CLI version), but no published, documented headless mode with structured output and an MCP client was found.
  • So the PR says no, per the card. If one appears, it is a wrapper on --driver external: (README), not runner code.

Tests

  • test/runner/external-driver.test.ts (new, 8 cases), against test/runner/fixtures/fake-external-driver.mjs, a stand-in command that speaks the contract and reports what it saw of the key (a SHA-256, never the key):
    • info names the driver and version; a command exiting 4, printing prose, or missing is refused at construction with the reason.
    • author: the exact stdin object, the call running in the project, the answer read into the turn (MCP prefix dropped, isError kept, model, numTurns, success), the project files snapshotted.
    • ask: the config file is 0600, holds the URL and the key, the call runs in its directory, the key is on neither argv, environment nor stdin, and the file and its directory are gone afterwards.
    • Failed calls: exit 3 → no-result(exit 3) and not measured; prose → invalid-output(stdout is not one JSON object); another shape → invalid-output(…) (is_error); a hang → killed at the timeout, author timed out after 0.03 min.
    • Command parsing, external: with no command refused, the unknown-driver list; every flag in limits and on the record.
    • End to end, the key pin: the real crm_account_with_contacts card through runCard (both modes), each scripted turn sent through the stand-in command (the exporter fixture's in-memory app; runCrm gains keyPrefix and wrap), every persona and the admin issued a key sk-scenario-e2e-key-9f27c1d4 + the persona id. Every ask read one of those keys from a 0600 file and from nowhere else, and each file is gone. Then the run record (where the CLI writes it), the recording, the scorecard (renderScorecard) and the full gallery export (exportGallery, which exported the card) are written, and every written file is searched for the key prefix: none holds it. The record names external:fake-agent 1.2.3, the app page reads - Driver: external:fake-agent 1.2.3; a replay of that recording names replayOf and its page reads (re-graded from a recording of that run) without the recording's path.
  • test/runner/codex-driver.test.ts (new, 12 cases), against a stand-in codex script (it answers --version, login status on stderr, mcp list --json, and for exec reads the profile it is pointed at):
    • parseCodexJsonl on the 0.167.0 shapes (pairing, failed MCP call, command execution, a call cut short, torn last line, notice not an end, turn.failed).
    • The cost guard: OPENAI_API_KEY / CODEX_API_KEY set, an API-key login, no login, an empty status, a non-plan login (its masked credential not echoed) refused; the billing variables stripped.
    • codexProfileToml exact text (TOML-escaped key and names).
    • The driver: version and login on record; refused at construction for an API-key login, no login and OPENAI_API_KEY; an ask turn's argv (exec --json --ephemeral --skip-git-repo-check, the two -c overrides, -s read-only, -), a 190 KB prompt on stdin, the profile 0600 with the key, the key on neither argv nor environment, the profile file gone and $CODEX_HOME empty afterwards, no billing variable in the child; an author turn's workspace-write, -C, the network override and the user's server turned off; a user server named app refused; timeout, exit-without-result and turn.failed each not measured; --model / --author-model / --ask-model → -m; both turn-cap flags refused.
Ablations (each restored: blob == HEAD, git diff HEAD empty)

Both through scripts/ablation-replace.mjs (anchor x1 → x0, replacement x0 → x1) on commit fb1d76f7. The suites import src/ directly, so no dist leg.

  • Ablation 1, the key written into the record (external.ts ask: return await this.call(input, dir); → the turn's meta.model set to task.mcp.apiKey): the end-to-end case → 1 failed | 7 skipped, expected [ …(7) ] to deeply equal [], naming the run record, recording.json, scorecard.md, and the gallery's README.md, run-record.json, scorecard.json, scorecard.md.
  • Ablation 2, an API-key Codex login accepted (codex.ts: the ChatGPT test widened to /Logged in using ChatGPT|API key configured/): codex-driver.test.ts -t "cost guard|refuses an API-key login" → 2 failed | 2 passed, both "expected function to throw an error, but it didn't".
  • Restore leg: both files → Test Files 2 passed (2), Tests 20 passed (20).

Acceptance notes

  • The external driver's cost claim. DriverInfo.apiBilled is typed false, and the runner cannot see an external command's login, so the record says authMethod: not verified (…) and the README states the cost ruling applies to the command; the four billing variables are stripped from its environment. Whether an external command must also be refused when one of them is set in the caller's environment (as the two built-in drivers are) was not in the rulings; this PR strips and does not refuse.
  • No served model for Codex. The JSONL names none, so a Codex turn's model is absent and the scorecard reads model not reported (asked for …) rather than guessing; modelMismatch is never set for it.
  • Codex writes into $CODEX_HOME. The profile layer is the only key-in-a-file route the CLI was measured to read (-p); the file is 0600, uniquely named, and removed in finally. A run killed by SIGKILL could leave one behind; it holds a persona key of a local dev app that is torn down with the run.
  • The external stand-in's e2e uses the fixture's in-memory app. The command answers the turn the scripted model gave; the double applies the turn's writes to the in-memory app in-process. Every turn's bytes still cross the process boundary, and the key reaches the command only through the file.
  • codex mcp list --json prints the user's other servers' headers to the runner's memory once at start; only name is read and nothing is logged.
  • Out of scope, untouched: any live model run (paused, cloud#3600), a WorkBuddy or other UI bridge, orchestrate.ts, the gallery index.json schema (the driver is on the app page, as Ask 4 says; run-record.json already carries env.driver).

Verification

All on head fb1d76f7 (base origin/main 169ff7e5, which carries #31221 as fba4c00a and #31204 as 0d0c377b), worktree objectstack-issue-31159.

  • pnpm --filter '@objectstack/scenarios^...' build (under the verify lock) → VERDICT command-exit 0.
  • pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios test → Test Files 30 passed (30), Tests 573 passed (573), VERDICT command-exit 0.
  • pnpm --filter @objectstack/scenarios typecheck (tsc --noEmit, tests included) → exit 0.
  • node --stack-size=4000 node_modules/eslint/bin/eslint.js packages/qa/scenarios --no-inline-config → exit 0 (the package has no lint script).
  • The built entries load: require('dist/runner.cjs') (141 keys; ExternalDriver, CodexDriver functions), dist/export.cjs (driverText), dist/index.cjs, dist/cli.cjs, and import('dist/runner.js') (EXTERNAL_DRIVER_CONTRACT = objectstack-scenario-driver/1).
  • GITHUB_EVENT_NAME=pull_request GITHUB_EVENT_PATH=EVENT_WITH_THIS_BODY node scripts/check-changeset-no-major.mjs --base origin/main → exit 0 (Clause-②: yes, Metadata-protocol: none, patch).
Derived gates: 60 families, 58 run green, 2 NOT MEASURED, then 1 re-measured

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (tree at fb1d76f7) → 60 commands, each run with its exit captured before any pipe; --ran → "60 derived famil(ies) accounted for — 58 run, 2 NOT-MEASURED".

  • node scripts/check-plugin-teardown-shape.mjs --self-test → exit 3 (shallow clone, control commit missing). After git fetch --depth=1 origin 621a4876…, rerun → exit 0, "48 cases pass".
  • pnpm check:dual-build-cjs-loads → exit 3, PREREQUISITE NOT MET (needs every package's dist/; this worktree built the scenarios closure only). NOT MEASURED; the package's own CJS and ESM entries were loaded directly instead (above). CI runs it.
  • Beyond the derivation: pnpm --filter @objectstack/spec run check:error-code-provenance → exit 0 (this diff adds no error-code literal).
  • Every other family exit 0, among them check:cross-package-test-inputs, check:test-source-alias, check:dts-closure, check:published-files, check:undeclared-dep-imports, check:type-check-debt, check:type-check-coverage, check:nul-bytes, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration.
  • The full record: pm-orders/devx/31159-gates-ran.txt (project files).
  • test:repo, the dogfood battery and the full CI farm are CI's (no ! in the title, no (narrowing) arm).

Generated by Claude Code

…e driver on each gallery app page

The scenario runner drives the OpenAI Codex CLI on a ChatGPT plan login and
any command that speaks a stdin/stdout JSON driver contract, so the same card
can measure another agent tool. The persona's API key reaches either only
through a 0600 file. A replay names the driver of its recording, and each
exported app page names the driver and its version.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5mx64pxVGCbKfuxEwi
@github-actions github-actions Bot added size/xl 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 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/scenarios, touching 78 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/qa/scenarios/README.md, packages/qa/scenarios/src/runner/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/connect-mcp.mdx (via mcp.json (literal, a string literal in ask), mcpServers (literal, a string literal in a comment on a changed line))
  • content/docs/api/client-sdk.mdx (via automation.trigger (sdk, the route ledger binds it to POST /automation/trigger/:name, selected by route anchor /trigger/:name))
  • content/docs/api/plugin-endpoints.mdx (via /trigger/:name (route, bridged from symbol timeoutMs — its route source's handler names it))
  • content/docs/automation/connectors.mdx (via web_search (literal, a string literal in parseCodexJsonl))
  • content/docs/automation/flows.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/automation/hook-bodies.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/automation/jobs.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/automation/webhooks.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/data-modeling/virtual-objects.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/deployment/environment-variables.mdx (via timeoutMs (symbol, a field of interface ExternalLimits), OPENAI_API_KEY (literal, a string literal in CODEX_API_BILLING_ENV))
  • content/docs/protocol/kernel/lifecycle.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))

⛔ 8 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v16.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/releases/v17/17-0.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/releases/v17/17-3.mdx (via automation.trigger (sdk, the route ledger binds it to POST /automation/trigger/:name, selected by route anchor /trigger/:name), /trigger/:name (route, bridged from symbol timeoutMs — its route source's handler names it))
  • content/docs/releases/v17/17-4.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/releases/v17/17-5.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/releases/v17/17-7.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/releases/v18/18-0.mdx (via timeoutMs (symbol, a field of interface ExternalLimits))
  • content/docs/releases/v9.mdx (via OPENAI_API_KEY (literal, a string literal in CODEX_API_BILLING_ENV))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/qa/scenarios/README.md, packages/qa/scenarios/src/runner/index.ts) — pages documenting those are invisible to this run
  • 23 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 455229e7aebae2fe91ada77736377fe145defba3 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 455229e7aebae2fe91ada77736377fe145defba3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 455229e7aebae2fe91ada77736377fe145defba3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Contract review

Served-tier: TIER_DEFAULT
Head-sha: fb1d76f7d24678c01304f573d97d45a046409bf7
Local-runs: none

Inputs: card #31159 (body, triage 6709176909, claim 6712196415, os-dev-report 6712807610), PR #31265 (body, 15-file list, net diff origin/main...fb1d76f7), and the 45 check-runs on the head. Read-only: the diff was read from the fetched objects, nothing built, run or re-run.

① Derived judgments

  • Accept set of makeDriver (src/runner/cli.ts): claude (unchanged), codex, external:COMMAND, recorded:FILE. Refused: external: with an empty or blank command (needs a command, from parseExternalCommand); codex with --author-max-turns or --ask-max-turns (has/have no equivalent in the Codex CLI); recorded: with any live flag (unchanged); every other name, with the message now listing all four. The default claude path is unchanged in substance: runCli became runTurnProcess in drivers/process.ts with the same body and the same subscriptionOnlyEnv() child environment.
  • External contract, README versus implementation (README.md "Other agent tools" against drivers/external.ts): they agree on every point I compared — one process per call; info once in the constructor before any card, refused on non-zero exit, prose or a missing binary; author runs in cwd, ask in the config file's directory; strict ExternalTurnSchema (unknown key refused); exit 0 with the declared shape is the turn; non-zero exit, signal or the runner's timeout is no-result(exit N | signal S) via noResult; other stdout is invalid-output(why) with isError; limits.timeoutMs is --author-timeout (default 60 min from DEFAULT_AUTHOR_TIMEOUT_MIN) or 5 min for ask, SIGTERM at the deadline; stderr tail 2,000 characters; maxTurns and model carried in limits and on meta.process; the four billing variables deleted from the child environment. authorNotMeasured in orchestrate.ts turns every failed authoring turn into a not-measured Build half, so "never an empty pass" holds. Two small documentation gaps, neither a contract break: the README does not state the info name grammar (ExternalInfoSchema regex: letters, digits, ., _, -) nor the 30 s info timeout (infoTimeoutMs).
  • Exports reachable through ./runner (src/runner/index.ts now export * from drivers/codex.js and drivers/external.js; drivers/process.ts not re-exported, as the PR says): comparing the exported names of driver.ts, transcript.ts, runner/index.ts and export/index.ts on origin/main against the head yields no name present on main and absent at the head. The 89 lines deleted from driver.ts were the module-private CliRun, STDERR_TAIL, runCli and noResult; the 12 from transcript.ts the private resultText (now contentText in process.ts, same logic). DriverInfo.replayOf is an optional member; ApiBillingRefusedError's second parameter is optional with the Claude default, so the previous message is byte-identical. ./export gains driverText; appReadme's changed signature is private. Additive throughout.
  • Gallery exporter (src/export/exporter.ts, record.ts): every app page gains - Driver: NAME VERSION from driverText(record.env.driver); a replay reads DRIVER VERSION (re-graded from a recording of that run) and never the recording path; an old replay record without replayOf says so. RecordedDriver.info() fills replayOf from the recording and preserves the original across a recording of a replay. The record reader (ScenarioRunRecordSchema.env.driver) now reads version and replayOf; note it also types version as string | undefined where the loose object accepted any value before — a narrowing of the exporter's accept set in theory, but every writer is DriverInfo.version: string, so no record the runner ever wrote is affected. Cosmetic: codex --version prints codex-cli 0.167.0, so a Codex page will read - Driver: codex-cli codex-cli 0.167.0; the Claude driver already has the same shape, so it is consistent, not wrong.
  • Key-handling contract: external ask writes the Claude-shaped mcpServers.app config to a 0600 file inside a fresh mkdtemp directory, puts only {url, configFile} on stdin, strips the task to StepRef via stepOf (so task.mcp.apiKey cannot ride along), and removes the directory in finally. Codex writes a 0600 profile scenario-runner-HEX.config.toml under $CODEX_HOME, passes only -p NAME, and removes it in finally. Neither driver puts the key on argv, in the child environment or on stdin; the recorded turn carries meta.process (exit, timing, stderr tail) and the parsed answer only. The triage's ask for a test that pins "no key in any record" is met: external-driver.test.ts runs the real crm card through the stand-in and greps the run record, recording, scorecard and the whole gallery export for the key prefix. Residual exposure, shared with the Claude driver: a command that prints the key to stderr would land it in stderrTail; the README forbids that and the runner cannot prevent it.
  • Codex API-key refusal against the card's ask ("refuse an API-key login the same way the Claude driver does"): met. assertCodexSubscriptionLogin refuses OPENAI_API_KEY/CODEX_API_KEY in the caller's environment, an API key configured status, no login, and any non-ChatGPT login (masked credential not echoed); every turn also passes -c forced_login_method="chatgpt"; both variables are stripped from every child. The test suite includes the dev's ablation of the guard.
  • External command: stripped but not refused when a billing variable is set. Ask 1 asks only that keys go in a 0600 file, never on argv; the refusal rule is stated for Codex (Ask 2) and the Claude driver, whose logins the runner can read. For an arbitrary command the runner cannot see a login, so a refusal on a set variable would be a heuristic, not the Claude driver's check. Stripping the four known variables is the strongest enforceable step and the PR declares the choice in its acceptance notes. Judged acceptable against the card, not a defect; it is a maintainer policy question and is escalated in ③.

② Semver level

Changeset .changeset/31159-scenarios-codex-external-driver.md: '@objectstack/scenarios': patch, Clause-②: yes, Metadata-protocol: none; the PR body carries the same two lines. No published spec schema and no governed path in the 15 files. The diff adds exports, an optional member, an optional parameter, two --driver values and a README section, and removes or renames no exported name (verified above), so Clause-②: yes is right and patch is the level the launch-window rule assigns. Check Changeset on the head: success.

③ Boundary flags

From os-dev-report 6712807610 (open_questions: [], security_findings: none, three deviations) and the PR's acceptance notes:

  • Deviation 1, no assignees on pr_create: the order said none; the order governs the thread. Answered.
  • Deviation 2, pnpm check:dual-build-cjs-loads not measured locally: it runs inside the Build Core job (.github/workflows/ci.yml line 3081), and Build Core on this head is success. Closed by CI.
  • Deviation 3, Codex measured from a scratch install with no login and no model turn (proxy refuses OpenAI hosts; live runs paused per cloud#3600): acceptable under the card's own verification rule. Residual: a live turn.completed stream was never observed; the parser is built from exec_events.rs at the tag and replayed by a stand-in. The failure modes degrade to no-result/turn.failed not-measured, never a silent pass, so the first live Codex run is the remaining proof. Noted, not blocking.
  • Acceptance note, external cost claim: judged in ① as acceptable. Escalated to the maintainer as a policy question: should --driver external: also refuse to start when OPENAI_API_KEY, CODEX_API_KEY, ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is set in the caller's environment, as the two built-in drivers do? A one-line follow-up either way.
  • Acceptance note, no served model from Codex: the scorecard already renders model not reported (asked for …) (scorecard.ts line 234) and modelMismatch stays unset. Answered.
  • Acceptance note, a SIGKILL could leave a 0600 profile under $CODEX_HOME: it holds a persona key of a local dev app torn down with the run, and the file is 0600 in the user's own home. Acceptable; should-fix (non-blocking): sweep stale scenario-runner-*.config.toml at CodexDriver construction.
  • Acceptance note, the e2e stand-in uses the fixture's in-memory app: the key still crosses the process boundary only via the file, which is what the pin measures. Answered.
  • Acceptance note, codex mcp list --json holds the user's server headers in memory once: only name is read, nothing logged. Answered.
  • Observation outside the card's asks: a Codex persona turn runs -s read-only, which still allows read-only shell commands, whereas the Claude driver limits a persona turn to --allowedTools mcp__app. The answer may therefore draw on something besides the app's MCP. Not a defect against the card; a should-fix if parity is wanted.
  • Scope: all 15 files under packages/qa/scenarios/** plus one changeset, as the claim's file surface allows; orchestrate.ts untouched.

Check-runs on fb1d76f7 at the last poll: 29 success, 13 skipped by path, 0 failure, 3 still in progress — Test Core (1/8), Test Core (2/8), Test Core (3/8). Green and relevant: Build Core, Check Changeset, Check PR Size, Governed Surface Queue Guard, PR-body guards, Type Check (workspace, source gates, consumer gates, debt ledger), Lint (ESLint, repo and tooling gates, docs and code guards, CI/release/engine gates, PM dispatch-gates, scoped tooling self-tests, scoped query-options erasure, scoped slot lookup and corpus), Test Core (4/8 to 8/8), Plan Test Core shards, Dogfood Regression Gate, Live E2E UI, Test UI. This verdict stands on the three in-progress Test Core shards finishing green; a failure among them re-opens it.

Implemented-by: claude/project-thread-mickba
Reviewed-by: session_01FEkQ5njkh3xbcDN6EtSfw7

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

席位核对

Verdict: ACCEPT · head fb1d76f7d24678c01304f573d97d45a046409bf7 · card #31159 · report 6712807610 · contract review 6712878828 (PASS).

  • Shape: draft → main, Fixes #31159; 15 files, +1496/-112, all under packages/qa/scenarios/** plus one changeset, inside the claim's file surface. check-governed-merges --pr 31265: NOT governed, under the 3000-line threshold.
  • Card's asks, read in the diff:
    1. --driver external:COMMAND: ExternalDriver on the objectstack-scenario-driver/1 contract, documented in the README. One process per call; strict JSON on stdin and stdout. A non-zero exit is no-result(exit N) and any other answer is invalid-output(why), never an empty pass.
    2. --driver codex: CodexDriver on codex exec --json, with flags measured on @openai/codex 0.167.0. It refuses OPENAI_API_KEY/CODEX_API_KEY and any login that is not a ChatGPT login. --model maps to -m; the turn-cap flags are refused at makeDriver because codex exec has no turn cap.
    3. WorkBuddy: checked, no headless mode with structured output and an MCP client found. Per the card, no wiring and no UI bridge.
    4. The driver and version appear on the run record and on each gallery app page (- Driver:). A replay names its recording's driver through replayOf.
  • Keys (triage ⚠️): the persona MCP key reaches either tool only in a 0600 file, removed when the turn returns, and is never on argv, in the environment or a stdin value. The end-to-end test greps the run record, recording, scorecard and full gallery export for the key and finds it in zero files. The ablation that writes the key into the record turns that test red on 7 files.
  • Public surface: nothing previously exported from driver.ts or transcript.ts is gone (the 101 deleted lines were module-private); the new drivers are additive through ./runner.
  • Gates: check-runs on this head: 33 success, 13 skipped (path-gated), 0 failed, 0 pending, including all eight Test Core shards, Build Core and Check Changeset. Local: 58 of 60 derived families exit 0. check-plugin-teardown-shape was re-measured at exit 0, and check:dual-build-cjs-loads (NOT MEASURED locally) is answered by CI's Build Core. Package suite 573/573.
  • Changeset: patch, Clause-②: yes, Metadata-protocol: none; Check Changeset green.
  • Seat ruling on the review's escalated point: an external: command's environment is stripped of the known billing variables but not refused when they are set. The runner cannot read an arbitrary tool's login, so a refusal would be a guess; stripping is the enforceable step, and the README says so. The seat accepts it as built; the maintainer can tighten it later.
  • Not sent back (follow-up if wanted): the README does not yet state the info name grammar or the 30 s info timeout. A SIGKILLed Codex turn can leave a 0600 profile under $CODEX_HOME, as the PR itself notes. Codex ask runs -s read-only, which still allows read-only shell commands, unlike Claude's MCP-only tool list. The gallery line repeats the tool name (codex-cli codex-cli 0.167.0).
  • 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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant