Skip to content
Cockpit0.29.0
A snapshot: read at commit 707a04c7ce8 on 2026-10-18T00:06:01Z by majordomus 0.29.0. Nothing on this page is read again. See it live

continuity.sync

Exchange published handovers with a git remote

What it is

Fetches the remote's refs/majordomus/continuity, merges it into the local store as the union of both (records are content-addressed, so a name holding different bytes is reported and the local copy kept), and pushes the result, never forced. Reports each line as equal, remote_newer, local_newer, diverged, local_only or remote_only. An unreachable remote changes nothing and leaves what is pending pending.

Descriptor

Canonical id
continuity.sync
Module
continuity
Kind
command
Stability
experimental
Provenance
declared
Source
apps/majordomus-cli/src/capability/builtin/continuity.rs
Cache
disabled
Benchmark
waived: external_dependency
Tags
continuityhandoverdevices

Run

command
A command that writes the repository. It changes tracked files a commit will carry, and is sent as a POST from this page's origin.

The git remote; the current branch's, else `origin`, when absent.

POST /api/v1/continuity/sync

Projections

InterfaceAsWhere
MCP toolmajordomus_continuity_sync-
MCP resourcenot exposed-
HTTPPOST /api/v1/continuity/syncSwagger
Command linemajordomus continuity sync-

Schemas

