Skip to content

mesh.handover.publish

Publish a handover record of this checkout — the newest, or the one named under .ai/local/state/handovers/ — to every linked runtime: its task, branch, head and time from its front matter, the issue and milestone given, and its Markdown body, bounded and identified by the body's digest. No path of this machine travels, and no file outside the handovers directory is ever read.

Publish a handover record of this checkout — the newest, or the one named under .ai/local/state/handovers/ — to every linked runtime: its task, branch, head and time from its front matter, the issue and milestone given, and its Markdown body, bounded and identified by the body's digest. No path of this machine travels, and no file outside the handovers directory is ever read.

  • command
  • experimental
  • module mesh
  • #mesh
  • #continuity
  • #cooperation

Exposure

Where this one definition is reachable. Absence is explicit: a surface not listed does not carry it.

surfaceas
MCPtool majordomus_mesh_handover_publish
HTTPPOST /api/v1/mesh/handovers operationId mesh.handover.publish
command line—

Schemas

The canonical input and output, from the Rust types; the MCP tool schema and the OpenAPI parameters and responses are derived from these.

input · HandoverPublishInput

The input of mesh.handover.publish.
propertytyperequireddescription
issue string | null no The issue the handover belongs to.
milestone string | null no The milestone it belongs to.
path string | null no The record, relative to the repository root and inside .ai/local/state/handovers/; the newest record when omitted. Nothing outside that directory is ever read by this command.
JSON Schema
{
  "additionalProperties": false,
  "description": "The input of `mesh.handover.publish`.",
  "properties": {
    "issue": {
      "description": "The issue the handover belongs to.",
      "type": [
        "string",
        "null"
      ]
    },
    "milestone": {
      "description": "The milestone it belongs to.",
      "type": [
        "string",
        "null"
      ]
    },
    "path": {
      "description": "The record, relative to the repository root and inside\n`.ai/local/state/handovers/`; the newest record when omitted. Nothing outside that\ndirectory is ever read by this command.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "title": "HandoverPublishInput",
  "type": "object"
}

output · Written

What an operation wrote, as its answer to the caller. Every mesh operation is an event appended to this runtime's journal, and the caller is handed the three facts it cannot work out for itself: the mesh-wide key of the thing it created, the event that says so, and the Lamport stamp that places it against everyone else's events.

The key is what a later operation is addressed by — a claim is released by the key its acquisition returned, never by the local name it was given — and the stamp is what a caller waiting for a peer to catch up compares against.

#### use std::sync::Arc;
#### use majordomus_cli::mesh::config::{CooperationConfig, TrustConfig};
#### use majordomus_cli::mesh::cooperation::{CheckoutFacts, Cooperation, CooperationSetup};
#### use majordomus_cli::mesh::identity::NodeIdentity;
#### use majordomus_cli::mesh::link::HttpTransport;
#### use majordomus_cli::mesh::registry::MeshRegistry;
#### use majordomus_cli::mesh::repository::of_root_commits;
#### let cooperation = Cooperation::new(CooperationSetup {
####     identity: Arc::new(NodeIdentity::ephemeral().unwrap()), runtime: "0000000000000001".into(),
####     repository: of_root_commits(&["root".into()]), endpoints: vec!["127.0.0.1:9".into()],
####     version: "doc".into(), config: CooperationConfig::default(), trust: TrustConfig::default(),
####     journal_path: None, registry: Arc::new(MeshRegistry::new()),
####     transport: Arc::new(HttpTransport), board: None, checkout: CheckoutFacts::default(),
#### }).unwrap();
use majordomus_cli::mesh::cooperation::Written;
use majordomus_cli::mesh::journal::{ClaimMode, Durability, SessionInfo};

let session = SessionInfo::named("s1", "cli");
let written: Written = cooperation
    .claim(&session, vec!["docs".into()], None, ClaimMode::Advisory, None)
    .unwrap();
assert!(written.lamport > 0, "placed against every other runtime's events");
assert_eq!(written.durability, Durability::Memory, "this journal has no file");

// and the key it returned is how the claim is addressed from here on
cooperation.release(&written.key).unwrap();
propertytyperequireddescription
durability reference no Whether the event reached this machine's disk: synced, memory (a journal with no file, by configuration), or not_durable — held and replicated to peers, not on disk here, and not acknowledged as durable. unknown from an executable that predates it. default "unknown"
event string yes <stream>/<seq> of the event that says so.
key string yes <stream>/<local id> of what was created or changed.
lamport integer yes The event's Lamport stamp.
JSON Schema
{
  "$defs": {
    "Durability": {
      "description": "Whether an event this runtime wrote reached this machine's disk: what an append\nacknowledges, and the only thing a caller may say about it.\n\n```\nuse majordomus_cli::mesh::journal::Durability;\nassert_eq!(serde_json::to_value(Durability::NotDurable).unwrap(), \"not_durable\");\nassert_eq!(Durability::default(), Durability::Unknown, \"an answer that did not say\");\nassert!(Durability::Synced.is_on_disk() && !Durability::NotDurable.is_on_disk());\n```",
      "oneOf": [
        {
          "const": "synced",
          "description": "Appended to the journal file and synced (`fsync` of its data) before the append\nreturned.",
          "type": "string"
        },
        {
          "const": "memory",
          "description": "The journal has no file: it lives in memory and its peers, by configuration.",
          "type": "string"
        },
        {
          "const": "not_durable",
          "description": "The write to the journal file failed. The event is held in memory and replicated to\npeers, and is lost to this machine when the runtime restarts unless a peer still holds\nit. It is not acknowledged as durable.",
          "type": "string"
        },
        {
          "const": "unknown",
          "description": "Not reported: an answer from an executable that predates this field.",
          "type": "string"
        }
      ]
    }
  },
  "description": "What an operation wrote, as its answer to the caller. Every mesh operation is an event\nappended to this runtime's journal, and the caller is handed the three facts it cannot\nwork out for itself: the mesh-wide key of the thing it created, the event that says so,\nand the Lamport stamp that places it against everyone else's events.\n\nThe key is what a later operation is addressed by — a claim is released by the key its\nacquisition returned, never by the local name it was given — and the stamp is what a\ncaller waiting for a peer to catch up compares against.\n\n```\n# use std::sync::Arc;\n# use majordomus_cli::mesh::config::{CooperationConfig, TrustConfig};\n# use majordomus_cli::mesh::cooperation::{CheckoutFacts, Cooperation, CooperationSetup};\n# use majordomus_cli::mesh::identity::NodeIdentity;\n# use majordomus_cli::mesh::link::HttpTransport;\n# use majordomus_cli::mesh::registry::MeshRegistry;\n# use majordomus_cli::mesh::repository::of_root_commits;\n# let cooperation = Cooperation::new(CooperationSetup {\n#     identity: Arc::new(NodeIdentity::ephemeral().unwrap()), runtime: \"0000000000000001\".into(),\n#     repository: of_root_commits(&[\"root\".into()]), endpoints: vec![\"127.0.0.1:9\".into()],\n#     version: \"doc\".into(), config: CooperationConfig::default(), trust: TrustConfig::default(),\n#     journal_path: None, registry: Arc::new(MeshRegistry::new()),\n#     transport: Arc::new(HttpTransport), board: None, checkout: CheckoutFacts::default(),\n# }).unwrap();\nuse majordomus_cli::mesh::cooperation::Written;\nuse majordomus_cli::mesh::journal::{ClaimMode, Durability, SessionInfo};\n\nlet session = SessionInfo::named(\"s1\", \"cli\");\nlet written: Written = cooperation\n    .claim(&session, vec![\"docs\".into()], None, ClaimMode::Advisory, None)\n    .unwrap();\nassert!(written.lamport > 0, \"placed against every other runtime's events\");\nassert_eq!(written.durability, Durability::Memory, \"this journal has no file\");\n\n// and the key it returned is how the claim is addressed from here on\ncooperation.release(&written.key).unwrap();\n```",
  "properties": {
    "durability": {
      "$ref": "#/$defs/Durability",
      "default": "unknown",
      "description": "Whether the event reached this machine's disk: `synced`, `memory` (a journal with no\nfile, by configuration), or `not_durable` — held and replicated to peers, not on disk\nhere, and not acknowledged as durable. `unknown` from an executable that predates it."
    },
    "event": {
      "description": "`<stream>/<seq>` of the event that says so.",
      "type": "string"
    },
    "key": {
      "description": "`<stream>/<local id>` of what was created or changed.",
      "type": "string"
    },
    "lamport": {
      "description": "The event's Lamport stamp.",
      "format": "uint64",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "key",
    "event",
    "lamport"
  ],
  "title": "Written",
  "type": "object"
}

Policies

benchmark
waived — waived: transient_state
cache
disabled — every call runs the handler

Benchmark targets

Derived from the registry for this repository: one requirement per transport, and the cases the input type provides. The whole matrix is on the benchmarks page.

transportstatecasestargets
directwaived (transient_state)0
mcpwaived (transient_state)0
httpwaived (transient_state)0

Searches the titles and descriptions of every page this site publishes.