Commit c2f1605
Audit follow-up to #1888 (flow `runAs` enforcement). Two showcase flows relied on
implicit elevation and would teach the wrong pattern as AI-authoring reference
templates now that `runAs` is enforced:
- `showcase_inbound_task_webhook` — an HMAC webhook (no authenticated user) that
creates records. It only worked via the "no identity → security-skipped"
fall-through. Now declares `runAs:'system'` — the correct, explicit pattern for
external ingest (and robust once the target object carries RLS).
- `showcase_invoice_signoff` — the revert-on-reject write is an approval-process
outcome, not an act of the submitter. `runAs:'system'` so it lands regardless of
whether the submitter still has edit rights on a "sent" invoice.
No behavioral regression in the showcase itself (broad member perms — the full
dogfood gate was already green); this hardens the templates so they stay correct
under stricter RLS and as patterns AI copies. The rest of the example flows were
audited and are correct as-is: `system` where they cross owners (lead
qualification, renewal/stale sweeps, todo escalation/recurrence) and `user` where
they act on the trigger user's own accessible record (lead convert, task reassign,
resilient-sync self-update).
Verified: `pnpm --filter @objectstack/example-showcase typecheck` + full dogfood
gate (173 tests) green.
Refs #1888
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4a242ad commit c2f1605
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
886 | 890 | | |
887 | 891 | | |
888 | 892 | | |
| |||
1160 | 1164 | | |
1161 | 1165 | | |
1162 | 1166 | | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1163 | 1172 | | |
1164 | 1173 | | |
1165 | 1174 | | |
| |||
0 commit comments