Management API
The management API is a small HTTP service that runs beside a Node on the same appliance.
What it does
- Reports what the Node is running and what is waiting to run.
- Shows the staged config with its secrets redacted, and checks a config without applying it.
- Fetches a new config from the configured repository and stages it.
- Reads the Activity Log.
- Lists the identity matches waiting for a person.
- Lets a reviewer approve, reject or edit the records a drafting Task leaves for a person to decide, and confirm, reject or re-open an identity match.
It is a separate process from the Node. It starts, answers and stays up with the Node stopped, with no database or broker configured. Only the Activity Log routes, the sign-off and identity-match routes, and sync need the database.
On a site with several nodes, an administrator revokes a token on every node with the cascade tool (see Revocations across nodes).
The documents scope opens the four document routes (see Documents) and no other scope opens them. It cannot read a sign-off record or approve one, read or stage a config, or read the Activity Log.
What it is not
It never edits a config or writes one it has not validated. It never starts, stops or restarts the Node: a restart, done at the operating-system level by whoever runs the appliance, is what makes the Node load the staged config. None of its routes runs anything on the Node.
Three routes change the staged config:
POST /v1/config/synctakes a ref and fetches the file from the repository itself.POST /v1/config/bundletakes a whole file built from a repository ref, which a person carried in because the appliance cannot reach the repository, and runs it through the same validation.POST /v1/config/rollbackputs back the one config the staged one replaced.
None of them commits or pushes: the appliance has no repository credentials of its own to write with.
The other routes that change anything are the four decisions, the document queue routes, token rotation and the two revoke routes. Each leaves an Activity Log entry, and the document routes also queue a call for the Node to ingest. A config check writes its Activity Log entry too.
- A sign-off decision writes a record's status (and its successor).
- An identity-match decision writes the match's status. When it confirms an inferred match, it also merges the match's attributes onto the existing record it was matched to. The Node reads that record, so what the Node answers about it changes with it.
- Re-opening a rejected match makes a new pending one and moves the reference the rejected one held to it.
It has no interactive documentation pages. Its one description is GET /v1/openapi.json. Its open routes are the four pages (/ui, /ui/tokens, /ui/trail, /ui/config), which hold no data.
The three config states
| State | Where it lives | How it changes |
|---|---|---|
| In the repository | The configured repository, at the configured path and ref | By whoever maintains the site's config |
| Staged | staged/ inside the service's state directory, with the one config it replaced in staged/prior/ |
Only by POST /v1/config/sync, which fetches, decrypts and validates a candidate and stages it if it is valid; by POST /v1/config/bundle, which does the same for a file carried in; and by POST /v1/config/rollback, which swaps the staged config with the prior one |
| Running | In the Node's memory, loaded from the staged file when it started | Only by restarting the Node |
GET /v1/status shows the staged and running states side by side, and restart_required says
whether they differ. A sync never changes the running state.
A fourth thing sits beside them and is none of the three: the draft, a config being worked on at the
appliance, kept in one slot under draft/ in the state directory. The Node never reads it and a sync never
touches it. It becomes the staged config only when POST /v1/config/draft/stage stages it, and it reaches the
repository only when an integrator commits what GET /v1/config/draft/export hands out: the appliance never
commits or pushes. See The draft.
Setup and the commands in this document
Every command below runs as written once these three lines have been run in the same shell. They
read the address and the token file from the environment, with the defaults the appliance install
uses, and api sends the token with every call without putting it on a command line (where
ps would show it).
BASE=${KINDRED_MANAGEMENT_URL:-http://127.0.0.1:8470}
TOKEN_FILE=${KINDRED_MANAGEMENT_TOKEN_FILE:-$HOME/.config/kindred/management-token}
api() { curl -sS --fail-with-body --config <(printf 'header = "Authorization: Bearer %s"\n' "$(cat "$TOKEN_FILE")") "$@"; }
The token file here is the caller's file: it holds one token's plaintext, mode 0600. It is not
the service's token file, which holds only hashes (see Tokens). jq is used to shape
the answers.
deployment/kindred_management.sh does the same for the common calls, so an operator need not type
the address or the token. It reads the same two variables, refuses a token file that anyone else can
read, never prints the token, and rotates the token it holds when
fewer than 30 days of it are left:
deployment/kindred_management.sh status | jq '{restart_required, node}'
{"restart_required": false, "node": "running"}
The wrapper's other commands are config, validate-file, validate-ref REF, validate-body FILE,
sync [REF], check [REF], activity-log [NAME=VALUE ...], signoffs [NAME=VALUE ...],
signoff ID, identity-matches [NAME=VALUE ...], alerts [NAME=VALUE ...], alerts-count, alert ID,
trail ORDER_ID [NAME=VALUE ...], genealogy ORDER_ID [NAME=VALUE ...] and openapi. It is a shell script over curl;
there is no separate command-line program.
The three review commands (signoffs, signoff and identity-matches) need a token carrying
signoff, and they only read: signoffs and identity-matches take the same filters
as the routes (for example signoffs status=pending record_type=case_summary), and signoff ID shows
one record. The wrapper has no command that decides. A decision is made in the review
page or with the routes under Deciding a record, so that it
is always made with the deciding person's own token.
The three alert commands (alerts, alerts-count and alert) need a token carrying alerts, and they only
read: alerts takes the route's filters (for example alerts acknowledged=false limit=20), alerts-count
says how many alerts no one has acknowledged, and alert ID shows one. The wrapper has no command that
acknowledges. An acknowledgement is made in the review page or with the route under
Alerts, so that it is always recorded against the acknowledging person's own token.
trail and genealogy need a token carrying correlation. They take the route's parameters as
NAME=VALUE pairs (see Order trail and genealogy) and send the order id
percent-encoded.
Routes
Every route under /v1 needs a bearer token. A route's scope is the scope the token must carry.
The routes outside /v1, GET /ui, GET /ui/tokens, GET /ui/trail and GET /ui/config, are pages: a browser
navigation cannot send a token, so each page is served without one and asks for the token itself.
/ui is the review page (see The review page); /ui/tokens lists the node's
tokens and revokes one, and calls only the two admin routes below; /ui/trail looks up one order's
trail and genealogy and calls only the two order routes below; /ui/config edits and stages the node's
configuration, and calls only the config routes below (see The configuration page).
| Route | Scope | What it does |
|---|---|---|
GET /v1/status |
read |
Identity, running and staged config, restart_required, Node liveness, license state, connector health, certificate status |
GET /v1/config |
read |
The staged config, each x-sensitive value replaced by a placeholder |
POST /v1/config/validate |
read |
A verdict on the staged file, on a candidate body, or on a ref; writes nothing |
POST /v1/config/sync |
sync |
Fetches a ref, validates it and stages it if valid |
POST /v1/config/bundle |
configure |
Validates a config carried in a bundle, built on a laptop from a repository ref, and stages it if valid. See Staging a bundle |
POST /v1/config/rollback |
configure |
Swaps the staged config with the one it replaced, if that one is still valid. See Rolling back |
GET /v1/config/draft |
read |
The draft config, each credential shown as a placeholder. See The draft |
PUT /v1/config/draft |
configure |
Saves the whole draft, or starts it from the staged config or from a starting point (one read from the repository also needs sync); a credential in it is encrypted on the appliance and never returned |
DELETE /v1/config/draft |
configure |
Discards the draft and its credentials |
POST /v1/config/draft/stage |
configure |
Validates the draft as a config and stages it, as a bundle is staged. See Staging and exporting a draft |
GET /v1/config/draft/export |
configure |
The draft as one file and a patch against the staged file, for the integrator to commit; credentials only encrypted |
POST /v1/config/draft/export |
configure |
The draft as a starting-point file for the repository, with no credential in it in any form. See Starting points |
GET /v1/config/schema |
read |
A Node Type's Configuration Schema, its credential fields marked. See The Configuration Schema |
POST /v1/config/migration |
read |
Every schema problem of the staged config or the draft against the running Node Type, the version line set aside; writes nothing. See The migration read |
POST /v1/config/assist |
configure |
Turns a plain-language request into a checked change to the draft, on this site's own inference endpoint, and saves or stages it only when the request says so; 503 until the inference settings are set. See The configuration assistant |
POST /v1/config/check |
check |
Fetches a ref and tests its connectors against their targets; stages nothing |
GET /v1/activity-log |
read |
Activity Log entries, filtered and paged by cursor |
POST /v1/tokens/rotate |
any_token |
Replaces the calling token's secret under the same id and scopes, and renews its expiry; the old secret works for a short grace window. See Rotating your own token |
GET /v1/tokens/self |
any_token |
The calling token's own id and scopes, sorted, and nothing else; no Activity Log entry. The review page asks it once at sign-in. See Asking a token for its own scopes |
GET /v1/signoffs |
signoff |
Sign-off records of any status, filtered and paged by cursor |
GET /v1/signoffs/record-types |
signoff |
The distinct record types the sign-off records hold |
GET /v1/signoffs/{record_id} |
signoff |
One sign-off record, its content exactly as submitted |
POST /v1/signoffs/{record_id}/resolve |
signoff |
Approves or rejects a Pending record, recorded against the token's id |
POST /v1/signoffs/{record_id}/edit-and-resubmit |
signoff |
Supersedes a Pending record with a revised Pending successor |
POST /v1/signoffs/{record_id}/submit-as-document |
signoff |
Also needs the documents scope: the token must carry both. Queues an approved case summary, with the disposition a person writes, as a past case; see Submit an approved case summary as a document |
GET /v1/alerts |
alerts |
The alerts the Node raised, newest first, each with its acknowledgement if it has one, filtered and paged by cursor |
GET /v1/alerts/count |
alerts |
How many alerts have no acknowledgement and when the oldest was raised; null on a Node that raises none |
GET /v1/alerts/{alert_id} |
alerts |
One alert, with where its instruction is and the id of its drafted explanation |
POST /v1/alerts/{alert_id}/acknowledge |
alerts |
Records a person's disposition for an alert, against the token's id, once |
GET /v1/identity-matches |
signoff |
Pending identity records with their candidates, filtered and paged by cursor |
POST /v1/identity-matches/{match_id}/resolve |
signoff |
Confirms or rejects a Pending identity match, recorded against the token's id |
POST /v1/identity-matches/{match_id}/reopen |
signoff |
Re-opens a rejected identity match as a new Pending one that points back at it, recorded against the token's id |
POST /v1/documents |
documents |
Queues a document revision for the Node to ingest; 202 means accepted, not applied |
POST /v1/documents/deactivate |
documents |
Queues withdrawing a stored document from retrieval |
POST /v1/documents/activate |
documents |
Queues returning a deactivated document to retrieval |
GET /v1/documents/{call_id} |
documents |
What became of a document call: queued, ingested, skipped, applied or failed; never text |
GET /v1/orders/{order_id}/trail |
correlation |
An order's trail across the site's Nodes, asked of the peers as this Node; a peer that did not answer is named, never left out |
GET /v1/orders/{order_id}/genealogy |
correlation |
One page of an order's material genealogy across the site's Nodes, followed by next_after_material |
POST /v1/tokens/revoke |
admin_certificate |
An administrator's revoke of a token id on this node, authenticated by a site-CA client certificate and not by a token: takes the token out if the node holds it, retires the id, and answers what it did, for any id and any number of times. See Administrator certificates |
GET /v1/admin/tokens |
admin |
The tokens this node enforces (id, scopes, expiry) and its retired ids; no secret or hash. See Listing the node's tokens |
POST /v1/admin/tokens/{token_id}/revoke |
admin |
Revokes one token of this node and retires its id, as the revoke command does; never the caller's own. See Revoking a token from the API |
GET /v1/openapi.json |
read |
The machine-readable description of all of the above |
GET /ui |
none | The review page, one HTML document; it holds no data and calls the signoff routes above, and the rotation route, with the token its reviewer enters |
GET /ui/tokens |
none | The token administration page, one HTML document; it holds no data and calls the two admin routes above with the admin token its administrator enters |
GET /ui/trail |
none | The order trail page, one HTML document; it holds no data and calls the two order routes above with the correlation token its reader enters |
GET /ui/config |
none | The configuration page, one HTML document; it holds no data and calls the config routes above with the token its person enters: read to look, and read, configure and sync to change. See The configuration page |
Scopes
A token carries one or more scopes, fixed when it is minted. They are independent: none implies another, so a token that must do two things carries two scopes. This table is the one list of them; the rest of this document, the token scripts and the lifecycle page name a scope only to say what it is needed for.
| Scope | What it opens | Who gets it |
|---|---|---|
read |
GET /v1/status, GET /v1/config, POST /v1/config/validate (the staged file or a candidate body), GET /v1/config/draft, GET /v1/config/schema, POST /v1/config/migration, GET /v1/activity-log and GET /v1/openapi.json |
A monitoring system, and anyone who looks and changes nothing |
sync |
POST /v1/config/sync; with read, validating a ref |
Whoever stages a config |
check |
POST /v1/config/check |
Whoever tests a config's connectors against their targets |
configure |
POST /v1/config/bundle, POST /v1/config/rollback, POST /v1/config/assist and the routes that change, stage or export the draft (PUT and DELETE /v1/config/draft, POST /v1/config/draft/stage, GET and POST /v1/config/draft/export), and nothing else; it does not read the draft, so a person who also looks carries read too |
Whoever commissions or recovers the appliance. Never without an expiry. Staging a bundle or a draft is a larger power than a sync, which can only stage what the repository holds, and a credential is sent only through the draft's route, so it is a scope of its own and sync does not open it |
signoff |
The sign-off and identity-match routes, and so the review page; with documents, submitting an approved case summary as a document |
One token for each reviewer |
alerts |
The four alert routes (list, count, one alert's detail and acknowledge), and nothing else | One token for each person who acknowledges alerts; never without an expiry |
documents |
The document routes, and POST /v1/signoffs/{record_id}/submit-as-document together with signoff, and nothing else |
A document-management system, or the script that sends a site's documents |
correlation |
The two order routes (trail and genealogy), and nothing else | A person or tool that asks for an order across the site's Nodes |
admin |
GET /v1/admin/tokens and POST /v1/admin/tokens/{token_id}/revoke, and nothing else; not even GET /v1/status |
One administrator. Minted alone and never without an expiry (see Listing the node's tokens) |
Validating a ref fetches from the repository, so it needs a token carrying both read and
sync; so does starting a draft from a starting point read from the repository, which needs configure
and sync (a starting point uploaded needs configure alone). A check makes this appliance dial out to the targets a config names, so it has a scope of its
own; a token with check alone can test a ref but cannot stage one. The sign-off and identity-match
routes need signoff and nothing else opens them, a read token included: a drafted record or an
identity record can carry plant data, which a token that only monitors has no need to see. A
signoff token in turn opens no other route: it cannot sync, check, validate or read the Activity
Log.
any_token, in the route table, is not a scope a token carries: it is the rule of the two routes any
token may call, whatever scopes it carries, because each acts on the calling token alone (rotating it, and
telling it its own scopes). The description
at GET /v1/openapi.json gives it as
the route's x-required-scope.
Status
api "$BASE/v1/status" | jq '{identity, running, staged, draft, restart_required, node, license_state}'
{
"identity": {"node_type": "ERP", "node_instance_id": "erp-1", "version": "0.2.0"},
"running": {"known": true, "ref": null, "hash": "9f2c...", "started_at": "2026-10-05T08:00:00+00:00"},
"staged": {"present": true, "hash": "9f2c...", "ref": "main", "commit": "4be1...", "staged_at": "2026-10-05T08:00:00+00:00", "source": "sync", "provenance": "verified", "in_repository": true, "base": null, "prior": null, "metadata_stale": false},
"draft": null,
"restart_required": false,
"node": "running",
"license_state": "LICENSED"
}
| Field | Meaning |
|---|---|
identity |
The Node Type and instance ID, from the Node's runtime-state file, else the staged config's Node Type (each null when not known), and version, the engine package version this service imported. version is never null, and is not the Node's own report: a Node still running from before an upgrade shows the newer version until it is restarted |
running |
{known: false} when the Node has reported nothing (development, or never started); else the hash of the config it loaded, its ref when it was started from one, and when it started. A Node removes its report when it stops normally (a stop by systemctl or kill counts), so after a crash or a power loss the last report remains: read it together with node, which says not_running then |
staged |
{present: false} when nothing is staged; else the staged file's hash, the ref and commit it came from, and when. source says how it was staged: sync (this appliance fetched it), bundle (it was carried in), draft (it was made on the appliance) or rollback (the prior config was put back). provenance is verified when this appliance fetched the ref and commit itself and stated when something else claimed them and this appliance cannot check; in_repository is false for a draft made on the appliance, and for a rollback that restored one, until a sync or a bundle stages the committed config. A draft never stops a restart. prior is the config this one replaced, which a rollback would put back, as {ref, commit, source, staged_at} (null when there is none). base is the template or ref a staged draft started from, when it is known (a draft has no commit of its own). source, provenance, in_repository, base and the prior's fields are null when the metadata is stale. metadata_stale: true means the file on disk no longer matches its metadata (it was edited in place, or a sync was interrupted): trust the hash, not the ref and commit. problem is set, with present: false, when the staged directory holds both a plain and an encrypted config or the file cannot be read |
draft |
null when there is no draft; else {revision, base, updated_at, credentials}: that one waits, the revision a save must quote, the template or ref it started from, and how many credentials it holds (a count: never which one, never a value). Beside staged.ref it shows whether the draft was started from the config now staged |
restart_required |
true when the staged hash differs from the running hash; false when they match; null, never false, when either is unknown |
node |
running, not_running or unknown, from the process ID the Node recorded |
license_state |
LICENSED only for a valid, unexpired license file that covers the Node's type; anything else is UNLICENSED. A Node with no license file runs ungated while status says UNLICENSED: status reports the file, not the Node's own gate |
token_file |
Whether the token file's last change loaded: state is loaded or reload_failed, loaded_at is when the tokens now in force were read, and reload_failed_at is when the file last changed into a state that could not be loaded (null while it has not). After reload_failed the tokens read before the change stay in force. It also reports expired_tokens, earliest_expiry and tokens_without_expiry (see Token expiry), and admin_tokens, how many of the tokens in force carry the admin scope (none is not a fault). It says nothing about which tokens exist; it is null only for a service given a fixed set of tokens, which a real appliance never is |
connectors |
Whether each connector in the staged config answered a bounded, cached check: state is checked, not_tested (nothing staged), not_applicable or error, with a checks list of {name, connector_type, target, success, message, checked_at}. connector_type is opcua, rest_polling, mqtt or database_log. target is the address checked and never a credential: a URL's scheme, host and port, or mqtts://host:port (mqtt:// without TLS, mqtt+unix://path for a socket) for an MQTT broker, whose check is a connection of its own that subscribes to nothing; see mqtt-system-connector.md. For a database_log section the target is host:port/database and the check is a session of its own that asks the database whether the table and its columns are there; it reads no row and never touches the Node's watermark table; see database-log-scanning.md |
certificate_status |
The Node's certificates, read from the files each time, so a renewal shows at once. state is ok, warning (any certificate inside the warning window), expired, unreadable (problem says which file and why, never key contents) or not_configured (no certificate files). warning_days is the window, 30 days; certificates lists the leaf, then each CA in the trust bundle, as {role, subject, identity, not_after, days_remaining, expired, in_warning_window, identity_problem}. A certificate is flagged once fewer than 30 days remain |
scheduled_tasks |
Each scheduled task of the running Node, from the file the Node writes beside its runtime state; empty when the Node is not running or reports none. {name, state, consecutive_failures, last_success, degraded_since, failure_class}: state is ok or degraded (the task failed the configured number of ticks in a row and is probed every tick), failure_class is task_error, database_unavailable or crashed, never the failure's text. The count is in memory, so a Node restart starts every task at ok. A degraded task is a warning for monitoring and stops nothing |
host_time_utc, time_sync, virtualization |
The host's clock and what the host says about keeping it, with no verdict. host_time_utc is the host's UTC time (compare it with yours, or across Nodes: three or more show the outlier). time_sync is {client, synchronized, source}: client is chrony, systemd-timesyncd, other, none or unknown; synchronized is true, false, or null when there is no client or it cannot be read; source is the server in use when synchronized. virtualization is the type (kvm, vmware...), none on bare metal, or unknown. Read together: a guest type with no client points at the hypervisor, not the appliance. The facts are read with a 3 s budget in all; one that cannot be read in time is unknown, so the response is never stalled by it |
coverage |
When the Node was last known to be running and the most recent coverage gap (see "Coverage gaps" in database-reference.md). {last_alive_at, latest_gap}: last_alive_at is the Node's liveness mark, UTC, or null when it has none yet or the database cannot be read in time (a Node stopped cleanly has no instance id on file, so the one instance the database knows is used, and none is guessed if it holds several); latest_gap is {connector, cause, outcome, started_at, ended_at} for the latest coverage gap entry of this instance (cause is node_stopped, connection_lost or messages_dropped; outcome is replayed or not_replayed), or null. It names a connector and a window, never a record or a count. Neither value stops the Node or the response |
Status touches no database and no broker, so it answers when either is down.
Config
api "$BASE/v1/config" | jq '{node_type, staged: .staged.hash, document_keys: (.document | keys)}'
{"node_type": "ERP", "staged": "9f2c...", "document_keys": ["config", "config_version", "node_type"]}
A value in a field the Node Type marks x-sensitive is replaced by a placeholder, wherever it sits,
including inside a $shared fragment. A new x-sensitive field in a Node Type is redacted with no
change here. Plain values are shown as they are.
Validate
Validation reads and judges a config; it writes nothing, to the staged config, the state directory
or the Activity Log. Send exactly one of source (file or ref) or body.
A config is judged against the Node Type its own envelope names, and, when the Node on this appliance
has reported its type, it must be that Node's: a valid config for another Node Type is reported
invalid (and a sync refuses it with 422), because the Node would refuse it at its next start. Until a
Node has reported, any known Node Type is accepted, so a wrongly staged type can still be corrected.
The type is the one in the Node's runtime-state file, which a crash leaves behind; if this appliance is
reprovisioned as another Node Type, remove that file (RUNTIME_STATE_PATH) first.
The staged file on disk:
api -X POST "$BASE/v1/config/validate" -H 'Content-Type: application/json' -d '{"source":"file"}'
{"valid": true, "errors": [], "node_type": "ERP"}
A candidate body. A body may carry an x-sensitive field only as the placeholder or absent; any other
value is refused with a message that names the field and never the value. The redacted config from
GET /v1/config is therefore a valid body as it stands:
api "$BASE/v1/config" | jq '{body: .document}' \
| api -X POST "$BASE/v1/config/validate" -H 'Content-Type: application/json' -d @-
{"valid": true, "errors": [], "node_type": "ERP"}
A ref in the repository, fetched and judged exactly as a sync would, but not staged. This needs a token
with both read and sync:
api -X POST "$BASE/v1/config/validate" -H 'Content-Type: application/json' \
-d '{"source":"ref","ref":"main"}'
{"valid": true, "errors": [], "node_type": "ERP"}
An invalid config is a normal answer, not an error: valid is false and errors lists what is
wrong, none of it carrying a config value.
Sync
Sync fetches the config file from the configured repository at a ref (a branch, a tag or a commit
id; the configured ref when none is given), decrypts it when it is a .enc.json file, validates it
exactly as validate does, and stages it only if it is valid. The commit the ref resolved to is
recorded, and that commit is what is staged even if the ref moves while the sync runs.
api -X POST "$BASE/v1/config/sync" -H 'Content-Type: application/json' -d '{"ref":"main"}'
{
"ref": "main",
"commit": "4be1c0d9...",
"hash": "9f2c...",
"node_type": "ERP",
"staged_at": "2026-10-05T08:00:00+00:00",
"restart_required": true
}
A sync that fails changes nothing: the old staged config and its metadata stay exactly as they were.
The reason comes back as {"detail": "..."} with the status in the failure table:
api -X POST "$BASE/v1/config/sync" -H 'Content-Type: application/json' -d '{"ref":"no-such-ref"}'
{"detail": "the ref was not found in the repository"}
Applying a staged config is a restart of the Node, done at the operating-system level. After it,
restart_required in GET /v1/status is false.
A 504 on sync is not a failed sync. The API stops answering a request after 30 seconds and
returns 504, but a sync that was already running keeps going: git has its own 20-second deadline,
while decryption and the disk writes have none. That sync can still finish and stage. After a 504
on sync, read GET /v1/status and look at staged before calling sync again.
Staging a bundle
A config bundle is one config file from the integrator's repository at a ref, built on a laptop and carried to an appliance that cannot reach the repository, such as one at an air-gapped site. The appliance validates it exactly as a sync does and stages it. The bundle carries the file as a string, so its bytes, and so its hash, are exactly what was committed.
python3 -m engine.config_bundle_cli REPO REF CONFIG_PATH NODE_TYPE_DIR --output bundle.json reads
CONFIG_PATH at REF of the local repository REPO with git, records the ref and the commit it resolved to,
runs the same offline check as Checking a config before it is staged (add
--shared-dir to let it resolve "$shared" fragments), and writes the bundle to a file that must not
exist. It stages nothing and reaches no target, so it says that the connection check was skipped: a staged
config is connection-tested by GET /v1/status. The same work is build_config_bundle in
engine.public. The only stable promise of the command is its exit code:
| Code | Meaning |
|---|---|
| 0 | The bundle was written, and the config passed the offline check |
| 1 | The config is invalid; nothing was written |
| 2 | The command could not run (usage, git missing, a repository or Node Type directory that cannot be used, a file that cannot be carried, an output file that exists); nothing was written |
| 3 | The ref, or the config file at that ref, was not found; nothing was written |
| 4 | The bundle was written, but the offline check had no verdict: the config is encrypted and the laptop has no age key. The appliance validates it when it stages the bundle |
A bundle is a JSON object: format_version (1), ref, commit (the full commit id), name (config.json,
or config.enc.json for an encrypted config) and content (the file's text). POST /v1/config/bundle takes
it as the request body (curl --data @bundle.json with Content-Type: application/json and a configure
token) and answers like a sync, plus where the config came from:
{
"ref": "main",
"commit": "4be1c0d9...",
"hash": "9f2c...",
"node_type": "ERP",
"staged_at": "2026-11-15T08:00:00+00:00",
"source": "bundle",
"provenance": "stated",
"in_repository": true,
"restart_required": true
}
- The ref and commit are stated, not verified. The appliance cannot check them against a repository it
cannot reach, so
GET /v1/statusshowssource: "bundle"andprovenance: "stated". A later sync stages what the repository holds and showsverified. - The same validation as a sync. The file is validated through the same code a sync and the Node's own
loader use, against the Node Type this appliance runs, and decrypted with the appliance's age key when its
name ends
.enc.json. An invalid, undecryptable or wrong-Node-Type bundle stages nothing and leaves the staged and prior configs as they were. - One file, like a sync.
"$shared"fragments are the appliance's own, placed by hand in its shared directory: a bundle is judged against those, and a missing fragment is refused with the same message a sync gives. - The file's kind cannot change. The Node reads exactly one of
config.jsonandconfig.enc.json, chosen when it was installed, so a bundle whose file is not the same kind as the staged one is refused (422), with a message saying to reinstall with--encryptedto change it. - Size. A file over about 0.9 MiB is refused (413) with a message saying so; the request limit is 1 MiB and the bundle wraps the file in a JSON string, which makes its quotes and line breaks two characters each, so a file near the limit can make a request the request limit refuses first. The command refuses what the route would.
- Audited. Every attempt writes one Activity Log entry: trigger
management_api, task typeconfig_bundle, an outcome ofstaged,rejected:<code>orfailed:<code>, andreference_idsholding thetoken_id, the statedrefandcommit, thehashonce computed andsource. The route is refused with 503, before anything changes, when the log cannot record it.
Rolling back
The appliance keeps exactly one prior staged config: the one the last stage replaced. It is there so that recovering from a bad config change is one step on the appliance, with no repository, no network and no need to know which ref was good. There is no history beyond that one slot; the repository has that.
POST /v1/config/rollback (no body) swaps the staged config with the prior one and answers as a bundle does,
with source: "rollback". The swap is exact, so a mistaken rollback is undone by rolling back again. The
prior is validated again first, because a Node Type version change since it was staged could have made it
invalid; one that no longer validates is refused (422) and nothing changes. Applying the restored config is,
as always, a restart of the Node.
- No prior is a clear refusal. With nothing to go back to the route answers 404 and changes nothing; the message says to sync a known ref instead. (A 409 means another sync, bundle or rollback is running, and is worth retrying; a 404 here is not.)
- A repeat leaves the prior alone. A sync or a bundle whose file has exactly the staged file's bytes does not replace the prior, so repeating one cannot overwrite the config a rollback would restore. A stage that fails or is refused leaves the prior as it was.
- Only a file of the staged file's name. A prior of the other kind (encrypted or plain) is refused, for the
reason a bundle's is. A sync is the one stage that may change the staged file's kind (it follows the one
configured repository path), and when it does the file it replaced is the prior, so a rollback is then refused
(422, reinstall with
--encrypted) althoughstaged.priorand the page still show it; sync a known ref instead. - Where it is shown.
GET /v1/statusshows the prior's ref, commit, source and time understaged.prior, even when nothing is staged but a prior is. A restored draft shows as not in the repository again. A prior whose own record is missing or no longer describes its file is restored with no ref or commit and claims nothing:stated, and not in the repository. - Audited. One Activity Log entry with task type
config_rollback, the same outcomes andreference_idsas a bundle's, and the same refusal with 503 when the log cannot record it.
The draft
A draft is the config an integrator is working on at the appliance, before it is staged: by hand, or
from the page. There is one slot per appliance, kept in draft/ of the state directory, readable by the
service's user and no one else, and capped at 1 MiB. It is judged when it is staged, not when it is saved,
so work in progress can be kept. A sync never touches it, and the Node never reads it.
GET /v1/config/draft (read) answers with the draft as the document the Node would read, every
credential shown as "[redacted]":
{
"revision": 3,
"base": "main",
"started_at": "2026-11-15T08:00:00+00:00",
"updated_at": "2026-11-15T08:20:00+00:00",
"node_type": "ERP",
"document": {"node_type": "ERP", "node_type_version": "0.1.0", "config_version": 1, "config": {"rest": {"endpoint": "https://erp.example", "api_key": "[redacted]"}}},
"credentials": ["config.rest.api_key"],
"placeholders": []
}
placeholders is empty unless the draft was started from a starting point. With no draft
it answers 404. PUT /v1/config/draft (configure) saves the whole document. Send
{"revision": 3, "document": {...}}, or {"document": {...}} for the first save. In the document, each
field the Node Type marks x-sensitive is one of three things:
| In the document | What it does |
|---|---|
"[redacted]" |
Keeps the credential already stored at that place |
| absent | Removes it |
| a non-empty text value | Sets it. The appliance encrypts it with its own age key and never returns it |
Every other field is stored as sent, and "$shared" references stay as references. The node type the
document names must be one this appliance has, because the credential fields are found by the Node Type's
schema; a field named like a credential that sits where the schema places none is refused, so a credential
cannot be stored by mistake in plain text. A save is a whole document and not a patch.
- The revision. Every save makes the next revision, and a save must quote the one it replaces. The numbering carries on after a discard or a start over (a new draft never reuses the number of one that was discarded), so a save that quotes a draft that is gone is refused, not applied to the one that replaced it. A save made from an older read, or a save with no revision when a draft exists, is refused (409), and so is a revision when there is no draft. Read the draft again and redo the change. A refused save changes nothing.
- Starting over.
{"replace": true, "document": {...}}discards an existing draft and its credentials and starts again; replacing needs the explicit word and no revision.[redacted]in such a document is refused (422), because the credential it would keep has just been discarded. - Starting from the staged config.
{"from_staged": true}(withreplacewhen a draft exists) copies the staged config into the draft, moving every credential in it, plain or encrypted, into the draft's encrypted credentials."$shared"references are kept as written. The draft'sbaseis the ref it was staged from. The staged config is not changed. - A credential in a list is stored by its position. A save that changes the length of a list holding a
credential cannot keep that credential with
"[redacted]", because its position moved; send it again. Reordering a list, or replacing one item with another, keeps its length and cannot be seen, so check a list's credentials after doing either. - At most 32 credentials can be set or removed by one save.
- No age key. Setting or removing a credential needs the appliance's age key and is refused (503) with a message naming the missing key; the draft is as it was, and every edit that touches no credential still works.
- Never in plain text. A credential is on the appliance only in the draft's encrypted credentials file,
and in memory while it is being encrypted. It reaches
sopson its standard input and never on a command line, it is in no response, no log line, no error message and no Activity Log entry, and an error fromsopsis answered with a fixed message that carries none ofsops's own words. - Audited when it matters. A save that sets or removes a credential, and a discard of a draft that holds
one, write one Activity Log entry with task type
config_credentials, an outcome ofchanged,rejected:<code>orfailed:<code>, andreference_idsholding thetoken_id,source(draft) and the countscredentials_setandcredentials_removed, never a name or a value. They are refused with 503, before anything changes, when the log cannot record them. A save that edits only text writes no entry. - The same lock. A save, a discard, a stage and an export are serialized with a sync, a bundle and a rollback; one that finds another running is refused (409) and changes nothing.
DELETE /v1/config/draft (configure) removes both files and answers
{"discarded": true, "credentials_removed": 1}, or 404 when there is no draft.
Starting points
A starting point is a config skeleton for one target system, kept as a file in a repository, with placeholders for the values and credentials that differ from site to site. The file's format, the public set Kindred ships and how an integrator writes their own are in Starting points; this section is what the routes do with one.
PUT /v1/config/draft (configure) starts the draft from one when the body carries starting_point in
place of document or from_staged:
{"starting_point": {"document": {"starting_point_format": 1, "...": "the file's content"}}}
{"starting_point": {"ref": "main", "path": "templates/erp-rest-polling.json"}, "replace": true}
- Uploaded, or read from the repository.
documentis the file's content, sent from a laptop where the appliance cannot reach the repository.pathnames a file of the configured repository andrefthe ref to read it at (the configured ref when left out); the appliance fetches it as a sync does, with the same repository credentials. A path is held to the rule the configured config path is held to: relative, inside the repository, ending.json(422 otherwise), and never a file ending.enc.json, since a starting point holds no credential. Reading from the repository needs thesyncscope as well asconfigure, as validating a ref does, and is refused (403) before anything is fetched when the token lacks it. The two ways give the same draft for the same file. - What the draft is. The file's skeleton becomes the draft's document, its Node Type and version set as
the file states them, with no credential; its placeholders are recorded in the draft and returned as
placeholders, each with itspath,label,kind(valueorcredential),exampleandfilled(a value placeholder is filled when the saved draft has a value at its place, a credential placeholder when a credential is stored there). The draft'sbaseispath@reffor a file read from the repository, andstarting point: <what it is a start for>for an upload. Fill the placeholders with ordinary saves; a save keeps them listed, and a start over (replacewith a document, or from the staged config) drops them. - Replacing a draft needs
replace, as starting from the staged config does (409 otherwise, and the draft is as it was). A draft that holds credentials is audited as any discard of one is. - The file must fit the appliance. It is refused (422) when it is not in the format (every reason is listed, none carrying a value from the file), when the Node Type it names is not one this appliance has or its version is not this appliance's exactly, when its skeleton holds a value where the Node Type places a credential or a field named like one anywhere else, or when a placeholder is in the wrong place or of the wrong kind. Nothing is changed. A starting point for an older version of a Node Type is a file to update, not a draft to repair.
- Staging and exporting wait for every placeholder.
POST /v1/config/draft/stageandGET /v1/config/draft/export(and the template form below) are refused (422) while a placeholder is unfilled, and the message names each one by its path and label (config.rest.endpoint (The ERP's base URL)), never a value. A value placeholder is open while its place is absent, null or an empty text; a credential placeholder is open until a credential is stored there. A draft cannot drop a placeholder: start over withreplaceto leave one out. The refusal is audited like any refused stage.
POST /v1/config/draft/export (configure) is the other direction: it saves the draft as a starting-point
file for the integrator to commit. Send what the template is a start for, optionally a sentence about it, and
the places to leave open:
{
"target_system": "Our ERP's REST interface",
"description": "The ERP at every plant.",
"placeholders": [
{"path": "config.rest.endpoint", "label": "The ERP's base URL", "example": "https://erp.example.test"}
]
}
It answers {"node_type", "name", "content", "hash", "base", "draft_revision", "placeholders"}, where
content is the file. Every credential the draft holds becomes a credential placeholder, labelled by its path
unless it is named in the request to give it a label; the appliance reads where each sits and never decrypts
one, so no credential is in the file in any form, not even encrypted (an encrypted value is bound to this
appliance's key and would be of no use at another site). Each named place that is not a credential becomes a
value placeholder, and its value is left out of the file. A place that is not in the draft, a path that is not
a place, a place named twice or inside another, and a credential kept by a list position are refused (422). So
is a draft that still has a placeholder of its own unfilled. The export is audited as an export is (task type
config_export, with source template, which tells it from an ordinary export, the count
template_placeholders and the hash), refused with 503 when the log cannot
record it, and writes nothing to the state directory. Applying the file and filling each placeholder gives the
config again.
Staging and exporting a draft
POST /v1/config/draft/stage (configure, no body) composes the draft into one config, validates it
through the code a sync and a bundle use, and stages it. It answers like a bundle does:
{
"ref": null,
"commit": null,
"hash": "9f2c...",
"node_type": "ERP",
"staged_at": "2026-11-15T08:30:00+00:00",
"source": "draft",
"provenance": "stated",
"in_repository": false,
"restart_required": true
}
The draft has no commit of its own, so ref and commit are null and GET /v1/status shows
staged.base. A staged draft is reported as not in the repository, and stays that way until the
integrator commits it and it is staged again by a sync or a bundle, which replaces it. That is a warning
and never stops a restart. Staging leaves the draft where it was. As with a bundle, staging is
the way to connection-test a draft: GET /v1/status checks the connectors of the staged config.
- The staged file's kind never changes. The Node reads exactly one of
config.jsonandconfig.enc.json, chosen when it was installed. A draft is composed as the staged file's kind: a plain file where a plain one is staged, and a SOPS file where an encrypted one is, even when the draft holds no credential. A draft that holds a credential where the staged file is a plain one is refused (422) with a message saying to reinstall with--encrypted. With nothing staged, a draft with a credential is staged encrypted and one without is staged plain. - Only the credentials are ciphertext. The composed encrypted file has every field readable except the
fields the Node Type marks
x-sensitive, so the file can be read and compared in a repository. (When a credential sits where a field name cannot find it, such as an item of a list or an entry of a map, the whole file is encrypted instead, so that none is left readable.) The credentials are decrypted into memory, put back into the document, and encrypted again together with the document, so each time a draft is composed its credential values are new ciphertext. - Validated like a bundle. An invalid draft, or one that names another Node Type than the one on this appliance, stages nothing and leaves the staged and prior configs as they were; the 422 lists what is wrong, worded from the schema and carrying no config value (it names a field and the rule it breaks, as the migration read does; a sync's, a bundle's and a rollback's refusal are worded the same way). A stage replaces the staged config, which becomes the prior, as any stage does.
- Audited. One entry per attempt, with task type
config_draft, the same outcomes andreference_idsas a bundle's withsourcedraft, and the same refusal (503, before anything changes) when the log cannot record it.
GET /v1/config/draft/export (configure) is how a change leaves the appliance. The integrator commits what it
returns; the appliance never commits, pushes or holds repository credentials:
{
"node_type": "ERP",
"name": "config.enc.json",
"content": "{ ... the whole composed file ... }",
"hash": "7ac1...",
"patch": "--- a/config.enc.json\n+++ b/config.enc.json\n@@ ...",
"staged_hash": "9f2c...",
"base": "main",
"draft_revision": 3
}
content is the full file, composed and validated exactly as a stage would, so it is what a sync of the
committed file would stage. patch is a unified diff from the staged file's exact bytes to content, and
git apply turns the staged file into content; staged_hash is the hash of the file it is against, so
the integrator can tell whether their copy is that one. patch is null when nothing is staged. A
credential is in content and patch only as ciphertext. The export is audited (task type config_export,
outcome exported, the hash of the file) and refused with 503 when the log cannot record it. It writes
nothing to the state directory, and a draft that is invalid, or that holds a credential where the staged file
is plain, is refused as a stage is.
The Configuration Schema
GET /v1/config/schema (read) returns a Node Type's Configuration Schema, so a page or a script can build a
form or check a draft by hand:
{
"node_type": "ERP",
"version": "0.1.0",
"config_schema": {"type": "object", "properties": {"rest": {"type": "object"}}},
"sensitive_names": ["api_key"]
}
Without a parameter it is the Node Type this appliance runs: the Node's own report, else the staged config's
type. A fresh appliance knows neither, so it answers 404 until a Node Type is named with ?node_type=
(404 for a name this appliance has none of). A field marked "x-sensitive": true in the schema is a
credential: it is set through the draft and never read back.
api "$BASE/v1/config/schema" | jq '{node_type, version, sensitive_names}'
{"node_type": "ERP", "version": "0.1.0", "sensitive_names": ["api_key"]}
The migration read
A Node Type's version moves, and a config written for an older one is refused at its first line: the version
does not match. POST /v1/config/migration (read) is for judging such a config without that line. Send
{"source": "staged"} or {"source": "draft"}; it answers every problem the config has against the
running Node Type's schema, and not only the first, and writes nothing:
api -X POST "$BASE/v1/config/migration" -H 'Content-Type: application/json' -d '{"source":"staged"}'
{
"source": "staged",
"node_type": "ERP",
"found_version": "0.1.0",
"expected_version": "0.1.0",
"version_matches": true,
"problems": []
}
Each problem is {"path": "config.rest.poll_interval_seconds", "message": "must be of type number"}: where, from
the document's root, and what rule it breaks, worded from the schema and never from the config, so no value is
in it (a missing or unexpected field is named, because a field's name is the config's shape and not a value
in it). A problem at a credential's own place is left out, because the placeholder stands there and the real
value is never judged. Applying what the problems list, and setting node_type_version to expected_version, makes the config
pass the same validation a stage uses. A draft is judged with its credentials as set, and a staged
config has its credentials replaced before it is judged, so none is held or shown. The config is judged against
the Node Type this appliance runs (the Node's own report, else the one the config names); a config for another
type has one problem, at node_type. No staged config or no draft is 404.
The configuration assistant
POST /v1/config/assist (configure) asks the site's own inference endpoint for a change to the draft, in
answer to a request in plain words, and checks the change before it is shown:
{"request": "Poll every 30 seconds instead of 5.", "revision": 4, "apply": "none"}
It answers with the proposed edits, the draft they would make (each credential as the placeholder), the findings
worth knowing, and what was done with it. apply is none (nothing is saved), draft or stage; a change
that does not pass the checks is never applied, and a save or a stage goes through the draft routes' own logic.
The assistant never sees a credential and cannot set one, a request that holds a credential the draft already
has is refused before anything is sent, and the Activity Log entry (config_assist) never holds the request or
the model's reply. The route is off, answering 503, until MANAGEMENT_INFERENCE_ENDPOINT and the settings
beside it are set (see Installing it). It runs for as long as the model's calls and their
retries need, never more than 600 seconds, where every other route is cut off at 30, and it runs one request
at a time (409 for a second). The whole of it is in The configuration assistant.
Check
A check answers "would this config connect?" for a ref that is not staged yet, which is the only way to test a credential without making it the next restart's config. The appliance fetches the ref and decrypts it as a sync would, validates it, builds each connector the config declares and tests it against its target. Nothing is staged and nothing is written but the Activity Log entry.
POST /v1/config/check
Content-Type: application/json
{"ref":"main","mqtt_wait_seconds":5,"show_sample":false}
(The wrapper's check [REF] sends the same request. It has no runnable example here, because a
check dials the targets the config names.)
{
"ref": "main",
"commit": "4be1c0d9...",
"state": "passed",
"findings": [],
"reason": null,
"node_type": "ERP",
"connection_state": "passed",
"connection_reason": null,
"connections": [
{"name": "rest", "connector_type": "rest_polling", "state": "passed",
"message": "...", "target": "https://erp.example", "sample": null, "sample_truncated": false}
]
}
- A verdict is a 200.
stateis the config's verdict (passed,failedwithfindings, each a rule and a message, orskipped) andconnection_statethe connectors' (passed,failedorskipped, withconnection_reasonwhen skipped). Neither sayspassedfor a part that did not run: a config that fails is not dialed, and a config for another Node Type than the running one is refused as a sync would refuse it. - No secret appears. Every message and sample has the config's secrets removed, and
targetnever carries a credential. The sample, whatever a passing connector returned, is left out (null) unless the request setsshow_sample, because it can hold plant data that is not a secret of the config. mqtt_wait_secondsis how long an MQTT connector waits for one message (0 to 10, default 5); a quiet topic is a result, not a failure. The limit keeps a check inside the 30-second request limit.- A database log connector reads no row here. The check asks the database whether it can be
reached and whether the table has the declared columns, whatever
show_sampleis. Reading one row of the table is a separate option of the command line and the library call, off by default (see Checking a config before it is staged). - One check at a time (409 otherwise), because a target may limit its sessions; a live Node may hold one on the same target. A 504 is not a failed check: it keeps running and finishes, and its Activity Log entry says how it ended.
- Audited. Every attempt writes one entry: trigger
management_api, task typeconfig_check, an outcome ofpassed,failed:config,skipped:config,failed:connection,skipped:connectionorfailed:<code>, andreference_idsholding thetoken_id, therefand thecommitonce resolved. The check is refused with 503 when the log cannot record it.
Activity Log
Entries come oldest first, exactly as the log stores them, chain hashes included, so a consumer can
verify the hash chain over what it received. The filters are node_type, node_instance_id,
reference_id (with reference_ids_key to name which reference), task_type, start and end
(timestamps with a timezone), and limit (1 to 1000, default 100). The answer carries
next_cursor unless it is the last page; pass it back as cursor with the same filters to
continue. A cursor is a position in the log, so entries added between two calls never make a page
repeat or skip one.
Every sync attempt writes one entry: trigger management_api, task type config_sync, an outcome
of staged, rejected:<code> or failed:<code>, and reference_ids holding the token_id, the
ref, the commit once resolved and the hash once computed. A bundle and a rollback write the same
kind of entry, with task type config_bundle and config_rollback and a source among the
reference_ids. A staged draft writes config_draft, an export config_export, and a change of the draft's
credentials config_credentials, which records counts and never a name or a value. A request to the assistant writes config_assist, with its outcome and counts of attempts, changes and findings and never the request or the model's reply. Reads and failed
authentications write none.
api -G "$BASE/v1/activity-log" --data-urlencode task_type=config_sync --data-urlencode limit=2 \
| jq '{entries: [.entries[] | {task_type, outcome, reference_ids}], next_cursor}'
{
"entries": [
{"task_type": "config_sync", "outcome": "staged", "reference_ids": {"token_id": "ops", "ref": "main", "commit": "4be1c0d9...", "hash": "9f2c..."}}
],
"next_cursor": "opaque"
}
Paging through everything that matches:
cursor=
while :; do
page=$(api -G "$BASE/v1/activity-log" --data-urlencode task_type=config_sync --data-urlencode limit=2 \
${cursor:+--data-urlencode cursor="$cursor"})
echo "$page" | jq -c '{count: (.entries | length), more: (.next_cursor != null)}'
cursor=$(echo "$page" | jq -r '.next_cursor // empty')
[ -n "$cursor" ] || break
done
{"count": 2, "more": true}
{"count": 2, "more": true}
{"count": 1, "more": false}
Sync, a bundle and a rollback are refused up front, with 503, when the Activity Log cannot be reached: an unaudited change to what a restart does is not allowed.
The API description
api "$BASE/v1/openapi.json" | jq '{openapi, paths: (.paths | keys)}'
{"openapi": "3.1.0", "paths": ["/v1/activity-log", "/v1/config"]}
Sign-off records
The records a drafting Task leaves for a person to decide: a drafted Playbook entry, a case summary,
a shift-handoff summary. GET /v1/signoffs lists them oldest submission first, whatever their
status (pending, approved, rejected, rejected_superseded). The filters are record_type,
status, start and end (timestamps with a timezone; start is inclusive, end exclusive, on
the submission time) and limit (1 to 1000, default 100). The answer carries next_cursor unless
it is the last page; pass it back as cursor with the same filters to continue. A cursor is a
position in submission order, so a record submitted between two calls never makes a page repeat.
A record is stamped with its submission time before it commits, so one that commits after a page
was served, carrying an earlier time than that page's last record, appears only on a fresh walk.
GET /v1/signoffs/record-types lists the distinct record_type values the records hold, whatever their
status, alphabetically, as {"record_types": [...]}. It is what a filter's choices are built from: the service
keeps no list of record types, so a Node that holds none, or has no sign-off table, answers an empty list.
GET /v1/signoffs/{record_id} returns one record. A record's content is returned as the database
holds it (JSON, so object key order and number formatting are normalized) and is not interpreted, so a record type this service has never heard of is listed like
any other. A record created by an edit-and-resubmit carries predecessor_id, the record it
replaced. An appliance whose Node has no inference section has no sign-off table, and the list is
then empty, not an error. These routes answer with the Node stopped.
Deciding a record
POST /v1/signoffs/{record_id}/resolve takes {"decision": "approved" | "rejected", "action_id": UUID} and answers with the record, which carries resolved_by and resolved_at. The reviewer is
the id of the token that authenticated the request and is never taken from the body: a body that
names one (reviewer, resolved_by, or any other field the route does not define) is refused with
422.
POST /v1/signoffs/{record_id}/edit-and-resubmit takes {"content": {...}, "action_id": UUID},
marks the original rejected_superseded and answers with a new pending record whose
predecessor_id is the original. The edited content must have the same top-level keys as the
original, so a reviewer revises a draft but cannot change its shape; one that does not is 422. The
check applies to a record that is still Pending: against one already settled the answer is the
replay or 409, whatever keys the body has. Content the database cannot hold as JSON is 422 as well,
with the same answer on every repeat: a number that is NaN or infinite, or text (or a key) with a NUL
character or half of a surrogate pair in it. The message names the problem and never the value.
action_id is chosen by the caller, once per decision, and kept across retries of it. Sending
the same request again is a no-op that returns the first outcome. A retry that disagrees with what
was recorded, naming the other decision or carrying different edited content, is 409 and changes
nothing: correcting a decision or an edit is a new action, with a new action_id, and only while
the record is still Pending. Do not reuse an action_id for a different record.
First writer wins. Two decisions on one record do not both take effect: the first to reach the
database settles it, and every later caller is answered 409 and changes nothing. The same is true of
a decision racing a change made straight against the store. A call counts as the one that won, or as
a retry of it, only when the stored record carries that call's action_id and that token's id.
Another reviewer who sends the winning action_id lost, and a resolve that names an action_id
that edited the record is 409, because that record was superseded and not decided.
Approval is a status, not a publication. Approving a record does not publish it anywhere. The records reviewed here are drafted entries (a drafted Playbook entry, a case summary, a shift-handoff summary, an instruction claim), and retrieval reads the site's source documents and never a drafted entry: an approved draft is found by retrieval no more than a pending one is. What approval changes is the record's status, who set it and when. An approved instruction claim is a person's confirmation that the sentence says what the fields say; an instruction binding reads confirmed claims (see Instruction bindings), and nothing else reads one. The review page shows a claim's quoted sentence beside the fields read from it; the other record types show their content as it is stored.
What a decision writes to the Activity Log. One entry per decision, after the record changes and
only for the call that changed it: task_type signoff_resolution, trigger management_api,
outcome approved, rejected or edited_and_resubmitted, and reference_ids with token_id,
record_id, record_type and action_id (and successor_id for an edit). Its time is the
decision's. The entry belongs to the Node's own node_instance_id once the Node has started, and to
management_api before that. Its id is derived from the record and the action_id, so writing it
twice is refused by the log's own primary key.
A decision is refused with 503, the record left Pending, when the Activity Log cannot be reached.
When the record changed but its entry could not be written, the answer is 503 too, and repeating
the same request, with the same action_id, writes the missing entry once and answers 200; a
further repeat writes nothing. The repeat must come from the same token: the record names the token
that decided it, and anyone else sending that action_id is answered 409. If that token has been
revoked in the meantime the record stays decided and its entry stays unwritten, and nothing here
completes it. Minting and revoking a token write entries of their own; see Token actions in the
Activity Log.
Alerts
An alert is what an instruction binding in alert mode raises when a reading stays outside a limit (see
Instruction bindings). The four alert routes need the alerts scope and
nothing else opens them, a read or signoff token included: an alert carries the product and operation labels
and the value that crossed a limit, which a token that only monitors or reviews has no need to see. An alerts
token opens no other route.
GET /v1/alerts
Lists the alerts newest first. Only a finished alert is listed: one whose Activity Log entry and Trigger have both been written.
- Filters.
acknowledged(trueorfalse; left out lists both),limit(1 to 1000, default 100) andcursor, as the other lists do. - Fields. Each alert has
id,raised_at,binding_id,claim_id,limit_name(lowerorupper),measured_value,limit_value,unit,product,operation,held_readings,held_seconds,repeat_count,last_repeat_at,previous_alert_id,suppressed_beforeandacknowledgement. acknowledgementisnulluntil a person acknowledges the alert. It then holdsdisposition,acknowledged_by(the id of the token, never a name the caller sent) andacknowledged_at.- No sentence from the instruction is returned, and neither is the document, revision or locator. An alert's row holds none of them. The alert's own Activity Log entry, under the same
id, names where the instruction is. - A Node with no alerts table lists nothing.
- A Node whose alerts table exists but whose acknowledgements table does not (it has not yet been restarted onto this release) answers 503 "not yet upgraded" on every alert route. It never answers an empty list or a
null, which would hide alerts it holds.
GET /v1/alerts/count
Answers {"unacknowledged": N, "oldest_unacknowledged_at": TIME} for the finished alerts no one has acknowledged, in one query.
Nis a number, 0 included, on a Node that has an alerts table. On a Node that has none it isnull, which a reader shows as unknown and never as "no alerts".- The Node's own Pending-Count Pointer carries the same count and time. Its oldest waiting time is the earliest of the sign-off records, the identity matches and the alerts.
- The sign-off count does not change with alerts: an acknowledgement is not a sign-off record and gates nothing.
GET /v1/alerts/{alert_id}
Answers one finished alert with everything the list carries and two more things. They are read from the alert's own Activity Log entries, because its row holds neither.
instructionhasdocument,revisionandlocator, eachnullwhen the entry names none. It is the place the instruction is, never its wording.explanation_record_idis the id of the drafted explanation among the sign-off records, ornullwhile none was drafted. It is the Case Triage summary that names the alert as its trigger. It is not part of the alert, and the route never returns its text (reading it, atGET /v1/signoffs/{id}, needs thesignoffscope). When a summary was drafted more than once, the latest is named.
Statuses. 404 is an id that is not a finished alert. 503 is an alert store or an Activity Log that cannot be reached, or a Node not yet upgraded. Nothing is written.
POST /v1/alerts/{alert_id}/acknowledge
Takes {"disposition": ...} and no other key. The disposition is one of:
confirmed_issue: operations were outside the instruction;dismissed: the instruction is correct;instruction_needs_revising.
It answers 200 with the alert, now carrying its acknowledgement. There is no free text, because a person's words would sit in the append-only log for good. The alert is not changed, and its own entry is not.
- Once. An alert is acknowledged once; the database enforces it. A second request, from any token, is 409, and the first acknowledgement stands. Kindred acknowledges only the alerts it raises: an id that is not a finished alert (an unknown id, an entry a binding writes when a tag cannot be read or a claim stops being current, or the record of a drafted explanation) is 404 and nothing is written. So is an alert whose entry is not yet written.
- What it writes to the Activity Log. One entry, after the acknowledgement is recorded and only for the call that
recorded it:
task_typeinstruction conformance: alert acknowledged,triggermanagement_api,outcomethe disposition, andreference_idswithalert_id,dispositionandtoken_id. Its time is the acknowledgement's. Its id is derived from the alert, so writing it twice is refused by the log's own primary key. - When the log cannot be reached, the request is refused with 503 and nothing is recorded. When the acknowledgement was recorded but its entry could not be written, the answer is 503 too, and repeating the same request (the same token, the same disposition) writes the missing entry once and answers 200; a further repeat is 409. Another token, or another disposition, is 409 in that window too. A failure of the store after the acknowledgement is recorded answers 503 in the same words, and repeating finishes it. Two identical requests from one token at the same instant are that same retry: both answer 200 and one entry is written. If that token is revoked in the meantime the acknowledgement stays recorded and its entry stays unwritten, and nothing here completes it.
- A repeat of an acknowledged cause is counted on the acknowledged alert's
repeat_countwhile the minimum interval lasts, and raises a new alert, which is unacknowledged, once a reading arrives after it. Acknowledging silences nothing for good and nothing is sent again on a timer.
Mint a token for the person who acknowledges with
deployment/mint_management_token.sh --id shift-lead --scope alerts --expires-in 90d.
deployment/kindred_management.sh reads the three GET routes: alerts [NAME=VALUE ...], alerts-count and
alert ID. Like the routes, alert ID answers 503 and exits non-zero while the Activity Log cannot be reached.
It has no command that acknowledges.
Identity matches
An identity record the Node could not settle on its own waits as pending until a person decides it. Two things put one there:
- an inferred match: identity resolution found an existing record that is probably the same entity, and never merges on its own;
- a first article: a reference or product seen for the first time, flagged for inspection, with or without a candidate.
GET /v1/identity-matches
Lists the pending ones, oldest first.
| Filter | Values |
|---|---|
entity_type |
order, material, qualification, schedule |
origin |
inferred_match, first_article or unknown |
kind |
inferred_match or first_article |
status |
pending when left out. rejected, merged or resolved lists what a person decided with that outcome. |
limit |
1 to 1000, default 100 |
- Decided matches. A record the Node itself made canonical is not a decision and is not listed. Decided matches come newest decision first, so a recent mistake is on the first page. That lets a rejected match be found after the page that rejected it is closed.
- Paging.
next_cursorandcursorwork as for sign-off records, with the same filters repeated.
What each match carries. id, entity_type, reference_id, attributes, matched_record_id and match_score, and its candidate: the existing record it proposes to be the same entity as, so a reviewer sees both sides without a second call. candidate is null for a first article that matched nothing, and for a candidate that is no longer on file (its matched_record_id is still shown).
origin and kind
-
originis which creator wrote the record, as stored.- It is
unknownfor a record written before the origin was recorded, and for every record of a table the Node has not been started against since the upgrade that adds the column. This service never creates or alters a table. - A stored value this service does not recognise is shown as it is.
- The
originfilter matches what is stored, andorigin=unknownselects the records with no recognised origin.
- It is
-
kindis always one ofinferred_matchorfirst_article, because that is what confirming the record would mean. It equalsoriginwhen that is known. Forunknown, it is worked out from the record's shape:- one with a
reference_idis a first article; - one with a candidate and no reference is an inferred match;
- one with neither is a first article.
That is a best reading, not a fact: a first article that matched a candidate and has no reference looks exactly like an inferred match. The
kindfilter selects by that same reading, sokind=first_articleincludes the legacy first articles, andkind=inferred_match&origin=unknownis the set that rests on the best reading. - one with a
Resolution and re-opening fields
resolved_by,resolved_atandresolution_action_idare null while a record is pending.reopens_id,reopened_byandreopen_action_idare set on a match made by re-opening a rejected one: the rejected match, who re-opened it, and the request id.reopened_asandreopened_action_idare set on a rejected match that was re-opened: the match that replaced it, and the request id of the re-opening.
All of these are left out of the answer altogether when the table has no column for them. A table the Node has not upgraded has no decided matches to list. A node with no identity table lists an empty page, not an error. The list answers with the Node stopped.
Deciding a match
POST /v1/identity-matches/{match_id}/resolve takes {"decision": "confirmed" | "rejected", "action_id": UUID}. As for a sign-off record, the reviewer is the id of the token that authenticated
the request and is never taken from the body: a body that names one is refused with 422.
What a decision does depends on the match's kind, which is what the list showed:
kind | confirmed | rejected |
|---|---|---|
inferred_match |
The record's attributes are merged onto its candidate and the record becomes merged |
The record becomes rejected; the candidate is untouched |
first_article |
The record becomes resolved, so the next observation of its reference is a clean match |
The record becomes rejected; it stays flagged on its next observation |
The merge and the status change happen in one transaction: both land or neither does. Where a key is
in both records the confirmed record's value replaces the candidate's, so read both sides in the list
before confirming. The answer is the match as it now stands, with status merged, resolved or
rejected, resolved_by, resolved_at and resolution_action_id set, the candidate as it is
after the merge, and changed_keys: the attribute keys the merge added or replaced on the candidate,
empty when nothing was merged. A repeat of an earlier request answers changed_keys null, since the
values are no longer recoverable. A record with no stored origin is decided as the kind the list
reported for it, by the same rule. A rejected record is never canonical and is never offered as a
candidate to a later observation.
action_id, first writer wins and the Activity Log entry follow the sign-off routes. The same
request sent again is a no-op that returns the first outcome; the same action_id naming the other
decision is 409; another reviewer, including one who sends the winning action_id, is 409 and
changes nothing; and a decision is refused with 503, the match left Pending, when the Activity Log
cannot be reached. One entry is written per decision, after the record changes and only for the call
that changed it: task_type identity_match_resolution, trigger management_api, outcome the
resulting status (merged, resolved or rejected), and reference_ids with token_id,
identity_record_id, action_id, kind and entity_type, plus reference_id and
matched_record_id when the record has them. When the record changed but its entry could not be
written the answer is 503, and repeating the same request, from the same token, writes it once.
Two answers are particular to matches. Confirming an inferred match whose candidate is no longer on file, or no longer canonical, is 409 and the match stays Pending: it can still be rejected. And a decision against a table the Node has not yet upgraded is 503, since only the Node adds the columns a decision is recorded in; start the Node once and repeat the request. This service never creates or alters a table.
A match that is rejected, or never decided, can come back. An inferred match has no reference
to deduplicate on, so the same pair of records is not recognised as one already queued. After a
rejection, and on every further observation of the same thing, the Node can write a new pending
row for the same pair; the old one is not reopened by that. A first article that carries a
reference keeps its one row and is not queued again: its next observation is flagged, and what a
person does about a rejection of it is to re-open it. The size of the queue therefore follows how often the Node
observes things, not how many distinct things there are. A site should review the queue against real
observation volume before relying on it as a work list.
Reopening a rejected match
A rejection is a decision, and it stays as it was decided. A person who rejected a match by mistake,
or who has since learned more, re-opens it: POST /v1/identity-matches/{match_id}/reopen takes
{"action_id": UUID} and makes a new pending match that copies the rejected one (its
attributes, candidate, score and kind) and carries reopens_id, reopened_by and
reopen_action_id. The rejected match is not edited: its status, who rejected it, when and the
request id are as they were, and the list shows it with reopened_as naming the new one. The new
match is then confirmed, rejected or, if rejected again, re-opened again, each step a record of its
own. The reviewer is the id of the token that authenticated the request and is never taken from the
body.
A first article that carries a reference is the case that needs the most care, because a reference
belongs to at most one record. In the one transaction that makes the new match, the rejected match
gives up its reference and the new one takes it, so the Node's next observation of that reference
finds a pending first article awaiting a decision, as it would for any other. The rejected match
keeps everything else (its updated_at included), and the reference is recoverable from the new
match's reopens_id. A rejected match with no stored origin is given the one it was shown with
(its kind) in the same step, because without a reference its kind could no longer be worked out
the same way.
The same first-writer-wins rules apply as for a decision. Only a rejected match can be re-opened
(409 otherwise: a match that is pending, confirmed or never decided has nothing to re-open), and
only once: the same request sent again is a no-op that answers with the same new match; a different
action_id, or another reviewer, is 409 and changes nothing; and a re-opening is refused with 503,
nothing changed, when the Activity Log cannot be reached, or the Node has not yet upgraded the
identity table. This service never creates or alters a table.
What a re-opening writes to the Activity Log. One entry, after the transition and only for the
call that made it or a retry of it: task_type identity_match_reopened, trigger
management_api, outcome reopened, and reference_ids with token_id, identity_record_id
(the rejected match), reopened_record_id (the new one), action_id, kind and entity_type, plus
reference_id (the reference that moved) and matched_record_id when the match has them. Its time
is the new match's creation time. Its id is derived from the rejected match, the action_id and the
purpose, so writing it twice is refused by the log's own primary key, and it cannot be mistaken for
the entry of the decision that rejected the match even if the same action_id was used for both. If
the match was made but its entry could not be written the answer is 503, and repeating the same
request, from the same token, writes it once. A page that was closed before the repeat finds the
rejected match in the Rejected view with Send this re-opening again, which sends the request under
the id the list gives (reopened_action_id); a repeat of a re-opening whose new match has since been
decided answers 200 with that match as it stands now.
A table the Node has not upgraded. The re-opening uses three columns of the identity table that only the Node adds, at its start. Until the Node has started once on the installed version, a table that lacks them answers a decision or a re-opening with 503 ("start the Node once, then repeat the request"); the lists keep working. This is the same rule as for any column the Node adds, and it covers confirm and reject too.
Submit an approved case summary as a document
Approving a drafted case summary is a status and nothing more: nothing reads an approved one. It reaches
retrieval only when a person submits it, as a second act. POST /v1/signoffs/{record_id}/submit-as-document
takes {"disposition": "..."} (1 to 2000 characters, in the person's own words) and answers 202 with
{"id": ...}, the id of the queue row, which GET /v1/documents/{id} reads like any document call.
- What is queued. An approved
case_summarybecomes a document of the starter typeapproved_summary, a case record: it is offered by precedent retrieval and never by a point-of-use answer (see case precedent retrieval). Its id iscase-summary-{record_id}, its revision time is the record's approval time, it has no revision label, and its title isCase summary: {trigger type}, {approval date}. Its text is the stored summary, a blank line, thenDisposition:and the person's words, and nothing else, kept as one chunk when it is up to 1500 characters. - The disposition is the person's. A model drafted the summary; a case record is what happened and how it was dispositioned, and the draft has no disposition. The service cannot judge what is written: the field makes the act deliberate, and the Activity Log entry names who submitted it. To change what was written, edit and resubmit the record first; an edited record is a new record with a new id.
- Two scopes. The route needs a token that carries both
signoff(it is a decision about a sign-off record) anddocuments(it puts text into retrieval); a token with one of them is refused403, before the body is read. Neither scope alone can put text into retrieval from a drafted record. The description atGET /v1/openapi.jsongivessignoffasx-required-scopeanddocumentsinx-also-required-scopes. - Refusals.
404for no such record;409for a record that is not Approved (Pending, Rejected or Rejected-Superseded);422for a record of another type (a shift-handoff summary, a Playbook entry draft and an instruction claim are not offered), for one with no summary, or for a disposition that is blank or over 2000 characters;429withRetry-Afterwhen the document queue is full, as for any document;503before anything is queued when the Activity Log cannot be reached. - A repeat. The same record with the same disposition answers the same row and queues nothing more. The
same record with another disposition is
409and the queued text is unchanged. - What it writes to the Activity Log. One entry per record:
task_typesignoff_submitted_as_document,outcomequeued, andreference_idswithtoken_id,record_id,record_type,document_idandqueue_row_id; no text of the summary or the disposition. It is the link from the document back to the record. When the document was queued but the entry could not be written the answer is503, and repeating the same request writes the missing entry once. - Withdrawing it. Use
POST /v1/documents/deactivatewith the document idcase-summary-{record_id}. Nothing here submits in bulk or automatically: no setting makes a drafted summary reach retrieval without a person's act, and approving, rejecting or editing a record queues nothing.
Documents
A site's documents (its SOPs, work instructions and the like) reach the Node's store through the
document routes. They need a token carrying documents and nothing broader; mint one with
deployment/mint_management_token.sh --id doc-sender --scope documents --no-expiry (a system holds it, so it may never expire; give it --expires-in 90d instead to have it end). The Node takes them
only if its config names a document provider of kind rest:
"document_intake": { "providers": { "documents": { "provider": "rest" } } }
The provider's name (documents above) is the name the Node records handled revisions under, so
renaming it offers every document again. At most one provider may be of kind rest. Two optional
settings in its entry set how often the Node looks for work: poll_interval_seconds (default 5)
while nothing is waiting, and fast_poll_interval_seconds (default 0.05, or the slow interval if
that is shorter; never longer than the slow one) after a check that found something, until a check
finds nothing again. The offline check reports two rest providers and a fast interval longer than
the slow one, as the Node would refuse to start with either. The Node also needs
the embedding and inference sections that any document intake needs.
Accepted is not applied. A call is answered 202 with {"id": ...} once it is committed to a
queue in the Node's database, so it works with the Node stopped, and the Node applies it afterwards,
one call at a time and in the order received. The queue table is created when the Node starts with a
rest provider; until the Node has started once, these routes answer 503. With
inference_enabled false the Node applies nothing, and the calls wait, still in order, until it
runs with inference enabled; a deactivate sent meanwhile takes effect after that restart.
Sending a document. POST /v1/documents takes a JSON body of source_document_id,
source_revised_at (with a time zone), text, and optionally document_type (left out, the Node
reads generic), applicability, title, document_number and revision_label. The body limit
is the 1 MiB every route has, counted in JSON, so a document of about 1 MB of text is the longest;
split a longer one before sending it. Text the database cannot hold (a NUL character, a lone
surrogate) is refused with 422. No error repeats the text.
Sending the same thing again is safe. A revision that was already sent is answered with the id
it first got, whatever became of it, and nothing is queued. To send a document again on purpose
(it failed, or its configuration changed and the sender wants it re-ingested), send it with
"overwrite": true and a request_id (a UUID) of your own: the Node then replaces that revision's
stored chunks. The same request_id again is a retry of that send and a new one is new work.
overwrite also bypasses the check that refuses a revision older than one already stored, so an
old revision sent this way puts old content back.
The revision is the document id and source_revised_at, not the text: a corrected text sent again
under the same source_revised_at is answered with the first id and is not queued (for a type that keeps
each revision, the revision label is part of the revision: two labels sent with one time are two submissions), so give a
corrected document a new revision time, or send it flagged.
The queue is bounded. While more than MANAGEMENT_DOCUMENTS_MAX_PENDING_BYTES of submitted text
(64 MiB by default) is waiting, a new submission is refused with 429 and a Retry-After in
seconds, and nothing is written; a smaller one that fits is still accepted. Wait that long and
send it again: a bulk load is a series of waves, each refused until the Node has worked through
the one before. The cap rests on a measured 100 KB/s of embedding, so 64 MiB is about eleven minutes of
backlog.
Withdrawing and restoring. POST /v1/documents/deactivate and /activate take
{"source_document_id", "reason", "request_id"} and, for a document type that keeps each revision,
the revision_label of the revision (its stored id is source_document_id@revision_label; the base
id alone names nothing for such a type). A deactivated document is not retrieved but is not
deleted. The request_id is required and the same one again is a retry; one used for the
other target state is refused with 409. A call for a document the store does not hold is still
answered 202 and ends failed with the reason not_found. Before a call changes anything, the
Node records on its row how many chunks it will change. A call that will change some leaves exactly
one Activity Log entry (document_state_change) with that count, however many times the Node has
to try it, even across a restart: the entry is keyed by the call, so a try that changed the state
and could not write its entry is finished by the next. A call that finds the document already in
that state changes nothing, ends applied with no chunks, and writes no entry on any try.
What became of a call. GET /v1/documents/{call_id} answers by the id a call was acknowledged with:
state | Meaning |
|---|---|
queued |
Waiting for the Node, or being applied |
ingested |
Stored; chunks is how many, and stored_document_id the id it is stored under |
skipped |
Not applied because the revision was already ingested (reason duplicate) or an older one than the one stored (superseded) |
applied |
An availability call took effect (chunks is how many changed; none if it was already in that state) |
failed |
reason is refused (with refused: one field: error type for each problem, such as document_type: unknown_type, or document_type: wrong_source for a type that a file source is configured for), not_found, held (the Node's worker and its store disagreed about whether inference is enabled, a fault of the Node's setup that waiting does not clear), or failed after the Node tried and gave up |
A submission's answer also carries source_document_id, source_revised_at (UTC) and
document_type (generic when it named none), so a failed or skipped call can be matched to the
revision that was sent. An unknown id is 404. The answer never carries text, and any token with
documents can ask about any call.
A submission is not retained. When a call ends, the Node replaces what it queued with a record of
the outcome (the document id, its revision time and type, the outcome, the chunk count and the id of the token
that sent it); the
document text is gone from the queue, and the Node keeps chunks, not source documents. A document
that failed cannot be retried from the queue: send it again, flagged, with a new request_id. A
failure the Node expects to clear is retried for about fifty minutes before the call is given up on:
the embedding endpoint could not be reached or kept failing, it refused its credential or named a
model it does not have (HTTP 401, 403 or 404, which an operator puts right while the documents
wait), or the database could not be reached. Any other failure, among them a refusal of the
document itself (another HTTP 4xx, a vector of the wrong size), is tried three times.
Order trail and genealogy
A person at a site asks for one order across the site's Nodes with two routes. They need a token
carrying correlation and nothing else opens them (mint one with
deployment/mint_management_token.sh --id plant-lead --scope correlation --expires-in 90d). Each answers for the
Node whose Management API it is: the Node is asked who else took part, and it asks its declared
peers for their part.
GET /v1/orders/{order_id}/trailis the order's record, every Activity Log entry that names it (from this Node and from each peer), the Node Types that contributed, the peers that did not, and any Nodes whose records of the order disagree.GET /v1/orders/{order_id}/genealogyis one page of the materials that went into the order and the other orders each was consumed in.
deployment/kindred_management.sh trail MO-1001 \
| jq '{order_id, complete, truncated, entries_total, not_contributed}'
{
"order_id": "MO-1001",
"complete": false,
"truncated": false,
"entries_total": 3,
"not_contributed": [
{"node_type": "MES", "address": "10.0.0.5:8443", "outcome": "unreachable", "reason": "unreachable at the last rescan"}
]
}
The order id is the one on file in this Node's identity store. It may hold a / (PO/2026/17) or a
space, and the wrapper sends it percent-encoded; with curl, encode anything but letters, digits and
. _ ~ - / yourself, and pass --path-as-is so that curl does not collapse a . or .. segment of
the id. An id is at most 256 characters and holds no NUL character. The / of an id is part of the
path, so a reverse proxy in front of the service must pass the path on as it is, without merging
slashes or decoding %2F.
What a peer sees. The service asks as the Node, not as itself and not as the token's holder. It
reads the staged config's communication_interface section and the Node's own certificate,
builds the same client the Node builds, and each peer sees a request from the Node's certificate
identity and answers as it would answer the Node. A peer's own log shows the Node as the asker. The
person and the token are not sent to a peer; they are recorded on this Node only (see below). The
service reads the staged config, which after a sync and before a restart may name other
peers than the running Node asks. It works with the Node stopped, and it keeps nothing between
requests: a peer that was down and is up now is asked again, and a certificate that was renewed is
used at once.
A site that declares no peers is refused. A staged config with no communication_interface
section, or one that names no peers, answers 409 and nobody is asked: there is nothing across
Nodes to assemble. Stage a config that names the peers first.
Incomplete is an answer. A trail with a peer's part missing, and a genealogy page with a peer
missing or a lookup skipped, is a 200. It says so: complete is false (completeness is
incomplete on a genealogy), and not_contributed names each peer that did not answer (its Node
Type, its address, what happened, and a reason written on this side). Nothing a peer sent about a
failure is repeated. Take a complete of true as meaning that every declared peer answered and no read
was cut short. Ask again once the peer is back; nothing needs restarting.
What is capped, and by how much.
| What | Default | Largest | When it is reached |
|---|---|---|---|
deadline_seconds, how long the peers are given |
20 | 24 | Peers that have not answered are named in not_contributed. The clock starts before this Node's own entries are read, so a slow database spends it too. The registry's health check (a hard total of 2 seconds) and a trail's identity fetch (up to 2 more) come on top, inside the service's 30-second limit |
Trail max_entries, the entries in the answer |
2,000 | 2,000 | The earliest are kept; entries_total is how many there were, entries_omitted how many were left out, and truncated is true |
Genealogy page_size, the materials in a page |
50, or max_materials when lower |
max_materials |
next_after_material names where the next page starts |
Genealogy max_materials, the materials looked up on peers in one request |
50 | 200 | A larger page_size is 422 |
Genealogy max_orders_per_material, the other orders listed under one material |
200 | 200 | The first are kept; consumed_in_omitted says how many were left out under each material, and truncated is true |
| Requests running at once | 2 | 2 | A third is 429 with Retry-After: 5 |
A cap bounds the answer and not the work: the entries and the orders are read in full, within the
library's fetch limits, before the cap is applied. truncated is separate from complete: a truncated
answer can be complete, and an incomplete one can fit under its cap. A caller that needs everything
treats a truncated answer as unfinished.
A genealogy is read a page at a time. Pass the answer's next_after_material back as
after_material until it is null. Each page is assembled afresh, so a long order costs one round of
peer fetches per page, and completeness is per page (the causes about the order itself and the peers
that did not contribute are on every page). A page after the last material is empty and states the
total; a materials_total that grew while you read means reading again. A material id over 256
characters is reported as a malformed link (malformed_link in causes) and is not paged, since it
could not be passed back as after_material.
(
set -e # a failed page stops the walk instead of looking like the last one
after=
while :; do
page=$(deployment/kindred_management.sh genealogy MO-1001 page_size=50 ${after:+"after_material=$after"})
echo "$page" | jq -c '{materials_in, materials_total, next_after_material, completeness}'
after=$(echo "$page" | jq -r '.next_after_material // empty')
[ -n "$after" ] || break
done
)
{"materials_in": ["LOT-A"], "materials_total": 3, "next_after_material": "LOT-B", "completeness": "complete"}
{"materials_in": ["LOT-C"], "materials_total": 3, "next_after_material": null, "completeness": "complete"}
The narrative is not here. The routes return the structured trail and genealogy and no drafted account of the order: writing one needs a model, and this service has none.
A trail is per Node. Each Node's Management API answers for itself, from its own record of the order and its own peers. There is no call that asks several Nodes' APIs for one site-wide view; ask the Node that holds the order's record.
What each request leaves. The routes change nothing but the Activity Log. Each request writes one
entry on this Node: trigger correlation_request, task type order_trail or genealogy, the token's
id as token_id, the order under requested_order, and an outcome of answered, incomplete,
refused:<reason> or failed:internal. A refusal for 429 is written too, so a client that ignores
Retry-After adds a row for each attempt; a 401, 403 or 422 writes none. The log is checked
first and the request is refused with 503 if it cannot be reached, before any peer is asked. An entry
that cannot be written after that is logged on the service and does not fail the request, as for the
config check. The entry stays on this Node: a peer's read of this Node's Activity Log never receives an entry that
carries requested_order, so the asker's token id does not cross to a peer, and a trail leaves these
entries out of its own read, so asking about one order many times cannot make a whole trail read as
incomplete. Each peer asked also leaves its usual entry on this Node; the request's own entry is not
one of an order's trail entries.
| Status | When |
|---|---|
200 |
A trail or a genealogy page, complete or not |
404 |
No identity record is on file for the order on this Node (a record only a peer holds does not stand in for it) |
409 |
The trail's record is not resolved, on this Node or on a peer (the answer says which, and does not name the peer); no config is staged; the staged config declares no peers; or the Node asking is not known. A genealogy never checks the record's status |
422 |
A parameter is outside its range, or the order id is empty, over 256 characters or holds a NUL |
429 |
Two such requests are already running |
503 |
The Activity Log or the identity store cannot be reached, or the staged config or the Node's certificate cannot be used to ask the peers (the answer names the class of fault, never a path or file content) |
The review page
GET /ui serves one HTML document for the sign-off and identity-match routes above, so a person can
review without writing a call. It needs no token, because a browser navigation cannot send one, and it holds
no data: it asks for a token, keeps it in the page's memory, and calls the routes from the same origin. It is
not part of /v1 and not in GET /v1/openapi.json; the routes it calls are. Enter a token that carries
signoff.
What it shows, how it is styled and served, how it handles the token and Rotate token, what its tests cover and what a person still checks before a release are in The review page.
Failures
Every error body is {"detail": "..."} with a message that never repeats a secret, a credential
or a repository URL; details go to the service's log. The one exception is a malformed request (422
from the request itself, not from a config verdict), whose detail is a list of {loc, msg, type}
entries that name the field and never its value. GET /v1/openapi.json declares the bearer scheme,
each route's scope and these answers.
| Status | Meaning |
|---|---|
| 202 | Not a failure: a document call was accepted and committed to the queue, and not yet applied |
| 401 | No token, or one that does not work: malformed, unknown, revoked, expired, or a secret a rotation replaced whose grace window has passed. Identical for all of them, with WWW-Authenticate: Bearer. Every route under /v1 answers it; the review page, which needs no token, never does |
| 403 | The token is valid but lacks the route's scope (validating a ref also needs sync; a check needs check; staging a bundle, rolling back, asking the assistant and every change to the draft need configure, which sync does not imply). On POST /v1/tokens/revoke: the certificate names several Kindred identities or one that is not listed, or the node lists no administrator (see Administrator certificates) |
| 404 | The ref was not found in the repository, the config path is not in it, (config, validate) nothing is staged, (rollback) there is no prior config, (draft, stage, export, migration) there is no draft, (a save that starts from the staged config, or a migration of it) nothing is staged, (schema) no Node Type is known yet or none has that name, or (sign-off record, identity match) no such record, or (alert acknowledgement) no such alert, which includes an id that is not an alert and an alert whose entry is not written yet, or (document status) no such call, or (an order's trail or genealogy) no identity record on file for the order on this Node |
| 409 | Sync: another sync is already running; wait and look at /v1/status, do not loop. A bundle, a rollback or a draft route: another sync, bundle, rollback or draft change is already running (so is a sync refused for the same reason). The staged config and the draft are untouched. A draft save: a draft already exists and the save carries no revision, a stale one or no replace, or there is no draft at that revision, or the staged config cannot be read. Check: another check is already running. GET /v1/config: the staged config is ambiguous (both a plain and an encrypted file) or not valid. A sign-off decision: the record was already settled by a different action or reviewer (read it with GET /v1/signoffs/{record_id}; do not resend with a new action_id expecting a different outcome), or the action_id already recorded a different decision or edit. An identity match: the same, and also a confirmed inferred match whose candidate is gone or no longer canonical (the match stays Pending and can be rejected). A re-opening: the match is not rejected, or it was already re-opened by a different action or reviewer. An alert acknowledgement: the alert was already acknowledged (see Alerts). A document availability call: the request_id was already used for the other target state. An order's trail: the record is not resolved (on this Node or on a peer), or (trail and genealogy) no config is staged, the staged config declares no peers, or the Node asking is not known; see Order trail and genealogy. A rotation: the token is being changed (another rotation, a mint or a revoke holds the token file) or was rotated again since the request was checked; nothing changed and the secret sent still works, so try again |
| 413 | The request body is over 1 MiB, or (a bundle) the config file in it is over about 0.9 MiB, or (a draft save) the draft it makes is over 1 MiB |
| 429 | A document submission would take the text waiting in the queue over its cap, or two trail or genealogy requests are already running, or a rotation comes from a token rotated less than a minute ago (nothing was written and the secret sent still works); Retry-After says how many seconds to wait |
| 422 | The request is malformed, the ref is not a valid git ref name, the candidate is invalid (the message lists the errors), the candidate is for another Node Type than the one on this appliance, the candidate cannot be decrypted, or the config file is too large. A bundle: its format version is not 1, its ref or commit is not shaped like one, its file name is not config.json or config.enc.json, or its file is not the kind (plain or encrypted) of the staged one. A rollback: the prior config no longer validates, or is not the kind of the staged one. A draft save: the document's node_type is not one this appliance has, a credential is not a non-empty text value, is kept where none is stored, or sits where the schema places none, or too many credentials change at once. A draft stage or export: the draft is not a valid config, or holds a credential where the staged file is plain. An assistant request: it holds a credential the draft already has (nothing was sent to the model), the draft and schema do not fit the model's window, or no change passed the checks within the attempts (nothing was changed; the last findings are in the answer). A migration: the config names a Node Type this appliance does not have. A sign-off decision: the body has an unknown field or a bad decision or action_id, or edited content has different top-level keys from the original, or has a NaN or infinite number, or a NUL or lone surrogate in text or a key. An identity decision: the body has an unknown field or a decision other than confirmed or rejected. A re-opening: the body has an unknown field or a bad action_id. A certificate revoke (POST /v1/tokens/revoke): the body is not JSON or not marked Content-Type: application/json, is not an object holding just an id, or the id does not fit the id rule (a letter or digit, then up to 63 of letters, digits, ., _ and -); only a caller the certificate admitted gets this. The identity list: a status the service does not know. An order's trail or genealogy: a parameter outside its range, or an order id that is empty, over 256 characters or holds a NUL. A document call: a field missing or malformed, a flagged submission with no request_id, text the database cannot hold, a body that is not valid UTF-8 JSON, or a base id and revision label containing @ |
| 502 | The repository could not be reached, or (the assistant) the inference endpoint gave no usable answer to any attempt |
| 503 | No repository is configured; git is not installed; the repository credentials file is unusable (missing, or readable by anyone but its owner); there is no age key for an encrypted candidate, or to set, remove or read a credential; the service has no Node Type definitions (MANAGEMENT_NODE_TYPES_DIR is wrong or empty); or the assistant has no inference endpoint set, or the Activity Log is unavailable (sync, check, a bundle, a rollback, an assistant request, a draft stage and an export, and a draft change that sets or removes a credential, are refused before they do anything, and a sign-off decision before the record is touched), or the sign-off, alert or identity store cannot be reached, or the Node has not yet upgraded its alert tables, or an alert acknowledgement was recorded but could not be completed (repeat the same request with the same disposition), or the Node has not yet upgraded the identity table (identity decisions and re-openings only), or a decision or re-opening was recorded but its Activity Log entry was not written (repeat the same request, with the same action_id), or (a rotation) the Activity Log cannot be reached, or the token file cannot be written, so the old secret still works, or (POST /v1/tokens/revoke) the token file or the retired list is unsafe, malformed or could not be written, or the removal was left unfinished, or (trail and genealogy) the staged config or the Node's certificate cannot be used to ask the peers, or (document calls) the queue cannot be reached or does not exist yet because the Node has not started with a rest document provider |
| 504 | The repository did not answer in time, or the 30-second request limit was reached (the assistant's own limit is longer, never above 600 seconds). For sync, see the note above: check /v1/status before retrying |
| 500 | Anything unexpected. Nothing was staged by a failed attempt |
Tokens
The life of one token, step by step, from the mint to the revoke and what to do when a person leaves, is in Management API tokens: the lifecycle.
A token is 32 random bytes, URL-safe base64. The service stores only each token's SHA-256, never the token itself, in its token file.
The token file
The token file is a UTF-8 JSON list of {id, scopes, sha256}, mode 0600, owned by the service user. Some entries carry more:
expires_at, for a token that expires;previousandrotated_at, for one rotated lately (see Rotating your own token);never: true, for one minted with--no-expiryon purpose.
How the file is written:
- The service writes the file only to rotate a token and to revoke one on an administrator's request. Both replace it whole, under the lock the commands take.
- The commands below write it as plain ASCII, so a file they wrote reads the same under any locale. A file edited by hand must stay UTF-8 JSON.
The service refuses to start if the file is missing, empty, not UTF-8, unparseable or readable by anyone else. It also refuses to start if the file holds:
- a duplicate id, an unknown scope, a malformed hash or an unknown key;
- an
expires_ator arotated_atthat is not an ISO 8601 time with a UTC offset; - a
neverthat is nottrue, or that sits beside anexpires_at; - a
previousthat is not a hash and such a time, or whose hash another secret already has.
Minting a token
Mint one on the appliance, as the service user and not root:
deployment/mint_management_token.sh --id NAME --scope SCOPE [--scope SCOPE ...]
[--expires-in 90d | --expires-at TIME | --no-expiry] [--token-file PATH] [--save-to FILE]
- Scopes. Choose at least one from the table above. The script refuses any other. Give a monitoring system
readonly, and a reviewersignoffonly. --idis the token's only name: letters, digits,.,_and-, up to 64. A retired id is refused (see the lifecycle page for choosing one). The script refuses an id that exists, or one this node has revoked.- No network call. The script makes none, so an id another node has revoked is not known here. Revoke on every node of a site with the cascade tool.
Where the secret goes, and where it does not
The plaintext is shown once, because nothing stores it.
- Without
--save-to, it is printed on the terminal and nowhere else, so it is in that terminal's scrollback. - With
--save-to FILE, it is written to a new file instead, mode0600, owned by whoever ran the script (the service user). The script refuses a file that already exists, or a directory that cannot be written, before it mints anything. That file is the caller's token file that the commands above anddeployment/kindred_management.shread. The wrapper refuses one that is not its caller's own, so use it as that user. - If the file cannot be written after the token is minted, the script prints the plaintext as the only copy and says so.
- The secret is never in
.env, in the config repository, in the Activity Log or in the service's log. - What the node keeps is the SHA-256 in its token file, and the id, scopes and the account that ran the command in the Activity Log.
- A holder keeps the plaintext in their own
0600file, or types it into the review page, which keeps it in memory only.
A mint is written to the Activity Log first
A mint is written to the Activity Log before the token exists. A node whose Activity Log is not configured or cannot be reached refuses mint, and no token is left behind. There is no option to mint without the entry.
That includes the first mint on a new appliance, which needs the database settings in .env and the Activity Log table that provision_node.sh creates. What is written is under Token actions in the Activity Log.
The service follows the token file
The service looks at the file on every authenticated request and re-reads it when it has changed. A token minted or removed takes effect on the next request, for every scope, with no restart.
- A change that cannot be loaded leaves the tokens read before it in force, so a token that change was meant to remove still works. Causes are a file that is missing, readable by others, not valid JSON or too deeply nested to read, or that holds an entry the service refuses.
- How it is reported. The problem is logged once, without a hash, and
GET /v1/statusreportstoken_file.stateasreload_failed. Fixing the file is noticed on the next request. The service still refuses to start on a file like that. - A request already past authentication when its token is removed finishes normally.
- How a change is noticed. By the file's inode, size and modification and change times. Two same-size in-place edits inside one clock tick of the file system, with no request between them, can be missed until the file changes again. A
mintorrevokereplaces the file, so it is never missed.
Listing and revoking
deployment/management_tokens.sh list shows each token's id, scopes and expiry, and never a hash.
deployment/management_tokens.sh revoke --id NAME removes a token and retires its id. The id goes on a list beside the token file (NAME.revoked, mode 0600, kept per node). list --revoked and the administrator routes show its ids and times, and mint refuses a retired id from then on.
- What the list holds. It also keeps the revoked token's hash, which the service reads for one thing: to name the id in the log when that token is presented (below). It decides nothing.
- Handling. Because it holds hashes, treat the file like the token file: mode
0600, and not in a ticket or a wider backup. - Version. It is read only by this version and later. A node rolled back to an earlier version refuses the list (
mintstops, anddoctor.shfails) until the hashes are removed from it. - When it starts. The list starts when
revokefirst runs. A token taken out of the file by hand is not on it.
Keep the revoked list with the token file. Nothing warns when it is lost, and a list that was lost cannot be told from one that is empty (it is served as an empty list). Restoring or re-provisioning the token file on its own would let a retired id be issued again. Back the two up together.
- A list that is unsafe or malformed stops
mintuntil it is put right, but never stops arevoke. The token is removed, a warning says its id could not be retired, and the id could be issued again until the list is fixed. doctor.shsays how many ids the list holds and fails on one the commands would refuse. It cannot know about a list that is gone.- If
revokefails after it retired the id, the token is still honoured, and the message says to runrevokeagain.
One node at a time
Every node has its own token file and its own revoked list. Nothing is held centrally. A node never reads another's, so a revocation made on one node reaches the others only when an administrator sends it there with the cascade tool. See Revocations across nodes, which also says what it does not cover.
What the commands refuse. revoke refuses an id that does not exist, and refuses the only token left. A file with no token is one the service will not load, so it would keep honouring the token you removed. Mint another first.
Locking. mint, revoke, set-expiry and reset each replace the file whole and hold a lock beside it (.NAME.lock, left in place). Two of them at once cannot undo each other: one that finds the lock held waits up to ten seconds, then stops with a message and changes nothing. A holder's rotation takes the same lock and never waits (see Rotating your own token).
doctor.sh reports the scopes the tokens carry. It reads the file, not what a running service holds. When it names a problem with the file, the running service may still be honouring the tokens it last read. token_file in GET /v1/status is the service's own account of that.
Replacing a secret, and failed authentication
An admin replaces a token's secret with reset, under the same id (see Resetting a token). A holder replaces their own with POST /v1/tokens/rotate. Neither changes the id or the scopes.
A failed authentication is logged, and never written to the Activity Log, so unauthenticated traffic cannot flood it. The log line carries the caller's address and the route, and never the token. It names the token's id in these cases:
- the token is real but lacks the route's scope;
- the token is one this node revoked, logged as
revoked token 'NAME'; - the token has expired, logged as
expired token 'NAME'.
An unknown token has no id to log. A token revoked before the list kept hashes is logged as unknown, and so is one a node took out of its file by hand.
The answer is the same 401 for a revoked token as for an unknown one, so a caller learns nothing from it. An expired token is answered the same way (see Token expiry).
Token expiry
A token may carry an expires_at, an ISO 8601 time with a UTC offset (2027-03-01T00:00:00+00:00;
a time with no offset is refused, so is null). From that instant, the instant included, the
service refuses the token with the same 401 and the same WWW-Authenticate: Bearer header it
gives an unknown token, so a caller learns nothing from it. The check is made against the clock on
every request, so a token expires with no restart and no reload; only the service's log says the token
was expired, by id (expired token 'NAME'), never the token. An entry with no expires_at never
expires, so a token with no expires_at loads and works.
Every mint needs an expiry, one of:
| Option | Meaning |
|---|---|
--expires-in 90d |
Expire that many whole days from now |
--expires-at TIME |
Expire at that ISO 8601 time, with a UTC offset |
--no-expiry |
Never expire. Refused for a token that carries signoff, sync, check, configure, alerts, correlation or admin, which a person holds; accepted for the rest, such as a read-only monitor |
| none of these | The node's MANAGEMENT_TOKEN_LIFETIME_DAYS gives the expiry; unset, the mint is refused |
The expiry may not be further out than MANAGEMENT_TOKEN_MAX_LIFETIME_DAYS (default 180) from now, nor
in the past. A refused mint writes no Activity Log entry and leaves no token, and the refusal is made
before anything is written. Both settings are whole days from 1 to 364, read from the environment,
else .env; the service refuses to start on any other value, and on a MANAGEMENT_TOKEN_LIFETIME_DAYS
past the ceiling. --expires-in and --expires-at are options of deployment/mint_management_token.sh,
which passes them on. install_management_api.sh --mint-operator-token mints the operator token with
MANAGEMENT_TOKEN_LIFETIME_DAYS, else the ceiling.
Giving an existing token an expiry. deployment/management_tokens.sh set-expiry --id NAME (--expires-in 90d | --expires-at TIME) sets or replaces the expiry of a token that exists and changes
nothing else: not its secret, its hash, its scopes or its id, so the holder does nothing. It is held to
the same ceiling, refuses a time that has passed, and refuses an id that does not exist or was revoked.
Its Activity Log entry is written first, and it is refused when the log cannot be reached, as a mint is.
It cannot remove an expiry.
Seeing it.
management_tokens.sh listhas anEXPIREScolumn: the time in UTC,(expired)after one that has passed, andneverfor a token with none. It never shows a hash.GET /v1/statustoken_filealso reportsexpired_tokens(how many tokens in force are past their expiry now),earliest_expiry(the earliest of any token that has one, past or not, elsenull) andtokens_without_expiry.doctor.shwarns for each token that has no expiry (an entry with noexpires_athas none), each that expires within 14 days and each that has expired, naming its id, and reports how many tokens have no expiry. A warning does not change its exit status.- A response to an authenticated request carries
X-Token-Expires-At, the token's expiry in UTC, so a holder can see how long the token has left. A token with no expiry gets no header, and neither does a401or a403. An error answered to an authenticated caller from inside a route (a404, for instance) carries it; a body the framework rejects as malformed (422) does not. The API description (GET /v1/openapi.json) names the header on every bearer route's success answers, and namesCache-Control: no-storeon the routes that send it (the rotation route, the route that tells a token its own scopes, the two revoke routes and the token listing); a test calls them, so the description and the routes cannot drift apart.
A revoke removes a token and retires its id and changes no other entry, so it never touches an
expiry. A holder renews an expiry by rotating (below); an admin does it with
set-expiry, or replaces a token whose holder cannot, and an early end is revoke.
Rotating your own token
POST /v1/tokens/rotate, with the token to be replaced as the bearer token and no body, replaces that
token's secret in place. The id and the scopes do not change, so a sign-off still names the same
reviewer and the retired ids are not touched. Any token may call it, whatever scopes it carries. It rotates the token on this node only: a holder of
tokens on several nodes calls it on each.
{"id": "NAME", "token": "the new secret, shown once"}
- The answer is the only copy of the new secret. It carries
Cache-Control: no-store, and the service keeps only the hash. Store the secret before doing anything else. - The old secret keeps working for a grace window,
MANAGEMENT_TOKEN_ROTATION_GRACE_SECONDS(default300, from0to3600;0ends it at once). A caller whose response was lost calls the route again with the old secret inside the window and gets a working one. The window is judged against the clock on every request, with no reload. After it the old secret is answered401, the same as an unknown token, and the service's log sayspresented a secret a rotation replaced, by id. Only one replaced secret is kept: a second rotation replaces it, so the secret from before the first rotation ends at that moment. The window is the cost of a lost response: it leaves a stolen secret usable for as long, so rotation is not the answer to a leaked token: an admin'sresetis. - The expiry is renewed. A token that expires gets
X-Token-Expires-Atset to now plus the node'sMANAGEMENT_TOKEN_LIFETIME_DAYS, elseMANAGEMENT_TOKEN_MAX_LIFETIME_DAYS(the ceiling; the lifetime may not exceed it). That may be later or earlier than the expiry it had, including one an admin set withset-expiry. A token minted with--no-expirystays without one. An expired token is401on this route like any other: it cannot rotate, and an admin replaces it. - The entry goes in first. The rotation writes its Activity Log entry (
token_rotated, see the table) before the secret is replaced, and is refused with503when the log cannot be reached; the old secret then still works and the token file is unchanged. A file write that fails after the entry is503too, with the old secret valid and anot_issuedentry correcting the first. - It never waits. The route does not queue behind a mint, a revoke or another
rotation holding the token file's lock: it answers
409at once, and so it does when the token was rotated again between the check and the write. Nothing changed, the secret sent still works, and the caller tries again. Of two rotations at once, one wins and the other is told409. - Once a minute at most. Any token may call the route, so a token rotated less than 60 seconds ago
is answered
429with aRetry-Afterheader (whole seconds to wait) andCache-Control: no-store. The check comes before anything else: no Activity Log entry is written and the token file is not rewritten, and the secret sent still works. A caller whose answer was lost and who asks again with the old secret inside the minute is held back the same way; it waits the seconds the header names, and the old secret is still in its grace window if that is longer. The token file keeps the time of the last rotation asrotated_at; a file with none loads, and aresetclears it. - The new secret, the old one and their hashes are never in the Activity Log, a log line or an error body.
POST /v1/tokens/rotate
Authorization: Bearer <the current token>
Asking a token for its own scopes
GET /v1/tokens/self, with the token as the bearer token, answers the token's id and the scopes it
carries, sorted, and nothing else. Any token may call it, whatever scopes it carries, because the answer
is only what the caller already holds.
{"id": "NAME", "scopes": ["alerts", "signoff"]}
- The scopes are advice to the caller. A client such as the review page asks once, to
decide which of its views the token can open without making a request that is refused to find out. It
decides nothing: every route still checks the token's scopes itself, and a
403from any route is answered as ever. - Nothing of any other token and no secret. The answer holds no hash, no secret and no other token's
id. The expiry is not repeated in the body: it is in the
X-Token-Expires-Atheader of every authenticated answer, this one included. - It writes no Activity Log entry, and so it answers when the log is down. It tells the caller only what the caller holds; the token listing, which names other tokens, does write one.
- It is never cached (
Cache-Control: no-store). - An unknown, revoked, expired or replaced token is answered with the same
401as on every other route.
GET /v1/tokens/self
Authorization: Bearer <the token>
The wrapper rotates its own token
Every answer to an authenticated call says when its token expires (X-Token-Expires-At, see Token
expiry). deployment/kindred_management.sh reads that header from the call it was asked
to make and, after the call is done, rotates its token when fewer than 30 days are left, writing the
new secret to the same token file. A caller who runs kindred_management.sh status a few times a month
therefore never meets an admin, as Rotating your own token intends.
KINDRED_MANAGEMENT_ROTATE_BEFORE_DAYS=14 deployment/kindred_management.sh status
- The call comes first and is never changed by the rotation. The wrapper prints the call's answer and exits with the call's status whatever the rotation does. The rotation is made with the secret the call used, which works. Everything the wrapper has to say about a rotation goes to the error output, one line each, and never holds a secret.
- When. The threshold is
KINDRED_MANAGEMENT_ROTATE_BEFORE_DAYS(a whole number of days, default30;0turns rotation off; anything else is refused before a request is made). A token with no expiry, a call refused with a401or403(which carry no expiry) and a header that is not a time rotate nothing. The wrapper also rotates a file at most once a day, judged by the file's age, whatever the node's token lifetime. Without that, a node whose lifetime is shorter than the threshold (MANAGEMENT_TOKEN_LIFETIME_DAYSmay be as low as1, and a token may be minted to last 7 days) would rotate on every call, and each rotation is an Activity Log entry, a rewrite of the token file and a secret kept for the grace window. It says so when a rotation leaves the token still inside the window: set the threshold below the node's lifetime. - How the file is written. The wrapper makes a
0600file in the same directory as the token file, asks the service to rotate, writes the new secret into that file and renames it over the token file, so the old secret is never lost to a failed write. The new file is mode0600and the caller's. A token file that is a symlink, is not the caller's or can be read by others is refused before any request, as for every call, and so rotation never reaches it. The directory must be one the caller can write to, and the token file a plain file in it, not a mount point (a file mounted into a container cannot be renamed over; mount the directory). - Somewhere to put the secret comes first. The wrapper does not ask the service to rotate until it
has made the file and written to it (so a full disk or a directory it cannot write to is found out
before the secret exists). It then reports
not rotatedand leaves the service and the file as they were; the next call after the fault is mended rotates. A rotation that cannot be saved after the service has rotated cannot be retried by the wrapper: the old secret works for the grace window, but the service has by then given the token a new expiry, so the wrapper sees nothing to rotate. The message says so, and an admin resets the token. If only the final rename failed, the new secret is in the temporary file (mode0600), whose name the message gives: move it over the token file within the grace window. - Only one run rotates a file. The wrapper takes a lock on a file of its own beside the token file
(
.NAME.lock, left in place) without waiting. A run that finds it held leaves the rotation to the run that holds it, and a run that finds the file already holds a different secret than the one it used leaves it alone. Several scripts that call the wrapper at once on one file therefore rotate it once, and the file ends holding the secret the service holds. Rotation needsflock; a machine without it gets a message and no rotation. - What a failed rotation says.
409(the service is changing the token just now) and503(the Activity Log or the token file cannot be written) leave everything as it was, and a later call tries again.401means the service no longer accepts the token. A service that cannot be reached is reported and not asked again. An answer that never came is asked for once more with the same secret, which the grace window allows; if that gets none, or is refused, the first request may have rotated the token, and the message says an admin resets it if it stops working. A rotation that did not happen is tried again by every later call until it does, so a token whose file cannot be rewritten says so each time: turn rotation off for it. - The notes are on the error output. A caller that merges the two streams (
2>&1) and reads the result as JSON will meet a note on the day a rotation first happens: keep them apart, or set the threshold to0. - One token file, one holder. A copy of the file on another machine, or the same token typed into the
review page, is not rotated with it: a rotation ends the secret it replaced after the grace window,
so every copy of it stops working then. Give each machine or script its own token, with its own id.
With
MANAGEMENT_TOKEN_ROTATION_GRACE_SECONDS=0there is no window, and a script that began a call with the old secret before another run's rotation lands is refused.
Resetting a token
deployment/management_tokens.sh reset --id NAME [--expires-in 90d | --expires-at TIME] [--save-to FILE],
run on the node as the service user, gives a token that exists a new secret under the same id and
scopes and ends the old secret at once. It is for a holder who cannot rotate (the secret is lost, or
the token has expired) and for a token that has leaked. Unlike a rotation it has no grace window, and
a secret a rotation was still keeping for its window is dropped with the rest, so after the command no
secret the token ever had works except the new one. It is per node: the holder's tokens on other nodes
are other secrets, and are reset on those nodes if they need it.
- The new secret is printed once on the terminal, or with
--save-to FILEwritten to a new file, mode0600, exactly as for a mint (see Tokens); a file that exists, or a directory that cannot be written, is refused before anything changes. It is shown nowhere else: not in the Activity Log, a log line or an error. - An expired token can be reset. It has no valid secret to rotate with, so the reset gives it an
expiry again, or the new secret would be dead on arrival: now plus
MANAGEMENT_TOKEN_LIFETIME_DAYS, elseMANAGEMENT_TOKEN_MAX_LIFETIME_DAYS(the ceiling), the same as a rotation. A token that has none (one minted withmint_management_token.sh --no-expiry, or before expiry existed) stays without one.--expires-inor--expires-atreplaces that default with a time of your choice, held to the ceiling and to the future as inset-expiry; that is also how a token with no expiry is given one. A reset renews an expiry the token has, so it may be later than one set withset-expiry. - It refuses an id that does not exist or was revoked, naming which, and changes nothing. A revoked id is never issued again; to bring a person back, mint under a new id.
- The entry goes in first, and there is no override. The reset writes its Activity Log entry
(
token_reset, see the table) before the file changes, and is refused when the log cannot be reached, with the old secret still working and the file unchanged. There is no option to reset without the entry: a system that cannot record who was given access should not give it. If the file cannot be written after the entry, anot_issuedentry corrects it. - A running service reads the new hash on its next request; no restart.
Recovering a token: the runbook
Run each command on the node the token is for, as the service user. NAME is the token's id.
A reviewer is stranded (the secret is lost, a rotation's response was lost and its grace window has passed, the wrapper reported that it rotated the token but could not save the new secret, or the token has expired). A holder who still has a working secret rotates it themselves and needs no admin. Otherwise reset it and hand the new secret over by the channel the site trusts:
deployment/management_tokens.sh reset --id NAME --save-to FILE
The id, the scopes and the reviewer's earlier decisions are unchanged. The expiry is renewed as
described under Resetting a token. Confirm with deployment/management_tokens.sh list, which shows the new expiry.
A token has leaked. Reset it, at once, and do not rotate it. The old secret keeps working for the
grace window after a rotation (MANAGEMENT_TOKEN_ROTATION_GRACE_SECONDS, default 300 seconds), and
during that window it can call the rotation route itself, which would hand the thief a current
secret. A reset has no window:
deployment/management_tokens.sh reset --id NAME --save-to FILE
Then read what the id did from the time of the leak:
deployment/kindred_management.sh activity-log reference_id=NAME start=TIME limit=1000
with TIME the time of the leak (ISO 8601 with a UTC offset; entries come oldest first, and a longer
answer carries a next_cursor). That shows the token's syncs, decisions and rotations. Reads and refused attempts are not in it (see
the lifecycle page). The person's tokens on
other nodes are other secrets: reset them too if they were kept where the leaked one was. If the
holder must not have access at all, revoke the token instead.
A reviewer leaves. Revoke the token on every node the person held one on; do not reset it, because a reset leaves the id live and issues a working secret:
deployment/management_tokens.sh revoke --id NAME
The steps for finding every token, covering the other nodes and confirming are in When a person
leaves. revoke refuses the only token left on
a node.
The Activity Log is down. reset, mint and set-expiry write their entry first and are refused
while the log cannot be reached, and so is a holder's rotation (503); none has an override. Restore
the log first (the database it is written to), then reset. revoke is never held up by the log: it
removes the token, says on its error output that the entry was not written, and the entry is kept
and written the next time a command can reach the log. The exception is the node's last token: revoke refuses it, and it
cannot be replaced while the log is down, because mint is refused. Restore the log before
removing it.
Listing the node's tokens
GET /v1/admin/tokens answers with the tokens this node is enforcing and the ids it has retired, for an
administrator who has no shell on the appliance. It needs the admin scope, and that scope opens
nothing else: an admin token is answered 403 on GET /v1/status, the Activity Log and every other
route, and a token with every other scope is answered 403 here. (The exceptions are the two routes
any token may call on itself: rotation, and the route that tells it its own scopes.) The first admin token is
minted on the appliance, as for any other: deployment/mint_management_token.sh --id NAME --scope admin --expires-in 90d. install_management_api.sh mints none.
admin stands alone, and it always expires:
mintrefusesadminbeside any other scope, before it writes a token or an Activity Log entry, so an administrator's reviews and their administration are two tokens with two ids. A token file edited by hand to holdadminbeside another scope still loads, so the service starts and the token keeps every scope it holds;doctor.shnames such a token as a warning.--no-expiryis refused for it, as forsignoff,sync,check,configure,alertsandcorrelation(see Token expiry).
The answer:
| Field | Meaning |
|---|---|
tokens |
Each token in force, in the token file's order: id, scopes (sorted), expires_at (ISO 8601 in UTC, or null for a token that never expires; a token past its expiry is listed with it, since the expiry says it is refused) and self, true for the token that made the request |
revoked |
Each retired id with revoked_at, oldest first, as list --revoked shows them; null when the list cannot be read |
revoked_reason |
null, or the fixed sentence the list of revoked token ids is unavailable when revoked is null. The tokens are still listed |
token_file |
loaded, or reload_failed when the token file changed into a state that could not be loaded. The tokens listed are then the last good set, which is what the service is still enforcing, including a token the change was meant to remove |
The list is what the service enforces and not a fresh read of the file: a token minted or revoked on the
appliance appears or goes on the next call, with no restart. No hash, no secret (the one a rotation
replaced included) and no file path is ever in the answer; the retired list holds a hash for each id,
and none is served. The answer carries Cache-Control: no-store.
A listing is recorded, and fails closed. The listing is the read of the credential list, so the route
writes a token_listed entry before it answers (see Token actions in the Activity
Log): the asking token's id and scope and how many tokens came
back, and no id it returned. It is published on the Activity Log topic like a revoke entry. If the entry
cannot be written the route answers 503 and returns nothing, because an administrator locked out by a
database fault still has the shell. Listings by one token inside 60 seconds write the first entry and
then one listed_again entry carrying their count (written when that token next lists after the minute
has gone, or when any other listing settles it), so a page that reloads or polls does not fill a log that
cannot be pruned. A different token, or a listing after the minute, writes its own entry. A read or
signoff token is 403 and a refused listing writes nothing. Only this route records: listing through
the token commands (management_tokens.sh list), at startup, in the revocation cascade or in
doctor.sh writes no entry, because they carry no token to name.
Revoking a token from the API
POST /v1/admin/tokens/{token_id}/revoke removes one token of this node and retires its id, for an
administrator with the admin scope. It calls the same revoke the token command does (the file lock,
the atomic write, the id retired before the token goes), so a revoke from the API and one from
management_tokens.sh revoke leave the same files and the same Activity Log entry. It acts on this node
only and reaches no other node: on any other node the token is still honoured until it is revoked there (an
administrator revokes on every node with the cascade tool).
The token stops working on its next request, with no restart. A request it already had under way finishes normally. The request has no body. The answer:
| Field | Meaning |
|---|---|
id |
The id of the token that was revoked |
scopes |
The scopes it held, sorted |
retired |
true, or false when the retired list could not be used: the token is removed all the same, and mint refuses to run until the list is put right |
activity_log |
written, or kept when the log could not be reached and the entry waits beside the token file to be written later, or lost when it could not be kept either: note the revoke down |
| Status | When |
|---|---|
200 |
The token was removed |
401, 403 |
No token or an unknown, expired or revoked one, or a token without admin. Both are answered before the id is looked at |
404 |
No token has that id, or it is already retired: one fixed answer ({"detail": "no such token"}), so a second request is answered as a mistyped id is |
409 |
{"error": "own_token"} for the caller's own id: a node always keeps the administrator who is acting, and removing the last admin is done on the appliance. {"error": "only_token"} for the node's only token. Nothing was changed |
422 |
The id does not fit the id rule (a letter or digit, then up to 63 of letters, digits, ., _ and -). The token file is not read |
503 |
The token file could not be changed, or is unsafe or malformed (it is not rewritten, and the answer says what is wrong without the path), or the removal was left unfinished: the id was retired but the token is still honoured, and repeating the request finishes it |
Two requests for one id at once leave one 200 and one 404. The Activity Log never holds the removal
up: the entry is the command's token_revoked entry with the admin_token_id of the token that asked
added, its trigger management_api, and never a token, a hash or a path. Its operator is the account
the service runs as, as the command's is the account that ran it. A repeat is the same entry, not a
second.
Administrator certificates
POST /v1/tokens/revoke is the one route that takes a certificate and no token. The listener asks
every caller for a site-CA client certificate and does not require one, so a call with a token and none
is served as ever. The route admits a caller only when their certificate names exactly one Kindred
identity and that identity is in MANAGEMENT_ADMIN_IDENTITIES. An administrator's identity is an ordinary
one from deployment/issue_node_certificate.sh whose node-instance is the administrator's name
(urn:kindred:plant1:admin-ada). Every Node certificate is a site-CA certificate too, so a valid one that
is not on the list is refused: a compromised Node cannot administer the site.
In a browser. The request names the site's certificate authorities, so a browser that holds none of
their certificates is not asked to choose one. A certificate that the site CA did not issue is refused in
the handshake and the page does not load (Chrome reports ERR_CONNECTION_RESET); other browsers word it
differently. Naming the authorities needs one OpenSSL call that Python does not expose, made only on a
64-bit CPython 3.12 or 3.13 with the default build and a shared OpenSSL. On anything else the service
starts as before, logs a warning that it will not name the site CA, and a browser may offer every
certificate it holds.
| Status | When |
|---|---|
401 |
The caller sent no certificate, over TLS or plain HTTP, or one that names no Kindred identity. The body and header of every other 401. A bearer token, whatever its scopes, is a caller with no certificate: the route never reads it |
403 |
The certificate names several Kindred identities, or one that is not listed, or the node lists no administrator at all (MANAGEMENT_ADMIN_IDENTITIES unset answers 403 to everyone, certificate or not) |
200 |
The certificate was accepted and the request understood. The answer says what this node did (below), for any id, and a repeat is a 200 too |
422 |
For an admitted caller only: the body is not JSON, is not marked Content-Type: application/json, is not an object holding just an id, or the id does not fit the id rule (a letter or digit, then up to 63 of letters, digits, ., _ and -). The answer lists where and why, never what was sent. Nothing is changed |
503 |
The token file or the retired list is unsafe, malformed or could not be written: nothing was changed, and the answer says what is wrong without the path. Or the removal was left unfinished (the id was retired, the token is still honoured): repeat the request to finish |
The check comes before anything of the request body is read, so a refused caller learns nothing from a
malformed body and costs the service nothing for a large one (a body over 1 MiB is refused with 413
before this, as for every route).
Revoking a token id by certificate
curl --cacert trust-bundle.pem --cert admin-ada.crt --key admin-ada.key \
-H 'Content-Type: application/json' -d '{"id": "reviewer-ada"}' \
https://NODE:8470/v1/tokens/revoke
The route is built to be sent to every node of a site without knowing which of them hold the token, and
to be sent again. It never answers 404 or 409: whatever the id, the node ends with that id retired,
and result says how it got there.
result | The node |
|---|---|
removed |
Held a token with that id, not its only one. The token is out of the token file, its id is on the retired list, and the token is refused from the next request |
withheld |
Held a token with that id and it is the node's only token. It is kept, because a token file with none is refused when the service loads it, and so it still works. The id is on the retired list. Mint another token and send the request again to remove it |
retired_only |
Held no token with that id. The id is on the retired list, so mint never issues it here |
already_retired |
Held no token with that id and had retired it already. Nothing was written |
The answer is {"id", "result", "retired", "activity_log"}. retired is true, or false when the retired
list could not be used: a token is then removed all the same (taking access away does not wait on the list)
and mint refuses to run until the list is put right. For withheld, retired_only and
already_retired an unusable list is a 503 instead, because nothing else would have been done.
activity_log is written, kept (the log could not be reached and the entry waits beside the token file
to be written later, as for the other revokes) or lost: note the revoke down. The answer is never cached.
The change is made under the lock and by the atomic write the revoke command uses, the id retired before
the token leaves the file, so a request in flight finishes and the next is refused, and two requests at
once for one id leave one removed and one already_retired. Sending removed's request again changes
no file. A token whose id an earlier revoke retired but could not remove is removed by the next request.
Each answered request adds an entry to the Activity Log (see
Token actions in the Activity Log) naming the administrator's
identity, the token's id and the result, and never a token or a hash. The same administrator getting the
same result again is the entry already written and adds no second; a different result, or a different
administrator, is a new entry, so a withheld and the removed that follows it are both on record, and
so is a second administrator's request for an id the first had already retired. The removal never waits on the log. The service's own
log records the same three facts.
A certificate that does not chain to the Node's trust bundle ends the TLS handshake, on every route,
not only this one: the connection is refused before any request is sent. (Python's TLS layer cannot finish
the handshake and treat such a certificate as absent.) A client that attaches a certificate must therefore
attach a good one. A connection is kept alive after its handshake, so the certificate's validity period is
checked again on every request, and one that has run out is answered 401. TLS 1.2 session resumption
(see Where it listens) can let a client that held a session from before a CA roll
reuse it, without its certificate being verified again, until that session expires (minutes). Plain HTTP on loopback carries no certificate, so the list can never admit anyone
there; the service says so at start when both are set. The service refuses to start if an entry is of a
site other than the one the Node's own certificate names; the site is read when the service starts, so a
Node re-enrolled under another site needs its identities changed and a restart. Refusals are logged with the identity that was
refused, never a token.
A browser that holds a certificate from the site CA (an administrator's) may ask its user to choose one when it opens the review page over TLS; declining it changes nothing, since the pages need no certificate.
Revoking on every node: the cascade tool
management_tokens.sh revoke with --nodes, --range, --retry or --status is the administrator's tool
for the route above. It sends one revoke to every node of a site, prints what each node did, and remembers
the nodes it missed so they can be tried again. It runs as the administrator, from any machine that can
reach the nodes' management API (which listens on loopback unless a network address was set; see Where it
listens). It is not run as the service user and reads no token file. The plain
revoke --id NAME of the tokens section is still the local one, on the node it runs on.
deployment/management_tokens.sh revoke --id NAME --nodes nodes.txt
deployment/management_tokens.sh revoke --id NAME --nodes nodes.txt --range 10.20.0.0/24
deployment/management_tokens.sh revoke --retry [--id NAME]
deployment/management_tokens.sh revoke --status [--nodes nodes.txt]
Set-up, once per administrator. Issue the administrator's certificate with
deployment/issue_node_certificate.sh SITE admin-ada on the workstation that holds the site CA, and list
urn:kindred:SITE:admin-ada in MANAGEMENT_ADMIN_IDENTITIES on every node. Put the three files where the tool
looks, ~/.kindred-admin/ (or the directory in KINDRED_ADMIN_DIR): admin.crt, admin.key and
trust-bundle.pem (the site CA's). The certificate and the key must be yours and mode 0600; the tool
refuses to run, before any connection, when either is open to anyone else, is another account's, or is not a
regular file, and it tells you to run chmod 600. It also refuses a certificate that is out of date, does not
match its key or does not chain to the trust bundle. Neither file is ever printed or logged.
The nodes file lists the nodes you expect, one address a line: an IP address, or ip:port ([ipv6]:port),
in a private network, with blank lines and # comments ignored. A hostname, a public address, an address
listed twice or a file with no address is refused. Include the node you are on: the cascade does not touch
this machine's token file.
| Flag | Meaning |
|---|---|
--id NAME |
The token id to revoke. Required, except with --retry (every id with a missed node) and --status |
--nodes FILE |
The expected nodes. The exit status is zero only when every one is done |
--range CIDR |
Sweep an IPv4 range for nodes. Refused, before any connection, when wider than a /22 (1024 addresses), IPv6, or not wholly inside 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, loopback or link-local. With --nodes, a node of your site found in the range and not in the file is listed as found, not expected, is not asked to revoke and does not count as done. With a range alone there is no list to compare with, so the nodes found are the targets (a range that finds none is a failure), and a node that does not answer the sweep is not in the output at all: the run says so, and the exit status cannot vouch for a node it never saw. Give --nodes too |
--retry |
Ask again only the nodes the state file records as missed, for --id or for every id. It takes no --range, and a --nodes given with it is ignored (the tool says so). A run that leaves none missed empties the file |
--forget ADDRESS |
With --id, stop recording a node as missed: it is out of service, or you revoked it by hand. The node may still honour the token; this is the administrator's decision, and the only way a miss leaves the record other than the tool reaching the node |
--status |
Print what the tool holds and exit: the administrator's certificate, the nodes file, and per id the addresses listed, done and missed. Exit status 1 when anything is missed or refused. Also written management_tokens.sh --status |
--cascade |
Says the command is a cascade; --nodes, --range, --retry and --status each say it too |
--cert FILE, --key FILE, --ca FILE |
The administrator's certificate, private key and the site CA's trust bundle |
--state-file FILE |
Where missed nodes are recorded (default .revocation_retry_state beside the administrator's files) |
--port N |
The port for an address that names none (default 8470; a sweep uses it too) |
--timeout SECONDS |
The whole of one node's exchange, from connecting to the last byte, not each read (default 5, at most 60) |
--parallel N |
Nodes asked at once (default 16, at most 64) |
management_tokens.sh starts the tool from the checkout and sets the environment variable KINDRED_CALLER_DIR to the directory you ran it from; the tool changes back to that directory first, so a relative --nodes, --cert, --key, --ca or --state-file means what you meant. It is set by the script; set it yourself only when running python -m engine.management.cascade directly from another directory.
Who counts as a node. The tool connects, and before it sends anything checks that the responder's
certificate chains to the site CA and names a Kindred identity of the administrator's own site. A host that
fails either is not sent the request and is not reported as a node: it is a miss for an address you listed
(certificate not verified, or answered with an identity that is not of this site), and nothing for one the
sweep merely tried.
Output. One line for each node, IDENTITY ADDRESS RESULT, in the nodes file's order, then any node found
and not expected, then the summary. IDENTITY is - when nothing identified itself. Progress and refusals go
to the error output, so the standard output is only the lines and the summary.
urn:kindred:plant1:node-1 10.20.0.11:8470 done (removed)
urn:kindred:plant1:node-2 10.20.0.12:8470 done (retired_only)
- 10.20.0.13:8470 missed (timed out)
urn:kindred:plant1:node-9 10.20.0.19:8470 found, not expected
Missed (1):
10.20.0.13:8470 timed out
Run again with --retry once they are reachable.
A node is done when it answered removed, retired_only or already_retired. It is missed when it
answered withheld (the person's token is the node's only one, so it still works there: mint another token
on that node, then --retry), did not answer (timed out, unreachable), or failed (certificate not verified, TLS failed, administrator certificate refused for a 401 or 403, answered an error status,
malformed answer, node could not write the change for a 503). The summary names every missed node and the
reason. The exit status is 0 only when every address in the nodes file is done; it is 1 otherwise or when a
refusal stopped the run, and 2 for a command line that is not valid.
The state file holds, for each id with a node still missed, the addresses of the latest run, how many are
done, and each missed address with its reason. A run adds its misses and clears the nodes it reached; a node
that an earlier run missed and this run did not ask (a shorter file, a range, a different file) stays recorded,
and the run exits 1 while any node is recorded for the id. The record is written as soon as the nodes are
answered, and an interrupted run (Ctrl-C, a dropped session) records the nodes it did not finish as not attempted,
so nothing is forgotten by stopping. It is mode 0600, written whole through a rename so it is never half
written, and one run at a time changes it. It holds no token, hash, certificate or key: nothing in it is
secret, but it is the list of nodes that may still honour a revoked token, so keep it. A state file that is
open to others, is another account's or is not one this tool wrote is refused and never overwritten. A run that
leaves nothing missed for an id removes the id from the file. The route is idempotent, so running the cascade again changes nothing on a node already done.
Limits. A node that is down may issue the retired id again until the tool reaches it, and a holder who
keeps rotating a token on a node the tool missed keeps it alive until it does; the state file is how every missed
node stays known. A node nobody listed is only found if a sweep covers its address, and then only reported. The
sweep needs the management API reachable on the LAN. A withheld token still works.
The token administration page
GET /ui/tokens is a page over the two admin routes above, for an administrator who has no shell on the
appliance. Browse to it on the management API's address (for example https://NODE:8470/ui/tokens on a
network bind) and enter an admin token's secret, the one line mint_management_token.sh prints. It lists
each token in force with its scopes and expiry (an expired token is marked Expired, and one that ends
within three days Expires soon), and the retired ids with when. Revoke asks once, naming the token and
what follows, then calls the revoke route. The page says beside its lists that a revoke acts on this node
only and that no other node is told. It mints nothing, rotates nothing and shows no secret or hash, and the row of the token the page is
using has no button: a node always keeps the administrator who is acting.
It is served like the review page: one HTML document without a token, under a policy that names the hash of its one script and one style and allows no outside network, with the token kept in the page's memory only (never in the address, the browser's stored data or a cookie), so a reload or Forget token asks again. An id is shown as text, never as markup. The page is not part of the public API baseline, as a page is not an API contract.
What the tests cover. The page's policy and headers, that the document has no script-injection sink and no use
of browser storage, that every route, query name and response field it uses is in the served description and
needs the admin scope, and the two routes it calls are tested. The page itself runs in a real Chromium against
the shipped service (tests/test_browser_pages.py): the list shows each token once and marks the page's own,
Revoke asks first and then removes the token for good, a double click on Yes, revoke sends one revoke, and
Forget token empties the page and asks for a token again.
Checking the token administration page. To check the page against a running service on a test
appliance, use three tokens: an admin token, a signoff token and a second signoff token past its expiry.
mint will not give a token a past expiry, so mint the third with
--expires-in 1d and set its expires_at in the token file to a past time by hand (the service reads the
file when it changes). Mint each with --save-to FILE and enter the secret from the file.
Each line below is what the page does:
- [ ] Token entry:
/ui/tokensopens without a token and asks for one; entering theadmintoken shows the three tokens and, under Retired ids, none. - [ ] A refused token: a mistyped token returns the page to the token entry and says so (401).
- [ ] A token without the scope: entering the
signofftoken shows the page's message that it is not an administrator's token (403), and no list. - [ ] The list: each token shows its id, scopes and expiry; the expired token is marked Expired; no secret or hash appears anywhere on the page.
- [ ] Your own token: the row of the token the page is using says it cannot be revoked here and has no Revoke button.
- [ ] Revoke asks once: Revoke on the live
signofftoken names its id and scopes and says it stops on its next request and its id is retired on this node and no other node is told; Keep it closes the question and changes nothing. - [ ] Revoke: Yes, revoke removes the token from Tokens in force and lists its id under Retired ids
with a time;
management_tokens.sh list --revokedon the appliance shows the same id. - [ ] The revoked token is refused: entering the revoked token's secret returns the page to the token
entry (401), and
deployment/kindred_management.shwith that token is refused the same way. - [ ] A second click: with the page open on a token that someone else has since revoked on the appliance, Revoke and Yes, revoke show it as already gone and the list is read again without it.
- [ ] A reload forgets the token: reloading the page returns it to the token entry, and the address bar, the browser's stored data and its cookies hold no token.
- [ ] A new token starts clean: Forget token and then entering the
signofftoken shows the message for a token without the scope and none of the earlier list.
The order trail page
GET /ui/trail is a page over the two order routes in Order trail and
genealogy, for a person at a site who has no shell on the appliance. Browse
to it on the management API's address (for example https://NODE:8470/ui/trail on a network bind) and
enter the secret of a token that carries correlation. Type an order id and choose Show trail or Show
genealogy.
It is a viewer, not part of the API. The page is a UI only. It is not in GET /v1/openapi.json, not
part of the public API baseline, and not an API contract: a page is not one. The routes it calls are in
both. It holds no data of its own, calls only GET /v1/orders/{order_id}/trail and
GET /v1/orders/{order_id}/genealogy, and changes nothing but the Activity Log entry that each of those
requests leaves, unless the service refuses it for a token or a parameter (401, 403, 422), which
writes none. kindred_management.sh already has trail and genealogy for the same two routes and
is unchanged by the page.
What it shows.
- The trail: the order and its record's status, then a completeness line, then the entries in order with Node Type, instance, time, task and outcome (filterable by Node Type), and any records that differ, by field name. The completeness line says Complete, or Incomplete with each Node Type that did not contribute, its address and the route's reason in the route's own words, or how many of the entries are shown. A trail with a peer's part missing is never shown as complete, and the entries that did arrive are still listed.
- The genealogy: one page of materials at a time, each with the other orders it was consumed in. Its
completeness line says it is for this page. A list the route cut is said to be cut, which is not the
same as incomplete; a material that was not looked up is listed by id and never shown as consumed
nowhere else. Next page passes
next_after_materialback until the route names none, and an order id in the genealogy opens that order's trail. A Next page that is refused or times out leaves the page being read on screen beside the message, with Try this page again; only a first-page lookup clears the answer before it asks. - A refusal:
404,409,422,429and503each say which refusal it was, followed by the route's own reason (see the table under Order trail and genealogy); for a422that is the list of the parameters the service did not accept, and any other status is shown as "The service answered" with the status and what it said. A trail the route cut says "Showing N of M entries", and that every Node answered if none failed. A401returns the page to the token entry, saying the token may be mistyped, expired or revoked. A403does the same and says the token does not carrycorrelation.
It is served like the review page: one HTML document without a token, under a policy that names the hash of its one script and one style and allows no outside network. The token is kept in the page's memory only (never in the address, the browser's stored data or a cookie), so a reload or Forget token asks again, and an answer that arrives after that is ignored. Everything on the page is text, including what a peer sent; no markup is built from data. A lookup is a request the person makes: the page does not refresh itself, asks one thing at a time, and shows a pending line while it waits.
What the browser tests cover. The page runs in a real Chromium against the shipped service, with the order
routes answering from a canned table (tests/test_browser_pages.py) under the content security policy the
service computes for it, and each test fails on a script error, a logged error or a request to another origin.
The page's policy and headers, that the document has no
script-injection sink and no use of browser storage, and that every route, query name and response field it uses
is in the served description and needs the correlation scope are tested too:
| What is checked | The test |
|---|---|
| A complete order: Complete, entries as plain text, the genealogy, paging to the last page | test_a_lookup_shows_the_order_its_record_and_its_entries, test_next_page_walks_the_materials_two_at_a_time_and_ends |
| A peer that did not contribute: Incomplete, the peer, its address and the route's reason, the entries that arrived, Complete again once it answers | test_a_peer_that_did_not_contribute_makes_the_trail_and_the_genealogy_incomplete |
| A refused order (404, 409, and the busy and unavailable answers) | test_a_refused_first_lookup_says_why_and_leaves_no_answer_to_be_mistaken_for_it |
A token the service refuses (expired 401, read 403), and a valid one working after |
test_a_token_the_service_refuses_returns_the_page_to_the_entry_and_a_good_one_works_again |
| A reload forgets the token and the order, and the browser stores nothing | test_a_reload_forgets_the_token_and_the_order_and_the_browser_stores_nothing, test_forget_token_clears_the_order_and_the_answer |
The tests do not run a lookup against real Nodes. Against a running site, a complete order reads Complete, a stopped peer makes the trail Incomplete naming it, and a started one makes it Complete again.
Revocations across nodes
A token is revoked on one node, and it is revoked on the others when an administrator sends the revoke there. No node reads another's list of revoked ids, and a node makes no network call about revocations of its own accord: the cascade is a push, started by a person.
What a revoke reaches.
- This node, on its next request, when
deployment/management_tokens.sh revoke --id NAMEruns on it (or an administrator sends the revoke to it). - Every node of the site, when an administrator runs the cascade tool,
deployment/management_tokens.sh revoke --id NAME --nodes nodes.txt, from any machine that can reach the nodes (see Revoking on every node: the cascade tool). The tool prints what each node did, exits non-zero while any node listed was not reached, and remembers the nodes it missed so thatrevoke --retrycan try them again. - A node nobody listed is not reached. A node the tool missed keeps honouring the token until a retry reaches it.
- A node that holds the person's token as its only token retires the id and keeps the token (see the limits below), so the token still works there.
- Nothing outside the nodes. A revoke does not reach a copy of the plaintext in a holder's own file or browser; the token stops working but the copy stays, and no node tells anyone to delete it.
No pulling. A node does not name its peers or pull their revoked ids on an interval. This has these effects:
GET /v1/revocationsanswers404, andpeer_revocationsis not inGET /v1/status.- The
revocationsscope is not offered:mint_management_token.sh --scope revocationsis refused, and--allow-unreachableis not an option.mintmakes no network call. MANAGEMENT_PEERS,MANAGEMENT_PEERS_TOKEN_FILEandMANAGEMENT_PEERS_INTERVAL_SECONDSare ignored. A node that still sets one starts and logs a warning naming it; remove them (see Installing it).- A token file that still holds the
revocationsscope loads. The service drops the scope and logs one line,management token file: obsolete scope revocations ..., naming the tokens it dropped it from; a token left with no scope is skipped. A node-to-node pull token is useless: remove it withrevoke --id, and the peer token file with them. doctor.shnames each obsolete setting and each token that lost the scope, and asks the running service forGET /v1/revocationsto confirm it answers404; a service that answers something else is a failure (restart it).- An id a node pulled in the past stays retired on that node. Nothing is removed.
Limits. These are documented and not closed:
- Ids revoked before a node kept a list are not on it. The list starts when
revokefirst runs on a node, and a token taken out of the file by hand is not on it. Run the cascade for such an id: a node that holds no token with it answersretired_onlyand puts the bare id on its list, so it is never reissued there. (The localrevoke --id NAMErefuses an id that has no token.) - A node the tool did not reach may issue the id again. A mint refuses only an id this node has retired. Until the cascade reaches a node, it can mint that id, so keep the state file and retry.
- A revocation that would remove a node's last token is not applied. The service will not load a
token file with no token, so removing the last one would leave it honouring the token it was meant to
remove. The node answers
withheld, the id is retired, and the token stays. Mint another token under a new id on that node, then runrevoke --retry. - An id means the same thing on every node. A revocation removes the token with that id wherever it is, so use one id for one person on every node, never give it to anyone else, and never give one id to two different tokens on two nodes: revoking either takes away both.
- The last token cannot be revoked while the Activity Log is down.
revokerefuses the only token left, andmintis refused without the log, so the replacement for a leaked sole token cannot be made until the database is back.
Token actions in the Activity Log
Minting a token, giving one an expiry, a holder rotating their own, an admin resetting one, revoking one on this node and an admin token listing the tokens each write
Activity Log entries, so the log shows when a reviewer's token was created, changed or taken away. Every
entry has trigger management_api and belongs to the Node's own node_instance_id once the Node
has reported one, else to management_api.
task_type | outcome | reference_ids |
|---|---|---|
token_minted |
minted |
minted_token_id, scopes (sorted, comma-separated), expires_at (UTC, or none for a token minted with --no-expiry) and operator |
token_minted |
not_issued |
minted_token_id and operator: the mint that wrote a minted entry then failed, so no token was issued |
token_expiry_set |
expiry_set |
expiry_token_id, expires_at (the new one), previous_expires_at (or none) and operator |
token_expiry_set |
not_issued |
expiry_token_id and operator: the change that wrote an expiry_set entry then failed, so the token's expiry is as it was |
token_rotated |
rotated |
rotated_token_id, expires_at (the new one, or none), previous_expires_at (or none) and grace_seconds; no operator, because the token's holder asked: the token's id is the caller |
token_rotated |
not_issued |
rotated_token_id: the rotation that wrote a rotated entry then failed, so the secret is as it was |
token_reset |
reset |
reset_token_id, expires_at (the new one, or none), previous_expires_at (or none) and operator |
token_reset |
not_issued |
reset_token_id and operator: the reset that wrote a reset entry then failed, so the secret is as it was |
token_listed |
listed |
listing_token_id (the admin token that asked), scopes (its scopes, sorted) and tokens_returned (a count). It names no token the listing returned and no secret |
token_listed |
listed_again |
listing_token_id, scopes, listings (how many more times that token listed inside the window) and window_seconds (60) |
token_revoked |
revoked |
revoked_token_id and operator |
token_revoked |
removed, withheld, retired_only or already_retired |
revoked_token_id and admin_identity: the administrator whose certificate asked POST /v1/tokens/revoke, and what the node did |
operator is the account that ran the command: the account that used sudo to become the service
user, else the account itself. It is read from the command's environment (SUDO_USER, else the login
name), so it names an account as the shell reported it and does not prove who typed the command. An entry holds ids, scopes, an account and an administrator's identity, and never a
token, a hash or the path of a file. Entries of the type token_revoked_from_peer, written for a revocation pulled from a peer, can still
be in the log; the service writes none. They are read like any other entry:
api -G "$BASE/v1/activity-log" --data-urlencode task_type=token_minted --data-urlencode limit=2 \
| jq '{entries: [.entries[] | {task_type, outcome, reference_ids}]}'
{
"entries": [
{"task_type": "token_minted", "outcome": "minted", "reference_ids": {"minted_token_id": "reviewer-ada", "scopes": "signoff", "operator": "admin"}}
]
}
- A mint is refused when it cannot be audited. Its entry is written before the token is, so no
token exists that the log does not know about. A node whose Activity Log is not configured or
cannot be reached refuses
mint, as above.set-expiryandresetare refused the same way, and so is a holder's rotation. - A revoke is never held up by the log. Taking access away does
not wait on an outage: the token is removed first and the entry written after. When the log cannot
be reached
revokestill completes and says on its error output that the entry was not written; the entry is kept in<token file>.unwritten(mode0600, beside the token file) and written the next time the log can be reached, by the next successfulmint,set-expiry,resetorrevoke, or a holder's rotation (alistwrites nothing). An entry that could not be kept either is reported by the command, and the revoke is to be noted down. doctor.shcounts what is waiting. It prints aWARNINGwith the number of entries in the.unwrittenfile (the count, never their content), and another when that file cannot be read. The exit status is not changed by it.- A repeat writes no second entry. An entry's id comes from the host, the token file, the kind of action
and the token's id, so a second
revokeof an id adds nothing. - Known limit: a process killed between an entry and its change to the token file leaves the entry with
no correction. A mint,
set-expiry,resetor rotation that fails cleanly after its entry (the id was taken in the meantime, the token changed while the entry was written, or the file cannot be written) writesnot_issued. A process killed in that gap, by a power loss orkill -9, cannot, so the log can show a token minted, an expiry set or a secret replaced that is not in the file. Comparemanagement_tokens.sh listwith the entries when it matters.
The log's append-only guard and hash chain protect an entry after it is written. They do not establish who held a token when it was used.
What a recorded reviewer establishes
A decision on a sign-off record or an identity match records three things: the id of the token that
authenticated the request, the action_id, and the time. That is all it establishes. In particular:
- A token is a bearer secret. Whoever holds it is, as far as this service can tell, that reviewer. It cannot tell the holder from anyone the holder gave it to or who copied it.
- The id is a label. It is chosen by whoever ran
minton the appliance, and shows nothing about the person beyond the site's own token-handling practice.revokeretires the id on this node andmintnever issues it again, so a decision recorded under an id is never confused with a later holder's. The retired ids are kept per node (see the service follows the token file above); ids revoked before this was kept are not on the list. A node learns the ids another has retired only when an administrator revokes them there too (see the limits), so do not give two nodes' reviewers the same id either. - One token per person is a site procedure, not something enforced. Nothing stops one token being shared, or one person holding several.
- There is no second factor, no re-authentication per decision, and no signature manifestation. A decision is therefore a decision-attribution record. It is not a 21 CFR Part 11 electronic signature, and nothing in this document or the service claims it is. A site that needs those properties is asking for something this service does not provide.
- The log shows when a token was created or removed, not who held it. Minting and revoking are shell actions on the appliance and each writes an entry (see Token actions in the Activity Log), so the log shows when a reviewer's token was created or taken away and by which account. The log's append-only guard and hash chain protect an entry after it is written; they do not establish who held the token when a decision was made.
Give each reviewer their own token with --scope signoff, name it so the site can tell its holder
(reviewer-ada, not reviewer1), and revoke it when they stop reviewing. A reviewer's browser must
trust the site's CA to open the page: see Opening it in The review page.
Where it listens
By default 127.0.0.1, plain HTTP, so the appliance's own tooling needs no network exposure. Any
other bind must be a literal private-network IP address (not 0.0.0.0, not a hostname, not a public
address) and is served over TLS with the Node's own certificate. The service refuses to start on
such a bind if that certificate is missing or invalid, so it is never served in the clear.
The certificate is the Node's, and the service has no certificate settings of its own. It reads
node.crt, node.key and trust-bundle.pem from the Node's certificate directory, the one
install_node_certificate.sh installs into: KINDRED_NODE_PKI_DIR in its environment or .env,
else ~/.kindred-node-pki of the service user, exactly as the certificate scripts choose it, except that those scripts read only their environment.
install_management_api.sh --pki-dir DIR writes it to .env (and install_node_service.sh reads it
from there); give the certificate scripts the same directory in KINDRED_NODE_PKI_DIR. A
MANAGEMENT_* setting that names a certificate, key, trust bundle or PKI directory is refused at
start, since it would otherwise be ignored and the Node's certificate served regardless. The service
runs as the same user as the Node, so it can read the key.
A renewed certificate is served from the next connection, with no restart and no signal: the service
checks the files on each connection and rebuilds only when they have changed. A new set that does not
validate is logged once and the previous certificate keeps serving; one that has expired while being
served is logged once as an error. Callers are asked for a certificate and not required to send one: the bearer token is
the authentication of every route but POST /v1/tokens/revoke, and a
valid Node certificate without a token is refused like any other request. The service never negotiates below TLS 1.2. Session tickets are off, but TLS 1.2 session-ID
resumption cannot be, so a client holding a session from before a renewal may resume it, and so not see
the new certificate, until that session expires (minutes).
The directory the service reads (above) and the paths in the Node's own communication_interface.tls
section are set separately. Keep them the same directory; the Node warns at start when they are not,
because otherwise this API would serve and report a different certificate from the Node's.
Request limits: a body over 1 MiB is refused with 413 before it is parsed; a request that takes over 30 seconds gets 504; a connection that does not finish its request headers in 10 seconds is dropped.
Installing it
deployment/install_management_api.sh installs the service on an appliance that already has a
Kindred service user, a checkout and a Python environment (run it as root or with sudo):
sudo deployment/install_management_api.sh [--service-user USER] [--state-dir DIR] [--token-file PATH]
[--port PORT] [--repo-url URL] [--repo-path PATH] [--repo-ref REF] [--repo-credentials-file PATH]
[--pki-dir DIR] [--python PATH] [--mint-operator-token]
[--inference-endpoint URL --inference-model NAME --inference-context-tokens N
--inference-output-tokens N] [--inference-reasoning-effort VALUE] [--inference-token-file PATH]
The installer has no option for the listen address; a MANAGEMENT_LISTEN_HOST other than loopback is set by
editing the management_* settings in the checkout's .env.
It creates the state directory (owned by the service user, mode 0700), writes the management_*
settings into the checkout's .env, and installs and enables a systemd unit that runs the service as
the service user, not root, under a sandbox: no new privileges, a read-only file system apart from
the state directory and the directory of the token file (the service replaces the token file when a
holder rotates a token or an administrator revokes one), a private /tmp, no device or kernel access, and network access only over
IP and local sockets, with egress to the repository left open. Running it again changes nothing that
is already right, and rewrites the unit when it is not: an appliance whose unit lacks that access
runs it again, then restarts the service, so that the unit can write the token file's directory.
The Activity Log table the routes read and the sync audits into is created by provision_node.sh, so
a first sync works on a new appliance before any Node has started; on a host provisioned before that,
run python3 -m engine.provision_schema once from the checkout.
It creates no token unless --mint-operator-token is given, never writes the age key and never writes
the repository credentials. Those are the operator's, and the service will not start until a token
exists. With --mint-operator-token the install mints one token as the service user, operator with
the read and sync scopes, into ~/.config/kindred/management-token (the file
deployment/kindred_management.sh reads) and starts the service; it does nothing when the service's
token file or that file already exists, and a mint that fails (the Activity Log cannot be reached)
leaves the rest of the install done and prints the command to run. Any other token is minted by hand.
- Mint a token:
deployment/mint_management_token.sh --id ops --scope read --scope sync --expires-in 90d. The mint is written to the Activity Log, so it is refused until the database is configured in.envandprovision_node.shhas created the log's table. Skip this step when the install minted one. - If the repository needs credentials, put them in a file the service user owns, mode
0600, in git's credential format (username=andpassword=lines), and setMANAGEMENT_REPO_CREDENTIALS_FILEin.envto its path. A file readable by anyone else is refused (503). - Put the age key where
sopsfinds it for the service user,~/.config/sops/age/keys.txt(orSOPS_AGE_KEY_FILEin the unit's environment), if the config is encrypted. Without it every encrypted candidate is refused with 503. sudo systemctl start kindred-management.- Point the Node's
--configat<state dir>/staged/config.json(orconfig.enc.json), so that a restart of the Node loads whatever the last sync staged.
The service needs git and sops on its PATH, and network access to the repository. On a site with
several nodes, see Revocations across nodes for revoking a token on every one.
Setting (.env) | Default | Meaning |
|---|---|---|
MANAGEMENT_LISTEN_HOST |
127.0.0.1 |
Bind address; see above |
MANAGEMENT_PORT |
8470 |
Port |
MANAGEMENT_STATE_DIR |
none (required; the install uses /var/lib/kindred-management) |
Must exist and be writable by the service user: the staged config, its metadata, a lock taken on the directory itself, and .sync-* / .validate-* scratch directories |
RUNTIME_STATE_PATH |
unset (the install sets <state dir>/runtime-state.json) |
Where the Node writes its runtime state and the service reads it. Unset, the running config is reported as unknown |
MANAGEMENT_CONNECTOR_TIMEOUT_SECONDS |
5 |
How long one connector's health check may take before it is reported as failed |
MANAGEMENT_CONNECTOR_CACHE_SECONDS |
30 |
How long a connector health result is reused, so repeated status calls open no repeated sessions (0 turns the cache off) |
MANAGEMENT_NODE_TYPES_DIR |
node-types |
Node Type definitions, relative to the service's working directory |
MANAGEMENT_SHARED_CONFIG_DIR |
unset (the install does not set it) | Where $shared fragments in a config resolve. Set it to the directory the Node is started with (--shared-config-dir); while it is unset a config that uses $shared is judged invalid |
MANAGEMENT_TOKEN_FILE |
none (required; the install sets ~/.config/kindred/management-token-hashes.json of the service user) |
The service's token file of hashes |
MANAGEMENT_TOKEN_LIFETIME_DAYS |
unset | How many days a token lives when mint is given no expiry, from 1 to 364. Unset, a mint must be given --expires-in, --expires-at or --no-expiry. Read by the token commands each time they run, and by the service when it starts for the expiry a rotation gives (unset, the ceiling), so a changed value reaches a rotation after a restart and a reset at once |
MANAGEMENT_TOKEN_MAX_LIFETIME_DAYS |
180 |
The furthest from now an expiry may be set by mint, set-expiry and reset, from 1 to 364; the service refuses to start on a MANAGEMENT_TOKEN_LIFETIME_DAYS past it. Read by the commands each time they run and by the service when it starts |
MANAGEMENT_TOKEN_ROTATION_GRACE_SECONDS |
300 |
How long the secret a rotation replaced keeps working, from 0 to 3600 seconds; 0 ends it at once. Read when the service starts |
MANAGEMENT_DOCUMENTS_MAX_PENDING_BYTES |
67108864 (64 MiB) |
How much submitted document text may wait to be ingested before a new submission is refused with 429; not below 1 MiB, so one document always fits an empty queue. See Documents |
MANAGEMENT_ADMIN_IDENTITIES |
unset | The identities allowed to call POST /v1/tokens/revoke by certificate: comma-separated urn:kindred:<site>:<node> identities of this node's own site, such as urn:kindred:plant1:admin-ada. Unset, that route answers 403 to everyone. A malformed entry, a repeated one, or one of another site stops the service starting (the message names the entry's position, never its text). Not secret. Read when the service starts |
MANAGEMENT_REPO_URL |
unset | https:// or file://, with no password in it. Unset, sync answers 503 |
MANAGEMENT_REPO_CREDENTIALS_FILE |
unset | See above |
MANAGEMENT_REPO_PATH |
config.json |
The config's path in the repository |
MANAGEMENT_REPO_REF |
main |
The ref a sync uses when none is given |
MANAGEMENT_GIT_TIMEOUT_SECONDS |
20 |
One deadline for all the git commands of a fetch |
MANAGEMENT_INFERENCE_ENDPOINT |
unset (the assistant is off) | The site's own OpenAI-compatible inference server for the configuration assistant, http:// or https://, with no name, password or query in it. The endpoint, model, context window and output cap go together: all four or none. With none, POST /v1/config/assist answers 503; a request to the assistant whose token file is unusable does too. Read when the service starts |
MANAGEMENT_INFERENCE_MODEL |
unset | The model that server serves, named exactly as it lists it |
MANAGEMENT_INFERENCE_CONTEXT_WINDOW_TOKENS |
unset | The context window the server runs the model at; the assistant sizes its prompt to it |
MANAGEMENT_INFERENCE_RESERVED_OUTPUT_TOKENS |
unset | The most tokens the model may answer with, sent as the hard cap |
MANAGEMENT_INFERENCE_TOKEN_FILE |
unset (no header sent) | The path of a file (mode 0600, one token) holding the bearer token the model server needs; read for each request, never logged, and its contents are never in a prompt, an answer or the Activity Log. See the configuration assistant |
MANAGEMENT_INFERENCE_REASONING_EFFORT |
unset (not sent) | Sent as reasoning_effort when set, for example none |
MANAGEMENT_INFERENCE_TIMEOUT_SECONDS |
120 |
How long one call to the model may take; with the attempts it sets the route's own time limit, never above 600 seconds |
MANAGEMENT_INFERENCE_MAX_ATTEMPTS |
3 |
How many times the model may be asked for one request |
MANAGEMENT_INFERENCE_TEMPERATURES |
0.1,0.4,0.7 |
The retry schedule's temperatures, comma-separated: attempt n uses the nth, then the last |
MANAGEMENT_INFERENCE_TOP_P |
0.9,0.95,1.0 |
The retry schedule's top_p, the same way |
MANAGEMENT_INFERENCE_CHARS_PER_TOKEN |
3.5 |
The estimate the prompt is sized with |
MANAGEMENT_INFERENCE_SAFETY_MARGIN |
0.9 |
The fraction of the usable window the prompt is planned against |
LICENSE_FILE_PATH, LICENSE_PUBLIC_KEY_PATH |
as the Node's | The license files status reads |
Environment variables override .env.
Ignored settings. MANAGEMENT_PEERS, MANAGEMENT_PEERS_TOKEN_FILE and MANAGEMENT_PEERS_INTERVAL_SECONDS
once named the nodes whose revoked token ids a node pulled, with a token file and an interval. A node
does not pull, so none of them does anything. A node that still sets one starts, ignores it, makes no call
to a peer for revocations and logs a warning at start that names each such setting; doctor.sh names them
too. Remove them from .env and from the environment or unit that sets them.
Release: v0.11.0