Skip to content

feat(scenarios): door mode builds a card through the MCP draft door with no project, in skill and rule arms - #35241

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-34780-scenarios-draft-door-mode
Nov 18, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-34780-scenarios-draft-door-mode

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Part of #34780

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:场景卡评测运行器新增 --modes door:客户端只拿到应用的 MCP 草稿门和技能,没有任何项目文件;运行器替人建包、连客户端、发布草稿,然后按现有规则评分。
  • 为什么改:要实测"托管的规则文本还需要多少",就得能在同一张卡上对比带不带某个技能、带不带某组规则时的构建结果。
  • 风险与回滚:只改 @objectstack/scenarios(评测工具包),产品包零改动;不传 --modes door 时行为不变。回滚即还原本 PR。
  • 先看:packages/qa/scenarios/src/runner/orchestrate.ts 的 doorMode(建包、取令牌、发布、评分顺序);src/runner/door.ts 的 readDoorRules(规则文件拒收条件);src/runner/driver.ts 的 doorAuthor(客户端只能调 mcp__app)。
  • 两分钟验证:pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/runner/door.test.ts,预期 21 个用例全绿。
  • 需要你做的:合并后按 README「One round, five reps per arm」跑一轮(每个 arm 5 次),规则文件由你在仓库外提供。

What changes

A fourth runner mode, door, in @objectstack/scenarios. No product package is touched.

  • The client gets the draft door and nothing else. A door turn runs in a fresh, empty directory outside the host project, removed after the turn. It is handed the booted app's MCP server with an OAuth token scoped openid metadata:write; the token sits in a 0600 config file outside that directory and never appears on argv or in the record. It may call mcp__app (plus Skill when given skills); Bash, Edit, Write and NotebookEdit are denied. The prompt (doorBuildPrompt) names the package and namespace and is the same text in every arm.

  • Person-equivalent steps around the turn (doorMode, src/runner/orchestrate.ts). Before the turn, the runner boots the host with the OAuth provider on and creates a writable package com.scenario.NAMESPACE in the card's namespace (POST /api/v1/packages). It mints the token over OAuth 2.1 + PKCE (mintAuthoringToken, src/runner/app.ts). After the turn, it lists the drafts and publishes them (POST /api/v1/packages/ID/publish-drafts). Then it grades what the environment serves, exactly as a scratch build is graded: Build half, then Run half. A publish that does not answer published is a finding naming each refused draft; the door answers a refusal on a 200, with outcome: refused under data. A refused package or token is a finding, and a harness without the doors is a skip naming them.

  • Arms (src/runner/door.ts, src/runner/cli.ts). There are two:

    • Skills. --door-skills DIR, less --door-skill-omit, uses the --ask-skills reader and its closed front-matter set.
    • Rules. --door-rules FILE or OS_SCENARIOS_DOOR_RULES, less --door-rules-omit, takes rule texts the maintainer supplies at run time in a documented generic format: { rules: [{ id, text }], sets? }. The texts reach the client as its directory's CLAUDE.md.

    A missing, malformed or in-checkout rules file is refused before any card runs, naming what is wrong. The record states the arm: skills with sha256, the rules file's name and sha256, and the active and omitted ids, never a text. summary refuses to sum two arms.

  • Replay. RecordedDriver re-sends a door turn's recorded save_metadata_draft / delete_metadata_draft calls through the replay's own door and token, and reports a mismatch as not faithful. Codex and external drivers are refused for door mode.

  • README: a door mode section with the rules file format, the flags, and the maintainer's one-round command at five reps per arm.

Tests

