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 82b1acd
Browse filesBrowse the repository at this point in the historyBrowse files
feat(scenarios): refuse an operation its acting persona cannot reach (held)
The loader now refuses an operation whose declared outcome contradicts its
acting persona: an object the persona must not read (PERMISSION_DENIED), a
target row outside its row scope (RECORD_NOT_FOUND), or a written field it
must not read (PERMISSION_DENIED). Row scope is decided from the seed rows
through the same relation-path resolver the persona truths use.
Held, not for merge as is: the rule also refuses five operations in three
other library cards (invoice_with_line_items ops 0 and 3, project_with_tasks
ops 0 and 3, travel_expense op 4), which sit outside this claim's file
surface, so the library test is red on this branch until they are fixed.
Claude-Session: https://claude.ai/code/session_01Q4EjjPXwX1YfHyKJUh4agu
Co-authored-by: Claude <noreply@anthropic.com>
`${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/],
84
86
['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`/],
85
87
['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`/],
88
+
// ── reach: an operation its acting persona cannot reach has one outcome ──
89
+
['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`/],
90
+
['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`/],
91
+
['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`/],
92
+
['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`/],
93
+
['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`/],
86
94
// ── guardrails ──
87
95
['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/],
88
96
['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