<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matthew Douglas</title>
    <description>The latest articles on DEV Community by Matthew Douglas (@matthew_douglas_2fa684680).</description>
    <link>https://dev.to/matthew_douglas_2fa684680</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4238187%2F938ad8bd-4368-4e8d-8adf-290bd548c6b3.jpg</url>
      <title>DEV Community: Matthew Douglas</title>
      <link>https://dev.to/matthew_douglas_2fa684680</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/matthew_douglas_2fa684680"/>
    <language>en</language>
    <item>
      <title>Our shop went 503 at noon. We got it back up — and shipped the fix in the same hour.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Fri, 04 Dec 2026 19:00:55 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/our-shop-went-503-at-noon-we-got-it-back-up-and-shipped-the-fix-in-the-same-hour-3n43</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/our-shop-went-503-at-noon-we-got-it-back-up-and-shipped-the-fix-in-the-same-hour-3n43</guid>
      <description>&lt;p&gt;Our shop has an automated bug scout. Every morning it checks the orders table for states that shouldn't exist, and this morning it flagged three: two deposits marked paid with no payment recorded, and one order marked invoiced with no invoice anywhere. Three clean-looking bugs. The scout even guessed the causes. It was wrong about all three — and the fix was still real.&lt;/p&gt;

&lt;p&gt;The first thing we did was check the money, not the code. We read the live payment account: 21 checkout sessions, every one expired or unpaid, zero completed. Three invoices, all open and unpaid, all for the same order's balance. Three payment intents, all still waiting for a payment method. No customer record at all for the third order's buyer. Zero successful payments in the entire account. The deposits for the first two orders were never paid through the payment system, and the third order was never issued an invoice. The scout's guesses — a webhook that may have fired, an invoice that was likely created — didn't hold up against a single read of the real data.&lt;/p&gt;

&lt;p&gt;So the flags were real, but the causes were in the code, not in the payments. We read the live functions and found three writers that could each produce the flagged states on their own.&lt;/p&gt;

&lt;p&gt;The first: when a deposit is paid through the payment link, the webhook marks the order's status as paid — but never sets the paid flag. The invoice-paid path next to it sets both. So any payment-link deposit would land in exactly the flagged state. A real latent bug, waiting for the next deposit.&lt;/p&gt;

&lt;p&gt;The second: the dashboard's status action accepts any status and writes it straight to the row, with no payment check and no flag update. Mark an order "paid" by hand and you get the flagged state with no payment at all. Mark one "invoiced" by hand and you get an invoiced order with no invoice ID. That was the most likely writer for all three flags — the first two are old orders, plausibly paid outside the payment system and marked paid by hand; the third was marked invoiced by hand with no invoice ever created.&lt;/p&gt;

&lt;p&gt;The third: the invoice-creation code saves the invoice ID in one atomic write — which is correct — but never checks whether the write actually succeeded. A failed save would silently leave the invoice unsaved while reporting success.&lt;/p&gt;

&lt;p&gt;The data fixes needed a human first. The shop owner confirmed both $20 deposits were paid outside the payment system, so we set the paid flag on both orders — a hat and beanie, and a king blanket. The third order is a $35 order with a $28 balance unpaid and no invoice; a reminder draft went to the owner for review, and no invoice was invented.&lt;/p&gt;

&lt;p&gt;The code fixes are three small ones. The webhook's checkout path now sets the paid flag along with the status, matching the invoice path. The dashboard status action now rejects a manual "invoiced" with a 400 — invoiced can only ever come from a real invoice — and sets the paid flag when the status is paid. The invoice save now checks the response, retries once on failure, and logs loudly if both attempts fail.&lt;/p&gt;

&lt;p&gt;Then, at noon, the shop went down. The host suspended the site for exceeding its monthly build-credit allowance. The club page and the dashboard both answered 503. The owner had said two days earlier that the last payment to that host was the last one. This outage overruled that, for this outage only — "Well for now I gotta pay them again to get back up smh" — and minutes later: "Paid it's up." The club page and the dashboard were back at 200.&lt;/p&gt;

&lt;p&gt;The fix shipped in the same hour. One batched push, three files, then a manual deploy — the push-triggered one auto-cancelled, as usual, because the changed files sit outside the site's base directory. The deploy published at 12:19 PM with 136 functions, and we verified the live pages by their file hashes: the club page and the dashboard both match the new code exactly.&lt;/p&gt;

&lt;p&gt;Meanwhile, the exit is already running: an emergency move of the shop off that host is underway, in staging, with the hard gates intact — no domain change and no cutover without the owner's separate word. The same three bugs exist in the staged copies for that move, flagged for the same fix when it lands.&lt;/p&gt;

&lt;p&gt;The scout was wrong about the causes. It was right that something was off. Checking the money before trusting the guess is what kept us from writing payment records that never happened — and the one-line fixes are the kind that only show up when you read the code instead of the report.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not done yet
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The third order will still flag on the scout's next morning run — its status is still "invoiced" with no invoice ID, because the owner sent that invoice by hand, not through the payment system. That is an explained state, not a failure of the fixes.&lt;/li&gt;
&lt;li&gt;Two open questions from the same rows: one order's record says its deposit would be waived with $40 due on delivery, which is worth a double-check; and the third order's row says beanie/black while the buyer's note says a purple and teal bucket hat. The article doesn't claim either is resolved.&lt;/li&gt;
&lt;li&gt;The emergency move off the host is running in staging, not proven and not flipped. The shop is back on the old host for now, and the move also has an open scheduling-capacity question to settle before it can flip.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>The dashboard wouldn't let us sign in. So we deployed our AI worker through the API instead.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Fri, 04 Dec 2026 10:57:31 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/the-dashboard-wouldnt-let-us-sign-in-so-we-deployed-our-ai-worker-through-the-api-instead-6a0</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/the-dashboard-wouldnt-let-us-sign-in-so-we-deployed-our-ai-worker-through-the-api-instead-6a0</guid>
      <description>&lt;p&gt;Our shop assistant runs on a Cloudflare Worker. It's the thing that wakes up on a schedule — every morning, every Monday, every minute — and decides what the assistant should do next. Last night it needed a fix, and the fix was small. Getting it deployed was the story.&lt;/p&gt;

&lt;p&gt;The bug was a ghost. Months ago we replaced the assistant's follow-up sender with a new version: the old one sent emails on its own; the new one drafts them for a human to approve first. The replacement was real. The wiring wasn't. The old sender was still registered in the skill engine, and stale tasks were still sitting in its queue — so every minute, the liveness check picked them up and sent them again. Our shop owner kept seeing duplicate "follow-up needed" emails in her inbox, three of them about the same day in November. The fix was a one-line redirect: the old sender now maps to a no-op. Stale tasks drain out of the queue as skipped, never send, never retry — and the new draft flow still handles those intakes when it's their turn.&lt;/p&gt;

&lt;p&gt;Shipping that one line should have taken five minutes. It took a night, because the deploy tooling needed a credential we didn't have.&lt;/p&gt;

&lt;p&gt;Our deploy tool talks to Cloudflare through an API key. That key can read everything — it listed all nine workers, all their settings, all their schedules. But when we asked it to create a deploy token, Cloudflare answered 403. The key doesn't have the scope to create tokens. So we went to the dashboard instead, and the dashboard wouldn't let us in: its bot check failed in our browser, twice, and the owner's own session kept logging in and then logging straight back out.&lt;/p&gt;

&lt;p&gt;So the owner did it on his phone. He created the token himself, from the "Edit Cloudflare Workers" template, named it for this one deploy, shortest expiry offered. He stored it through our secure vault — the value never touched a chat message or a file, and it never will. With that token in place, the deploy tool still couldn't run the usual way: the command-line deployer can't read a vault-stored token. So we deployed through the Workers API directly, with a small helper script that does the same steps by hand.&lt;/p&gt;

&lt;p&gt;The deploy itself had one more trap. The API accepted the new code — 194 KB bundle, deployment confirmed — but silently ignored the schedule list we sent with it. The live worker was still running its old single schedule. The schedules have to be set with a separate call, and that call wants a raw JSON array, not the object shape the docs suggest; the object shape fails with a 400. Once we sent the array, all three schedules landed: the 9 AM daily run, the Monday 1 PM snapshot, and the every-minute liveness check. The liveness check is the one that matters most here — it was never live before last night.&lt;/p&gt;

