dotFactory
Documentation / Build a factory

Factories and versions

Build a factory

Identity, immutable versions, members, and factories that live in a repository.

A factory is the container a workflow lives in. It has an immutable identity, a per-owner name, a history of versions, and members with roles.

Identity and naming

A factory's identity is a uuid id; URLs use it (/factories/<id>), so a rename cannot move a resource or break a bookmarked Run. Its name is a per-owner label: two people may each own a factory called delivery without colliding, and the name is never resolved globally. The API's {"factory": "<name>"} resolves only within the caller's memberships.

Versions are immutable

Every upload creates a factory version: an integer version number, a content digest, the source modules and the content of every referenced file "…". The digest is location-independent — module paths are relative to the root module — so the same factory hashes the same wherever it is checked out.

  • Re-uploading identical content is a no-op: the existing version is returned, not a new one.
  • A Run records both the factory id and the exact digest it used, so an old Run stays reproducible after the factory moves on.
  • Editing a prompt that is injected with file "…" changes the digest: the injected content is part of the factory's identity.
  • A version published from a repository also carries provenance: the repository, path, ref and commit.

Members and roles

role may
owner everything an admin may do, plus delete the factory
admin add members by email, upload versions, manage the factory's secrets and configuration, pause schedules, pick an organization, publish repository updates
member run and read: fire triggers, read Runs, see which keys exist

An owner or admin adds an existing user by email; adding someone does not create an account for them. A factory with queued or running Runs cannot be deleted until they finish or are cancelled.

Factories from a repository

Instead of uploading a bundle by hand, a factory can be linked to a repository. A repository may carry a default factory at .fct/factory.fct, and any number of named factories at .fct/factories/<name>/factory.fct; each root is self-contained and its modules and file "…" content live under its directory.

A check reads the granted repository's default branch at a pinned commit and records one candidate per root. It never registers or runs anything. A person entitled to the repository accepts a candidate, which creates the factory and its first version.

After that the link is one of two modes:

  • pinned — a later commit is proposed as an update. The factory page shows Publish update, and an owner/admin publishes it as a new version.
  • follow — a push to the default branch publishes the new version automatically.

A linked factory is updated from the repository only: its Versions page does not offer Upload. Refresh (in the factory page header, for owners and admins) re-checks the default branch; when it differs from the current version the source card shows Publish update. That keeps every version associated with the repository that scopes github_token. For a hand-edited variant, create a separate factory without a repository link; an uploaded factory still opts into tokens with FCT_GITHUB_REPOS.

A root that disappears becomes missing; the linked factory and its versions remain. Reading a repository needs the GitHub App's installation token with Contents: read; automatic updates additionally need the App subscribed to Push events. GitHub covers the App setup.

Reading a factory page

The factory page is the factory's live documentation:

  • the flow diagram, built from the stored source even when an adapter is missing;
  • Runs, with status tallies and the average and p95 duration for the latest 100, and factory history that starts with five Runs and expands to pages of 20;
  • the definition — every source file of the current version;
  • the types it declares, and the ports each type flows through;
  • the secrets and configuration keys it needs, and which scope can satisfy each one.

The dashboard keeps the list of your factories and their last Runs. Refresh re-reads a repository-linked source; Delete removes the factory and everything scoped to it.

Your factories

Your factories will appear here. Create one and open it beside this guide.