Reserved before inspection.
A returned memory module, received at the warehouse.
Investigate
From domain to code with DDD.
One returned memory module. A fictional case.
Researcher and architect
in AI governance
A system and a language that help people and AI build other systems while preserving meaning, responsibility, and evidence.
He buys the last memory module.
The store confirms his order.
But before it ships, support calls:
“We can’t ship it yet.That returned unit is still waiting for inspection.”

Support opens BUG-4821. Our investigation begins here.
A returned memory module, received at the warehouse.
Investigate →
LP-2041 is physically present and unreserved. Inspection is pending.
The rule checks only presence and absence of a reservation.
Quality approval is never checked.
Does receipt authorize resale?
function canReserve(unit) {
return unit.present
&& !unit.reserved;
}
Data before checkout
canReserve(unit) → trueThe Store confirms the reservation.
Pseudocode of the existing rule.
“When you say in stock,
what does that mean?”
“It is here.”
Received“It passed inspection.”
Approved“It can go back on sale.”
SellableEach model owns a decision.
| Context | Question | Language |
|---|---|---|
| Warehouse | Where is the unit? | Receipt · location · custody |
| Quality | Did the unit pass inspection? | Inspection · outcome · approval |
| Commerce | Can it be sold and reserved? | Sellability · approval · reservation |
| Store | What do we show the customer? | Availability · purchase request |
What happened to the unit — and who recognizes each fact?
An explicit model of a domain’s concepts, relationships, and constraints.
Person · Organization · City
Works at · located in · lives in
Who works: PersonWhere: Organization
Next, we use this lens to examine LP-2041.
Each area is responsible for a different decision.
The outcome can be pass or fail.
The unit’s situation can change before purchase.
With these distinctions, when can we authorize a new sale?
“We can only reserve a returned unit if it is here, approved after inspection and free for an order.”
Receipt does not authorize resale. LP-2041 still needs to pass inspection.
The aggregate brings together the state and behaviors that protect this rule.
isSellable(): boolean {return this.present&& this.quality === "APPROVED"&& this.allocatedOrder === null;}1 · Physical presence is necessary, but does not authorize resale on its own.
All conditions are satisfied.
reserve(order: OrderId) {
if (!this.isSellable()) {
throw new UnitNotSellable();
}
this.allocatedOrder = order;
this.recordEvent(
new UnitReserved(
this.id, order
)
);
}Pseudocode inside SellableUnit.
Start with a valid scenario and change one fact at a time.
| Scenario | Reservation |
|---|---|
| Present + approved + free | Allowed |
| Same scenario, but physically absent | Rejected |
| Inspection failed | Rejected |
| Unit already allocated | Rejected |
| LP-2041: inspection pending, as in the ticket | Rejected |
Thank you for your attention.
Vladimir Rondelli
Researcher and architect in AI governance
cyberalchemylab.com