-
Notifications
You must be signed in to change notification settings - Fork 0
[C] #514 slice 13: General Inventory contract and the flock-eligibility read #855
Copy link
Copy link
Open
Labels
area:apiAPI/endpoint layerAPI/endpoint layerepic-514Modular monolith architecture (#514)Modular monolith architecture (#514)priority:tier4Deferred or speculativeDeferred or speculativesize:MA day or two; migration or a multi-state UIA day or two; migration or a multi-state UIsliceThin vertical work itemThin vertical work itemtrack:C#514 Track C — moves production code; UNSCHEDULED, needs authorisation#514 Track C — moves production code; UNSCHEDULED, needs authorisation
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
area:apiAPI/endpoint layerAPI/endpoint layerepic-514Modular monolith architecture (#514)Modular monolith architecture (#514)priority:tier4Deferred or speculativeDeferred or speculativesize:MA day or two; migration or a multi-state UIA day or two; migration or a multi-state UIsliceThin vertical work itemThin vertical work itemtrack:C#514 Track C — moves production code; UNSCHEDULED, needs authorisation#514 Track C — moves production code; UNSCHEDULED, needs authorisation
Important
Track C is unscheduled. These slices move production code, and the 2026-08 design's own status
line still governs: "proposed architecture; no production refactor is authorized by this
document." Filed so the analysis is tracked work rather than a comment, not as a commitment to
run it.
The 2026-09-14 re-plan
recommends gating Track C on evidence from Tracks A and B: if the #842 ratchet fires repeatedly in
real pull requests, these become worth their cost; if it stays quiet, they do not. Track C is
57–95 focused engineering days and produces no user-visible change.
Read the re-plan before picking any of these up. Several assumptions in the 2026-08 plan are
corrected there.
Inventory items, lots, movements, feed usage and water usage behind a contract.
Scope
IInventoryModuleover purchase, adjust, consume, feed usage and water usage.slice carries is importing
Flockinstead of asking a question about it.The ordering detail that must not move
RecordFeedUsagelocks the inventory item first, then — still inside that same transaction —evaluates flock eligibility, then reads lots. The check must stay inside the transaction and after
the item lock.
Moving it to a precondition before the transaction opens would widen the race, not close it.
Today's shape deliberately shrinks a concurrent archive/deplete race to the commit itself, and leaves
the flock row unlocked on purpose: a same-day deplete racing a same-day feed is business-valid either
way, because the birds ate before they left.
Done when
Unedited and green: backdated FIFO consumption, insufficient-stock rollback, concurrent lot
consumption, flock eligibility behaviour, currency handling, tenant and
Versiontests, API and SPAcontracts. One inventory transaction retained. EF model digest identical.
Explicitly not in this slice
Flock internals. Egg stock — that is Egg Operations' ledger and a different FIFO.