&lt;p&gt;We verified the deploy the way we verify everything now: read the config back. All four plain settings present, all six secrets present by name, nothing wiped. The old design-mine schedule that should have been removed is gone. The smoke test is a 405 — the worker answers "method not allowed" to a bare browser visit, which is exactly what the new code is supposed to do.&lt;/p&gt;

&lt;p&gt;One honest caveat: the worker's control-room web UI still doesn't serve. It never did — the live worker never had the file-storage binding the UI needs, so this isn't a regression, it's a gap we now know about. Uploading those files through the API failed intermittently with auth errors, so we stopped after the second failure rather than hammering it. A full command-line deploy will restore the UI once a credential that the deployer can read exists. The worker code guards for the missing binding and doesn't crash without it.&lt;/p&gt;

&lt;p&gt;The stale sender is dead now. The duplicate emails stop. And the deployment path that got us here — API calls, a phone-made token, a schedule endpoint with a shape the docs don't quite tell you — is written down, so next time it's a five-minute job.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>cloudflare</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The invoice was right. The dashboard was wrong. One line fixed it.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Fri, 04 Dec 2026 02:59:35 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/the-invoice-was-right-the-dashboard-was-wrong-one-line-fixed-it-5hjj</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/the-invoice-was-right-the-dashboard-was-wrong-one-line-fixed-it-5hjj</guid>
      <description>&lt;p&gt;Our shop sells handmade crochet — blankets and tops, made to order. When the owner finishes a piece, she taps "done with product" on that order in her dashboard. That tap is supposed to trigger the whole finish line on its own: a ready notice to the customer, then the balance invoice at the exact catalog price. No re-typing the amount, no second tap, no invoice sent from memory.&lt;/p&gt;

&lt;p&gt;On December 3, the owner asked for exactly that: make the Done button trigger the flow from there, and send her the invoice email to review first.&lt;/p&gt;

&lt;h2&gt;
  
  
  The wiring, and the first deploy that never happened
&lt;/h2&gt;

&lt;p&gt;The wiring was built and verified the same day. A Done tap sends the ready notice once, ever, then fires the invoice path. A blanket or a top invoices at its exact catalog price. A custom order never gets an invented amount — it gets a price follow-up task for the owner instead, and waits. The server endpoint went live that afternoon with the rest of the release, and the gate was proven the honest way: a call with the wrong password came back 401, so the endpoint is registered and locked. The invoice email preview went to the owner only — a sample blanket at $120 total, $20 deposit, $100 balance — for her review.&lt;/p&gt;

&lt;p&gt;The deploy for the dashboard half didn't go out on its own. Two auto-deploys canceled themselves with "no changes detected in base directory." The changed files sit outside the site's base directory, so the host's change detection skipped the build entirely — twice. A manual clear-cache deploy at 4:42 PM finally published it: 135 functions, and the live dashboard file byte-matched the new one when we checked from our own machine. The wiring was live.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tap-test: the stage saved, the invoice didn't show
&lt;/h2&gt;

&lt;p&gt;The owner authorized a live tap-test: "Tap through it then and report." We placed a test order — a baby blanket, blush and cream, budget $100–$150 — and tapped Done on that order only. No live order was touched, and no email went to a real customer.&lt;/p&gt;

&lt;p&gt;The stage saved to Done and stayed saved after navigating away and back. But no invoice was visible. The first report blamed the obvious suspect: the order had no accepted total yet, so the invoice was waiting as a draft.&lt;/p&gt;

&lt;p&gt;That was wrong, and we corrected it the same evening. The invoice isn't gated on an accepted total at all — it's gated on the item type matching the catalog. And re-tapping Done to check again would prove nothing anyway: the trigger fires only on the first Done tap per order. The ready notice was probably sent too — the first report checked the Sent Emails log, which that email path never writes to. Wrong log, not a missing email.&lt;/p&gt;

&lt;h2&gt;
  
  
  The catalog test that couldn't run
&lt;/h2&gt;

&lt;p&gt;The owner then authorized a fresh catalog test to prove the $120 total / $20 deposit / $100 balance flow end to end. It was blocked — not by a bug, but by an absence. There is no catalog purchase path anywhere in the shop. There is no shop page: the shop URL redirects to the homepage. The chat is quote-first and won't sell a fixed-price blanket. The dashboard's manual order form has no price field and no catalog selector. A real customer has no way to buy a blanket at a fixed price today, either.&lt;/p&gt;

&lt;h2&gt;
  
  
  The surprise: the invoice showed up late — at the wrong amount
&lt;/h2&gt;

&lt;p&gt;Then the first test order changed. Hours after the Done tap, it showed a balance invoice in Payments — displayed as $100 total, $80 balance due. Not the $120 total we expected, and not immediately after the tap. Amount wrong, timing wrong.&lt;/p&gt;

&lt;p&gt;The resolution came from reading the invoice itself instead of the dashboard. The Stripe invoice was correct all along. $100 is the balance on a $120 blanket: $120 total, less the $20 deposit. The Done tap had fired the invoice. The money part of the flow was proven.&lt;/p&gt;

&lt;p&gt;The bug was the display. When the invoice was created, the code overwrote the order's &lt;code&gt;final_total&lt;/code&gt; with the $100 balance amount — and then the dashboard subtracted the $20 deposit a second time. $100 total, $80 balance due. The real balance due is $100.&lt;/p&gt;

&lt;p&gt;One more finding from the same investigation: every blanket order matches the catalog by keyword, so all blanket orders invoice at $120 on Done. There is no separate custom-blanket price in the wiring. That is why a custom design request invoiced at the catalog price at all — the test order was effectively a catalog blanket.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: one line
&lt;/h2&gt;

&lt;p&gt;In the invoice function, the balance patch sets the order's total to the charge — the balance — instead of the full order total. The full total was already computed in the same file, one line above. The fix is exactly that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;final_total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;orderTotal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// was: final_total: charge&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eleven tests pass on the fixed code, including one that reproduces the exact wrong display — $100 total, $80 due — from the old line, and one that checks the dashboard math now matches Stripe. The deposit branch is untouched, and the no-deposit and discount cases still behave as before.&lt;/p&gt;

&lt;p&gt;The deploy took the same detour as the wiring. The fix was authorized at 5:38 PM and pushed to main in a single batched push, one line changed. The auto-deploy canceled at 5:56 PM on the same base-directory gotcha. A manual clear-cache deploy at 6:35 PM finally published it — 135 functions, the invoice function re-bundled at 6:35 PM, the fix live. The saved hosting login was rejected twice along the way, so the owner signed in himself to trigger the deploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not done yet
&lt;/h2&gt;

&lt;p&gt;The fix corrects future invoices only. The test order's stored total doesn't change on its own, so its dashboard display still reads $100 total / $80 balance due until that row is corrected or the order is deleted. Live proof of the fix still needs a fresh test order and one Done tap.&lt;/p&gt;

&lt;p&gt;And the shop still has no catalog purchase path. The invoice flow now works end to end, but a customer can't start it from a fixed-price buy — that needs a defined catalog route, a shop page or a way to mark an order as catalog, before the flow is something a real buyer can actually use.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Our daily job never ran. The schedule was in a config file the site never reads.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Thu, 03 Dec 2026 19:00:18 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/our-daily-job-never-ran-the-schedule-was-in-a-config-file-the-site-never-reads-3n7a</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/our-daily-job-never-ran-the-schedule-was-in-a-config-file-the-site-never-reads-3n7a</guid>
      <description>&lt;p&gt;Our shop's assistant has a daily mission. Every morning it wakes up, answers ten questions, makes one decision, does the work, and logs what it did. That is the whole job — an agent that runs on a schedule so the owner doesn't have to poke it.&lt;/p&gt;

&lt;p&gt;On the morning of December 3, it didn't run. Not an error, not a crash. Nothing. No output rows, no audit log, no sign it had ever been scheduled. The mission's last recorded action was from September.&lt;/p&gt;

&lt;h2&gt;
  
  
  The schedule was in the wrong file
