Your Plant as Files

Keep your plant as plantformat files: preview the map, instructions and parts, change the map and instructions in place, edit in Code or the terminal of your own workspace, and fix what validation finds.

Most plants are described in a dozen places: a drawing of the floor, routing sheets, a BOM export, instruction binders. They drift apart. In Threaded, your plant is one folder of plain-text files: the map, the parts, how each part is made, and the instructions at each station. The files follow plantformat, a format for describing a factory. Because the plant is files, you can keep it in git, see every change, and let the AI edit it the same way you do.

#What it is

Plant shows those files as a plant. You change them on the Map and Instructions tabs, in Code, or ask the AI (see The Plant AI Agent). When the plant is right, you commit it for your organization and release it so Run can import it (see Plant Git and Imports).

A plant folder holds these files:

File or folderWhat it describes
plant.yamlThe plant itself: its name and format version.
map/map.yamlThe places and the flow: groups such as cells and lines, stations (operations and inspections), stores, and how material moves between them, including rework and scrap paths.
routings/The stations and stores a part passes through. At each station: the changeover, setup and run work, with instructions, crew, times, tools and batch size. Parts made the same way share one routing.
instructions/What the operator is told: procedures, steps, checks, named parameters, tools and step photos.
specs/The parameter values at each station: targets, limits, units, and whether the station records them.
part_recipes/One per part made here: which routing and specs it uses and what it consumes at each station. A part with a recipe is made here; a part only consumed is bought.
parts.yamlThe plant’s item master.
catalog/The design item master from engineering, and each part’s EBOM (its direct components).
resources/tools.yamlThe tools.
media/Document files, such as drawings. Step photos live in your organization’s media library.

#Rules

  • Every fact has one home. A spec value lives in specs/, not in an instruction.
  • Some things are deliberately left out of the plant: training, costs, schedules, work order quantities, and what happened on the floor. Those live in Run and in your other systems.
  • A part is made if it has a part recipe, and bought if a recipe only consumes it. Nobody types “make” or “buy”.
  • The plant is checked every time the preview builds. Errors must be fixed before the plant can be released to Run. Warnings don’t block a release.
  • Your edits are drafts in your own workspace until you click Commit. They never reach the floor until they’re released, approved, merged and made effective.
  • A change you make on the Map tab is written to map/map.yaml straight away. There’s no Save for it and no undo: to take a change back, make the opposite change.
  • The map holds no positions. Threaded lays it out from the flow each time, so a station can’t be dragged to a new spot.
  • A station’s id is made from its name when you add it, and renaming never changes it. Routings name a station by its id.
  • The Map tab won’t delete a station that a routing runs through, join two stations that are already joined, or add a connection that would make material flow loop.
  • Plant opens on your workspace as you last left it, then catches up. If the workspace was asleep, it starts. Then it pulls your teammates’ latest commits on dev from plant git in the background and merges your drafts with them. If they’d conflict, it leaves your drafts as they are and pulls nothing; you settle it when you commit. If plant git can’t be reached, Plant shows Couldn’t get teammates’ latest changes. You can keep working, but you may not see your teammates’ newest commits until Plant tries again: after 30 seconds, 2 minutes and 5 minutes, then not again until you open Plant again or click Reconnect, which tries straight away. Committing still merges them in.
  • If plant git can’t be reached and your workspace has none of your organization’s files yet (a new workspace, or one that was cleared), Plant shows Couldn’t get your plant where the plant would be. Your organization’s plant is still in plant git. Threaded tries again on its own after 30 seconds, 2 minutes and 5 minutes, then stops until you click Retry or open Plant again. Your plant appears as soon as it gets through; you don’t need to reload the page. Don’t start a new plant in Code in the meantime: it would conflict with your organization’s plant when the workspace connects again.
  • Your workspace sleeps after an hour without use. Your files are saved first, and come back when it starts again.
  • Plant needs the Planning Workspace, which is turned on per organization. See Feature Access and Billing.
  • Owners, Editors and View All members can open Plant. Operators can’t; they work in Run.
  • Only Owners and Editors can commit and release. A View All member can try changes in their own workspace, but can’t share them.
  • Each person has one workspace per organization. Nobody else can see your workspace or your drafts, and the AI only edits the workspace of the person it’s talking to.
  • Your workspace keeps its files between visits. It goes to sleep after an hour with nothing open, and wakes with your drafts where you left them.
  • A workspace nobody has used for seven days is cleared, and drafts you never committed are lost. Committed work is safe in your organization’s plant repo, and the next time you open Plant your workspace starts again from it.

