Promise proof 4 promise classes · 18 real Kane runs · 9/9 HONOREDOpen the proof →

Closed loop

What failed, what changed, what reran.

Pre-repair audit 2026-11-22T00-53-05-669Z-f5230a. The diff is read from git; the objective hashes are read from the audit artifacts.

Recorded audit: replay of real runs, not a live session.
Original audit SHA-256: f42f8359bb40b9dc36114a125e7ce65e4b6a63bbd6d6523d726e4dd12fb425af
Recorded audit: replay of real runs, not a live session.
Original audit SHA-256: 6d9a2c1ddc078166fe32dbdf1b975ebba59a6598bca3bfaf8e7f2a037eec1eb6

Agent loop · terminal-driven

Kane's result gated the patch.

Pi is the coding agent that made the bounded repair. The repair was terminal-driven, not an in-app autonomous repair. No agent transcript is reproduced here; this is the recorded scope and git/audit evidence.

01 · Kane fails

The promise did not survive checkout.

Audit 2026-11-22T00-53-05-669Z-f5230a recorded these exact values. The $35 control stayed at $9.00, so the failure is specific.

Exact pre-repair Kane observations
CartPromisedObservedKane
$60.00 eligible
eligible-60
$0.00 $9.00 BROKEN
Eligible $60 cart is charged standard shipping
740 / assertion_error.confirmed_product_bug
$50.00 boundary
boundary-50
$0.00 $9.00 BROKEN
$50.00 boundary cart is charged standard shipping
740 / assertion_error.confirmed_product_bug
$35.00 control
control-35
$9.00 $9.00 HONORED
100 / success.complete

02 · Pi patches within the brief

A bounded source change.

Agent: Pi · terminal-driven. Branch: repair/free-shipping-threshold.

Bounded brief · scope record, not a transcript

Repair the shipping threshold in src/lib/shipping.ts and add the post-repair acceptance test. Do not edit the frozen contract, oracle, audit engine, parser, scenario definitions, fixtures, recorded evidence, receipt language, app configuration or secrets. Preserve unrelated work. The patch is accepted only after the unchanged six objectives rerun through Kane.

Allowed
src/lib/shipping.ts · tests/post-repair.test.ts
Forbidden
contracts/demo-promise.json · src/lib/contract.ts · src/lib/audit.ts · scripts/kane-audit.ts · recorded/ · tests/fixtures/ · docs/store-policy.md · .env* and secrets
Fix commit 4c8105f
4c8105f fix: compare free-shipping threshold in cents
Author
kaelah971 · 2026-11-23 12:33:01 UTC
Files changed
src/lib/shipping.ts · tests/post-repair.test.ts

03 · Human approval

The branch was merged by the owner.

The patch was not self-approved by the agent. The merge is a separate human action; the audit above ran on the repair branch.

Merge 88536a9
88536a9 merge: free-shipping threshold repair
Author
kaelah971 · 2026-11-23 12:47:35 UTC

04 · Kane reruns the same objectives

The gate, not the patch, decides.

2026-11-23T12-35-29-692Z-48b993 answers the pre-repair audit with the same objectives.

6/6 objective hashes match. 6/6 objective hashes match. Post-repair audit HONORED.

Ship gate

OPEN for the tested scope.

“The agent may not ship until Kane passes the same objectives.”

6/6 objective hashes match. Post-repair audit HONORED.

What failed

BROKEN

Contract kern-demo-free-shipping-v1 · 6 runs

$60.00 eligible

eligible-60

BROKEN

Promised $0.00 · Observed $9.00

Kane's verdict

Bug title
Eligible $60 cart is charged standard shipping
Severity
major
Family / category
application_issue / ui_data_defect
Confidence
0.98
Confirmed
Yes
Status
failed

Root cause. The store applied a shipping charge even though the cart subtotal was $60.00 and the store says US orders of $50.00 or more receive free standard shipping.

Suggestion. Fix the free-shipping rule so US standard-shipping carts with an after-discount merchandise subtotal of $50.00 or more show $0.00 shipping, then add a regression check for the $60.00 eligible-cart fixture.

Signals

  • 0-6 objective_contradiction: Shipping — Standard (3–5 business days) $9.00
  • 0-6 objective_contradiction: Merchandise subtotal (after discounts) $60.00
  • 0-2 objective_contradiction: Free standard shipping on US orders of $50.00 or more. After-discount merchandise subtotal, USD, standard shipping.