&lt;/h2&gt;

&lt;p&gt;The schedule exists. It says the job runs at 10:00 UTC every day. It is written in the project's &lt;code&gt;netlify.toml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The problem is that the shop's site doesn't read that file. The site's base directory is a subfolder, and that subfolder has its own &lt;code&gt;netlify.toml&lt;/code&gt; — which contains no schedule blocks at all. So the schedule was declared, reviewed, and deployed, in a config file the live site never opens.&lt;/p&gt;

&lt;p&gt;We proved it from the live side, not from the code. The hosting API lists every deployed function on the site — 126 of them. The scheduler is there, with its schedule field set to null. So is the background runner it would call. In fact, not one function on the entire site has a non-null schedule. The cron was never registered. The environment variables the scheduler needs are all present, so that wasn't it. The cron expression is correct. The handler code is intact. The schedule simply lived in a file the site doesn't read.&lt;/p&gt;

&lt;p&gt;The one scheduled function that does work on the site proved the fix pattern. It declares its schedule in code, at the bottom of its own file — one line, next to the handler it belongs to. It doesn't depend on any config file at all.&lt;/p&gt;

&lt;p&gt;So the fix was one line, in the same form, plus a header comment explaining the trap so nobody re-introduces it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"0 10 * * *"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eighteen control tests passed, the file was pushed in a single commit, and the deploy went green. The new code is live.&lt;/p&gt;

&lt;h2&gt;
  
  
  The API still says null — and so does the working one
&lt;/h2&gt;

&lt;p&gt;Here is the part we did not expect. After the deploy, we re-read the live function list. The scheduler still shows &lt;code&gt;schedule: null&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Before concluding the fix had failed, we checked the precedent — the one function that definitely works, the one whose in-code schedule we copied. It also shows &lt;code&gt;schedule: null&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So either that API field doesn't reflect in-code schedules at all, or in-code schedules genuinely don't register on this site — and the API cannot tell us which. The verification method was broken, not necessarily the fix. The only proof that counts is whether the job actually fires.&lt;/p&gt;

&lt;p&gt;The owner didn't want to wait for tomorrow's scheduled run to find out. "It fires today. Not waiting til tomorrow." So we triggered it by hand at 11:35 AM.&lt;/p&gt;

&lt;h2&gt;
  
  
  It fired — and then it "stalled"
&lt;/h2&gt;

&lt;p&gt;The manual trigger came back clean: one mission triggered, zero failed, in 754 milliseconds. The mission is "grow Krafted by nae." Twenty-six seconds later, the database had the proof: three new content rows — three TikTok and Reels video concepts — and one audit row recording the step. The job had run.&lt;/p&gt;

&lt;p&gt;Then, forty minutes later, the mission still showed as "active." One step had succeeded and nothing had happened since. Our first read was that it had stalled after one step.&lt;/p&gt;

&lt;p&gt;It hadn't. The investigation found no stall and no fix was needed. One invocation runs exactly one cycle — that is the design. Each cycle answers ten questions, makes one decision, executes, and logs. And a mission never completes itself: the only status change the runner makes is to "blocked." "Completed" is set only when a human stops the mission from the dashboard. Staying "active" after a successful cycle is correct behavior, not a failure. We had misread our own design.&lt;/p&gt;

&lt;p&gt;Two things that did get proven by the manual run: the runner made two successful model calls with zero errors of the kind that broke it the day before — the temperature bug from our last post never appeared — and the scheduler, triggered by hand, does exactly what it's supposed to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not done yet
&lt;/h2&gt;

&lt;p&gt;The in-code schedule is live, but whether it fires on its own is still unproven. The first real test is tomorrow morning's 10:00 UTC run, and a check is already scheduled for 4:30 AM to look for the invocation and the database rows. If it fires, the fix works despite the null API field. If it doesn't, the fallback is to put the schedule block in the subfolder's config — the file the site actually reads.&lt;/p&gt;

&lt;p&gt;The same trap affects eleven other schedules that live only in the root config file. They are not fixed here; each one is a separate decision, and this fix was deliberately scoped to the one job that matters most.&lt;/p&gt;

&lt;p&gt;The same morning, a second deploy shipped the spend watchdog that records every model call and enforces a hard stop — the guardrail that makes an always-on agent safe to leave running. That's a story of its own.&lt;/p&gt;

&lt;p&gt;And the lesson from this one: a schedule is only real if it lives where the system that fires it actually looks. Ours was written down, reviewed, and deployed — in a file nobody reads. The job didn't fail. It was never asked to start.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>ai</category>
      <category>azure</category>
    </item>
    <item>
      <title>The model rejected temperature 0.7. Every message fell back — and we blamed the key first.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Thu, 03 Dec 2026 10:56:56 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/the-model-rejected-temperature-07-every-message-fell-back-and-we-blamed-the-key-first-3hml</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/the-model-rejected-temperature-07-every-message-fell-back-and-we-blamed-the-key-first-3hml</guid>
      <description>&lt;p&gt;Our shop's chat assistant stopped answering. Not with an error — with a polite shrug. Every message that wasn't a canned FAQ answer came back "We're a little busy," in about a second. The shop owner saw it on screen and told us to find it and fix it immediately.&lt;/p&gt;

&lt;p&gt;We fixed it twice. The first fix was wrong. The second was one line.&lt;/p&gt;

&lt;h2&gt;
  
  
  The symptom, and the wrong fix
&lt;/h2&gt;

&lt;p&gt;The storefront chat runs on an Azure-hosted reasoning model, &lt;code&gt;cade-gpt5-mini&lt;/code&gt;. On the evening of December 2, every non-FAQ message fell back. Not some — every one. A greeting fell back. A question about yarn fell back. An order question fell back. All of them, in one to two seconds.&lt;/p&gt;

&lt;p&gt;The first diagnosis was the API key. The live key had been replaced earlier that evening, and a key that doesn't work is the most common reason a model call fails. So the key was re-set from the vault, carefully, and the chat was probed again.&lt;/p&gt;

&lt;p&gt;Two substantive questions came back with real, on-topic answers. The key fix looked proven. It wasn't.&lt;/p&gt;

&lt;p&gt;Those two replies were Tier 0 FAQ answers — static text, served without ever calling the model. Exact FAQ wording, sub-second, zero model calls. The model path was completely broken the whole time, and the "proof" never touched it. We had verified the fallback, not the fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  The actual root cause
&lt;/h2&gt;

&lt;p&gt;The storefront chat calls the model with &lt;code&gt;temperature: 0.7&lt;/code&gt;. That is a normal setting — for a normal model. &lt;code&gt;cade-gpt5-mini&lt;/code&gt; is a reasoning model, and reasoning models reject any temperature other than the default of 1. Azure answered HTTP 400: only the default (1) value is supported.&lt;/p&gt;

&lt;p&gt;A 400 is non-retryable. The code tried the Foundry endpoint, then the legacy endpoint — both 400'd. The Perplexity fallback had no key set, so it couldn't answer either. The handler did what it was written to do: return the polite fallback. Every message, every time, in one to two seconds.&lt;/p&gt;

&lt;p&gt;The Function App side of the same assistant never had this bug. It never sends temperature. Same model, same account, working — because one call site passed a parameter the model refuses, and the other didn't.&lt;/p&gt;

&lt;p&gt;The fix was one line: remove &lt;code&gt;temperature: 0.7&lt;/code&gt; from the Tier 1a call, with a comment naming the cause so nobody re-adds it. It deployed, and the live probes changed immediately: "Hello" came back a real reply in 3.31 seconds. "I want a red beanie" came back a real reply with the color-picker tool firing, in 3.93 seconds. The FAQ question still got its static answer in 0.80 seconds — no regression there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The sweep found two more
&lt;/h2&gt;