#In the app

#Your workspace

Your workspace is a small Linux machine that Threaded runs for you. It holds a copy of your organization’s plant repo in /workspace, and it’s where the previews are built, where Code saves your edits, and where the terminal and the AI run their commands.

When you open Plant, the toolbar shows Waking workspace…, then Starting workspace… while your workspace starts. The file tree and previews you saw last are shown in the meantime. Commands, saves and previews wait until it’s ready. A workspace with nothing in it yet (the first time you open Plant) gets your organization’s plant from plant git before it’s ready, so it opens with the files in place.

It then brings in what others have committed since your last visit, when those changes don’t clash with your drafts, and the toolbar shows Getting latest changes…. The file tree, files and previews keep loading meanwhile. Commands and saves you start wait for it to finish, usually a few seconds; if plant git stops answering, it gives up within about 10 seconds. A clash is left as it was: your drafts stay, and their commits aren’t in the preview until you Commit and choose Keep mine, Use theirs, or Ask the assistant to combine. If bringing them in doesn’t finish, your workspace stays as it was.

  • If the toolbar shows Workspace could not start, hover it for the reason and click Reconnect.
  • If your connection to the workspace drops while Plant is open (for example, while Threaded is being updated, or if the workspace stops), the toolbar shows Reconnecting… and Plant reconnects on its own, starting the workspace again if it needs to. A command or save that was running when it dropped doesn’t finish; run it again once Plant is back. If Plant still can’t reconnect after about a minute, it shows Workspace disconnected: click Reconnect. In a background tab, Plant waits until you come back to the tab before it reconnects.
  • If it shows Workspace disconnected, click Reconnect.
  • If Plant can’t reach your workspace at all, it says Could not wake the planning workspace. Reload the page to try again.

#Preview your plant

Plant’s tabs show the plant described by your files:

  • Map: the stations, stores and flow. Click a station to see what it makes, the parts and tools it uses, its time and crew, and its instructions. Highlight shows the path of a routing or part.
  • Instructions: every instruction, its procedures and steps, the parts that use it, and its parameter values.
  • Parts: every part, grouped into finished goods, subassemblies and components, with whether it’s made or bought, its recipe and route, and whether its consumption matches the EBOM.
  • Media: your organization’s media library. Owners and Editors can upload photos, videos and files here to use in instructions.

You can change the map on Map and edit instructions on Instructions (both below). Everything else in the previews is read-only. While the plant builds, the toolbar shows progress, such as Building map preview…. If your workspace has more than one plant, pick one from Plant in the toolbar.

#Change the map

On the Map tab you can add stations, name them, connect them and delete them, without opening a file. Each change goes into map/map.yaml with the file’s comments and layout kept, and the map redraws at once. The plant is checked after each change, so the chip in the toolbar follows a moment later.

Click a station to pick it. Its toolbar opens above it:

  • Add before and Add after start a new station that feeds the picked one, or is fed by it. The new station appears on the map, in the same group, with a panel beside it. Type its Name, choose Station, Inspection or Store, then click Add or press Enter. Nothing is written until you do: Cancel or Escape drops it.
  • Rename changes the station’s name. Click Save or press Enter.
  • Delete removes the station and its connections, after asking. A station that a routing runs through can’t be deleted here: take it off the routing first, with the AI or in Code.

To connect two stations, point at one, then drag from the dot on its right edge onto the other station. The connection is material flow from the first to the second. Dragging from the dot on its left edge makes the connection the other way: the other station feeds this one.

Let go over empty canvas instead, and a new station starts there, connected to the one you dragged from. Name it as above.

To remove a connection, click it, then click Remove this connection on it or press Delete.

