Page kind: Reference
land_check#
Says what landing changes (1 to 32, each a head with an optional base and idempotency_key) in order onto target, main by default, would come to, each merged onto what the clean ones before it make, as land would land them one after another: clean (the root tree it lands and the paths it changes), replayed, nothing_to_land, or conflict (land's E_CONFLICT report). Writes nothing. Land with expect_target set to onto to land what it found, or nothing.
- Since
0.11.0- Mutates
- no
- Identity required
- no
- Envelope op
land_check- Cli command
swarmops land-check- Request type
LandCheckReq- Annotations
{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true}- Max result chars
null- CLI command
swarmops land-check
Input schema#
arguments is a LandCheckReq: swarmops schema LandCheckReq prints the type. A field the type does not know is ignored.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
changes | array of object | yes | The changes, in the order they would land: 1 to 32 (E_INVALID_ARG for none, E_TOO_LARGE past 32), each key once. | |
max_conflict_bytes | integer | no | 32768 | The most bytes of hunk text each conflicting change's report carries, as a land's. |
target | string | no | "main" | The ref the changes would land on: main or release/<name>, which must exist. |
JSON Schema#
As tools/list gives it: each $ref replaced by its definition, so that it stands alone.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "`land_check` (CLI `land --dry-run`, `land-check`): what landing `changes`, in order, onto\n`target` would come to, each after the clean ones before it, as `land` would land them one\nafter another. It writes nothing and takes no lock. A head or base not found, a base that\nis no ancestor, a merge in a chain or a key used for another change fails the whole check,\nas it fails a land.",
"properties": {
"changes": {
"description": "The changes, in the order they would land: 1 to 32 (`E_INVALID_ARG` for none,\n`E_TOO_LARGE` past 32), each key once.",
"items": {
"description": "One change of a `land_check`: as `land` takes it.",
"properties": {
"base": {
"anyOf": [
{
"description": "A revision as the caller wrote it, for the store to resolve: a ref name (`main`,\n`release/1.2`), a full 64-hex changeset id or a unique prefix of at least 12 hex digits, or a\nref's earlier value: `<ref>@{N}` the value it held N moves before its current one (`@{0}`\nis the current value), `<ref>@{at=<unix seconds>}` the value set by its newest move\nrecorded at or before that instant (the writer's clock, moves read in journal order);\noptionally followed by `~N` for the N-th first-parent ancestor.",
"type": "string"
},
{
"type": "null"
}
],
"description": "Where the change starts, as a land's `base`. When omitted, the merge base of `head` and\nthe target's head, along first parents."
},
"head": {
"description": "The change's head. A revision as the caller wrote it, for the store to resolve: a ref name (`main`,\n`release/1.2`), a full 64-hex changeset id or a unique prefix of at least 12 hex digits, or a\nref's earlier value: `<ref>@{N}` the value it held N moves before its current one (`@{0}`\nis the current value), `<ref>@{at=<unix seconds>}` the value set by its newest move\nrecorded at or before that instant (the writer's clock, moves read in journal order);\noptionally followed by `~N` for the N-th first-parent ancestor.",
"type": "string"
},
"idempotency_key": {
"description": "The change's land key, as a land's: one the target holds a land of is `replayed`.",
"type": [
"string",
"null"
]
},
"message": {
"description": "The landed changeset's message, as a land's; a check does not use it.",
"type": [
"string",
"null"
]
}
},
"required": [
"head"
],
"type": "object"
},
"type": "array"
},
"max_conflict_bytes": {
"default": 32768,
"description": "The most bytes of hunk text each conflicting change's report carries, as a land's.",
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"target": {
"default": "main",
"description": "The ref the changes would land on: `main` or `release/<name>`, which must exist.",
"type": "string"
}
},
"required": [
"changes"
],
"title": "LandCheckReq",
"type": "object"
}Annotations#
It only reads the store.
| Annotation | Value | Meaning |
|---|---|---|
destructiveHint | false | True: a tool that changes the store may overwrite or delete what is there, not only add to it. |
idempotentHint | true | True: calling it again with the same arguments changes nothing more. |
openWorldHint | false | True: it reaches beyond a closed set of things. Every tool here stays inside the store. |
readOnlyHint | true | True: the tool does not change its environment, the store. |
Its entry in tools/list carries no _meta.
CLI command#
swarmops land-check runs the same operation and prints the same envelope.
Examples#
{
"id": 13,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"changes": [
{
"head": "[head]"
}
]
},
"name": "land_check"
}
}{
"id": 13,
"jsonrpc": "2.0",
"result": {
"content": [
{
"text": "{\"api\":1,\"meta\":{\"auth\":\"trust\",\"elapsed_ms\":\"[elapsed_ms]\",\"repo\":\"[tmp]/store\",\"resolved\":{\"[head]\":\"[head]\",\"main\":\"[theirs]\"}},\"ok\":true,\"op\":\"land_check\",\"result\":{\"items\":[{\"head\":\"[head]\",\"outcome\":\"clean\",\"paths\":[{\"change\":\"modified\",\"path\":\"src/lib.rs\"}],\"root\":\"[id5]\"}],\"onto\":\"[theirs]\"}}",
"type": "text"
}
],
"isError": false,
"structuredContent": {
"api": 1,
"meta": {
"auth": "trust",
"elapsed_ms": "[elapsed_ms]",
"repo": "[tmp]/store",
"resolved": {
"[head]": "[head]",
"main": "[theirs]"
}
},
"ok": true,
"op": "land_check",
"result": {
"items": [
{
"head": "[head]",
"outcome": "clean",
"paths": [
{
"change": "modified",
"path": "src/lib.rs"
}
],
"root": "[id5]"
}
],
"onto": "[theirs]"
}
}
}
}The server ran as swarmops mcp --repo [tmp]/store --as agent/worker-17, after initialize. Recorded by the MCP tests. A name in square brackets, such as [tmp] or [c1], stands for what differs from run to run: the test's temporary directory, an id, a time, the version.
Return information#
A tool result: the envelope, whose op is land_check, as structuredContent and again as the text of its one content block. isError is true exactly when the envelope's ok is false. On success the envelope's result is what swarmops land-check returns.
Errors#
A failed call is a tool result with isError: true; the envelope's error.code is one of the error codes.
- E_INVALID_ARG: arguments that do not fit
LandCheckReq, a field named twice among them included, or that break one of the server's own rules. - E_NOT_A_REPO: the server's store is not there; the server serves on.
- E_INTERNAL: the operation panicked, a bug.
Then the errors of the operation, as swarmops land-check lists them.
See also#
gc
Removes the store's leftovers (temp files past a day, a crashed create's staging, derived values of older versions, what an upgrade left) and never an object…
land_group
Lands changes (1 to 32, each a head with an optional base and idempotency\_key) in order onto target, main by default, as one operation: each merged onto what…