Arbor agent guide

Authoring Arbor Records

A Schema, View or Dashboard is an Artifact whose source is arbor-records/v1 JSON. Creating that Artifact on its home Thread publishes it. Tool schemas remain the source of truth for flags.

Set up structured Records

  1. Confirm access and discover. Use arbor profile list, then run arbor --profile NAME whoami and arbor --profile NAME server info --json. Compare serverVersion with arbor --version. Use the matching published package, or build the CLI from the server's checkout for a pre-release. With MCP, check the live authenticated tools/list and refresh the host catalog if it omits record or typed Thread inputs. Find your Topic with tree query "Space / Topic" or browse with tree --depth spaces. Check write access and existing definitions with record definitions and spaceId. Match schemas[].topic and views[].query.topic to the Topic id.
  2. Inventory and organize Threads first. Existing Threads become rows and keep their IDs, conversations and Artifact history. Record their current Topics and the source Artifact versions. Complete intended Thread moves before publishing, because moves into or out of a Topic with a live Schema are blocked. Use Standing lifecycle for directory entries and the Topic's existing workflow Status for progress. Add a custom field only for a separate business attribute.
  3. Publish a small Schema. Start with a few optional fields and leave unverified values blank. In Topic Details, choose Set up structured data and select an existing source Thread. In the CLI or MCP, create a doc Artifact of type json with sourceThreadId for its provenance. A private Topic requires a home Thread in that Topic. Between open Topics, a home Thread can live in the same Space outside the target Topic. A Dashboard needs an open home Topic. If you need a first row, start a real Thread with create_thread. The Schema generates its All {noun.many} View. Read definitions back before adding optional saved Views or a Dashboard referencing a saved View.
  4. Backfill and verify. Save create receipts by topicId, threadId and artifactId. Use the current Schema version and each Thread's baseRevision for bounded, idempotent field writes. Compare IDs, verified values and history against your inventory. Run the default and saved Views with the intended identity and check Dashboard totals and the matching drill query when present.
  5. Recover and cut over deliberately. After an ambiguous write, reread the Thread, definitions or exact Artifact source before retrying. Replay the original key with the original payload when the caller supports it. For a corrected edit, reconcile against the latest baseVersion or baseRevision and use a new key. Preserve legacy Artifact versions. Archiving a legacy Topic makes its contents read-only. Superseding an Artifact changes its lifecycle and leaves it editable subject to the usual write rules.

Copy-ready sequence

Replace IDs from tree and create receipts. Here the Orders definitions use an existing home Thread.

arbor --profile NAME tree --query "Acme / Orders"
arbor --profile NAME record definitions --space-id spc_…

Replace the placeholder IDs in the Schema JSON below and save it as schema.json.

arbor --profile NAME create artifact --kind doc --type json --title "Orders Schema" --summary "Orders Schema" --source-thread-id thr_… --source-file schema.json
arbor --profile NAME record definitions --space-id spc_…

In MCP, use artifact with verb=create, the same fields, and source. If the Schema exists and its default View is missing, create a View from the current Schema or use Finish Records setup in Topic Details. If you get This Topic already has a Schema Artifact, edit that Artifact with edit artifact or MCP artifact with verb=edit and the latest baseVersion. For a timed-out create without an idempotency key, check the home Thread and exact Artifact source before submitting again.

Working JSON

Replace top_orders, top_accounts and art_retail_orders with live IDs. Dashboard widgets reference a saved View Artifact id, never an inline query.

{
  "format": "arbor-records/v1",
  "kind": "schema",
  "schema": {
    "topic": "top_orders",
    "label": "Orders",
    "noun": {
      "one": "Order",
      "many": "Orders"
    },
    "fields": [
      {
        "key": "quantity",
        "label": "Quantity",
        "type": "number",
        "defaultValue": 1
      },
      {
        "key": "unitPrice",
        "label": "Unit price",
        "type": "currency",
        "currency": "USD"
      },
      {
        "key": "total",
        "label": "Total",
        "type": "currency",
        "currency": "USD",
        "readOnly": true,
        "formula": "quantity * unitPrice"
      },
      {
        "key": "channel",
        "label": "Sales channel",
        "type": "select",
        "options": [
          {
            "value": "retail",
            "label": "Retail"
          },
          {
            "value": "wholesale",
            "label": "Wholesale"
          }
        ]
      },
      {
        "key": "dueDate",
        "label": "Due",
        "type": "date"
      },
      {
        "key": "daysOverdue",
        "label": "Days overdue",
        "type": "number",
        "readOnly": true,
        "formula": "daysBetween(today(), dueDate)"
      },
      {
        "key": "account",
        "label": "Account",
        "type": "relation",
        "relation": {
          "topic": "top_accounts"
        }
      }
    ]
  }
}
{
  "format": "arbor-records/v1",
  "kind": "view",
  "view": {
    "name": "Retail orders",
    "query": {
      "topic": "top_orders",
      "filter": [
        {
          "field": "channel",
          "op": "in",
          "value": [
            "retail"
          ]
        }
      ],
      "sort": [
        {
          "field": "dueDate",
          "dir": "asc"
        }
      ]
    },
    "mode": "table",
    "layouts": {
      "table": {
        "columns": [
          "title",
          "status",
          "channel",
          "total",
          "dueDate",
          "account"
        ]
      },
      "board": {
        "groupField": "status",
        "cardFields": [
          "total",
          "dueDate"
        ]
      },
      "calendar": {
        "dateField": "dueDate"
      }
    }
  }
}
{
  "format": "arbor-records/v1",
  "kind": "dashboard",
  "dashboard": {
    "name": "Orders",
    "widgets": [
      {
        "id": "retailCount",
        "title": "Retail orders",
        "view": "art_retail_orders",
        "kind": "stat",
        "measure": {
          "fn": "count"
        }
      }
    ]
  }
}

