AIToday
AI Coding AssistantsAI Safety & AlignmentZenn AI/MLPublished: Oct 26, 2026, 01:00 JST

django-oscar fix shows why code needs 'Laws', ArchSig author says

Send on LINE
django-oscar fix shows why code needs 'Laws', ArchSig author says

3 Key Points

  1. What happened

    Using django-oscar's stock-allocation fix as a case study, an AI read the code against two Laws — stock allocated in stockrecord order (L1) and order lines created in basket order (L2) — and found the fix satisfied L1 but broke L2.

  2. Why it matters

    The author argues that committing to explicit Laws lets teams catch changes they did not intend, like the reordered order lines that reached invoices and emails, without reading all the code.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

A familiar problem: human code reading no longer keeps pace with AI-generated code. Its proposed posture is to decide in advance which properties must survive a change, write them as Laws, and define Atoms as the specific facts to read from code. ArchMap records those observations with source locations, so a questionable value can be traced back to the code.

The django-oscar case shows why this matters. A change meant to make stock locking order consistent also reordered order-line creation because both operations shared one loop. Against L1 (stock allocated in stockrecord order) and L2 (order lines created in basket order), the pre-change code failed L1 but passed L2; the reordered code passed L1 but failed L2. Only after the loops were split into PR #4594 and PR #4598 did both Laws pass.

This links to algebraic architecture theory (AAT), framing Laws as equations whose solution space represents software satisfying them, and describing how diagnosis and repair candidates can be explored within allowed change scopes. It acknowledges limits such as Rice's theorem, noting that restricting to finite or linear models makes judgment and repair computable.

FAQ
What went wrong in the django-oscar example?
A fix sorted basket lines by stockrecord to lock stock consistently, but the same loop also created order lines, so order lines were created in stockrecord order instead of basket order. This changed order details, invoices, and emails.
How was the django-oscar issue finally resolved?
The loop was split: one loop creates order lines in basket order, and another allocates stock in stockrecord order. PR #4594 and PR #4598 are cited for these changes.
What is ArchSig?
ArchSig is a tool under development that takes Atom definitions, Laws, and an ArchMap of observed code facts and checks whether the code satisfies the Laws. Version v0.6.0 produced the two-Law check in the example.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleAI wearables roundup: Bee, Friend, Muse Charm and more