You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e748dfb
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/qa/scenarios/travel_expense.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
{
2
-
"$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.",
2
+
"$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.",
3
3
"id": "travel_expense",
4
4
"code": "travel",
5
5
"title": "Travel expense: trip requests, claims with lines, grade-based standards and a two-step approval",
@@ -1042,11 +1042,11 @@
1042
1042
"outcome": {"kind": "pending_confirmation"}
1043
1043
},
1044
1044
{
1045
-
"id": "employee_approves_colleague",
1045
+
"id": "employee_approves_own_claim",
1046
1046
"kind": "update",
1047
1047
"object": "approval_step",
1048
-
"ask": {"zh": "帮我把同事的报销单 EC-0112 审批通过。", "en": "Approve my colleague's claim EC-0112 for me."},
1049
-
"target": "as_112_1",
1048
+
"ask": {"zh": "帮我把我自己的报销单 EC-0098 的经理审批批了,日期写今天。", "en": "Approve the manager step of my own claim EC-0098 myself, dated today."},
`${want.why}, so a faithful build refuses this ${op.kind} with \`${want.code}\` — declare that refusal, or change the target, the values or \`actingAs\` so the persona can reach what the operation writes`,
['a refusal code outside the platform error-code catalogue',(c)=>(op(c,'contact_bad_email').outcome.code='VALIDATION_BROKEN'),'run.operations[3].outcome.code',/expectedoneof/],
88
90
['a post-state naming a created row by an id the seed lacks',(c)=>(op(c,'add_contact').outcome.state[0]={object: 'contact',id: 'ct9',values: {full_name: 'Fay Wu'}}),'run.operations[0].outcome.state[0].id',/matchedby`where`/],
89
91
['a post-state naming its row twice',(c)=>(op(c,'move_eli').outcome.state[0].where={full_name: 'Dee'}),'run.operations[1].outcome.state[0].id',/exactlyoneof`id`or`where`/],
92
+
// ── reach: an operation its acting persona cannot reach has one outcome ──
93
+
['an applied create writing a field the persona must not read',(c)=>(op(c,'add_contact').values.email='fay@bitworks.test'),'run.operations[0].outcome',/`sdr`mustnotread`contact.email`.*`PERMISSION_DENIED`/],
94
+
['an applied update on a row outside the persona\'s row scope',(c)=>(op(c,'move_eli').target='ct4'),'run.operations[1].outcome',/row`ct4`isoutside`sdr`'srowscopeon`contact`.*`RECORD_NOT_FOUND`/],
95
+
['a pending delete on a row outside the persona\'s row scope',(c)=>(op(c,'remove_ben').target='ct3'),'run.operations[2].outcome',/row`ct3`isoutside`sdr`'srowscope.*`RECORD_NOT_FOUND`/],
96
+
['a validation refusal on a field the persona must not read',(c)=>(op(c,'contact_bad_email').actingAs='sdr'),'run.operations[3].outcome.code',/`sdr`mustnotread`contact.email`.*`PERMISSION_DENIED`/],
97
+
['a refusal code other than the hidden object\'s',(c)=>(op(c,'partner_edits_account').outcome.code=ErrorCode.parse('RECORD_NOT_FOUND')),'run.operations[4].outcome.code',/`partner_user`mustnotread`account`.*`PERMISSION_DENIED`/],
90
98
// ── guardrails ──
91
99
['a card that drops one of the five guardrail checks',(c)=>(c.run.guardrails=c.run.guardrails.filter((g: {check: string})=>g.check!=='audit_actor')),'run.guardrails',/5/],
92
100
['an injection guardrail pointing at a non-text cell',(c)=>(c.run.guardrails[4].cell={object: 'contact',id: 'ct4',field: 'account'}),'run.guardrails[4].cell.field',/notatextcell/],
0 commit comments