Files
mesh-contracts/seats/node-backup/seat.json
T
jschoubben d86a46e5d8 C7: node-backup backs up and restores a module's kept data on the bus: aside, discard-aside, ended and restored
now, restore and aside are of class act; discard-aside is the operator's alone; ended and restored carry the
node, module and kept data in their subject and the module, kept data, form, fingerprint and outcome.

Builds: design 47 G §296, §297, §302, §405

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
2026-11-11 10:40:23 +01:00

291 lines
8.4 KiB
JSON

{
"format": 1,
"seat": "node-backup",
"scope": "node",
"grain": "seat-list",
"domain": "Data",
"decision": "novox/hq ADR 0214",
"verbs": [
{
"name": "backed-up",
"description": "What this machine backs up: each module, what it declared, its last good night, how many restore points are kept and the repository's size. Also each module's restore points of its kept data on the bus (the kept data, the form, the fingerprint each was taken before) and the data set aside at each restore, with its size.",
"replaces": [
"restic snapshots"
],
"input": {
"properties": {
"module": {
"description": "one module (optional)",
"type": "string"
}
},
"type": "object"
}
},
{
"name": "now",
"description": "Take a backup now, of one module or of every module on this machine — before a migration, a retirement or anything else that could go wrong. With kept, a restore point of one kept data on the bus instead, said by the event ended.",
"replaces": [
"restic backup"
],
"input": {
"properties": {
"module": {
"description": "one module (optional)",
"type": "string"
},
"kept": {
"type": "string",
"description": "one kept data of the module on the bus, its local name: its restore point is taken by the bus module's account, of the node holding mesh-broker"
},
"form": {
"type": "integer",
"description": "with kept: its form now"
},
"fingerprint": {
"type": "string",
"description": "with kept: the fingerprint the restore point is taken before"
},
"catch-up": {
"type": "object",
"description": "with kept: the catch-up tool the newer manifest declares beside it and its arguments whole, recorded in the restore point (design 47 G 299, 406)",
"properties": {
"tool": {
"type": "string"
},
"arguments": {
"type": "object"
}
},
"required": [
"tool"
]
}
},
"type": "object"
},
"class": "act"
},
{
"name": "restore",
"description": "Restore one module's data from a restore point BESIDE the live data, never over it: each directory as <path>.restored-<date>. Swapping it in is a person's act. Lists the restore points when none is named. With kept, the restore point of one kept data on the bus by its module, kept data and form, the live data set aside and never removed, said by the event restored.",
"replaces": [
"restic restore"
],
"input": {
"properties": {
"module": {
"description": "the module",
"type": "string"
},
"path": {
"description": "one of the module's directories (all of them when omitted)",
"type": "string"
},
"snapshot": {
"description": "the restore point (from `backed-up`; the newest when omitted)",
"type": "string"
},
"kept": {
"type": "string",
"description": "one kept data of the module on the bus, its local name: its restore point is taken by the bus module's account, of the node holding mesh-broker"
},
"form": {
"type": "integer",
"description": "with kept: its form now"
},
"fingerprint": {
"type": "string",
"description": "with kept: the fingerprint the restore point is taken before"
}
},
"required": [
"module"
],
"type": "object"
},
"class": "act"
},
{
"name": "aside",
"description": "Set one module's live kept data on the bus aside under a name of its own and restore nothing, after the node agent stopped the newer build (design 47 G 297, 405); the data set aside is listed by backed-up and removed only by discard-aside.",
"class": "act",
"input": {
"type": "object",
"properties": {
"module": {
"type": "string",
"description": "the module"
},
"kept": {
"type": "string",
"description": "one kept data of the module on the bus, its local name: its restore point is taken by the bus module's account, of the node holding mesh-broker"
},
"form": {
"type": "integer",
"description": "with kept: its form now"
},
"fingerprint": {
"type": "string",
"description": "with kept: the fingerprint the restore point is taken before"
}
},
"required": [
"module",
"kept",
"form",
"fingerprint"
]
},
"answer": {
"type": "object",
"properties": {
"aside": {
"type": "string",
"description": "the name the live data is set aside under"
},
"error": {
"type": "string",
"description": "why it failed; set alone"
}
}
}
},
{
"name": "discard-aside",
"description": "Remove data a restore set aside, on a person's call alone; writes the act, who and why in the hand-act log of the seat mesh-hand-acts.",
"callers": [
"operator"
],
"input": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "the aside's id, as backed-up lists it"
},
"why": {
"type": "string",
"description": "why"
}
},
"required": [
"id",
"why"
]
},
"class": "act"
}
],
"receives": [
{
"kind": "backup",
"comment": "#",
"dirs": true
},
{
"kind": "data",
"comment": "#",
"dirs": true
}
],
"events": [
{
"name": "ended",
"subject": "ended.<node>.<module>.<kept>",
"body": {
"type": "object",
"description": "a restore point of a kept data on the bus taken, done or failed",
"properties": {
"v": {
"type": "integer",
"description": "the layout's version"
},
"module": {
"type": "string",
"description": "the module"
},
"kept": {
"type": "string",
"description": "the kept data"
},
"form": {
"type": "integer",
"description": "its form"
},
"fingerprint": {
"type": "string",
"description": "the fingerprint"
},
"outcome": {
"enum": [
"done",
"failed"
]
},
"error": {
"type": "string",
"description": "why it failed"
}
},
"required": [
"v",
"module",
"kept",
"form",
"fingerprint",
"outcome"
]
}
},
{
"name": "restored",
"subject": "restored.<node>.<module>.<kept>",
"body": {
"type": "object",
"description": "a kept data on the bus restored from its restore point beside the live data, done or failed",
"properties": {
"v": {
"type": "integer",
"description": "the layout's version"
},
"module": {
"type": "string",
"description": "the module"
},
"kept": {
"type": "string",
"description": "the kept data"
},
"form": {
"type": "integer",
"description": "its form"
},
"fingerprint": {
"type": "string",
"description": "the fingerprint"
},
"outcome": {
"enum": [
"done",
"failed"
]
},
"error": {
"type": "string",
"description": "why it failed"
}
},
"required": [
"v",
"module",
"kept",
"form",
"fingerprint",
"outcome"
]
}
}
]
}