ITAD Inventory & Asset Disposition Platform
A production system for IT asset disposition: receiving, hardware audit, grading, refurbishment, sales and compliance certification. It replaces a spreadsheet-and-memory process with one auditable record per device, and it issues the data-erasure certificates the industry actually gets asked for.
- Role
- Sole designer, architect and engineer
- Timeline
- Jan 2025 — Present
- Status
- live
- Tracking granularities
- 3Serialised devices, bulk SKUs, and mixed-quantity pallets — the three ways stock physically arrives.
- Lifecycle stages modelled
- 10Receive → verify → sort → audit → grade → refurbish → inventory → sales → compliance → reporting.
- Records destroyed on sale
- 0The tool it replaced deleted assets after sale. History here is append-only.
Latest updates
A destroyed drive or device now gets its own Certificate of Destruction, and a destroyed device cannot be sold
Customers sometimes want equipment destroyed rather than erased. The platform could only note that as a hand-typed erasure, on a document headed as an erasure certificate. There is now a separate Certificate of Destruction that lists each drive or item by serial, says plainly that a person entered it, and locks a destroyed device out of stock.
- The problem
- Physical destruction printed on an erasure certificate that did not name the drive and had nowhere to record the method, shred size, witness, contractor or waste paperwork. Separately, marking a device as disposed did not by itself stop it being sold.
- What changed
- Destruction records have their own tables, number series and hash chain, and are signed when a signing key is configured. One certificate covers one destruction event with a line per drive or whole item, a serial or the reason it cannot be read, the method, date and place, who did it, an optional witness, contractor and waste references, and optional photos whose fingerprints are part of the record. Records can only be added to: a correction, late evidence or a withdrawal is filed alongside. The wording states that the audit station did not perform or verify the destruction, and a contractor's work is described as reported by them. The software records what is typed and does not check that the destruction was lawful.
- How it was fixed
- The sale lock is enforced in the database rather than in each screen, because stock status is written by many paths. A device destroyed whole cannot be sold, restocked, put on a pallet or deleted unless the certificate is withdrawn, while a machine that only had a drive destroyed stays sellable.
- Improvements
- Destruction and erasure are now two different documents with different claims
- Each drive or item is identified on the certificate
- A device recorded as destroyed whole is blocked from sale on every path
- Merged and deployed, with its tests passing; the new screens have not yet been used on the live system, and online checking of certificates is not switched on
A batch can now be sorted into boxes, with a label and a location, and both systems keep the same boxes
A pallet of mixed laptops arrives as one batch, but staff wanted to sort it into boxes (by generation, say) while auditing, keep some machines directly in the batch, and have the partner platform show exactly the same structure. A box now belongs to one batch, gets a reference that carries the batch (BAT-10017-BOX-001), can be chosen or made on the audit stick, and can be labelled and moved.
- The problem
- There was no level between a batch and a machine. Sorting into boxes happened on paper after the audit, so a box could not be traced to its audit, and two systems each holding their own idea of a box would have drifted apart.
- What changed
- One system issues every box reference, under a lock on the batch, so two technicians making a box at the same moment get different numbers; a reference is written once and never changes. A machine is in one box or none, and only a box of its own batch, which the database enforces, so boxed plus unboxed always equals the batch total and nothing is counted twice. The partner platform reads the boxes and asks the service to make one, with an id of its own so a retry cannot make two, and reuses the storage box it already had instead of inventing a second concept. On the stick a technician picks or makes a box before auditing. A box made with no network is kept under a key of the stick's own, and the first audit that reaches the server asks for the box under that key, so queued records, a retry or a reboot can never make two. Labels carry the batch, the reference, the name and a QR code, and moving boxes sets a location that the partner owns and the service then shows beside the box.
- How it was fixed
- Several problems only appeared by testing against the real code. The wipe route now carries the box, which moved the wipe engine's fingerprint, so the tool version was bumped and re-pinned rather than the guard being loosened. A keyboard-handler guard caught an inline Enter key handler on the new field, which I replaced with a form submit. A box label's QR code would have opened its batch, because the scanner read anything starting with the batch prefix as a batch, so the box reference now reads as a box. The first publish of the partner side did not take effect until it was pressed again, which I found by checking the live bundle for the new text rather than assuming.
- Improvements
- Batch, box and machine relationships are the same in both systems, with one place issuing references
- A machine can only be in a box of its own batch, enforced in the database, so the counts cannot double count
- The stick can make and audit into a box with no network, and the box is created exactly once when the connection returns
- Box labels print with a QR code that opens the box, and one or many boxes can be moved to a location that both systems show
- All five parts are merged and live. The stick path was confirmed on hardware by the owner; printing a label and moving boxes are live but their first real use has not been confirmed yet
A partner inventory platform can now ask the audit service to audit a machine, read what was found, and download the signed erasure certificate
The audit service used to be something only its own staff used. It now has a small, versioned API for a partner platform: the partner announces a batch, asks for a machine to be audited, reads the audit and the wipe record when it is done, and downloads the signed certificate. Each of those is its own permission on a key that can be rotated and revoked.
- The problem
- A partner's inventory system needed audited machines and proof of erasure inside its own records, but the only way to get them was to re-key results by hand or give the partner a staff login. A staff login would have shown them every customer's machines, and a hand-copied certificate is not evidence anyone can check.
- What changed
- Keys are issued per partner with four separate permissions (start audits, read audit jobs, read results, read certificates), stored only as hashes, shown once, and rotated with a grace period so a partner can switch without downtime. A partner sees only the batches it announced: a machine from anyone else's batch answers exactly like one that does not exist. The audit and wipe routes read stored records and change nothing. The certificate route reuses the same eligibility rule, signing ledger and PDF as the staff download, so a partner can never be handed a certificate staff could not issue. It is signed-only: with signing off a partner gets a clear refusal and never an unsigned document. Asking for a machine's certificate for the first time issues it, once, with one stable number however often it is asked for.
- How it was fixed
- Signing is a safety-critical switch, so the server was built to refuse to start rather than run with a key it cannot read, and the production key was generated on my own machine and never typed into a chat, a log or the repository. Each slice was proved against a real Postgres, and the partner side was exercised end to end against a local copy of the service signing with a throwaway key before anything reached production. Along the way a test that empties the certificate table collided with the new ones on a shared database, so the new certificate tests run on a database of their own.
- Improvements
- A partner reads audits, wipe records and signed certificates through scoped, revocable keys, and sees only its own batches
- A partner can never receive an unsigned certificate, or one that staff could not download
- Asking again is always safe: a retried request returns the same record and never makes a second certificate
- Merged and deployed in stages; production signing is switched on. The first partner screen showing the certificate and a real signed download from the live site have not yet been seen by me
A drive the wipe engine refused to touch is now kept as its own record, not just on the stick
When the wipe engine refuses a drive (the wrong drive, a USB device, the boot disk, an unapproved technique), the screen said so and the stick logged it, and the server never learned that a drive was skipped or why. The station now files that refusal as a record of its own. It is evidence kept and nothing more: no machine's status, certificate or release check reads it.
- The problem
- Filing a refusal as a failed wipe would have been wrong, because the drive was never touched and a failed row on a device would block a machine whose drive is fine. Leaving it on the stick meant the platform could not show that a drive had been deliberately skipped, under which policy, or how often.
- What changed
- A new insert-only table keeps one row per refused attempt, keyed by the attempt's own station record id so the kiosk's retries never double it. It stores the drive as the engine named it, the engine's code and sentence exactly as sent, a closed reading of the code that falls back to unknown for one it has not met, the policy and register versions, and when. The station files only a verdict the engine itself gave, through the same upload queue as a wipe, and a failure to file never changes what the operator sees. The route answers success even for a body it cannot use, because the kiosk retries a rejected upload for ever, and answers unavailable only when the table is missing, so a record is kept until the server is ready. No other part of the platform reads the table.
- How it was fixed
- The pull request's CI failed once: an earlier slice's test, which checks that its own column names appear on no other table, caught the new table's generic names. The table is a separate record, so I allowed it in that test rather than renaming five columns across the code. Proof: the type check, 140 unit suites (3,226 tests) and the tool tests passed locally, and CI, which runs the Postgres specs and the migration chain, passed before merge. Stated plainly: no mutation run and no replay against the previous tree were made, and the kiosk change has not yet been seen on a real stick.
- Improvements
- A refused drive is now evidence on the server: which drive, which code, under which policy, and when
- A resend of the same refusal writes nothing, so a flaky connection cannot inflate the count
- It cannot affect a machine: no certificate, release check, roll-up or sync rule reads it, and a wipe still uploads exactly as before
- Merged on 20 October 2026 and deployed with the next commit after it: the API serves that commit and the route answers 401. A stick sync and a bench test of a refused drive are still owed, and the owner's production checks have not been run
The owner can size what a validation requirement would hold before switching it on, and a machine's journey can be written down, both still off
Two pieces landed behind switches that nothing sets. A read-only command now counts what the validation requirement would hold back from release before anyone turns it on, and the lifecycle events for a machine's journey now have writers, off by default.
- The problem
- The validation requirement from the day before would hold a machine the moment it was switched on, including any rejection already on record, and the owner had no way to see how many that was. Separately, the lifecycle event types existed but nothing wrote them, the release path that was supposed to write RELEASED was no longer in use, and a pallet could be marked shipped with none of its ship records written if a write failed halfway.
- What changed
- A sizing flag on the existing release blast-radius command counts devices held, newly held, and by reason (not validated, rejected, escalated, check failed), using the same rule the release itself runs, in a read-only transaction. The require mode of the validation setting is now only an alias of release, with no effect on certificates, because the signed validation addendum already exists. For lifecycle, one switch, LIFECYCLE_EVENTS=1, turns on writers for sanitisation started and completed, validated, released (on every live release path, inside the release's own transaction), received, last-use location and final disposition. Failures are caught per event so a filed wipe or validation is never turned into an error. Separately and not switched, a pallet's shipped status and its ship records are now one transaction, and the ship record carries who shipped it.
- How it was fixed
- The sizing step is the thing the validation requirement's own record said must exist before the switch is used; it now does. Proof for the lifecycle work: the type check and 21 unit tests passed locally, and the pull request's CI, which runs the Postgres specs, passed before merge. Stated plainly: the sizing command has not been run against a real database, the lifecycle switch has never been on against real data, and the pallet add-assets path creates no device, transferred events are not written, and there is no screen showing the events.
- Improvements
- The owner can see how many machines the validation requirement would hold, and why, before choosing to turn it on
- A half-shipped pallet can no longer happen: the status change and its ship records succeed or fail together
- A machine's received, sanitised, validated and released events can be written, and only when the owner switches it on
- Merged on 19 October 2026 and deployed (the API serves the merge commit); both switches are unset, so nothing about behaviour has changed except the atomic ship
A certificate can now be added to after it is issued, without reissuing it, and a whole lot gets a signed certificate of its own
A certificate says what was erased, but sometimes something has to be said later: a person validated the erasure, or late evidence turned up. Until now the only option was to reissue. Certificates now carry more of the facts a reader relies on, can be extended by signed addenda, and a lot of machines gets a signed, stored certificate that points at each device's own.
- The problem
- The device certificate did not carry the source, classification, condition, verification method, disposition or destination of a machine, so a reader had to trust other systems for them. It had no way to say anything afterwards, and the lot certificate was an unsigned summary. Separately, I found that this work had been merged on 18 October into the stage's working branch and not into master, so it was not live even though the pull request said merged.
- What changed
- New certificates carry a record section and an attestation page with an attester and a second, separate concurrence. Addenda are signed, insert-only and chained to their certificate, numbered from it, and a validation addendum copies the result and the validator from the validation record instead of letting anyone type them. The lot certificate is signed and stored, ties every device to its certificate by number and hash, and a changed lot gets the next number, chained to the last. A register limitation may be printed on a certificate only if its wording passes a check against unrecoverable, guarantee and standard-approval claims. Unrecognised values print as not recognised rather than as a bare code. The offline verifier and the public check understand addenda and lots. Filing an addendum needs the review permission and is off while signing is off.
- How it was fixed
- I re-landed the same commit on top of current master as a new pull request, resolving one conflict by keeping both sides of a list in a test guard. A first attempt used a branch name that already existed and showed the wrong commits, so I closed it unmerged. Proof: the type check is clean, 136 unit suites (3,202 tests) pass, and the pull request's CI, which runs the Postgres specs, the migration chain and the boot, was green before the merge. No replay against the previous tree and no mutation run was made for this stage, and the record says so.
- Improvements
- Something can be said about a certificate after it is issued, signed and chained, without reissuing it
- A validation on an addendum is copied from the validation record, never typed
- A lot of machines has a signed certificate that points at each device's own by number and hash
- Merged on 19 October 2026 and live: the API reports the merge commit and the new lot route answers 401. Nothing has been filed on real data, and the owner's production checks have not been run
A rejected or escalated erasure can now be made to hold a machine back from release, but only if the owner switches it on
A person's rejection of an erasure was recorded but nothing acted on it, so a machine someone had refused to accept could still pass the release check. A setting now lets the owner make a rejection or an escalation block release, and a missing validation appear as a note. It ships silent, so nothing about release changes until the owner chooses.
- The problem
- The release check read the wipe and the certificate but not the person's decision. Making it read the decision had to avoid two mistakes: treating the absence of a validation as a pass or as a refusal, when it is neither, and surprising the owner on the day the setting is switched on, because every rejection already on record would start holding its machine at once.
- What changed
- One setting with three modes: record (the default), release and require. Unset, blank or any unrecognised value reads as record, and the release check then behaves exactly as before. In release mode the check compares the newest validation with the exact wipe records the certificate counts: a rejection or an escalation is a blocker, an approval says nothing, and no validation is a note that does not hold a release. A failed read, a missing table or an unknown decision marks that device as unchecked rather than guessing. The require mode is reserved and reads as record for now. The device page and the validation form say whether the setting is in force. No migration.
- How it was fixed
- Merged with its checks green. What it did not get is stated in its record: the database-backed specs, the replays against the earlier tree, the mutation run and the scope checks were not run in this slice, and the GitHub checks are the only full-suite gate it passed. One gap is open on purpose: the command that sizes how many machines the setting would hold, before it is switched on, is not built yet, and the record says the setting must not be turned on until it is.
- Improvements
- A rejection or an escalation can be made to hold a machine from release, by the owner's choice alone, and an absent validation is only ever a note
- The default changes nothing: with the setting unset no statement, answer or release record differs
- Nothing is grandfathered: once switched on, a rejection already on record holds its machine immediately, which is why the sizing step comes first
- Merged on 19 October 2026 and its deploy statuses are green; the setting is unset and nothing has been held. The owner's read-only production checks have not been run
The validation form now shows what the server's read-back check says of each wipe, beside the decision
A person validating a machine could not see the server's read-back result for each wipe record without opening another card. The form now shows it, per record, with a worst case on top. It is read only and decides nothing.
- The problem
- Execution, verification and validation are kept apart on purpose. But a validator deciding on a machine had the codes pre-filled from the roll-up and nothing showing where the stored read-back check disagreed with them. Older wipe records had no stored result at all, and a hand-entered record has none to show.
- What changed
- A new read-only route returns, for one device, each wipe record's read-back status, its reason and basis, whether the station's own execution record is on file, and counts with an overall worst case. A hand record is named and never judged. Where no result was stored, the answer is worked out at read time from the wipe record and the execution record. The web form prints the lines under its existing pre-filled note, in the same words as the wipe card. The route needs the review permission, is not cached, runs read only with short lock and statement limits, and a switch turns it off. No migration.
- How it was fixed
- Merged with its checks green. The unit specs pass, including a 22-case fixture for the fold and 2,000 generated fact sets for its invariants. Named as not proved: the database-backed specs, the replays, the mutation run, and the form in a browser, because the web has no test runner and was checked by source scans and the type check.
- Improvements
- A validator sees the read-back check of every wipe record beside the decision, and where it disagrees with the pre-filled codes
- A hand-entered record is shown as hand-entered and never counted as a pass or a failure
- Nothing is held, released, certified or recorded by it, and it adds no migration
- Merged on 18 October 2026, deploy statuses green; no validator has used it on real data and the owner's production checks have not been run
A machine's journey is now recorded, and a release can note missing paperwork, with the stricter part off
The platform recorded the erasure but little about the rest of a machine's life: when it arrived, when it left, and what was shipped on which pallet. This adds lifecycle events, a record of each pallet shipment, and an optional documentation check on release. The certificate half of this stage is not part of it and is not yet live.
- The problem
- Standards for sanitisation expect the chain of custody around the erasure to be evidenced as well, and the history table held only a few event types with no structure for the job, the pallet, the places or the parties involved. A pallet shipping left no record of what quantity of which line went.
- What changed
- Seven new history event types with structured columns for the job, pallet, from and to place and party, condition and destination. Only two are written so far: received (when a device is created) and released (when a sale is fulfilled). A new insert-only table keeps one ship record per quantity line when a pallet ships, as a record only, with no gate. A release finding, documentation incomplete, checks that the newest wipe record names an operator, a tool and a method; it is a caution and stays silent unless the owner sets the switch. Three migrations.
- How it was fixed
- The pull request states plainly that the Postgres specs were skipped locally, so the three migrations were not run against a real database by the author; the release, executions, sales, assets and pallets specs and the type check passed locally, and it was merged with its GitHub checks green. Writers for the sanitisation and validated events, the last-use location and the final disposition are not built.
- Improvements
- A device's arrival and release are now structured events, ready for the rest of the journey to be added
- Every pallet shipment leaves a per-line record, kept as a record and not used to block anything
- Missing operator, tool or method on a wipe can be noted at release, only if the owner switches the check on
- Merged on 18 October 2026, deploy statuses green; the owner's production checks have not been run
The owner can now see which machines still need a human review, without a second set of rules
Validation and remediation records existed, but there was no way to list the machines still waiting for a review or a follow-up, or to count them. A read-only queue and a count command now answer that from the same rules the system already enforces.
- The problem
- A review queue the owner can trust must agree with the refusals the validation form already makes and with the remediation list. A stored job table, or a second copy of the rules, would drift from both. The original specification also assumed pieces of the earlier slices that had never been merged, so it was reconciled against the merged code first and only the parts that matched were built.
- What changed
- A read-only route lists devices that need review, or all devices, a page at a time, using a cursor over device ids so nothing is skipped or listed twice and a sparse queue cannot cause a long walk. It reuses the roll-up verdict, the newest validation for the records standing now, and the remediation state function from the earlier slice, adding no new state and no clock. A separate command prints counts only, in a fixed order, with no tag, serial or lot number in the output, and forces the time zone to UTC because the roll-up compares times. A switch turns the route off. No migration and no write of any kind.
- How it was fixed
- Merged with its checks green. The 15 validation suites (233 tests) and the typecheck passed locally; the database specs and the mutation run in the original specification were not written, and the record says so. The web page for the queue is not built, so the owner has an API and a count but no page to open yet.
- Improvements
- Which machines need a review, and which have an open remediation, can be listed and counted from one source of truth
- Nothing is stored or projected: the queue is worked out on every read, so it cannot go stale
- The count command is safe to paste: it prints numbers only
- Merged on 18 October 2026, deploy statuses green; there is no queue page yet and the owner's production checks have not been run
A rejected erasure now records what should happen next, and what the machine looked like when it was rejected
A rejection used to be a decision with a reason and nothing more. A person who rejects a wiped machine can now choose re-sanitise, escalate or destroy, and the facts that reuse depends on are kept with that review. It is recorded only: nothing is held or changed by it.
- The problem
- Reuse of a machine under the standard depends on facts the platform holds in six different places. A rejection that did not say what happens next left a machine in the warehouse with a certificate, a validation and no owner for the follow-up, and the facts it was judged against change the moment someone wipes it again.
- What changed
- Three nullable columns on the existing insert-only validation row, not a second table, so the rejection and its remediation are written together or not at all, and one rollback undoes it. The facts are read from the sources the release check itself uses: stock status and grade, whether the device has left, the lock, classification and disposition, each counted drive's health, and any failed wipe rows. A fact that cannot be read is recorded as not read, never guessed. Where a remediation stands is worked out on every read and never stored. A device that has left cannot be re-sanitised or destroyed. Sold stock is not touched, no audit row is written and nothing in the sync rules changed.
- How it was fixed
- Verified in local containers on a fresh Postgres: 309 validation tests passed (149 new), 526 earlier tests stayed green unedited, the migration chain, its revert and re-run, the seed and the boot passed, and the replays against the previous tree were byte-identical. The first run was red, with 26 type errors and three over-strict tests, and was fixed. Stated plainly: the mutation set of 33 was written but not run, so no mutant has been seen to be caught, and the web form was only type-checked.
- Improvements
- A rejection now says what happens next, and keeps the facts it was judged against
- Nothing reads it to hold, quarantine or block anything: no certificate, release check or sync rule changed
- A device that has already left cannot be sent for re-sanitising or destruction
- Merged on 18 October 2026, deploy statuses green; it has never been used in production and the owner's production checks have not been run
A wipe that was never read back clean can now be held back from release, but only if the owner switches it on
The platform already records whether each drive was read back clean after a wipe, and keeps a shadow of what a requirement would do. Nothing acted on it. A setting now lets the owner make that evidence count in two places: the release check and a device's first certificate. It ships recording only, so nothing is held or reported until the owner chooses a stricter mode.
- The problem
- Making the read-back a requirement the obvious way, inside the roll-up, would have stopped certificates that were already handed out from downloading again. And a requirement switched on by an environment variable alone would have been retroactive: the variable leaves no record of when it changed, an unsigned certificate is rebuilt on every download so last week's machines would be judged afresh, and a machine whose certificate was never stored would be held at its first download after the switch.
- What changed
- One setting with three modes: record (the default), release and require. In release mode the release check reports a wipe that was not read back clean as a blocker. In require mode a device's first certificate is withheld as well, and only when signing is on. It applies only to wipe records that reach the server after the server first starts with the setting, which is logged in a new insert-only table, so it can never reach back to earlier records. Certificates already issued are untouched.
- How it was fixed
- Independent review found wording and logging gaps, fixed before merge: the ledger now logs why a certificate read was held, the web card shows its note on a record with no stored verification, and a misspelt flag on the blast-radius command is refused instead of ignored. Proof: with the setting unset, a replay of 2,304 database statements against 2,304 gave identical answers. None of the 51 deliberately broken copies of the code survived, though three were not caught by every test written for them, which the record states. One test meant to catch a time-zone mistake did nothing, because it could not change the real time zone inside the test runner; I rewrote it so it checks that the zone moved. The merged tree passed 2,938 API unit tests locally and the pull request's CI checks.
- Improvements
- A wipe that was never read back clean can be made to count at release, and at a device's first certificate, by the owner's choice alone
- It cannot be retroactive: it applies only to records that arrive after the setting was first seen, and issued certificates keep downloading
- Switching it on is the owner's act, in two steps (release, then require), and the default changes nothing
- Merged and deployed on 18 October 2026, recording only: the setting is unset, nothing is held, and the owner's read-only production checks have not yet been run
A device's status can now be judged against the evidence when someone edits it by hand, with the switch off
A phone or an edit screen can write a device's stock status, audit status or a lot's status directly, and nothing checked those writes against what the platform already knows. A guard now judges each such write and can log it or refuse it. It ships switched off, so nothing about how the system behaves changes until the owner turns it on.
- The problem
- Reading every place that writes those three statuses showed four gaps. A phone's retry could lift a quarantine that the release check relies on. A move from one of sold, shipped or disposed to another went unjudged, which could change the sales count and put a disposed machine back into stock. A hand-set audit status could say ready for sale over a failed station wipe. And a lot could be labelled sold while it still held devices. Nothing shows that any of these has happened to a real machine; they were found by reading the code.
- What changed
- One pure rule function takes the facts a write already holds and answers with a short code, or nothing. It has three modes: off, record (every hit is one log line and nothing changes) and enforce (only the rules the owner names bite). The phone sync path can only drop the one offending field and let the rest of the row land, because a row the server refuses is retried by the phone for ever; a refusal with a clear message is answered only on the online screens. It ships off, with no database change, no change to what syncs to phones and one new line in the start-up log. The rule table is a proposal for the owner to approve, not a decision.
- How it was fixed
- A review of the finished slice by three readers (code, roll-out and documentation), each finding checked by a second reader, produced 13 findings of which 4 were real, all wording; they were fixed before merge. Proof: a replay of 27 scenarios through the phone and screen routes showed every answer, row and database statement identical with the guard off, and identical in record mode once the guard's own reads and log lines are taken off. The earlier replays for certificates, ingest and release inputs were unchanged. 34 deliberately broken copies of the code were each caught, and the pull request's four checks passed.
- Improvements
- The four ways a hand edit could contradict the evidence each have a named rule, ready to be recorded before anything is refused
- Switching it on is the owner's act, and so is choosing which rules may refuse: record first, enforce one rule at a time
- A phone's upload queue cannot be wedged by it: on the sync path it only ever drops one field
- Merged and deployed on 17 October 2026, switched off: the start-up log reads "Status guard: off" and no guard line has been written
A person can now record that they accept, reject or escalate a machine's erasure
The platform already checks a wipe itself and issues a certificate. It had nowhere to keep a person's judgement of that erasure. It now has a validation record: approved, rejected or escalated, with a reasoned residual risk and the name of the person who decided. It is recorded only, so nothing else in the system reads it yet.
- The problem
- NIST's guidance on media sanitisation separates three things: running the erasure, checking it, and a person validating it. The platform recorded the first two. Every check it makes after a wipe is the server's own, and the sanitisation policy is explicit that such a check is never called an approval. So nothing kept a person's decision about an erasure, or who made it, and nothing could later depend on one.
- What changed
- A new insert-only table holds each validation, kept against the exact wipe records the certificate counts, so a validation never silently covers a machine that was wiped again. A small pure function pre-fills the form from the existing roll-up: it suggests a risk level and the reasons worth noting, but it never suggests rejecting or escalating and carries no decision field, so a person has to choose. The form is on the device page, behind the review permission. It refuses a station login as the validator, labels a person validating their own wipe, requires a reason where the choice calls for one, and answers a clear conflict code if the records changed while the page was open. Nothing else reads a validation: no certificate, release check, roll-up or customer-facing page changes, and a switch turns recording off.
- How it was fixed
- Two independent AI reviews, each finding checked by a sceptical second reader, found real defects before merge. One cap would have turned the validation of a 65-drive machine into a server error. A shared station login could be mistaken for a different person. And the form kept its old pre-filled values after a conflict, so a person could have submitted a decision about records that had since changed. All were fixed, each with a test written to fail without the fix. Proof: the whole API job on the pull request (2,696 unit tests and 416 against a real Postgres database, the migrations, the seed and the boot); three replays showing that what the certificate, release and device pages read is identical to before the change; and 68 deliberately broken copies of the code, each caught by the test written for it, plus 8 more for the review fixes.
- Improvements
- A person's judgement of an erasure, and who made it, can now be kept, with a reasoned residual risk and no score
- The suggestion is only a suggestion: it never proposes rejection or escalation and never fills in the decision
- A validation is tied to the exact wipe records it was made against, so a re-wipe makes it stale instead of covering it
- Merged and deployed on 17 October 2026. It is recorded only: no certificate, release or roll-up reads a validation, and it has not yet been used by a person on real data
A wipe's evidence is no longer thrown away when its result line could not be read
A correction to the wipe execution record, made before any station sends the engine's evidence. The server checks that the evidence belongs to the wipe by comparing two start times, but it now does so only when both times really come from the wipe engine, so the evidence is kept in exactly the case it matters most.
- The problem
- The previous slice keeps the wipe engine's own evidence (the commands it issued, their exit codes, the read-back windows and the controller logs) beside each wipe record. To be sure the evidence belongs to that wipe, the server compared the engine's start time with the record's start time and discarded the evidence as another run's when they differed. But the record's start time is the engine's only when the station could read the engine's result line. When the result line could not be read, never arrived, or the record was rebuilt after a power cut, the station fills in its own clock, so the two times can differ by a second or by the length of a queue. The check would then have thrown away the evidence in exactly the case where it is the only machine record of what the drive went through. A final review of the station-side slice found it before any station sent the evidence.
- What changed
- The server now compares the two times only when the record's time can be the engine's. When the station says the time is its own, the evidence is kept as this wipe's: the station runs one engine per drive and passes on only that engine's last evidence line. When there is no station account at all, or one the server cannot read, the times are still compared, because attributing another run's evidence to a wipe is the worse mistake. The shared contract gained a rule that the engine must print its start time as the very same text as on its result line, and it records the change as a correction to version 1, since nothing about what is sent has changed.
- How it was fixed
- An independent AI review checked the reasoning against the station's own code, line by line, before the change was proposed. It confirmed the fix and found five small gaps in the documents and tests, all closed: three more hand-written test cases for the accounts the server cannot place, the start-time rule, and two over-stated claims. Proof: the full API job in throwaway containers (2,580 unit tests, 368 tests against a real Postgres database, the migrations, the seed and the boot), and eight deliberately broken copies of the check, each caught by the test case written for it.
- Improvements
- The engine's evidence of what a drive went through is kept even when its result line could not be read
- Evidence that might belong to another run is still never attached to a wipe
- The engine's start time now has a written rule, so a later change cannot silently discard every record's evidence
- Merged and deployed on 16 October 2026. Nothing sends the engine's evidence line yet, so no stored record changes until the station update that does
A record of what each wipe actually ran, and a separate record of how it was verified
Every station wipe now gets two new write-once records on the server: what was actually executed, and how the result was verified, including whether the technique that ran was the one the station should have chosen. They run in shadow: nothing that decides a certificate or a release reads them yet, and they fill with detail only as the station updates that send it are rolled out.
- The problem
- This is the second slice of the fifth stage of the plan built on NIST SP 800-88 Rev. 2, whose test is that the software can prove what was executed and separately verify the outcome. A wipe record held the method, the sanitisation level, a one-word read-back result and the list of attempted techniques. It held no exit codes, byte counts, read-back detail or controller logs, and nothing of the station's own result line. The register of erase techniques from the fourth stage had to mark every command result as not sent by the station. The read-back result was one field on the wipe row, so nothing recorded on its own how a wipe was verified, whether the technique that ran was the right one, or how the wipe would fare under a future rule that a certificate needs a passing verification.
- What changed
- The server now accepts two optional, versioned blocks of evidence on each station wipe record: one from the station's kiosk (its raw result line and the engine's exit code) and one from the wipe engine (read-backs, command results, controller logs, drive health). Each field is checked one by one: a bad value is stored as unknown with a reason, and nothing is ever refused. Two new tables can be written once and never changed. The execution record is written for every station wipe, even when the station sent nothing, so a missing record can only mean the step did not run. The verification record keeps the read-back result apart from the wipe's outcome. A drive that read back clean but failed to clear its temporary password is a clean read-back on a failed wipe, not a pass. The record also says whether the technique that ran was the first one available from the list the station actually applied, and gives a shadow answer for a future verification requirement. A read-only card on the device page shows both records; the raw result line is visible to administrators only.
- How it was fixed
- Before any code was written, AI agents attacked the design from four angles, and their findings changed it. The engine's evidence will travel on its own line, so a malformed value can only lose the evidence, never turn a clean wipe into a failed one. Any text captured from a tool is cleaned to plain characters first. The 'should have chosen' check uses the list the station applied, never the server's current register, which the station may not have had; a path-parsing slip that would have judged every NVMe drive against the SATA list was caught there. For a wipe filed with the station record id from the previous slice, the execution record is written inside the same database transaction, so a crash cannot lose evidence that exists only in the upload. After the build, a review found six defects, all fixed. Proof: the full API test suite (2,573 unit tests and 366 against a real Postgres database), the migrations from scratch with the new one reverted and re-applied, and three replays against the previous server. A record without the new fields produced the same database statements, all 311; the full ingest path produced the same 398 apart from the new records' own writes; and every certificate, release and roll-up query asked about five machines produced the same 152. All 75 deliberately broken copies of the code were caught by a test.
- Improvements
- Each station wipe now has a record of what ran and a separate record of how it was verified, kept for good
- A failed wipe that happened to read back clean can no longer look like a passed one
- A future rule that a certificate needs a passing verification now has something to read, and its effect can be seen in advance
- Merged and deployed on 16 October 2026, in shadow: no certificate or release reads the new records, and they fill with detail as the station updates that send it reach each station
A wipe record is now filed only once, however many times a station sends it
Audit stations retry an upload whenever an answer is lost, a queue flush is cut short or the machine restarts mid-wipe, and every copy used to become a new record. The server can now recognise a copy of a record it already holds, answer as if it had just filed it, and write nothing. It changes nothing on the day it ships: no station sends the new identifier until the next station update.
- The problem
- This is the first slice of the fifth stage of the plan built on NIST SP 800-88 Rev. 2: execution evidence and separate verification. A station files one record per drive per wipe, and keeps a copy on its USB stick whenever an upload fails. Several ordinary events file the same record again: an answer lost after the server had stored it, a queue flush interrupted after a send, or a station restarted mid-wipe, which files the outcome as unknown with a new time on every boot. The server had no way to tell a copy from a new record, so each one became another audit row and another history entry, and rewrote the device's hardware profile, batch and grade. Later slices attach an execution record and a verification record to each wipe, so a wipe on record three times would have three sets of evidence for one erase.
- What changed
- A station wipe record may now carry the station's own identifier for that record: one per drive per attempt, the same on the live, queued and recovered copies. The server stores it in a new column that can be written once and never changed, with a uniqueness rule over the records that carry it. A record with an identifier is filed inside one database transaction, under a lock taken on that identifier, so two copies arriving at the same moment can never both be filed. A copy of a record already on file is answered with the stored device and tag, so the station crosses it off its queue, and nothing is written. If the identifier is already on record for a different machine or drive, which only a station bug could cause, the record is filed without it and with a note saying so: it is never lost and never refused. A record without an identifier, which is every record from every station today, takes exactly the path it took before.
- How it was fixed
- Before any code was written, AI agents attacked the design from three angles, and three problems changed it. A plain 'look up, then insert' let two simultaneous copies both miss the lookup and both rewrite the device, so a per-identifier lock inside one transaction replaced it. The rule for an identifier held by another drive, as first written, would have answered with the other drive's device and lost this drive's record. And the obvious way to insert the row would have dropped the drive's media record on every keyed wipe without any error. After the build, a review found five smaller defects, all fixed, including a station identifier holding a NUL byte crashing the insert. Proof: the full API test suite (1,939 unit tests and 309 tests against a real Postgres database) and the database migrations from scratch, with the new one reverted and re-applied, ran in throwaway containers. The same nine station records were run through the old and new server, and records without an identifier produced byte-identical SQL, all 311 statements. 25 deliberately broken copies of the code were each caught by a test.
- Improvements
- A lost answer, a cut-short queue flush or a restart can no longer put the same wipe on record twice, once stations send the identifier
- Two copies of one record arriving at the same moment are filed once, with two identical answers
- Nothing is ever refused: an unusable or clashing identifier files the record without it and says why
- Merged and deployed on 16 October 2026. It is inert until the station update that sends the identifier, the third slice of this stage, which reaches a station only when its stick is synced
A register of erase techniques, and a recorded check of new station wipes against it
The station's erase techniques existed only as code. They are now entries in a versioned register, beside a store for evidence and customer statements, and each new station wipe record is checked against it on record. All ten seeded entries are pending and every gate only records, so no certificate or release decision changes.
- The problem
- This is the server and web half of the next stage of a plan built on NIST SP 800-88 Rev. 2, which asks an organisation to keep the evidence its choice of erase technique rests on. The station's wipe engine chooses among eight techniques by what the drive reports, and they existed only as code. Nothing recorded what each one reaches and does not, or whether anyone had approved it, and a vendor statement or a bench result had nowhere to live. A cryptographic erase, which the automatic method tries first on an NVMe drive, is still certified like any other erase at that level, with no word that the data stays on the drive in encrypted form or that the protection rests on the drive's own encryption. Nothing recorded what the customer had said about copies of the keys or data once stored unencrypted, which only the data owner can state. Asked who approved a technique and on what evidence, the honest answer was "the code does it". It was found by mapping the code against the plan.
- What changed
- The register is a versioned document, pinned by hashes the database records; any change is a new version. Version 1 holds ten entries: the wipe engine's eight techniques, hand-recorded erasure and degaussing. Each says what is established about what it reaches and does not reach, and any verification. All ten are "pending": no person has approved or refused them. Evidence is a reference to a document, with a separate review, matched to the wiped drive by full model and exact firmware, more widely only where the item or entry says so; it never raises a level. A customer statement can rest only on what the client stated or the contract's default; with none, the record reads "no statement on record", never "no". When a station's wipe record arrives, the server stores one check of its technique, judged only on what was then on record, never again. Where a cryptographic erase produced the result, fourteen preconditions are recorded too; a drive's claim that it encrypts never establishes one. Every gate only records: a cryptographic erase's limitation lines are stored, not printed, and no certificate or release decision changes.
- How it was fixed
- The main choice was that day one changes no certificate and no release decision. Approving each technique is the operator's decision and it has not been taken, so every entry is seeded pending and every gate record-only, and the validator refuses a draft that moves a gate above record-only while any entry is pending. A register can lower a certified level, never raise one; raising a level stays a code change with a bench run. The PC restarted mid-build. The work was on disk, and that part was run again by AI agents, told to trust nothing and read every file against the specification; it found no half-written file and closed three small gaps. An AI-assisted review, each finding given a sceptical re-check, confirmed 25 findings and refuted none: 24 were fixed and one was a reviewer's note. Eight of the 24 were gaps in the tests: the code was deliberately changed and nothing failed. In one, a release test was keyed to the wrong row, so it proved nothing. A merge of two station fixes was textually clean yet left one new test failing; replaying the pipeline locally caught it. Before the merge to the main branch, a separate safety review looked for anything that could change existing data or break a working request, and found none.
- Improvements
- Ten techniques are now entries on record, each stating what is and is not established about it: what it reaches, what it does not, and any verification. All ten are pending, and no IEEE 2883 clause is stored for any of them, because nobody has recorded reading that standard against them; the page says so in words
- "No statement on record" is never read as "no", and missing evidence is never read as approved or refused: a precondition nothing on record settles is stored as not established, with the reason. A drive's claim that it encrypts, which no station sends yet, is recorded only as a claim; a database rule refuses a precondition established on it
- A check uses only what was on record when its wipe record arrived and is not made again. On a throwaway copy, a test wipe record filed before an evidence item was accepted kept its answer afterwards. If storing a check fails, the wipe record is kept and the failure logged. Hand-recorded wipes and earlier records get none
- Before the branch was pushed, a local replay of the pipeline passed 1870 API tests and 277 database tests; after two later merges the hosted pipeline passed on the final commit. Walking the pages on a throwaway copy also found a fault in an earlier stage's card, already live: at phone width the device page scrolled sideways. It was fixed
- Merged and deployed on 11 October 2026; the station half is not built. Afterwards the API reported the new build, the three deploy checks were green and the new routes asked for sign-in. No signed-in request was made on production, no check of a real station wipe was looked at, and gates other than record-only ran only in tests
Storage drives become records of their own, with what each drive reported it can do
A drive existed only inside a capture's JSON and a wipe record's free fields. Each drive a station files is now stored as insert-only records: an identity where serial and model allow one, and the erase capabilities it reports. No capture carries those answers yet: the station checks are merged, not run on hardware.
- The problem
- The next stage of a plan built on NIST SP 800-88 Rev. 2 asks for each storage medium to be identified and described before it is sanitised: what it is, and which sanitisation methods it reports it can do. A drive existed only as an entry inside a capture's JSON profile and in a wipe record's free fields. Nothing kept a drive's identity from one capture to the next. Nothing recorded, drive by drive, what it reported about its own erase capabilities, such as NVMe sanitize and format support or self-encryption. Most of those facts were read only at wipe time, inside the wipe engine, and thrown away. Choosing an erase technique, and judging what a wipe achieved, both depend on what the drive said it could do. A record that cannot tell "the drive said no" from "nobody asked" repeats a fault this codebase has paid for before: a check that did not run being read as a negative. The gap was found by mapping the code against the plan's requirements.
- What changed
- When a station files a capture or a wipe outcome, the server stores each drive it names as an observation, linked where identity allows to one drive record. Identity is built from the serial and the first twelve letters and digits of the model. A drive that reports no serial, or a placeholder for one, gets no identity; its observation is still stored, unlinked. Each capability is stored as yes, no, a value, or not established with a reason, so a check that did not run is never stored as no. The records are insert-only, enforced by database triggers. The device page shows this in words; for a fixed fact a later capture did not get, it shows not established, with any earlier answer from that drive beside it. Release decisions and certificates are unchanged today. The answers come from new station checks at capture: read-only, time-limited, and not asked while a wipe runs. They are merged but reach a station only at its next stick sync; until then a capture's drives are stored with the checks marked as not made.
- How it was fixed
- The plan had sketched a link column on the audit table. It became a separate insert-only row: the column would have meant updating wipe evidence after it was saved, and a foreign key would have made a device with only captures impossible to delete. Merging two drives into one record is worse than splitting one, so no identity is invented for a drive without a serial, and two drives in one capture that share a key are both left unlinked. Storing these records never fails the capture or wipe being filed. On the station, a sick drive can hold one command for minutes, so each drive's questions run as a background job the capture abandons at a deadline. A source test holds every function the checks can reach to an exact list of read commands, and bans state-changing ones by name. A review by AI agents, each finding re-checked by sceptics, confirmed 18 findings, all fixed, and refuted four. Among the confirmed: a malformed self-encryption answer read as "no", and a source test that would have passed a forbidden command in a new helper. Deliberate faults were then planted, such as a helper sending an unlock command, and a test failed for each.
- Improvements
- Identity is by serial and model, so a drive's captures and wipe records can link to one drive record. A drive without a usable serial is stored with its readings but no identity, never an invented one. Known gap: an eMMC or SD card is never linked, because the station sends no model for it
- Each capability answer is yes, no, a value, or not established with a reason. A check that did not run or did not answer is never stored as no, and the database refuses a not-established row that carries no reason
- The station checks only read. A drive that does not answer within twenty seconds is abandoned, and one capture has a sixty-second budget for them. None of the new checks is asked while a wipe runs or waits its turn, and a source test holds every function the checks can reach to an exact list of read commands
- Before the merge, a local replay passed 63 tool test scripts, 1337 API tests and 196 database tests, and after a later merge the hosted pipeline passed on the final commit. One station test measures real time against the capture's time budget, so a slow machine can fail it: it has, under heavy load, and passed when rerun
- Merged and deployed on 11 October 2026. After the deploy the API reported the new build and the new route asked for sign-in; no signed-in request was made on production. The station checks reach a station only at its next stick sync, and none has run on real hardware; a bench test is written, not run
A written, versioned sanitisation policy, and a recorded check of station wipes against it
Wipe rules that lived only in code and design records are now a versioned policy, and wipes filed by stations are checked against it on record. Lots and devices can be given a data classification and intended disposition once the operator chooses a vocabulary; version 1 has none and restates the existing rules.
- The problem
- The next stage of a plan built on NIST SP 800-88 Rev. 2 asks for four things this system lacked: a documented sanitisation policy, a classification of the data a device held, an intended disposition, and a recorded decision tied to the policy version it was made under. The rules existed, but only in code and design records. Nothing recorded what a device's data was or how it was meant to leave, and the release check judged the wipe evidence, not whether that wipe was enough for the data. A certificate says what happened to a drive; nothing said whether that was the right thing to do, or under which rules. That leaves quiet failures open, such as a rule change re-judging old work, an unclassified device being read as low, or a drive of unestablished type being held to the rules for magnetic disks. It was found by mapping the code against the plan's requirements, which summed this area up as "nothing before the wipe".
- What changed
- The rules are a policy document with a machine-readable form, each pinned by a hash the database records, so any edit, even a typo, is a new version. Only one version can be in force at a time. A lot or device can be given a data classification and an intended disposition, each stored with who set it and why; a classification also records its basis: stated by the client, the contract's default, or the operator's own assumption. A device with none of its own takes its lot's. When a station files a wipe outcome, the server checks that drive against the policy and stores the answer, labelled as a check made after the wipe, not permission given before it. If storing it fails, the wipe record is kept and the failure logged. Hand-recorded wipes and earlier wipes get no such record. Classifications and checks are insert-only, enforced by database triggers. "Not classified" is never treated as a class, and a drive whose type was not established is never treated as magnetic. Under version 1, no class or disposition can be set.
- How it was fixed
- The main choice was that day one changes nothing: the classification vocabulary is the operator's to decide, and that decision is open. Version 1 is seeded by the migration and restates the rules already in force: no vocabulary and one rule, for devices that are not classified. Two tests hold it to that, on test data: every existing release-check case, and every device in a test database that no other test had classified or filed a station decision for, must come out the same with and without the policy step. One decision function answers at wipe arrival, at release and in the policy page's preview, and a hand-written fixture pins its answers. An AI-assisted review, each finding given a sceptical re-check, confirmed fourteen findings on the API, two pairs of them one defect seen twice; all were fixed or covered by a new test. Five were places where the code could be broken with no test failing, among them an evaluation error being read as a pass. Separately, the operator decided managers are no longer limited to their own lots, so a manager can now read any lot's classification. Merging that change was textually clean, but one database test still asserted the old answers; replaying the pipeline locally caught it.
- Improvements
- The wipe rules are one written policy with numbered versions, each frozen by a hash. A change is a new version, and a new version never re-judges an issued certificate or a stored decision; it judges releases from the moment it is in force
- The server and the audit station each hold a copy of the decision rule, and both must pass one hand-written fixture that compares result codes, never sentences. The station's copy is merged but has not run on real hardware
- A release record now names the policy version, classification and disposition the device was judged under. In the two tests that compare answers for unclassified devices with and without the policy step, version 1 adds no finding, and the release check it feeds is in warn mode, so it refuses no release because of what it finds
- Before the merge, 1178 API tests and 179 database tests passed. In a browser, on a throwaway copy, a draft three-level vocabulary became version 2 and a device was sold in warn mode; some parts, the preview form among them, were not walked. The check at wipe arrival is proved by database tests, not a real station wipe
- Merged and deployed on 10 October 2026. Production reports a build containing it and the new routes ask for sign-in; no signed-in request was made there, and no before-and-after comparison of release decisions on production data is on record. No classification vocabulary is in force: that is the business owner's decision, not yet taken
A phone upload that can never land is now skipped and logged, not retried forever
The phone scanning app queues its work offline and re-sends each batch until the server accepts it, so one entry the database refused every time would hold up everything recorded after it. The server now applies what can land, skips the kinds of entry found that can never land, and writes every skip to its log.
- The problem
- Technicians scan devices on phones that keep working offline. Each phone queues its writes, and the sync library re-sends a batch until the server accepts it. So an entry the database refuses is refused on every retry, and every later scan and audit on that phone waits behind it. The phone still shows the work, the server never receives it, and the only way out was to clear the phone's local data, which throws away everything still queued. Three kinds of entry could do this. The first is a re-send: when the acknowledgement for a newly scanned device is lost on weak Wi-Fi, the phone sends the device again, and the server's handling of that second copy failed on a required column. The second is a row the database refuses for good, such as one tag created offline on two phones, or history for a device deleted while the phone was offline. The third is an entry with a value the database cannot read. None came from a report of a stalled phone: the first was found in passing while building another change to the same code, and the others by listing what each fix had left.
- What changed
- A re-sent create for a device that already exists is applied as an update of the fields a phone may still change, never its tag, name or category. If another device already holds a new device's tag, the second record is skipped along with the history and audits recorded against it, and the log names the device that holds the tag so the two can be reconciled. History and audits for a device that is not on the server are skipped. An entry with a value the database cannot read, or with an unrecognised table or operation, is skipped on its own and the rest of the batch carries on. Errors that may clear on a retry, such as a lost connection, are still returned so the phone tries again. Every skip writes one line to the server log: which entry, which account and why. That line is all the server keeps. The skipped row itself is not stored, so that work has to be reconciled or recorded again by a person.
- How it was fixed
- Each fault was reproduced in a test before it was fixed. The first had slipped through because the tests' stand-in for the database did not enforce required columns, and two existing tests had been passing for the wrong reason. The stand-in now enforces required columns, unique keys and the link from a history or audit row to its device, in the order the real database checks them. The main cases were then run against a real Postgres 16 in a throwaway container, never production: the new tests there, controls aside, failed on the old code and passed on the new. For unreadable values the choice was between checking every value first and catching the database's refusal. The refusal is caught: a copy of the database's rules for ids, dates and allowed words would drift as the schema changes, and each gap would be another stalled phone. For a duplicate tag the choice was skip, rename or redirect. Renaming would invent an identity that a certificate would print and count one machine twice in stock; redirecting the second phone's rows to the device that holds the tag needs a new table and was deferred. Skipping is the default, and that choice can be changed later.
- Improvements
- A create re-sent after a lost acknowledgement lands once, and the re-send cannot change a device's tag, name or category
- An entry that can never land, of any of the kinds found, is skipped on its own, and the entries behind it in the same batch are applied
- Every skip is written to the server log with the entry, the account and the reason; the skipped row itself is not stored
- Deployed on 10 October 2026; the production version endpoint reported that build when it was checked after the deploy. On the fixed code the API's 871 tests passed, as did all 124 tests that run against a real Postgres 16. None of this has been tried with a real phone yet, and what the second phone shows after a duplicate-tag skip is reasoned from how the sync library works, not observed
One release check for every individually tracked device that leaves
Selling, shipping or disposing of an individually tracked device now runs one check against its wipe evidence and writes an insert-only record of the answer. It is live in warn mode: it shows what it would refuse and records every decision, and it refuses no release because of what it finds.
- The problem
- The station produces the erasure evidence and the platform issues the certificate, but nothing connected either of them to the moment a device was released. Seven backend paths could let a device leave as sold, shipped or disposed without looking at its wipe records. A device whose wipe had failed, or that had never been wiped, could be sold like any other, with nothing on record about the state of its data at that moment. Those paths had faults of their own as well: none ran inside a database transaction, the bulk sales re-sold devices that were already shipped or disposed, and marking a pallet of devices as shipped changed no device and wrote nothing. This was found by mapping the code against a plan built on NIST SP 800-88 Rev. 2, where it was the largest gap. How much held stock it touches has not been measured yet.
- What changed
- Selling one device, a whole lot or a whole pallet, and editing a device into shipped or disposed, now run the same check, each inside a single database transaction: the device rows are locked, each device is judged from its wipe evidence, the change is made and a release record is written. A failed, incomplete or unverifiable wipe counts against release, as does no wipe where storage is present or its absence was not established. A person marking a device ready for sale is never taken as evidence. Release records are insert-only, enforced by a database trigger, and a return is a new row. A device with no storage media can be given a recorded exemption, for one device and its next release only. The check is live in warn mode: its findings are shown in the sale dialog, which asks for an acknowledgement when a device is not ready, and are stored with the release, and no release is refused because of them. Enforce mode is built and tested but not switched on. That decision is the operator's and has not been taken.
- How it was fixed
- The main choice was to ship in warn rather than enforce. How much held stock enforce would refuse has not been measured, and the rules for hand-recorded wipes and for records from older station builds are the operator's to set, so each got a default that can be changed. A mistyped mode setting falls back to warn and says so at start-up and on every record, so a typo can neither switch the check off nor freeze every sale. The exemption exists because NIST SP 800-88 Rev. 2 itself allows release without sanitisation in narrow cases. Three paths were closed rather than put through the check: offline sync no longer carries a change into or out of sold, shipped or disposed; a dormant orders module is unregistered; and marking a pallet shipped while it still holds devices in stock is now refused, with a pointer to the pallet sale. To test it, deliberate faults were planted one at a time to confirm a test fails for each: with the row lock weakened, a failed wipe landed in the middle of a sale and the race test caught it. An AI-assisted code review raised 16 findings; all were acted on, and two of them were serious faults in the check itself. Both modes were then walked in a browser on a throwaway copy with seed accounts.
- Improvements
- Selling a device, a lot or a pallet, and releasing by edit, all go through one check, each in a single transaction, and a test scans the API source and fails if any other file writes sold, shipped or disposed directly
- Each release and each return leaves an insert-only record of the decision, the findings, the mode, the acknowledgement and the person, and it outlives deletion of the device or lot
- "No drives recorded" is never read as "no storage": only a recorded exemption establishes that
- Not covered yet: stock held only as a quantity, including whole machines counted on a pallet line
- Live in warn mode since 10 October 2026: no release is refused because of what the check finds. 858 API tests and 113 database tests passed before the merge. On production I checked only that the new build is serving and that the new readiness route asks for sign-in; no signed-in release was exercised there, and the read-only run that sizes what enforce would refuse has not been run on production data
Certificates claim only what the record shows
An erasure certificate now says data is unrecoverable only when the record shows the drive was read back clean. Two erase techniques that no bench run has yet proved are certified at the lower level with the limitation printed, and the wipe records behind a certificate can no longer be deleted along with a device or a lot.
- The problem
- This is the first stage of a plan built on NIST SP 800-88 Rev. 2. The review behind that plan found certificates saying more than the records behind them could support. A certificate stated that data was unrecoverable even when the record did not show the drive had been read back, and the lot certificate made the same claim. Two techniques that no bench test had proved on a real drive, one NVMe format mode and the wipe of eMMC storage, were certified at the level the station recorded, with no qualification. Separately, deleting a device or a lot deleted every wipe record under it, failed attempts included, while any signed certificate stayed behind with nothing left to check it against. A certificate is a statement to a customer, so an over-claim is a liability, and a deleted wipe record cannot be brought back when someone asks for it. None of this came from a disputed certificate: it was found by reading the code against a list of requirements drawn from the standard.
- What changed
- A certificate issued from now on says data is "unrecoverable by generally available means" only when the record shows the drive was read back clean. Where the read-back is missing or was not confirmed, the certificate is still issued, as wiped with limitations, and a line says why. The NVMe format mode and the eMMC wipe are certified at Clear with a limitation line, even where the station recorded Purge; the stored record is not rewritten. Two other NVMe erase modes have no bench report either and are still certified at the level the station recorded; capping them is a decision still to be taken. The lot certificate applies the device certificate's rule, so it cannot claim more for a machine than that machine's own certificate would. New certificates for erasures the station performed carry one sentence saying the process is designed to support sanitisation aligned with NIST SP 800-88 Rev. 2, and that this is not a certification. A device or lot holding any wipe record cannot be deleted: the request is refused with a plain reason, and the database refuses the row even through a cascade.
- How it was fixed
- The standard's name, the level labels and the alignment sentence live in one file that the device certificate, the lot certificate and the public verification page all read, so the three cannot drift apart. Where signing is on, a certificate already signed keeps the wording it was signed with; where it is off, each download is built afresh under the new rules. For the two capped techniques the choice was to certify them lower or to withdraw them from the station. The first was taken, as a default the business owner can still reverse: nothing is withdrawn, and the cap is lifted per technique, by a code change, once a bench run proves it. For wipe records, a database trigger backs the application's check, because that check cannot cover a wipe record filed between the check and the delete, or a delete typed straight into the database. A delete of a device with wipe records that arrives by offline sync is skipped and logged, since an error there would jam the upload queue of the phone or browser that sent it. Before merging, the full pipeline was replayed locally against a throwaway database: 55 tool test scripts, 639 API tests and 31 database tests passed, and the migration was applied from empty, reverted and re-applied. A review by AI agents from three angles, in which a finding counted only once a majority of three sceptical re-checks agreed, left 23 findings, a few of them the same problem seen twice. 22 were fixed and one was accepted and written down: a lot certificate, built fresh each time, can mark a machine as having limitations while that machine's earlier signed certificate still says unrecoverable. The lot only ever claims less.
- Improvements
- A certificate says data is unrecoverable only when the record shows a clean read-back; anything less is issued as wiped with limitations, with the reason printed
- Two erase techniques that no bench run has yet proved are certified at Clear with a limitation line, while the stored record keeps the level the station reported
- A device or lot holding a wipe record can no longer be deleted: the application refuses with a reason, and a database trigger refuses the delete even through a cascade
- Automated checks fail the build if user-facing text claims certification by, or compliance with, the standard
- Merged and deployed on 10 October 2026. On production the API reports the deployed commit, a protected route still asks for sign-in and the login page serves a new build; the database migration's result was not inspected directly. The station-side part of the same work, which names methods plainly and refuses a method name it does not recognise before any drive is touched, reaches a station only when its USB stick is next synced, and none of it has been run on real hardware yet
The problem
IT asset disposition looks like a logistics problem and behaves like a compliance problem. A pallet arrives with a supplier manifest that is optimistic at best. Every device on it has to be identified, tested, graded, wiped, priced and sold — and at the end of that chain a client can ask you to prove, in writing, that their data was destroyed. The existing tooling handled the first half and actively worked against the second: it deleted asset records once a unit was sold, which is precisely when the audit trail starts to matter. The rest of the process lived in spreadsheets and in people's heads.
Research
I started from the floor rather than the schema. I mapped the real path a device takes through the warehouse and found that the single assumption baked into the old system — that every item is an individually serialised unit — was false for most of the stock. Keyboards, mice and cables are counted, not serialised. Monitors arrive on mixed pallets described as '20 × 22-inch, 35 × 23-inch'. Those two categories were being kept in Excel because the software could not represent them. That finding reframed the whole project: the core modelling problem was tracking granularity, not workflow.
Planning
I wrote the redesign as a sequence of phases that could each ship to production independently, starting with a product catalogue and ending with compliance certification. The constraint I set was that the system had to stay live and usable throughout — this is a working warehouse, not a greenfield project. Every phase was deployed and verified against the production API before the next one started.
Design
Three tiers of tracking sit side by side: serialised assets with a unique tag and full history; bulk stock lines with an append-only quantity movement log; and pallets with per-variant line quantities. Above them sits the purchase lot — the commercial unit a buyer actually thinks in. The operational interface was later rebuilt around lots rather than individual devices, because at a few thousand units a device-first list stops being usable. Lot cards carry live roll-ups: scanned against expected, missing, extra, ready for sale, scrap, quarantine, audited.
Architecture
A NestJS API on Railway with self-hosted PostgreSQL, and a Next.js 15 App Router frontend on Vercel. PowerSync provides offline-first sync so warehouse scanning keeps working when the WiFi does not — the device holds a local SQLite replica and uploads a write queue on reconnect. Hardware capture happens outside the web stack entirely: a bootable Linux tool posts device specifications straight into the API. Full hardware profiles are stored as JSONB so new capture fields need no migration, with only the fields that must be searchable promoted to indexed columns.
Challenges
- 01
Intake devices have no operating system
The obvious way to collect hardware specifications is an agent running on the device. That is useless here — most units arrive already wiped, with no OS to run an agent on. I built the capture tool as a bootable Linux script instead, reading DMI, lscpu, lsblk, SMART, PCI and sysfs directly. It boots from USB, identifies the machine, and uploads a complete profile without the device ever having an installed operating system.
- 02
The audit tool mis-identified machines as their own boot stick
The first real field run reported a ThinkPad as a SanDisk USB drive. The storage loop was using eval on lsblk -P output, which defined shell variables literally named MODEL and SERIAL — clobbering the system's DMI identity that had been read moments earlier. I removed the eval, parsed into namespaced variables, and restricted the audit to internal fixed drives only. A parsing shortcut had silently overwritten the machine's identity.
- 03
Offline writes were being dropped silently
Warehouse scanning worked offline, then quietly lost data on sync: every multi-word snake_case column failed to map on upload. Separately, a deleted lot left a dangling foreign key that wedged the entire upload queue — one bad reference blocked every subsequent write. Both were fixed with explicit mapping and FK sanitisation, but the lesson was that an offline queue fails silently by design, so it needs its own verification path.
- 04
Firmware erase is not one command
Issuing a credible erasure certificate means actually purging the drive. Field testing showed the theory does not survive contact with real hardware: a Dell NVMe drive advertised no crypto erase via FORMAT but supported it via SANITIZE. SATA drives are usually security-frozen at boot, blocking ATA secure erase entirely. The tool now dispatches across NVMe format, NVMe sanitize, ATA secure erase and overwrite, with method-aware verification — an overwrite must read back as zeros, a crypto erase cannot, so it is recorded as controller-confirmed instead.
The solution
One device, one permanent record, from arrival to invoice. Stock arrives as a purchase lot with an imported supplier manifest; receiving reconciles expected against scanned and reports found, missing and extra. A bootable USB tool captures the full hardware profile and can perform a verified NIST-grade erase in the same pass. Grading and functional testing stay human, because judgement does not automate well. Repairs are logged with parts and cost, which flows into per-unit profit. Sales pick devices by serial, and shipping a unit flips its status and writes an immutable history entry rather than deleting it. At any point after a recorded wipe, the system will issue a per-device or per-lot Certificate of Data Erasure as a PDF — and refuses to issue one where no completed wipe exists.
Result
The platform runs the business it was built for. The process that lived across spreadsheets, a legacy tool and institutional memory is now a single auditable system, and the compliance artefact that used to be assembled by hand is generated from the erasure record itself. The refusal case matters as much as the feature: a certificate can only exist where the wipe genuinely happened.
What I took from it
Model the physical reality before the workflow. The most expensive assumption in the old system was that everything is serialised — a workflow decision made at schema level years earlier.
Ship in phases against production. Deploying each stage into a live warehouse surfaced modelling errors that no amount of design review would have caught.
Offline systems fail quietly. Every failure I found in the sync layer was silent — no error, just missing data. Offline capability needs deliberate verification, not just testing that it works.
Build the refusal path. The certificate generator declines to issue where no wipe is recorded, and that constraint is the actual product.
Field-test hardware assumptions early. Every erase method I implemented from documentation behaved differently on real drives.
Roadmap
Full-lifecycle ITAD workflow (complete)
Receiving through sales, costing and profit reporting.
Comprehensive hardware audit (complete)
Bootable capture of every hardware category into an extensible JSONB profile.
Verified data erasure + certification (complete)
NIST-aligned purge with method-aware verification and PDF certificates.
WEEE & environmental reporting (planned)
Extend the compliance stage to environmental and ESG reporting obligations.
Certificate register (planned)
In-app company settings, signatory details and a searchable register of issued certificates.
Scale hardening (planned)
Move remaining client-side aggregation into database roll-ups ahead of six-figure device counts.