Input · SyncInput
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "remote": {
      "type": [
        "string",
        "null"
      ],
      "description": "The git remote; the current branch's, else `origin`, when absent."
    }
  },
  "description": "The input of `continuity.sync`.",
  "title": "SyncInput"
}
Output · Synced
{
  "type": "object",
  "properties": {
    "remote": {
      "type": [
        "string",
        "null"
      ],
      "description": "The remote, when there is one."
    },
    "action": {
      "$ref": "#/$defs/SyncAction",
      "description": "What happened."
    },
    "fetched": {
      "type": "integer",
      "format": "uint",
      "minimum": 0,
      "description": "Records the local store gained."
    },
    "published": {
      "type": "integer",
      "format": "uint",
      "minimum": 0,
      "description": "Records the remote gained."
    },
    "lines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LineSyncView"
      },
      "description": "Every line either side holds, compared."
    },
    "store": {
      "$ref": "#/$defs/StoreView",
      "description": "The store after the sync."
    },
    "resumable": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RecordView"
      },
      "description": "What other devices published that this checkout could resume."
    },
    "diagnostics": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Diagnostic"
      },
      "description": "Refused files, collisions, diverged lines, an unreachable remote."
    }
  },
  "required": [
    "action",
    "fetched",
    "published",
    "lines",
    "store",
    "resumable",
    "diagnostics"
  ],
  "description": "The answer of `continuity sync`.",
  "title": "Synced",
  "$defs": {
    "SyncAction": {
      "oneOf": [
        {
          "type": "string",
          "const": "none",
          "description": "Nothing to move: both held the same records."
        },
        {
          "type": "string",
          "const": "fetched",
          "description": "Records were fetched."
        },
        {
          "type": "string",
          "const": "published",
          "description": "Records were published."
        },
        {
          "type": "string",
          "const": "exchanged",
          "description": "Both."
        },
        {
          "type": "string",
          "const": "unreachable",
          "description": "The remote could not be reached; nothing local changed, and what is pending stays\npending."
        },
        {
          "type": "string",
          "const": "no_remote",
          "description": "No remote is configured."
        }
      ],
      "description": "What a sync did."
    },
    "LineSyncView": {
      "type": "object",
      "properties": {
        "line": {
          "type": "string",
          "description": "The line."
        },
        "relation": {
          "$ref": "#/$defs/LineSync",
          "description": "How the local store and the remote's stood before the merge."
        },
        "heads": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The line's heads after the merge."
        }
      },
      "required": [
        "line",
        "relation",
        "heads"
      ],
      "description": "One line's comparison in a sync."
    },
    "LineSync": {
      "oneOf": [
        {
          "type": "string",
          "const": "equal",
          "description": "Both hold the same heads."
        },
        {
          "type": "string",
          "const": "remote_newer",
          "description": "The remote holds records that continue the local heads: fetching brings them."
        },
        {
          "type": "string",
          "const": "local_newer",
          "description": "The local store holds records that continue the remote's: publishing sends them."
        },
        {
          "type": "string",
          "const": "diverged",
          "description": "Each holds a continuation the other lacks: after merging, the line has two heads."
        },
        {
          "type": "string",
          "const": "local_only",
          "description": "Only the local store holds the line."
        },
        {
          "type": "string",
          "const": "remote_only",
          "description": "Only the remote holds the line."
        }
      ],
      "description": "How the local store and a remote's stand towards each other, for one line."
    },
    "StoreView": {
      "type": "object",
      "properties": {
        "reference": {
          "type": "string",
          "description": "The local ref."
        },
        "tip": {
          "type": [
            "string",
            "null"
          ],
          "description": "Its commit."
        },
        "remote": {
          "type": [
            "string",
            "null"
          ],
          "description": "The remote `sync` uses."
        },
        "remote_tip": {
          "type": [
            "string",
            "null"
          ],
          "description": "The commit last fetched from or pushed to it."
        },
        "sync": {
          "$ref": "#/$defs/SyncState",
          "description": "How they stand."
        },
        "records": {
          "type": "integer",
          "format": "uint",
          "minimum": 0,
          "description": "Records admitted."
        },
        "refused": {
          "type": "integer",
          "format": "uint",
          "minimum": 0,
          "description": "Files refused."
        }
      },
      "required": [
        "reference",
        "sync",
        "records",
        "refused"
      ],
      "description": "The two stores, as refs."
    },
    "SyncState": {
      "oneOf": [
        {
          "type": "string",
          "const": "no_remote",
          "description": "No remote is configured: the store is local, and that is a valid answer."
        },
        {
          "type": "string",
          "const": "never_synced",
          "description": "Never synced with the remote."
        },
        {
          "type": "string",
          "const": "in_sync",
          "description": "Both hold the same records."
        },
        {
          "type": "string",
          "const": "pending",
          "description": "This store holds records the remote has not received: a sync publishes them."
        },
        {
          "type": "string",
          "const": "behind",
          "description": "The last fetch brought records not merged yet."
        },
        {
          "type": "string",
          "const": "diverged",
          "description": "Both of the above."
        },
        {
          "type": "string",
          "const": "empty",
          "description": "The store is empty and nothing was ever fetched."
        }
      ],
      "description": "How the local store stands towards the remote's, from the refs alone — no network."
    },
    "RecordView": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The record id."
        },
        "line": {
          "type": "string",
          "description": "Its line."
        },
        "parent": {
          "type": [
            "string",
            "null"
          ],
          "description": "The record it continues."
        },
        "device": {
          "$ref": "#/$defs/Device",
          "description": "The device that published it."
        },
        "this_device": {
          "type": "boolean",
          "description": "Whether that device is this one."
        },
        "trust": {
          "$ref": "#/$defs/Trust",
          "description": "Whether its signer is trusted here."
        },
        "session": {
          "type": [
            "string",
            "null"
          ],
          "description": "The episode it was published from."
        },
        "branch": {
          "type": [
            "string",
            "null"
          ],
          "description": "The branch it was written on."
        },
        "head": {
          "type": [
            "string",
            "null"
          ],
          "description": "The commit it was written at."
        },
        "working_tree": {
          "$ref": "#/$defs/WorkingTree",
          "description": "Clean or dirty at the origin."
        },
        "changed_total": {
          "type": "integer",
          "format": "uint",
          "minimum": 0,
          "description": "How many paths differed from HEAD at the origin."
        },
        "published_at": {
          "type": "string",
          "description": "When it was published, by the publisher's clock."
        },
        "age_minutes": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int64",
          "description": "Minutes since then, by this machine's clock; absent when either clock's reading is\nunusable."
        },
        "task": {
          "type": [
            "string",
            "null"
          ],
          "description": "The task's title: the intent."
        },
        "issue": {
          "type": [
            "string",
            "null"
          ],
          "description": "The issue."
        },
        "objective": {
          "type": "string",
          "description": "The handover's `# Objective`, first line."
        }
      },
      "required": [
        "id",
        "line",
        "device",
        "this_device",
        "trust",
        "working_tree",
        "changed_total",
        "published_at"
      ],
      "description": "One record as every surface shows it."
    },
    "Device": {
      "type": "object",
      "properties": {
        "node": {
          "type": "string",
          "description": "The node id: the first 32 hex of the SHA-256 of the device's Ed25519 public key."
        },
        "label": {
          "type": "string",
          "description": "The display label of the device's identity file (`macbook-pro`), or the first eight\nhex of its node id when it has none."
        }
      },
      "required": [
        "node",
        "label"
      ],
      "description": "The device a record was written on: the mesh node key's id and the label its identity\nfile carries. The label is presentation; the node id is identity."
    },
    "Trust": {
      "oneOf": [
        {
          "type": "string",
          "const": "this_device",
          "description": "This device signed it."
        },
        {
          "type": "string",
          "const": "trusted",
          "description": "The mesh declaration's trust list admits the key."
        },
        {
          "type": "string",
          "const": "untrusted",
          "description": "The mesh declaration exists and does not admit the key: never resumed from."
        },
        {
          "type": "string",
          "const": "undeclared",
          "description": "The repository declares no mesh, so no list exists to check the key against. The\nsignature still binds the record to its key; the plan warns."
        }
      ],
      "description": "Whether the device that signed a record is one this repository trusts."
    },
    "WorkingTree": {
      "oneOf": [
        {
          "type": "string",
          "const": "clean",
          "description": "Nothing outside HEAD."
        },
        {
          "type": "string",
          "const": "dirty",
          "description": "Modified, staged or untracked files that HEAD does not hold."
        }
      ],
      "description": "Whether the working tree had changes git does not hold in a commit."
    },
    "Diagnostic": {
      "type": "object",
      "properties": {
        "severity": {
          "$ref": "#/$defs/Severity",
          "description": "How bad."
        },
        "code": {
          "type": "string",
          "description": "A stable machine-readable code, e.g. `unknown_key`, `duplicate_identity`."
        },
        "path": {
          "type": [
            "string",
            "null"
          ],
          "description": "Repository-relative path of the file concerned, when there is one."
        },
        "message": {
          "type": "string",
          "description": "What is wrong, for a person; the code is for a program."
        }
      },
      "required": [
        "severity",
        "code",
        "message"
      ],
      "description": "One finding about the declarative state, named by a stable code, tied to a path where\nthere is one, and carrying the command that reproduces it where there is one."
    },
    "Severity": {
      "oneOf": [
        {
          "type": "string",
          "const": "info",
          "description": "Worth knowing; changes nothing."
        },
        {
          "type": "string",
          "const": "warning",
          "description": "Something to look at; the object is still served."
        },
        {
          "type": "string",
          "const": "error",
          "description": "The file is excluded and the index is degraded."
        }
      ],
      "description": "How bad a diagnostic is. `Error` excludes the file it concerns from the index and puts\nthe index into the degraded state; `Warning` and `Info` do neither."
    }
  }
}

Examples

These are the capability's own benchmark cases: the same inputs the benchmark runs and the OpenAPI document shows.

default
{}