Skip to content

test(qa-scenarios): add the travel_expense mid-tier scenario card - #30600

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-30476-travel-expense-card
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-30476-travel-expense-card

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by 田騏 · project thread
Fixes #30476
Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:新增「差旅报销」中档场景卡(7 个对象、两级审批、3 个角色其中 2 个按行限定、1 个支出报表、120 张报销单跨 7–10 月、10 道问数、6 个写操作、4 个 agent 动作),并配一份只属于这张卡的真值测试。
  • 为什么改:落实 cloud#3600 九个场景中的财务场景,让 AI 建应用、问数、代办写操作都有一张能用代码判分的差旅报销卡。
  • 风险与回滚:只加测试数据和测试,所在包私有、不发布,运行时零改动;回滚即删两个新文件并还原 library.test.ts 一行。
  • 先看:① docs/qa/scenarios/travel_expense.json 的 run.questions 与 run.operations;② packages/qa/scenarios/test/travel-expense.test.ts 的 EXPECTED_TRUTHS;③ packages/qa/scenarios/test/library.test.ts 第 102 行(控制卡清单加了本卡)。
  • 两分钟验证:pnpm --filter @objectstack/scenarios test,预期 4 个测试文件、64 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

  • docs/qa/scenarios/travel_expense.json (new): the 差旅报销 travel-expense mid-tier card.
    • Seven objects: department, employee, travel_standard (a cap per grade and expense type), trip_request, expense_claim, claim_line and approval_step (the two-step approval: department manager, then Finance).
    • Three personas: employee (own rows) and dept_manager (own department) carry a row scope; finance_officer sees every claim but no trip request.
    • Seed: 120 claims dated July to October 2026, plus 280 lines, 204 approval steps and 126 trips. The arithmetic rule that generated it is stated in the card's $comment, so every truth can be worked by hand.
    • Run half: 10 questions, 6 operations and 4 agent actions (one confirm-gated); iterate adds travel advances.
  • packages/qa/scenarios/test/travel-expense.test.ts (new): this card's own test file.
    • It pins all 10 computed truths and the 7 per-persona truths against hand-worked values.
    • It asserts the mid-tier floor and the seed's own consistency: each claim total is the sum of its lines, and a line is over_standard exactly when it is above the grade cap.
    • It shows that a wrong seed cell or a wrong truth spec in a fixture copy goes red against those pins.
  • packages/qa/scenarios/test/library.test.ts: one line. The library-wide test asserts the exact set of loaded card ids, so travel_expense is added to that list. Its truths are pinned in the card's own file, not here.

Tests

pnpm --filter @objectstack/scenarios test: 4 files, 64 tests passed. pnpm --filter @objectstack/scenarios typecheck: exit 0, after building the closure with pnpm --filter '@objectstack/scenarios^...' build.

Acceptance notes

  • File name. The card is travel_expense.json, not travel-expense.json as the issue spells it. A card's id must be a snake_case machine name, and the loader requires it to equal the file's basename, so a hyphenated basename cannot load. The schema was not changed.

  • No schema field for some floor items. Three floor items have no field in the schema:

    • an approval or automation flow as a structural expectation;
    • "declarative preferred";
    • a report as distinct from a dashboard.

    The card states them in prompt.detailed (zh and en) and in capabilities, seeds approval_step as an expected object, and declares the report under expect.dashboards. Nothing in the loader grades them.

  • Seven operation kinds, six operations. The issue names seven operation kinds and caps the card at six operations. So file_and_submit_from_text covers two of them: entry from free text with lines, and the multi-step chain (file, add two lines, submit, route to the manager).

  • Routed approval step not asserted. The post-state of file_and_submit_from_text does not assert the routed step-1 row. A where cannot name the new claim's id, and step 1 · approver e01 · pending also matches a seeded row.

  • README step 3. docs/qa/scenarios/README.md "Adding a card" step 3 says to add a card's truths to test/library.test.ts, but this card's truths live in its own file. The README is unchanged here.

  • Sibling cards. Every sibling mid-tier card has to edit the same library.test.ts line, so their PRs will conflict on it in turn.

  • Unreachable references. objectstack-ai/templates and objectstack-ai/cloud answer 403 from this session. The domain is designed from the card text alone, and the rulings are applied as the card states them.

Verification

scenarios test + typecheck (head 130acb8)
 Test Files  4 passed (4)
      Tests  64 passed (64)
> tsc --noEmit
os-verify-lock: VERDICT command-exit 0
dispatch-gates --commands (50 commands, local)

All 50 derived commands exit 0. The --ran reconciliation reads: 50 derived, 50 run, 0 NOT-MEASURED, 0 UNRUN, a derived zero because every line recorded its exit code.

Three of them first exited 3 (PREREQUISITE NOT MET: a dist was not built). Each exited 0 after the build it names:

  • check:doc-formula-expressions, after building @objectstack/formula and @objectstack/lint;
  • check:lean-entry-closure, after building @objectstack/objectql;
  • check:dual-build-cjs-loads, after a full turbo run build.