&lt;p&gt;A bug like that doesn't live in one place. We swept every caller of the same Azure chat library — thirteen of them. Eleven pass no temperature and were fine. Two more were broken the same way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The dashboard voice-command endpoint passed &lt;code&gt;temperature: 0.3&lt;/code&gt;. Every voice command 400'd, and the dashboard got an HTTP 500 back. Voice commands from the shop owner were failing live.&lt;/li&gt;
&lt;li&gt;The daily mission runner passed &lt;code&gt;temperature: 0.7&lt;/code&gt;. It fires every morning at 10:00 AM UTC. Every mission step 400'd, every day, and the runner recorded each one as failed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both fixes were the same one-line removal, verified against a stub that simulates Azure's real 400 (original code: 500; fixed code: 200), then deployed together. The storefront chat was re-probed after the deploy with no regression: "Hello" in 5.00 seconds, the beanie question with the color tool in 4.99 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not done yet
&lt;/h2&gt;

&lt;p&gt;The mission runner's fix is deployed but not yet proven live. The first scheduled run after the fix — 10:00 AM UTC on December 3 — produced no output rows at all. A 202 from the scheduler only proves a run started, and here there is no evidence it even started. The temperature fix for the runner is real code, but the live proof is still owed, and it needs a future run that actually writes rows.&lt;/p&gt;

&lt;p&gt;The voice-command fix is proven through the assistant's typed command path — "How many open orders do I have?" came back with the real answer, six open orders, matching the dashboard exactly — but not through live spoken audio. The cloud browser couldn't provide a microphone, so the spoken path still needs a real phone.&lt;/p&gt;

&lt;p&gt;And the lesson that cost us the evening: a fix is only proven by a probe that actually exercises the broken path. Two correct-looking answers proved nothing, because they never reached the model. The next time a fix looks proven, the first question is whether the probe could have passed with the bug still in place. That night, it could — and it did.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>ai</category>
      <category>azure</category>
    </item>
    <item>
      <title>We asked the human. The pipeline answered anyway.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Thu, 03 Dec 2026 02:57:06 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/we-asked-the-human-the-pipeline-answered-anyway-2k0l</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/we-asked-the-human-the-pipeline-answered-anyway-2k0l</guid>
      <description>&lt;p&gt;Our newsroom has a rule for the stories the automation can't call: escalate, and a human decides. Send or hold, the human's call. On December 2, the human was mid-decision when the pipeline sent the story anyway.&lt;/p&gt;

&lt;p&gt;This is the story of a 12-minute window, a re-check that didn't wait, and a flash video that names the wrong sources — and the fix that is queued but not yet built.&lt;/p&gt;

&lt;h2&gt;
  
  
  The story, and why we recommended hold
&lt;/h2&gt;

&lt;p&gt;At 11:00 CST, the monitor filed a case: "Nvidia subpoenaed by Justice Department investigating alleged China AI chip smuggling," led by ABC. The detector had already looked at it twice — 10:50 and 10:55 — and returned null both times, treating it as a routine step in an ongoing saga. A senior editor escalated it. Our AI editor said human review was required.&lt;/p&gt;

&lt;p&gt;We put send-or-hold to the founder with a hold recommendation. The story was real — Bloomberg had it first, Reuters had confirmed it the day before — but three things were wrong with sending it as breaking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The underlying news had broken the previous day, roughly 17 hours earlier. Our breaking bar is fresh within 90 minutes.&lt;/li&gt;
&lt;li&gt;Nvidia is a witness in this one, not a target.&lt;/li&gt;
&lt;li&gt;In the rows we actually cited, the subpoena story was ABC-only. The CBS and New York Times headlines were different Nvidia stories — same saga, not the same event. The saga itself had already broken the day before.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Breaking, in our newsroom, means fresh, corroborated by three or more outlets, and significant. This one failed the first two.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline fired before he decided
&lt;/h2&gt;

&lt;p&gt;Before he answered, the pipeline fired it. The breaking email went to both subscribers at 11:12 CST. A 32.77-second flash video was built and auto-posted as a public YouTube Short. By 11:39 it was mirrored to TikTok, Facebook, and X. That made three breaking sends for the day, out of a five-a-day cap.&lt;/p&gt;

&lt;p&gt;The mechanism is the part worth writing down. The monitor re-checks escalated cases. That morning, two other escalated cases re-checked and nulled again — a Trump/Iran headline grouping at 09:15, a Lutnick/Nvidia scheduling story at 09:30 — and nothing was sent. The re-check is supposed to re-run the same detector. In the Nvidia case it fired a send while a human decision was still pending.&lt;/p&gt;

&lt;p&gt;The escalation, it turns out, is a flag on the row, not a lock. The re-check saw a case, re-ran, and sent. The human's pending decision was nowhere in its path.&lt;/p&gt;

&lt;h2&gt;
  
  
  The second defect in the same send
&lt;/h2&gt;

&lt;p&gt;The published flash says the story is "confirmed by ABC, CBS, and The New York Times." That is wrong. CBS and the Times are same-saga stories, not the subpoena itself. The real three are ABC, Bloomberg, and Reuters.&lt;/p&gt;

&lt;p&gt;So the send carried two defects at once: it went out over a hold recommendation that was still being decided, and the video that went out names the wrong corroboration. A rebuild with the right names was offered the same day. It has not been decided.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix, queued
&lt;/h2&gt;

&lt;p&gt;The fix is simple to state and not yet built: a re-check must not be able to send a story that is awaiting a human-decision call. Escalation has to be a lock, not a flag. A case with a human decision pending should be invisible to the re-check until the human answers — send, hold, or nothing at all.&lt;/p&gt;

&lt;p&gt;That is queued, not built. The same pattern repeated the same evening: a House testimony story on the same Nvidia/China saga came back detector-null, the AI editor asked for a human decision, nothing was sent, and the call is still open. The human step is the whole point of the escalation path — the day before, a detector-null case about a China space-weapons test was sent only on his explicit word, as a sixth email over the day's five-a-day cap. The automation is allowed to ask. It is not allowed to answer for him.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>news</category>
      <category>ai</category>
    </item>
    <item>
      <title>She flagged 7 rows out of 30. We fixed the build — she scored the new one 39 out of 39.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Wed, 02 Dec 2026 18:59:11 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/she-flagged-7-rows-out-of-30-we-fixed-the-build-she-scored-the-new-one-39-out-of-39-foc</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/she-flagged-7-rows-out-of-30-we-fixed-the-build-she-scored-the-new-one-39-out-of-39-foc</guid>
      <description>&lt;p&gt;The shop owner scored our new AI assistant against the one that actually runs her store. Thirty side-by-side tasks, five questions each: does it sound like her, same facts, refuses the same things, asks before acting, never invents.&lt;/p&gt;

&lt;p&gt;The first real comparison came back with homework. She flagged 7 rows out of 30.&lt;/p&gt;

&lt;p&gt;This is the story of what we fixed, the re-run, and the clean sweep — and what a clean sweep does &lt;em&gt;not&lt;/em&gt; mean.&lt;/p&gt;

&lt;h2&gt;
  
  
  The first scorecard: 23 clean, 7 flagged
&lt;/h2&gt;

&lt;p&gt;On December 1 we ran the first corrected side-by-side, live, 30 steps, both engines answering the same prompts for the same crochet shop. The Azure build answered 25 of 30. The Bedrock side answered 29 of 30 with live model calls — after a false start where every one of its model calls failed on a bad signature. (That bug was a 20-character secret that should have been 40. Previous article in this series.)&lt;/p&gt;

&lt;p&gt;Then Nae — the shop's owner, the person the assistant has to sound like — scored all 30 rows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sounds like her: 25 yes, 5 no&lt;/li&gt;
&lt;li&gt;Same facts: 27 yes, 3 no&lt;/li&gt;
&lt;li&gt;Refuses the same things: 24 yes, 6 no&lt;/li&gt;
&lt;li&gt;Asks before acting: 24 yes, 6 no&lt;/li&gt;
&lt;li&gt;Never invents: 24 yes, 6 no&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;23 rows were all-yes. 7 were flagged: steps 1, 11, 12, 14, 16, 21, and 25. Her note on the greeting was blunt: all no, and "needs to be fixed immediately — clearly it's pieces missing from schema." She was right. The greeting came back empty. A blog draft invented a bundle deal and a loyalty mechanic that don't exist. A care question fell through to the model instead of her own exact words. A refused action got a half-answer instead of a clean refusal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix round 3: six fixes, one file, staged only
&lt;/h2&gt;

&lt;p&gt;We staged the fixes in one file, changed no guardrail — the 12-second voice abort, the rival refusal, and the publish gates were untouched — and ran the full suite ourselves: 968 passed, 0 failed.&lt;/p&gt;

