My morning brief caught a worn laser nozzle 6 days before the weekly report did

Not technical? Start with the whiteboard version: Crestline Supply on a whiteboard.
What you'll get out of this
In about 25 minutes, you'll walk away with:
- How early a plain morning brief catches a slow failure. A wearing laser nozzle, flagged on day two of the wear. The weekly scrap report caught it six working days later. 289 bad parts, $2,260.67 of them, were cut in between.
- How to backtest a brief honestly: 64 mornings, each built only from what had arrived by 05:30 that morning, scored against ground truth, with the false alarms counted and the thresholds checked on a second run they weren't tuned on.
- A pattern for letting a model write the brief without letting it make up a number: facts in SQL, prose by the model, and a check that refuses any number it can't trace to a fact. It caught real mistakes. But under the final prompt, 26 of the 84 briefs it passed still had something misleading in them. Here's why.
- Why I'd ship the plain template first. It never misled anyone. Of the briefs the check let through, 5 of Claude Sonnet 4.6's 38 and 21 of Amazon Nova 2 Lite's 46 still did. And the same request, byte for byte, at temperature 0, was refused one morning and sent the next.
- What an AI agent gets right and wrong on 20 questions a plant manager would ask, on two models, every answer graded one by one against ground truth. Including three answers the data platform itself got wrong before any model saw them.
- One command to stand the whole Crestline platform up in a clean region, and one to take it down: 2 hours 1 minute up, 5 minutes 53 seconds down.
- What it costs: about $0.05 a brief, about $2.45 a month for the whole platform with the brief every weekday, and $13.00 for everything I ran to write this post. Plant leaders: read Part 1 and "What this means for your plant." Builders: jump to "Facts in SQL."
Part 1: The problem
The Monday report
Every plant I've worked with has a Monday report. Somebody pulls last week's scrap by machine, drops it in a spreadsheet, and walks it into the production meeting. It works. It's how most plants find most problems.
It's also a week late, by design.
At Crestline, the fiber laser's nozzle started to wear on Wednesday, August 12. Not all at once. A nozzle wears a little each day: the cut gets a bit wider, the edges a bit rougher, and a few more parts fail inspection. The laser's scrap runs about 1.6% on a normal day. Over ten days it climbed toward 10%.
Here's what the Monday report saw:
- The week of August 10: 3.0% laser scrap. Higher than usual. Under the 5% that gets anyone's attention. Nobody looked twice.
- The week of August 17: 9.9% (343 of 3,479 pieces). That gets attention. So on Monday, August 24, maintenance changed the nozzle. 06:36 to 07:46, logged as
PM. By then the wear had scrapped 316 pieces, worth $2,447.76 at true cost.
Nobody did anything wrong. The report did exactly what it was built to do. It was built to be a week late.
Why would I bring this up? Great question. Because over the last four posts we built everything you'd need to know sooner. The ERP data is true (post 2). The machines tell their own story (post 3). An agent can answer questions without touching the floor (post 4). None of that helps if nobody reads it before first shift.
So this post builds the thing a plant manager would read: a morning brief at 05:30. Then it asks the only question that matters. How early would it have caught the nozzle?
TL;DR
- A 05:30 morning brief, built in SQL from Crestline's ERP, MES, and machine data, covering output, margin, stops, and scrap, with four alert rules.
- Backtested over 64 working mornings, each built only from what had arrived by 05:30. At the chosen thresholds: 8 issues raised, 0 false alarms. On a second run it wasn't tuned on: 12 issues, 2 false.
- The nozzle alert fired on the morning of Friday, August 14, two working days into the wear. The weekly report caught it six working days later. 289 of the 316 wear-scrapped parts ($2,260.67) were cut in between.
- Claude Sonnet 4.6 and Amazon Nova 2 Lite wrote the brief from the facts. A check refused any number it couldn't trace. It caught real mistakes, and under the final prompt it still passed 26 of 84 briefs with something misleading in them. Nova's favorite mistake, a right number under the wrong shift, sails straight through it.
- 20 plant-manager questions through post 4's agent: Sonnet right on 38 of 60, Nova on 18 of 60. Three answers were wrong in the platform before any model saw them.
crestline upbuilds it all in a clean region in about two hours.crestline downremoves it in six minutes.- The platform runs about $2.45 a month with the brief every weekday. Everything for this post billed $13.00.
- Repo: https://github.com/trcollinson/crestline-supply (tag
post-05-capstone)
One note on the numbers
Every number in this post comes from a second 90-day run of the same plant, with the same seed and the nozzle problem switched on. Turning the nozzle on nudges a few earlier numbers. PB-02's second-shift margin gap, for example, reads 5.5 points here against 5.7 in post 1, because scrapped laser parts change what reaches the brakes. The default run, with the nozzle off, still reproduces posts 1 to 4 exactly.
Part 2: The fix
The architecture
- Amazon EventBridge Scheduler fires at 05:30 Denver time on weekdays.
- An AWS Lambda function runs the brief's fact queries in Amazon Athena (about a minute), sends the facts to Claude Sonnet 4.6 on Amazon Bedrock, runs the number check, stores the brief as Markdown and an HTML page in Amazon S3, and emails the text through Amazon Simple Notification Service (SNS). The scheduled test run took 59 seconds.
- Everything underneath is the platform from posts 1 to 4. The brief's SQL sits on top of it unchanged. ### Facts in SQL, prose by the model
The brief is about 100 facts a morning (107 on August 20). Each one is a row with a stable ID, a value, a unit, a baseline, and a pointer to the rows it came from. The ID looks like scrap:LSR-01:scrap_pct.
Here's the laser's scrap fact from the morning of August 20:
{"fact_id": "scrap:LSR-01:scrap_pct", "morning": "2026-08-20", "plant_day": "2026-08-19", "family": "scrap", "subject": "LSR-01", "metric": "scrap_pct", "value": 10.7, "unit": "percent", "baseline": 2.6, "source_rows": "scrap_by_day where machine_id = 'LSR-01' and work_date = date '2026-08-19' (baseline: the 20 working days before)"} Every fact says where it came from. If the plant manager doubts a number, the query that made it is right there.
Four families of facts, each against its own last 20 working days:
- Output: pieces by work center, and jobs finished. The MES has no "job complete" field, so a job is finished on the day its last operation has made as many pieces as the operation before it. That rule matches ground truth on all 1,271 jobs, each on its true day.
- Margin: post 1's margin by brake and shift, for jobs the ERP closed in the last 20 working days. It runs a day behind the floor, because the ERP closes jobs in its 22:00 batch. The brief says so instead of hiding it.
- Stops: stops the machines saw against stops the operators logged, including how many nobody logged (post 3).
- Scrap: each machine's scrap rate against its own trailing rate, in standard errors, so a machine that cut 40 pieces yesterday doesn't alarm like one that cut 4,000. Four rules raise alerts on top of those facts. An alert carries a status: new, still open since a date, or open since at least a date. A chronic problem gets one line, not a fresh alarm every morning. (Score it per morning and PB-02's margin gap alone is about 60 "true alerts." That's how a brief turns into noise.)
Here's what the alerts looked like on Thursday, August 20:
- Laser scrap 10.7% against a 2.6% baseline, 15.1 standard errors above it. Still open since August 13.
- PB-02 second shift: the ERP's margin 6.1 points above the rebuilt one. Open since at least July 22.
- Powder coat line: 149 stop minutes, 2 of its 3 stops never logged by operators.
- PEM-01: 114 stop minutes. ### The brief only knows what had arrived by 05:30
This is the part that makes the backtest worth anything, so it gets its own section.
A backtest asks: if this brief had existed in August, what would it have said each morning? The trap is that your full dataset knows the future. Run the brief's SQL against all 90 days, filter to "yesterday," and you're reading data that hadn't arrived yet at 05:30 that morning.
Here's the exact way it bites. An operator forgets to scan off on Friday's second shift. The MES closes that scan at 06:00 Monday morning. In the full data, the scan is there, closed, with its pieces and hours. At 05:30 Monday, it wasn't. Read uncut, Monday's brief quietly knows things nobody in the plant knew yet.
So the brief never reads the data directly. A cut layer, queries/as_of.sql, redefines every source under its own name as of 05:30 on a given morning:
- MES files dated before that morning (each lands at 02:15)
- Machine messages published before 05:30
- ERP rows as they stood at that moment, rebuilt from the ERP's own history Then the SQL from posts 1 to 3 (margin, machine cleaning, downtime, scrap) runs on top unchanged.
-- MES: the files dated before the morning. A scan is in the file of the -- day it closed, so it had arrived if it closed before midnight. create or replace view mes_labor as select * from crestline_raw.mes_labor where scan_off_local < (select cast(morning as timestamp) from brief_cut); -- Machines: the messages published before the brief runs. create or replace view pb01_data as select * from crestline_raw.pb01_data where published_at_utc >= (select machines_from_utc from brief_cut) and published_at_utc < (select cut_utc from brief_cut); -- ERP: rows nothing has changed since the cut. create or replace view erp_jobs as select * from crestline_raw.erp_jobs where lastmodified_utc < (select cut_utc from brief_cut); The look-ahead test builds each morning two ways: the cut applied to the whole backfill, and a copy holding only the files that had physically arrived by then, with the ERP rebuilt from its history. On five mornings (including a Monday, the morning after the wear started, and the morning the nozzle was changed), they're equal cell for cell, on DuckDB and on Athena.
A test that can't fail proves nothing, so I leaked exactly one thing on purpose: scans opened before the morning and closed after it. Friday's forgotten scan-offs, closed at 06:00 Monday.
| Morning | Facts changed (of 105) | What changed |
|---|---|---|
| Mon Aug 17 | 27 | PEM output 400 → 477 pieces, BRAKE 437 → 485, jobs finished 26 → 28, PEM-01 gains a stop "nobody logged" |
| Fri Aug 14 | 20 | Similar output changes |
| Mon Aug 24 | 0 | Nothing |
Here's the scary part. On those mornings, no alert changed. A quarter of Monday's facts were wrong, and the brief looked exactly as calm as the honest one. A look-ahead leak doesn't announce itself. You find it with a test, or you don't find it.
One more thing the cut forces you to get right: "yesterday" is the last day anyone worked. Monday's brief is about Friday.
The backtest: 64 mornings
I ran the brief as of every working morning from July 6 to October 1, and scored every alert against the simulation's hidden ground truth. An alert that stays open counts once, as one issue. Scoring starts August 3, the first morning with 20 working days of baseline behind it.
| Issues raised | Planted scenarios | Real problems | False alarms | |
|---|---|---|---|---|
| Starting thresholds | 23 | 2 | 15 | 6 |
| Chosen thresholds | 8 | 2 | 6 | 0 |
At the chosen thresholds, 57 mornings carried at least one alert, from 8 issues:
- 2 planted scenarios: the nozzle, and PB-02's slow second shift from post 1.
- 6 real problems nobody planted: five long stops, mostly maintenance, and the powder coat line running short of work.
- 0 false alarms. The lead time. The nozzle alert first fired on the morning of Friday, August 14, two working days into the wear, before the laser's true daily scrap had passed 5%. The Monday report caught it six working days later. Of the 316 parts the wear scrapped, 289, worth $2,260.67, were cut between that first brief and the nozzle change.
That's the number. Not "AI found a problem." A query a plant manager could read over coffee, six working days ahead of the spreadsheet.
The honest catch
I tuned those thresholds on the same 90 days I scored them on. That's a thumb on the scale, and you should discount "0 false alarms" accordingly.
So I ran the plant a second time (seed 2, nozzle on) and scored the same thresholds without retuning:
- 12 issues, 2 of them false. Both were scrap alerts on manual stations: one bad day by chance, one barely over the threshold.
- The nozzle raised 5 working days before the Monday report.
$2,090.25 of the run's $2,310.53 in wear scrap was made after the first alert.
Two things seed 2 told me that seed 1 couldn't:Seed 2's own tuning would have picked a looser scrap threshold. The "right" threshold moves between runs of the same plant. Expect yours to move too.
The 90-minute floor on stop alerts halved seed 2's real stop alerts, 16 to 8. That floor kept seed 1 quiet. On seed 2 it hid real stops. Quiet and right aren't the same thing.
One worry that didn't pan out: a trailing baseline absorbs a slow failure (by August 20 the laser's baseline was already 2.6%, not 1.6%), so I also scored a variant with the baseline frozen at the last quiet morning. At the chosen threshold, it changed nothing.
A model writes it, a check reads every number
The facts are the product. The model's job is to turn 100 rows into something a person reads in two minutes.
What the model gets: the facts as JSON. Never the operators' free text. That's post 4's lesson: a downtime note is a place to plant an instruction, so stops go in as counts and minutes only.
What it's told: cite each fact's ID, compute nothing, suggest no causes.
What the check does (brief/check.py): every number in the brief must be a fact cited in the same paragraph, rounded no further than the fact allows, with the right unit. "Twice," "half," and worked-out differences fail. If the brief fails, a plain template that states every fact goes out instead, and the log says why.
The heart of it is one small function. For every number in the prose, it looks at the facts cited in the same paragraph:
def matches(fact: Fact, any_unit: bool = False) -> bool: if not any_unit and unit is not None and unit != fact.unit: return False # "149 stops" isn't 149 minutes if decimals > UNIT_DECIMALS.get(fact.unit, 2): return False # no sharper than the fact return any( candidate is not None and _rounded(candidate, decimals) == value for candidate in (fact.value, fact.baseline) ) # its value or baseline, rounded half up No match in the paragraph's citations, and the number is an orphan. One orphan, and the brief doesn't go out.
I ran both models on all 64 mornings with the first prompt, and every refused number was read against that morning's facts, one by one:
| First prompt | Briefs that passed | Refused for a wrong or worked-out number | Refused for right numbers cited in the wrong place |
|---|---|---|---|
| Claude Sonnet 4.6 | 27 of 64 | 8 | 29 |
| Amazon Nova 2 Lite | 58 of 64 | 4 | 2 |
Sonnet's 8 included wrong scrap values and "17 of 872" written as 1.9%. Nova's 4 included another brake's margin, and the rebuilt margin called the ERP's.
Most of Sonnet's refusals were the check being strict, not Sonnet being wrong. So I changed the prompt: no tables, no numbers in headings. Sonnet's passing briefs rose to 38 of 64. Nova's fell to 46: its new failures cite an alert's threshold next to a citation of the gap.
| Final prompt | Briefs that passed | Refused for a wrong or worked-out number | Refused for right numbers cited in the wrong place |
|---|---|---|---|
| Claude Sonnet 4.6 | 38 of 64 | 7 | 19 |
| Amazon Nova 2 Lite | 46 of 64 | 1 | 17 |
The new prompt cut the noise, not the mistakes. Of Sonnet's 7, five were wrong in ways a manager would believe, and two did arithmetic it was told not to do and happened to land on the right count. Verbatim:
- "PB-01: 1.5% vs. baseline 1.8%." The baseline was 0.8%.
- "AS-01: 1.3% vs. baseline 1.6%." The baseline was 1.2%. 1.6% is the laser's.
- "AS-01: 1.9% [scrap:AS-01:scrap_pct] — wait, 0.9%." The model corrected itself in the middle of the sentence, and the wrong number stayed in. 1.9% is PEM-01's rate.
- "# Morning Brief — Monday, July 7, 2026." The morning was Monday, July 6. Nova's one: "PEM-01 had 1 stop for 32 minutes." The machine said 31. 32 is the operators' log. Nova made the same slip under the first prompt.
(Sonnet's count is also hurt by two briefs that escaped every underscore in their fact IDs. The check now reads those correctly, which would make it 40 of 64. The table shows what went out on the day.)
Passing the check isn't reading well
The check reads numbers. It doesn't read words, and it can't read what isn't there. These got past it, or around it:
- A missing alert. Nova's August 20 brief passed the check and didn't mention any of that morning's four alerts. Not the laser at 10.7%. Not one. Every number it wrote was right. The check only reads what's written.
- A false sentence with no number in it. On September 21 Sonnet wrote "All work centers were at or below baseline scrap rate." The powder line was at 1.2% against a 1.0% baseline. The next sentence invented a "1.0 standard error" limit, and that's the one the check refused. The false one had nothing for it to catch.
- Right number, wrong word. Sonnet wrote "PC-LINE logged 149 stop-minutes." 149 is what the machine measured. The operators' log has 111. Every number was a real fact. One verb made it false.
- A bad field name became a bad sentence. A field named
baselineheld the alert's threshold, and Sonnet wrote "against a baseline of 23." Fair reading of a bad name. It'sthresholdnow. Name your facts for the person who'll read the prose, because the model will. - Nova's passing briefs read like a fact dump. Every work center, in order. Accurate, and not "what changed."
- Temperature 0 doesn't give you the same brief twice. Don't build anything that assumes it does. So I had every one of the 84 briefs that passed under the final prompt read against its morning's facts. Claude did the reading, in subagents, with a second pass that checked every finding against the facts and changed 12 verdicts. Then I read a sample myself against the same facts. Every verdict is in the repo, keyed to its log, so you can check the reading too.
| Final prompt | Passed the check | Passed, with at least one misleading statement |
|---|---|---|
| Claude Sonnet 4.6 | 38 | 5 |
| Amazon Nova 2 Lite | 46 | 21 |
Nova passed the check more often than Sonnet, and nearly half of what it passed was wrong somewhere. 30 of its 35 misleading statements are the same habit: one shift's margin written under the bare machine name. September 18, verbatim:
For PB-02, ERP margin was 11.2 percent and rebuilt margin was 0.1 percent, a gap of 11.1 points
Those are second shift's numbers. First shift's gap was −0.3. Every number is a real fact, cited with the right ID, so the check passes it. A plant manager reads "PB-02 is losing 11 points" and goes looking at the wrong machine.
Sonnet's five, from the same read, include "AS-01 — 2.6% scrap rate [scrap:LSR-01:scrap_pct], wait — AS-01: 1.2%" (July 10; the self-correction habit again, and this time the citation gives it away: it's the laser's rate) and an alert marker on the laser on a day it had no alert (September 9).
What the read didn't find: an alert labeled new when it was still open (0 of 104 mentions), or a cause or a piece of advice from either model.
So the check refused every brief with a number it couldn't trace, and still let 26 misleading briefs through. (The refused briefs were read under an earlier rubric, one that also flagged a right number the model had worked out itself, so I'm keeping the two reads as separate counts rather than adding them into one rate.)
The check does exactly what it says: it stops numbers it can't trace. It doesn't stop a traceable number in the wrong place, and that turned out to be most of the problem.
What I'd build next. None of it is built, so treat these as ideas, not results:
- Name the subject. A cited fact's subject (machine, and shift where it has one) must appear in the same sentence as its number. That one rule covers 30 of Nova's 35.
- Cite every open alert. Every open alert's fact ID must appear somewhere in the brief. That catches Nova's August 20.
- No unbacked "all" or "none." A sentence about all or none of something must cite the facts it covers. That catches Sonnet's September 21. ### The same morning, refused on Friday and sent on Wednesday
The scheduled brief runs on a replay clock: one plant day per real weekday, so the plant's August runs again, a morning at a time, in November. The first brief on the real schedule went out at 05:30 on Monday, November 23, for the plant's Wednesday, August 12. Sonnet wrote:
PB-01: 2 of 4 stops not logged by operators
It got the 2 by subtracting: 4 machine stops, 2 logged rows. But the fact stops_not_logged is 0. The operators' two log rows (129 minutes) cover all four of the machine's stops. Sonnet did arithmetic it was told not to do, got it wrong, and wrote it in a sentence a plant manager would believe. The check refused it, and the template went out.
Three days earlier I'd run that same August 12 morning, same facts, same prompt, temperature 0. That time Sonnet failed for something else: five job counts in headings, no citation. Same input, different mistake. The check caught both, which is the point of a check that doesn't depend on the model making the same mistake twice.
Then Wednesday, November 25: the plant's Friday, August 14, the morning the nozzle alert first fires. Sonnet's brief passed the check and went out. It's clean: read against the morning's 106 facts, every number sits under its own machine and shift, the laser's scrap alert says NEW, and PB-02's margin says open since at least July 16.
Here's the part that matters. I'd already run that exact morning in the backtest, on Friday, November 20. The request was identical byte for byte: same system prompt, same facts, temperature 0. That brief was refused for five job counts in bold labels with no citation, like "PB-02 2nd (53 jobs) ⚠ open alert". On Wednesday it wrote the same labels with the citation after them, and passed. 2,338 output tokens one day, 2,180 the next.
Temperature 0 on Bedrock is not repeatable. You can't test a model's brief once and call it tested. The check has to run every morning, because every morning is a new draw.
Then the next two mornings went back to the template. Thanksgiving morning, November 26 (the plant's Monday, August 17), Sonnet wrote:
LASER: 773 pieces (baseline 417 — wait, baseline 718), 742 good, 31 scrapped.
417 is the assembly station's baseline. The laser's is 718. The same "wait" habit from the backtest, now on the live schedule, and the check stopped it. In the backtest, that same morning had passed. On November 27 the brief was refused for a true number, the 20 working days in "20-day baseline," cited without its fact. Right number, wrong place, nothing misleading, and still the template.
Four mornings on the real schedule so far:
| Sent | The plant's morning | What went out |
|---|---|---|
| Mon Nov 23 | Wed Aug 12 | Template (Sonnet did arithmetic and got it wrong) |
| Wed Nov 25 | Fri Aug 14 | Sonnet's brief, clean |
| Thu Nov 26 | Mon Aug 17 | Template ("baseline 417, wait, baseline 718") |
| Fri Nov 27 | Tue Aug 18 | Template (a true number cited in the wrong place) |
One in four went out as Sonnet wrote it. On two of the four, the result differed from the backtest's run of the same morning.
Earlier, the brief crestline up sent from the clean region escaped every underscore in its fact citations (85 false failures, 2 real), and the template went out. When the fallback fires, nobody reading the email knows.
I'll take that trade. A brief that's sometimes plain beats a brief that's sometimes wrong.
Part 3: Lessons and choices
Template, Sonnet, or Nova?
| Plain template | Claude Sonnet 4.6 | Amazon Nova 2 Lite | |
|---|---|---|---|
| Reads like | A report | A person wrote it | A list |
| Passed the check (final prompt, 64 mornings) | Every time, by construction | 38 of 64 | 46 of 64 |
| Passed the check but still misleading (final prompt) | 0 | 5 of 38 | 21 of 46 |
| Time to write and check, once the facts exist | Under 10 ms | About 15 s | About 3 s |
| Cost per brief (the facts cost the same for all three: about $0.002 in Athena) | Nothing | $0.052 | About $0.004 |
| Watch for | Nobody reads it | Arithmetic it was told not to do; "wait" mid-sentence; a different draft every morning | Right number under the wrong shift; leaving alerts out; fact dumps |
If I were putting this in a real plant tomorrow, I'd ship the template first. That's no longer a hunch: the template misled no one, and both models did. The SQL found the nozzle. The model makes it nicer to read, and the check makes "nicer" safer, not safe. Add the model once the template has earned trust, with the three checks above, and read a sample of what goes out every week.
Twenty questions a plant manager would ask
The brief tells you what changed. Then the plant manager has questions. So I asked post 4's agent (Cedar enforcing, now with a scrap_by_day tool and its own policy) 20 questions a plant manager would ask, 3 times each, on both models. The answer keys come from the simulation's ground truth, not from the platform's own views, so the platform can be wrong too.
Every answer was graded one by one against ground truth, not by rule. That wasn't optional: the automatic grading rules got 21 of the 120 the wrong way round.
| Model | Right | Partly right | Wrong | Said it couldn't tell, rightly | Said it couldn't tell, wrongly |
|---|---|---|---|---|---|
| Claude Sonnet 4.6 | 38 | 4 | 14 | 1 | 3 |
| Amazon Nova 2 Lite | 18 | 3 | 33 | 6 | 0 |
The misses, grouped by cause:
- Nova misreads the calendar. 21 of its misses: "last week" read as this week, "last Friday" as Saturday.
- Sonnet makes things up. 11 of its misses. The clearest: asked what caused August's laser scrap, all six sessions across both models named a cause from that week's logged stops. Nothing in Crestline's data records a scrap cause. The right answer was "I can't tell."
- A denied request became a dead end. Sonnet asked for 60 days of data, Cedar's 31-day rule refused it, and Sonnet sent the user to IT instead of asking for 31 days twice. The policy worked. The agent didn't.
- Both models said no jobs finished yesterday. 26 did. No tool counts finished jobs, and neither model said so. A missing tool looked like a zero.
- Three answers were wrong before any model saw them. The clearest: September's PB-02 second-shift margin gap reads 7.2 points rebuilt, against 3.4 in truth. Six forgotten scan-offs added $1,617 of labor hours to those 46 jobs. The rebuild beats the ERP over 90 days. Over one month and 46 jobs, a few forgotten scans move it a lot. It's better than the ERP. It isn't the truth. That last one is the one I'd put on the wall. Your agent can be perfect and still wrong, because the data under it is.
What building it on AWS taught us
Athena spent half its time planning, not reading. One query for all the facts failed with INTERNAL_ERROR_QUERY_ENGINE, because Athena expands every view wherever it's named. Reading each family once took 61 s, 30.6 s of it planning. Cutting the machine data to six weeks dropped the scan from 430 MB to 283 MB and barely moved the time. Four queries, one per family, run at the same time, brought it to 38 to 66 s a morning.
A data check that cried wolf, every hour. The brake check compares machine strokes to operator pieces. On the newest day, one operator's open scan meant the strokes had arrived and the pieces hadn't, so it failed every hour. The fix: don't judge a day until it can be complete.
The first nozzle design lasted one afternoon. I first had the nozzle reset at the laser's first natural maintenance stop. The laser has one every 3.8 working days, so the wear barely started before it was fixed. Now the plant notices on Monday, the way a real plant would.
One environment variable, two regions. The CDK reads AWS_REGION. boto3 reads AWS_DEFAULT_REGION. One setup command ran against the region holding my live re:Invent demo. Nothing changed, and I caught it, but set both. Every session.
A new region has first-day surprises. Its AWS IoT Core endpoint is created on the first request and takes a while to resolve, and my home router cached "doesn't exist" for minutes (crestline up now waits). Its first AgentCore Gateway needs CloudWatch Transaction Search turned on, or the stack rolls back.
logGroupNamePattern is case-sensitive. The first teardown missed four Crestline… log groups.
The clean-clone run found a crash the workbench never did: the backtest's worker processes collided while decoding the laser data. Run your build from a fresh clone before you trust it.
One command up, one command down
Post 1's README had a few commands. Post 4's had a page. That's not a platform anyone else can stand up, so crestline up does it all:
- From a fresh clone, in a clean region, with only an AWS profile set: 2 hours 1 minute. 1 hour 45 minutes of that is replaying 90 days of machine data, 2,215,665 messages, every one accounted for.
- It ends with
cdk diff, which showed no differences. - Same answers as the build region: the margin query, the brief's facts for two mornings, and one agent question.
-
crestline down: 5 minutes 53 seconds. It leaves three things, on purpose: the CDK bootstrap stack, Transaction Search (an account-level tracing setting, with its two log groups), and Bedrock model access. ### What it costs
Everything for this post ran in us-east-1 and us-east-2 from November 17 to 25 and billed about $13.00. Bedrock was $10.06 of it (Sonnet $9.38, Nova $0.67), and the two 90-day machine replays through AWS IoT Core were $1.36. (Cost Explorer still marks the last two days as estimated.)
| Run | Billed |
|---|---|
| One morning brief | $0.052 in Sonnet tokens (5,200 in, 2,180 out on November 25). The morning's facts in Athena: 280 to 430 MB, about $0.002. Lambda and SNS: free tier. |
| The 64-morning backtest, final prompt | Sonnet $3.26, Nova $0.28 (both prompts: $6.56 and $0.50). The facts ran on DuckDB. |
| The 20 questions, 3 times each, both models | About $2.55: Sonnet $2.25, Nova $0.16, Athena $0.12 (264 queries, 23 GB), AgentCore $0.012 |
crestline up in a clean region, once | $1.10: IoT Core $0.68, Firehose $0.31, the rest pennies. Nothing after down. |
| The platform per month, idle | About $1.25. Mostly Athena: about 337 small queries a day from the hourly machine curator and the daily ERP merge, each billed at Athena's 10 MB minimum. |
| The platform per month, brief every weekday | About $2.45 |
| With live machine data | Add about $0.35 a month |
Two things the bill taught me, again:
- Tags can't see most of this. Model tokens and IoT Core messages carry no cost allocation tags, so about $11.40 of the $13.00 can't be filtered by tag at all. A budget on
milestone=M5would show $0.001. - Both models billed at 1.1 times their global list price: Sonnet at $3.30 and $16.50 per million tokens in and out, Nova at $0.33 and $2.75. That's the
us.cross-Region profile from post 4. The tokens in my logs match the billed units exactly; the rate is the difference. The thinking is still the expensive part. The data platform under it costs less than a coffee a month.
Part 4: Your turn
Run it yourself
You'll need: uv, Node.js with the AWS CDK CLI at version 2.1143 or later, the AWS CLI, an AWS profile, and access in Amazon Bedrock to Claude Sonnet 4.6 and Amazon Nova 2 Lite.
git clone --branch post-05-capstone https://github.com/trcollinson/crestline-supply.git cd crestline-supply uv sync export AWS_REGION=us-east-2 AWS_DEFAULT_REGION=us-east-2 # set both; `up` sets its own, the Sonnet brief needs these uv run crestline up --region us-east-2 --email you@example.com # about 2 hours, mostly the machine replay; click the confirmation email uv run crestline brief write --morning 2026-08-14 --model none # the template first: it also builds the 20 mornings before (about 2 min) uv run crestline brief write --morning 2026-08-14 --model sonnet # then Sonnet, reusing them; this one replaces the template's .md uv run crestline down --region us-east-2 # asks you to type the region again You don't need AWS to check the numbers. The backtest's facts and scores rebuild byte for byte from a fresh clone on DuckDB, for both seeds. Every number that needed a model call comes from crestline-m5-logs.tar.gz (about 1.6 MB) on the release, and the hand readings are in the repo:
uv run crestline sim backfill --days 90 --end 2026-10-01 --seed 42 --out ./out-m5 --scenarios eval/scenarios_nozzle.yaml uv run python eval/brief_backtest.py run --out out-m5 # about 10 min, every core busy curl -LO https://github.com/trcollinson/crestline-supply/releases/download/post-05-capstone/crestline-m5-logs.tar.gz tar -xzf crestline-m5-logs.tar.gz -C out-m5 uv run python eval/brief_backtest.py score --out out-m5 uv run python eval/plant_questions.py score --run step7 --out out-m5 The experiment that makes the point: leak Friday's forgotten scan-offs into Monday's brief, and count what changes.
uv run python eval/look_ahead_leak.py --morning 2026-08-17 # 15 s, local, no AWS: 27 of 105 facts change, no alert does What this means for your plant
You don't need an AI to do this. You need yesterday's numbers by 05:30, compared to their own normal, with a person reading them. The model is the last step, not the first.
Three questions worth asking your team this week:
- What do you find out on Monday that you could have known on Wednesday? Pick one. Scrap by machine is a good start.
- Which number in your morning meeting would you trust if a model wrote it? Then ask how you'd know if it was wrong.
- What question would you ask that your data can't answer? "What caused the scrap?" was ours. Find yours before an agent answers it for you. Go find out. Do it this week.
The takeaway
If you remember one thing from this post: the brief is the SQL. The model is the coat of paint. The check makes the paint safer, not safe.
- A plain morning brief caught a wearing nozzle six working days before the Monday report. 289 bad parts, $2,260.67, came in between.
- Tuned thresholds look perfect on the data they were tuned on. On a second run: 12 issues, 2 false, and the nozzle still five days early.
- Models wrote better prose and worse briefs. Under the final prompt, the check still passed 26 misleading briefs. The template misled no one.
- The same request at temperature 0 was refused one morning and sent the next. Check every morning.
- The agent's worst misses weren't the model's fault: a missing tool read as zero, and a rebuild that's better than the ERP but isn't the truth. Five posts ago, Crestline's ERP said a job was profitable and the machines disagreed. Since then we made the ERP copy true, got the machines to tell their own story, put an agent on top that can't touch the floor, and now a brief that's on the plant manager's phone before first shift. That's the foundation. Everything else gets built on it.
This one goes out while I'm at re:Invent in Las Vegas. If you're there and you run a plant, or build for people who do, find me. I'd love to hear what your Monday report misses.
What's next
The foundation's done. Next is what you do with it: a bad lot of steel, traced both directions, from the supplier's certificate to every job it touched. After that, what all of this really cost, line by line. Then in January, the defect that shows up two days after its cause.
P.S. The nozzle was changed in 70 minutes on a Monday morning. The fix was never the hard part. Knowing was.
Tim Collinson has spent nearly 30 years building software, much of it on AWS, across manufacturing, oil and gas, and enterprise IT. Reach him at trcollinson@gmail.com.
