WEBVTT

00:00:00.500 --> 00:00:04.301
An AI agent builds a checkout engine. The code looks convincing.

00:00:04.301 --> 00:00:06.029
But would you ship it?

00:00:08.000 --> 00:00:13.268
Start with a real requirement. Validate the order. Apply the discount before tax.

00:00:13.268 --> 00:00:15.699
Round in cents, and calculate shipping.

00:00:18.000 --> 00:00:23.237
This is executable AI# code. Typed orders and quotes. Declared failure cases.

00:00:23.237 --> 00:00:28.037
A pricing function that returns a result the caller must handle.

00:00:31.000 --> 00:00:37.546
Discard that result, and the compiler rejects the program. The diagnostic identifies the unhandled outcome

00:00:37.546 --> 00:00:40.164
and the function that produced it.

00:00:42.000 --> 00:00:46.526
Now the build passes. But tax was calculated before the discount.

00:00:46.526 --> 00:00:51.052
The external test expects one hundred sixteen dollars and ninety-one cents.

00:00:51.052 --> 00:00:56.401
The program returns one hundred seventeen dollars and ninety cents. The test fails.

00:00:58.000 --> 00:01:03.619
Change one line. Calculate tax on the discounted amount. Rebuild, run the same test, and

00:01:03.619 --> 00:01:05.118
the total is correct.

00:01:09.000 --> 00:01:14.865
Then test the edges. Empty orders. Rounding. Shipping thresholds. Express delivery.

00:01:14.865 --> 00:01:21.264
Invalid inputs. Sixteen cases, executed in both normal and optimized native builds.

00:01:23.000 --> 00:01:28.830
Ownership is checked too. Move the receipt buffer, then read the old owner, and the

00:01:28.830 --> 00:01:31.551
compiler rejects the unsafe access before execution.

00:01:35.000 --> 00:01:42.496
Humans define the outcome. Agents write the implementation. Compiler checks and external tests provide the

00:01:42.496 --> 00:01:45.495
evidence. That's the AI# development workflow.