Changed lines: 1337 (+1336 / -1, 3 files), under the 3000 threshold.


🤖 Generated with Claude Code

A 差旅报销 (travel expense) card for the open scenario library: seven
objects (department, employee, travel_standard, trip_request,
expense_claim, claim_line, approval_step), a two-step approval, three
personas (two row-scoped), a spend report, 120 claims over July-October
2026, ten questions, six operations and four agent actions. Its own test
file pins every computed truth against hand-worked values and shows a
wrong seed cell or truth spec in a fixture copy goes red.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2ebbZkr2QAEG1x7UC8
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

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): node scripts/docs-audit/affected-docs.mjs --json 4831d5006ded46c123075c43b400c50bfea7d32d → packageMentionDocs.

…ory, so a new card never edits it

The "exactly these cards" check listed card ids by hand, so every mid-tier
card PR had to edit the same line and the sibling PRs would conflict in turn.
It now asserts one loaded card per .json file in docs/qa/scenarios, with the
three control cards among them. README "Adding a card" step 3 now points a
new card's truths at its own test/<id>.test.ts.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2ebbZkr2QAEG1x7UC8
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 5, 2026
…directory

The previous commit listed docs/qa/scenarios with readdirSync, which the
cross-package test-inputs gate reads as a directory input no declared glob
covers (README.md sits beside the cards). The listing was redundant: the
loader yields a card or a refusal for every *.json there, and the test before
it asserts no refusal. The check now asserts the three control cards are
loaded and leaves each mid-tier card to its own test file.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2ebbZkr2QAEG1x7UC8
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#2 · marchtian · session_017ihL2ebbZkr2QAEG1x7UC8

席位核对 — ACCEPT · domain:devx#2 · Head-sha 6c33ec2b88fbd35226829d4fde920ceb15a47e48 · 2026-11-05T18:11Z

  • Shape: 4 files, +1343/−3 (read from the diff, not the report). docs/qa/scenarios/travel_expense.json (the card), packages/qa/scenarios/test/travel-expense.test.ts (its own truths), packages/qa/scenarios/test/library.test.ts and docs/qa/scenarios/README.md. No schema, loader or truth change for the existing cards. No governed path, under 3000 lines.
  • Card (dev report 6664687093): 7 objects, 3 personas (two row-scoped), 120 claims July–October 2026 with 280 lines, 204 approval steps and 126 trips; 10 questions, 6 operations, 4 agent actions (one confirm-gated), one iterate step. The floor field of the report maps each mid-tier floor item to its JSON path. Its test pins 10 all-rows truths and 7 per-persona truths against hand-worked values; a wrong seed cell and a wrong truth spec, each in a fixture copy, go red.
  • Card id: travel_expense, not travel-expense: the schema requires a snake_case id and the loader requires it to equal the basename.
  • Seat review rounds:
    1. The dev's head added 'travel_expense' to the exact-list assertion in library.test.ts, so each of the six sibling cards (Scenario library: mid-tier card — 订单到收款 order-to-cash (8–10 问数 + 4–6 write operations, row-scoped personas) #30477–Scenario library: mid-tier card — 资产全生命周期 asset lifecycle (8–10 问数 + 4–6 write operations, row-scoped personas) #30481 and the rest) would edit the same line and conflict in turn. The seat made that test name only the three control cards (ccacbe0aa2), and README "Adding a card" step 3 now sends a new card's truths to its own test/<id>.test.ts instead of library.test.ts.
    2. That first version listed the directory with readdirSync, and check:cross-package-test-inputs was red: docs/qa/scenarios/ holds README.md, which the declared *.json glob does not cover. The listing was redundant (the loader yields a card or a refusal for every *.json there, and the test before it asserts no refusal), so 6c33ec2b88 drops it. The gate exits 0 locally, as do the package's 64 tests and its typecheck; a stray card file in a scratch copy turned both library tests red.
  • Gates:
    • Head checks: 34 success and 14 skipped, none red.
    • check-expected-skips: OK, all 14 skips are in main's roster (exit 0).
    • check-governed-merges: 1346 changed lines, which is ≤ 3000.
    • Dev's local dispatch-gates --commands: 50 of 50 exit 0, --ran reconciled.
  • Noted, not carried: the card names seven operation kinds and caps operations at six, so run.operations[0] covers both free-text entry and the multi-step chain. Three floor items (approval flow, "declarative preferred", report vs dashboard) have no schema field and sit in the prompt and capabilities. The approval step operations[0] creates is not asserted, since no where can single it out from the seeded rows.
  • Out of scope: Skills-docs: n/a, Clause-②: no, Metadata-protocol: none.
  • Landing: skip-changeset (@objectstack/scenarios is private). Ready, then auto-merge through the merge queue.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 18:13
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit b6ae87c Nov 5, 2026
49 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-30476-travel-expense-card branch November 5, 2026 18:31
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 skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scenario library: mid-tier card — 差旅报销 travel expense (8–10 问数 + 4–6 write operations, row-scoped personas)

1 participant