Skip to content

Commit ddd646d

Browse files
feat(scenarios): a scenario card carries a tier (control | starter | delivery); starter and delivery cards meet the gallery floor (#31091)
Fixes #30970 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:每张场景卡新增必填字段 `tier`(`control`、`starter`、`delivery` 三选一)。三张简单对照卡标为 `control`,六张中等场景卡标为 `starter`。加载器拒收没有 `tier` 的卡,也拒收低于「图库下限」的 `starter` 或 `delivery` 卡,逐条指出差在哪个字段。 - 为什么改:按维护者裁决「我接受你的建议」,对照卡只做内部质量检查,永不导出或展示;中等卡作为图库的入门模板。此前卡片上没有任何字段区分两者,导出器将来可能把只有 2 个对象、8 行数据的对照应用当成产品发布。 - 风险与回滚:只改私有包 `@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.** `tier` is a card-level key (outside `expect`, so the scorer's shape is untouched), a closed enum `control | starter | delivery`, required on every card. A card without one is refused at `tier` with the closed set named; any other value is refused with zod's "expected one of". `SCENARIO_TIERS`, `GALLERY_TIERS` (`starter`, `delivery`) and `isGalleryTier` are exported from `src/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 `starter` or `delivery` card to `GALLERY_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 it `control`): | Line | Floor | Refused at | |:---|:---|:---| | expected objects | at least 5 | `expect.objects` | | expected dashboards | at least 1 | `expect.dashboards` | | rows on the largest seeded object | at least 100 | `run.seed` | | personas with a row `scope` | at least 2 | `run.personas` | | questions | at least 8 | `run.questions` | | operations | at least 4 | `run.operations` | | agent actions | at least 3 | `run.agentActions` | `delivery` holds the same floor until the delivery-grade list sets its own. A `control` card has no floor. A `countsReason` does 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 `starter` tier, and `docs/qa/scenarios/README.md` already 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: - 8 questions, not 10: the README's band is 8 to 10. - At least 2 row-scoped personas instead of 3 personas: the README asks for 2 or 3 roles with a row scope. - 100 rows on one object rather than 100 across the seed: the README asks for 100 on the main object. - Dashboard, operation and agent-action lines added, because the README floor states them too. Moving any number is one constant and one README line. Measured at objectstack@719a502b, before this change (the floor's lines per card): | Card | Tier | Objects | Dashboards | Largest object | Scoped personas | Questions | Operations | Agent actions | |:---|:---|---:|---:|---:|---:|---:|---:|---:| | `crm_account_with_contacts` | control | 2 | 0 | 5 | 1 | 8 | 5 | 3 | | `invoice_with_line_items` | control | 3 | 0 | 5 | 1 | 9 | 5 | 3 | | `project_with_tasks` | control | 2 | 0 | 6 | 1 | 8 | 5 | 3 | | `asset_lifecycle` | starter | 8 | 1 | 297 | 2 | 10 | 6 | 6 | | `leave_balances` | starter | 7 | 1 | 307 | 2 | 10 | 6 | 4 | | `order_to_cash` | starter | 8 | 1 | 240 | 2 | 10 | 6 | 5 | | `requisition_to_receipt` | starter | 8 | 1 | 184 | 2 | 10 | 6 | 5 | | `service_desk` | starter | 8 | 1 | 249 | 3 | 10 | 6 | 4 | | `travel_expense` | starter | 7 | 1 | 280 | 2 | 10 | 6 | 4 | The 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.md` gains a Tiers section with the floor, and states that the exporter does not read `tier` yet 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 (no `tier`; a tier outside the closed set). A top-level `describe` for the floor raises the control card to exactly the floor on all seven lines and checks that it loads clean as `starter` and as `delivery`. Then one case per line lowers that line by one step and gets exactly one refusal, at the field that falls short. A `countsReason` case shows the floor is not lowered. A `delivery` case shows the same floor applies. The motivating card (two objects, eight rows) declared `starter` is refused at exactly its four short lines. - `test/library.test.ts`: the three controls, and only they, are `control`. - Each mid-tier card's "meets the mid-tier floor" test now also pins `tier: starter`. ## Acceptance notes - **Changeset: `skip-changeset`.** `@objectstack/scenarios` is `private: true`, and `docs/qa/` ships in no package, so nothing publishes. Earlier PRs on this package carried a `patch` changeset; this one follows AGENTS.md's criterion instead. - The README's mid-tier floor also says "an approval or automation flow", "a seed spanning three months", a question and operation mix, and "declarative first". None of these can be counted from the card. They stay as authoring guidance, pinned in each card's own test. - The README's line "at least one report or dashboard" is enforced as one `expect.dashboards` entry, because the card format has no way to state a report. - The six per-card floor tests now overlap the loader's countable lines. I kept them because they also pin the lines that cannot be counted. - Existing wording slip, not touched: "How truth is computed" says the computed truth "has one of three shapes", then lists five. - `Clause-②: no` and `Metadata-protocol: none` are copied from the claim. The card format is a private devx instrument with no `packages/spec` obligation, 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/main` was still at the base `719a502b` when the gates ran. <details><summary>Package suite and typecheck</summary> ```text pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios test check-dts-emitted: @objectstack/scenarios - 10/10 declared declaration file(s) present. Test Files 23 passed (23) Tests 357 passed (357) os-verify-lock: VERDICT command-exit 0 pnpm --filter @objectstack/scenarios typecheck (tsc --noEmit) -> VERDICT command-exit 0 tsc --listFiles counts test/refusals.test.ts, test/library.test.ts, test/travel-expense.test.ts: 3 of 3 ``` 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. </details> <details><summary>Ablations (three behaviours, each mutated on disk with scripts/ablation-replace.mjs, then restored)</summary> Tests import `../src/index.js`, so a `src/` mutation reaches the subject with no rebuild. ```text A1 loader.ts: `if (gallery) checkGalleryFloor(...)` -> `if (gallery && false) ...` anchor 1 -> 0, blob 457c98e -> 2824a0caf452 test/refusals.test.ts: Tests 10 failed | 63 passed (73) -- every floor case red; the at-floor controls stay green restored: blob == HEAD (457c98e), `git diff HEAD` empty A2 schema.ts: `tier: ScenarioTierSchema,` -> `tier: ScenarioTierSchema.optional(),` anchor 1 -> 0, blob c50b65e -> 89135e96ed87 Tests 1 failed | 72 passed (73) -- "refuses a card with no tier" restored: blob == HEAD (c50b65e), `git diff HEAD` empty A3 loader.ts: band rule no longer skipped for gallery cards anchor 1 -> 0, blob 457c98e -> ca8f95cfa6b5 Tests 2 failed | 71 passed (73) -- "7 questions", "3 operations": expected length 1 but got 2 (more diagnostics, the predicted direction) restored: blob == HEAD (457c98e), `git diff HEAD` empty After all three: git status --porcelain is empty; both files hash to their HEAD blob. ``` </details> <details><summary>Derived gates (node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands)</summary> ```text 52 command(s) derived from 21 changed path(s), 289 changed lines (+280 / -9) 50 exit 0 2 exit 3 (PREREQUISITE NOT MET, read as NOT MEASURED): node scripts/check-plugin-teardown-shape.mjs --self-test -- its positive control is pinned to a commit a shallow clone cannot reach (checker-health only) pnpm check:dual-build-cjs-loads -- reads every package's dist/; this tree built only this package's closure dispatch-gates --ran: 52 derived famil(ies) accounted for, 50 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3), 0 UNRUN ``` For the second, as a targeted reading only (not the gate): `require('packages/qa/scenarios/dist/index.cjs')` loads, and it exports `SCENARIO_TIERS`, `GALLERY_TIERS`, `GALLERY_FLOOR` and `isGalleryTier`. CI runs both gates over a full build. CI check-runs had not concluded when this PR was opened. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_012MmDsRzowAnXEmogPGSEKA)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 51992df commit ddd646d

21 files changed

Lines changed: 280 additions & 9 deletions

‎docs/qa/scenarios/README.md‎

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,42 @@ question's computed truth; a card that does not load is red in CI.
3636
| 5 | `run.operations`, `run.guardrails`, `run.agentActions?` | At least two writes, each acting as a persona and declaring its `outcome`; the five guardrail checks; optionally the agent-callable business actions. |
3737
| 6 | `iterate` | A one-sentence change request plus the `expectDelta` it should add to `expect`. |
3838

39-
Besides the layers a card carries `id` (its basename), `code`, `title`, `provenance` (where the
39+
Besides the layers a card carries `id` (its basename), `code`, `tier` (what the card is for,
40+
[below](#tiers)), `title`, `provenance` (where the
4041
scenario comes from) and, when a question uses a time window, `asOf`: the fixed "today"
4142
(`YYYY-MM-DD`) windows are computed against. `code` is the app code: 2–8 lowercase letters,
4243
unique across the library. The app lives in the namespace `demo` + code (`democrm`) wherever
4344
it is built, scored or exported, and every item it declares carries that prefix.
4445

4546
**Counts.** The default band is 8–10 questions and 4–6 operations. A card below 8 questions
46-
or 4 operations states why in `run.countsReason`, or it is refused.
47+
or 4 operations states why in `run.countsReason`, or it is refused; a `starter` or `delivery`
48+
card has no such excuse ([Tiers](#tiers)).
4749

4850
Every object in a card is strict: an unknown key is refused, never dropped.
4951

52+
## Tiers
53+
54+
Every card names its `tier`, a closed set; a card without one is refused.
55+
56+
| `tier` | What the card is | Floor |
57+
|:---|:---|:---|
58+
| `control` | An internal quality check: one of the small golden cases. Never exported, never shown in the gallery, whatever it scores. | none |
59+
| `starter` | A gallery starter template: the mid-tier scenarios. | the gallery floor |
60+
| `delivery` | A delivery-grade scenario. | the gallery floor, until the delivery-grade list sets its own |
61+
62+
The **gallery floor** is the countable part of the [mid-tier floor](#the-library). The loader
63+
refuses a `starter` or `delivery` card under any line of it, at the field that falls short:
64+
65+
- at least 5 objects in `expect.objects`, and at least 1 in `expect.dashboards`;
66+
- at least 100 seed rows on one object;
67+
- at least 2 personas with a row `scope`;
68+
- at least 8 questions and 4 operations: the default band's lower edge, which a
69+
`countsReason` does not lower on a gallery card;
70+
- at least 3 `run.agentActions`.
71+
72+
The gallery exporter's filter on `tier` is a change of its own: until it lands the exporter
73+
reads no tier, and it exports no card at all (`packages/qa/scenarios/src/export/generic.ts`).
74+
5075
## Seed rows
5176

5277
`run.seed` maps each expected object to its rows. Every row has a string `id`; the other
@@ -138,16 +163,17 @@ card states the bad write in full in `values` (and `target`), exactly as the app
138163

139164
## The library
140165

141-
The library holds nine scenarios. The three **simple controls** are here:
166+
The library holds nine scenarios. The three **simple controls**, tier `control`, are here:
142167
`invoice_with_line_items`, `project_with_tasks` and `crm_account_with_contacts`, the golden
143168
cases of `packages/cli/src/lint/corpus.ts`. Their `expect` is derived mechanically from each
144169
fixture: every object; `minFieldsPerObject` = the smallest object's field count; one
145170
`selectFields` row per select field with `minOptions` = its option count; one `lookups` row
146171
per lookup or master_detail field.
147172

148173
The six **mid-tier** scenarios — travel expense, order-to-cash, service desk, leave and
149-
balances, requisition-to-receipt, asset lifecycle — each land as a card of their own and
150-
meet this floor:
174+
balances, requisition-to-receipt, asset lifecycle — each land as a card of their own, tier
175+
`starter`, and meet this floor. Its countable lines are the [gallery floor](#tiers), which
176+
the loader enforces; each card's own test pins the rest:
151177

152178
- 5–8 related objects, at least one approval or automation flow, and at least one report
153179
or dashboard;
@@ -164,7 +190,9 @@ meet this floor:
164190

165191
## Adding a card
166192

167-
1. Write `<id>.json` here; `id` equals the basename, and `code` is one no other card uses.
193+
1. Write `<id>.json` here; `id` equals the basename, `code` is one no other card uses, and
194+
`tier` says what the card is for. A new gallery card is `starter` and meets the gallery
195+
floor; `control` is kept for the golden cases, which `test/library.test.ts` pins.
168196
2. Keep it generic — a scenario anyone could write from the domain alone.
169197
3. Run `pnpm --filter @objectstack/scenarios test`: a refusal names the file and the field
170198
path. Then pin the card's hand-worked truths, per persona too, in its own

‎docs/qa/scenarios/asset_lifecycle.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$comment": "Seed rule (so every truth can be worked by hand): asset i = 1..120 has category by i mod 4 (1 laptop 7200 over 36 months, 2 monitor 1800 over 60, 3 phone 4800 over 24, 0 chair 2400 over 120; straight line, no salvage, so 200 / 30 / 200 / 20 a month), department by ((i-1) mod 16) div 4 (Engineering, Sales, Operations, Finance), and was bought on 2026-06..09 day ((i-1) mod 30)+1 (i 1-30 June, 31-60 July, 61-90 August, 91-120 September). Assets 1-64 were issued on their purchase day as kits to e(4*dept + (i-1) div 16 + 1); 65-120 are the pool. Repairs: kit assets i mod 6 = 3 were reported 40 days after purchase and completed 6 days later at 10*i + 500 (phones) or 10*i + 300 (laptops); a009 and a021 broke again 20 days after the fix (900 and 400); kit assets i mod 11 = 8 are in repair since 2026-10-(i div 3), open when i is odd, in_progress when even. A repair returns the asset's open checkout as damaged; a completed repair re-issues it to the same holder. Loaners: pool laptop i = 65 + 4k (k 0-13) was lent to e(k+1) on 2026-10-(k+1), due 21 days later, and returned in good condition after 14 days when k mod 3 = 0. The seven scrap requests are listed in full; each one's approver is the manager of the asset's department, and after a043 was scrapped its holder e11 got pool phone a075 on 2026-09-20. Status: disposed (a completed scrap), pending_disposal (submitted or approved), in_repair (an open or in_progress repair), in_use (an open checkout, whose employee is the custodian), else in_stock. Depreciation: one entry per asset per month after the purchase month through October, posted on the month's last day, none for the disposal month or later; accumulated_depreciation sums an asset's entries and book_value = purchase_cost - accumulated_depreciation.",
33
"id": "asset_lifecycle",
44
"code": "asset",
5+
"tier": "starter",
56
"title": "Asset lifecycle: register, checkout and return, repairs, monthly depreciation and a scrap approval",
67
"provenance": "Mid-tier scenario 资产全生命周期 (asset lifecycle) of the open library, written for this card from the domain alone: generic names, equipment and amounts, no customer-derived content. The seed follows the arithmetic rule in `$comment`, so each truth can be worked out by hand.",
78
"prompt": {

‎docs/qa/scenarios/crm_account_with_contacts.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"id": "crm_account_with_contacts",
33
"code": "crm",
4+
"tier": "control",
45
"title": "CRM: accounts and independently-living contacts",
56
"provenance": "Golden case `crm_account_with_contacts` of packages/cli/src/lint/corpus.ts; `expect` derived mechanically from its fixture (every object; minFieldsPerObject = the smallest object's field count; one selectFields row per select field with minOptions = its option count; one lookups row per lookup or master_detail field).",
67
"prompt": {

‎docs/qa/scenarios/invoice_with_line_items.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"id": "invoice_with_line_items",
33
"code": "invoice",
4+
"tier": "control",
45
"title": "Invoicing: invoices with inline line items and a summed total",
56
"provenance": "Golden case `invoice_with_line_items` of packages/cli/src/lint/corpus.ts; `expect` derived mechanically from its fixture (every object; minFieldsPerObject = the smallest object's field count; one selectFields row per select field with minOptions = its option count; one lookups row per lookup or master_detail field).",
67
"prompt": {

‎docs/qa/scenarios/leave_balances.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$comment": "Seed rule (so every truth can be worked by hand): request i = 1..120 is filed by employee e((i-1) mod 12 + 1) (e01-e12; e13/e14 are HR and file none). Leave type by i mod 5: 1-3 annual, 4 sick, 0 personal. It starts on working day ((i-1) mod 30) mod 15 + 1 (Monday to Friday; public holidays are out of scope) of July (i 1-30), August (31-60), September (61-90) or October (91-120) 2026 and covers N consecutive working days, N by i mod 7 = 0..6: 5, 1, 2, 3, 1, 2, 4. One leave_day row per day, the last one a morning half day (0.5) when i mod 11 = 0; days is their sum. Submitted 28 days before the start (drafts are not submitted). Status: i 1-90 rejected when i mod 10 = 7, withdrawn when 3, else approved; i 91-120 by i mod 10: 1 and 3 draft, 2 and 4-6 pending, 7 rejected, 8-9 approved, 0 withdrawn. Route: step 1 goes to the requester's department manager (to e14 when the requester is that manager), decided the day after submission; a request of more than 3 days also has step 2 to e13, decided two days after submission. A rejected request is rejected at its last step, a withdrawn one has step 1 cancelled, and a pending one waits at step 1, or at step 2 when it is over 3 days and i mod 10 is 5 or 6. Balances are for leave year 2026/27 (from 1 July 2026): annual entitlement 5, 10 or 15 days for under 3, 3 to 9, or 10 and more full years of service on 1 July 2026, plus the employee's carry-over; sick leave 10 days. used_days sums the days of the approved requests on the balance and remaining_days = entitled + carried over - used. A sick request over 2 days carries a certificate, and its medical note by i mod 7 is: 0 and 4 surgery, 1 and 5 physiotherapy, 2 and 6 dental treatment, 3 post-operative rest.",
33
"id": "leave_balances",
44
"code": "leave",
5+
"tier": "starter",
56
"title": "Leave and balances: leave types, yearly balances, requests with day lines and a route set by the days",
67
"provenance": "Mid-tier scenario 请假与假期余额 (leave and balances) of the open library, written for this card from the domain alone: generic names, cities and dates, no customer-derived content. The seed follows the arithmetic rule in `$comment`, so each truth can be worked out by hand.",
78
"prompt": {

‎docs/qa/scenarios/order_to_cash.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$comment": "Seed rule (so every truth can be worked by hand), as of 2026-10-31: account a(k), k = 1..12, is owned by rep [e02, e03, e04, e06, e07, e08][(k-1) mod 6] (team east: e02-e04 under manager e01; team west: e06-e08 under e05) on net_45 terms when k mod 4 = 0, else net_30. Order i = 1..120 is for a((i-1) mod 12 + 1), owned by that account's owner, dated 2026-07..10 day ((i-1) mod 30)+1 (i 1-30 July, 31-60 August, 61-90 September, 91-120 October), with two lines: hardware p((i-1) mod 3 + 1) x (10 + 5(i mod 5)) at list price, 20% off when i mod 10 = 0, and service p(4 + i mod 3) x (1 + i mod 4) at list price. A line discount above 10% routes the order to the owner's manager (`approver`; `approved_on` the next day once approved). Status: i 1-90 cancelled when i mod 20 = 13, else fulfilled; i 91-120 by i mod 10: 1-3 fulfilled, 4, 5 and 9 confirmed, 6-7 draft, 8 cancelled, 0 pending_approval. A fulfilled order is invoiced 7 days after its order date as INV-(1000+i), due after the account's terms. Payments as of asOf: Harbor Foods (a05) has paid nothing; Ironwood Labs (a09) pays half on the due date; Cedar Logistics (a02) pays in full 20 days after the due date; every other account pays in full 3 days before it; method by k mod 3: 0 wire, 1 ach, 2 check. Activities: one touchpoint per account per month on day 30 - 2k by the owner (July meeting, August call, September email, October call), plus a collection_call by e09 on the day an invoice is 15 days past due when it is not fully paid by then.",
33
"id": "order_to_cash",
44
"code": "order",
5+
"tier": "starter",
56
"title": "Order to cash: accounts, an activity stream, sales orders with lines, a discount approval, invoices, payments and receivables aging",
67
"provenance": "Mid-tier scenario 订单到收款 (order to cash) of the open library, written for this card from general business knowledge alone: generic account names, cities, products and amounts, no customer-derived content. The seed follows the arithmetic rule in `$comment`, so each truth can be worked out by hand.",
78
"prompt": {

‎docs/qa/scenarios/project_with_tasks.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"id": "project_with_tasks",
33
"code": "project",
4+
"tier": "control",
45
"title": "Project management: projects owning inline-edited tasks with roll-ups",
56
"provenance": "Golden case `project_with_tasks` of packages/cli/src/lint/corpus.ts; `expect` derived mechanically from its fixture (every object; minFieldsPerObject = the smallest object's field count; one selectFields row per select field with minOptions = its option count; one lookups row per lookup or master_detail field).",
67
"prompt": {

‎docs/qa/scenarios/requisition_to_receipt.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$comment": "Seed rule (so every truth can be worked by hand): requisition i = 1..120 (PR-0001..PR-0120) is filed by employee e((i-1) mod 12 + 1) (e01-e04 Sales, e05-e08 Engineering, e09-e12 Operations; e13-e18 file none), dated 2026-07..10 day ((i-1) mod 30)+1 (i 1-30 July, 31-60 August, 61-90 September, 91-120 October). Its tier m = i mod 7 fixes what it buys, from whom and on which PO lines: 1 printer paper 40 x 30 = 1,200 (s02); 2 monitors 3 x 1,200 = 3,600 (s01); 3 office cleaning 1 x 5,000 (s03); 4 laptops 2 x 5,400 + docking stations 2 x 600 = 12,000 (s05); 5 consulting days 13 x 2,000 = 26,000 (s04); 6 rack server 40,000 + installation 8,000 = 48,000 (s01); 0 office chairs 15 x 600 = 9,000 (s02). approval_levels is 1 up to 5,000, 2 up to 30,000 and 3 above; level 1 goes to the requester's department manager (e13/e14/e15), level 2 to e16, level 3 to e18, and level s is decided on the request date + s days. Status: i 1-60 rejected when i mod 10 = 7, else received; i 61-90 rejected when i mod 10 = 7, ordered when 8 or 9, else received; i 91-120 by i mod 10: 1-3 pending_approval (the levels below min(approval_levels, i mod 10) approved, that level pending), 4 approved with no PO yet, 5 approved with a draft PO, 6 and 8 ordered, 7 rejected, 9 and 0 draft. A rejected requisition is rejected at level 1; a draft has no step. An ordered, received or draft-PO requisition has PO po(i) (sent, received or draft) with its tier's lines, dated the request date + approval_levels days, its total the requisition's amount; a received PO has one full goods receipt per line, 4 days after the order, recorded by the requester. PR-0113's description carries an injected instruction.",
33
"id": "requisition_to_receipt",
44
"code": "purchase",
5+
"tier": "starter",
56
"title": "Requisition to receipt: purchase requisitions, an amount-threshold approval, purchase orders with lines and goods receipts",
67
"provenance": "Mid-tier scenario 采购申请到收货 (requisition to receipt) of the open library, written for this card from the procurement domain alone: generic names, suppliers, items and amounts, no customer-derived content. The seed follows the arithmetic rule in `$comment`, so each truth can be worked out by hand.",
78
"prompt": {

‎docs/qa/scenarios/service_desk.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$comment": "Seed rule (so every truth can be worked by hand): ticket i = 1..120 (TK-0001..TK-0120) is opened 2026-07..10, day ((i-1) mod 30)+1 (i 1-30 July, 31-60 August, 61-90 September, 91-120 October). With k = ((i-1) mod 12)+1 the customer is cus_01 for k 1-4, cus_02 for 5-7, cus_03 for 8-9 and cus_04 / cus_05 / cus_06 for 10 / 11 / 12. Category by i mod 4: 1 billing, 2 and 3 technical, 0 how_to. Priority by i mod 10: 1 urgent, 2-3 high, 4-7 normal, 8, 9 and 0 low; the SLA policy follows the priority. Channel by i mod 3: 1 email, 2 web, 0 phone. A technical ticket with i mod 20 = 11 (urgent) or 3 (high) outlived its escalation rule and sits in grp_tier2 with a09 (escalated_by esc_urgent / esc_high); every other billing ticket is in grp_billing (a02 when i mod 8 = 1, a03 when 5) and every other technical or how_to ticket in grp_tech (a05 / a06 / a07 for i mod 4 = 2 / 3 / 0). Status: i 1-60 closed, 61-90 resolved; in October an escalated ticket is open, any other urgent or high ticket resolved, i 118-120 new (unassigned), the rest by i mod 3: 0 open, 1 pending, 2 resolved. A resolved or closed ticket took 6 / 20 / 48 / 96 hours (urgent / high / normal / low), an escalated one 14 (urgent) or 40 (high), which is the SLA breach; resolved_on is 0 / 1 / 2 / 4 days (escalated: 1 / 2) after opening, and resolution_code is fixed for billing, answered for how_to, and for technical workaround when i mod 3 = 0, else fixed. Comments: every ticket has the customer's public message (0 minutes) on its opening day; every ticket that is not new has its assignee's public reply the same day (45 / 30 / 15 / 10 minutes by priority); every escalated ticket has a08's internal note (40 minutes) the next day. Every resolved or closed ticket has one satisfaction survey: unanswered (sent, no score) when i mod 3 = 0, else answered on resolved_on with score 2 when breached, 3 when low priority, otherwise 5.",
33
"id": "service_desk",
44
"code": "helpdesk",
5+
"tier": "starter",
56
"title": "Service desk: tickets with comment threads, SLA policies, time-based escalation and satisfaction surveys",
67
"provenance": "Mid-tier scenario 客服工单 (service desk) of the open library, written for this card from the domain alone: invented company and agent names, example.com addresses and invented figures, no customer-derived content. The seed follows the arithmetic rule in `$comment`, so each truth can be worked out by hand.",
78
"prompt": {

‎docs/qa/scenarios/travel_expense.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$comment": "Seed rule (so every truth can be worked by hand): claim i = 1..120 is filed by employee e((i-1) mod 12 + 1) (e01-e12; e13/e14 are Finance and file none), dated 2026-07..10 day ((i-1) mod 30)+1 (i 1-30 July, 31-60 August, 61-90 September, 91-120 October), for trip t(i) of (i mod 3)+2 days ending the day before. Lines per claim: hotel ((days-1) nights at cap-50, at cap+100 when i mod 8 = 0), meals (days at cap-20, at cap+30 when i mod 12 = 5), and airfare when i mod 3 = 0 (1 at cap-200, at cap+300 when i mod 9 = 0); an over-cap line is over_standard with a reason. Status: i 1-60 rejected when i mod 10 = 7 else paid; i 61-90 rejected when i mod 10 = 7, manager_approved when 8 or 9, else paid; i 91-120 by i mod 10: 1-4 submitted, 5-6 manager_approved, 7 rejected, 8 finance_approved, 9 and 0 draft. Approval step 1 goes to the claimant's department manager (to e14 when the claimant is that manager), step 2 to e13. Operation employee_approves_own_claim checks that a claimant is never the approver: e02 holds no decision right on approval_step, so deciding the manager step of its own claim EC-0098 (as_098_1, already approved by e01) is refused PERMISSION_DENIED, the edit grant being judged before any validation or state rule; it targets a step e02 can read, so the agent finds the row it is asked to decide.",
33
"id": "travel_expense",
44
"code": "travel",
5+
"tier": "starter",
56
"title": "Travel expense: trip requests, claims with lines, grade-based standards and a two-step approval",
67
"provenance": "Mid-tier scenario 差旅报销 (travel expense) of the open library, written for this card from the domain alone: generic names, cities and amounts, no customer-derived content. The seed follows the arithmetic rule in `$comment`, so each truth can be worked out by hand.",
78
"prompt": {

0 commit comments

Comments
 (0)