Shape, Status, defaults

Exact unit rates

Use two editable text fields with decimalScale from 0 to 6. Declare the quantity unit, such as LB, and the corresponding rate unit USD/LB. Send decimal strings, such as "85" and "0.095", in values. Short fractions are padded to the declared scale. Excess digits, exponent notation and negative rates are refused.

Declare the output as currency with currency: "USD", readOnly: true and exactProduct: {"quantity":"quantity","rate":"rate","rounding":"half-away-from-zero"}. The server stores integer cents atomically with each operand change. Omit the derived key from writes. Clearing either operand clears the amount. This policy rounds each Record separately, including signed quantities. Confirm the rounding boundary and authoritative inputs before applying it to billing.

Read rows and run widgets

Resolve a relation target

The target must be in the same Space. An open Topic cannot relate into a private Topic. A private Topic may relate to itself or an open Topic. Find the target with tree query "Acme / Accounts", then query the exact Topic id:

{"verb":"query","query":{"topic":"top_accounts","filter":[{"field":"title","op":"in","value":["Example account"]}],"limit":20}}

If titles repeat, inspect candidates before writing. Use the returned Thread id as the relation value and the Topic id in the Schema's relation.topic. An inaccessible target is withheld.

To read incoming links by inverse role, use arbor thread get AXS-6 --backlinks --json or MCP thread_get with backlinks: true. Each role in record.backlinks.roles shows its visible total and up to five source Records. Continue rows by copying that role's query and putting its nextCursor in query.cursor. Continue roles by passing record.backlinks.nextCursor as backlinkCursor (CLI --backlink-cursor).

Import new Records from CSV or JSON

Find the destination with tree using Space / Topic. Copy the top_… id of a writable Topic with an existing Schema. This creates new Threads in that Topic's default active status.

arbor records import ./leads.csv --topic top_leads --map ./mapping.json --dry-run

For a CSV with headers Company,Amount cents,Old export ID,Stage, save this mapping as mapping.json:

{"Company":"title","Amount cents":"budget","Old export ID":null}

Other columns match field keys first, then case-insensitive keys or labels. A populated column with no unique writable match makes the row invalid. Use null in the mapping to deliberately ignore a column. Supply a title and an objective unless the Schema makes objectives optional. Empty cells use Schema defaults. In a JSON array of row objects, omit a key to use its default or send null to leave it empty.

Use select option values, true or false for booleans, integer minor units for currency, YYYY-MM-DD for dates, and existing Thread or Profile IDs for relations or people. Use a JSON array of strings for multiselect and multi-value IDs, including inside a quoted CSV cell. Status, computed, disabled and other read-only fields cannot be imported.

Schema art_leads version 3
  "Company" → title
  "Amount cents" → budget
  "Old export ID" → ignored
  "Stage" → stage
Up to 1 would be created (1 invalid). Previously imported rows replay.
  Row 2: stage: Use one option value: "warm", "cold".

After preview, remove --dry-run to create Records. Add --schema-artifact-id art_leads --schema-version 3 to require the previewed Schema. Use --json for all row receipts. CLI validates or writes in batches and exits nonzero if any row fails, with the result in data.

Over MCP, call record with verb: "importRows" and up to 10 structured rows. No local path is required. Use dryRun: true to preview, then send the same input with dryRun: false to execute:

{"verb":"importRows","topicId":"top_leads","idempotencyKey":"leads-2026-11","schemaArtifactId":"art_leads","schemaVersion":3,"dryRun":true,"mapping":{"Company":"title"},"rows":[{"Company":"Meyer, Inc.","budget":12550,"Stage":"warm"}]}

Every row commits independently. Keep the import key, actor, Topic and source positions when retrying. For subsequent MCP batches, set offset to the number of preceding source rows. Replay exact rows after response loss, or correct rows confirmed invalid in place. A changed successful row conflicts. The CLI defaults to a key derived from the absolute file path. Set --idempotency-key explicitly to resume from another path or intentionally start a separate import. If the Schema changed after some rows succeeded, reconcile the receipts before importing the remaining rows under the new version.

Write fields and reconcile

Use CLI thread update or MCP thread_update with values, the Schema id and version, a stable idempotencyKey, and baseRevision from revisions[threadId] in a row query or thread.fieldRevision in a Thread read. For a stale revision, reread the row and reconcile the draft before retrying with a new key. For a stale Schema, refresh definitions first.

For record setFieldsMany, pass one field in --values and one JSON array in --items. Check each results[].ok and retry only failed rows after resolving their refusals.

Distinguish edit failures

Replay an idempotency key only with its original payload after response loss. A reconciled or corrected payload is a new logical write and needs a new key.

Formulas, dates, limits