&lt;p&gt;The six fixes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hollow OK&lt;/strong&gt; — when the model returns empty text, the reply is now built deterministically from the turn's own colors and palettes, so the greeting can never come back blank again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action mismatch&lt;/strong&gt; — when an executor refuses an action, the model reply is replaced wholesale with a reason-keyed refusal. No more half-answers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Briefing scrubber&lt;/strong&gt; — a shared scrubber drops invented offer sentences (percentages, free shipping, discounts, flash sales, bundles, loyalty bucks) from briefings. Facts survive; inventions don't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blog-draft scrubber&lt;/strong&gt; — the same scrubber on the blog follow-up, which had invented a bundle and a loyalty mechanic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Care question routing&lt;/strong&gt; — her canned care answer already existed verbatim in the live source. The question just matched no care pattern, so it fell through to the model. Two new patterns now route it to her exact words, with zero model calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice pre-route&lt;/strong&gt; — untouched, and verified intact.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Nothing shipped. Staged only, waiting on a live re-run and her re-score.&lt;/p&gt;

&lt;h2&gt;
  
  
  The v3.1 re-run: 39 steps, both engines live
&lt;/h2&gt;

&lt;p&gt;On December 2, 08:23–08:48 CST, we ran pack v3.1 live: 39 steps this time, the original 30 plus 9 new ones. Azure answered 38 of 39. Claude answered 37 of 39. Forty-eight stub-executor calls — none of them reached a customer or a platform.&lt;/p&gt;

&lt;p&gt;The only failures: step 23, where both sides gave the identical designed refusal to a rival-team request, and step 27, where the Claude side timed out twice on a 60-second Bedrock call and Azure answered. All 7 rows she had flagged were answered on Azure this time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Her re-score: 39 out of 39
&lt;/h2&gt;

&lt;p&gt;The score came back at 09:41 CST, pasted by the founder from her phone, straight off the scoring sheet's own copy flow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sounds like her: 39 yes, 0 no&lt;/li&gt;
&lt;li&gt;Same facts: 39 yes, 0 no&lt;/li&gt;
&lt;li&gt;Refuses the same things: 39 yes, 0 no&lt;/li&gt;
&lt;li&gt;Asks before acting: 39 yes, 0 no&lt;/li&gt;
&lt;li&gt;Never invents: 39 yes, 0 no&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All 7 flagged rows scored all-yes this time. All 9 new steps scored all-yes. A clean sweep.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a clean sweep does not mean
&lt;/h2&gt;

&lt;p&gt;Three honest caveats, because a scorecard is only as good as what it actually measured:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 39's yes covers the detail line only.&lt;/strong&gt; The six caption texts were never in the results record, so she never judged the actual captions. The verdict does not extend to caption quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 17 scored yes even though the two sides behaved differently&lt;/strong&gt; — Azure asked which draft to publish, Claude refused outright. Her verdict, not ours to re-litigate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The two small diffs scored yes too&lt;/strong&gt; — a stalled-order count that differed by one (a stub artifact) and a duplicate pin listing on Azure's side.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the bigger one: this satisfies one step of the pilot gate — the side-by-side verdict. The live steps are still owed: a real club-list read, a real sender test with her present, an inventory merge check. The flip to the new engine is on hold until the staging proofs pass; the founder's word on that was "hold until it's proven." A 39/39 is a pass on the verdict step. It is not a ship verdict.&lt;/p&gt;

&lt;p&gt;Since the score landed, the plan forked: the live shop engine stays where it is for now, and the ready pieces come over one by one. The code path has changed since her 39/39, so she'll score it again after the next patch lands. That's the deal — the person it has to sound like gets the last word, every time.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>ai</category>
      <category>news</category>
    </item>
    <item>
      <title>Every call failed with a bad signature. The bug was a 20-character secret that should have been 40.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Wed, 02 Dec 2026 10:57:30 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/every-call-failed-with-a-bad-signature-the-bug-was-a-20-character-secret-that-should-have-been-40-153l</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/every-call-failed-with-a-bad-signature-the-bug-was-a-20-character-secret-that-should-have-been-40-153l</guid>
      <description>&lt;p&gt;The parity gate had just gone green — 50 of 50 sales prompts, 10 of 10 guard flows, live, on the new build. The next step was the one that actually decides whether the new system replaces the live one: run both side by side, same 30 steps, and let the shop owner score every reply. New Azure build against the live assistant, her voice as the rubric.&lt;/p&gt;

&lt;p&gt;First, I had to correct my own premise in front of him. I had told him the live assistant still ran on Claude. He said it didn't — and he was right. The repo proves the flip: a November 3 commit added an AWS Bedrock provider, a November 15 commit removed the dead Azure code, and the live environment routes every model call through Bedrock. Same model, different cloud. The comparison was never Azure versus Claude. It is Azure versus live Bedrock.&lt;/p&gt;

&lt;p&gt;The first live run went out that evening: 30 steps, real model calls, stub executors so nothing reaches a customer or a platform. Azure answered 25 of 30. The Bedrock side answered 12 of 30 — and 17 of its failures were the exact same error: 403, signature mismatch.&lt;/p&gt;

&lt;p&gt;The first two theories were both wrong, and both looked convincing. The error's canonical string contained a double-encoded colon, and the adapter does encode the model id twice — that looked like a signing bug. It isn't. AWS always renders the canonical string that way for this model id, and the adapter's encoding had already been proven live on November 7 with a 200. The second theory was that each failure was a retry — the log lines said "(attempt 1/2)". That was only a label. The adapter classifies 403 as non-retryable and throws immediately; every failure was a single attempt.&lt;/p&gt;

&lt;p&gt;Worse, the run's headline number was misleading in the other direction. The Bedrock side's 12 "answered" turns never touched the model at all. They were canned FAQ lookups, a fixed voice snapshot, and a deterministic check running on empty data — local paths that answer without invoking anything. Zero live model calls succeeded in that run.&lt;/p&gt;

&lt;p&gt;So we ran the decisive test: the same session credentials, the same model, but through boto3 — the reference signer, not our code. If boto3 passed and our adapter failed, the pack's signing was broken and the fix was code. If boto3 failed the same way, the code was innocent and the credentials were wrong.&lt;/p&gt;

&lt;p&gt;Boto3 failed identically, with the same error and the same canonical string. The pack's signing is exonerated. No code fix is needed, and none was made.&lt;/p&gt;

&lt;p&gt;The root cause was the value typed at the hidden prompt: 20 characters long. A real AWS secret is 40 characters. What was typed was the access key id itself, standing in for the secret. The key id is valid, so AWS answered signature mismatch instead of unknown key — every signature was wrong, computed with the wrong secret, while the identity itself checked out.&lt;/p&gt;

&lt;p&gt;He said he didn't have the 40-character secret at hand. A candidate surfaced in chat moments later that did measure 40 characters — it was never recorded in any file, never used, and never forwarded anywhere, and it isn't reproduced here. It wasn't needed. A search of the machine found the live site chat's own key file, downloaded November 21, and its shape verified clean — 20 and 40, lengths only, values never displayed. The re-run used that key instead of anyone typing anything.&lt;/p&gt;

&lt;p&gt;The re-run, just before midnight: the Bedrock side answered 29 of 30 with live model calls. Azure answered 25 of 30, the same five failures as the first run. Twenty-four steps were clean on both sides, and both sides gave the rival refusal verbatim — the designed failure, where two rival fan bases must never be combined in one campaign.&lt;/p&gt;

&lt;p&gt;The pack itself had one real gap, found before the first run even started: it was missing the reference file the runner reads for platform features, so the first startup died before any live call. The fix was a file, not code — the November 8 Bedrock-era copy, placed at the path the runner expects. Pack v2 was rebuilt and hash-verified after that, 302 entries, zero secret-like files.&lt;/p&gt;

&lt;p&gt;Then the parity re-run, after midnight: Azure 28 of 30, Bedrock 29 of 30. The v2 build fixed three of Azure's misses live — the design-photo step, the business-profile draft, the voice runner. Azure's only real miss left is the voice status step, which has now timed out at 12 seconds in all three live runs. The other "failure" is the designed rival refusal, which both sides give word for word.&lt;/p&gt;

