You never need to open these. They’re documented here so that if anything ever needs checking, we know exactly where to look. Click any board — then click any node inside it.
The engine. Every hour it reads what the scanner delivered, names each slip by its order number, archives the raw copy, and files everything into the day.
A hand-trigger button. Click it and the whole board runs once, immediately.
So we can test or catch up on demand without waiting for the clock.
The clock. Fires the board every hour, ten past the hour, during lab hours.
Slips get filed all day long, not in one risky end-of-day batch — and an hourly rhythm means any backlog drains itself.
Creates /Emerald/00_Inbox if it does not exist.
The loading dock must always be there for the scanner — even after a manual cleanup or a brand-new setup.
Creates today’s 00_Originals folder inside the date tree.
The raw archive is sacred; its home for the day must exist before any file is touched.
Asks Dropbox for everything currently sitting in 00_Inbox.
The board has to see the work before it can do the work.
Reads that listing and takes up to 25 files, oldest first.
25 is the safe memory limit for image files in one run — any overflow is simply picked up next hour. This cap is what keeps the board from ever crashing on a big scan day.
Filters the listing down to actual files.
Dropbox listings can include folders and system entries; we only ever want scans.
Tags each file with its date, extension, and size.
Every later step needs to know which day a scan belongs to — this is where that label is attached.
Splits the flow: real images go to the reader; anything odd (wrong type, zero bytes) skips it.
A corrupted or non-image file should not crash the reader — it gets routed around and still handled.
Pulls one scan down from Dropbox at a time.
The reader needs the actual image — and one-at-a-time keeps Dropbox’s rate limits happy.
Sends the image to our decoder server: two barcode engines, rotations, enhancement, plus an OCR read of the printed number.
This is the eyes of the system. Two engines and a printed-number cross-check catch far more than any single reader would.
Grades each result: clean barcode = processed; number read but unsure = verify; nothing = review. Writes the reason in plain English.
Every file must land in exactly one lane, and every landing must be explainable later — no silent judgment calls.
Gives the skipped (non-image) files their own “review” verdict.
Even a file we could not read deserves a lane and a log entry — nothing just disappears.
Merges the read files and the skipped files back into one stream.
The rest of the board should not care which path a file took — one stream, one set of rules.
The brain. Builds each file’s destination in the date tree, renames it to the order number, catches same-day duplicates, and runs the age-guard: a barcode far older than today’s orders is flagged as a likely remake and sent to Verify instead of filing silently.
This is where the remake bug was killed. A remake slip carries two barcodes — if only the old one reads, blind filing would bury it under the wrong number. The age-guard makes that impossible.
Works out which day folders this run is about to write into.
The next step has to know what is already filed there before a single file moves.
Reads everything already filed in each of those days.
So the agent can tell a fresh slip from one whose number is already on file.
Two guards, in order. First the age-guard: it compares each barcode against every order already filed for that day, and anything far older is treated as a likely remake and sent to Verify. Then the duplicate check: if that order is already filed, the file goes to 04_Duplicate.
The age-guard used to compare a slip only against the others in the same batch — but this board runs hourly, so a batch is usually one file, and one file is its own comparison. The guard could never fire. It now measures against the whole day.
Prepares the copy instructions: every raw scan into today’s 00_Originals.
One batch instead of many single copies — the difference between smooth runs and Dropbox rate-limit failures.
Executes the archive copy in Dropbox.
The untouched original is preserved before anything is renamed or moved. Whatever happens later, the raw scan is safe.
Pauses 45 seconds while Dropbox finishes the archive job.
Dropbox copies are asynchronous. Moving files before the archive lands once cost us backups — this wait closes that gap for good.
Prepares the move instructions: every file to its final folder with its final name.
Same batching principle — one clean instruction set for the whole run.
Executes the moves. Dropbox auto-creates any folder that does not exist yet.
This is the moment filing actually happens — and why folders only ever appear when they have files.
Pauses while the move job completes.
The run should not report success until the files have truly landed.
Writes each file’s outcome to the board’s internal ledger.
A machine-readable memory of every run, used for cross-checks.
Writes one row per file — name, verdict, reason — to the audit sheet.
The permanent paper trail. Any slip, any day, you can see exactly what the agent decided and why.
Composes the human summary: how many processed, verified, review, duplicates.
Numbers you can read in five seconds beat a log you have to dig through.
Sends that summary to WhatsApp.
You should not have to open anything to know today ran clean.
A tripwire that fires only if the board itself fails.
Silence must never be mistaken for success — failure announces itself.
Sends the failure alert with the error details.
We hear about a problem before the lab ever feels it.
Second chances. Twice a day it re-reads everything sitting in Review with a much heavier decode than the hourly pass can afford.
Hand-trigger for an immediate sweep.
For testing, or clearing Review on demand.
The clock — after the morning wave and before close.
Stubborn slips get second chances the same day they arrive, while the paper is still on hand.
Generates the last 21 days of Review folder paths in the date tree.
Review folders live inside each day now — this is how the sweeper knows every place to look without scanning the whole archive.
Lists the contents of each of those Review folders.
Gets the actual candidate files for each day.
Loads the strike ledger — how many times each file has already been diagnosed.
So the sweeper remembers its past attempts instead of repeating them forever.
Merges all days into one list, newest first, drops anything with 2+ strikes, caps at 20 per sweep.
Newest-first means today’s slips never wait behind an old graveyard; the two-strike rule stops wasted effort; the cap keeps runs fast and safe.
Pulls each candidate scan down, one at a time.
The heavy decoder needs the full image.
The heavyweight read: 7 image variants — including page-half crops and de-skew for bent paper — through both barcode engines, then a 4-pass OCR that must agree with itself, plus a plain-English diagnosis if all fails.
Bent and curled slips beat the fast hourly read. This slower, exhaustive pass rescues most of them — and when it can’t, it at least tells the human why.
Turns each deep-read into an action: barcode found → file to Processed; OCR consensus → pre-name into Verify; neither → stay, with the diagnosis attached.
Recovered barcodes are certain, so they file; OCR is probable, so a human confirms; everything else waits honestly.
Works out which day folders this sweep is about to write into.
The guards below need to know what is already filed in those days before anything moves.
Reads everything already filed in each of those days.
This one listing powers both guards — it reveals the day’s highest order number and every filename already taken.
Two guards in order. First the age-guard: a recovered barcode far older than the rest of that day’s orders is treated as a likely remake and sent to Verify, not Processed. Then the collision check: if that exact file already exists, it goes to 04_Duplicate.
The Sweeper could previously file a recovered barcode straight to Processed with no remake check — the same door the 12 historic misfiles came through. This closes it, and stops Dropbox silently renaming a clash to “(1)”.
Assembles the batch move instructions for the rescues.
One batch, no rate limits.
Executes the moves in Dropbox.
The rescues actually get filed.
Lists the files that stayed behind.
Each failed attempt must be remembered…
…and writes those strikes to the ledger.
…so two failures means the sweeper steps aside and leaves that slip for a human.
Writes every verdict — rescued or stayed — to the audit sheet.
Second-chance decisions deserve the same paper trail as first-chance ones.
Composes the digest: checked, rescued, still waiting.
A five-second read on how the sweep went.
Sends it to WhatsApp.
You know Review shrank without opening a folder.
The last resort. Slips nothing else could read get AI vision — under the strictest rule on any board.
Hand-trigger for an immediate AI pass.
For testing, or when you want Review cleared right now.
The clock — half an hour after each sweep.
The classical sweeper goes first; AI only spends money on what it could not crack.
Generates the last 21 days of Review paths in the date tree.
Same date-tree awareness as the sweeper — it looks everywhere Review lives.
Lists each Review folder’s contents.
Collects the stubborn files.
Loads the AI’s own strike ledger.
AI attempts are tracked separately — it gets three tries (it’s cheap), the classical sweeper gets two.
One list, newest first, drops 3-strike files, caps at 15.
Focus the pennies where they matter; retire what has genuinely failed.
Downloads the scan for the first read.
The AI needs the actual image.
Stamps the file as a proper JPEG image.
Dropbox hands files over as anonymous bytes; the AI service refuses anything not labeled as an image. Small fix, mandatory.
The first AI vision read: “find the order number under the barcode; reply with digits only, or NONE.”
A modern vision model reads curled paper that defeats every classical decoder.
Pairs each answer back with its file and extracts a valid 6-digit number — or nothing.
Only a clean, in-range order number counts; chatter and partial guesses are discarded here.
Downloads the same scan again, fresh.
The second read must be truly independent — same paper, clean slate.
Same image-labeling fix for the second copy.
Same requirement, second lane.
The second AI vision read — differently worded prompt, no knowledge of read A.
Two independent witnesses. One AI can hallucinate a digit; two agreeing on the exact same six digits, asked differently, effectively cannot.
Compares A and B. Only an exact match on a valid number goes forward — pre-named into that day’s 05_AI_Verify.
This is the anti-hallucination rule in one node: agreement or nothing. And even agreement only earns a suggestion — never a direct file to Processed.
Works out which day folders the agreed reads are about to be filed into.
The next step has to know what is already sitting in those folders before a single file moves.
Reads what is already filed in each of those days.
So the agent can tell a genuine rescue from an order that is already on file.
Checks each AI suggestion against the day already on disk. If that order is filed, it becomes a duplicate. And if the suggested number sits far below the day’s newest order, it is flagged as a likely remake — in the log and in the WhatsApp summary.
Two AI reads agreeing proves they saw the same number, not the right one. On a remake the old number is often the clearest thing on the page, so both reads agree on it. The flag tells whoever confirms it exactly where to look. Nothing is rerouted — it still goes to a human either way.
Assembles the batch move for the agreed slips.
One batch, clean and rate-limit-safe.
Executes the moves into 05_AI_Verify.
The rescues land where a human will glance at them.
Lists the files where the reads disagreed or failed.
Disagreement is a strike, not a guess…
…written to the AI ledger.
…three strikes and the AI retires that slip to the human queue.
Logs each AI-labeled slip with both-reads-agreed noted.
The audit trail shows exactly which names came from AI — full provenance, forever.
Composes the digest of what the AI rescued.
So the wins are visible.
Sends it to WhatsApp.
You see what the AI saved without opening anything.
Housekeeping. At 2:30 AM — the one hour nothing else moves files — it sweeps the date tree for empty folders.
The clock — fires once, in the middle of the night.
2:30 AM is the one hour nothing else moves files. A cleaner must never run beside a mover.
Lists the top of /Emerald.
Finds the year folders to walk into.
Keeps only folders named like a 4-digit year.
The safety fence: 00_Inbox and anything else at the top level are invisible to the cleaner by design.
Lists inside each year.
Finds the month folders.
Collects the month folders.
Next level of the walk.
Lists inside each month.
Finds the day folders.
Collects the day folders.
Next level down.
Lists inside each day.
Finds the status folders (Originals, Processed, Verify…).
Collects those status folders.
The deepest level — where empties actually appear.
Lists inside each status folder.
The final check: does it actually contain anything?
Marks a folder deletable only if Dropbox returned a clean, truly-empty listing. Any file — or any error — and it is left alone.
The one rule that makes a deleting robot safe: when in doubt, do nothing. An error is never treated as empty.
Assembles the delete instructions for the confirmed empties.
One batch, bottom-up — an empty day disappears the night after its folders do.
Executes the deletions in Dropbox.
Mornings always look clean.
Composes the list of what was removed.
Even housekeeping reports its work.
Sends that list to WhatsApp.
A deleting robot must never work in silence.
Temporary. Bridges the current scanner folder into the system during the transition — copies, never moves, so nothing about today’s process changes.
Hand-trigger for an immediate pickup.
Testing, or grabbing a fresh batch on demand.
The clock — twice an hour during lab hours.
The lab empties the scanner folder during the day; frequent pickups catch scans while they exist.
Creates 00_Inbox if missing.
The destination must always exist.
Works out today’s scanner folder.
Staff sometimes mistype folder names — the board finds today’s scans by their timestamps, not by trusting the folder name.
Lists what the scanner has produced.
Sees the day’s scans.
Loads the record of every file already copied.
The memory that makes double-ingestion impossible.
Compares the source against the ledger and keeps only genuinely new files.
Copy each scan exactly once — no repeats, no misses, even across re-runs.
Assembles the batch copy instructions.
One batch, rate-limit-safe.
Executes the copies into 00_Inbox. Copies — never moves.
The lab’s current process stays completely untouched during the transition. Their folder is never disturbed.
Pauses while Dropbox finishes the copy job.
Don’t record success before it’s true.
Confirms the batch actually completed.
Verification before bookkeeping.
Prepares the ledger entries for the files just copied.
Every copy becomes memory…
…written to the ledger.
…so tomorrow’s runs know exactly what has been taken.
Confirms the files are really sitting in 00_Inbox.
Trust, then verify.
Composes the pickup report.
Every pickup is visible, every day.
The agent ran beside your team for a full shadow period before touching anything alone. These are the numbers.
Files are organized by date first — year, month, day. Inside each day, the same folders every time.
How the agent performed on real scans, day by day — and what the hand-audit found.
Every issue we hit running on your real Dropbox, and exactly how each one was solved.
(The Agent)
Reads every slip. Names it. Files it.