From 694703304ffaafdc13ba02afc6ffe2d0a3a6922a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 20 Sep 2026 12:20:49 +0000 Subject: [PATCH 1/2] docs: correct overstated impact framing in #66's status_events note The "654 real, non-demo jobs" framing was wrong. Checked the actual rows: 653 are scripts/load-multi-office-actions.mjs output against the QA/fleet test companies (customer_name/issue literally read "Synthetic multi-company office load test"), and the last one is an obvious manual placeholder entry ("John Smith") in a company named "...Demo Co". None had is_demo set, which is what made the query in #66 look like it was surfacing real production data loss -- it wasn't. The product has no real customers yet. The underlying bug and fix are unaffected -- status_events inserts via the session-scoped client were and are silently dropped by RLS, which would have hit the first real dispatcher-created job. Only the impact framing needed correcting. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01MR2GnZw5BX1L6QgTabt5JF --- docs/AUTHORIZATION.md | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/docs/AUTHORIZATION.md b/docs/AUTHORIZATION.md index 36f1b58..3bbf87b 100644 --- a/docs/AUTHORIZATION.md +++ b/docs/AUTHORIZATION.md @@ -137,16 +137,27 @@ even about the `FORCE` setting; RLS applies to the `authenticated` role regardless). The `authenticated` role does have a table-level `INSERT` grant, which is exactly the shape that makes this failure silent rather than a permission error: the insert simply matches zero rows for the -`with_check` clause and is dropped. Confirmed the real-world impact -directly: 654 non-demo `manual`/`call`-sourced jobs had **zero** -`status_events` rows, and the only `dispatcher`-attributed rows that did -exist all had `actor_id: null` — the exact signature of the demo-seed -script's service-role inserts (`scripts/seed-live-qa.mjs`), not of a real -API request (which always sets `actor_id: profile.id`). Fixed by routing -both call sites through `createSupabaseAdminClient()`, matching how -`intake`/`tech-action` already write `status_events`, and now checking -(and logging) the insert's `error` at both call sites instead of ignoring -it. +`with_check` clause and is dropped. Confirmed the gap actually bites in +practice: 654 `manual`/`call`-sourced jobs had **zero** `status_events` +rows. **Correction:** none of those 654 are real customer jobs — the +product has no real customers yet. 653 are `scripts/load-multi-office-actions.mjs` +output against the QA/fleet test companies (`customer_name`/`issue` +literally read "Synthetic multi-company office load test"), and the +remaining one is an obvious manual placeholder entry ("John Smith" / +"123-456-7890" / "Heater broke") in a company named "...Demo Co". None +had `is_demo` set, since neither load scripts nor ad hoc manual testing +bother setting that flag, which is what made them look like real traffic +at a glance — they aren't. The only `dispatcher`-attributed rows that +otherwise exist all had `actor_id: null` — the exact signature of the +demo-seed script's service-role inserts (`scripts/seed-live-qa.mjs`), not +of a real API request (which always sets `actor_id: profile.id`). The +underlying bug is unaffected by this correction — it's still real and +would have silently dropped the audit trail for the first genuine +dispatcher-created/updated job — only the "confirmed production data +loss" framing was overstated. Fixed by routing both call sites through +`createSupabaseAdminClient()`, matching how `intake`/`tech-action` already +write `status_events`, and now checking (and logging) the insert's `error` +at both call sites instead of ignoring it. ## `PATCH /api/jobs/[id]` — technician branch From b5f4f0bccee9795bed7ff6b3c9578b9ae92e8b42 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 20 Sep 2026 12:23:04 +0000 Subject: [PATCH 2/2] docs: fix which fields actually carry the load-test signature Codex review on PR #71: customer_name is "Office Fleet -", not the "Synthetic..." string -- only issue and problem_description carry that literal text. Narrowed the wording to match scripts/load-multi-office-actions.mjs's actual output. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01MR2GnZw5BX1L6QgTabt5JF --- docs/AUTHORIZATION.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/AUTHORIZATION.md b/docs/AUTHORIZATION.md index 3bbf87b..1546488 100644 --- a/docs/AUTHORIZATION.md +++ b/docs/AUTHORIZATION.md @@ -141,9 +141,10 @@ than a permission error: the insert simply matches zero rows for the practice: 654 `manual`/`call`-sourced jobs had **zero** `status_events` rows. **Correction:** none of those 654 are real customer jobs — the product has no real customers yet. 653 are `scripts/load-multi-office-actions.mjs` -output against the QA/fleet test companies (`customer_name`/`issue` -literally read "Synthetic multi-company office load test"), and the -remaining one is an obvious manual placeholder entry ("John Smith" / +output against the QA/fleet test companies (`customer_name` reads "Office +Fleet `` ``-``" and `issue`/ +`problem_description` literally read "Synthetic multi-company office load +test"), and the remaining one is an obvious manual placeholder entry ("John Smith" / "123-456-7890" / "Heater broke") in a company named "...Demo Co". None had `is_demo` set, since neither load scripts nor ad hoc manual testing bother setting that flag, which is what made them look like real traffic