Skip to content

Commit aaec016

Browse files
committed
docs(showcase): the hook comments say four hooks refuse, and which system writers pass the paid-line guards
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FmarW2qJYp6PYJJz9cpvK5
1 parent c50a44c commit aaec016

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • examples/app-showcase/src/data/hooks

‎examples/app-showcase/src/data/hooks/index.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ export const TASK_REOPEN_REFUSAL =
127127
'A finished task cannot be reopened. Create a follow-up task instead.';
128128

129129
/**
130-
* beforeUpdate (gated) — the showcase's one hook that REFUSES a write, with a
131-
* sentence addressed to the user.
130+
* beforeUpdate (gated) — the showcase's first hook that REFUSES a write, with a
131+
* sentence addressed to the user. (The three paid-invoice line guards below
132+
* refuse the same way.)
132133
*
133134
* `throw new Error('<sentence>')` from a sandboxed body is the business-refusal
134135
* shape: the write is aborted (`onError: 'abort'`) and the sentence travels to
@@ -176,8 +177,10 @@ export const PAID_INVOICE_LINE_MOVE_REFUSAL =
176177
* Two kinds of write pass every guard:
177178
* - a SYSTEM write (`ctx.session.isSystem`): the seed loads INV-1003's line
178179
* under a header that is already paid, and a migration or import restores
179-
* history. The platform's own read-only strips exempt system writes the
180-
* same way;
180+
* history. Every system writer passes by design — the seed, a script
181+
* action's `ctx.api`, a `runAs: 'system'` flow — and none writes
182+
* `showcase_invoice_line` in the showcase today. The platform's static
183+
* `readonly` strip exempts system writes the same way;
181184
* - a header that cannot be read: the engine's reference check answers a
182185
* dangling `invoice` with its own refusal, so the guard does not invent one.
183186
*/

0 commit comments

Comments
 (0)