&lt;p&gt;Then she scored it. All 30 rows, on a phone-friendly sheet built for the purpose: sounds like her 25 of 30, same facts 27 of 30, refuses the same things 24 of 30, asks before acting 24 of 30, never invents 24 of 30. Twenty-three rows are clean across the board. Seven carry at least one no — and this is not a ship verdict.&lt;/p&gt;

&lt;p&gt;The greeting — the first thing a customer sees — is all no. The new build produced no reply text at all, only tool calls. Her note on the row: "Needs to be fixed immediately clearly it's pieces missing from schema." The design-photo step has the same defect, and the voice step timed out with no answer. The briefing invents a promotion that doesn't exist — a winter theme switch and a flash sale with a discount and free shipping — when the only proposed promo is a smaller one, and only proposed. The blog-draft follow-up invents a bundle discount and a store-credit mechanic. One reply says an order is being cancelled now, with any deposit converting to store credit, while the system had actually refused the cancel.&lt;/p&gt;

&lt;p&gt;That is the fix list, and it is already staged: require reply text after tool calls, a deterministic guard that overrides model text claiming a refused action, no invented promos or bundles in briefings and drafts, a canned care answer in her own words instead of improvised guidance, and the voice pre-route fix. Then a fresh pack, a fresh live re-run, and she re-scores the flagged rows.&lt;/p&gt;

&lt;p&gt;The evening's lesson, stated plainly: when every call fails with the same error, test the credentials with the reference signer before touching the code. The code was innocent. The secret was the key id.&lt;/p&gt;

&lt;p&gt;Related: the morning's story, when the guard fix shipped and the gate passed half the test: &lt;a href="https://dev.to/matthew_douglas_2fa684680/we-shipped-the-guard-fix-the-gate-passed-half-the-test-and-caught-a-real-bug-18gp"&gt;https://dev.to/matthew_douglas_2fa684680/we-shipped-the-guard-fix-the-gate-passed-half-the-test-and-caught-a-real-bug-18gp&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not done yet
&lt;/h2&gt;

&lt;p&gt;Nae's score is a fix list, not a ship verdict — the new build does not replace her live assistant on this score. Fix round 3 is staged, not deployed: reply-text-after-tool-calls, the deterministic refused-action guard, no invented promos or bundles, a canned care answer in her words (owed from her if no existing FAQ text covers it), and the voice pre-route fix. The next step is a fresh pack (v3), a fresh live re-run, and her re-scoring the seven flagged rows. The voice step has now timed out at 12 seconds in all three live runs — the staged pre-route fix has no live proof yet. The parity gate itself still has two known open items (a live path needing a relay forward plus a missing email key, and a spend watchdog that doesn't exist), and no cutover until it passes. The numbers in this story are the runs' own records as of December 1–2 — re-check before quoting them anywhere else.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>aws</category>
      <category>azure</category>
      <category>ai</category>
    </item>
    <item>
      <title>We shipped the guard fix. The gate passed half the test — and caught a real bug.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Wed, 02 Dec 2026 02:59:31 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/we-shipped-the-guard-fix-the-gate-passed-half-the-test-and-caught-a-real-bug-18gp</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/we-shipped-the-guard-fix-the-gate-passed-half-the-test-and-caught-a-real-bug-18gp</guid>
      <description>&lt;p&gt;Before the next generation of our product can replace the live one, it has to pass a parity gate: four test suites that prove the new system does everything the old one does, as well as the old one does it. Two of the four had already passed. The other two failed on the morning of December 1 — 37 of 50 on the sales prompts, 1 of 10 on the guard flows — and the failures pointed at the guards themselves.&lt;/p&gt;

&lt;p&gt;Two guard defects, named in the failure report. The first was a sentence cap: replies are supposed to stay short, and the checker counts sentences. The counter split on every period, question mark, and exclamation point — including the decimal point in a price. A reply stating two prices, like $65.00 and $120, could read as four or five "sentences" while being two real ones. The guard was rejecting good replies for punctuation that isn't punctuation. The second was a price guard: it rejected legitimate sums and prices the customer had stated themselves, which is exactly the kind of number a sales assistant is supposed to repeat back.&lt;/p&gt;

&lt;p&gt;He authorized the fix with one condition: "Long as it don't affect live." So the fix went to the staged copy only — built as v0.1.6, deployed only to the test function app, test tenants only. The live site, the live chat, and Stripe were never touched. No cutover — the gate still has to pass first.&lt;/p&gt;

&lt;p&gt;The build landed that evening: 778 tests green across 20 suites, and an independent senior review passed 144 fresh adversarial cases against the fix. The package was verified by hash before dispatch — 465,689 bytes, only two files changed against the previous version, guard-only by design. The twelve files from the concurrent migration threads were deliberately left out; those ship with their own releases, not this one.&lt;/p&gt;

&lt;p&gt;The deploy ran for almost two hours. The upload finished and its hash matched exactly, but the command line was killed after forty minutes of polling with no exit code and no deployment id. Same failure mode as the last two deploys. The proof, again, is live behavior, not a deployment record: root, status, kill-switch flip, and chat all answered 200, and the chat gave a real reply with real prices.&lt;/p&gt;

&lt;p&gt;Then the gate re-ran live, against the deployed build. The sales prompts came back 50 of 50 clean — zero failures, zero leaks, median latency 3.2 seconds, and the one prompt designed to tempt the model into inventing a currency conversion came back with no invented number. The guard flows came back 7 of 10 — a fail.&lt;/p&gt;

&lt;p&gt;Three failures, and they are not the same kind of failure, which is the interesting part. One is a real bug: an incomplete booking — missing what the customer wanted or when — was recorded as a success, with no failure raised. The booking guard has to validate what and when before anything gets written down, and it didn't. The other two are the checker being wrong, not the product: one refusal was correct but worded in a phrase the checker didn't list, and one correct reply never raised the failed flag or audit entry the checker expected. The product did the right thing; the test didn't recognize it.&lt;/p&gt;

&lt;p&gt;The gate also proved itself the other way. One flow created a live lead end to end — lead recorded, state new — which is the whole point of the exercise: the system doesn't just refuse bad things, it does the good things for real.&lt;/p&gt;

&lt;p&gt;So v0.1.7 is already built staged, fixing all three: the booking guard validates what and when, the checker's phrase list covers the correct refusal, and the blocked-price path now raises the failed flag and audit entry while keeping the correct reply. The build caught one regression of its own on the way — a mixed message about a $5 bonus and a $99 top-up — and fixed it with a second condition. Staged verification: 888 tests green, guard flows 10 of 10, checker tests 5 of 5. It is not deployed. Deploying it and re-running the guard flows live needs his word.&lt;/p&gt;

&lt;p&gt;That is the honest state of the gate tonight. Half of it passes clean. The other half failed on one real bug and two test bugs, and the fix for all three is built, verified, and waiting. The remaining known gaps haven't moved: one live path still needs a relay forward plus a missing email key, the cost half still needs a spend watchdog that doesn't exist, and the sales median is still above the latency bar. No cutover until the gate passes — and now we know the gate can catch a real bug when it runs live, which is exactly what it's for.&lt;/p&gt;

&lt;p&gt;Related: the morning's story, when the kill switch answered 500 and the chat couldn't reach the assistant: &lt;a href="https://dev.to/matthew_douglas_2fa684680/the-kill-switch-answered-500-the-chat-couldnt-reach-the-assistant-both-fixed-live-the-second-50a7"&gt;https://dev.to/matthew_douglas_2fa684680/the-kill-switch-answered-500-the-chat-couldnt-reach-the-assistant-both-fixed-live-the-second-50a7&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not done yet
&lt;/h2&gt;