On a plant with no stations yet, click Add the first station.

What the Map tab doesn’t change:

  • Groups (cells and lines). A new station goes in the group of the station it was added from.
  • A station’s kind once it’s added, a store’s policy and capacity, or its description. A new store starts as a buffer.
  • Rework and scrap paths. A connection made here is always material flow; Leave and Return connections are written in map/map.yaml.

For those, ask the AI or edit map/map.yaml in Code.

If the AI or a teammate’s commit changes map/map.yaml at the moment you change the map, Threaded asks you to choose Keep my edits or Load new version.

#Edit in Code

Click Code in the toolbar to see the plant’s files. Click it again to go back to the preview.

  • Click a file in the tree to open it and make your change. It saves to your workspace a moment after you stop typing. The editor shows Saving… while it writes, then Draft saved.
  • A PDF opens in the pane as the document. The browser draws it. It isn’t edited there. A browser that can’t draw PDFs says Could not show this PDF. and offers Open PDF, which opens the file in a new tab.
  • Click New file to add a file.
  • Press Ctrl+ to show the terminal, or click **Show terminal (Ctrl+)**.
  • Click the download button in the open file’s header to save a copy of the file to your computer. It downloads the file as it is in your workspace, such as a PDF or spreadsheet the AI built in data/. Files over 32 MB are too large to download here. Ask the AI to upload one to the Media Library instead, and download it from there.

Share a file. While a file is open in Code, the address bar names it, such as …/plant/code/routings/frame.yaml. Copy the address and send it. A link from Open in code also names the line, with ?line=12. After you press Preview or Edit on a Markdown or CSV file, the address ends in view=preview or view=edit, and the link opens the file that way. Anyone in your organization who can open Plant can open the link. It opens the file in their own workspace, so they don’t see your changes until you commit them.

A file or folder you changed is marked Modified. To share your changes with your organization, click Commit. To send committed changes to Run, open Releases and submit a release. See Plant Git and Imports.

If the AI or a teammate’s commit changes a file you have open, Threaded keeps your edits and asks you to choose Keep my edits or Load new version.

A file the editor can’t open says This file is too large to open here. Use the workspace terminal instead.

#The terminal

