Repository navigation
feat(scenarios): a scenario card carries a tier (control | starter | delivery); starter and delivery cards meet the gallery floor - #31091
Conversation
…delivery) Every card names a closed `tier`; the loader refuses a card without one. A `starter` or `delivery` card is held to the gallery floor, the countable lines of the library's mid-tier floor, each refused at the field that falls short. The three golden cases are `control`, the six mid-tier cards `starter`. Claude-Session: https://claude.ai/code/session_012MmDsRzowAnXEmogPGSEKA Co-authored-by: Claude <noreply@anthropic.com>
…and the library's tiers Claude-Session: https://claude.ai/code/session_012MmDsRzowAnXEmogPGSEKA Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check13 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 0 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 3b76eba7b64f0fcb06a84bd1ec044d175ce7f58c && git checkout 3b76eba7b64f0fcb06a84bd1ec044d175ce7f58c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 719a502b260616c5ffe62db3c3089f3f27e78622 58f8f32eba79008b9b1bb1453d38085caf9e966d && git checkout -B drift-repro 719a502b260616c5ffe62db3c3089f3f27e78622 && git merge --no-ff 58f8f32eba79008b9b1bb1453d38085caf9e966d
node scripts/docs-audit/affected-docs.mjs --json 719a502b260616c5ffe62db3c3089f3f27e78622 |
|
domain:devx#3 · os-lizheng · session_012MmDsRzowAnXEmogPGSEKA 席位核对 — ACCEPT · domain:devx#3 ·
|
Fixes #30970
Clause-②: no
Metadata-protocol: none
维护者速读
tier(control、starter、delivery三选一)。三张简单对照卡标为control,六张中等场景卡标为starter。加载器拒收没有tier的卡,也拒收低于「图库下限」的starter或delivery卡,逐条指出差在哪个字段。@objectstack/scenarios(不发布)和docs/qa/scenarios/下的九张卡与说明;不碰src/export/**与src/runner/**,导出器今天仍不读这个字段。回滚即整体 revert 本 PR。packages/qa/scenarios/src/loader.ts的GALLERY_FLOOR与checkGalleryFloor,以及 countsReason 规则对图库卡不再生效的那一处;②packages/qa/scenarios/src/schema.ts的tier字段;③packages/qa/scenarios/test/refusals.test.ts末尾的下限判别测试。pnpm --filter @objectstack/scenarios exec vitest run test/refusals.test.ts,预期全部通过;其中 "the gallery floor" 一组 13 条:恰在下限的 starter 与 delivery 卡加载通过,任一条低一格的卡恰好得到一条拒收。What changes
The field.
tieris a card-level key (outsideexpect, so the scorer's shape is untouched), a closed enumcontrol | starter | delivery, required on every card. A card without one is refused attierwith the closed set named; any other value is refused with zod's "expected one of".SCENARIO_TIERS,GALLERY_TIERS(starter,delivery) andisGalleryTierare exported fromsrc/schema.ts, so the exporter's filter can read the same set and does not need to spell it again.The floor. The loader holds a
starterordeliverycard toGALLERY_FLOOR(src/loader.ts). Each line it falls short of is its own refusal, at the field that falls short, and the refusal names the floor, the card's count and the fix (raise the card, or declare itcontrol):expect.objectsexpect.dashboardsrun.seedscoperun.personasrun.questionsrun.operationsrun.agentActionsdeliveryholds the same floor until the delivery-grade list sets its own. Acontrolcard has no floor. AcountsReasondoes not lower the floor on a gallery card. The default band's "state why in countsReason" refusal is therefore not raised on a gallery card, because it would tell the author to do something that cannot lift the refusal.Why these numbers, not the card's example. The card's example floor was at least 5 objects, 100 seed rows, 10 questions and 3 personas. The ruling makes the mid-tier cards the
startertier, anddocs/qa/scenarios/README.mdalready states the mid-tier floor those six cards meet. So the loader enforces the lines of that floor that can be counted from the card, and the library states one floor rather than two. The differences from the example:Moving any number is one constant and one README line.
Measured at objectstack@719a502b, before this change (the floor's lines per card):
crm_account_with_contactsinvoice_with_line_itemsproject_with_tasksasset_lifecycleleave_balancesorder_to_cashrequisition_to_receiptservice_desktravel_expenseThe card's own reading holds: the six measure 7 to 8 objects, 496 to 757 seed rows in total, 10 questions and 3 personas each.
The cards and the READMEs. The nine cards each gain one
"tier"line after"code"(a text insertion, so the compact seed rows keep their layout).docs/qa/scenarios/README.mdgains a Tiers section with the floor, and states that the exporter does not readtieryet and exports no card at all today (src/export/generic.ts). The package README names the floor on the loader's line.Not in this PR. The exporter's filter on
tier(#30349 owns it). The delivery-grade scenario list and any delivery-specific floor, which go to the maintainer for review first. The Chinese-UI requirement, which the maintainer withdrew: 「中文界面要求 不需要」.Tests
test/refusals.test.ts: two shape cases (notier; a tier outside the closed set). A top-leveldescribefor the floor raises the control card to exactly the floor on all seven lines and checks that it loads clean asstarterand asdelivery. Then one case per line lowers that line by one step and gets exactly one refusal, at the field that falls short. AcountsReasoncase shows the floor is not lowered. Adeliverycase shows the same floor applies. The motivating card (two objects, eight rows) declaredstarteris refused at exactly its four short lines.test/library.test.ts: the three controls, and only they, arecontrol.tier: starter.Acceptance notes
skip-changeset.@objectstack/scenariosisprivate: true, anddocs/qa/ships in no package, so nothing publishes. Earlier PRs on this package carried apatchchangeset; this one follows AGENTS.md's criterion instead.expect.dashboardsentry, because the card format has no way to state a report.Clause-②: noandMetadata-protocol: noneare copied from the claim. The card format is a private devx instrument with nopackages/specobligation, and no published consumer reads it (the CLI file that names the package only mentions it in a comment).Verification
All readings below are at head
58f8f32e, in objectstack-ai/objectstack.origin/mainwas still at the base719a502bwhen the gates ran.Package suite and typecheck
The first run, before this package's own
dist/existed, failed one suite (test/build/built-consumer.test.ts: "build @objectstack/scenarios first"), which is a prerequisite and not a regression. It went green after the package build above.Ablations (three behaviours, each mutated on disk with scripts/ablation-replace.mjs, then restored)
Tests import
../src/index.js, so asrc/mutation reaches the subject with no rebuild.Derived gates (node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands)
For the second, as a targeted reading only (not the gate):
require('packages/qa/scenarios/dist/index.cjs')loads, and it exportsSCENARIO_TIERS,GALLERY_TIERS,GALLERY_FLOORandisGalleryTier. CI runs both gates over a full build. CI check-runs had not concluded when this PR was opened.Generated by Claude Code