assemblyline.sh

Workpieces

A workpiece is one unit of work stored as one folder: one invoice, one email, one recording. The folder travels from station to station. Each station reads what earlier stations left in it and adds its own files.

inv-1001/
├── pointer.json     what this is: written once by the line head
├── log.jsonl        what happened to it: one line per event
├── invoice.pdf      added by IN0, the line head
└── check.json       added by IN1

Because the work lives in a folder, anyone can open it, read it and see its history without asking another system. The Orchestrator records each run and the id and outcome of each workpiece in it. It holds only what a station chooses to attach to a run, such as its report.

A folder is a workpiece when it holds pointer.json

pointer.json is the marker. The conveyor between stations and the watchers that start them move and count only folders that contain one. A folder without it is not work, wherever it sits.

Don't nest a workpiece inside another workpiece. Tools stop looking when they reach a pointer.json, so a workpiece inside it is never seen.

pointer.json: identity, written once

The first station on a line, the line head, writes pointer.json when it creates the workpiece. No later station changes it.

Put in itKeep out of it
workpiece_id: the folder name, the same at every stationAnything a station computes: that goes in a file of its own
The source's own key, under the source's own name (message_id, url, sha256)Anything that changes over time
Locators: paths, URLs, ids in other systems
What the source already knew: title, sender, timestamps

log.jsonl: the workpiece's history

log.jsonl is append-only, one JSON object per line:

{"ts":"2026-11-03T09:00:12.004Z","station":"IN0","wr":"wr_8KfQ2","event":"workpiece_created"}
{"ts":"2026-11-03T09:01:05.311Z","station":"IN1","wr":"wr_3mPx7","event":"station_started"}
{"ts":"2026-11-03T09:01:06.020Z","station":"IN1","wr":"wr_3mPx7","event":"station_complete"}

wr is the work record of the run that wrote the line, so each event leads back to its run in the Orchestrator. Stations add an event before an action with an outside effect (posting to a ledger, sending an email), so a failure shows how far the workpiece got.

Files: added, never rewritten

Each station adds its own files next to the ones already there. It doesn't edit or delete what an earlier station wrote, so every stage of the work stays readable in the finished folder.

  • One thing per file. extraction.json and check.json, not one file holding both.
  • Fixed names. The next station reads extraction.json by name, so the station that writes it always uses that name.
  • Text over binary when you have the choice. Markdown and JSON can be read with cat and searched with grep.