Skip to content

feat(scenarios)!: cards declare user-handle fields and persona records; seed dependence is decided per turn - #31275

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

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-kbxfnl

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #30914

Clause-②: yes (narrowing) — the published card schema (ScenarioCardSchema, . entry) gains run.userHandleFields and personas[].record; the loader refuses cards it loaded before (a scope rule ending on an undeclared field, a scoped persona naming no person); ./runner's seedDependence takes the loaded scenario and asks per turn.
Metadata-protocol: none
Skills-docs: none — no skill or docs page teaches the scenario card format; its own documentation, docs/qa/scenarios/README.md, is updated here.

维护者速读

  • 改了什么:场景卡片格式新增两项声明——run.userHandleFields(哪些种子字段的值是"用户句柄",如 account.owner = u_sam)与 personas[].record(有行范围的角色对应哪一条种子行,如员工 e06);加载器拒收"范围规则落在既非句柄、也非查找/选项/id 的字段上"以及"有范围却没指明是谁"的卡;跑测记录新增 seed.rewritten;种子行被应用拒收时,只把"预期答案因此改变"的那几轮问答记为未测,其余照常评分。
  • 为什么改:句柄字段原来靠推断,新卡可能被悄悄写错种子;一行被拒就整对象作废,遮掉了本可评分的结果(Scenario runner: the seed drops every owner-scoped row (handle left in the owner field; non-persona handles have no user), and the author loop never runs verify #30882 契约复审的 S1、S2);record 是维护者 2026-11-07 13:34 对 Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913 裁决的卡片格式那一半(S3)。
  • 风险与回滚:只动 @objectstack/scenarios(QA 工具包)与九张卡;九张卡全部照常加载,种子改写的字段集合与改前完全相同(account.owner、invoice.owner、task.assignee);私有覆盖目录里的卡若没有这两项声明会被拒收,补声明即可。回滚即 revert 本 PR。
  • 先看:packages/qa/scenarios/src/loader.ts(新拒收与 truthsOver)、packages/qa/scenarios/src/runner/orchestrate.ts(seedDependence 按轮判断)、docs/qa/scenarios/service_desk.json(三个角色的 record)。
  • 两分钟验证:pnpm --filter @objectstack/scenarios exec vitest run test/refusals.test.ts test/runner/units.test.ts,预期全绿;其中 ct4 用例显示 contacts_per_account 以 sdr 身份仍被评分。
  • 需要你做的:无,席位落地。

What changes

S2 — user-handle fields are declared.

  • run.userHandleFields: [{ object, field }] (optional, at least one entry) lists the seed fields whose text stands for a user. userHandleFields in src/runner/prompts.ts now reads this list and nothing else; it no longer infers a handle from "a direct scope field that is no lookup or select".
  • The loader refuses a persona scope rule whose last field (the last hop of a relation path) is not id, a declared lookup, a declared select or a declared handle field. It also refuses a handle declaration on the row id, a declared lookup, a declared select, an object the card does not seed, a field no seed row carries, and a duplicate.
  • The run record's seed.rewritten lists each object.field the seed loaded with a user id in place of the handle text (RunHalf.seed, src/runner/orchestrate.ts).
  • The three control cards declare their handle field. Before and after, measured over the nine cards: before (origin/main, inferred) crm_account_with_contacts:account.owner, invoice_with_line_items:invoice.owner, project_with_tasks:task.assignee; after (declared) the same three.

S1 — seed dependence per turn.

  • seedDependence(scenario, refused) keeps its row walk (the refused rows plus their children through the declared lookups), then computes every truth again over the seed less those rows with truthsOver (new in src/loader.ts, the loader's own resolver, row-scope test and withheld rule, factored out as seedReader and withholds). question(q, persona) is not measured only when that turn's expected answer changes, or is no longer defined (seed: its expected answer is not defined without …).
  • runHalf asks it per turn (inside the persona loop). Operations are unchanged.
  • The ct4 case: refusing contact ct4 on crm_account_with_contacts used to leave 5 turns not measured (contacts_per_account/sdr, unattached_contacts, best_covered_account, tech_contacts, contacts_by_industry); it now leaves 2 (unattached_contacts, contacts_by_industry, the two whose answer ct4 changes). contacts_per_account as sdr stays measured.

S3 — personas[].record = { object, id }.

  • Required on a persona with a scope, unless that persona is named by a direct scope rule on a declared handle field; optional on a global persona. The loader refuses a record naming no seeded row (including a row of an object the card does not seed). PERSON_USER_FIELD = 'user' fixes the person object's user field by name.
  • Filled on the six cards the ruling names: asset_lifecycle (employee e06, dept_manager e05), leave_balances (e07, e05), order_to_cash (e03, e01), requisition_to_receipt (e02, e13), travel_expense (e02, e01), service_desk (agent a02, agent a04, customer cus_03). Each id is the one the persona's role already names.
  • Format and loader only: the runner does not read record (Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913's half).

Namespacing and docs. namespacedScenario (src/runner/namespace.ts) prefixes the object of each handle declaration and each record. docs/qa/scenarios/README.md documents both declarations and the new refusals; the package README documents per-turn dependence and seed.rewritten. One patch changeset.

Tests

  • test/refusals.test.ts: 12 new refusal pins (one refusal each, exact path) and two controls: a scoped persona naming its record (and a global persona naming one) loads clean; deleting run.userHandleFields from the crm card refuses both of sdr's scope rules and its missing person. The gallery-floor fixture now scopes its second persona on a declared select and names its record.
  • test/runner/units.test.ts: userHandleFields reads the declaration (a card declaring none has none); across the nine cards the handle set is the three fields and every record is pinned; seedDependence per turn on the ac1 case, the ct4 case and a truth the rest of the seed no longer defines.
  • test/runner/orchestrate.test.ts: seed.rewritten in the record; the ct4 run (7/7 measured, 2 not measured; the driver is asked contacts_per_account as sdr); the all-accounts-refused run keeps the three turns no account feeds, and a half with every turn not measured is still not-run.

Ablations, each through scripts/ablation-replace.mjs on committed HEAD 33a20989: mutation landed (anchor 1 → 0, replacement 0 → 1, blob changed), suite red, restored to the HEAD blob; git diff HEAD empty after all legs. The tests import src/ directly (no dist/ in the path), so no rebuild leg.

Leg Mutation Red
A1 scope rule ending on an undeclared field not refused 2 failed (the refusal pin; the no-declaration test)
A2 handle declared on a lookup, select or id not refused 3 failed (the three pins)
A3 handle on an unseeded object not refused 1 failed
A4 handle field no seed row carries not refused (checkField call deleted) 1 failed
A5 duplicate handle declaration not refused 1 failed
A6 record naming no seeded row not refused 2 failed (row missing; object unseeded)
A7 scoped persona with no person not refused 2 failed (the pin; the no-declaration test)
A8 per-turn comparison removed (every turn on an out row not measured) 4 failed (both runCard dependence tests, both units dependence tests)
A9 seed.rewritten not recorded 2 failed (both seed-record pins)

Acceptance notes

Verification

  • Heads: code and tests at 33a20989; 4b4df50a adds one sentence to the changeset only. The derived loop started on 33a20989; the changeset-reading gates were run again on 4b4df50a (below). Base bdefd49f; origin/main has moved two commits since, neither in packages/qa/scenarios.
  • pnpm --filter @objectstack/scenarios exec vitest run: Test Files 28/28, Tests 571/571 (after pnpm --filter '@objectstack/scenarios^...' build, VERDICT command-exit 0, and the package's own build, which test/build/* read).
  • pnpm --filter @objectstack/scenarios typecheck (tsc --noEmit, its program includes test/**): exit 0.
  • node --stack-size=4000 node_modules/eslint/bin/eslint.js packages/qa/scenarios --no-inline-config (the root pnpm lint, scoped; the package has no lint script): exit 0.
  • On 4b4df50a: check-changeset-no-major.mjs --base origin/main with this body as the event: exit 0 ("yes (narrowing) and metadata-protocol none … a non-protocol change at patch"); check-adr-0087-registration.mjs --base origin/main: exit 0 (the no-migration-prescription disposition read); check-empty-changeset.mjs --base origin/main: exit 0; check-partof-closing-keyword.mjs with PR_BODY set to this body: exit 0.
  • Not measured: a live model run (paused by the maintainer) and a recorded-driver replay (no recording in this container); the per-turn rule is pinned on the real crm card through the fake-app runCard tests instead.
Derived gates (dispatch-gates --commands, 62 commands)
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
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-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.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/ci/snapshot-next.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
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: 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:dispatcher-error-vocabulary :: 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
  • dispatch-gates --ran: "62 derived famil(ies) accounted for — 61 run, 1 NOT-MEASURED".
  • NOT MEASURED: pnpm check:dual-build-cjs-loads, exit 3 PREREQUISITE NOT MET (it loads every package's dist/; only the scenarios closure was built). CI's lint job runs it on a full build.
  • check-plugin-teardown-shape.mjs --self-test answered exit 3 on the shallow clone until git fetch --depth=1 origin 621a4876…; rerun exit 0 (recorded above as the rerun).
  • check:type-check-debt re-measured under the lock (414 s): "0 raw tsc error(s) total, none above its recorded number".
Gates outside the derived set: the artifact-roster and declared-wide families (47 commands)
node scripts/check-closing-target-claim.mjs :: exit 2
node scripts/check-partof-closing-keyword.mjs :: exit 2
node scripts/check-platform-checklist-watchdog.mjs :: exit 0
node scripts/check-published-list-mirrors.mjs :: exit 0
node scripts/check-single-claim-paths.mjs :: exit 2
node scripts/check-skills-token-ratchet.mjs :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --toolchain-needed :: exit 0
node scripts/pm/check-governed-queue-guard.mjs :: exit 1
pnpm --filter @objectstack/spec run check:error-code-provenance :: exit 0
pnpm --filter @objectstack/spec run check:meta-url-spelling :: exit 0
pnpm --filter @objectstack/spec run check:react-blocks :: exit 0
pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0
pnpm check:auth-mount-ledger :: exit 0
pnpm check:authz-resolver :: exit 0
pnpm check:changeset-fixed :: exit 0
pnpm check:cli-examples-parity :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:error-code-casing :: exit 0
pnpm check:error-status-conformance :: exit 0
pnpm check:facade-delegation-only :: exit 0
pnpm check:filter-alias-parity :: exit 0
pnpm check:future-spec-major :: exit 0
pnpm check:i18n-stale-fill :: exit 0
pnpm check:init-service-contract :: exit 0
pnpm check:live-db-isolation :: exit 0
pnpm check:meta-type-normalized :: exit 0
pnpm check:object-def-param-keys :: exit 0
pnpm check:optional-error-sink :: exit 0
pnpm check:overlay-whitelist-table :: exit 0
pnpm check:pm-governed-prose :: exit 0
pnpm check:pm-label-desc-cap :: exit 0
pnpm check:pm-settings-deny-roster :: exit 0
pnpm check:published-readme-exports :: exit 0
pnpm check:resume-authority-declared :: exit 0
pnpm check:route-envelope :: exit 0
pnpm check:route-ledger-census :: exit 0
pnpm check:runner-env-posture :: exit 0
pnpm check:scaffold-emission-policy :: exit 0
pnpm check:select-gate-families :: exit 0
pnpm check:select-shard-packages :: exit 0
pnpm check:settings-bind-window :: exit 0
pnpm check:skill-top-level-keys :: exit 0
pnpm check:stack-collection-maps :: exit 0
pnpm check:startup-registry-verdict :: exit 0
pnpm check:tenant-chokepoint :: exit 0
pnpm check:verify-stand-in :: exit 0
pnpm check:wildcard-fallthrough :: exit 0
  • The four non-zero rows judge a pull request, not the tree, and refuse without its context (exit 2 "handed no pull request", exit 1 for the event file): NOT MEASURED locally, read from this PR's check-runs. check-partof-closing-keyword.mjs with PR_BODY answered exit 0 (above).
  • pnpm --filter @objectstack/spec run check:error-code-provenance is among them, exit 0: the diff adds no error-code constant.

Every CI family is read from this PR's check-runs, not re-run here.


Generated by Claude Code

…; seed dependence is decided per turn

A scenario card now says which seed fields hold a user handle
(run.userHandleFields) and which seed row each scoped persona is
(personas[].record). userHandleFields reads the declaration instead of
inferring it, and the loader refuses a scope rule ending on a field that is
no declared handle, lookup, select or id, a scoped persona naming no person,
and a record naming no seed row. The run record lists the fields the seed
rewrote (seed.rewritten).

A refused seed row now takes out only the question turns whose expected
answer changes once it and its children are gone: the runner recomputes each
truth over the rest of the seed with the loader's own rules (truthsOver).

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

16 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
  • 4 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 ea62933c2239b4c35b675f6af7d6812e01173edc → packageMentionDocs.

Which tree this was computed on

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

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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4b4df50a303cf4dee4ff4d14a070bd6b22b5179c
Local-runs: none
Scope: packages/qa/scenarios/src/schema.ts, packages/qa/scenarios/src/loader.ts, packages/qa/scenarios/src/runner/orchestrate.ts, packages/qa/scenarios/src/runner/prompts.ts, packages/qa/scenarios/src/runner/namespace.ts, packages/qa/scenarios/test/refusals.test.ts, packages/qa/scenarios/test/runner/units.test.ts, packages/qa/scenarios/test/runner/orchestrate.test.ts, docs/qa/scenarios/asset_lifecycle.json, docs/qa/scenarios/crm_account_with_contacts.json, docs/qa/scenarios/invoice_with_line_items.json, docs/qa/scenarios/leave_balances.json, docs/qa/scenarios/order_to_cash.json, docs/qa/scenarios/project_with_tasks.json, docs/qa/scenarios/requisition_to_receipt.json, docs/qa/scenarios/service_desk.json, docs/qa/scenarios/travel_expense.json, docs/qa/scenarios/README.md, packages/qa/scenarios/README.md, .changeset/30914-scenario-card-person-fields.md + packages/qa/scenarios/src/index.ts, packages/qa/scenarios/src/runner/index.ts, packages/qa/scenarios/tsup.config.ts, packages/qa/scenarios/package.json, packages/qa/scenarios/src/export/record.ts, packages/qa/scenarios/src/runner/scorecard.ts

Face: narrowing. reviewFace returns no path hit for the 20 files (record-recognisers --template --paths says the paths decide no face and the changeset's Clause-②: line decides); the changeset and PR body both carry Clause-②: yes (narrowing), which the recogniser reads as the narrowing face. @objectstack/scenarios is published since PR #31221 and its . entry (src/index.ts) re-exports schema.ts and loader.ts, so the card schema and the loader's accept set are published; ./runner (src/runner/index.ts) re-exports orchestrate.ts, prompts.ts and namespace.ts. Read against main at the head's check-run time: base bdefd49f, PR base ref ea62933c.

① Derived judgments

  • S2, handle fields declared (schema.ts, loader.ts, prompts.ts) — right. run.userHandleFields: FieldRef[], optional, min(1), on the published ScenarioCardSchema. userHandleFields in prompts.ts is now one line over the declaration and infers nothing (main's version walked every direct scope rule not in lookups/selects). The loader refuses, each with a named path and reason: a scope rule whose terminal field is none of id, a declared lookup, a declared select or a declared handle (checkPath returns the hop list, the last pair is the terminal field, so contact.account.owner is judged as account.owner and account.owner.team as employee.team); and a handle declaration on the row id, a declared lookup, a declared select, an unseeded or unexpected object, a field no seed row carries (checkField), or a duplicate (duplicates). The handle block runs before the persona loop, so the scope check reads the full validated set. Twelve refusal pins plus the delete-the-declaration control pin each arm.
  • Handle set before and after — right. Read off the nine head cards: main's inference rule (direct scope field, not id, not a declared lookup or select) yields account.owner on crm, invoice.owner on invoice, task.assignee on project and nothing on the other six; the declared set is exactly the same three. The units test loads the nine cards from docs/qa/scenarios with zero refusals and pins the three, and Test Core is green on this head.
  • S3, personas[].record = { object, id } (schema.ts, loader.ts) — right, including when it is required. The S3 ruling (6707631426) says required for a persona with a scope, optional for a global one, refused when it names no seed row. Read alone, that would refuse the three control cards, whose scoped personas are users with no person row. The Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913 ruling (6707625367, Q1 = A′ item 5) keeps the userHandleFields route for crm, invoice and project so both models coexist. The dev's rule, required unless a direct scope rule on a declared handle field names the persona, is the only reading under which items 1 and 5 both hold, and on the nine cards it carves out exactly the three controls. The refusal for a record naming no seeded row reads the loader's ids map (seeded row ids per object), so an unseeded object fails the same way; both are pinned. PERSON_USER_FIELD = 'user' matches the ruling's "fixed by name, not chosen per card"; the runner does not read record, which is Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913's half as the ruling orders. Observation, no fix: the exemption does not check that the direct rule's value is this persona's own handle; today personaHandles binds every direct-scope string value to its persona, so it holds by construction.
  • Six cards filled — right. asset_lifecycle employee e06 / dept_manager e05, leave_balances e07 / e05, order_to_cash e03 / e01, requisition_to_receipt e02 / e13, travel_expense e02 / e01, service_desk a02 / a04 / cus_03. Each id is the one the persona's role string already names, and each is a seeded row (the loader would have refused otherwise). Every scoped persona across the nine cards now names a person by record or by a direct handle rule; no global persona was given one, which the ruling leaves optional.
  • Run record seed.rewritten (orchestrate.ts RunHalf.seed, seedApp) — right. Set only inside the user-handle branch, as sorted unique object.field of the namespaced card; pinned in two orchestrate tests (democrm_account.owner). The export side's RunHalfSchema in src/export/record.ts is a z.looseObject that does not model seed, so the new key passes through.
  • S1, per-turn seedDependence (loader.ts truthsOver, orchestrate.ts) — right. truthsOver(card, seed) factors the loader's own resolver, in-scope test and withheld rule (seedReader, withholds, truthReads) and computes every truth over a given seed, with a TruthError read as "not defined" rather than refused. seedDependence(scenario, refused) keeps the row walk, computes the truths once over the seed less the out rows, and question(q, persona) compares that turn's truth to the loaded one with JSON.stringify; both sides come from the same evaluateTruth and the same { kind: 'withheld' } literal, so key order is stable. runHalf asks it inside the persona loop. The reason text is new; nothing downstream parses it (scorecard.ts only tests presence, record.ts types it as a string). ct4 pin: units test and orchestrate test both show contacts_per_account/sdr measured and only unattached_contacts and contacts_by_industry out; the all-accounts-refused run keeps the three turns no account feeds, and the "not defined" arm (avg over no rows) is pinned.
  • Exports through . and ./runner — right, and named. Added through .: truthsOver (loader) and PERSON_USER_FIELD (schema); the ScenarioCard type widens by two optional keys. Through ./runner: seedDependence changes its signature (LoadedScenario in place of the card; question(q, persona)), RunHalf.seed gains rewritten, userHandleFields keeps its signature with declared-only semantics. Nothing is removed or renamed. The changeset names the signature change and tells seedDependence callers what moves.
  • namespace.ts, 6 lines outside the claimed surface — right and necessary. Without the two spreads the namespaced card keeps bare object names in userHandleFields[].object and record.object, so userHandleFields answers account.owner while the seed loop iterates democrm_account: the handle rewrite would silently stop for every run. The orchestrate test's rewritten: ['democrm_account.owner'] depends on it.
  • Docs — right. docs/qa/scenarios/README.md row 4 and the Personas section state both declarations and every new refusal; the package README states per-turn dependence, truthsOver and seed.rewritten.

② Semver level

patch is correct. Ruling A in check-changeset-no-major.mjs decouples the level from Clause-②: Metadata-protocol: none means every introduced entry is patch, full stop, and a minor beside none is refused. No platform schema key moves, the card format is QA tooling, so none is the right protocol line and the ADR-0087 not-required (no-migration-prescription) disposition is in the changeset. The BREAKING banner is present and names the loader's accept-set narrowing, which the (narrowing) arm requires. Clause-②: yes (narrowing) is the right spelling for this diff: yes because a published schema and two published entries widen (two optional keys, truthsOver, PERSON_USER_FIELD), the (narrowing) arm because the loader refuses cards it accepted before and ./runner's seedDependence breaks at compile time for a caller; record-recognisers documents yes (narrowing) as owing the narrowing face. Check Changeset is green on this head.

③ Boundary flags

  • Deviation 1, namespace.ts outside the claimed surface. Answered: necessary, 6 lines, named in the PR body and here in ①. No escalation.
  • Deviation 2, pr_create sent no labels or assignees. Not a contract matter; the seat applies labels at landing. No escalation.
  • Deviation 3, gate loop on 33a20989, changeset gates and the dogfood battery re-run on 4b4df50a. The two heads differ by one sentence in the changeset (4b4df50a is a changeset-only commit), and the check-runs on 4b4df50a are the gate verdicts: 48 check-runs, 35 success, 13 skipped, 0 failure, including Test Core with its 8 shards, Lint & Repo Gates (which runs the one locally not-measured check:dual-build-cjs-loads), Check Changeset, Type Check · workspace, PR-body guards and Governed Surface Queue Guard. Answered.
  • Report and PR-body claim "origin/main has moved two commits since, neither in packages/qa/scenarios" — stale, harmless; should-fix the wording or merge origin/main before landing. main is 9 commits past base bdefd49f, and one, d3b6ff43 (feat(scenarios): run-scenarios --driver codex and --driver external:COMMAND, with the driver on each gallery app page #31265, codex and external drivers), lands in packages/qa/scenarios: runner/cli.ts, runner/driver.ts, runner/transcript.ts, runner/index.ts, export/record.ts, export/exporter.ts, the package README. It merged at 21:08Z; this PR opened at 21:24Z and its check-runs started 21:24 to 21:38Z, so CI judged a merge that already held it, GitHub reports mergeable: true, clean, and none of those files reads seedDependence, question, userHandleFields or RunHalf.seed (the record schema is loose). The serial note on 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.ts, cli.ts) holds: this PR touches neither.
  • Live model run and recorded replay not measured (maintainer pause; no recording in the container). The per-turn rule is pinned on the real crm card through the fake-app runCard tests. Accepted as stated.
  • No open questions, no security findings, no out-of-scope findings in the report.

④ Design judgment

  • Loud at authoring time. Every new acceptance condition is a load-time refusal with an exact path and a message that names the remedy (list it in run.userHandleFields when the value is a handle … or declare it in expect.lookups or expect.selectFields; add record: { object, id } … or scope it by a direct rule on a declared user-handle field). Nothing is tolerated and corrected at run time: userHandleFields cannot answer a field the card did not declare, and a card with a scope rule on an undeclared text field, the exact mis-seed S2 names, is refused before any build. Deleting the crm declaration produces three refusals, two on the scope rules and one on the missing person, which is the right amount of noise.
  • Structurally harder to get wrong for an AI-authored card. A card must now say, in the card, what each scope value names, and the loader cross-checks the claim against the seed (the field exists, is not a row id, lookup or select, is not declared twice) and against the personas (a scoped persona is a seed row or a handle). The strictObject on record refuses stray keys. The one remaining inference, which persona a handle text belongs to, stays as it was and is Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913's half.
  • The narrowing against the published spec on main. It takes away exactly the tolerated inference, not a declared capability: every card that loaded on main with a declared meaning still loads, and the nine open cards load unchanged with the same three rewritten fields. The per-turn dependence rule removes an over-wide not-measured, grades more of what the run can grade, and never grades a turn whose truth the refused row moved, so it cannot produce a new false fail.
  • Nothing speculative beyond the card's asks. truthsOver is the mechanism S1 asks for ("re-evaluating each question's truth over the seed minus the out rows") and is factored from the loader rather than duplicated; PERSON_USER_FIELD is the ruling's "fixed by name" made a constant for Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913 to read; the namespace change is a consequence, not a feature. The terminal-field reading of a path rule is a judgment call the PR states; the alternative (direct rules only) would leave a path ending on an undeclared field to inference, which S2 exists to remove, so the stricter reading is the right one.

Implemented-by: claude/project-thread-kbxfnl
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 4b4df50a303cf4dee4ff4d14a070bd6b22b5179c · card #30914 · report 6713604153 · contract review 6713691120 (PASS, CONTRACT_REVIEW_TIER, narrowing face).

  • Shape: draft → main, Fixes #30914; 20 files, +425/-89, inside the claim's surface plus src/runner/namespace.ts (6 lines, accepted: the namespaced card has to prefix the new object refs). check-governed-merges --pr 31275: NOT governed.
  • S2 (handle fields declared): the card format declares its person-handle fields and userHandleFields reads the declaration instead of inferring it. Seven new loader refusals have named remedies. On all nine cards the declared set equals what main inferred: account.owner, invoice.owner, task.assignee. The run record carries seed.rewritten.
  • S1 (dependence per turn): seedDependence re-evaluates each question's truth over the seed minus the refused rows (truthsOver). The ct4 case on crm_account_with_contacts is pinned: contacts_per_account as sdr stays measured.
  • S3 (personas[].record): required for a scoped persona unless a direct scope rule on a declared handle field names it (the three control cards). The review confirms this is the only reading that squares the ruling with Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913 item 5. It is filled on the six named cards, and the ids match each persona's role. The runner does not use it yet (Scenario runner: the seed sets owner_id from scope values that are not person handles (service_desk owns public comments by the portal user) #30913's half).
  • Gates: check-runs on this head: 35 success, 13 skipped, 0 failed, 0 pending, including all eight Test Core shards and Check Changeset. The full dogfood command exited 0.
  • Changeset: patch, Clause-②: yes (narrowing), Metadata-protocol: none, with a BREAKING banner. That is right for a published card schema that both widens and narrows.
  • Accepted as noted: the PR body says origin/main moved two commits, none in packages/qa/scenarios. That is now stale, because feat(scenarios): run-scenarios --driver codex and --driver external:COMMAND, with the driver on each gallery app page #31265 (merged 21:26Z) touched the runner, export and README. GitHub reports the PR clean, none of those files reads seedDependence, userHandleFields or the seed half, and the merge queue re-tests on current main. Not sent back.
  • 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/l 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.

Scenario cards: declare which scope fields hold a person handle, and drop only the turns a refused seed row actually feeds

1 participant