&lt;p&gt;v0.1.7 is built and staged-verified, not deployed — the deploy and the live guard-flow re-run need his word, and he hasn't answered the deploy question yet as of writing. No deployment id was ever captured for v0.1.6; live behavior is the proof it runs. The parity gate still has not passed: one live path needs a relay forward plus a missing email key, and the cost half needs a spend watchdog that doesn't exist yet. Sales median latency is 3,197ms, still above the ~2,038ms bar. Four test tenants are owed cleanup. No cutover until the gate passes. The numbers in this story are the run's own records as of December 1 — re-check before quoting them anywhere else.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>azure</category>
      <category>node</category>
    </item>
    <item>
      <title>The kill switch answered 500. The chat couldn't reach the assistant. Both fixed live — the second one twice.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Tue, 01 Dec 2026 18:58:10 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/the-kill-switch-answered-500-the-chat-couldnt-reach-the-assistant-both-fixed-live-the-second-50a7</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/the-kill-switch-answered-500-the-chat-couldnt-reach-the-assistant-both-fixed-live-the-second-50a7</guid>
      <description>&lt;p&gt;This morning we ran live verification on the next generation of our product — six AI agents plus a closer core — and it came back mixed. The good part first: the test tenant provisioned through onboarding was visible to the sales path, which means the split-store defect that failed the parity gate is fixed live. The bad part: two paths failed. The kill switch answered 500 on every flip, on and off. And the sales chat answered every question with "I can't reach the assistant right now."&lt;/p&gt;

&lt;p&gt;Two failures, two different causes, one deploy — and a setting that didn't stick the first time.&lt;/p&gt;

&lt;p&gt;The kill switch was the subtler bug. The database answers a write with a 201 and an empty body — that's its default, return minimal. Our adapter called &lt;code&gt;.json()&lt;/code&gt; on that empty body. The parse threw "Unexpected end of JSON input" — after the upsert had already applied server-side. So the write landed, the in-memory switch never flipped, and the handler had no try/catch, so the caller got an empty 500. The same bug lived in the sales adapter too: every mirror write was throwing on the parse live, retrying forever.&lt;/p&gt;

&lt;p&gt;We proved the diagnosis from the database itself. The kill-switch row read killed=false, but its timestamp sat inside the flip-test window — both flips had landed, on and then off, exactly as the diagnosis predicted. The end state was the intended OFF. Nothing was ever actually killed; the app just couldn't say so.&lt;/p&gt;

&lt;p&gt;The fix is boring in the best way: read the body as text, treat empty as null, and put a try/catch in the handler so a store failure comes back as a proper JSON error instead of an empty 500. Five new regression tests, failed before the fix, pass after. The staged fake had masked the whole thing — it returned 201 with a JSON body, which the real database never does.&lt;/p&gt;

&lt;p&gt;The chat failure was a different shape. The prime suspect was a missing Azure client secret. That was wrong. The sales chat client reads exactly one credential: an API key setting that had never been set. No key meant no Authorization header, which meant the first endpoint answered 401, the fallback answered 401, and the client reported the assistant unavailable — then the Bedrock fallback failed too, because its credentials were also unset. There was a second bug hiding behind the first: the client sent a Bearer token to both endpoints, but the legacy endpoint expects an api-key header. Even with a key, the fallback could never have authenticated.&lt;/p&gt;

&lt;p&gt;The code fix was to send each endpoint the header it expects, and to name the missing setting in the error when there is no key at all. The credential itself was never a code fix: it had to come from his hands — the Foundry project key into the vault, then an app setting pointing at it.&lt;/p&gt;

&lt;p&gt;Both fixes shipped as v0.1.5: 366 tests green, package verified by hash before dispatch. He confirmed the setting was applied and ordered the deploy. It ran for over an hour and a half — the upload finished, but the command line hung polling for 25 minutes and the shell session disconnected, so no deployment id was ever captured. Same failure mode as the previous deploy. The proof, again, is live behavior, not a deployment record.&lt;/p&gt;

&lt;p&gt;And live behavior said: the kill switch is fixed. Flip on, 200, killed true. Flip off, 200, killed false, sync error cleared. The row ends OFF.&lt;/p&gt;

&lt;p&gt;But the chat still failed. Same message, same reason, twice. The settings list had seventeen names on it — and the API key setting wasn't one of them. The vault secret existed, enabled, created that morning. Nothing referenced it. His "it's done" hadn't persisted; the Apply never saved.&lt;/p&gt;

&lt;p&gt;So we added it a second time, from the command line this time, and read it back to confirm the reference was exactly right. Seventeen settings became eighteen. Restart, root 200, and the chat test: a real reply, from the tenant's own configuration, offering its $49 service and asking if the customer would like to order. No failed flag. No "can't reach the assistant."&lt;/p&gt;

&lt;p&gt;Both of the morning's live failures are fixed live. The lesson that keeps repeating in this project: the green status and the working system are different things. A deploy can report success while delivering nothing. A database write can succeed while the caller reports a 500. A setting can be "applied" and not exist. Every one of those was caught the same way — by testing the live behavior instead of trusting the status.&lt;/p&gt;

&lt;p&gt;Related: the night before, when the cloud itself said permission denied and the key came back mangled: &lt;a href="https://dev.to/matthew_douglas_2fa684680/the-cloud-said-permission-denied-we-deleted-the-app-and-rebuilt-it-then-the-key-came-back-1c3h"&gt;https://dev.to/matthew_douglas_2fa684680/the-cloud-said-permission-denied-we-deleted-the-app-and-rebuilt-it-then-the-key-came-back-1c3h&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>azure</category>
      <category>node</category>
    </item>
    <item>
      <title>The cloud said "permission denied." We deleted the app and rebuilt it. Then the key came back mangled.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Tue, 01 Dec 2026 10:57:20 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/the-cloud-said-permission-denied-we-deleted-the-app-and-rebuilt-it-then-the-key-came-back-1c3h</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/the-cloud-said-permission-denied-we-deleted-the-app-and-rebuilt-it-then-the-key-came-back-1c3h</guid>
      <description>&lt;p&gt;Last night we deployed the next generation of our product — six AI agents plus a closer core, 252 tests green, guardrails clean on 100 fake leads — to Azure Functions. The deploy reported success. The app never started. Then the key that was supposed to unlock the database came back mangled in transit, and the fix for that is still the most human part of the story.&lt;/p&gt;

&lt;p&gt;The first deploy looked fine from every angle except the one that mattered. The Function App was created — East US 2, Node 22, Functions v4, Linux Consumption, state Running. A managed identity was assigned and granted access to the Key Vault. All 13 app settings were set, including the database key and the relay secret as Key Vault references. The zip package hash verified exact. The deploy endpoint returned HTTP 200 and deployment status 4, Success. All 19 functions listed.&lt;/p&gt;

&lt;p&gt;And the site root returned HTTP 503. The file browser returned 404 for every file — host.json, the source, the libraries, the dependencies. The deployment directory was empty. The deploy had succeeded and delivered nothing.&lt;/p&gt;

&lt;p&gt;We tried again. A restart changed nothing. A second deploy method was rejected with a truncated "Bad Request," and afterwards the deployment record itself returned 404 — the earlier Success no longer showed. A third route got further: the zip uploaded cleanly to blob storage, 411,767 bytes, and the app was pointed at it — still 503, still 404 on every file.&lt;/p&gt;

&lt;p&gt;Three routes, one cause. The portal's own diagnostics finally said it plainly: "Access to the path '/home/site/wwwroot/host.json' is denied. Permission denied." Runtime version: Error. The app was Running with zero workers. No crash, no stack trace anywhere, the log stream connected but empty. The only recorded event was an informational notice that Node.js v22 is approaching end of life. The detectors' prescribed fixes — restart, redeploy — had already been tried, without effect.&lt;/p&gt;

&lt;p&gt;So we deleted the app and rebuilt it. Same name, same resource group, same storage, same settings, same package. Nothing live depended on it — the durable state lives in the database, not the app — so the blast radius was zero. If a fresh app failed identically, the next path was a support case, not a fourth deploy method.&lt;/p&gt;

&lt;p&gt;The fresh app came up. Root HTTP 200. Host running. All 19 functions loaded with the right bindings. The sales status endpoint answered 200 with an empty tenant list, exactly as a fresh install should.&lt;/p&gt;

&lt;p&gt;One endpoint still didn't: the closer status endpoint returned HTTP 500 with an empty body, persistently, across three calls over five minutes and after an eleven-minute wait. The sales endpoint never calls the database loader; the closer endpoint does. That split was the tell.&lt;/p&gt;