$50.00 boundary

boundary-50

BROKEN

Promised $0.00 · Observed $9.00

Kane's verdict

Bug title
$50.00 boundary cart is charged standard shipping
Severity
major
Family / category
application_issue / ui_data_defect
Confidence
0.98
Confirmed
Yes
Status
failed

Root cause. The store did not apply its free-shipping rule at the exact $50.00 merchandise-subtotal boundary.

Suggestion. Fix the free-shipping threshold comparison so a $50.00 after-discount merchandise subtotal receives $0.00 standard shipping, then add a boundary test for exactly $50.00.

Signals

  • 0-3 objective_contradiction: Free standard shipping on US orders of $50.00 or more.

The actual diff

git diff ed3dbaf HEAD -- src/lib/shipping.ts

diff --git a/src/lib/shipping.ts b/src/lib/shipping.ts
index 1c80d95..97daf3c 100644
--- a/src/lib/shipping.ts
+++ b/src/lib/shipping.ts
@@ -2,32 +2,20 @@ export const FREE_SHIPPING_THRESHOLD_CENTS = 5_000;
 export const STANDARD_SHIPPING_CENTS = 900;
 
 /**
- * ===========================================================================
- * DELIBERATE DEMO DEFECT — SEEDED ON PURPOSE. DO NOT SHIP THIS FUNCTION.
- * ===========================================================================
+ * US standard shipping for the Kern demo store.
  *
- * The advertised promise is free standard shipping at an after-discount
- * merchandise subtotal of $50.00 (5,000 cents) or more.
+ * Free when the after-discount merchandise subtotal is $50.00 (5,000 cents)
+ * or more; otherwise $9.00. Both sides are integer cents.
  *
- * This implementation compares a cents subtotal against a threshold that has
- * been multiplied by 100, as if the constant were denominated in dollars.
- * The effect is that no realistic cart ever reaches the free-shipping branch:
- *
- *   $35.00 cart (3,500 cents)  -> $9.00  (correct by accident)
- *   $50.00 cart (5,000 cents)  -> $9.00  (WRONG; promise says $0.00)
- *   $60.00 cart (6,000 cents)  -> $9.00  (WRONG; promise says $0.00)
- *
- * This is the controlled defect the Kern repair slice is meant to fix. The
- * oracle in src/lib/contract.ts is independent of this function and must not
- * be edited to match it. See docs/demo-defect.md.
+ * This is the repaired version of the seeded demo defect. The buggy revision
+ * remains reachable in git history; see README "Replay the pre-repair defect".
  */
 export function getStandardShippingCents(subtotalCents: number): number {
   if (!Number.isSafeInteger(subtotalCents) || subtotalCents < 0) {
     throw new RangeError(`subtotal must be non-negative integer cents, got ${subtotalCents}`);
   }
 
-  // DELIBERATE DEMO DEFECT: * 100 treats the cents threshold as dollars.
-  if (subtotalCents >= FREE_SHIPPING_THRESHOLD_CENTS * 100) {
+  if (subtotalCents >= FREE_SHIPPING_THRESHOLD_CENTS) {
     return 0;
   }
   return STANDARD_SHIPPING_CENTS;
 

Unchanged rerun

HONORED

2026-11-23T12-35-29-692Z-48b993

Answers 2026-11-22T00-53-05-669Z-f5230a · 6 runs · 117.14 credits

6/6 objective hashes match.

Pre-repair and post-repair objective hashes
Scenario / runPre-repair SHA-256Post-repair SHA-256
eligible-60
observe · MATCH
0a6c2a3c1736 0a6c2a3c1736
eligible-60
assert · MATCH
bac28a215bb8 bac28a215bb8
boundary-50
observe · MATCH
943d13847c0f 943d13847c0f
boundary-50
assert · MATCH
d6fd99ab4c6f d6fd99ab4c6f
control-35
observe · MATCH
75a02fea8548 75a02fea8548
control-35
assert · MATCH
73cea5ea958c 73cea5ea958c

First 12 hex characters shown; the complete 64-character values are in the audit artifact (audit.json). Hover a hash for its full value.

Promise Receipt