The tests use replay and stub drivers only; no live model is run.

  • test/runner/door.test.ts (new, 21 cases), with invented rule texts:
    • Rules file: a valid file; each refusal (missing, a directory, no JSON, unknown key, empty text, bad id, empty set, duplicate id, a set naming an unknown id, a set named like a rule, an unknown selector, an empty selector entry, a selector that omits every rule, a file inside the checkout); renderDoorRules; omitSkills; doorArmText.
    • Live-driver door turn, via a stand-in claude: --allowedTools mcp__app; the four denied tools; an empty cwd; the token only in the MCP config; the arm's skills under .claude/skills/ less the omitted one; the rules as CLAUDE.md; the record's arm; a scratch turn untouched by the arm.
    • CLI parse and refusals: door flags without door mode; an omit without its source; Codex/external refused; replay refusing live flags.
    • Replay and summary: a replay states the arm; summary refuses mixing arms.
  • test/runner/orchestrate.test.ts gains a top-level runCard describe for door mode (6 cases, on the file's existing fake harness):
    • end to end, covering the empty client cwd outside the host, the package, the token scope, the drafts, the publish, the scored Build and Run halves, the scorecard line, and the token absent from the record;
    • a publish refused on a 200;
    • a publish short of published with no refused draft;
    • a refused token, after which the driver is never asked;
    • the harness-gap skip;
    • a replay re-sending the saves through a new token, and a replay against an app that refuses a save, which leaves the build not measured.
  • One existing pin updated: the unknown-mode refusal now lists door.

Acceptance notes

  • Maintainer action after merge. This is the card's "Done when": one eval round at five reps per arm. The containers are keyless, so no live model ran here. The command is in packages/qa/scenarios/README.md under "One round, five reps per arm". In short, for each arm:

    pnpm --filter @objectstack/scenarios run-scenarios --modes door [--door-skills "$PWD/skills" [--door-skill-omit NAME]] [--door-rules /abs/path/outside/repo/rules.json [--door-rules-omit SET]] --record runs/door-ARM/repN.rec.json --out runs/door-ARM/repN

    Then run summary --mode door runs/door-ARM once per arm.

  • NOT MEASURED live. Nothing was run against a live os dev:

    • the OAuth flow on os dev -p PORT (canonical origin and token audience);
    • package creation and the publish of door-made drafts.

    These doors were read from source, not exercised. A step the app refuses is recorded as a finding naming the step, never as a score.

  • Follow-ups, not in this PR:

    • The build skill the "with build skill" arm needs (skills: a thin "build over MCP" procedure skill for the open draft door #34778) does not exist yet. Until it does, the skills arm is the published skills/ directory with and without a named omission.
    • The scenario-eval skill (governed .claude/**) needs a line about door mode.
    • The gallery exporter's record mode enum does not list door; door records are not exported to the gallery yet.
    • Moving a hosted rule corpus into this repository is left for the maintainer's own explicit word. This PR takes rules only from a maintainer-supplied file outside the repository, and every fixture text is invented.
  • Ablation (one-off, not a kept test):

    • Run 1 removed the publish.outcome !== 'published' || clause and checked it against the refused-publish case. That run stayed green: the refused case also carries failed[], so it does not pin that clause.
    • The fix. I added the published_unregistered case, which publishes with no refused draft.
    • Run 2 applied the same deletion and that case went red (expected [] to deeply equal [ Array(1) ]). The restore was proven: blob == HEAD and git diff HEAD was empty.
    • A first no-op attempt. An empty --replacement was refused by ablation-replace before anything ran, so it is not counted.

Verification

All at head 4e1b7624f1e.

Package tests and typecheck (under os-verify-lock)
  • pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios test: Test Files 40 passed (40), Tests 1176 passed (1176), VERDICT command-exit 0.
  • pnpm --filter @objectstack/scenarios typecheck (tsconfig includes test/**): VERDICT command-exit 0.
  • The dependency closure was built first: pnpm --workspace-concurrency=2 --filter '@objectstack/scenarios^...' build, VERDICT command-exit 0.
  • test:repo was not run locally: the diff touches no repo-project test. It is declared to CI.
Derived gate families
  • node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands derived 67 families against merge base ec227fc7b.
  • All 67 ran at this head and exited 0. That includes check:error-code-casing, which was red once on a lowercase test fixture code and is fixed; check:nul-bytes; check:published-files; check:dts-closure; check:dual-build-cjs-loads; and check:lean-entry-closure.
  • --ran reconciliation: 67 derived famil(ies) accounted for — 67 run, 0 NOT-MEASURED (a DERIVED zero — all 67 recorded an exit code and none of them is 3).
  • node scripts/pm/overlap-check.mjs before each push: VERDICT clean exit 0.

Generated by Claude Code

@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 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/scenarios, touching 111 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.

28 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json ec227fc7b18dbaea7ea635677db39063fb803206.

⛔ 13 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

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

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json ec227fc7b18dbaea7ea635677db39063fb803206

⚠️ 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 ec227fc7b18dbaea7ea635677db39063fb803206 → 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

repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud

席位核对

L1 full · REWORK (1 must-fix, small) · Head-sha: 4e1b7624f1eb285744a846a388f051648ce57bc9 · card #34780 (Part of #34780) · read 2026-11-18T17:42Z

Net diff against merge base ec227fc7b18: 17 files, +1483 / -55. All of it is in packages/qa/scenarios plus one changeset. It adds --modes door: a client that holds only the app's MCP draft door builds the card, the runner publishes the drafts as a person would, and then grades the result as a scratch build is graded. It has a skills arm and a rules arm.

Must-fix

  • M1. The changeset's first body line is Clause-②: no, not the summary. Each of the 43 changesets on main opens its body with the title line and puts the Clause-② / Metadata-protocol lines after it. The changelog generator takes the first body line as the entry's line. As written, @objectstack/scenarios' CHANGELOG entry would read "Clause-②: no", and the feat(scenarios): … title would fall into its body. Move the title line first.

Should-fix (does not block)

  • S1. A rules-arm transcript can carry rule text. The record states the arm by ids and sha256, never a text, and that holds for the arm field. But the turn's transcript is recorded too, and a client may quote a rule it was given in its own words or tool inputs. Rule texts may be the maintainer's private material, and eval-run records are filed publicly. One README line under the rules arm would cover it: read a rules-arm record before filing it anywhere public.

Against the card

  • Part of is right. The card is done when one round at five reps per arm is on record as an eval-run. That round needs a live model, so it is a maintainer action after merge, and the README gives the command.
  • Scope. Both arms are present: with and without skills (--door-skills less --door-skill-omit), and with and without a named set of rule texts (--door-rules less --door-rules-omit). The build-skill arm itself waits on skills: a thin "build over MCP" procedure skill for the open draft door #34778, as the body says.
  • No hosted rule text is in the diff. The rules arm reads a maintainer-supplied file at run time, a file inside the checkout is refused, and every fixture text is invented.

Read at the head

  • The client holds the door and nothing else.
    • The door turn runs in a fresh empty directory outside the host, which is removed after the turn.
    • It gets --strict-mcp-config with the one app server. --allowedTools is mcp__app (plus Skill when given skills), and Bash, Edit, Write and NotebookEdit are denied.
    • The token is in a 0600 config file in its own temp directory, also removed. It never appears on argv. The record keeps the token step's answer and scope, never the token.
  • Person-equivalent steps.
    • Before the turn, the runner creates the package, then mints an OAuth 2.1 + PKCE token scoped openid metadata:write.
    • After the turn, it lists the drafts, then publishes them. Only a whole published with no failed[] counts as clean, since a refusal can answer on a 200. The ablation in the body pins that clause through the published_unregistered case.
    • Each refused step is a finding naming the step, and nothing that needed it runs. A harness without the four doors is a skip that names them.
  • Arms.
    • The rules reader is a strict schema. It refuses each malformed input by name before any card runs, and it refuses a selector that omits every rule.
    • summary adds door arm as a table dimension, so two arms never sum into one cell.
    • Codex and external drivers are refused for door mode.
  • Replay. A door turn's recorded save_metadata_draft / delete_metadata_draft calls are re-sent through the replay's own door and token, by the existing faithful-replay rule. Recorded MCP names are stripped of their mcp__app__ prefix, so they match DOOR_WRITE_TOOLS.
  • Clause-② and metadata-protocol. Clause-②: no and Metadata-protocol: none are right for an eval-runner mode: no product package, no protocol and no authorable surface moves. No L2 is owed on that face.
  • Merges cleanly onto origin/main ec227fc7b1.
  • Check-runs at this head: 46 so far. None failed, and 13 are still running. I'll read them at the fixed head.

Owed after the fix

  • A delta L1 at the fixed head, once CI is green.
  • Landing, through the seat. After merge, the five-reps round is the maintainer's.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud

席位核对

L1 delta · ACCEPT · Head-sha: 91ba6cfc0ed232aea0ec5b9b03c1e8abea50ceba · card #34780 (Part of #34780) · delta 4e1b7624..91ba6cfc, answering 6986622506 · read 2026-11-18T18:17Z

What the delta changes

The delta is one commit touching two files, +5 / -2. No code or test moved.

  • M1 is fixed. The changeset's body now opens with its feat(scenarios): … title line, and the Clause-②: no / Metadata-protocol: none lines follow it, as on every changeset on main. Nothing else in the changeset changed.
  • S1 is done. The README's rules-arm section gains a sentence: a rules-arm record and recording hold the client's transcripts, which can quote rule text, so read them before filing either anywhere public.

Read at the head

  • The full L1 at 4e1b7624 (6986622506) stands for everything else: the client holds the door and nothing else, the token is never on argv or in the record, the person-equivalent publish is judged, the arms are strict, the replay is faithful, and no hosted text is in the diff.
  • Merges cleanly onto origin/main f2078e3674.
  • Check-runs at this head: 49 in total, all completed, none failed (33 success, 16 skipped).

Nit (does not block)

  • The PR body's Verification section still names 4e1b7624f1e. Only docs changed since then, and the area reports 1176/1176 at the new head, so this is a body-only line the seat can update when landing.

Not mine, still owed

  • Landing, through the seat. After merge, the five-reps round is the maintainer's.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL

Landing · 2026-11-18T18:18Z. Head 91ba6cfc0ed232aea0ec5b9b03c1e8abea50ceba (Part of #34780; the card stays open for the five-reps-per-arm round, a maintainer action after merge):

  • L1: full read REWORK 6986622506, then delta ACCEPT 6987493755 (M1 changeset title line first, S1 README line).
  • Contract review: not owed. The diff is packages/qa/scenarios plus one changeset, Clause-②: no, Metadata-protocol: none, with no spec or governed path.
  • Check-runs: 49, with 33 success, 16 skipped and 0 failed.
  • Shape: not governed, 17 files.
  • Body note: the Verification section names the first head 4e1b7624f1e; the delta since then is the changeset and README only, and the scenarios suite reads 1176/1176 at this head (6987441127).

Marked ready, and auto-merge is armed.

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

Development

Successfully merging this pull request may close these issues.

2 participants