Systems and records
What a correct count hides: an inventory usability decision dataset
By SourceX Editorial · Reviewed by Noah Loul ·
9 sections
Short answer
An inventory usability decision dataset stores each case where stock was counted correctly but some of it could not be used: expired, quarantined, damaged, wrong revision, allocated or on hold. Each episode records the state as the system showed it at decision time, who had authority to release it, the release evidence and what shipped. In OpenBoxes, six of seven declared lot statuses never reduce available-to-promise.
Checklist
Inventory usability decision
Key takeaways
- A correct count answers how many units exist, not how many may be used; the dataset has to model the second question.
- Each of the six usability states has its own releaser and its own evidence, so one unavailable flag destroys the signal.
- In OpenBoxes at commit d28bf7c, only RECALLED of seven lot statuses reaches available-to-promise, and the lot keeps no record of who set it.
- Hold locations and regulated release records keep the releaser; status flags and write-offs often do not, so label those releases unattributed.
- Grade agents against release records and outcomes, never against the system's available figure.
What should an inventory usability decision dataset record?
It should record, for every demand that met held or doubtful stock, which units could be committed on that date, which could not and why, who had authority to release each blocked quantity, what that release rested on, and what finally shipped. The on-hand count is only the opening fact. A correct count of 240 units cannot tell you whether 40 or 200 of them may leave the building today.
The decision being modeled is narrow on purpose. Given one demand line and the stock records exactly as they stood at that moment, how much may be promised now, how much could be promised once a named person acts, and how much must not be promised at all? Evidence that supports a useful answer has four parts: a snapshot of each lot's state at decision time rather than its status today, the release events with an actor and a basis, the demand with its constraints, and the record of what actually moved.
This differs from a count-correction dataset, where the number itself was wrong, and from an allocation dataset, where usable stock is short and two orders compete for it. Here the number is right and the units exist; the question is whether each of them is allowed to be used, and whose signature changes that.
Six states a correct count hides, and who can lift each one
Expired, quarantined, damaged, wrong revision, allocated and on hold are the six states that leave a count accurate and the stock unusable, and each has its own release path. A dataset that collapses them into one unavailable flag loses the only part a model has to learn: which release is possible, by whom, and on what evidence.
Regulated industries spell out the hardest of these states. The drug manufacturing rules in 21 CFR Part 211, as shown on eCFR, require each lot of components, containers and closures to be identified by status as quarantined, approved or rejected, require storage under quarantine until testing or examination and release, keep incoming lots out of use until the quality control unit releases them, and make that unit responsible for approving or rejecting them (sections 211.80(d), 211.82(b), 211.84(a) and 211.22(a), paraphrased from an eCFR excerpt).
Defense logistics adds the in-between states. The Defense Logistics Agency's condition code definitions separate serviceable stock issuable without qualification (code A) from stock issuable only with qualification because of limited usefulness or short remaining life (B), stock suspended from issue while its true condition is unknown (J) and stock suspended for a potential or confirmed quality deficiency (Q). Expiry is not always final either: under the federal Shelf-Life Extension Program, which the Department of Defense administers and FDA supports with testing, stockpiled lots can be extended past their labeled dates after stability testing if they were stored as labeled, and FDA says the program is limited to federal stockpiles.
The constraint matrix below turns those states into fields a dataset can carry and a grader can check:
| State | What the count still shows | How the record should show it | Who can release it | Release evidence to keep |
|---|---|---|---|---|
| Expired | Units past their use-by date, still on the shelf | Lot expiry date plus the date the state was evaluated, not only a computed flag | Usually no one inside the company; a regulator program can extend named lots (federal stockpiles only under SLEP) | Write-off or return transaction, or the extension notice naming lot and storage condition |
| Quarantined | Received units awaiting test or inspection | Status per lot or a quarantine location, set at receipt | The quality unit; in drug manufacturing, the quality control unit | Test or inspection result, release decision, releaser role and date |
| Damaged | Units found broken or out of condition | Condition or disposition code, or a move to a damage location | Quality or the warehouse lead deciding scrap, rework or return | Inspection note, disposition transaction and its author |
| Wrong revision | Units built to a superseded drawing or label | Revision on the lot or serial record beside the revision the demand requires | Engineering or the customer, through a written deviation | Deviation or concession with scope, quantity and end date |
| Allocated | Units already promised to another demand | Allocation or pick record linked to the other order | The planner applying the written priority rule | Reallocation record naming both orders and the rule used |
| On hold | Units suspended for an investigation, recall check or dispute | Hold location or hold status with a reason code | Whoever placed the hold, or the role the hold names | Hold and release transactions with actor, reason and time |
Seven lot labels, one subtraction: what OpenBoxes does with each status
In OpenBoxes, only one of seven declared lot statuses changes the quantity the system reports as available to promise; the other six are labels without arithmetic. OpenBoxes is an open-source warehouse and inventory management system whose README says it runs in healthcare facilities in Sierra Leone, Lesotho, Rwanda, Liberia and the United States, which makes it a fair public test of how usability states reach the number an agent would read.
The audit read the code at commit d28bf7c (October 26, 2026) and ran no code from it. The status list declares APPROVED, RECALLED, ON_HOLD, QUARANTINED, EXPIRED, RESERVED and DAMAGED. Across the other 6,120 files under grails-app/ and src/, the qualified reference LotStatusCode.RECALLED appears on 9 lines and each of the other six appears on none. ON_HOLD, QUARANTINED and RESERVED do not occur anywhere outside the status file, even as bare words; the bare-word hits for the other three come from different lists, such as order statuses and adjustment reason codes.
The availability service shows why that matters. It counts a quantity as on hold when its bin belongs to a location that supports the HOLD_STOCK activity or its lot is RECALLED, then computes available to promise as on hand minus allocated minus on hold. Expired stock drops out only when the caller applies an expiration filter, and one of the filter options, DO_NOT_SUBTRACT_EXPIRED_STOCK, leaves it in.
Attribution differs by route. Only administrators can recall a lot or revert the recall, reverting sets the status back to empty, and the lot record carries lot number, expiry date, status, comments and timestamps but no field for who set the status or why. Moving stock into a hold bin is a stock transaction instead, and OpenBoxes transactions record created-by, updated-by and confirmed-by users and a comment. The same physical hold leaves an author in one encoding and none in the other. None of this is a defect report; it shows that a status column existing is no evidence that it governs the available figure.
| Lot status | Qualified code references | Effect on available to promise | Who-set-it record on the lot |
|---|---|---|---|
| APPROVED | 0 | None | None |
| RECALLED | 9 | Whole lot quantity counted as on hold | None; administrator-only action, revert clears it |
| ON_HOLD | 0 | None; holds work through hold bins | None |
| QUARANTINED | 0 | None | None |
| EXPIRED | 0 | None; expiry comes from the date and an optional query filter | Not applicable |
| RESERVED | 0 | None; allocation comes from pick lists | None |
| DAMAGED | 0 | None; damage is written off with an adjustment reason | Author sits on the adjustment transaction |
Write-off, flag, hold bin or condition code: what each encoding keeps
Systems record usability in four ways, and only hold locations and regulated release records reliably keep who lifted the state. Before building episodes, identify which encoding each source system uses, because it decides which labels can be recovered at all and which must be marked unknown.
OpenLMIS, an open-source logistics management information system, shows the write-off pattern. Its demo configuration lists eight stock card reasons, six of them debit adjustments: Damage, Expired, Stolen, Lost, Passed open-vial time limit and Cold chain failure. Its lot record holds a lot code, expiry date, manufacture date, trade item and an active flag, and a search of the main source of both services found no file that mentions quarantine or unusable stock. Until someone posts the debit, an expired unit is part of stock on hand; afterwards it leaves the count with a reason attached.
Each encoding leaves a different trail for a dataset builder:
- Write-off with a reason (OpenLMIS debits, OpenBoxes adjustment reasons): recovers the outcome and its reason, but not how long unusable units sat inside the available figure before the posting.
- Status flag on the lot (OpenBoxes lot status): recovers the label, but the audited code applies only RECALLED to availability and stores no actor, reason or release date on the lot.
- Hold location (OpenBoxes HOLD_STOCK bins): recovers state, actor and time, because entering and leaving the hold are stock transactions with named users.
- Condition code or regulated status (DLA supply condition codes, the 21 CFR Part 211 quarantined, approved and rejected labels): recovers the state as part of how the stock is described, and in drug manufacturing a release decision by a named unit.
Who released it? Evidence that turns a status into a decision
A release is usable evidence only when it names a role acting within its authority, on a stated basis, for a stated scope and time. Anything less is a status change, and a model trained on unexplained status changes learns that blocked stock becomes available on its own.
The sources above show what a complete release looks like. Under Part 211 the basis is a test or examination result and the actor is the quality control unit. Under the Defense Logistics Agency's code J the basis is a condition classification that resolves an unknown condition. Under the Shelf-Life Extension Program the basis is a stability test, the scope is specific lots, and the release holds only for product stored under its labeled conditions, so the evidence has to carry lot and storage condition, not just a new date.
Three inference rules keep labels honest. Never infer a release from a later shipment, because shipping quarantined stock may be the error the dataset should capture. Never infer authority from the fact that a status changed; label a cleared status with no actor as release unattributed. And never backfill a state from today's record, since an expiry date, a hold reason or a revision can be corrected after the decision.
The usability decision packet, field by field
Each episode joins one demand line to one stock position at one moment, and the packet keeps what an evaluator needs to grade both the commitment and the release. Pseudonymize customers and people before export, and keep the field order so episodes from different systems line up:
At a glance
The usability decision packet, field by field
- Demand: line identifier, item, quantity, required date and demand-side constraints such as required revision or minimum remaining shelf life.
- Stock snapshot at decision time: quantity per lot and location, expiry date, status or condition code, location type and revision.
- System figure: the available quantity the system showed, with the settings that produced it, such as whether an expiration filter applied.
- State evidence: for each blocked quantity, the record showing the state, its source system and its timestamp.
- Release authority: the role allowed to lift each state, taken from procedures, quality agreements or delegation records.
- Release events: actor role, basis (test result, deviation, extension notice, classification), scope (lot, bin or serial) and time.
- Decision: quantity committed and from which lots, quantity offered conditionally and on which release, quantity refused.
- Communication: what the requester or customer was told, and when.
- Outcome: shipment, receipt or consumption records, plus returns or complaints traced to the lots used.
- Labels: correct commitment, over-commitment, under-commitment, state misread, release unattributed.
Does the fastest pick explain the error better than a misread state?
Sometimes it does, so the dataset has to separate the two explanations. A picking rule that takes the nearest or oldest lot, or a planner taking the quickest path, can pull expired or quarantined units even when the state was recorded correctly, and that is a different failure from misreading the state.
Record whether the lot actually used was the system's default suggestion. If over-commitments cluster where the default lot was blocked, the fault is the suggestion logic; if they appear even when a usable lot was the default, the agent or planner misread the state. Include counterexamples where the usable stock is farther away, costs a transfer from another site, or needs a release from someone who is unavailable that day. A model that always takes the quickest path or the system's available figure fails those episodes, which is the point: the cheapest or fastest action is wrong exactly when it breaks a usability constraint.
One more rival explanation has to be ruled out per episode: that the count itself was wrong. Require a verified count, or a count reconciliation, before an episode enters the set, and route count disputes to a count-correction dataset instead.
Illustrative episode: 240 counted, 40 promisable today
Illustrative case, not a real record. A distributor counts 240 filter cartridges of one part number, and the count is correct. A new order asks for 90 within two days. The stock sits in six positions, and only 40 units are promisable today.
In a system that treats statuses the way the audited OpenBoxes code does, with no hold bins in use, no recall and the expiration filter off, the available figure would read 210: 240 on hand minus the 30 allocated. An agent that promises all 90 from that figure over-commits by 50 units: only 40 are releasable today, and the rest would have to come from quarantined, expired, damaged or wrong-revision lots.
The correct response commits 40 now, offers up to 50 more if incoming inspection passes and quality releases the lot in time, offers the revision C units only if the customer issues a written deviation, and leaves the allocated 30 with the earlier order unless the written priority rule says otherwise. Each line of the case carries its own release path:
| Position | Units | State on the decision date | Who could release | Correct handling |
|---|---|---|---|---|
| Lot A | 60 | Expired last week | No one in the company | Exclude; write off or return |
| Lot B | 50 | Quarantined pending incoming inspection | Quality, after inspection | Offer conditionally, stating the dependency |
| Lot C | 20 | Damaged cartons found at count | Quality, by disposition | Exclude pending disposition |
| Lot D | 40 | Revision C; customer drawing requires D | Customer, by written deviation | Offer only with the deviation in hand |
| Lot E | 30 | Allocated to an earlier order | Planner, under the priority rule | Keep allocated unless the rule moves it |
| Lot F | 40 | Usable | Not needed | Commit now |
Requesting usability episodes from real stock records, and this design's limits
A buyer who needs usability episodes should specify the states, the release evidence and the acceptance test before any records move. SourceX sources datasets to order from U.S. businesses rather than keeping an inventory of them, and a buyer starts by describing the records it needs: their scope and volume, the language and format, when they are needed and on what license terms. The supplying company approves the scope and terms and signs before anything is delivered. A useful request names candidate records such as lot-level stock histories with status changes, quality release records, hold and release transactions, allocation records and shipment outcomes. It cannot promise that such records exist at any particular company, or that a model trained on them will improve.
This design has limits. The code audit covers two open-source systems at one commit each, not commercial ERPs and not how any site configures them; a site that uses hold bins consistently would keep authors that the lot flag does not. The regulatory sources describe drug manufacturing and defense logistics, and other sectors set their own release authorities. Not measured: how often each state occurs in real inventories, how often agents or planners over-commit against them, and how many releases in real records lack an actor. The next evidence needed is a sample of real episodes, with release records attached, scored against the packet above.
Frequently asked questions
What is the difference between on-hand and available-to-promise stock?
On-hand is what the count says is physically present. Available to promise is what the system will let you commit after subtracting allocations and anything it treats as held. The gap between them depends on which usability states the system actually subtracts, which in the audited OpenBoxes code is recalled lots and hold bins only.
Can expired inventory ever be released for use?
Sometimes, but only through a named authority and for named lots. The federal Shelf-Life Extension Program extends stockpiled drug lots after FDA stability testing, for product stored as labeled, and FDA says it is limited to federal stockpiles. Outside such a program, expired stock is normally written off or returned.
Who can release quarantined stock?
In drug manufacturing, 21 CFR Part 211 keeps incoming components out of use until tested and released and makes the quality control unit responsible for approving or rejecting them. Elsewhere, the releasing role should be named in the company's procedures or quality agreements, and the dataset should record that role with each release.
Why not train a stock agent on the system's available quantity?
Because that figure may ignore states the system labels but does not subtract. In OpenBoxes, six of seven lot statuses never touch available to promise, so an agent that trusts the figure would promise quarantined or damaged units. Grade against release records instead.
What records does a company need to build usability episodes?
Lot-level stock history with status or condition changes, quality release or inspection records, hold and release transactions, allocation or pick records, and shipment or consumption outcomes. Each needs timestamps and an actor role, and customer and personal details should be pseudonymized before export.
Sources
- 21 CFR Part 211 requires lot status identification (quarantined, approved, rejected), quarantine until testing and release, withholding until the quality control unit releases, and gives that unit authority to approve or reject. Source
- DLA supply condition codes distinguish serviceable stock issuable with or without qualification from stock suspended pending classification or for a quality deficiency. Source
- The Shelf-Life Extension Program, administered by DoD with FDA testing, extends labeled expiry for properly stored federal stockpile lots and is limited to federal stockpiles. Source
- OpenBoxes describes itself as an open-source warehouse and inventory management system running in healthcare facilities in several countries. Source
- OpenBoxes declares seven lot statuses: APPROVED, RECALLED, ON_HOLD, QUARANTINED, EXPIRED, RESERVED and DAMAGED. Source
- OpenBoxes counts stock as on hold for hold bins or recalled lots and computes available to promise as on hand minus allocated minus on hold, with expiry handled by an optional filter. Source
- OpenBoxes restricts recalling a lot and reverting a recall to administrator users. Source
- Reverting a recall in OpenBoxes sets the lot status back to null, and moving stock between bins creates transfer transactions. Source
- The OpenBoxes lot record holds lot number, expiry date, status, comments and timestamps, with no actor or reason field. Source
- OpenBoxes stock transactions record created-by, updated-by and confirmed-by users and a comment. Source
- OpenLMIS demo data lists eight stock card reasons, six of them adjustment debits for damage, expiry, theft, loss, open-vial time limit and cold chain failure. Source
- The OpenLMIS lot record holds lot code, expiration date, manufacture date, trade item and an active flag. Source
Tell us what data you need
Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.