Written 6 October 2026, updated 7 October 2026: where it stands, what is next, and how it is built. Every figure is measured against the live account on the date stated. The desk itself: https://reports.iconicbyai.com/desk?key=studio1-desk-2026
The desk is built, deployed, and not switched on. The team can look at the live book, but on Render it cannot tell them which accounts are theirs, and nothing they do is saved. Every remaining blocker is a credential or a decision. None needs code first.
/desk/api/status| Piece | State | Detail |
|---|---|---|
| The book | Live | Built 19 Oct 08:00 UTC, every 15 min. Square declines 15–19 Oct: 1,149, 1,139 with a CRM ref, 107 one-off studio sales excluded. |
| Square declines | Live | Nightly file from report_square_declines.js (owner:render). |
| CRM payment history | Live | Per agreement, when a panel opens. Proven on Render 19 Oct 2026 — CRM_COOKIE works. Two panels opened on the live desk came back with real, differently-shaped histories (H3882042: balance 2,958 of 4,000, 2 instalments, last paid 18 Jul · D4038150: deposit only, never paid an instalment, 3 lines), and crm_schedules flipped to ok. The BULK ledger is a separate thing and is still not wired, so the LIST columns stay as dashes. |
| GHL (owners, DND, threads, replies) | Blocked | Works on the laptop. Not on Render — no GHL_USDC_TOKEN. |
| Database (recording anything) | Blocked | No SUPABASE_SERVICE_ROLE_KEY; migrate.sql unapplied. |
| Staff logins | Blocked | Zero accounts. Every write is a 401. |
| Sending texts | Blocked | DESK_SEND_LIVE unset — dry run. Correct for now. |
| GoTo calls | Stale | Aggregate feed frozen (Render: 2 Sep, laptop: 17 Sep). The per-call service still answers. |
With no GHL token on Render, the desk shared ownerless accounts out round-robin and showed that as who owns what. Of 354 agreements with a real owner in GHL, the guess matched 76 (21%). The team noticed before we did. Since 7 Oct the desk allocates nobody when GHL cannot be read. An empty list makes a worse day, but it is a truer answer. The real split, read off GHL on the laptop on 7 Oct:
| Owner in GHL | Agreements |
|---|---|
| Nick | 130 |
| Charles | 101 |
| Maria | 70 |
| Emily | 53 |
| Veronica | 0 |
| Nobody in GHL | 182 |
The round-robin had shown Veronica 117 accounts. She owns none in GHL.
| # | Step | Who | Why |
|---|---|---|---|
| 1 | Put GHL_USDC_TOKEN in Render’s environment | Neil | One line in the Render dashboard. Gives the live desk real owners, DND, the message thread and last-reply dates. Until then every collector’s "My day" on the live link is empty by design. |
| 2 | Create the service-role key and apply scripts/desk/migrate.sql | Neil | Supabase SQL editor. Without it calls, notes and promises vanish on refresh. |
| 3 | Create the staff accounts | Neil | node scripts/reports/staff.js — five collectors, five admins. |
| 4 | Decide: may the desk write notes back to the CRM? | Neil | Possible — the booking’s notes field (BookingUIClass, the allergies field, append-only). But it is a CRM WRITE and the brief says version 1 never writes. Needs a yes. |
| 5 | Wire the bulk CRM ledger | dev | Fills the dash columns on the list. Contract is in feeds/contract.md. |
| 6 | Confirm queue 1 fills on Render | dev | "Replied — waiting on you" depends on the ~6.5-minute conversations pass, which needs the GHL token. Check it has real people once the token is in. |
| 7 | GoTo: check the Advanced Reporting add-on billing | Neil | Before redoing OAuth. Veronica has no line in either GoTo roster — her calls do not exist anywhere. |
| 8 | Fix the Square webhook receiver | dev | serve_reports.js fails open when SQUARE_WEBHOOK_SIGNATURE_KEY is unset, and signs the body without the URL. Fix before anything depends on it. |
| 9 | Cutover, last | Neil | Switch OFF the GHL debt workflows and the Debt AI G-Sheet feed by hand, set DESK_ONE_SENDER_CONFIRMED, run a dry-run week, then DESK_SEND_LIVE=true. |
| What | Where |
|---|---|
| The desk | https://reports.iconicbyai.com/desk?key=studio1-desk-2026 |
| Feed status | /desk/api/status?key=… — every feed’s own answer, with its newest data time |
| Code | modules/collections-desk/ + scripts/desk/, mounted in serve_reports.js by prefix |
| Checks | node scripts/desk/selftest.js (58) and node scripts/desk/render_check.js |
| Background | project_collections_desk in the auto-memory; the original brief is ~/Downloads/COLLECTIONS_DESK_FOR_CLAUDE_CODE.md |
Six rules first. Every wrong thing this build produced was a DEFINITION problem,
not an arithmetic one — a fabricated payment history, a $0 that meant "unknown",
638 accounts reported as "Unassigned" when the truth was a missing credential. The sums were fine
every time.
Nothing is stored yet. Every screen is built on the fly from the nightly Square declines file joined to the live GHL contact index, cached in memory for 15 minutes. That is why it survives a deploy badly and why the Supabase key is the first thing to fix.
One row = one CRM order reference (D3845375). 2,123 debtors hold more than one GHL card, so counting cards double-counts people. The ref is carried on the GHL contact as companyName — that is the join key for everything.
The feed adapter returns ok | stale | not_wired | error. Only ok may render a number, and only ok with an empty array may render a 0. Everything else renders an em dash. A 0 says "this customer has paid nothing"; a dash says "we have not looked". Those are different claims and the second one is usually the true one.
Not Square, not the CRM, not GHL. Every second attempt on record is a collector on the phone or a customer paying a reminder link. The words retry / re-presented are banned in copy, column names and variables — routes.js throws at load time if they appear, and the send path re-checks every outbound message body.
GHL assignedTo on opportunities is not maintained. The desk allocates and writes back, never the other way round.
The moment money posts, cancel every queued text, call-back and sequence step and clear the next contact. A chase after someone has paid is the fastest way to lose them.
The book: Square declines joined to GHL people, rebuilt every 15 minutes. Nine queues, search (name, ref, city, phone), the account panel with the real message thread, real last-reply dates, the decline reason and what to say about it, the card and the BANK that issued it, the CRM payment history and real balance for the account you open, and a "who paid in the last 5 days" section.
The SMS send path, with its five guards, running in dry run. The complaints hand-off and hand-back. The promise and next-contact writers. The morning rebuild. The sequence engine.
Logging a call (including "Took a payment"), notes on an account, promises and next-contact dates. They move the row on the page, but nothing is saved anywhere until the database key and staff accounts exist.
The BULK CRM ledger, so balance / deposit / instalments still show a dash on the LIST (the panel has them). The Square payments walk — recovery comes off the decline row’s own recovered flag. GoTo per-call matching is written but its upstream has been 403ing since 17 Sep. Writing anything back to the CRM.
All three are credentials or accounts. None needs a line written.
GHL_USDC_TOKEN is not in Render’s environmentghl-inventory/.token is gitignored — correctly, it is a secret — so the cloud has no token. Four things go blank without it: the owner column, Do-not-disturb, the message thread in the account panel, and the last-reply dates. It all works on the laptop because the token is there. This is the single highest-value fix and it is one line in the Render dashboard.
SUPABASE_SERVICE_ROLE_KEY is not set anywherescripts/desk/migrate.sql is written — 16 desk_* tables, RLS on with no policies so the committed anon key can read nothing — but unapplied. PostgREST cannot run DDL, so it needs the Supabase SQL editor. Until then nothing can be recorded: a collector’s calls, texts and promises vanish on refresh. It is also why every deploy throws the book away.
Login is scripts/reports/lib/staff_auth.js — scrypt, salted, constant-time, already live on /complaint-log. Nobody can act until somebody runs node scripts/reports/staff.js. Every write endpoint returns 401 today, which is the fourth independent reason nothing can reach a customer.
A module under modules/, mounted by prefix, isolated in a try/catch so
a desk fault cannot take the reports site down. Not 1,500 more lines in the 19,000-line
serve_reports.js.
| File | What it owns |
|---|---|
modules/collections-desk/index.js | HTTP handler. /desk plus /desk/api/*. Mounted by prefix in serve_reports.js the same way /convo-intel is — a prefix if, a try/catch require writing global._collectionsDeskApp, and a 503 page if it fails to load so a desk fault can never take the reports site down. |
modules/collections-desk/feeds/index.js | The adapter. Every screen reads through it. This is where "a missing feed is never a zero" is enforced, so a new screen cannot forget it. |
modules/collections-desk/feeds/live/square.js | Reads the nightly declines file. No Square client of its own. |
modules/collections-desk/feeds/live/ghl.js | Contact index + the DND field. Read-only. |
modules/collections-desk/feeds/live/conversations.js | Message threads and last-reply dates. |
modules/collections-desk/feeds/live/crm.js | Payment history for ONE agreement, read live from the CRM (PaymentUIClass.loadByBooking) when the panel opens, cached 2h. Read-only. Reuses bo/parseSchedule from pull_finance_schedules.js rather than a second CRM client. |
modules/collections-desk/feeds/live/build.js | Joins the three into the book, and allocates owners — but ONLY when GHL was readable (see Traps). |
modules/collections-desk/feeds/cache.js | Serves the last-built book instantly, refreshes behind it. Reports its own age; a cached copy presented as live is the same lie as a build stamp presented as a data stamp. |
modules/collections-desk/queues.js | The nine queues and the next-contact rules. Server-side so the rebuild, the API and the page can never disagree. |
modules/collections-desk/routes.js | Decline code to route, meaning and what to say. Wraps the 29-code map in report_square_declines.js rather than copying it. |
modules/collections-desk/send.js | The only way a text leaves the desk. Five guards, dry run by default. |
modules/collections-desk/auth.js | Two gates: the key lets you look, a login lets you act. |
modules/collections-desk/page.html | The front end. Derived from Neil’s prototype; it is now the source of truth and build_page.js will not overwrite it without --force. |
scripts/desk/migrate.sql | 16 desk_* tables, RLS on, no anon policies. Unapplied. |
scripts/desk/selftest.js | 58 checks, offline. The claims the desk makes about itself. |
scripts/desk/render_check.js | Renders the real page against the real book under a stub DOM. Exists because the desk once shipped a blank page that every server-side check passed. |
Square and the CRM were asked for as placeholders. Rather than scatter "if not wired" checks
through every screen, one adapter returns a status and the screens read through it. The rule is
enforced in one place, so a screen written next year cannot forget it. feeds/contract.md
is the written spec a real pull has to satisfy — field names, units, the join key, and every trap
that has already produced a wrong number.
The long one, as asked. Everything here is measured against
pcTyOadbzBqZO7v3cbwn on the date stated. GHL is the only system that knows who owns
an account, who has asked us to stop texting, and what has actually been said to a customer.
Get these four things right and the rest follows.
| Thing | Value |
|---|---|
| Sub-account (location) | pcTyOadbzBqZO7v3cbwn — "US Debt Collection". This is the live one. |
| The decoy | ghl_config.json has locationId: XcjF95QScPf2rxRSgp2e — a near-empty account whose token 403s. At least six files in this repo carry a warning about it. Assert the location id on every call; feeds/live/ghl.js refuses any non-USDC location outright rather than trusting its caller. |
| Token | GHL_USDC_TOKEN env var, falling back to the file ghl-inventory/.token (gitignored, 41 bytes). Resolved by scripts/lib/ghl.js token(). Never read the token from ghl_config.json. |
| Host | services.leadconnectorhq.com |
| API version header | Conversations and messages: 2021-04-15. Opportunities: 2021-07-28. They are different and the wrong one fails quietly. |
| Shared transport | scripts/lib/ghl.js — read-only by design, with the note that anything written to GHL reaches a real person’s phone. Use it rather than a new https wrapper; there were five independent paginators in this repo before it existed. |
One pass gives phone, DND, owner and the CRM ref for the whole account. Measured 6 Oct 2026: 13,010 contacts, of which 12,966 carry a CRM ref.
| Point | Detail |
|---|---|
| Endpoint | GET /contacts/?locationId=<id>&limit=100 |
| Pagination | Cursor on meta.startAfter + meta.startAfterId — BOTH, or it loops. ~131 pages for the whole account, about two minutes. |
| Never probe per person | 12,500+ contacts means 12,500 requests for an answer one pass already gives you. The one-pass index is the only acceptable shape. |
| A short pull looks exactly like a finished one | Compare against meta.total and refuse to report a rate off a pull that came up short. feeds/live/ghl.js returns status: error with the count rather than pretending. |
companyName is the CRM order reference | This is THE join key between GHL and everything else. Written by a GHL workflow step called "update business name from reference code". Measured 6 Oct 2026: 12,966 of 13,010 contacts carry one. |
assignedTo is a GHL user id, not a name | Map it with the DESK table in scripts/reports/report_collector_calls.js, which holds ghlUser per collector. An id not in that table is a real finding, not a blank — 197 cards belong to three deleted staff accounts. |
Measured 6 Oct 2026: 1,464 blocked on SMS, 109 of them permanent. The tag holds about 432. If you take one thing from this page, take this one.
| Rule | Why |
|---|---|
| Read the FIELD, never the tag | dndSettings.SMS.status. The dnd enabled TAG holds about 432 contacts; the field says 1,464. Keying suppression off the tag is a 9x undercount — it would text a thousand people who asked us not to. |
| The polarity is back to front | "active" means the DND is ACTIVE, i.e. the channel is BLOCKED. "inactive" is the open one. Reading it the natural way round once reported 162 blocked against a real 1,448. |
"permanent" is a carrier-level opt-out | They replied STOP. It cannot be undone. Measured 6 Oct 2026: 109 of them. |
The master dnd: true is separate | It blocks everything regardless of dndSettings, and on this account those contacts carry no channel entries at all, so the two sets do not overlap. Check both. |
| Re-read it immediately before every send | Never off a cached flag. A STOP that arrived ten minutes ago still counts. send.js calls dndFor(contactId) per message, and if the read FAILS it refuses — could-not-check is not the same as not-blocked. |
| Point | Detail |
|---|---|
| List endpoint | GET /conversations/search?locationId=<id>&limit=100&sort=desc&sortBy=last_message_date |
| Cursor | startAfterDate, taken from the last row’s lastMessageDate. It is a DATE cursor, so a page that repeats its boundary will loop — stop when the cursor stops moving or no fresh ids arrive. |
| Volume | 13,001 conversations on the account, measured 6 Oct 2026. |
| The list row carries the ref | companyName is on the conversation itself, so threads join to the book without touching contacts. Also on the row: contactId, lastMessageDate, lastMessageDirection, lastMessageType, assignedTo, tags. |
| Messages endpoint | GET /conversations/<conversationId>/messages?limit=100. The payload nests: json.messages.messages. Each message has direction (inbound/outbound), body, dateAdded, messageType, status. |
| The two-pass trick for last-reply dates | Where lastMessageDirection is inbound, lastMessageDate IS the last reply — exact, free, no second call, and it covers about a fifth of threads. For the rest the last message was ours, so their reply is further back and the list cannot see it; fetch messages for those threads ONLY, and only for refs in today’s book. That is ~680 reads instead of 13,000. |
| Measured cost | A full pass is about 6.5 minutes. Far too slow to sit in a page load, so it runs on its own hourly clock and the page renders off whatever the last pass produced. On a cold start the column reads an em dash, which is true: we have not read the threads yet. |
| What it produced, 1 Oct 2026 | 728 of the book’s agreements had a conversation; 490 had a real last-reply date; 238 had never replied — read, not assumed. |
| Cell shows | Means |
|---|---|
| a date | They wrote to us on that day. Exact, off the thread. |
| Never | We READ the thread and found nothing from them. A fact about the customer. |
| — | We have not read the thread. A fact about our data. Collapsing this into "Never" turns a gap in our pipeline into a claim about a person, which is the single easiest way for this page to lie. |
Nothing sends today, and four independent things would each stop it on their
own — no staff account (every write is a 401), DESK_SEND_LIVE unset, no GHL token
on Render, no database. Turning it on is four deliberate acts, not one.
All server-side. A guard in the browser is a suggestion.
Not a cached flag. If the read fails, refuse — could-not-check is not not-blocked. Permanent (replied STOP) is an absolute stop.
Default 9:00am–8:00pm local, from the real IANA strings in city_config.json (which no cron in this repo currently uses). An unknown city falls back to America/New_York deliberately: it reaches 9am soonest and 8pm soonest, so an unknown can never be texted outside somebody’s hours.
An open complaint is a hard stop on texts, calls and sequence steps. So is a payment.
Free text may go out from a named person and is logged. It may never go out from the sequence. The body is also checked for the banned wording.
If the send fails we still know we tried. The refusal rows are the most useful ones in the table — they are the evidence the guards work.
| Thing | Detail |
|---|---|
| The switch | DESK_SEND_LIVE must be exactly the string "true". "TRUE", "1", "" and unset all stay dry. Written as an explicit equality so a missing env var can never be read as permission. |
| The payload | POST /conversations/messages with { type: "SMS", contactId, message } and Version: 2021-04-15. Same call modules/iconic-reminders/engine.js has been making safely in production — copy its shape, it is the proven one. |
| One sender only | DESK_ONE_SENDER_CONFIRMED must also be true before a live send. The GHL workflows and the Debt AI G-Sheet feed have to be switched OFF BY HAND first — workflows cannot be created or disabled through the API. Two senders means the customer gets both messages. |
| What must be switched off at cutover | "Debt not debt", "2nd Missed payment Automation", any other debt workflow that texts, and the Debt AI G-Sheet feed. Then keep push_square_declines_ghl.js in dry run or retire it. |
| Templates | The 11 reason-routed messages already exist in scripts/leads/push_square_declines_ghl.js at MESSAGES, with ACTION_FALLBACK for the codes they do not cover. Reuse them; do not write a twelfth. |
| The pay link | payLink(account) is the ONLY place a link is built, so Neil’s readable format changes in one place. Today it is /pay?c=<square customer id>. |
It is not a stub. Dry run does everything except the final HTTP call — it runs all five guards,
re-reads DND live, writes desk_sms and desk_activity with
dry_run = true, and returns exactly what it would have sent. That is what makes a
dry-run week worth reading: a log of zero sends to blocked contacts is only evidence if the
guards actually ran. Accept it when a week of it shows zero sends to DND contacts and zero outside
hours.
The desk does not talk to Square. It reads a file the nightly report already builds. That was the single best decision in this build — it means the desk and /square-declines can never disagree, and every Square trap stays handled in the one place that already handles it.
| Point | Detail |
|---|---|
| The desk does NOT call Square | It reads Reports/square_declines/declines.json, which report_square_declines.js (owner:"render") already builds every night with 40+ fields per failed payment. Same file report_chase_daily.js and the GHL push read. |
| Why that is the right shape | The desk and /square-declines can never disagree, every Square trap is already handled in the one place that handles them, and there is no second Square client to keep in step. |
| What the row carries | crmRef, customerName, phone, email, amount, reason, action, missNum, dueNow, nextDue, monthly, last4, cardBrand, cardType, recovered, cleared, orderId, paymentId, bucket. |
| What it cannot tell you | It is a declines feed, not a ledger. No balance, no deposit, no payment history. Those are the CRM, and the CRM is the one real placeholder left. |
| The ephemeral-disk problem | Render wipes the file on every deploy, so the desk falls back to sample data until the 7am cron or a visit to /square-declines rebuilds it. square.triggerRebuild() now makes that request itself, rate-limited to once per 20 minutes. |
| The one-off filter | Rows with bucket === "One-off" are Studio Sales card failures, not instalment agreements. The desk excludes them and says how many it excluded. |
Nine queues, in priority order. Order is the rule — an account is in the first one it matches.
| # | Rule |
|---|---|
| 1. Replied — waiting on you | Inbound SMS newer than our last outbound, not yet answered. |
| 2. Ring again now | Next contact is today and its time has passed. |
| 3. New misses to ring (day 0–3) | First missed payment in the last 3 days. Day 1 is about half of everything a missed first payment ever recovers. |
| 4. Promised to pay today | Promise date is today and the money has not landed. |
| 5. No reply to a text (24h+) | Texted 24h to 7 days ago, no reply since, no call since. |
| 6. Sequence steps due | A step that needs a person. |
| 7. Call-backs booked for later today | Moves up to queue 2 when its time comes. |
| 8. Zombie accounts | 4+ misses in a row, still billing, still owing. Due first, then ever-paid first, then longest untouched. |
| 9. Worked today | Acted on today with a future next contact. Drops to the bottom, never disappears. |
The first rule it matches, reading top down. assign() returns a single key, never a list, so a row cannot show up twice and inflate a count.
If one is set for today the account is in queue 2 or 7 whatever else is true. Somebody promised to ring at a time; that wins.
Queue placement is computed once in queues.js. But the moment a collector acts, the row has to move there and then — making the server’s answer unconditional meant you could log a call and watch the row sit still.
If their last message to us is unanswered the account goes to queue 1 whatever else is true — a zombie who has just written back is the warmest conversation on the book, not the coldest.
A paid account leaves every work queue and every count of work outstanding, and lands in its own group so you can still see what came back. The row says "Paid $X" and "Off the list".
Touch gaps, call windows, texting hours, the no-reply window, the zombie threshold and the hold-back percentage all live in desk_config. None of them are agreed yet, which is exactly why none of them are hardcoded.
What the desk shows that is not a measurement, and how it says so. This tab is the one to re-read before adding a column.
| Thing | What it does instead |
|---|---|
| Balance, deposit, instalments paid, ever-paid — on the LIST | The bulk ledger is not wired. All null, all render as an em dash. Never 0 — 0 says the customer has paid nothing. Open the account and the panel has the real figures. |
| Payment history in the account panel | Real since 7 Oct, read from the CRM for that one agreement. If the read fails the panel says why, in the place the lines would be — never an empty history. History lesson: the prototype used to GENERATE a plausible schedule when the server gave it none; against the real book that would have put an invented payment history under a named customer. That code runs in sample mode only. |
| Notes, logged calls, promises, next contact | Held in the browser. They change the page, and they are gone on refresh. Nothing is recorded until the database exists. |
| Replies, promises, call outcomes | These are the desk’s OWN records and the desk has not been used. The queues for them are genuinely empty rather than unpopulated — a real distinction. They cannot be backfilled from anywhere. |
| Owner, where GHL is unreachable | On Render today GHL cannot be read, so NOBODY is allocated and every account reads "Owner not known", naming the missing credential. Until 7 Oct the desk filled the gap with its own round-robin — and that guess was wrong four times in five (see Status now). |
In order. The first three are credentials and accounts; nothing after them matters until they are done.
scripts/desk/migrate.sql in the Supabase SQL editor. 16 tables, RLS on with NO policies — this project’s anon key is hardcoded in committed source, so the tables must be unreadable to it. The desk connects with the service-role key, which bypasses RLS and belongs only in Render’s environment.
SUPABASE_SERVICE_ROLE_KEY, GHL_USDC_TOKEN, and later DESK_KEY if the default is changed. Leave DESK_SEND_LIVE unset.
node scripts/reports/staff.js. Ten people, five collectors and five admins.
The CRM pulls are owner:"laptop" and reach Render only by git push. They should write desk_* rows to Supabase instead, which fixes the ephemeral disk and the never-pushed problem in one move.
The per-agreement read is done (feeds/live/crm.js schedule()). The bulk ledger() against feeds/contract.md is what fills the four dash columns on the list. Keep negative payment_debit lines — they are refunds.
node scripts/desk/selftest.js (58 offline checks) and node scripts/desk/render_check.js (renders the real page against the real book). Neither needs the network.
node scripts/desk/selftest.js — 58 checks, offline, no network.
| Area | What it proves |
|---|---|
| Language | 4 checks — the banned wording is blocked, correct wording passes. |
| Decline routes | 7 checks — 29 codes collapse to 4 routes, an unknown code falls to money and never to silence. |
| Queues | 11 checks — one account one queue, a payment takes it off every work queue but keeps it visible, next contact overrides, a past due time becomes tomorrow. |
| Feeds | 12 checks — a missing declines file reports not_wired with NO row count, proved by pointing it at a path that does not exist. |
| Sending | 16 checks — dry run unless exactly "true", customer-timezone hours, every guard refuses what it should. |
| Complaints | 5 checks — the hand-off blocks, the hand-back unblocks. |
| Database | 3 checks — absent is reported, an upsert without a conflict target is refused. |
node scripts/desk/render_check.js renders the
real page against the real book under a stub DOM. It exists because the desk once shipped a
blank page that every server-side check passed — the API returned 638 correct rows, the
JavaScript parsed, and one unguarded map lookup killed the whole view. node --check
cannot catch that; only running it can.
Every desk commit, in order. The commit messages carry the detail — each one says what was wrong and how it was found.
| Date | What changed |
|---|---|
| 25 Sep | Built from Neil’s brief and prototype, switched off. |
| 25 Sep | GoTo per-call service found alive; the complaints hand-off made two-way. |
| 25 Sep | The real book on the live URL — 752 agreements instead of 36 invented ones. |
| 25 Sep | "Unknown", not "Unassigned", when GHL cannot be read. The declines file rebuilds itself after a deploy. |
| 25 Sep | Fixed a blank "My day" that every server check passed; added render_check.js. Stopped the page inventing the morning rebuild. |
| 1 Oct | Build notes taken off the collectors’ page. Real last-reply DATES instead of buckets. The account panel opened, and had content. |
| 4 Oct | The book handed out so every collector had a day’s work (round-robin for ownerless accounts). |
| 5 Oct | A worked row moves. An outcome is noted first and saved with one button. |
| 6 Oct | Build handoff written for Mark. Search, a "Took a payment" outcome, and the who-paid section (18 agreements, $3,014.17 back that morning). |
| 19 Oct | CRM_COOKIE proven on Render — two account panels on the live desk returned real payment histories and crm_schedules reported ok. Cutover step 2 struck off. The other three blockers are unchanged: no GHL token, no service-role key, zero staff accounts (complaint_staff in Supabase holds 0). |
| 7 Oct | Card bank column (690 of 692 BINs resolve to a named issuer). CRM payment history in the panel. Notes card. Split-tender deposits summed. Owner guard — the round-robin was wrong 79% of the time and is now off when GHL cannot be read. The CRM status line reports its real last read. This handoff extended. |
Every one of these has already produced a wrong number or a broken page. They are in rough order of how much they cost.
| Trap | What it does |
|---|---|
| Allocating owners when GHL could not be read | With no token on Render every account came back ownerless and the round-robin handed the WHOLE book out by hash. Measured 7 Oct 2026: of 354 agreements with a real GHL owner, the guess matched 76 — 21%. Veronica, who owns nothing in GHL, was shown 117. The team said it first: "some of them said they are not their leads". allocate() now refuses when GHL is unavailable. |
| The CRM line that looks like a payment | A payment_order line with a credit and no type is the AGREEMENT total (package price), not money in. Summing it as a payment overstates what the customer has paid. |
| Split tender is one payment | At the studio people pay $50 + $200 + $100 on one day. That is $350 to the customer, so "last paid" sums the whole newest day. |
| The status page describing a feed from memory | It said "Square is a placeholder" after Square went live, and "CRM is a placeholder" for a day after the CRM history went live. Every status line must ask the feed. |
| GHL DND polarity | "active" = blocked. Cost a 9x undercount, 162 reported against a real 1,448. |
| The GHL tag is not the field | The tag holds 432; the field holds 1,464. |
| ghl_config.json is the wrong account | XcjF95QScPf2rxRSgp2e is near-empty and 403s with the USDC token. |
assignedTo on opportunities is stale | 219 in "Assigned to you" all point at one departed person. Never read ownership from opportunities. |
| Conversation cursor is a DATE | It will loop on a repeated boundary. Stop when it stops moving. |
| Messages nest twice | json.messages.messages, not json.messages. |
staff_auth.login and logout are ASYNC | Not awaiting them makes every login fail silently. |
Square /v2/payments without location_id | Returns the default location only. Once undercounted 47k against a real 151,318. The desk avoids this entirely by not calling Square. |
Recurring locations matched with === | Drops New York, whose location is named "Recurring NYC". Use /^Recurring/i. |
square_attempts.jsonl cannot reach a ref | It carries no order_id and no invoice_id. The ref lives in invoice.title. |
Ref prefix B is New York | Missing from the drift-check list in square_customer_import.js. Without it 35 agreements rendered as a second city called "newyork". |
generate_dashboard.js reads card.route | Not a top-level route on the manifest entry. Put it in the wrong place and the card 404s. |
*/15 inside a JS block comment | Terminates the comment. Cost one syntax error. |
| A stub DOM is not a browser | The render check caught a blank page but could not catch a fabricated number or a sentinel leaking into a heading. Screenshot the real page. |