Skip to content

Commit a00425b

Browse files
committed
fix(scenarios): grade an overstep refused on read, read a plain decline, and judge row scope enforced by RLS
- observe: when no write was attempted, the object's last coded answer to a read it needed first is graded as the operation's refusal. - run grading: the decline phrase list covers third-person and past-tense permission wording, and a coded PERMISSION_DENIED with no figure of its own reads as a decline in any wording. - access-security.row-scope accepts a public object narrowed for each scoped persona by a read policy on that persona's permission set. - the loader refuses a card whose persona declares a scope without the row-scope tag; the eight cards that lacked it carry it. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1Q3DqxR3fszjxQHd8
1 parent 26c965c commit a00425b

23 files changed

Lines changed: 428 additions & 62 deletions

‎docs/qa/scenarios/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ A question that lists `personas` is also answered **as each persona**: the perso
8989
`scope` rules for the question's object are applied first (`{ object, field, value }`,
9090
where `field` may be a path — `owner` for a rep, `owner.department` for a manager), and a
9191
question that reads an object or field the persona hides answers `{ kind: "withheld" }` —
92-
a correct reply declines. The loader returns these as `personaTruths`.
92+
a correct reply declines. The loader returns these as `personaTruths`. A card whose
93+
personas declare a `scope` carries the `access-security.row-scope` capability tag, so the
94+
build is checked for keeping the other rows from them; the loader refuses one that does not.
9395

9496
A truth the seed does not determine is **refused**, not approximated: an `avg`, `min` or
9597
`max` over no values, a field no seed row of the object carries, a comparison between a

‎docs/qa/scenarios/asset_lifecycle.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"automation.scheduled-flow",
6363
"access-security.row-level-security",
6464
"access-security.field-permissions",
65+
"access-security.row-scope",
6566
"dashboards.report",
6667
"ai.ask-data",
6768
"ai.agent-actions"

‎docs/qa/scenarios/crm_account_with_contacts.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"selectFields": [{"object": "account", "field": "industry", "minOptions": 2}],
1616
"lookups": [{"object": "contact", "field": "account", "to": "account"}]
1717
},
18-
"capabilities": ["records-forms.lookup", "records-forms.select-options", "ai.ask-data", "access-security.field-permissions"],
18+
"capabilities": ["records-forms.lookup", "records-forms.select-options", "ai.ask-data", "access-security.field-permissions", "access-security.row-scope"],
1919
"category": "crm",
2020
"run": {
2121
"seed": {

‎docs/qa/scenarios/invoice_with_line_items.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"records-forms.roll-up-summary",
2222
"records-forms.select-options",
2323
"ai.ask-data",
24-
"access-security.field-permissions"
24+
"access-security.field-permissions",
25+
"access-security.row-scope"
2526
],
2627
"category": "finance",
2728
"run": {

‎docs/qa/scenarios/order_to_cash.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"automation.time-relative-trigger",
5959
"access-security.row-level-security",
6060
"access-security.field-permissions",
61+
"access-security.row-scope",
6162
"dashboards.report",
6263
"ai.ask-data",
6364
"ai.agent-actions"

‎docs/qa/scenarios/project_with_tasks.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"records-forms.master-detail-inline-edit",
2020
"records-forms.roll-up-summary",
2121
"records-forms.select-options",
22-
"ai.ask-data"
22+
"ai.ask-data",
23+
"access-security.row-scope"
2324
],
2425
"category": "project",
2526
"run": {

‎docs/qa/scenarios/requisition_to_receipt.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"automation.record-triggered-flow",
7070
"access-security.row-level-security",
7171
"access-security.field-permissions",
72+
"access-security.row-scope",
7273
"dashboards.report",
7374
"ai.ask-data",
7475
"ai.agent-actions"

‎docs/qa/scenarios/service_desk.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"automation.time-relative-trigger",
6767
"access-security.row-level-security",
6868
"access-security.field-permissions",
69+
"access-security.row-scope",
6970
"dashboards.report",
7071
"ai.ask-data",
7172
"ai.agent-actions"

‎docs/qa/scenarios/travel_expense.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"automation.record-triggered-flow",
5050
"access-security.row-level-security",
5151
"access-security.field-permissions",
52+
"access-security.row-scope",
5253
"dashboards.report",
5354
"ai.ask-data",
5455
"ai.agent-actions"

‎packages/qa/scenarios/README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ discrimination test; ⛔ never match by area prefix.
6161
| `records-forms.roll-up-summary` | carries a roll-up summary, each reading a child object that relates back and, unless it counts, a child field that exists |
6262
| `records-forms.select-options` | carries a single-choice option field (`select`, `radio`), each offering at least two options |
6363
| `access-security.field-permissions` | denies (`readable: false`, in a permission set) every field a card persona hides, and has that field |
64-
| `access-security.row-scope` | keeps every object a persona's `scope` names private (owner-scoped), or derived from its master |
64+
| `access-security.row-scope` | keeps every object a persona's `scope` names private (owner-scoped) or derived from its master, or narrows it for each such persona by a read policy (`rowLevelSecurity`, `select` or `all`, no `positions`, a `using` that is not `true`) on that persona's permission set |
6565
| `approvals.approval-flow` | carries an approval (a flow with an Approval node), each bound to an object it serves, one bound to an object the card names |
6666
| `automation.record-triggered-flow` | carries a record-triggered flow, each bound to an object it serves, one bound to an object the card names |
6767
| `dashboards.widget-measures` | carries a dashboard widget with a measure, and every widget measure resolves on the dataset it binds |
@@ -87,7 +87,9 @@ Per card and mode the runner writes `docs/qa/platform-checklist/runs/<date>-scen
8787
refuses to start when `ANTHROPIC_API_KEY` / `ANTHROPIC_AUTH_TOKEN` is set or the CLI is logged in with an API key
8888
(the cost ruling on cloud#3600), and the record states the driver and login. `RecordedDriver` replays a recording.
8989
- **Observation** (`observe.ts`): the write grader is fed what the runner reads itself: the agent's write calls and
90-
the door's answer (a coded refusal), the object's rows before and after the turn, and the audit trail's actor.
90+
the door's answer (a coded refusal), the object's rows before and after the turn, and the audit trail's actor. A turn
91+
that wrote nothing because the object refused the read it needed first (a persona that may not read it) grades as
92+
that refusal's code; `(no write attempted)` is left for a turn whose object never refused it.
9193
- **Namespaces** (`namespace.ts`): every card's app is in the namespace `demo` + the card's `code` (`democrm`): scratch
9294
mode scaffolds the project under that name, and template mode installs a template declaring it into a host named
9395
`host<code>` (the unmanaged copy keeps its namespace, and the install refuses one the host owns). The card's names are

0 commit comments

Comments
 (0)