Twig

Workspaces

Private caves, shared folders, grants that expire

Workspaces = real folders on disk. User sees folder names. Never raw paths. Twig indexes them. Files still boss.

Kinds

KindOwnerWho opens
homeOne agentOnly that agent
userYouAgents you grant

Home: agents/<agentId>/. User: workspaces/<workspaceId>/.

Each workspace has .twig/ bookkeeping. Hidden from normal listing:

  • manifest.json — name, kind, owner
  • journal.ndjson — mutation log (append only)
  • versions/ — old file versions by hash

Grants

Share is soft. Always expires. Expiry checked on every open, not only by sweeper. Late sweep cannot keep dead grant alive.

ModeMeaning
readLook and search. No write.
writeCreate, change, delete. Still sandboxed.

Durations: hour, day, week. Then gone.

Sandbox

Path enters workspace → normalize or die:

  • No absolute paths
  • No ..
  • No backslashes, no NUL

.twig/ readable for peek. Agents never write it directly. Journal machinery owns that.

Why folders not cloud blob soup

Backup = zip the Twig root. Reindex = rebuild DB from files. Laptop mirror = same tree over USB. DB corrupt? Drop. Reindex. File wrong? Journal + versions help reconcile. Files win. Always.