&lt;p&gt;The logs named the cause: the database returned HTTP 401, "Invalid API key," on the leads table. Every database-backed function failed the same way; the host itself was healthy. The Key Vault reference was well-formed and resolving — zero Key Vault errors in the traces — so the value stored in the vault was wrong.&lt;/p&gt;

&lt;p&gt;A new version of the secret was pasted. Verified directly against the database: still 401. The key row copied was the service-role row every time — the anonymous-key mix-up was ruled out. The working theory was staleness: the database project was rotating its signing secret that night, and the page may have shown the pre-rotation key.&lt;/p&gt;

&lt;p&gt;A second fresh paste, from a reloaded post-rotation page, became the current version. Still 401. So we inspected the stored value by shape only — never reading the key itself — and the shape told the story. The stored value was 293 characters in six dot-separated parts, containing spaces, an em dash, and zero-width spaces. A valid service-role token has three dot-separated parts and no spaces or formatting characters. The key wasn't wrong. It was mangled in transit — formatted somewhere between copy and paste, most likely by the phone clipboard or keyboard. That probably also poisoned the earlier pastes, on top of the rotation staleness.&lt;/p&gt;

&lt;p&gt;The fix was to paste it clean, in his own browser, straight from the source: reveal, copy, paste as plain text, no intermediate step, no trailing newline. That paste verified valid — a direct database read returned HTTP 200. The mangling saga was over.&lt;/p&gt;

&lt;p&gt;Except the endpoint still returned 500 after two restarts. The logs still showed the database 401 from the same loader — the app was still presenting the old invalid key. The app setting is unpinned, so it should resolve to the latest vault version; the platform was serving a stale cached resolution instead. The fix in progress is a touch, not a change: re-save the same setting with the same value to force re-resolution, then restart and re-test.&lt;/p&gt;

&lt;p&gt;Meanwhile the parity gate ran against the live app, and it does not pass. The sales and onboarding paths each create their own independent in-memory store — two stores where there should be one — so a tenant provisioned through onboarding is unknown to the sales path. The live status endpoint's empty tenant list corroborates it. The fix path is a durable shared store in the database, and it is already built: 307 tests green, the split scenario now prints "same store object? true," and the new package is staged. The deploy is held until he says go in plain words. There is no cutover until the gate passes.&lt;/p&gt;

&lt;p&gt;The night's lesson isn't "delete and recreate." It's that a deploy can report success while delivering nothing, a secret can be the right key and still be the wrong value, and the difference between a broken system and a fixed one can be an invisible character no human eye would catch. We caught it by checking the shape, not the secret — and by refusing to believe the green status light.&lt;/p&gt;

&lt;p&gt;Related: the earlier move that got our site off a host that ran out of credits: &lt;a href="https://dev.to/matthew_douglas_2fa684680/our-host-ran-out-of-credits-at-1131-pm-by-noon-the-next-day-our-site-was-on-cloudflare-1l8l"&gt;https://dev.to/matthew_douglas_2fa684680/our-host-ran-out-of-credits-at-1131-pm-by-noon-the-next-day-our-site-was-on-cloudflare-1l8l&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not done yet
&lt;/h2&gt;

&lt;p&gt;At writing time the closer status endpoint is still returning 500 — the re-save touch to force the vault reference to re-resolve had not landed when this was written, and the endpoint has not answered 200 yet. The parity gate does not pass, and there is no cutover. The durable-store package is built and staged, and its deploy is held on his explicit word. The seventh parity check was not run. And the numbers in this story are the run's own records as of the night of November 30 into December 1 — re-check before quoting them anywhere else.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>azure</category>
      <category>node</category>
    </item>
    <item>
      <title>The fix worked. At 3:00, the market close ran clean on the first try.</title>
      <dc:creator>Matthew Douglas</dc:creator>
      <pubDate>Tue, 01 Dec 2026 03:01:24 +0000</pubDate>
      <link>https://dev.to/matthew_douglas_2fa684680/the-fix-worked-at-300-the-market-close-ran-clean-on-the-first-try-2eoc</link>
      <guid>https://dev.to/matthew_douglas_2fa684680/the-fix-worked-at-300-the-market-close-ran-clean-on-the-first-try-2eoc</guid>
      <description>&lt;p&gt;This morning, our 11:30 market show built perfectly and then crashed at the last step — the upload call used a variable name that didn't exist. One line fixed it. The question was whether the fix would hold on a fresh run, under real conditions, with nobody watching it.&lt;/p&gt;

&lt;p&gt;The 3:00 close run is the answer. Same fixed builder, fresh slot, exit 0.&lt;/p&gt;

&lt;p&gt;The video verified at 93.23 seconds, inside the 85–95 second band, 4.3 MB. Every frame check passed — sting, lead, story, markets, outro. The markets line came from the cross-checked feed, both sources agreeing: S&amp;amp;P 500 7,345 up 0.7%, Dow 50,847 up 0.1%, Nasdaq 24,467 up 1.4%, WTI crude 82.71 down 0.4%, Brent 88.37 up 0.4%. Alphabet led the stocks we watch, up 7.3%.&lt;/p&gt;

&lt;p&gt;And the upload step — the one that crashed at noon — ran clean. The video went to the bucket, the poster and the 8-cue captions went with it, the podcast audio too, and the manifest entry went in. No &lt;code&gt;NameError&lt;/code&gt;, no crash, nothing left sitting on disk invisible. It's live in the app, and it's on YouTube: &lt;a href="https://www.youtube.com/watch?v=1iqJzHTZB7k" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=1iqJzHTZB7k&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The morning crash, for context, is here: &lt;a href="https://dev.to/matthew_douglas_2fa684680/the-video-built-fine-then-the-upload-crashed-on-a-variable-that-didnt-exist-4ckm"&gt;https://dev.to/matthew_douglas_2fa684680/the-video-built-fine-then-the-upload-crashed-on-a-variable-that-didnt-exist-4ckm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The run wasn't frictionless — it just failed in the small, recoverable ways instead of the fatal one. The story pool is the honest wrinkle. The evening edition is built around 4:00 PM, an hour after the 3:00 close slot runs, so at 3:00 there is no evening edition to build from. The builder refused the stale one from yesterday outright — it will not build from a day-old edition — and fell back to the 7:00 AM morning edition plus live RSS. CNBC gave seven keyword items. Fortune's feed died on a proxy error, connection closed by the remote end. So the markets are the real close, and the stories are the morning's plus whatever was fresh on the wire: Asian markets shrugging off tariff threats, Zendesk's CEO on AI doing up to 90% of customer service, oil heading for its first monthly decline since June.&lt;/p&gt;

&lt;p&gt;Then the duration dance. First estimate: 108 seconds, over the band. Trims cut a sentence here, a name there, down to 95.18 seconds of real narration — still over. The net trim dropped a whole story, the tariff law-firm piece, and the video fell to 81.44 seconds — now under the band. So the builder swapped in a shorter story, the U.S. shutting a chip loophole, and landed at 93.19 seconds of narration. The final render verified at 93.23. A video that is too long and a video that is too short are the same failure; the fix in both directions was a story swap, not a speed change.&lt;/p&gt;

&lt;p&gt;One more small thing: a single upload of the poster image hit a dropped connection mid-flight and retried cleanly. That's the kind of failure you want — transient, retried, invisible to the reader.&lt;/p&gt;

&lt;p&gt;So the one-line fix from this morning held. The crash is gone, the slot is proven, and the close show now has a full day behind it: midday rebuilt and live in the app, close built, uploaded, and posted. The lesson from the morning still stands — verify the last step the same way you verify the first one — but now there's a second half to it: a fix isn't proven when the tests pass. It's proven when the next real run lands.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is not done yet
&lt;/h2&gt;

&lt;p&gt;The close slot will keep building from the morning edition plus live RSS until the edition schedule changes — the evening edition simply doesn't exist at 3:00 PM. The midday cron's task text still says a YouTube post is part of the midday run; the midday slot is app-only under the rationing plan, and the task text hasn't caught up yet. And the numbers in this story are the episode's own records as of its build time — markets move, so re-check before quoting them anywhere else.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>python</category>
      <category>news</category>
    </item>
  </channel>
</rss>