In Code, press Ctrl+ (Ctrl on a Mac too), or click **Show terminal (Ctrl+)**, to open the Workspace terminal. Terminal: Ctrl+** shows until you do. Click **Hide terminal (Ctrl+) or press Ctrl+again to hide it. Type a command and press Enter. It runs in your workspace, in/workspace, and its output shows when it finishes. A command that fails ends with its exit code, such as [exit 1]`.

  • Press Ctrl+C to stop a running command.
  • Press ↑ and ↓ to go through earlier commands, and Tab to complete a file path.
  • The terminal has plantformat, threaded (signed in as you), git, plant-sync, python3, node, jq, sqlite3, curl and the usual shell tools. You can’t install other programs.
  • Commands reach Threaded and your plant repo, and nothing else on the internet.
  • Programs that wait for you to type while they run, such as a text editor, don’t work here. Edit files in Code.
  • CPU and RAM beside the terminal show how much of its share your workspace is using.

If the workspace is disconnected when you run a command, the terminal reconnects first. If that fails, it says the command didn’t run. Click Reconnect, then press ↑ to run it again.

Commit from the toolbar, or with plant-sync save -m "<what changed>" in the terminal. Both commit to your organization’s dev branch. Don’t push to main from the terminal: it’s refused. main moves only when an editor merges an approved release.

#Editing work instructions

You don’t have to open the files to change what operators read. On the Instructions tab, open an instruction and click Edit. Your changes go into the instruction’s file with its comments and layout kept.

Nothing saves on its own. The chip at the top says Unsaved changes until you click Save, or Done, which saves and leaves edit mode. If the save can’t go through, you stay in edit mode and the editor says why. If you open another instruction, plant or tab with unsaved changes, Threaded asks you to Save, Discard changes or Stay on page.

The plant isn’t checked while you edit. A change often needs edits in several places, or several files, before the plant checks clean again, so validation waits until you save. After Done, the instruction shows the results of the checks.

Until you save, your edits are also kept in this browser. If the workspace stops answering, editing and saving pause, and your edits stay on screen. If the page reloads or the workspace restarts, they come back when you reopen the instruction. If the file changed in the meantime, you choose Keep my edits or Load new version.

#Steps and procedures

You can rename, reorder, add, duplicate and delete procedures, and set each one’s description and safety warning. In a step, Enter splits the step at the cursor, Shift+Enter starts a new line, and Backspace at the start joins the step to the one above. Drag a step to move it, within its procedure or into another one. Each step is a work step or a check step, and a check step can be pass/fail.

New, Duplicate and Delete in the instruction list work on whole instructions. A new instruction doesn’t run anywhere until a routing names it.

#What the step text leaves out

Write a step for the kind of part, not a specific part number: “fit the housing seat”, not “fit HSG-A100”. Which part is at a station comes from the plant’s map, routings and part recipes, so the same instruction can serve every part that runs there.

When you edit an instruction, a panel at the top shows where it runs: each station and phase, the parts that run there, and what each part consumes there. If step text names a part number or id, a hint under the step suggests naming the kind of part instead.

A step’s tools and parameters show as chips you can’t edit here. The routing lists the tools at each station, and the specs set each parameter’s value, so ask the AI Assistant to change them.

#Step pictures and videos

Click Add picture on a step. You can upload a picture, generate one with AI, or pick one from your organization’s Media Library. Then annotate it with arrows, shapes and text, and add alt text. You can reopen a picture later and change its annotations, reorder a step’s pictures, or move a picture to another step.

Click Add video on a step to pick a video from the media library, or upload one there. Videos aren’t annotated. A step’s videos show with a play button among its pictures, and you reorder, move, describe and delete them the same way. Click a video to swap it for another. Operators play the video on the step.

Base images and videos live in the organization media library, so the same photo or video can be used in many steps. Once a plant with an annotated picture is promoted to the floor, the photo underneath it can’t be deleted from the media library. That keeps the record of what operators saw intact.

You can also ask the AI Assistant how to edit an instruction or add a picture to a step. It answers, and gives you a link that opens the instruction with Edit on.

#Editing parts

The Parts tab is read-only. To add or change a part the plant makes or buys for itself, edit the plant’s parts.yaml in the code view: click a part’s number on its page to jump to its row. Parts that come from your design catalog (catalog/) are a copy of what’s in your PDM, so change them there.

A part’s id and part_number can be the same string, but neither can be another part’s id or part number. Validation flags a clash.

Routings, part recipes and specs aren’t edited on these tabs either. Ask the AI Assistant, or change them in the code view.

#Open in code

Where the plant shows what a file says, click it to jump to the code that defines it:

  • a part’s number under its name opens its part_number: line in the part’s row
  • a routing’s id under its name opens the routing
  • the route on a made part opens the part’s recipe
  • the files at the bottom of a part, routing or instruction open that file, at the part, recipe or routing it’s about
  • the map/map.yaml · <station id> line at the bottom of a station opens the station in the map

Any unsaved edits are saved first. The code view then opens the file, with the folders around it expanded and the line highlighted.

#Who can edit

Organization editors can change the map and edit instructions. Everyone else sees them read-only. Editing and saving instructions pause while the workspace is starting up or out of reach, and while a sync is running. Unsaved edits are kept.

The map can’t be changed while the workspace is starting up or out of reach, or while Trial run is on.

#Check your plant

A colored dot in the toolbar shows the result of the last check:

  • Green: no errors or warnings. Only the dot shows; point at it to see Checks pass.
  • Amber: warnings only, with how many, such as 1 warning. The plant still works.
  • Red: errors, with how many, such as 2 errors, 1 warning. Fix them before you release.

Click the dot to open Validate. It lists each problem and the file it’s in. On the map, a station with problems shows how many.

Errors include unknown keys, missing references, a parameter with no spec value, or a material flow that loops. Warnings include consumption that doesn’t match the EBOM, or a routing nothing uses.

If the plant doesn’t build at all, Plant says The preview did not build and shows what plantformat reported. Click Open Code to fix it. If there’s no plant yet, add a plant.yaml in Code, or ask the AI to start one.

#Your recipes against the EBOM

Engineering’s EBOM says what a part is made of. Your part recipes say what each station actually consumes. Plant compares the two for every made part that has an EBOM in catalog/eboms/, and shows the result on the part’s page in Parts:

  • matches the EBOM: each consumed part is in the EBOM at the same quantity, and each EBOM line is consumed.
  • {count} from the EBOM: they differ. The part’s consumption table marks each difference.

How the comparison works:

  • Consumption is added up per piece across all the part’s stations. Setup and changeover lines are never in an EBOM, so they’re not compared.
  • A phantom is a grouping in the EBOM only. The plant never builds or stocks it as a unit, so its parents consume its components directly. Phantoms are expanded into their components before comparing.
  • A made subassembly is checked on its own page, against its own EBOM.

Each difference, and how to clear it:

Plant showsIt meansTo clear it
not in the EBOMA recipe consumes a part the EBOM doesn’t list.Remove it from the recipe, or add it to the EBOM if engineering missed it.
In the EBOM, not consumedThe EBOM lists a component no station consumes. For a phantom, one of its components isn’t consumed by the parts it goes into.Add it to the recipe at the station where it’s fitted, or have engineering remove it from the EBOM.
EBOM says {quantity}The part is consumed, but at a different quantity.Fix the quantity in the recipe, or in the EBOM.
no EBOMNo EBOM in catalog/eboms/ is rooted at this part, so nothing is checked.Add the part’s EBOM to the catalog, if it has one.

The same differences show as warnings in Validate. They never block a release: some plants consume differently from the design on purpose. Each warning, in plantformat’s own words:

WarningIt meansTo clear it
'<part>': EBOM component '<child>' is not consumed at any stationThe EBOM lists <child> on <part>, and no station on <part>’s route consumes it.Consume <child> at the station where it’s fitted, or have engineering take it off the EBOM.
'<part>': component '<child>' of phantom '<phantom>' is not consumed at any station<phantom> is only a grouping in the EBOM. <part> should consume its component <child> directly, and no station does.Consume <child> at the station where it’s fitted, or take it off the phantom’s EBOM.
'<part>': phantom '<phantom>' is not consumed, nor are its componentsThe EBOM lists <phantom> on <part>, and neither the phantom nor any of its components is consumed.Consume the phantom’s components where they’re fitted, or take the phantom off the EBOM.
'<part>': EBOM component '<item>' consumed <have> per piece, EBOM says <qty><item> is consumed, at <have> per piece instead of the EBOM’s <qty>. A “(through phantom …)” suffix means the EBOM quantity comes from a phantom.Change the recipe quantity, or the EBOM quantity, so they agree.
'<part>' consumption: '<component>' is a design part not in the EBOM ('<ebom part>'); add it to the EBOM, or, if the plant owns it, define it in parts.yaml (part.manufacturing)A station consumes <component>, and <part>’s EBOM (<ebom part>) doesn’t list it.Add it to the EBOM if engineering missed it. If the plant owns it, such as a fixture the design doesn’t call out, define it in parts.yaml under part.manufacturing instead.
'<part>' consumption: '<component>' is below '<sub>', a direct component of its EBOM; <hint>The recipe consumes <component>, which sits inside <sub>. The EBOM lists <sub> itself, as one part, so the recipe is reaching below it. The warning ends with a hint about where.Consume <sub>, or change the EBOM if the station really fits those pieces one by one.
phantom '<part>' has no EBOM, so its parents cannot consume its …<part> is a phantom with no EBOM of its own, so a parent has no components to consume in its place. The warning names what the parents can’t consume.Add the phantom’s EBOM under catalog/eboms/.
phantom '<part>' is in no EBOM; a phantom is consumed through its parentNothing’s EBOM lists this phantom. A phantom is never built or stocked on its own. It’s consumed only by being expanded into a parent’s recipe.Add the phantom to its parent’s EBOM. If it’s a real part the plant builds, don’t mark it as a phantom.

#Trial run

Trial run in the toolbar runs work orders on your draft, as the floor would. Nothing is saved. Only Editors and Owners can turn it on.

  • Start order. Pick a Part and the number of Pieces, then click Start order. The order moves across the map, and each station’s panel shows the trial units there and the action the operator would see.
  • Feeders. Set the pieces on hand before the trial starts. Shortages count against them, and Feeders shows how many are short. As on the floor, a station can’t Complete while a made part it uses isn’t on hand: the trial refuses that move, names the part, and stops there. A part whose store pulls (kanban, supermarket) is pulled instead.
  • Reset clears every order and starts the trial again.

If you edit the draft while a trial runs, Threaded replays the moves on the new draft. A move that no longer runs is dropped, with every move after it.

A trial checks procedures, prep, picks and holds. Step tools, parameters and media are checked at release, not in a trial. To put a change on the floor for real, release it, merge it, and make it effective in Releases.

#From the CLI or API

  • threaded plantformat validate <plant-folder> runs the same checks on a plant on your computer. Add --json for a machine-readable report. It exits with an error when there’s at least one error; warnings aren’t failures.
  • threaded plant remote prints your organization’s plant repo URL, and threaded plant setup-git sets up git credentials for it, so you can clone the plant and edit it with your own tools. Push your commits to dev. See Plant Git and Imports.
  • threaded task map:export --plant <dir> writes your published Threaded map and parts into a plant folder to start from.
  • There is no command for a single map change. What the Map tab does is an edit to map/map.yaml, which you or an agent can make directly, then validate:
    • A station is an item under nodes with an id, a name and kind: process. An inspection adds subtype: inspect. A store has kind: store and a policy (buffer, fifo, supermarket, kanban or warehouse). parent names its group.
    • A connection is an item under edges with from, to and kind: material. kind: alternate leaves the flow (rework, scrap) and kind: return re-enters it.
    • Ids use only letters, digits, ., _ and -, and no group or node shares one.

Common errors from plantformat validate after a map edit:

  • duplicate id '<id>': two groups or nodes share an id. Until it’s fixed the plant loads with no map, so the Map tab shows No stations on this plant.
  • store nodes require policy: a kind: store node has no policy.
  • edge from unknown node '<id>' or edge to unknown node '<id>': a connection names a node that isn’t under nodes. Deleting a node means deleting its connections too.
  • edge cycle among <ids>: material flow loops. Change one of the connections to kind: return.
  • node '<id>' is not connected by any edge is a warning: the station stands alone.

plant-sync runs in the workspace terminal, not as a threaded command on your own computer. It moves your workspace to and from your organization’s dev branch.

  • plant-sync status prints one JSON line:
    • workingBranch: the branch commits go to (dev).
    • branch: the branch checked out now.
    • ahead and behind: how many commits you have that the shared repo doesn’t, and how many it has that you don’t.
    • dirty: whether you have uncommitted changes.
    • remote: whether dev exists on the shared repo.
    • inProgress: a half-finished git operation (MERGE_HEAD, rebase-merge, rebase-apply, CHERRY_PICK_HEAD or REVERT_HEAD), or null.
    • conflictPaths: files in an open merge, or from the last merge that was deferred or failed.
    • changedPaths: files the next save would send.
    • incoming: up to 50 commits on the shared repo that you don’t have yet, each with author and subject, as of the last fetch.
  • plant-sync save -m "<what changed>" commits your changes, merges anything newer, and pushes to dev. It exits 3 when the merge conflicts: the commit stays in your workspace and isn’t pushed, and the message names the files. It exits 4 when git refuses to start the merge at all, for example because an untracked file is in the way: the commit stays local, and the message gives git’s reason. Settle a conflict with plant-sync save --resolve ours, --resolve theirs, or --resolve manual, or with Commit in the app.
  • plant-sync save --dry-run lists the files a save would commit, and says how many local commits it would push and how many newer commits on plant-git it would merge first. It commits nothing. It does fetch, so that count includes commits that landed since you last looked. With nothing of yours to send it says Nothing to save; dev is up to date., even if others have committed since.