Skip to Content
turbo-12f
Reference

State home layout

What stays on disk under --home (scratch only), where durable state lives in Postgres (tables, document kinds, leases), and how t12 db import loads an older file-based home.

Reference

Neon Postgres is the only durable store (ADR 0005). Every process needs DATABASE_URL, and there is no local file mode.

--home (default $T12_HOME or ~/t12/home) is disposable scratch: git worktrees, caches, and cages that GitHub plus the database can rebuild. It must resolve outside any project repository (record.Open).

Disk

Scratch only

worktrees/, checkouts/, caches, and cages under <home> can be deleted at any time.

Database

Durable state

Accounts, conversations, event logs, evidence, runs, and metrics live in Postgres tables.

Leases

No lock files

Locks are rows with a time to live; a holder that dies frees its lease on its own.

Import

Old homes

t12 db import --home DIR loads a file-based home into the database once.

What stays on disk under <home>

admin.sock
PathOwnerPurpose
worktrees/orchestrator, strategist, t12 preview, t12 runGit worktrees for lanes (@<lane>), @release, @strategist, and preview-<project>-<port>.
merge-scratch/internal/mergequeueScratch worktree (<request-id>-<lane>) for rebasing onto staging.
checkouts/devops, sandbox, t12-uiDetached checkouts (<request-id>/<step>) plus MountScratch dirs (engineer-*, ui-base-*, gitleaks-*, job-checkout-*); 24h sweep on MountScratch/t12-ui start.
artifacts/<project>/<tree>/distinternal/roles/devopsRebuildable copy of a staging build. Its record is an artifact document. When dist/ is gone, t12 promote refuses with promote.no-build (a connected hosting account) or promote.no-account (none); t12 release merge rebuilds it first when a hosting account is connected.

Where durable state lives

Each table or document kind replaces a file the factory once kept under <home>. Full inventory: ADR 0005.

DataWhere
Request event log (hash-chained)events, stream request:<id>; a trigger refuses updates and deletes.
v1 run event logevents, stream run:<name>.
Evidence, reports, decisions, lane filesblobs + blob_chunks (1 MiB chunks) named in files (scope request:<id>, run:<id>, job:<id>, context:<id>); structured copies in role_reports and decisions.
Read caches (rebuildable)documents kinds log-snapshot and log-blobs (a log's events and the blobs of one event type, so a cold process reads only what came after), rollup-derived and ui-gate-facts (values derived from a log, stamped with its position and the build).
Conversation index (title, phase, last_seq)conversations; the person's own title, pin, and archive flags live in its doc.
Role-context statedocuments kind context-state, key <id>.
Standalone Context creator (t12-cc)documents kind context-creator; streams context:<id>:transcript and context:<id>:events in log_entries.
v1 run records and lanesruns and lanes; a home binding is the home-config document.

Importing an older home

Homes written before the database kept their records as files. t12 db import --home DIR reads that layout once and writes it into Postgres; the old tree is not used afterwards.

bin/t12 db import --home ~/t12/home --dry-run   # read and verify, write nothing
bin/t12 db import --home ~/t12/home

Import once, before cutover

Stop the factory first and do not import again afterwards: a second run would overwrite newer rows with the old files. Hash-chained logs are copied byte for byte after each chain is verified; a log that fails verification is reported and skipped.

The import runs steps in order. A failing step is reported and the others still run; the command exits 1 if any failed. Re-running is idempotent, and --only takes a comma-separated list of step names.

Re-copy the cloud worker workflow

The cloud worker workflow input product is now project, and the action init-product is now init-project. Copy .github/workflows/t12-worker.yml from this repository into the worker repository again, so its inputs match what the updated handler dispatches.

Legacy v1 scratch

t12 init and the legacy v1 commands keep their run records in the database (runs, lanes, events), but still use a few scratch folders under --home.

Next steps

On this page