Repository navigation
feat(scenarios): door mode builds a card through the MCP draft door with no project, in skill and rule arms - #35241
Conversation
Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
…gs, boot env Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL
…sal is a publish finding Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL
…our-mode refusal Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL
…s a door finding Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL
📓 Docs Drift CheckThis PR changes 1 package(s): 28 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 13 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. 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 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
|
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 full · REWORK (1 must-fix, small) · Head-sha: Net diff against merge base Must-fix
Should-fix (does not block)
Against the card
Read at the head
Owed after the fix
|
…rule text Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 delta · ACCEPT · Head-sha: What the delta changesThe delta is one commit touching two files, +5 / -2. No code or test moved.
Read at the head
Nit (does not block)
Not mine, still owed
|
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Landing · 2026-11-18T18:18Z. Head
Marked ready, and auto-merge is armed. |
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 个用例全绿。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 callmcp__app(plusSkillwhen given skills);Bash,Edit,WriteandNotebookEditare 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 packagecom.scenario.NAMESPACEin 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 answerpublishedis a finding naming each refused draft; the door answers a refusal on a 200, withoutcome: refusedunderdata. 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:--door-skills DIR, less--door-skill-omit, uses the--ask-skillsreader and its closed front-matter set.--door-rules FILEorOS_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'sCLAUDE.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.
summaryrefuses to sum two arms.Replay.
RecordedDriverre-sends a door turn's recordedsave_metadata_draft/delete_metadata_draftcalls 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:renderDoorRules;omitSkills;doorArmText.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 asCLAUDE.md; the record's arm; a scratch turn untouched by the arm.summaryrefuses mixing arms.test/runner/orchestrate.test.tsgains a top-levelrunCarddescribe for door mode (6 cases, on the file's existing fake harness):publishedwith no refused draft;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.mdunder "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/repNThen run
summary --mode door runs/door-ARMonce per arm.NOT MEASURED live. Nothing was run against a live
os dev:os dev -p PORT(canonical origin and token audience);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:
skills/directory with and without a named omission..claude/**) needs a line about door mode.door; door records are not exported to the gallery yet.Ablation (one-off, not a kept test):
publish.outcome !== 'published' ||clause and checked it against the refused-publish case. That run stayed green: the refused case also carriesfailed[], so it does not pin that clause.published_unregisteredcase, which publishes with no refused draft.expected [] to deeply equal [ Array(1) ]). The restore was proven: blob == HEAD andgit diff HEADwas empty.--replacementwas refused byablation-replacebefore 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 includestest/**):VERDICT command-exit 0.pnpm --workspace-concurrency=2 --filter '@objectstack/scenarios^...' build,VERDICT command-exit 0.test:repowas 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 --commandsderived 67 families against merge baseec227fc7b.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; andcheck:lean-entry-closure.--ranreconciliation: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.mjsbefore each push:VERDICT clean exit 0.Generated by Claude Code