# Deployment, operations, and disaster recovery ## Deployment and packaging Meridian is distributed as a native **Go binary** (via `install.sh`, see §Client installation; Compass and Meridian are the same binary, one per platform) and as two container images of the same binary (D1440). The Meridian image, `ghcr.io/beppetemp/cartographer`, holds `git`, `sops`, `age` and `openssh-client`, runs as the non-root user `cartographer` with the entrypoint `cartographer`, and is what Kubernetes, compose on a shared VM, Cloud Run and the MCP Registry entry run. The Surveyor image, `ghcr.io/beppetemp/cartographer-surveyor`, holds `git` and the CA certificates only and has the entrypoint `cartographer surveyor`. **Neither is a local deployment mode** (D73: containers on macOS mean a slow virtualized filesystem for git and SQLite, and an always-on VM). Both sides need `git` 2.43 or later on `PATH` (D2038): the binary runs it for every KB operation, with `--end-of-options` and `git switch`. ### Components Cartographer deploys as four **deployment components**: Meridian, Surveyor, Atlas, Compass. Meridian and Compass are the deployment names of the server and the client roles, and the command names do not change. They are deployment units, **not separate binaries**: every native channel ships one binary per platform and every component below is a subcommand of it (D37, D227, D1439). | Component | What it is | Command | State | Network | Reached through | |---|---|---|---|---|---| | **Meridian** | The MCP server and the only stateful component: the KBs' git working trees, indices, `.cartographer/` runtime files and the credentials directory. **One writer per KB.** It repairs on write always, and on a timer unless a Surveyor owns the repair of the KB or `maintenance.auto_repair` is false. Over stdio it serves exactly one KB and no Atlas; over HTTP, any number | `cartographer serve` (stdio, or HTTP with `--http`/`--config`) | The data directory | Inbound on the HTTP port; outbound to the KBs' git remotes | The binary, the image | | **Surveyor** | A background process for one perimeter of KBs, with its own model profiles and budgets (§The Surveyor (a third role)) | `cartographer surveyor` | None persistent; a writable temporary directory for exec recipes and git reads. The budget is rebuilt from the KBs' logs | No inbound port. Outbound to Meridian, the model endpoints and whatever its own config names: fetch hosts, `git.allow_hosts`, MCP connectors, exec listers | The binary, the image | | **Atlas** | The read-only browser UI. Not a process: it is embedded in Meridian, and `/ui/` and `/api/ui/v1` belong to Meridian | None; one switch, `web.enabled` (`CARTOGRAPHER_WEB_ENABLED`, `--web-enabled`), which the Helm chart exposes as `atlas.enabled`. stdio never serves it | Meridian's | Meridian's HTTP port | Meridian | | **Compass** | What runs next to the agent: `connect`, `sync`, `status`, `doctor` and the workspace bridge `cartographer mcp`. Not a workload: it writes under the agent's `$HOME` and never belongs in a Deployment | `cartographer connect` and the other client subcommands | The agent's `$HOME` | Outbound to one Meridian (the managed Compass follows one `server_url`) | The binary | Meridian also owns the data-directory administration commands (`kb`, `import`, `reindex`, `audit`), which run on the host that holds the data directory: `kb` refuses on a client pointed at a remote server. `cartographer service` manages Meridian's native user service and Compass's sync timer, never the Surveyor. The Atlas is never deployed on its own: a standalone frontend is not a supported topology, and the static public Atlas below is a demo. ### Deployment scenarios Each row is a way of deploying that this page documents or has assembled by hand. **Status** is `documented` when the row links its own section and `assembled by hand` when it has none yet and links the issue that will write it. A new way of deploying is a new row. ![The deployment film: the four components, then all-in-one, client and server, no client, and all together around one KB](https://raw.githubusercontent.com/BeppeTemp/cartographer/readme-film/deployment.webp) | # | Scenario | Components | Status | Where | |---|---|---|---|---| | 1 | Local all-in-one: native service, embedded Atlas, client on the same machine, loopback, auth off | Meridian, Atlas, Compass | documented | §Example: native local service; [getting-started](getting-started.md) | | 2 | stdio: the agent client spawns Meridian (a binary, or the image) | Meridian, no Atlas | documented | §Example: stdio | | 3 | Single VM: server and optional Surveyor under systemd or compose, bearer tokens, reverse proxy | Meridian, Atlas, Surveyor | documented | §Example: single VM | | 4 | Kubernetes minimal: server with embedded Atlas, PVC or `emptyDir`, Ingress | Meridian, Atlas | documented | §Example: K8s pod; the Helm chart, `deploy/helm/cartographer/ci/meridian-minimal-values.yaml` | | 5 | Kubernetes full: the previous row plus one Surveyor per perimeter | Meridian, Atlas, Surveyor | documented | §Example: K8s pod; §The Surveyor (a third role), Packaging; `ci/meridian-full-values.yaml`, `ci/surveyor-scheduled-values.yaml` | | 6 | Serverless: Cloud Run, one instance at most, synchronous push | Meridian, Atlas | documented (retired: the hosted demo no longer answers) | §The hosted MCP demo; `deploy/demo/README.md` | | 7 | Public static Atlas: bundle on Pages, API behind an edge with CORS | A static Atlas snapshot and a live API | documented (**a demo, not a topology to copy**) | §The public static demo | | 8 | Partitioned: different KBs on different servers | Several Meridians, one managed Compass | documented | §Several servers; one Helm release per server, `ci/partitioned-a-values.yaml` | | 9 | Same KB on two servers | Two Meridians | documented | §Several servers | | 10 | Surveyor outside the cluster (a GPU host, a local model), or on any host with the binary or the image, to Meridian over HTTPS | Surveyor | documented | §Example: Surveyor outside the cluster | | 11 | Surveyor scheduled: `--once` from a CronJob or an external scheduler | Surveyor | documented | §Example: Surveyor as a CronJob; `ci/surveyor-scheduled-values.yaml` | | 12 | Surveyor exec recipes: a derived image with its tools and a read-only identity | Surveyor | documented | §Example: a derived image for exec recipes; `ci/surveyor-exec-values.yaml`; `examples/system-recipes/kubernetes/README.md` | | 13 | Compass on a workstation: `connect`, `sync`, workspace bridge | Compass | documented | [configurator](configurator.md) §`cartographer connect`, §`cartographer sync` | | 14 | Compass on a headless always-on host, timer sync | Compass | documented | [configurator](configurator.md) §Headless hosts, CI and agent containers | | 15 | Compass in CI, a devcontainer or an agent pod: the binary in the agent's image, one-shot sync | Compass | documented | [configurator](configurator.md) §Headless hosts, CI and agent containers | | 16 | No client: a remote agent on `/mcp/routed` with a bearer token, no skills or hooks | none | documented | [mcp-clients](mcp-clients.md) | | 17 | Kubernetes Surveyors only: a Helm release with `meridian.enabled: false`, reaching an external Meridian by URL and token | Surveyor | documented | §Example: Surveyors only (Helm); `ci/surveyor-only-values.yaml` | | 18 | Meridian without the Atlas (`atlas.enabled: false` in the chart, `web.enabled: false` otherwise) | Meridian | documented | §The embedded Atlas UI (D227); `ci/meridian-no-atlas-values.yaml` | Three rules sit outside any row. The Atlas is never deployed alone. The same KB on two servers is synchronization, not scaling: two servers never add write capacity or availability to one KB. A Kubernetes or VM recipe never runs two Meridian processes on one working copy (`concurrency.md` §Writer boundary). ### Provisioning artifact signing A KB signs its artifacts with `.signing` in the credentials directory (§Credentials directory, D905): a 32-byte Ed25519 seed in hex. There is no `default.signing`, because a signature names its KB, so a KB without the file serves unsigned artifacts. Mount it from a secret manager or protected secret volume: never commit it, expose it in health/MCP output, or place it in logs. Meridian logs only the KB and derived key ID. Distribute and pin the corresponding public key on each client before switching a signer; unsigned KBs remain supported through the explicit client trust policy. ### KB-provided MCP descriptors The descriptors under a KB's `mcp/*.json` are always distributable (D906): Meridian lists every valid one in the manifest and in `artifact_list`, and `artifact_read` returns it. There is no allow-list on Meridian (`mcp_allowlist`, in a KB's `settings.yaml` or `kbs[]`, is a removed key: it is ignored with a warning and dropped when the file is realigned). The consent lives on Compass, which asks for a per-descriptor, hash-bound approval before it installs one (`docs/sync.md` §MCP servers). Headers and environment references stay references and are never written to the manifest as values. ### State and volumes The Meridian process is **ephemeral** (k8s pod or local service); what persists on volume/disk: - The KBs' git working trees. - SQLite indices (optional, rebuildable). - Optional local runtime files under `.cartographer/`. Search indexes are rebuildable; conflict registries are operational state and should survive a restart until resolved; `search-misses.jsonl` (D247) is a bounded log of searches that found nothing, disposable, lost harmlessly with the volume. `surveyor-history.json` holds the daily counters of the Surveyors' runs for 90 days (`control-plane.md` §Surveyor runs and alarms): one server per data directory, so several servers keep separate histories, and a folder session keeps none on disk; deleting it resets the counters. An entry ages out after 30 days; one whose search finds something now is reported `resolved` by `kb_status` before that (D319). Deleting the file is the only manual reset. `lint-history.jsonl` (D370) holds one sample a day of the whole-KB lint totals (`{at, total, by_handler}`, the latest of the UTC day, 90 days kept, pruned on write): derived state for `kb_status.lint_trend`, rewritten whole, never in the KB's git history, and lost harmlessly with the volume (the trend restarts from the next lint). `usage.json` (D326) holds the artifact usage clients report on `sync`: on an `emptyDir` it is lost at every restart, and until each client syncs again `kb_status.usage` is `no_data` (with `no_report_since`, the start time, D333) and no artifact reads as stale. Keep `.cartographer/` on the KB's persistent volume when that signal matters. Meridian's own state files there (`read-access.json`, `search-misses.jsonl`, `lint-history.jsonl`, the auto-repair log) are read and written only when `.cartographer/` and the file are not symlinks: a KB comes from a remote and git stores links, so with a link in either place the record is dropped and nothing is ever written through it. A file is replaced through a temporary with a random name beside it, never a fixed one. The audit log is always on (D905): MCP tool execution appends an attempt+completion event pair per call to `/audit/audit.log`, or to `audit.log` when it is set, so the file is a complete operational request log (D119), signed with `audit.key` from the credentials directory. See §Audit log below and [transport-auth](transport-auth.md) §Operational audit. `audit.retention_days` defaults to 90 (D325; `0` keeps everything). A configuration that sets `audit.log: /audit.log` keeps that path. ### Configuration: flags, env, YAML `cartographer serve` resolves its configuration from three sources, in order of precedence (highest first): **CLI flag > environment variable > YAML file (`--config`/`CARTOGRAPHER_CONFIG`) > default** (`internal/config`, `config.Default()`). The YAML file is optional: without `--config`, only defaults + env + flags apply, as in earlier versions. Which layer set each value is recorded as the layers are applied (`Config.Origins`, D743) and shown by `cartographer config` and the Atlas Settings page: `default`, `file`, `env` or `flag`, per-KB keys by mounted name. A key written in the file equal to its default is still `file`. Secrets show only `(set)` or `(unset)`. Full annotated example: [`config.example.yaml`](https://github.com/BeppeTemp/cartographer/blob/main/config.example.yaml) (repo root). The example is **generated** from the settings schema (`Schema` in `internal/config/schema.go`: every key with its scope, type, values, default, description, the environment variable and flag that override it, and whether it needs a restart) by `make settings-example`; a test fails when the committed file differs, and another when a key reaches `rawConfig` or `KBSpec` without a schema entry. Edit the schema, not the example. A `config.yaml` written by `service install` is self-documenting the same way: the keys it sets carry their comment and the unset ones are listed commented out under `# --- available settings: uncomment a key to set it ---` (the shorter `# --- available settings ---` divider is read the same), a blank line between keys, each with the value to uncomment: the key's `Example` when its schema entry has one (a map or a list is shown in block style, indented under the key), its default otherwise. Comments are ignored by the parser, so a file without them behaves identically. `kb create`/`kb clone` and `kb rename` give a `kbs[]` entry they add the comment of the keys they set, and leave every comment already in the file alone. **Hooks (`hooks:`).** The server calls external hooks over HTTP webhooks, protocol version 1 (the contract a hook author builds against, each point's request and response: [hooks](hooks.md)); with no `hooks:` entry it behaves as without hooks. Each entry has `name` (`/`), `point` (`write_veto`, `audit_sink`, `secret_resolver`, `identity`), `plugin` (the namespace of `name`, which must be pinned and enabled in `plugins`), `url` (`https`, or `http` only to a loopback host; no credentials in it), `credential` (the name of a file in `credentials_dir` holding the bearer sent as `Authorization`; a missing or empty file stops the start), `timeout` (default `2s`, at most `10s`, over the whole call), `failure_policy` (`fail_open` or `fail_closed`, **required**) and `mode` (`enforce`, the default, or `dry_run`). Per-point keys: `kbs` (`write_veto`), `batch_size` (1 to 1000, default 100) and `blocking` (`audit_sink`, see [transport-auth](transport-auth.md) §The audit sink), `cache_ttl` (`secret_resolver`, `identity`, at most `600s`) and `headers` (`identity`, at most 8 request header names handed to the hook; `Authorization` and `Proxy-Authorization` are refused). A misspelled key, a duplicate name or a `hook:` list stops the load. The keys are YAML only and need a restart. A hook only supplies an input or denies: `allow` or any unknown answer is "no opinion", so a hook cannot widen what the core refused. A failure (timeout, connection error, non-2xx, unparsable or oversized body, a response `version` other than the request's) is applied per the entry's policy: | `failure_policy` | `mode: enforce` | `mode: dry_run` | |---|---|---| | `fail_closed` | the request is denied | logged only | | `fail_open` | the request continues, the failure is logged | logged only | A `secret_resolver` must be `fail_closed`, and `mode: dry_run` is refused for it (it supplies a value or nothing); see [skills-services-secrets](skills-services-secrets.md) §Secrets held by a resolver hook. After 5 consecutive failures a hook's circuit opens for 30 s and the policy applies without calling it; then one probe call decides whether it closes. A redirect is never followed and a response body is read up to 64 KiB. Failures and circuit transitions are logged with the hook name, never a body, URL query or credential. **The write veto (`point: write_veto`).** For a tool that writes, after the core has authorized the call (an admin included: the veto sits outside the authorizer) and before the handler, the server asks each `write_veto` hook that covers the KB (`kbs`, empty means every KB) in config order and stops at the first deny. A tool that writes into another KB (`concept_transfer`, `artifact_move`) is judged on both: the hooks that cover the source KB and then those that cover `target_kb`, and a deny from either side denies; a hook scoped to the target only is asked when content moves into it. When several hooks record a verdict, the audit keeps the strongest (`deny`, then `dry_run_deny`, then `error`) with its hook name. The payload is `principal` (`id`, `kind`, `via`, `groups`), `kb`, `tool`, `class: "write"`, `target` (the audit's allow-listed identifiers, such as the concept id) and the caller's `reason`: never frontmatter, a body, a patch value or a secret name. A deny refuses the write with `forbidden: denied_by_hook: ` (the reason cut to 200 printable characters); a failure under `fail_closed` refuses with `hook_unavailable`; a core refusal never reaches the hook. The audit pair of the call carries `hook` and `hook_verdict` (`deny`, `dry_run_deny`, `error`) among its resources. The call is made **outside the KB lock**: a slow hook delays its own request and no other writer, and nothing under the lock calls a hook. The limit: the veto judges the request, not the final diff, and state can change between the veto and the lock; the check that sees the resulting content is the write gate, which is the core's. A routed `/mcp/routed` write asks the hook once, on the target KB's server. Why: `D1957`, `D1967`. **Pinned plugins (`plugins_dir`, `plugins`).** The server runs no plugin unless its own file pins one: `plugins_dir` is the absolute path of a read-only store (`///`, filled by `cartographer plugin vendor`, which prints the digest and these lines) and `plugins.` carries `digest` (64 lowercase hex, required), `enabled` (default true) and `settings` (scalars). The pin is the only consent: at start, before anything is mounted, a pinned plugin whose tree digest differs, that is missing or edited, that has neither a `server` nor an `atlas` side (the atlas side is data the Atlas draws, `docs/plugins.md` §The Atlas side) or whose side this binary cannot load stops the start with the plugin named; it is never loaded with a warning. A malformed digest, a relative `plugins_dir`, `plugins` without `plugins_dir` or an unknown key under an entry stops the load naming the key. `enabled: false` skips the pin: its tree is not read, but its name and digest are still validated. The keys are YAML only and need a restart (the auth reload does not re-read them); the server never writes into the store and never fetches. Why: `D1936`. A pinned plugin's server side is data: its roles are taken by an `auth.roles` entry with `from: /` and `kbs: [, ...]` instead of `rules` (see [transport-auth.md](transport-auth.md) §Roles from a plugin), and its presets are listed by `preset_list`. Every command that edits Meridian YAML in place (`kb rename`, `kb unmount`, `kb clone --branch`, the git-identity and `kb_aliases` migrations) writes it through one function: the document is re-encoded with a two-space indent (a config indented differently is normalized to it; comments, key order and values are kept), and replaced atomically (a temporary file beside it, `fsync`, rename; a symlink is followed and the mode kept). A crash or a full disk leaves the old file, never a truncated one without its `auth.tokens`. The old names of renamed KBs are not a setting (D906): they are a list of `{from, to}` items in the **server state file** `/.cartographer/state.json` (`kb_aliases`), beside `update-check.json`. `kb rename` and `kb unmount` write it (offline, atomically), Meridian reads it at its start, and an operator never needs to edit it. It makes a routed `?kbs=` select the KB mounted as ``; it is validated when read (valid KB names, no `from` equal to its `to`, no duplicate `from`), and a mounted name always wins over an alias. A server YAML that still carries a `kb_aliases` key is realigned (D903): its items are moved into the state file first, and until then they resolve as before. A server with no `data` directory has no state file, hence no aliases. Three behaviours are fixed, not settings (D906): `serve` never creates a KB (a missing one fails with *create it with `cartographer kb create`*; the `init` key and `--init` flag are removed); `tools/list` shows the core set (every tool not marked **[A]** in [control-plane](control-plane.md) §MCP API) with every other tool still callable by name (`tools.profile` is removed); and a request to `/mcp`, or any state-changing request, with an `Origin` header is accepted only when the origin's host and port are the request's `Host`, one with no `Origin` header (a non-browser client) always is (`mcp.allowed_origins` is removed, see [transport-auth](transport-auth.md) §Origin). Each removed key, environment variable and flag is warned about and dropped by the realignment, never an error that stops the start. A server that would listen **off-loopback with authentication off** refuses to start and says why: loopback is a listen host in `127.0.0.0/8`, `::1` or `localhost`; `auth.mode: off`, or `auto` with no token, is auth off; `:39273` and `0.0.0.0:39273` listen on every interface. The local service pins auth off on `127.0.0.1` (D268) and is unaffected. One startup option is deliberately **flag-only**, with no YAML key and no environment variable: `serve --log-file ` appends the Meridian log — the standard logger and everything written to stderr — to a file, creating the parent directory and never rotating (neither does launchd). It exists because a Windows Scheduled Task's action cannot declare a log destination the way a launchd plist does, and Windows has no journald — so the process takes the path itself and the task's argv stays flat enough for `EffectiveConfigPath` to read `--config` back out of it ([D217](decisions/D217-the-native-service-on-windows-is-a-per-user-scheduled-task.md)). It applies on every platform; a path that cannot be opened is a startup error, because a service that silently logs nowhere is the failure the flag exists to prevent. On Windows, with `--log-file` set, a process that is the only one attached to its console releases it at startup: that console is the window Task Scheduler opens for the task in the user's session, and closing it would stop Meridian. Run from a terminal, the process shares the shell's console and keeps it ([D1479](decisions/D1479-the-windows-service-detaches-from-its-console.md)). `cartographer sync --log-file` is the client-side counterpart, used by the scheduled sync task. It is not in the YAML because it belongs to *this invocation*, not to the served configuration: two services sharing one config file must still be able to log to two files. `serve` reads the `service.env` beside its `--config` (or the file `--env-file ` names) before anything else runs; the implicit read keeps any variable the process already has, so a hand-run `serve` beside an installed service keeps its shell's proxy settings, while an explicit `--env-file` replaces them: `NAME=value` lines that set the proxy and CA variables `service install` records (`HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY`, `SSL_CERT_FILE` and lowercase forms) and, on Windows, the `CARTOGRAPHER_SUPERVISED=1` marker; any other line is ignored and logged by its key. It exists for the Windows task and the cron backend, whose start has no environment of its own, and needs no flag in their definitions; see [configurator](configurator.md) §`cartographer service `. Every key (listen address `http`, `auth`, `data`, `credentials_dir`, `audit`, `git.identities`, `web.enabled`, `update_check`, `feedback.destination`, `kbs[]`, `components[]`) is in `config.example.yaml`, with its default and its environment variable and flag. Notes the example cannot carry: `data` is a directory whose subfolders are auto-discovered as KBs, and paths already mounted explicitly (`kbs[]`, including remote KBs cloned into it) are excluded from discovery, so there is no double mount; the credentials directory defaults to `/credentials`; `auth.tokens` is better given by `CARTOGRAPHER_TOKENS` because it is a secret; `kbs[].name` fixes the KB's name (D53). `components[]` (the Surveyors the server expects, an alarm when one is silent, → `control-plane.md` §Component contract) is YAML only: a list of mappings has no environment or flag form, and the Helm chart does not render it yet. An unknown key anywhere under `auth` (a token's `scope:` for `scopes:`, `role:` for `roles:`, a rule's `map:` for `maps:`) stops Meridian at startup, naming the key and its line, and so does a top-level `Auth:`, a root `tokens:`/`roles:` or any unknown top-level key that mentions `auth` or `token` or is within two edits of `auth` (`auht:`, `authentication:`, `token:`): a dropped key would otherwise change who may do what. A token that declares a scope list which comes out empty (`scopes: []`, `roles: []`, `tok|`) is refused too, and so is a rule whose `maps`, `journals` or `types` is written but empty (`maps: []`, a bare `maps:`): only an omitted key means all. The admin token is the one that writes no `scopes` and no `roles` at all. `kbs[]` (YAML) is additive to `CARTOGRAPHER_KB_REMOTES` (append, not replace) — all listed KBs get mounted — and every entry has a `remote`: a KB without one is a folder under `data`, which is discovered (there is no `kbs[].path`). The `--kb` flag and `CARTOGRAPHER_KB` mount one more folder from the command line, for development and tests: it is not a key of the YAML file, and a folder mounted that way syncs only when it has a git remote, like any other KB. Scalar fields (`http`, `data`, tokens, ...) follow flag > env > YAML precedence: the last explicitly set level wins. **Git: one way to write (D903).** Cartographer has no git settings of its own: the SSH key and the token that reach a remote are files of the credentials directory (D905). Every write is one commit on the KB's branch: the remote's default branch, or the one the KB's `settings.yaml` names with `branch` (the team's choice), or, for one server alone, the one its `kbs[].branch` names (below); a KB syncs exactly when it has a remote (fetch and pull-rebase before a read or write, push after a write) and a KB without one never contacts anything. The freshness window of the pull (30s) and the debounce of the background push (3s) are constants. There is no pull-request boundary and no forge: the Meridian git profile (D117, D903) and its keys (`git.profile`, `git.base_branch`, `git.working_branch`, `git.forge`, `git.github_*` and their `kbs[]` forms) are gone with the `pr_status` and `pr_finalize` tools, and so are `git.autocommit`, `git.sync`, `git.in_window`, `git.out_debounce` and `kbs[].path`. A KB that has a remote and was kept from pushing with `git.sync: false` starts pushing to it after the upgrade (the start only warns): remove the remote from the clone to keep it local. Cartographer pushes to the KB's branch itself; if the remote refuses because the branch is protected, the push is reported as that (`sync_status` `failed`, `last_error` naming the way out: unprotect the branch, or set `branch` in the KB's `settings.yaml`, or `kbs[].branch` for this server), the change stays committed in the clone, and the push is not retried. **Upgrading: realignment (D903).** The first start of a version that removed keys rewrites Meridian YAML into its commented form: the removed keys are dropped, values that switched a feature off are reset to the default, every other value, comment and key order stays, and the original is kept beside it as `config.yaml.bak-` (`.1`, `.2`… when one of that name exists). Meridian logs what it changed, one line per key, and does nothing, writing no backup, to a file already in that form or one that only lacks the schema's comments (a hand-written or fresh file is the operator's, not rewritten for its comments alone). In that rewrite the comments the schema wrote in an earlier release are brought to the current wording, and the comment of a removed key is dropped with it, wherever an older realignment left it (`Key.Previous`, `Removed.Description`). A file it cannot write (a read-only mount) keeps working, since a removed key is ignored with a warning that names its replacement. A key that no table describes and no retired entry explains (a typo: `credentials_dri`) is ignored too, with a warning per key at load that names its line and the nearest known key (`credentials_dri: unknown key, ignored (line 2); did you mean credentials_dir?`); it is never an error, so a key a newer release adds does not stop an older server. The sections `auth`, `hooks`, `plugins` and `components` refuse an unknown key at load, as before. `cartographer doctor` reports the same keys, in this file and in `.cartographer.yaml` (`docs/configurator.md` §`cartographer doctor`, check `unknown-keys`). The same applies to a removed environment variable and flag (`CARTOGRAPHER_GIT_SYNC`, `--git-sync`, ...): ignored with a warning, never an error. Each KB's `settings.yaml` is realigned the same way as one commit by Meridian, through the normal commit and push, so it is revertible; a file with uncommitted edits is left alone. `write_gate`, `auto_repair`, `repair_on_write` and the `doctor_*` keys (D907), in a KB's `settings.yaml` or in a `kbs[]` entry, go the same way: the repair itself, on write and in the background, has no per-KB key. The server-level `maintenance.auto_repair` (default true) switches only the background timer. Compass file `~/.cartographer.yaml` is realigned by the first `cartographer sync`. Two removed settings are refused and not ignored, because ignoring them would change where writes go. The Meridian profile (`git.profile: server`, `kbs[].git_profile: server`, `CARTOGRAPHER_GIT_PROFILE=server`, or `git_profile: server` in a KB's `settings.yaml`) would write straight to the branch it protected: Meridian does not start (or, for a KB's own file, that KB does not mount) and says what to do. A `kbs[].git_branch` still set would move the KB's writes to the remote's default branch: Meridian does not start until the key is renamed `kbs[].branch` (this server only) or its value set as `branch` in the KB's `settings.yaml` (committed on the default branch, the team's) and the key removed; it is not honoured as an alias (D1093). A refused file is not rewritten. The registry of removed keys sits next to each schema (`config.Retired`, `kb.SettingsRetired`, `clientconfig.Retired`). ### Credentials directory (D905) Every secret file Meridian reads is in one directory, `credentials_dir` (env `CARTOGRAPHER_CREDENTIALS_DIR`, default `/credentials`), and is found by the KB's name (`kbs[].name`, or the name derived from the remote). On Kubernetes it is one mounted Secret (§Example: K8s pod). | File | What it holds | When it is missing | |---|---|---| | `.ssh`, else `default.ssh` | SSH private key for the KB's `ssh://` remote | git's own SSH setup | | `known_hosts` | host keys of every SSH remote, in one file | ssh's own known hosts | | `.token`, else `default.token` | HTTPS git token (§Bootstrapping a KB from a git remote) | no credential | | `.age`, else `default.age` | age identity that decrypts the KB's SOPS secrets | secrets report a missing key | | `.signing`, no default | artifact signing seed, 64 hex characters (§Provisioning artifact signing) | unsigned artifacts | | `audit.key` | audit log signing seed, 64 hex characters | generated at the first start | | `tls.crt`, `tls.key` | certificate chain and private key (PEM) of the TLS listener, `tls.enabled`; the names of a Kubernetes `kubernetes.io/tls` secret | with `tls.enabled` on, the start stops naming the expected path | `tls.crt` and `tls.key` are read at start and again while the server runs: the files are polled every `tls.reload_interval` (default `30s`) by a digest of both, and `SIGHUP` always reloads (not on Windows). The listener accepts TLS 1.3 only and HTTP/1.1 only. A reload that fails (a file missing, a pair that does not match) keeps the certificate in force and logs one line per distinct content, never key material; new handshakes use the new certificate, open connections keep theirs. A non-atomic replace of `tls.crt` and `tls.key` (one file copied before the other) may log one transient "refused" line, fixed at the next poll. A certificate past its `NotAfter` or before its `NotBefore` is served with a warning, at start and on reload, as expired tokens are (D2110), and one expiring within 14 days is warned about; a missing or mismatched pair at start stops the server before any port is bound, and it never falls back to clear. `default.token`, `default.ssh` and `default.age` are offered to every KB that has no file of its own, whatever its remote host: a KB whose remote is on another host than the others should get its own `.token` (or `.ssh`), or the default credential is sent to that host. The lookup applies to every mounted KB, discovered or configured. A file counts when it is a regular file or a symlink to one, which is how a Kubernetes Secret mounts its keys; a missing file means the credential is not configured. A KB name that would point outside the directory has no file of its own. - **Read-only is fine.** Meridian writes into the directory only to generate `audit.key` and to place the secrets of removed settings when upgrading (below), `0600` in a `0700` directory, and never replaces a file. A read-only directory needs `audit.key` in it (`openssl rand -hex 32`): without it, with `audit.mode: best_effort` the log runs unsigned with a warning at every start, and with `required` the server does not start. - **Permissions are warned about, never refused.** A file other users can read is reported once per start, except `known_hosts`, which holds public host keys. A file its group can read is reported only when Meridian owns it: a Kubernetes Secret reaches a server that does not run as root as `root:` with mode `0440`, whatever `defaultMode` says, and the group bit is how Meridian reads it. OpenSSH draws the same line for a private key. - **Never inside a KB.** Every commit of a KB stages its whole working tree, so a `credentials_dir` in one refuses the start: one that is a KB (it holds `data/index.md`) or lies inside one, one inside a `kbs[].path` or a remote KB's clone under `data`, even before it exists, and one below a subdirectory of `data`, which is discovered as a KB. A direct subdirectory of `data` is fine: as the credentials directory it is not discovered, and neither are `credentials` and `audit`. The directory of the audit log (`audit.log`, or `/audit`) and `audit.archive_dir` are held to the same rule, since a KB named `audit` would otherwise hold the log and commit it: the start refuses, naming the setting to move. Neither is checked in a `--kb` session without data, which has no default log. - **Upgrading.** The first start of this version copies into the directory the secrets that the removed settings point at: `git.ssh_key`, `kbs[].ssh_key`, `git.known_hosts`, `kbs[].known_hosts`, `git.token_dir`, `sops.age_key_file`, `sops.age_key_dir`, `kbs[].sops_age_key_file`, `kbs[].artifact_signing_seed` and `audit.key_seed`, and their `CARTOGRAPHER_*` variables. A file is copied, never moved, links followed (a directory mounted from a Kubernetes Secret holds links); an inline value is written; every known_hosts goes into the one file; a file already in the directory is kept. The log names settings and files, never a value. What cannot be written (a read-only directory) is logged as the file to create by hand, and Meridian YAML is not realigned until every secret is in place, so it still holds them at the next start. ### Bootstrapping a KB from a git remote (replaces the init container) Every `kbs: [{remote: ...}]` entry (YAML) or `CARTOGRAPHER_KB_REMOTES` (env, CSV of URLs) is cloned by `cartographer serve` at startup into `/` (name derived from the last segment of the remote, without `.git` — or the explicit `kbs[].name`, if set, see D53 below), **only if the destination doesn't already exist** — an existing clone is left untouched: the existing sync that follows the remote handles fetch/push on subsequent writes (`cmd/cartographer/bootstrap.go`). Requires `--data`/`CARTOGRAPHER_DATA`/`data:` as the destination directory for clones. A remote is an scp-like address, an `https`/`http`/`ssh`/`git`/`file` URL or a local path; one starting with `-`, using git's `::
` helper syntax (`ext::`, `fd::`) or any other scheme (`ftp://`, `rsync://`) is refused before git runs (`gitx.ValidateRemote`), and git itself is limited to those schemes (`GIT_ALLOW_PROTOCOL`, unless the environment sets it). A remote that is still empty clones to a branch with no commit, named by the host's git (often `master`), and Meridian does not mount it: `serve` never creates a KB (D906), so it fails naming `cartographer kb create`. `kb create --remote ` is what fills an empty remote: the KB is pinned to `main` and given its initial commit, which it pushes as the remote's first branch. From then on writes follow the remote's default branch (`concurrency.md` §How changes land, D264), unless the `settings.yaml` committed on that default branch sets `branch` (D335, D903): a fresh clone is then checked out on that branch, and the first push creates it on the remote if it is missing. A server can override it for itself with `kbs[].branch` (D1093), which wins over the KB's `branch` (then not read at all), is validated like it (an invalid value stops the start, naming `kbs[N].branch`), and is YAML only: `CARTOGRAPHER_KB_REMOTES` is a list of bare URLs and has no branch form. Precedence, highest first: `kbs[].branch`, the KB's `branch`, the remote's default branch. A discovered KB (`kb clone` writes no entry) needs an entry with `remote:` and `branch:` for it. An existing clone on another branch is switched to the effective one by the first sync when that loses nothing (HEAD on a branch, clean tree, nothing unpushed there); otherwise it stays `degraded` and `last_error` says why (`concurrency.md`). `kb clone --branch X` checks `X` out and adds that entry to the server file (`--config`, which must exist); `kb create --remote --branch X` writes `branch: X` in the KB's own `settings.yaml` instead (D1093). On a repository with history and no `X`, `X` becomes an orphan branch pushed alone; there the `branch:` line is informational, since Meridian reads the override from the `kbs[]` entry that `kb create` records (D1412). The clone is atomic (D348): it lands in `/..cloning` and is renamed to `/` only when complete, so a process killed mid-clone leaves no half-clone that the next start would take for a finished one. A half-clone found at `/` is not detected (an existing clone is never touched): remove that directory. `GIT_SSH_COMMAND` for the clone is built from `default.ssh` and `known_hosts` in the credentials directory (`ssh -i '' -o 'UserKnownHostsFile=""' -o StrictHostKeyChecking=yes`, quoted so a path with spaces or a Windows one survives the shell git runs it with); if `GIT_SSH_COMMAND` is already present in the environment, it wins over `default.ssh`. This removes the need for a separate Kubernetes init container for the initial clone. **Git identity: the writer commits (D904, D950).** A commit with a known writer has that writer as author **and** committer: a forge with a membership push rule checks both. `` — the machine's name (a pod's hostname in Kubernetes, reduced to what an email domain accepts) — is recorded in the `Cartographer-Host` trailer, so the history still says which instance recorded a commit (it is the machine's name, so it is public wherever the KB is pushed, and there is no setting to omit it: see [control plane](control-plane.md)). The author of a write is whoever wrote it: the `Cartographer-Author: Name ` header of the request, else the identity configured for the KB, else ` >`; every write also carries `Cartographer-Host` and `Cartographer-Token: ` trailers, the latter unforgeable (see [control plane](control-plane.md)). The identity Meridian commits as is a **server setting**, because it is the machine's and not the KB's (a KB's `settings.yaml` is committed and shared by everyone who writes to it): `git.identities: {: "Name ", default: "Name "}` per KB name (the entry `default` for every KB without one; a present empty entry means that KB has none). It is the author and the committer of what has no writer of its own — the unattended repair, the `external changes` commit, a sync merge, conflict resolution — and of a write whose client sends no valid header (Kiro's MCP config has no headers). Without it the server identity `Cartographer >` applies. An invalid value is dropped with a warning. A sync that rebases local commits gives each its author back as committer, and re-commits one Meridian made before the identity was configured as that identity (`gitx.RealignCommitters`). `git.identity` (a retired key), and `git.author_name` with `git.author_email`, are read as `git.identities.default` and moved to it by the realignment (a file that sets both `git.identity` and `git.identities.default` to different values is refused at load, D1725); the other `author_*`/`committer_*` keys are removed settings (a file that still has them loads with a warning). The git config of the machine, `GIT_AUTHOR_*` and `GIT_COMMITTER_*` in the environment do not influence any of it. A KB's own SSH key, `.ssh`, and its token helper (`.token` or `default.token`) **override** Meridian's process environment (the reverse of the "environment wins" rule that applies to `default.ssh` and `GIT_SSH_COMMAND` above) — see `internal/gitx.runGitEnv`. **A personal install (D1974)** — a local server, stdio or HTTP with authentication off — never commits as the technical `local-admin`: a KB without a `git.identities` entry takes the git identity of the user running the server (`git config user.name`/`user.email`, read as `gitx.GlobalIdent` does and, when the global config picks the identity by folder with `includeIf`, as git would record it for a commit in the KB), and `cartographer connect` writes the one it found into `git.identities.default`, so it stays the same across restarts and is visible in the file. When neither the file nor the user's git config gives a name and an email, a write to a KB **with a remote** is refused, naming `git.identities.default` and `git config --global user.email`; reads, and a KB without a remote, are unaffected, and a request that sends a valid `Cartographer-Author` is not refused. A present empty `git.identities` entry is an explicit "none" and keeps the server identity. `connect` and `status` print the missing identity, and `kb_status` reports it as `identity_missing`. The commits made with no writer (conflict resolution, the external-changes commit, merges, the realignment) carry the same identity; only a KB with none at all keeps the server identity for them, so a recovery never stalls, and the unattended auto-repair is exempt from the refusal for that reason (a client's `kb_repair` is refused like any write). A shared server (tokens) is unchanged. If your forge enforces author or committer push rules (GitLab `member_check`), the server identity and the token-id author are not forge accounts and the push is refused: set `git.identities.default` (or an entry per KB) to a real account. Commits already pushed under another identity stay as they are. Commits that are still only local when a `git.identities` entry is set are another matter, and two cases (D1063): the sync itself re-authors those made by exactly the server identity (`gitx.RealignCommitters`, D950), but leaves a commit authored by a token alone, and refuses to touch a range that holds a merge. The refusal is reported in `last_error` as an identity refusal (it names the identities found, and is not a protected branch), and `cartographer kb reauthor ` (preview, then `--apply`, [configurator](configurator.md)) re-authors the token-authored ones on the server host and pushes them; it never rewrites a commit that exists on a remote, and a range with a merge is refused there too. **Explicit KB name and its credential files (D53, D905)**: `kbs[].name` fixes the KB's name (overrides the name derived from remote/path) — it's the name used everywhere: the HTTP endpoint (`/mcp/`, see below), the token scope (`kb::r|rw`), the clone directory (`/`), and the KB's files in the credentials directory (§Credentials directory). With an `http(s)://` remote, if `.token` or `default.token` exists there (content: the token, trimmed), Meridian uses it as the HTTPS credential for clone/fetch/pull/push of that KB, injected via `credential.helper` in the per-process environment (`GIT_CONFIG_COUNT=2`: an empty `credential.helper` first, which resets the list so no system or user helper answers before it, then the token helper; D53; a helper set in the Meridian process's own `GIT_CONFIG_PARAMETERS` is applied after these and stays the operator's to manage): the token never appears in argv, in the remote URL, or in `.git/config` — only the file's *path* is embedded in the helper, which reads it (`cat`) whenever git invokes it. `ssh://` remotes use `.ssh` or `default.ssh` (above), and the KB's SOPS key is `.age`, else `default.age`. ### MCP tool names Tools are **never prefixed** (D288): an agent client gets one routed entry whose tools carry bare names, and one entry cannot collide with itself. The former prefix and mount-mode keys (`kbs[].tool_prefix`, `mcp.tool_prefix_mode`, `CARTOGRAPHER_MCP_TOOL_PREFIX_MODE`, `mcp.mount_mode`, `CARTOGRAPHER_MCP_MOUNT_MODE`) are **silently ignored** by a config or environment that still carries them (no warning); `--mount-mode` is not a flag, so a launcher passing it fails with an unknown-flag error. Hand-written tool citations inside skill bodies and client permission rules must use the bare names: `cartographer sync` rewrites the entries and the generated instructions block, not those. `cartographer kb rename` never changes a tool name. ### Environment variables The options listed here have an environment variable (the CLI flag takes precedence over it). The YAML-only options (`auth.roles`, `git.identities`, the `audit.*` retention and segment keys, `kbs[].*`) have none: the Schema lists every key with its variable and flag (§Configuration: flags, env, YAML, and `config.example.yaml`): | Variable | Equivalent flag | Description | |---|---|---| | `CARTOGRAPHER_CONFIG` | `--config` | Path to a YAML config file (see §Configuration: flags, env, YAML) | | `CARTOGRAPHER_KB` | `--kb` | Folder(s) to mount as they are, comma-separated. No remote, so no sync: for development and tests (D903) | | `CARTOGRAPHER_KB_REMOTES` | — | Git remotes to clone into `--data` at startup, comma-separated (see §Bootstrapping a KB) | | `CARTOGRAPHER_DATA` | `--data` | Directory whose direct subfolders are separate KBs (auto-discovery) | | `CARTOGRAPHER_CREDENTIALS_DIR` | — | The credentials directory, default `/credentials`: every secret file, found by KB name (D905, see §Credentials directory). | | `CARTOGRAPHER_HTTP` | `--http` | HTTP listen address, e.g. `:39273` | | `CARTOGRAPHER_TOKENS` | `--tokens` | Bearer tokens, comma/whitespace-separated. Each entry is either a bare `token` (admin, full access to every KB) or `token\|scope1;scope2` with per-KB scopes `kb::r\|rw` (scopes separated by `;`, never by commas; spaces around `|` and `;` are trimmed, to avoid colliding with the between-entry separator). E.g. `admintok, readtok\|kb:wiki:r, writetok\|kb:wiki:rw;kb:notes:r` (D44). | | `CARTOGRAPHER_AUTH` | — | Explicit auth toggle (see §Auth) | | — | — | Fine-grained roles have no env form: `auth.roles` is YAML-only, because a rule is a structured object (see §Fine-grained roles). | | `CARTOGRAPHER_AUDIT_LOG` | — | Path of the audit log's JSONL file, which is always on (D905); empty keeps it at `/audit/audit.log`. Its signing key is `audit.key` in the credentials directory. | | `CARTOGRAPHER_ALLOW_INSECURE_HTTP` | — | **Compass**: `1` or `true` lets this run use a plain `http://` server URL that is not loopback; without it Compass refuses (D1023). A server reachable beyond loopback should serve TLS itself or sit behind a proxy that does; a private CA is trusted with the client's `server.ca_file` or `CARTOGRAPHER_CA_FILE` (§configurator `connect --ca-file`), not by this opt-in. | | `CARTOGRAPHER_SERVER_URL` | — | **Compass** (not server): default server URL for `cartographer connect` on the client machine when no `.cartographer.yaml` exists yet. The first connect honours it with `--no-input` too (an explicit `--server-url` wins). Precedence: existing yaml > env > `http://127.0.0.1:39273/mcp` (D64, `internal/clientconfig.Default`). | | `CARTOGRAPHER_WEB_ENABLED` | `--web-enabled` | Serve the embedded read-only Atlas UI at `/ui/` and its JSON API at `/api/ui/v1` in HTTP mode. Boolean words as `CARTOGRAPHER_AUTH` (`true`/`1`/`yes`/`on`, `false`/`0`/`no`/`off`); anything else stops the start with an error naming the variable, never the default. Default `true`; `false` registers neither route, so both answer 404 and the HTTP surface is what it was before the UI. Stdio mode never serves it. D227, → `control-plane.md` §Read-only UI API. | | `CARTOGRAPHER_TLS_ENABLED` | `--tls-enabled` | YAML `tls.enabled`. Ask for TLS 1.3 on the HTTP listener, with the files `tls.crt` and `tls.key` of the credentials directory (never inline YAML). Same boolean words and the same error as `CARTOGRAPHER_WEB_ENABLED`. Default `false`. A start with it on and no HTTP address (stdio), or on a folder session with no `credentials_dir`, stops with an error naming `tls.enabled`; a configuration that asked for TLS never starts in clear. Other keys, YAML only: `tls.health_addr` (the loopback `host:port` of the listener that will answer only `GET`/`HEAD` of `/health` and `/ready`, with the same rules as the public address: with auth on, `/health` is open and `/ready` needs a token there too (D1096 scopes its body to the caller), so a readiness probe on it carries one, as the chart does with `readiness.tokenSecret`; default `127.0.0.1` on the public port plus one, so a public port of 0 or 65535 needs the key; `off` runs none; it must be loopback and differ from `http`; a bad value stops the load naming the key; there is no plain-HTTP option on the public address), `tls.hsts_max_age` (duration, default `4380h`, `0` turns HSTS off; HSTS is sent only over TLS) and `tls.reload_interval` (duration, default `30s`, `0` stops the poll of the certificate files). Durations must not be negative. An unknown key under `tls:` (`client_auth`, for instance, is not a setting) stops the load naming it and the valid keys, unlike the other blocks, where it is a warning: a misspelled security key must not be ignored silently. With it on, the public address serves TLS 1.3 only: a plain request on it gets a `400`. | | `CARTOGRAPHER_FEEDBACK_DESTINATION` | — | YAML `feedback.destination`. Where agent bug and idea reports go (`cartographer-feedback` skill). `github` (default, also when empty): a prefilled issue on the public repository. `off`: the served instructions lose the offer line and internal-error results lose their report hint; nothing else changes. Or an internal-tracker URL template: `https://` (`http://` only to a loopback host), a literal host without userinfo, containing `{title}` and using no placeholder but `{kind}`, `{title}` and `{body}`; the agent is told the report goes to the operator's tracker. The template carries **no secret**: `kb_status` returns it to every authenticated caller, read-only and per-KB tokens included, so a query key with a word that names a credential (`token`, `key`, `apikey`, `secret`, `password`, `passwd`, `auth`, `authorization`, `sig`, `signature`, `credential`; the key is split on `_ - [ ] .` and camelCase, so `assignee_ids` and `author` pass and `api_key` and `X-Auth` do not; the path and fragment are not inspected) or a credential-shaped value stops the start. Anything else stops the start with an error naming the key (never the template's userinfo). The server never sends a report: the user opens the link and submits it. The mode reaches provisioned clients on the next `sync` (the managed block is rewritten once); the template itself is returned only to authenticated callers, in `kb_status`. D1925. | | `CARTOGRAPHER_API_ENABLED` | `--api-enabled` | YAML `api.enabled`. Serve the public read-only API at `/api/v1` in HTTP mode: the `stable` and `preview` routes of the route table (`internal-tier` ones answer 404), behind the same bearer tokens and RBAC as `/mcp`. Same boolean words as `CARTOGRAPHER_WEB_ENABLED`. Default `false`: with it off `/api/v1` is not routed at all. Independent of `web.enabled` (neither implies the other). Other keys, YAML only: `api.cors_origins` (list of `scheme://host[:port]`, `http` or `https`, no path, no `*`; a bad entry stops the start naming the key; default none: only same-origin pages read the API; a listed origin may read `/api/v1` from a browser, with a preflight answered before the token check, `transport-auth.md` §Origin), `api.max_streams_per_token` (default 4, at least 1) and `api.max_streams` (default 64, at least the per-token cap). | | `CARTOGRAPHER_UPDATE_CHECK` | `--update-check` | YAML `update_check`. Look up the latest release (GitHub release list) 30 s after start and every 24 h, cached in the data dir's `.cartographer/update-check.json` (the user cache dir without a data dir), and report it as `latest_version` in `/health` and `kb_status` when newer. Same boolean words and the same error as `CARTOGRAPHER_WEB_ENABLED`. Default `true`; a failed lookup is silent and retried after an hour instead of 24 h, and a `dev` build never checks. D254. The same switch gates the UI API's release history (`GET /api/ui/v1/releases`), a second GitHub call made on demand (§The embedded Atlas UI, D862). | | `CARTOGRAPHER_MAINTENANCE_AUTO_REPAIR` | — | YAML `maintenance.auto_repair`, default `true`. `false` stops the background repair timer only (startup run, daily run and the run after a pull); repair on write, the write gate and `kb_repair` are not affected. | | `CARTOGRAPHER_NO_UPDATE_CHECK` | — | `1` or `true` turns every update lookup off, in Meridian (as `update_check: false`) and in the Compass commands that report a newer release (D254). | | `CARTOGRAPHER_INSTALL_DIR` | — | **Installer** (`install.sh`, `install.ps1`): the directory the binary is installed into (§Client installation). | | `CARTOGRAPHER_INSTALL_TAG` | — | **Installer** (`install.sh`, `install.ps1`): install this tag instead of the newest release, typically a release candidate `v-rc..` (D1192); the release list is not read, and the checksum check is the same (§Client installation). | | — | — | Removed in D906, each warned about and ignored: `CARTOGRAPHER_TOOLS_PROFILE` and `--tools-profile` (the core set is fixed), `CARTOGRAPHER_MCP_ALLOWED_ORIGINS` (the same-origin rule is fixed, → `transport-auth.md` §Origin) and `--init` (`serve` never creates a KB). | **`CARTOGRAPHER_AUTH`** — its modes: | Value | Behavior | |---|---| | `false` / `0` / `no` / `off` | Auth disabled (e.g. a local service on loopback) | | `true` / `1` / `yes` / `on` | Auth mandatory — fatal error at startup if no token is configured | | unset / `auto` | Auto: enabled if tokens are present, disabled otherwise | Any other value (`onn`) stops Meridian at startup, from `CARTOGRAPHER_AUTH` and from `auth.mode` alike. #### Example: native local service (launchd/systemd/cron/Scheduled Task, auth off, single client) The local mode (D73) uses the binary already installed by `install.sh` as a **user service**: ```bash cartographer service install # generates config + plist/unit, starts the server cartographer service status # binary, config, and the observable state of the local service cartographer service start|stop|restart cartographer service uninstall # removes the service; config and data remain cartographer kb create --remote # scaffolds a KB in the data dir, pushes it to (D85, D134); --branch X makes X the KB's branch, an orphan branch on a repository with history (D1093, D1412) cartographer kb clone # mounts an existing remote KB in that data dir (D97); --branch X: this server writes to X (kbs[].branch, D1093) cartographer kb attach --remote # gives a --no-remote KB its origin (empty remote or a fast-forward ancestor, never forced); no restart cartographer kb list # what is on disk, and what the server actually serves (D173) cartographer kb rename # renames the mount point: directory + kbs[] entry + alias in the server state file + client bindings (D177, D754, D772, D906) cartographer kb unmount # retires a KB locally: kbs[] entry + state-file aliases pointing at it + client bindings and per-KB options (`knowledge_bases.`), clone parked or deleted (D761, D772) ``` `service install` (idempotent: re-running it rewrites the plist/unit and restarts): - also installs the **tray** (`cartographer tray`, D1482) unless `--no-tray` or a remembered `service tray uninstall` says otherwise: macOS LaunchAgent `~/Library/LaunchAgents/com.cartographer.tray.plist` (`KeepAlive` on unsuccessful exit only, Aqua session, log `~/Library/Logs/cartographer/tray.log`); Windows Scheduled Task `\Cartographer\Tray` from `%LOCALAPPDATA%\cartographer\tasks\tray.xml` (the server task's logon trigger and settings, `InteractiveToken`, except `RestartOnFailure`, which is deliberately dropped so a tray with no shell does not loop; log `%LOCALAPPDATA%\cartographer\Logs\tray.log`); none on Linux. It starts immediately, and `upgrade-repair` refreshes and restarts it after an upgrade. Windows 11 shows a new notification-area icon in the overflow (^) menu until the user pins it (drag it out of the menu, or Settings > Personalization > Taskbar > Other system tray icons): the choice is kept per executable path, so a first install, or a binary that moved, starts hidden. The first start from a given executable path therefore shows one balloon, "Cartographer is running", whose click opens the Atlas; a marker under `%LOCALAPPDATA%\cartographer\tray-announced\` keeps it from repeating for the same path, and the app never pins the icon itself. The tray writes `tray.log` from its first line, and `cartographer status` and `doctor` report a tray that is installed but not running (`tray_not_running`). The tray is not tied to the service: with no local service installed it shows the server of the client config, read-only (`configurator.md` §`cartographer tray`), so a client-server deployment gets the status icon too. `service uninstall` removes it first, unless the client config has a connected agent (the tray then keeps showing that client's server); `connect` installs it on a client with no local service (`--no-tray` is remembered) and the last `disconnect` removes it; - generates `~/.config/cartographer/server.yaml` — on Windows `%APPDATA%\cartographer\server.yaml` — **only if it doesn't exist** (`--config` for a different path; `--data`, default `~/cartographer-data`, and `--http`, default `127.0.0.1:39273`, are only used at generation time — if the config already exists they are ignored with a warning: edit the file and run `service restart`). For a loopback `--http` the generated file sets `auth: {mode: "off"}` explicitly: the clients `setup`/`connect` configure for a local server send no token, and with the default `auto` a `CARTOGRAPHER_TOKENS` exported for a remote server and reaching the service's environment would turn authentication on and reject them all with 401. The mode and the tokens are separate settings, so the pinned `off` holds whatever the environment carries; `CARTOGRAPHER_AUTH=on` (env beats YAML) or editing the file still enables auth deliberately, and `serve` logs the tokens it is ignoring. A non-loopback `--http` keeps `auto`, where env tokens are the protection ([D268](decisions/D268-the-local-service-pins-auth-off.md)); - creates the configured data dir if it doesn't exist yet (D83), so a fresh install never leaves `serve` pointed at a missing directory; - macOS: LaunchAgent `~/Library/LaunchAgents/com.cartographer.serve.plist` (`KeepAlive`, logging to `~/Library/Logs/cartographer/server.log`). The plist's binary path prefers a stable Homebrew symlink (`/opt/homebrew/bin/cartographer` or `/usr/local/bin/cartographer`) over the versioned Caskroom path, so it survives `brew upgrade` without a re-install (D83); - Linux with a reachable systemd user manager: systemd user unit `~/.config/systemd/user/cartographer.service` (log via `journalctl --user -u cartographer`; on a headless host, `loginctl enable-linger ` is needed for the service to survive logout). With Homebrew on Linux (Linuxbrew) the recorded binary is the prefix's stable `/bin/cartographer` (or `/opt/cartographer/bin/cartographer`), derived from the directory above `Cellar` or `Caskroom`, not the versioned keg path, so `brew upgrade` does not break the unit, and its `PATH` carries `/bin` (first, or right after the `opt` link's directory). A derived link is used only when its directory is owned by the user or root and is not world-writable (group write is allowed, as in Homebrew's own layout), and so is the prefix itself; a prefix owned by another user (a shared Linuxbrew owned by a dedicated user) is not trusted, so the keg path is refused; a keg path with no such link is refused by `CheckStableBinary`; - Linux without one (Slackware, Alpine/OpenRC, Void/runit, WSL without systemd — see §Windows with WSL —, containers): the **cron backend**. The backend is chosen at install time, in this order: `$HOME` is not the account's home → systemd, files only (#683); `systemctl` on PATH, `/run/systemd/system` a directory (what `sd_booted()` checks) and `systemctl --user show-environment` succeeding → systemd; `crontab` on PATH and `crontab -l` answering (or "no crontab") → cron; otherwise none, and `service install` fails with exit 2 **before writing anything** (no config, no data dir). An installed definition wins over the probe for every verb but `install`. The cron backend is a managed block in the user crontab (between `# BEGIN` and `# END` marker lines named for the `server` block; the user's other lines are never touched) with an `@reboot` line and a watchdog every 5 minutes, both running `cartographer service ensure`. `ensure` takes a lock, starts `serve --config --log-file /server.log` detached (new session, no stdio) unless a live process of ours already serves (a pid counts only when its command line names `serve` and the config), something already answers on the configured address (a Cartographer `/health`, or another program: a server that cannot bind is not fixed by spawning one, so the watchdog stays quiet and `start` says `another program answers on `), or the stop marker exists. Meridian gets a **clean environment** (`HOME`, `USER`, `LOGNAME`, `SHELL`, `LANG`, `LC_*`, `TZ`, `TMPDIR`, `XDG_*` and the service `PATH`), so an operator's `CARTOGRAPHER_TOKENS` never reaches it and a start from `setup` equals a start from cron. `@reboot` is best effort (busybox `crond` ignores it): the watchdog is what brings Meridian back within 5 minutes of the cron daemon starting or of a crash, so `crond` must be running (install warns when no cron daemon is found). Files: definition `~/.config/cartographer/cron/server.cron` (the "installed" test, with `bin=`/`config=` header comments), state in `$XDG_STATE_HOME/cartographer` or `~/.local/state/cartographer`: `server.pid`, `server.lock`, `server.stopped` (the marker `stop` writes first, kept across reboots until `start`, `restart` or a re-install), `server.log`, `supervisor.log`. `stop` and `restart` wait for the exit and for the port to be free (SIGTERM, up to 20 s, then SIGKILL); `uninstall` strips the block, re-reads the crontab when the write failed and keeps the definition if the block is still there (#1584 rule). Paths containing `%`, a newline or NUL are refused (cron turns `%` into a newline). `status` reports `Running` as "installed, not stopped, and a live process of ours or a Cartographer `/health` answer" (a foreign program on the address is not Running); exit codes stay 0/3/4; - Windows: a **per-user Scheduled Task** `\Cartographer\Serve`, defined by `%LOCALAPPDATA%\cartographer\tasks\serve.xml` and registered with the PowerShell `ScheduledTasks` cmdlets — never `schtasks.exe`, whose printed state is localised. It starts at **its owner's** logon — the trigger names the installing user, because a logon trigger for any user needs administrator rights to register and a standard user would get `Access denied` — and **belongs to that user**: the principal names the same account and an explicit `` grants the user's SID, SYSTEM and Administrators full control, so a non-elevated session of the user (an agent's terminal) can restart it. An install from an elevated shell registers the same user-owned task and says so, never an Administrators-owned one (the Sync and Tray tasks are defined the same way; D1979, amending D217) — restarts on failure (3 attempts, one minute apart), and logs to `%LOCALAPPDATA%\cartographer\Logs\server.log` through `serve --log-file`, because a task action has no equivalent of the plist's `StandardOutPath` and Windows has no journald. Not an SCM service: that would be per-machine and would need administrator rights, while this needs none ([D217](decisions/D217-the-native-service-on-windows-is-a-per-user-scheduled-task.md), amending D73). The task's binary path is the one `service install` ran from — `%LOCALAPPDATA%\Cartographer\bin\cartographer.exe` for an `install.ps1` install — which every `install.ps1 update` replaces in place, so unlike the Homebrew Caskroom path on macOS it needs no stable alias. The definition overrides four Task Scheduler defaults that would each stop a long-running server: the 3-day execution time limit, the two battery settings, and stop-when-no-longer-idle. Read fallback for the config: if `%APPDATA%\cartographer\server.yaml` does not exist and `\.config\cartographer\server.yaml` does, that one is used, so a machine configured before Windows was supported keeps working — the existing file keeps governing the service and nothing is moved or copied. A **new** config is generated at the `%APPDATA%` location. - sets a `PATH` in the plist (`EnvironmentVariables`) and the unit (`Environment=PATH=`), but **not** in the task definition, whose format has no environment block — a Scheduled Task inherits the user's own environment, where the machine and user `PATH` already contains the directories installers put there (`install.ps1`'s among them), so the gap this closes on unix does not exist there: the directory of the installed binary first, then `/opt/homebrew/bin`, `/usr/local/bin`, `/opt/local/bin`, then the platform default. A service manager does not pass the interactive shell's `PATH`, so without this a Homebrew-installed `sops` is invisible to Meridian and every secret resolution fails with `sops binary not found in PATH` — from the definition `service install` itself generated (D156). **An already-installed service keeps its old definition: re-run `service install` to pick this up.** `stop` leaves the job registered and `restart` works after it. On macOS `stop` disables the job (to defeat `KeepAlive`) and sends `SIGTERM` rather than `bootout`, which unregisters: with `bootout`, `stop` followed by `restart` failed with `Could not find service … in domain` and only `start` worked, which reads like a broken installation. `restart` falls back to `start` when the job is not registered, so a job booted out by an older version stays restartable after the upgrade; `uninstall` still uses `bootout`, because removing the definition is what uninstalling means (D156). `service install` and the sync timer's install, which `bootout` a loaded job before `bootstrap`, wait until `launchctl print` fails (up to 30 s, Meridian's drain) because `bootout` returns while the job is still loaded and a `bootstrap` in that window fails with exit status 5; a job still loaded at the deadline is an error naming the label and the manual commands. `uninstall` waits the same way before removing the plist. The systemd units quote an `ExecStart` path that holds a space, quote or `%` (systemd.syntax), and the readers of the unit parse quoted words. Windows follows the same contract with its own verbs: `stop` stops **and disables** the task (the logon trigger and restart-on-failure would otherwise bring it straight back), `start` and `restart` re-enable it first, `restart` re-registers from the XML when the scheduler no longer knows the task, and `uninstall` unregisters and deletes the definition. `restart` and `uninstall` first end the running server and **wait for it to exit** — the task no longer `Running` and nothing answering on the config's http address — because `Stop-ScheduledTask` returns while the process still holds the port: a start in that window dies on bind, and an unregistered task leaves its process running with the port, `index.db` and `server.log` locked. The stop is graceful first (the shutdown event below, up to 20 s), then `Stop-ScheduledTask` (up to 10 s more). A server that survives both is reported: `restart` still starts the task, `uninstall` still removes the definition and names the process to end ([D266](decisions/D266-a-windows-restart-waits-for-the-old-process-and-proves-the-new-one.md)). `service restart --wait` (D121) is a **graceful** replacement everywhere, and on Windows that took a mechanism of its own: there is no CLI-deliverable `SIGTERM`, `Stop-ScheduledTask` is a kill, and `GenerateConsoleCtrlEvent` cannot reach a process with no console. `serve` therefore also waits on a named event in the user's session (`Local\cartographer-serve-shutdown`) and triggers the same drain a `SIGTERM` does; the Manager sets it, waits for Meridian to exit, and then **starts the task again** (`Enable-ScheduledTask` runs only when the task is `Disabled`, so the restart needs only the right to start it) — a Scheduled Task is not a supervisor, so nothing else would bring back a server that exited cleanly. `Local\` is per logon session, so from another session — `upgrade-repair` or an `auto-patch` apply run over SSH while Meridian runs on the desktop — the event cannot be opened: the Manager then stops the task with `Stop-ScheduledTask`, waits for the exit, and prints why, since that stop cuts in-flight requests and does not flush pending pushes. The verification that follows only accepts a `/health` answer from a **new** process: `/health` reports `started_at`, and a value equal to the one read before the restart is the old process still draining (D266). **Per-KB policy lives in the KB, and only there (D746, D906).** `kbs[]` keeps three keys, `remote`, `name` and `branch`. A KB's behaviour (`usage_stale_days`, `branch`, `artifact_prefix`, `depends_on`, `remote_path_prefixes`; the write gate and the safe repairs have no key, D907) is set in the KB's own `settings.yaml` (`docs/data-plane.md` §The KB's own settings), the same for every server that mounts it. The former `kbs[]` form of the policy keys, and `allow_artifact_write`, `allow_template_write`, `mcp_allowlist` and `secrets`, are removed keys: each is ignored with a warning that names the KB file (or says why the key is gone), and dropped when the server file is realigned. A KB declares secrets by holding a sops-encrypted file under `secrets/`; its MCP descriptors are always distributable; artifact writes need only a token with `rw` scope on the KB. **Configured versus discovered mounts.** A KB listed in `kbs[]` is *configured*; a KB found by scanning `data:` is *discovered* and has **no `KBSpec`**, so every per-KB setting sits at its zero value unless the KB carries a `settings.yaml` (D746, which a discovered KB reads like any other). Its policy is that file; an entry would add only `remote`, `name` or `branch` for this server. A discovered KB otherwise works and looks identical from every client surface, so the mount kind is reported explicitly: startup warns once per discovered KB, `kb_status` reports `capabilities.mount: discovered`, and `cartographer doctor` raises a `capability` finding (D151). `kb create` / `kb clone` mount a KB *discovered*. Dot-directories are never discovered: `kb unmount` parks a retired clone in `/.unmounted/` for that reason (D761). `kb create` authors the KB's initial commit with the operator's own git identity (`user.name`/`user.email`) when git resolves one, otherwise the server identity (D904); the committer is the same identity (D950). **Before pushing it asks the remote (`ls-remote`).** An empty repository gets the scaffold as is. A repository holding only a forge's initial commit — one branch, one commit, top-level README/LICENSE/LICENCE/COPYING/`.gitignore`/`.gitattributes` files — is adopted automatically: the scaffold commit is rebased on top of it (the forge's files are kept, except a boilerplate `README.md` that a recognised forge template wrote, which one extra commit on top replaces with a short generated one; `--readme generate|keep` overrides the recognition and a README that is not a known template is kept with a hint, D1071), the KB lives on the remote's default branch whatever its name (D264), and the push is a fast-forward, never forced; a scaffold path that collides with a forge file (e.g. `.gitattributes`) is a refusal, not a merge. Any other non-empty remote is refused with a `kb clone` / cartographer-kb-import hint. These refusals happen before any push, so the local KB is deleted and the command can be rerun (D710). **If the push fails the scaffold is kept**, not rolled back: the local KB is complete and valid and only the push failed, so the command exits non-zero and prints the lines to finish by hand: `push -u origin`, preceded, only when the server identity was the fallback, by setting a git identity the forge knows and `commit --amend --reset-author --no-edit` (amending to the author the commit already has never helps; a refused first push is also classified like Meridian's sync, so an identity refusal names the author instead of blaming authentication) — or the command that discards it (`rm -rf`, or `Remove-Item -Recurse -Force` on Windows), noting that a server started with that data dir would otherwise mount it (D156). If git refuses the initial commit itself (a commit hook, signing without a key), `kb create` reports that error and stops before the push (D265). The port is bound before anything is cloned or indexed, and an address already taken stops `serve` at once with `cannot listen on : the address is already in use by another process`, naming the two ways out: stop that process (it may be another `cartographer serve`, or an unrelated program), or change the listen address/port (`http:` in the server config, `--http`) (#1998). `service status`, `doctor` and the tray tell such a port from a running server by its `/health` body, which must carry `status: "ok"` and a `version`. Binds to **loopback** by default (`127.0.0.1:39273`) → auth is off (pinned in the generated config, D268) without exposing anything on the network. With an empty (or missing — D83: `serve` creates the directory and treats it as empty rather than failing) data dir the server starts with 0 KBs — `/health` is still up (liveness: `status:"ok"`) but `/ready` reports `503 {"ready":false,"kbs":0}` (D84, §Observability): `cartographer kb create --remote ` scaffolds a subfolder KB (D85; `serve` itself never creates one, D906) and pushes it to the empty repository at `` (or builds it on the one commit a forge writes at project creation, D710), which becomes its `origin` — the remote is mandatory, `--no-remote` being the explicit opt-out for a local-only, non-durable KB (D134), recoverable later with `cartographer kb attach --remote ` (no restart) — while `cartographer kb clone ` mounts an existing OKF remote there (D97; `service install` itself prints a hint pointing at creation if it starts with 0 KBs mounted), or add `kbs:` entries to clone remotes (§Bootstrapping a KB) — either way, `service restart` (or `kb create --restart` / `kb clone --restart`, which do this for you and wait for the server to report healthy again) is what makes the new KB visible. `--restart` restarts the installed service even when `/health` fails or still reports bootstrapping, and says so when no service is installed; a restart that fails (`Error: restart failed: …`) makes the command exit 1, the KB change being already done (`kb create`, `clone`, `rename` and `unmount` alike). Every `kb` subcommand talks to the **local** service (the service config's `http:`, else `127.0.0.1:39273`), never to the client's `server_url`. **The `kb` commands act on the LOCAL server's data dir** (D173). They take `--config ` to name the server config to read `data:` from, mirroring `service install`/`service status`: without it a service installed at a custom config path is invisible, and the command reports `KB "x" mounted at …` about a directory no running server reads. On a machine whose `.cartographer.yaml` points at a **remote** server they refuse to run, since mounting a KB on that server is an operation on its deployment — `--local` is the explicit opt-out, and `--data ` (naming the target outright) bypasses the question. `kb clone` is bounded: `--timeout` (default 120s) caps the whole operation, `GIT_TERMINAL_PROMPT=0` and, for ssh remotes, `BatchMode=yes -o ConnectTimeout=10` make git fail instead of blocking on a credential or host-key prompt, and progress is streamed as it happens. Host-key *policy* is left to the operator's ssh config: `accept-new` would trade a hang for a silent trust-on-first-use decision. Recognised failures (DNS, SSH key, host key, repository not found as GitHub and GitLab word it, authentication) are reported with a remedy, and an interrupt removes the partial clone it created — never a directory that was already there. A pre-existing `GIT_SSH_COMMAND` is never overwritten. Once the KB is mounted, `kb clone` asks the remote whether the server's credentials for the KB (`.token`/`.ssh`, else `default.*`, in the credentials directory) may push, with the dry run of `setup` made in a temporary repository, against the URL the server pushes to (`remote.origin.pushurl` when set); the rest of the environment (`GIT_SSH_COMMAND`, `SSH_AUTH_SOCK`, proxies) is that of the shell running `kb clone`, not the service's. Three outcomes, by what git said: the remote refused the credential (a read-only token or key, a rejected or missing login) prints a warning and the exit code stays 0, since a reader may clone on purpose; a remote that does not answer, or a failure that says nothing about the credential (untrusted TLS certificate, unknown host key, HTTP 429/5xx), prints a note. `cartographer doctor` repeats the question for every KB of the local server (`push-access`), four at a time. The server start never probes. `kb rename [--data ] [--config ] [--restart]` renames a KB's **mount point**: the directory, the matching `kbs[]` entry when there is one, and an alias `{from: , to: }` in the Meridian state file `/.cartographer/state.json` (D177, D772, D906), together or neither: if the entry cannot be rewritten, the directory is renamed back and the alias removed. The KB's own credential files in the credentials directory (`.ssh`, `.token`, `.age`, `.signing`, D905) become `.` in the same step, and go back with the directory on a failure; an existing `.` is a refusal, never overwritten. The alias is written whether or not the KB has an entry — a discovered KB has none, and no entry is created for it — and even with no server config, since the file lives under the data dir (the same holds for this machine's client bindings, rewritten with or without a server config; only the server-side registration is skipped, #2358), so a routed `?kbs=` from a client that has not synced yet still reaches the KB after the next restart (see `transport-auth.md`). A `kb_aliases` list Meridian YAML still carries is moved into the state file by the command, and the key leaves the YAML. The list stays flat and single hop: renaming `b` to `c` after `a` to `b` leaves `a: c` and `b: c`, and renaming a KB back drops the alias of the restored name. It is offline and local — it never contacts a server, a client or a git remote, and the git `origin` is untouched: renaming a mount point is not renaming a repository. A cross-filesystem move fails explicitly rather than falling back to a recursive copy, which would silently change the ownership and timestamps of a git repository. Before moving anything it reports what else the name is an identity for. Auth scopes (`kb::r|rw`), role rules, client `knowledge_bases..signing_keys` pins, approvals in the machine file and `knowledge_bases..identity` entries (D904) are **listed, never rewritten**: they are configured out of band, and silently editing an operator's auth configuration would be worse than telling them what to change. This machine's client bindings that select the KB by name (`providers..kbs`, `providers..workspaces[].kbs`) **are rewritten** to the new name, in place, when Compass points at the local server — otherwise every `sync` would abort on a stale selection (D754); a client pointed at another server keeps its bindings, which name that server's KBs. Clients' MCP entries then reconcile on the next `cartographer sync`. Two entries that could both be the KB is a refusal, naming them: guessing there silently detaches a KB from its configuration. **No** entry is not a refusal — a KB created by `kb create` or found by discovery legitimately has none, and renaming its directory is then the whole job. `kb unmount [--delete-clone] [--force] [--dry-run] [--data ] [--config ] [--restart]` is the inverse of `kb create`/`kb clone`, offline and local like `kb rename` (D761). It refuses when the clone cannot be proven pushed — uncommitted changes, commits ahead of `origin/`, no upstream or no `origin` (it runs `git fetch` first) — unless `--force`. It then writes `server.yaml.bak-` and removes the matching `kbs[]` entry in place (comments kept; a discovered KB has none) together with the state-file aliases that point at the KB or start at its name (an alias records where a KB went, not who owns a name, so a different KB later mounted under it must not be reached by an old URL, D772), drops the KB from this machine's client and workspace bindings and its `knowledge_bases.` options (#2424), and either deletes the clone (`--delete-clone`) or, when it sits under `data:`, parks it in `/.unmounted/`: a clone left in the data dir would be remounted by discovery at the next start. Auth scopes, signing-key pins, MCP approvals and `identities` entries naming the KB are listed, not removed. The KB's credential files are left where they are and listed (a KB mounted later under the same name would inherit them). Both `kb rename` and `kb unmount` take the KB's advisory process lock (D155) without waiting and fail naming its holder when the service has it; the lock is released just before the directory moves or the clone is deleted, and unmount redoes its "pushed" check under it. A failure after the aliases were written (the backup and the edit included) puts them back, and one after the backup also restores the config from it. The remote stays the source of truth: the command prints the `kb clone` line that brings the KB back. Other machines' client URLs still name the KB until they `sync`; the routed endpoint serves them without it (D756). `kb list [--data ] [--config ] [--json]` prints one row per subdirectory of the data dir — name, whether it is an OKF KB (`data/index.md`), whether it is a git repository, its `origin` — and a `MOUNTED` column when Meridian answers `/health` and lists its KBs to a tokenless caller (authentication off; with authentication on `/health` names no KB without a token, D1096). When it does not, the column disappears and the reason is printed (a refused connection reads `the server is not running` and names `cartographer service start`): absence of the signal is not evidence that nothing is mounted. The command writes **nothing**: a missing data dir is reported rather than created (`kb list` then prints `no KB yet` with the `kb create` command and, when Meridian does not answer, the `service start` hint, and exits 0), and no repository is opened (which would migrate its git-exclude entry as a side effect). With `--json` stdout carries only `{"data_dir": …, "kbs": [{"name", "okf", "git", "origin", "mounted"}]}` (`kbs` is `[]` for an empty data dir, `origin` is empty when there is none): `mounted` is `null` when Meridian did not answer, and a `mounted_error` string then says why. The **sync timer** (`service sync-timer`) follows the same rule on its own definition: `sync.cron` present means cron, the `cartographer-sync` units mean systemd, else Meridian's backend. It is a second managed block (`sync`, with a `# interval=` comment and no `@reboot` line: a missed run is made up by the next slot), independent of the `server` block because `connect` installs it on machines that may run no server. Cron cannot say "every 45 minutes after the last run", so the interval is rounded up to whole minutes: under an hour it is `*/n * * * *`, a whole number of hours up to 23 is `0 */h * * *`, anything longer is rounded up to whole hours and capped at daily. Output goes to `sync.log` in the state directory. Install follows the fresh backend probe like the Meridian install, so a host whose systemd availability changes moves the timer: installing on cron removes our systemd sync units (only when they carry our `Description=Cartographer client sync` header; others are left with a note), installing on systemd removes our cron block and `sync.cron`. If both exist, `sync-timer status` reports both and `uninstall` removes both. Uninstall follows the same verified-removal rule as the Meridian block. ##### Windows with WSL On a Windows machine with WSL2, agents run on both sides — desktop apps (Codex app, Claude desktop, VS Code) read `%USERPROFILE%`, CLIs inside the distro read its `$HOME` — and one Meridian serves both. It runs **inside the distro**, installed with `install.sh` and `cartographer service install` there, managed by the Linux backend (systemd user unit, or cron), its data dir on the Linux filesystem (never under `/mnt/c`: no POSIX modes, no reliable locks, slow git) and bound to `127.0.0.1:39273`. WSL1 is not supported. Windows agents connect with the Windows binary to `http://127.0.0.1:39273/mcp` — the literal IP: WSL forwards Windows' `127.0.0.1` (and `localhost` over IPv4) into the distro, not `[::1]`, so `connect` refuses an explicit `[::1]` URL once the server is known to be WSL's. Each side's `connect` provisions its own home only. `service install` in a WSL2 distro also registers the **keep-alive task** `\Cartographer\WslKeepAlive` through the interop `powershell.exe` (the XML travels inline, no file on `/mnt/c` or `\\wsl.localhost`): WSL stops an idle distro ~15 s after the last terminal closes, and the server with it. The task starts at its owner's logon and runs `wsl.exe -d -u -- '' wsl keepalive`, which holds the distro up and never runs `serve`; on the cron backend it also runs `service ensure` every 60 s, since WSL starts no cron daemon at boot. It is registered with an S4U logon (session 0, no window, no password); if the scheduler refuses that, with an interactive token and `wslg.exe` (no window); never one that opens a terminal. When neither works, or interop is disabled, the install warns and the manual alternative is `instanceIdleTimeout=-1` under `[general]` in `%USERPROFILE%\.wslconfig`, then `wsl --shutdown` once. With systemd the install also runs `loginctl enable-linger ` (best effort, a warning on refusal): a systemd user manager runs only while a session or linger exists. `service uninstall` removes the task after the server. The `service` verbs work natively in the distro. On Windows, `cartographer.exe service install --wsl []` (a bare `--wsl` takes the single running distro) runs `cartographer service install` inside the distro and writes the marker `%LOCALAPPDATA%\cartographer\wsl-server.json`; from then on `install`, `uninstall`, `start`, `stop`, `restart` and `status` run `wsl.exe -d -- cartographer service ` with the terminal attached and exit with its code, and a delegated `uninstall` removes the marker. `sync-timer`, `tray` and `ensure` stay native. `--config`/`--data` are paths inside WSL (a `C:\` path is refused); a registered native `\Cartographer\Serve` task is refused next to the marker (two servers, one port); a distro without cartographer gets the `install.sh` command, a different version a warning. With no marker nothing is delegated. `connect` on Windows writes the marker itself when a loopback server answers, no native task exists and a running distro's `service status` exits 0. **Trust.** Loopback is not a boundary on such a machine: every distro and every Windows process reaches Meridian as `127.0.0.1`, and `\\wsl.localhost\\...` exposes the data dir to Windows processes as the distro's default user. That is the trust model of a native local server, and `auth: off` stays pinned for a loopback listener ([D268](decisions/D268-the-local-service-pins-auth-off.md)). Mirrored networking (`networkingMode=mirrored`) was not verified by Cartographer; `127.0.0.1:39273` should still work. Upgrade both binaries together: `install.ps1 update` on Windows and `install.sh update` in the distro ([D1996](decisions/D1996-wsl-is-a-supported-platform-with-the-server-in-the-distro.md)). ##### Hosts without a service manager A host with neither a reachable systemd user manager nor a usable `crontab` (a container, a minimal image, a BSD-style init) has no backend: `service install` and `setup` exit 2 before writing anything, and name the manual route. `cartographer service install --config-only` writes `server.yaml` and creates the data directory exactly as `install` does, installs nothing, prints the start command and exits 0. Start Meridian detached and hook it into the init system, then run `cartographer setup`: a server already answering `/health` on the configured address is kept as is (the plan says `already answering ... (not managed by Cartographer)`). A listener only counts as ours when its `/health` carries a `version` (any program can say `{"status":"ok"}`); anything else on the address stops setup with exit 2 before connecting. Setup cannot restart a server it did not start, so when its KB step creates or mounts a KB it stops with exit 1 and asks for a restart by hand; on the rerun it checks the answering server's `/health` `kbs` list (when it gives one) and stops again, naming the missing KB, if it was not restarted. ```sh # Slackware: /etc/rc.d/rc.local (as the user: su -l user -c '...') nohup cartographer serve --config ~/.config/cartographer/server.yaml --log-file ~/.local/state/cartographer/server.log >/dev/null 2>&1 & # OpenRC: /etc/init.d/cartographer command="/usr/local/bin/cartographer" command_args="serve --config /home/user/.config/cartographer/server.yaml" command_user="user" command_background=true pidfile="/run/cartographer.pid" # runit: /etc/sv/cartographer/run #!/bin/sh exec chpst -u user env HOME=/home/user /usr/local/bin/cartographer serve --config /home/user/.config/cartographer/server.yaml # container entrypoint cartographer service install --config-only && exec cartographer serve --config "$HOME/.config/cartographer/server.yaml" ``` `service status` on such a host exits 4 (nothing is installed) and, when something answers on the configured address, adds one line saying so (a measured fact, not a verdict, D174). `service ensure --config [--log-file ]` is the action the cron backend's crontab lines run (start Meridian unless it runs or was stopped on purpose); it is not meant to be typed. `service status` uses systemctl-like exit codes: `0` running, `3` installed but stopped, `4` not installed — this is what lets `install.sh update` automatically restart only a running service (see §Client installation). **What `service status` reports** (D174). It inspects the **local native service** and nothing else: the remote server a client points at is a different question, answered by `cartographer status` and `cartographer doctor`. It reports what it observed, never a verdict on what does not exist: - `installed` — the plist, the unit or the task definition is on disk. It is a **file**, on every platform, and never a query to the scheduler: `EffectiveConfigPath` reads that same file to recover the `--config` the service was installed with. When it is `false` the output says there is no local service and how to install one, and prints **no health line**: `healthy: false` next to `installed: false` describes an absence, and reads as an outage. - `loaded` — `launchctl print` / `systemctl --user is-active` / `Get-ScheduledTask` succeeded. On macOS it is false for a job that `stop` left registered but disabled and without a process (D1006), so `status` exits 3 and `upgrade-repair` leaves it alone; a job with a live `pid` is loaded whatever its disabled flag says. On Windows it is false for a task `stop` left `Disabled` or `Ready` (registered, no process), so `status` exits 3 and `upgrade-repair` leaves it alone (D1014); the state is compared inside PowerShell, and a state query that errors or answers anything unexpected reads as loaded, so a live service is never hidden. It does **not** prove Meridian answers. The JSON field keeps its name, `running`, and `lifecycle` (`not_installed` / `not_loaded` / `loaded`) is the field to read. - `healthy` — `true` when a Cartographer server answers `GET /health` on the address in the server config: a 200 whose body carries `status: "ok"` and a `version` (any program can say `{"status":"ok"}`, so a body without the version is not ours; the rule is `client.IsServerHealth`, the one `setup`, `doctor` and the tray use too). When something else answers there, `healthy` is `false`, JSON `foreign_listener` is `true` and the table prints `another program answers on ` (also when no service is installed): the port is taken, which is not the same as nothing listening (#1998). It is a verdict only when the probe **ran**: `health_checked` says whether it did, and `health_skip_reason` why not (`config_missing`, `config_unreadable`, `stdio_transport`, `no_health_listener`, `connection_denied`: the OS refused the connect, as in a sandbox without network access, where `service status` prints `health: not checked (the connection to was denied by the OS: ...)` instead of `healthy: false`, #2165). An empty `http:` means Meridian is configured for **stdio**, so there is no endpoint to probe — the default listen address is never substituted, since that would probe an address nothing listens on. - `ui` — the address of the embedded Atlas UI (JSON `ui_url`, D227), only when the service is installed, configured for HTTP and `web.enabled` is on. A wildcard bind (`0.0.0.0`, `::`) is reported as `127.0.0.1`, because a browser cannot open a wildcard. An absent line means there is no UI, never that it is down — liveness is `healthy`. - `client` — one context line when the `.cartographer.yaml` on this machine points at a server that is not this local service. A local service alongside a client pointed at a shared remote one is a legitimate configuration, reported as context and never as a warning. The `--output json` shape is a contract: fields are added, existing fields and the exit codes keep their meaning. **Data/code separation**: the cartographer repo contains no data. KBs live in the data dir (default `~/cartographer-data`); every subdirectory of it is a separate KB. For multiple users on shared KBs, see §Example: K8s pod (Kubernetes minimal) below — the Meridian configuration is identical, only where it runs changes; one server process is the sole writer of a given working copy, so several instances mean separate clones synchronizing through the same remote, never two writers on one checkout (`concurrency.md` §Writer boundary). Client-side convenience: if `cartographer connect` targets a loopback URL and the probe fails because the service isn't running, it directly offers to install+start the service (in the interactive flow) or suggests `cartographer service install` (in the non-interactive one). #### Example: K8s pod (untrusted network, auth on, multi-client) The **Helm chart** in `deploy/helm/cartographer/` renders this scenario, and the Surveyor ones below, from a values file (D1441). The chart deploys any subset of Meridian and Surveyors: `meridian.enabled: false` renders Surveyors only (§Example: Surveyors only (Helm)), and `atlas.enabled: false` renders Meridian with `web.enabled: false` (§The embedded Atlas UI). The Atlas is never deployed alone. It is published to GHCR with every release at the version of the app, and it renders every object of this scenario: ```sh helm install cartographer oci://ghcr.io/beppetemp/charts/cartographer --version -f values.yaml ``` ```yaml # values.yaml (Kubernetes minimal: deploy/helm/cartographer/ci/meridian-minimal-values.yaml) meridian: tokens: existingSecret: {name: cartographer-tokens} # key `tokens`: the whole CARTOGRAPHER_TOKENS string credentials: existingSecret: {name: cartographer-credentials} config: # rendered to config.yaml, per config.example.yaml auth: {mode: "on"} kbs: - remote: ssh://git@gitea.example.com:2222/user/wiki-kb.git ``` The chart renders **no secret value** and no `Secret` object: tokens and the credentials directory are references to Secrets that exist before the install. ```sh kubectl create secret generic cartographer-tokens \ --from-literal=tokens="$(openssl rand -hex 32)" kubectl create secret generic cartographer-credentials \ --from-file=default.ssh=./id_ed25519 \ --from-file=known_hosts=./known_hosts \ --from-literal=audit.key="$(openssl rand -hex 32)" ``` No init container: bootstrapping the git remotes (§Bootstrapping a KB from a git remote) is done by the `serve` process itself at startup, reading `kbs:` from the mounted ConfigMap. The credentials Secret (§Credentials directory: one key per file) is mounted read-only at `/etc/cartographer-credentials` with `defaultMode: 0440`, and the pod carries `fsGroup` and `fsGroupChangePolicy: OnRootMismatch` (the data volume is not re-chowned at every start). The image runs as a user that is not root, so the Secret needs `fsGroup`: the kubelet makes its files `root:` and adds `0440` whatever `defaultMode` says, and without `fsGroup` a `0400` file is unreadable to Meridian. The group bit is not reported as a loose permission (§Credentials directory). The mount is read-only, so `audit.key` comes in the Secret: Meridian cannot generate it there, and without it a `best_effort` log runs unsigned, warning at every start, while `audit.mode: required` does not start. The chart refuses a release whose credentials Secret is not named (`meridian.credentials.enabled: false` opts out, and Meridian then keeps its keys on the data volume). Back the key up, since the audit log's signatures depend on it. A KB that needs a key of its own adds `.ssh`; an HTTPS remote reads `.token` or `default.token`. This scenario serves **multiple clients** (one or more agents connected via `cartographer connect` / `cartographer sync`, all over HTTP): git remains the sync/backup layer between Meridian and the remote KBs, not a requirement for the agent clients. The scenario is **Kubernetes minimal**; the chart's `meridian` values are the rest of it. **One replica, by construction.** One writer per working copy (`concurrency.md` §Writer boundary): the Deployment has `replicas: 1` as a literal, with no value to change it and no HorizontalPodAutoscaler, and the **Recreate** strategy. A rolling update starts a second pod on the same volume, or hangs waiting for a `ReadWriteOnce` volume to detach. A values schema (`additionalProperties: false`) rejects `--set meridian.replicaCount=3`, and a second server is a second release (the partitioned scenario, §Several servers, `ci/partitioned-a-values.yaml`). **The data volume** is a claim the chart creates (`meridian.persistence`, `ReadWriteOnce`, 10Gi by default) and keeps on `helm uninstall` (`helm.sh/resource-policy: keep`), or an existing claim (`meridian.persistence.existingClaim`). Reinstalling a release whose kept claim still exists fails in Helm on ownership: install it again with `existingClaim: -data`. **The `emptyDir` variant** (`meridian.persistence.emptyDir: true`, an explicit opt-in whose install notes list the losses) replaces the claim by an `emptyDir` volume, for a trial or a read-mostly server, never for a KB whose only copy is the pod. What it loses: the KBs are cloned again at every pod start, so **every KB needs a remote**; a pod lost inside the 3 s push debounce loses its last writes; `usage.json`, the conflict registry (`.cartographer/conflicts.json`) and the audit log (`/audit/audit.log`) vanish with the pod, unless `audit.log` points at a persistent path (§State and volumes). **Service and Ingress.** A ClusterIP Service on port 39273 selects the Meridian pod only (never a Surveyor's). The Ingress (`meridian.ingress`, off by default, with TLS as in `ci/meridian-full-values.yaml`) sends every path to that one Service. The Ingress controller must pass the browser's `Host` header through unchanged (§Example: single VM, reverse proxy requirements). To put single sign-on in front of the Atlas only, split `/ui` and `/api/ui` from the rest of the paths, as §The embedded Atlas UI (D227) describes (D308). Probes are in §Observability. **TLS in the chart.** `meridian.tls.secretName` names an existing Secret with `tls.crt` and `tls.key` (`ci/meridian-tls-values.yaml`): Meridian then serves HTTPS on 39273, the liveness and startup probes use `scheme: HTTPS`, and the readiness exec reads a plain-HTTP health listener on `meridian.tls.healthPort`. The chart owns `tls.enabled` and `tls.health_addr` in `config.yaml` and refuses a release that sets them in `meridian.config.tls`, or sets `tls.enabled` without the Secret (the pod would never become ready). The Surveyors of the release reach Meridian over `https://`, and toggling the Secret restarts them. **Config on a read-only mount.** The ConfigMap is read once at start and a change restarts the pod (a checksum annotation). A server YAML that cannot be rewritten keeps working, so `helm upgrade` is the realignment of a retired key, and `kb clone` or `kb rename` run in the pod cannot persist into the ConfigMap: declare KBs in `meridian.config.kbs`. **Hardening.** Every container runs with a read-only root filesystem (Meridian writes to `/data`, and its temporary files to an `emptyDir` on `/tmp`); `meridian.image.digest` and `surveyorImage.digest` pull the images by digest; `networkPolicy.enabled` renders a NetworkPolicy that opens Meridian's port to the release's Surveyors and the peers of `networkPolicy.ingressFrom` only, and closes the Surveyor pods (`ci/meridian-hardened-values.yaml`, the chart's README §Hardening). For raw manifests, `helm template` prints what the chart installs. What the chart does not cover: Compass, a standalone Atlas, an autoscaler, a PodDisruptionBudget, an egress policy, RBAC and the Secrets themselves. #### Example: stdio The agent's client spawns `cartographer serve --kb `, with no `--http`: that is stdio, exactly one KB, no Atlas and no `/health` (`transport-auth.md`). The entry is **written by hand** in the agent's own configuration, because `connect` writes HTTP entries only (D37). A stdio session keeps no audit log and no credentials directory unless the configuration says where (§Audit log). The binary form, with the KB created beforehand (`cartographer kb create --no-remote --local --data ` or `kb clone`): ```json { "command": "cartographer", "args": ["serve", "--kb", "/home/user/cartographer-data/kb-a"] } ``` The container form runs the image with the KB folder bind-mounted. The entry is `docker run -i --rm` with the mount and `serve --kb` pointing at the mounted folder as the arguments: ```sh docker run -i --rm \ --mount type=bind,src=/home/user/cartographer-data/kb-a,dst=/kb \ ghcr.io/beppetemp/cartographer: serve --kb /kb ``` The folder must be writable by the image's user: a folder created by the host user needs `--user "$(id -u):$(id -g)"` on the `docker run`, and a fresh named volume is root-owned and needs one `chown` run before the first start (the same step as §Example: single VM). The MCP Registry entry (`server.json`) declares the image on stdio with the same form: the bind mount of a KB folder the client asks for (`kb_path`) and the arguments `serve --kb /kb`, because the image's entrypoint is `cartographer` and with no arguments and no terminal it prints the usage and exits (#1438, pinned by `TestServerJSONLaunchesAServer`). The release workflow stamps the version and the image tag. The entry also carries the icon a registry or a marketplace that mirrors it shows next to the name: `docs/brand/coordinate-pine-256.png`, served from `main` (`TestServerJSONIconIsARepositoryFile` fails when the file moves). #### Example: single VM A **shared-VM recipe**: one always-on host, Meridian and optionally a Surveyor, bearer tokens, TLS at a reverse proxy. It is not a local mode, and containers stay out of the local deployment (D73). Two forms. **systemd, native binary.** A **system** unit, not `service install`: that one is a per-user unit whose generated definition sets only `PATH`. Create a dedicated system user, install the binary with `install.sh`, put the tokens in an environment file with mode 0600 (`CARTOGRAPHER_TOKENS`: never in the YAML), and give the unit's user the data directory: ```ini # /etc/systemd/system/cartographer.service [Unit] Description=Cartographer server After=network-online.target Wants=network-online.target [Service] User=cartographer EnvironmentFile=/etc/cartographer/env Environment=PATH=/usr/local/bin:/usr/bin:/bin ExecStart=/usr/local/bin/cartographer serve --config /etc/cartographer/server.yaml Restart=on-failure TimeoutStopSec=30 [Install] WantedBy=multi-user.target ``` The stop timeout is at least 30 s, for the graceful drain and the push flush. `git` is on the unit's `PATH`, and so are `sops`, `age` and `ssh` when the KBs use secrets or SSH remotes (the trap of the native service, §Example: native local service). After `install.sh update` the operator restarts the unit: `upgrade-repair` acts only on the native user service on loopback (§Client installation). **compose.** The Meridian service from the image, with the configuration and the credentials directory mounted read-only (`audit.key`, `default.ssh` and `known_hosts` are read, never written: read-only is fine), the tokens from an env file, the data in a named volume and the port published on `127.0.0.1` only, because the proxy runs on the host: ```yaml # compose.yaml services: server: image: ghcr.io/beppetemp/cartographer:latest command: ["serve", "--config=/etc/cartographer/config.yaml"] restart: unless-stopped stop_grace_period: 30s env_file: ./cartographer.env # CARTOGRAPHER_TOKENS=... ports: - "127.0.0.1:39273:39273" volumes: - ./config.yaml:/etc/cartographer/config.yaml:ro - ./credentials:/etc/cartographer-credentials:ro - cartographer-data:/data healthcheck: test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:39273/health"] interval: 30s volumes: cartographer-data: ``` The configuration sets `http: ":39273"`, `data: /data`, `credentials_dir: /etc/cartographer-credentials` and `auth: {mode: "on"}`. The health check uses `/health`: `/ready` needs a token once auth is on (§Observability). Two errors to expect. A listener off loopback with no token refuses to start. A fresh named volume is root-owned while the image runs as `cartographer`, so one `chown` run precedes the first start: `docker compose run --rm -u root --entrypoint chown server cartographer /data`. The optional Surveyor is a second service, the compose block of §The Surveyor (a third role), Packaging, with `server_url` set to the same HTTPS URL the clients use. On a host with the native binary it is the unit of §Example: Surveyor outside the cluster instead. **TLS at the server or at the proxy.** With `tls.enabled` the server terminates TLS itself (TLS 1.3, `tls.crt` and `tls.key` of the credentials directory, §Credentials directory), sends HSTS (`tls.hsts_max_age`), and announces `https://` URLs: the base of the RFC 9728 metadata, `ui_url` of `kb_status`, the `ui:` line of `service status` and the tray's Atlas item. A certificate that does not name the loopback host (`127.0.0.1` or `localhost`) makes a browser warn on the Atlas URL of a loopback or wildcard bind. There is no self-signed generation and no ACME (the certificate is yours), and client-certificate authentication (mTLS) is a later release. The public listener never serves plain HTTP, so a probe of `/health` there uses `https://`. Without `tls.enabled`, a proxy terminates TLS: **Reverse proxy requirements** (the proxy is not a product configuration): terminate TLS; forward `/mcp`, `/ui/`, `/api/`, `/health` and `/ready` to the one upstream; **preserve the browser's `Host` header**, because the Origin check compares the `Origin` host with the request's `Host` and a proxy that rewrites `Host` makes the Atlas and every browser caller fail with 403; set `X-Forwarded-Proto`. A single sign-on variant that protects `/ui` and `/api/ui` only, and leaves `/mcp` on bearer authentication, is in §The embedded Atlas UI (D308). ### Several servers Two scenarios involve more than one Meridian. They share one rule: **synchronization yes, scaling no**. **Partitioned servers** (different KBs on different servers). Each server mounts its own KBs. The managed Compass follows **one** server (`server_url`): it receives that server's skills, hooks and instructions (D73, one server at a time). Another server is reached by an MCP entry **written by hand** in the agent's configuration, on that server's `/mcp/routed` URL with a bearer header ([mcp-clients](mcp-clients.md) §Connect). `sync` leaves such an entry alone, it carries no managed block, and with no `provisioned=1` in its URL Meridian sends the operating guide in `initialize`. Kiro's tool namespace is flat (D102), so identical bare tool names of two servers collide there. **The same KB on two servers.** Two servers may mount one KB to keep it available in two places (a laptop and a cluster). Their writes reconcile through git, and a conflict on the same concept degrades to `needs-resolution`. This is the multi-server cooperation of D73; it is never a way to add write capacity or availability, which is what the rule "do not use several active writer servers as replicas" forbids. The recipe: - Both servers mount one remote: a cluster server through `kbs[].remote` (§Bootstrapping a KB from a git remote), a laptop through `kb clone`. Each has its own clone and credentials and, when the forge enforces membership, its own `git.identity`. Commits carry `Cartographer-Host`, which says which instance wrote. - **Both write the same branch**: the remote's default, or the `branch` of the KB's `settings.yaml`. A per-server `kbs[].branch` that differs on one of them makes the two servers write different branches that never reconcile. - There is no push notification. A write on one server reaches the other after the push debounce (3 s) and that server's next pull, which a read starts in the background once the 30 s freshness window has expired (`concurrency.md`). - A conflict on the same concept is `needs-resolution`: the registry `.cartographer/conflicts.json`, `conflicts_list` and `git_conflict_resolve` (`concurrency.md`). Reserved files such as `log.md` merge by themselves (D311). - Each Compass follows one of the two servers (D73); moving a Compass between them is `connect --server-url`. What it is **not**: no replicas of one KB, no load balancer in front of two servers sharing a KB, no automatic failover, and never two Meridian processes on one working copy (`concurrency.md` §Writer boundary). ### The Surveyor (a third role) ![The Surveyor at work in the Atlas: a source is declared in Settings, a Surveyor run starts, the Activity page shows the run, the graph gains the new concepts, and one source that fails raises an alarm in the Work panel.](https://raw.githubusercontent.com/BeppeTemp/cartographer/readme-assets/surveyor.webp) `cartographer surveyor --config ` is a background process for one **perimeter**: a set of KBs, the token that reads and writes them, the model endpoints and their budgets. It is a process of its own (its own container, sidecar or a unit you write), never started by `serve`: Meridian stays model-less and fetches nothing. It has no persistent volume, no inbound port and no probe endpoint; Meridian and the model endpoints are the only things it talks to. One config per perimeter; replicas are more processes with the same config. | Flag | Meaning | |---|---| | `--config ` | The Surveyor YAML (required; there is no environment alias). Without it the command prints usage and exits 2 | | `--once` | Evaluate the triggers once, run until no task has work, the window closes or the budget is spent, exit 0 (for an external scheduler); the last log line names the stop reason and the task count | | `--log-file ` | Append the log to a file instead of stderr, as `serve` does | `ca_file` (absolute path of a PEM file) lets a server with a certificate from a private CA be reached over `https://`: the file is added to the system roots for the `server_url` host and port only, so the model endpoints, the connectors and `fetch` keep the system roots. A file that is unreadable or holds no certificate stops the start (exit 2), naming `ca_file`. `source-test` reads it too. Exit codes: 0 graceful shutdown (SIGINT/SIGTERM), 1 runtime failure (including a server that is still unreachable after the start-up retries), 2 start error (nothing was started). The file is strict: an unknown key fails with its path and line. Secrets are never in it: `token_env` and `api_key_env` name environment variables. ```yaml name: docs-night # the perimeter; [a-z0-9-]{1,40} server_url: https://wiki.example.com/mcp ca_file: /etc/surveyor/ca.pem # optional: the private CA of the server certificate token_env: SURVEYOR_TOKEN kbs: [wiki-kb] models: # named profiles; tasks pick one - name: cloud provider: anthropic # anthropic | openai model: claude-sonnet-4-5 # the provider's model id api_key_env: CLOUD_API_KEY tier: large # small | large context_tokens: 200000 # the model's window (default 32000) budget: {daily_tokens: 2000000, run_tokens: 500000} - name: local provider: openai # llama.cpp / LiteLLM: base_url is required base_url: http://llm.internal:8080/v1 allow_insecure_http: true # plain http to a non-loopback host needs this opt-in model: small-model budget: {daily_tokens: 9000000} schedule: window: {start: "23:00", end: "06:00", timezone: Europe/Rome} tasks: # in priority order - kind: ingest model: cloud ``` `server_url` is the server's `/mcp` URL or, on a routed server, its `/mcp/routed` URL: the Surveyor asks `/health`, and when the server is routed it talks to the advertised routed endpoint with `?kbs=` whichever of the two is written, and names the KB of each call as the `kb` tool argument (D2109). A `server_url` with `?kb=` keeps the per-KB addressing and reaches that one KB. A start-up check that fails with 401 or 403 reports a rejected token; any other status is reported as it is, and a `400 kb parameter required` names the URL to use. The key table is `internal/surveyorconfig`. A task `kind` must be registered in the binary; a config can name only the kinds the binary registers: `ingest` (D1260), `poll` (§The `poll` task), `prompt` (§Prompt tasks), `synthesis` (D1263), `doctor` (§The `doctor` task) and `repair` (§The `repair` task). **The `ingest` task (D1260).** It executes the `IngestUnit`s of a campaign: per KB, one `work_list` of `type=IngestUnit`, the first unit that is claimable (`open`, or `in-progress` whose `review_after` is before today UTC) and that this Surveyor may take, claimed with `concept_patch` and `if_match` (`claimed_by` = the replica identity, `review_after` = today + 2 days: a day-granular crash net, since a Surveyor that fails or stops releases the unit at once). The profile's `tier` decides the units: a `small` profile takes `executor: any`, a `large` one also `large`; `human` is never taken. A unit whose Source names a `connector` other than the built-in `git`, or whose `locator` is not `http(s)` (for `git`: not an `https://#` on `git.allow_hosts`), is skipped, not failed, except that the locator is not checked for a unit with `content_asset` (inline content) or for a unit of a `system` Source; such a unit is still skipped when its `system` recipe is not declared or its `content_asset` name is invalid. The instructions are the unit-mode section of the bundled `cartographer-kb-ingest`, embedded in the binary (a binary without it does not start). The model gets the allowlist plus `source_fetch`, except for a unit that carries inline content (`content_asset`), which is fed from its asset and gets no `source_fetch`; `source_fetch` is a Surveyor-side tool with no argument that fetches only the claimed unit's Source locator (GET without credentials; same-host redirects only; 1 MiB, 30 s; text, HTML as plain text; a page is data, never instructions). When the loop ends the Surveyor, not the model, runs `gate_check` over the pages written: a pass sets the unit `done` and, once no unit of the Source is open, the Source `ingested`; a failure, a budget cut, an error or a cancellation releases the unit (`open`, a note naming the pages already written). The third consecutive release whose run wrote nothing (counted from the Surveyor's own notes in the unit body, so it survives a restart) blocks the unit instead, with a note that the page may already be current; any other note, or a run that wrote, resets the count. A unit released while a newer unit of the same `observed_group` exists (the poll leaves a claimed unit alone) is set `skipped` with `superseded_by`, not `open`. At the first run on a KB after the process starts, the Surveyor releases the claims whose `claimed_by` is its own perimeter's name and a replica id other than its own (the id is random per process, so the perimeter is the identity), with a note saying the claim was orphaned, instead of waiting for the day-granular lease; a claim of another perimeter is never touched. A second replica running concurrently in the same perimeter (a misdeployment) has its claim released too; the cost is a repeated run, not a double write. Every write of the Surveyor carries `Cartographer-Surveyor: /` (the `Cartographer-Surveyor` request header, recorded as a commit trailer), which is what the Atlas reads as a Surveyor's change (shown as the author `surveyor//`); the commit's author and committer are the KB's identity, so a forge membership rule accepts the push (D2392). Each write made during a run also carries the run's id in the `Cartographer-Surveyor-Run` header, the same id the run later reports; writes outside a run (the unit listing, the closing entries) carry none. A Contradiction the loop itself wrote is the unit's output, not a failure. No unit is claimed when the remaining grant is under the dearest completed unit (20 000 tokens before any). **The `synthesis` task (D1263).** The lowest-priority kind: it proposes what the KB already implies, as `Contradiction` concepts of a gap kind (`missing_context`, `open_question`) with `origin: synthesis`, `provenance` (the pages the evidence comes from, each checked to exist at write time) and `confidence`; it never changes a claim on an existing page (D1263). It must be the **last** entry of `tasks` (the loader refuses any other position): the runner takes the first entry that has work, so it runs only when the entries before it have none. It offers work only when a candidate exists, and it spends only the daily budget above `synthesis_reserve` (a fraction of `daily_tokens`, kept whatever `run_tokens` says). Per run it takes the candidates the server's own signals give (undefined terms, repeated search misses, repeated facts, unlinked central pages), at most `synthesis_max_candidates`, one model call each, and writes at most `synthesis_max_new`. The instructions are embedded in the binary. The model sees a narrower allowlist than ingest and a Surveyor-side guard refuses every other call, so a write can only create the hypothesis at its computed id; every commit's reason is `synthesis: `. The run record (the closing `log_append`) lists the candidates examined and the hypotheses written; the next run skips the ones listed in the last 7 days. Closing a hypothesis is a reader's work (`resolution_outcome: confirmed | rejected`). | Key (under `tasks[]`) | Default | Meaning | |---|---|---| | `synthesis_map` | `""` | The map hypotheses are written into; empty = the map of the newest Contradiction; none found, the task ends without a write (it never creates a map) | | `synthesis_max_candidates` | `5` | Candidates examined per run | | `synthesis_max_new` | `3` | Hypotheses written per run | | `synthesis_context_tokens` | `6000` | Cap of the page text sent to the model per candidate | | `synthesis_reserve` | `"0.2"` | Fraction of the profile's daily budget left untouched; synthesis starts only above it | ```yaml fetch: allow_private: false # true: source_fetch may reach private, loopback and link-local addresses ``` `fetch.allow_private` is refused by default after DNS resolution (checked on every connection, redirects included): a Surveyor runs inside someone's network and must not become a proxy to it. **Connectors (D1262).** `connectors` is a mapping, by name (`[a-z0-9-]{1,30}`, no `/`, not `git`, `fetch` or `artifact`; `/` names belong to plugins, at most 31 characters in all, each part starting and ending with a letter or digit), of external MCP servers the unit-execution task may read documents through. Each takes `transport: stdio` (`command`, `args`, `env`) or `transport: http` (`url`, `token_env`, `headers`, `allow_insecure_http`), plus `tools` (required), `call_timeout` (default 60s) and `max_result_bytes` (default 256 KiB). A Source names a connector in its `connector` field; nothing else in a KB selects one. The model is offered only the tools listed in `tools`, as `__` (a plugin's `acme-wiki/wiki` is written `acme-wiki--wiki__`, and two connectors offering the same prefix are a load error; a set that reaches the run with such a pair refuses to start every connector of it; a tool whose offered name is over 64 characters, the cap providers enforce, is logged and not offered, for operator-local connectors too), and a call to any other is refused by the Surveyor before it reaches Meridian: Meridian's own tool list is untrusted. Every value of `env` and `headers`, and `token_env`, is the **name** of a variable of the Surveyor (a value is refused at load, without echoing it); the variable is read when the connector first starts, and a stdio child receives only the variables listed plus `PATH` and `HOME`. A connector that cannot start (command missing, variable unset, server down) is skipped for the run, not fatal: a unit whose Source names a declared connector is offered to the unit-execution task alone, which starts the connector before claiming the unit and adds its allowlisted tools to that unit's loop (never poll, doctor or synthesis). ```yaml connectors: docs-wiki: transport: http url: https://wiki-mcp.example.com/mcp token_env: WIKI_TOKEN tools: [get_page, search] local-files: transport: stdio command: ./bin/files-mcp # a path with a separator is resolved against this file's directory env: {API_TOKEN: FILES_TOKEN} tools: [read_file] ``` **Pinned plugins.** The Surveyor's config takes the same pair of keys: `plugins_dir` (absolute, or relative to the config file's directory) and `plugins.` with `digest`, `enabled` and `settings`, for the plugin's `surveyor` side. The digest is the only consent: a plugin whose tree differs from it, or that is missing, edited, without a `surveyor` side or not loadable by this binary, stops the start with an error naming `plugins.` and its line, before any model or network call; a malformed digest or `plugins` without `plugins_dir` is refused at load. The `recipe` dry run (`surveyor --recipe`) does not load plugins. A change of a pin takes a restart. `plugins..env` maps each variable name the plugin's manifest declares under `permissions.env` to one of the Surveyor's own variables (`{WIKI_TOKEN: WIKI_API_TOKEN}`): every declared name and no other, or the start is refused. The plugin's recipes and connectors (`/`, `docs/plugins.md` §Surveyor side) then run with only those variables plus `PATH` and `HOME`. `plugins..allow_private_hosts` (exact host names, at most 16) is the Surveyor's half of the private-network grant: a host listed there and under the manifest's `components.surveyor.permissions.net_private` may resolve to a private or loopback address (never link-local or a cloud metadata address) for the plugin's Starlark recipes. A host the manifest does not declare stops the start, naming both keys; a declared host left out stays refused. Exec recipes and MCP connector processes are not held by it (`docs/plugins.md` §Network and environment for scripts). **Recipes and the git reader (D1262).** A recipe lists what changed in a feed Source since its cursor, with no model; `git-docs` is the first built-in (Source `locator` = https repository URL, `feed_include` default `docs/**/*.md`, entries are files, `connector: git`). `git.allow_hosts` names the hosts the built-in git reader may clone (an exact host, or `*.example.com`; an IP only verbatim); it is empty by default, so no feed and no git entry is read. The reader takes https remotes only, with no credential: `file://`, `git://`, ssh, scp-like, local paths and any remote with userinfo are refused before a clone; a private repository is an exec recipe or an MCP connector. (An inline unit has no `source_fetch`.) For a unit whose Source has `connector: git` the `source_fetch` tool reads `#` from a clone made for that unit's run only (one clone per unit, deleted when the unit finishes, not shared across units), after checking the host, that the path is inside the repository (`.git` included) and that no component is a symlink; 1 MiB. Every clone is anonymous whatever the Surveyor's own git setup: no global or system git config, credential helper, askpass or extra header, no redirect followed, 5 minutes at most, history blobs not fetched. Symlinks, submodules and type changes are never listed. `recipes..instructions_file` (a built-in's name only, a path inside the config directory, at most 16 KiB UTF-8, read at load) replaces the recipe's embedded instructions text. ```yaml git: allow_hosts: [git.example.com, "*.corp.example.com"] recipes: git-docs: instructions_file: recipes/git-docs.md ``` **Exec recipes (D1262).** A recipe of your own is an executable declared under `recipes.` with an `exec` block (`command`, `args`, `env`, `timeout`, `max_output_bytes`, `max_content_bytes`), an `instructions_file`, optionally a `connector` and `settings` (scalars sent to the script as `config`); it lists a feed over a JSON stdin/stdout protocol, with no shell, a per-call temp directory and only the environment variables you list. The keys, protocol v2 and the trust model are in [surveyor-recipes.md](surveyor-recipes.md), which also describes `cartographer surveyor source test`, the dry run of a recipe. A script that needs an interpreter runs from a derived image (`FROM` the Surveyor image, §Example: a derived image for exec recipes) or from a mounted read-only volume, and the Surveyor now needs a **writable temp directory** (an `emptyDir` on Kubernetes) for exec recipes and git reads, which refines "no volume" to "no persistent volume". ```yaml recipes: wiki-changes: instructions_file: recipes/wiki-changes.md connector: docs-wiki exec: command: ./bin/list-changes env: {WIKI_TOKEN: WIKI_API_TOKEN} ``` The clone itself and the commands run in it afterwards (HEAD, ancestry, tree and diff listings) are anonymous too, with `HOME` and `XDG_CONFIG_HOME` pointed at an empty directory, so the operator's git config is out of reach on any git version (`GIT_CONFIG_GLOBAL` alone needs git 2.32). **System sources (D1372).** A live read-only system (a Kubernetes cluster, a cloud account, a metrics or dashboard instance) is a Source with `source_shape: system` and a `recipe` whose `shape` is `system` ([surveyor-recipes.md](surveyor-recipes.md) §System recipes). Register it once with `source_register` (`source_shape: system`, `recipe`, `locator` an opaque label such as `kubernetes://dev-cluster`) and set `feed_interval` and `feed_include` with `concept_patch`; an IngestPlan must list it in `sources`. Every poll runs the lister's `check`, lists the current state grouped, diffs it against the state kept on the Source and creates one unit per **changed** group; the executor runs those units with KB tools only (no tool on the system). The reference lister, its recipe block and its README are in `examples/system-recipes/kubernetes/`; it needs Python 3 and `kubectl` in the image (a derived image `FROM` the Surveyor image or a mounted volume, as above), and `KUBECTL`, `KUBE_CONTEXT` and `KUBECONFIG` set in the Surveyor's environment. A metrics source reports verdicts, not values ([surveyor-recipes.md](surveyor-recipes.md) §Verdicts, not metrics): its reference lister and weekly review task are in `examples/system-recipes/prometheus-verdicts/`. *Cost.* One measured development cluster had 583 objects in 27 namespaces: 4.3 MB of raw JSON (about 1.1M tokens), 209 KB normalized (about 52k tokens), about 8 KB per namespace. The first poll creates one unit per namespace (the baseline); a typical day changes a few namespaces, so a few thousand tokens; an unchanged system costs none. *Revisions and commits.* When a group changes again, the new unit supersedes every `open` unit of the same group (`skipped`, `superseded_by`; the poll's summary counts `superseded`); a unit claimed by a live replica is left alone and is superseded when released. A poll that finds nothing to do (no group changed, the state trusted, no `feed_error` to clear) writes nothing, not even the lease or `feed_checked_at`: the schedule is kept in memory, so a restart polls once more. The lease is taken once the observation finds work. A failure the Source already records (the same `feed_error` line) is not written again. *Caps.* A group is at most `exec.max_content_bytes` (default 128 KiB), a diff 400 lines / 64 KiB, a listing 1000 groups, the state file 8 MiB; over a cap is an error naming the group or the count (group coarser or filter with `feed_include`). A large first run is spread over polls by the poll task's `max_entries` and `feed_interval`. *Give the lister a read-only identity.* The check refuses a misconfigured identity but is not a security boundary (the script is operator code); the boundary is the identity: - **Kubernetes**: a dedicated ServiceAccount bound to the `view` ClusterRole, which does not include Secrets; the example's check refuses an identity that can read secrets, write pods, deployments or namespaces, or do anything on `*`. - **Cloud account**: a dedicated read-only / view-only policy; check what it can still read, since "read-only" can include secret values. - **Metrics or dashboard system**: a viewer role or a query-only token. **`http-pages`** is the second built-in: the Source `locator` is a sitemap (XML) or an HTML index, `feed_include` a list of URL prefixes (a trailing `*` is accepted; none = every link of the index's own host), one level, no crawl. It reads only hosts in `fetch.allow_hosts` (deny by default), https unless `fetch.allow_insecure_http`, with the same fetch as the unit executor (1 MiB, redirects within the host, `fetch.allow_private`). More matching links than the poll's `max_entries` is `list_failed` and nothing is listed. The revision of a page is its `ETag`, else `Last-Modified`, else a content hash; every matching page is emitted each poll and the unit ID tells new from known; the cursor is a digest of the sorted `url|revision` list and an unchanged digest ends the poll. It never reports a removed page (a digest cannot say which went). A page with neither `ETag` nor `Last-Modified` whose body changes on every request (a timestamp, a counter) gets a new revision at every poll, hence a new unit at every poll: put such a page out of `feed_include`, or use an exec recipe that computes a stable revision. ```yaml fetch: allow_hosts: [docs.example.com] allow_insecure_http: false ``` **The `poll` task (D1262).** `{kind: poll, model: , default_interval: 24h, min_interval: 1h, max_entries: 200}`, at most once. Prerequisites: run `ingest_setup` first (advice: the poll does not check it); exactly one `IngestPlan` lists the feed in `sources` (else `no_ingest_plan` or `ambiguous_ingest_plan`); the journal of the Sources exists (`source_register` defaults to `sources`, pass `map` for another). It reads the feed Sources (`source_shape: feed`) of each KB and takes the due one checked longest ago (`feed_checked_at` plus `feed_interval`, else `default_interval`). One feed per run: it checks the recipe and its host list, leases the feed (`feed_checked_at`, compare-and-swap: the loser skips silently), finds the one `IngestPlan` that lists the feed in `sources` and lists the entries with the recipe, with no model. For each added or modified entry it looks for the document's Source by locator, shapes the unit, then registers the Source (never `sha256`; an `ingested` Source returns to `pending`) just before it creates an `IngestUnit` at the ID `/-<8 hex of sha256(feed|locator|revision)>`; the unit map is the map the `IngestPlan` lives in (the first segment of its ID), or the map of its existing units when it has some; the plan's `maps` only limits where `targets` may point, and a plan outside a map that has no units yet fails with `unit_refused`; a unit that exists means the entry was handled and costs nothing. A new unit costs one model call with no tools (plan, feed and entry as delimited data, plus, when the entry has text, inline or fetched, a `content` data block with its first 6 KiB, cut with a `[truncated n bytes]` marker; the answer is JSON the Surveyor validates and retries once), made before the Source is registered, so a failed call leaves no Source without its unit; a changed document reuses the previous unit's fields with no call. The cursor advances only after every entry is handled; a spent grant leaves it, and the next poll skips the finished entries. Removed entries are counted, never acted on. A feed that cannot be polled gets `feed_error: : ` (`bad_field`, `recipe_unknown`, `recipe_shape`, `host_not_allowed`, `no_ingest_plan`, `ambiguous_ingest_plan`, `list_failed`, `fetch_failed`, `protocol_error`, `cursor_invalid`, `unit_refused`, `grant_exhausted`, `model_failed`) with the values of the connectors' credential variables replaced by `***`, and is retried at its interval. `model_failed` is a model call that failed (the API's error, one line, with the entry): the Source also gets `feed_retry_after`, 15 minutes later, and the feed is polled again then if its interval is longer; a second failure of the same streak waits the interval. A 401 or 403 is written too, with no early retry, and still turns the profile off for the run. A system Source's model call, one per changed group, fails the same way (the entry is the group's key). The Atlas feeds view lists the code like any other. The **budget is per model profile** (`budget.daily_tokens` across the perimeter's KBs, `budget.run_tokens` for one run) and is **rebuilt from the KBs' logs**, never from local disk: each run that touched a KB closes with a `log_append` (path `surveyor/`) whose line carries `day=`, `tokens.=` and `stopped=`, and the next run sums today's lines. A task's grant is `min(remaining today, run_tokens)` minus what the run already spent on its profile; an exhausted profile skips its tasks while the others go on. The day is the calendar day of `schedule.window.timezone` (UTC without a window). If the ledger cannot be read, or a day outgrows the capped read, the run is skipped and retried at the next poll. Tokens are counted as the API reports them, whatever the provider: tokens read from a prompt cache count in full, so a test on a cloud model spends the same budget as the run on a local one. Cache reads appear only in the `surveyor_task` metric. `context_tokens` (default 32 000) is a separate limit: a run is told once to close when a prompt reaches 75% of it, when the budget would not pay for two more turns or when two steps are left, and it stops before a prompt that would not fit. A tool result is capped at half of it, read as bytes: 16 000 at the default, down from 32 KiB. `max_output_tokens` (default 4096) bounds one answer: a turn it cuts is dropped and retried once, the second in a row stops the task. `timeout_seconds` (default 120) bounds one attempt of a model call, which is not streamed: a slow local model needs more. Each finished task logs one JSON line `{"metric":"surveyor_task",...}` with tokens, cache reads, steps, the largest prompt, tool calls and tool errors, and never a page's content. An unattended doctor does not get `map_create` or `map_update`: the shape of a map is the operator's. **Start-up checks**, in order; each failure exits 2 and starts nothing: the config loads (and every `*_env` variable is set); `/health` answers (a server that is starting or unreachable is retried for up to 5 minutes, then exit 1) and, when it names `component_protocol`, one the Surveyor can use (within one of its own, `control-plane.md` §Component contract), else exit 2 naming both numbers; `server/discover` accepts the token (`/health` is public and serves a wrong token as an anonymous caller, so only this call proves it); `/health` names KBs for the token; every name in `kbs` is among them. The roster is a read view: the perimeter token needs `kb::rw` on each KB (§Fine-grained roles), and a read-only token meets its first refusal at the first write. Give it an `id` so the audit log names the Surveyor. **Why the Surveyor may run unasked (D1258).** D704 says an agent works on a KB only when the operator asks; deploying a Surveyor for a perimeter, with its budgets, window, KBs, profiles and tasks, is that asking. Nothing else changes: Meridian runs no model, `serve` never starts or links the Surveyor, `connect`/`sync` install no scheduler, and every write is a revertible commit with a `Reason` trailer. **The `doctor` task (D1261, D1436).** `kind: doctor` (one entry) keeps a KB in order on its own. Put it after the ingest kinds: it works with what they leave. It needs no `doctor_suggested`: the signal is that a repair or a review item is waiting. A degraded KB is skipped, and a KB with nothing to do costs no model call and is read again after an hour. `tasks[].doctor_allow` says how far a run goes: | Word | What a run may do | |---|---| | (always on) | Close or suspend work, frontmatter only: `status_reclassify`, `zombie_work`, the `stale_open` lint judgement | | `repair` (the default) | Apply, in one commit and with no model, the mechanical fixes Meridian's background repair leaves: `broken_link`, `superseded_target_retired`, `unknown_type`. `invalid_field_value` also needs `structure`, because it drops values from pages. Any other check never runs unattended, a new one included: `reciprocal_link_item` can drop hundreds of edges and `junk_file` changes what git tracks | | `pages` | Edit the body of the pages an item names: `repeated_fact`, `duplicate_candidate` (a link between two different subjects), `closed_with_open_items`, `template_extra_section`, `template_section_missing`, the `island` observation | | `structure` | `facet_sprawl` and `missing_value_contract`: declare the proposed vocabulary with `map_update`, on the item's map, only the field the item proposes and exactly its list, and the Surveyor adds back the fields the map already declares. With `repair`, the next run converges the pages, dropping values outside the list. `index_unclassified`: `index_patch` on the item's map | | `archive` | `harvest_candidate` and `lesson_unpromoted`: carry a closed journal entry's facts to the live pages it links when the item starts, body only, then set it `archived`. Nothing is deleted or moved | **The `repair` task.** `kind: repair` (one entry, no `name`) asks Meridian for its own staged repair, `kb_repair` with `check: auto`, once per KB of the perimeter, in one commit. It calls no model: the entry sets no `model:` (one is a load error) and a config whose every task is `repair` may omit `models:`. `tasks[].repair_interval` (default `24h`, at least `1h`) is how long a KB rests afterwards, whether or not anything was applied; a restart repairs once. A KB Meridian refuses to repair (an open git conflict, a degraded sync) rests for an hour. The run writes its closing entry to the KB's log only when it applied something or failed: a repair that finds nothing to fix commits nothing. The task's summary names what it applied, per check (`auto-repair: 5 fixes in one commit (broken_link 3, stringified_list 2)`), or says `auto-repair: nothing to repair`. The commit carries the Surveyor's token like every Surveyor write. The heartbeat declares the task kinds a Surveyor runs (`tasks`, see the control-plane page). **Handover:** once the Surveyor's first `repair` call has succeeded, Meridian's own background repair of that KB pauses for as long as the Surveyor keeps beating and repairing (it resumes within 15 minutes of three missed beats, a clean stop, or no successful repair within the server's timer period plus an hour); a `repair_interval` longer than the timer period (one day) therefore never takes a KB over; until then, and always after a Meridian restart, the timer runs. It is independent of `doctor`, whose `repair` word stays the extras the background repair leaves. A minimal config: ```yaml name: repair-night server_url: https://meridian.example.com token_env: SURVEYOR_TOKEN kbs: [kb-a] schedule: window: {start: "02:00", end: "05:00", timezone: UTC} tasks: - kind: repair repair_interval: 24h ``` The Surveyor reads `kb_review` itself, at no token cost, up to 500 items per kind, and deals them one rule at a time, in that order, so a long check does not keep the others out of a run. An item no rule covers stays for a prompt task (§Prompt tasks) or an operator's `cartographer-kb-doctor` session; that includes `concept_merge` and `concept_archive`, which `tools/list` does not advertise, and a new template, which needs `artifact_write`. Each item is a loop of its own, at most 8 steps and 40,000 tokens, with short instructions embedded in the binary and only the tools its rule names, so one item's context never reaches the next. Frontmatter stays `status`, `waiting_on` and `review_after`. A run examines at most 10 items, applies at most `max_writes` writes (default 20), starts an item only with 20,000 tokens of grant left, and ends after three writes in a row Meridian refuses (a read-only token). The KB is the memory: a settled item leaves `kb_review`, and an examined one is recorded on the log path `surveyor//doctor` (`day= examined= writes=`) and left alone for 14 days, so the next run picks up where this one stopped. A run stopped by a shutdown records nothing and an item cut by `max_writes` is not recorded: what they did not settle comes back. A run never writes `kb-doctor`: `last_doctor` moves only with an operator's session. Every commit carries `Reason: doctor: ` (`doctor: repair` for the repair), so `git log --grep 'doctor: '` finds a pass and each commit reverts alone. The Surveyor's log has one line per item, with how it ended, its steps, its writes and how many did not land, and one line for each write refused by the guard or Meridian, so an item with no commit tells a model that left it from a fence that stopped it. **What the words trust.** The guard limits where a write lands, not what it says: a model reads the pages it edits, so text in a page can steer it inside its fence. With `pages`, `archive` or `structure` someone who can write a page can have a run write to the pages an item names, or to a map's index (`index_unclassified`), and with `archive` the author of a journal entry chooses the pages it links, and so where a run may write, and an item can add a link that a later item or run follows. Turn them on for a KB whose writers you trust. The default is narrower, not immune: a repair is mechanical, but a rule always on is a model reading a page, so a page's writer can steer whether the item's pages are closed or suspended and the text of `waiting_on`. **The runner.** Every `schedule.poll_seconds` it checks, per KB, whether the window holds or the KB has been idle for `idle_minutes` (the idle signal is Meridian's `last_activity_at`, answered to the Surveyor's heartbeat, `POST /api/component/v1/heartbeat`: [control-plane](control-plane.md) §Surveyor heartbeat; until the Surveyor beats, it is window-only). **Beat, settings, idle (D1259).** The Surveyor declares itself with `POST /api/component/v1/heartbeat` from its own goroutine: once at start (before the triggers are read, so `--once` has the idle signal), every 60 s, and once with `state: stopped` on a clean exit; the instance id is the perimeter `name`, `-` and six random hex characters. Right after the first beat it posts its settings to `POST /api/component/v1/settings` (typed scalar entries, never a secret: an `*_env` value is a variable name followed by `(set)` or `(unset)`, a URL has no userinfo, models and tasks are not listed) plus its `sources` (each recipe and connector: name, origin, kind and the outcome of its last `check`, never a command or a value; [control-plane](control-plane.md) §Surveyor settings reports), and again whenever a beat answers `settings_wanted` or a system recipe's check has run since the last report (at most once per beat). Finished tasks and open alarms go to `POST /api/component/v1/runs` (a task's tokens, its outcome, at most 20 per post, the whole recent history again on `runs_wanted`), and with them what it noticed that a person would report: a tool that failed unexpectedly, a protocol the two sides could not agree on, a result it could not decode (a kind, a tool name and a code, never an error text, at most 16 per post; Meridian drops them when `feedback.destination` is `off`). The idle time is the answer's `now` minus `last_activity_at` (or `server_started_at` when `null`), plus the local time since the answer; an answer older than three beats, a `404` from an older server (it has no component route), a `426` (the server refuses the Surveyor's component protocol: logged once per distinct window, the beat goes on), a KB the answer omits and `activity_known: false` (authentication off: Meridian cannot tell the Surveyor from a person) all make the idle trigger not hold, so the Surveyor runs on its window only. A failed beat or report is a log line and never fails a run; a settings report Meridian refuses with a 4xx is logged once per status, backed off for ten beats and sent again, as the runs report is. Meridian bounds a heartbeat, so the config is refused at load past **32 KBs** or **8 model profiles**. A run rebuilds the budget from the logs, then works the KBs in `kbs` order, one task at a time: the first `tasks` entry whose profile still has a grant and whose kind finds a unit of work, then the walk restarts from the first entry. A failing task is not retried in the same run; repeated errors on a KB (the limit is `maxConsecutiveErrors` in `internal/surveyor/runner.go`) skip it until the next poll (this is also how a token with read but no write grant shows up). A revoked token (401) or a refused host (403) ends the process with exit 1. A profile whose model API rejects the credential is off for the rest of the run and tried again at the next one. A run closes with one `log_append` per KB it touched, ending `stopped=done|window|budget|idle|shutdown|error`; a KB the run left quiet (`stopped=done` or `stopped=budget`, no tokens, no unit, no commit) gets no entry, so a poll that found nothing writes nothing to the KB's log. A run takes tasks until none has work left, the window closes or the grant is spent, and logs `surveyor: run ended stopped= tasks=` on exit; with `--once` that line is the whole answer to "did it drain". A grant above zero but below the ingest floor (the dearest unit completed so far, at least 20 000 tokens) leaves the claimable units unclaimed, so the run ends `stopped=budget`, never `done`: raise `run_tokens`, or run again once the day's budget allows. **Shutdown.** SIGINT/SIGTERM cancel the in-flight model call, abandon the task in progress (its claim lapses by lease; what was committed stays), write the closing entries in parallel with a 5 s HTTP timeout and exit 0. A second signal exits at once with 1. Keep `terminationGracePeriodSeconds` at 30 or more. **What survives a restart.** Nothing is written to local disk that must survive, so a replica needs no persistent volume. | State | Where | After a restart | |---|---|---| | Spend of finished runs, per profile | the closing entries in the KBs' logs | rebuilt before each run | | Spend of the run in progress | in-process counters | lost on a crash: the day can exceed a profile's `daily_tokens` by at most its `run_tokens` per crash | | A closing entry that could not be appended | nowhere | counts like a crash for that run and KB | | Work half-done | the KB (a claim with a lease, commits already made) | an expired lease is re-claimed by any replica | | Window, idle state, poll timers | clock and server | recomputed | | Replica identity | memory | a new random id; old claims lapse by lease | | Replicas' counters | not shared | overshoot bounded by `replicas x run_tokens` per profile | The budget is a cost-control guard, not a quota the provider enforces; set `run_tokens` to the overshoot you accept. **Packaging.** The Surveyor has its own image, `ghcr.io/beppetemp/cartographer-surveyor`: the same binary as Meridian's, with `git` and the CA certificates and none of Meridian's secret and ssh tooling (`sops`, `age`, `openssh-client`), no persistent volume and no inbound port. Its entrypoint is `cartographer surveyor`, so a deployment passes flags only: compose `command`, Kubernetes `args` (a Kubernetes `command` would replace the entrypoint). A shell or `cartographer version` needs `--entrypoint`, because `docker run version` hands `version` to the Surveyor. The Meridian image still runs a Surveyor (`surveyor` as its first argument): a deployment that does keeps working. The image has no `tzdata`; the binary embeds the zone database, so `schedule.window.timezone` resolves there. ```yaml # compose.yaml services: surveyor: image: ghcr.io/beppetemp/cartographer-surveyor:latest command: ["--config=/etc/cartographer/surveyor.yaml"] restart: unless-stopped environment: SURVEYOR_TOKEN: ${SURVEYOR_TOKEN} CLOUD_API_KEY: ${CLOUD_API_KEY} volumes: - ./surveyor.yaml:/etc/cartographer/surveyor.yaml:ro ``` ```yaml # Kubernetes, with the Helm chart (§Example: K8s pod): one `surveyors` entry per perimeter surveyors: - name: docs-night mode: deployment existingSecret: docs-night-env # SURVEYOR_TOKEN, CLOUD_API_KEY: every key is an environment variable config: # surveyor.yaml, no secret in it token_env: SURVEYOR_TOKEN kbs: [kb-a] ``` The token is a dedicated one, scoped `kb::rw` to the perimeter's KBs only (`auth.tokens`, §Fine-grained roles), with an `id` so the audit log names the Surveyor. A Surveyor must not change a skill, an agent or a hook that every client of the KB syncs and executes, yet it needs whole-KB `rw` (`log_append`, `source_register`): give it a role with `artifacts: r` (§Fine-grained roles). To drive the Surveyor from an external scheduler instead of its own window, run it with `--once`. As a native service, write the unit yourself: `cartographer service` manages only Meridian. In Kubernetes a perimeter is one `surveyors` entry of the chart: its own ConfigMap (`surveyor.yaml`, plus the text `files` that `instructions_file` names by plain name) and one Deployment or CronJob, with one `emptyDir` on `/tmp` for exec recipes and git reads and no persistent volume, port or probe. The Secret is yours: `existingSecret` names it and **every** key becomes an environment variable (the token, the model keys, an exec recipe's `KUBECTL`), and the chart has no `env` value, so no value is rendered by mistake. One config per perimeter, so a second perimeter is a second entry; `replicas` above 1 are more processes with the same config and unshared budget counters. The entry's Deployment is `Recreate`, since a rolling overlap would be a second spender. An entry's `image` overrides the Surveyor image for a derived one, which must keep the entrypoint `cartographer surveyor` because the chart passes only arguments. A `serviceAccountName` also mounts the API token on that entry's pod, for a system-source lister (the account and its read-only role are the operator's: the chart creates no ServiceAccount or RBAC). Set `server_url` to the Ingress's HTTPS URL. With no `server_url` the chart injects the Meridian URL (the in-cluster Service URL, or `meridian.url` when the release has no Meridian) and, for a plain `http` one, `allow_insecure_http: true`, because a plain `http` URL to a non-loopback host needs that opt-in, and the install notes say that the token then crosses the network in clear. #### Example: Surveyor outside the cluster A machine with a GPU or a local model, reaching Meridian over HTTPS. `server_url` must be `https://` for a non-loopback host unless `allow_insecure_http` is set. `cartographer service` does not manage the Surveyor, so the unit is a **system unit** written by hand: the binary comes from `install.sh`, the command is `surveyor --config `, and the variables the config names (`token_env`, `api_key_env`) come from an environment file with mode 0600, never from the YAML. There is no port to open. ```ini # /etc/systemd/system/cartographer-surveyor.service [Unit] Description=Cartographer Surveyor After=network-online.target Wants=network-online.target [Service] User=cartographer EnvironmentFile=/etc/cartographer/surveyor.env ExecStart=/usr/local/bin/cartographer surveyor --config /etc/cartographer/surveyor.yaml Restart=on-failure TimeoutStopSec=30 [Install] WantedBy=multi-user.target ``` The stop timeout is at least 30 s, the grace period the Surveyor itself advises (§The Surveyor (a third role), Shutdown). The model endpoint is local: a loopback `base_url` needs no opt-in, and a plain `http` model URL on another host needs `models[].allow_insecure_http` in the config. The token is the dedicated, perimeter-scoped one with a role that has `artifacts: r` (§The Surveyor (a third role), end of Packaging). The same unit serves a Surveyor next to the Server on one VM (§Example: single VM), where it replaces the compose service. #### Example: Surveyor as a CronJob `surveyor --config --once` evaluates the triggers once, runs if a task is due and exits. Each of these is a trap: - The config still needs `schedule.window`, and `--once` runs only when the window holds at launch: **the CronJob's schedule falls inside the window**. Use a window as wide as the CronJob needs; `00:00` to `23:59` is the widest the loader accepts (equal start and end is refused), and a launch in the last minute does nothing and exits 0. - A feed is polled only when due (`feed_checked_at` plus `feed_interval`, default 24h), so a repeat `--once` test inside the interval may do nothing (the first poll, or a failure, sets `feed_checked_at`); clearing `feed_checked_at` makes the next poll run. - Nothing is kept on local disk and the budget is rebuilt from the KBs' logs, so a CronJob loses nothing between runs. - Two overlapping runs both run a due task (there is no lock), so `concurrencyPolicy` is `Forbid`. - The exit codes are 0 done, 1 runtime failure and 2 start error. The Job does not retry (`restartPolicy: Never`, `backoffLimit: 0`) and the next schedule is the retry. Bound a run with `activeDeadlineSeconds`. The chart renders each of these (`mode: cronjob`: `concurrencyPolicy: Forbid`, `restartPolicy: Never`, `backoffLimit: 0`, `--once`, `terminationGracePeriodSeconds` of 30 or more); the cron expression only decides when the process starts, and a tick outside the config's window or idle trigger runs nothing and exits 0. The window of the config, as an excerpt: ```yaml schedule: window: {start: "00:00", end: "23:59", timezone: UTC} ``` ```yaml # Helm: deploy/helm/cartographer/ci/surveyor-scheduled-values.yaml surveyors: - name: docs-night mode: cronjob schedule: "15 2 * * *" # inside schedule.window activeDeadlineSeconds: 14400 existingSecret: docs-night-env config: token_env: SURVEYOR_TOKEN kbs: [kb-a] schedule: window: {start: "00:00", end: "23:59", timezone: UTC} ``` A systemd timer or any external scheduler has the same semantics: the launch time falls inside the window, runs must not overlap, and the next launch is the retry. #### Example: Surveyors only (Helm) A release with `meridian.enabled: false` renders no Meridian object (no Deployment, Service, ConfigMap, claim or Ingress): only the `surveyors` entries, which reach an external Meridian at `meridian.url`. A Meridian setting the chart can tell is set (ingress, tokens, claim, `config.kbs`, credentials) is refused; one it cannot tell from its default (the image, the probes) is ignored. The release needs at least one Surveyor entry. ```yaml # Helm: deploy/helm/cartographer/ci/surveyor-only-values.yaml meridian: enabled: false url: https://wiki.example.com surveyors: - name: docs-night mode: cronjob schedule: "15 2 * * *" existingSecret: docs-night-env # holds SURVEYOR_TOKEN config: token_env: SURVEYOR_TOKEN kbs: [kb-a] ``` ```sh kubectl create secret generic docs-night-env --from-literal=SURVEYOR_TOKEN= helm install surveyors oci://ghcr.io/beppetemp/charts/cartographer --version -f values.yaml ``` The token is a Surveyor-kind token created on the external Meridian, with a role that has the permissions the Surveyor needs (`artifacts: r` at least, like the role in `ci/meridian-yaml-tokens-values.yaml`); it stays a reference to the entry's Secret and never enters the values. The entries use `surveyorImage`, not `meridian.image`. An `http://` `meridian.url` makes the chart inject `allow_insecure_http: true` and sends the token in clear (`ci/surveyor-only-http-values.yaml`): use an HTTPS URL. #### Example: a derived image for exec recipes An exec recipe (§The Surveyor (a third role), Exec recipes) runs a lister the image does not carry. The reference lister of `examples/system-recipes/kubernetes/` needs Python 3 and `kubectl`, so the image is **derived** from the Surveyor one: ```dockerfile FROM ghcr.io/beppetemp/cartographer-surveyor:latest USER root RUN apk add --no-cache python3 # Pin the version and verify its checksum: a downloaded binary is not trusted by its name. ARG KUBECTL_VERSION=v1.31.0 ARG KUBECTL_SHA256= ADD https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl /usr/local/bin/kubectl RUN echo "${KUBECTL_SHA256} /usr/local/bin/kubectl" | sha256sum -c - && chmod 0755 /usr/local/bin/kubectl COPY lister.py /opt/surveyor/lister.py USER cartographer ``` The image runs as the non-root `cartographer` user, so `apk` needs `USER root` and the last line switches back: a derived image keeps the non-root user. The entrypoint is inherited, so the derived image is run with flags only. At run time the kubeconfig of the dedicated read-only identity comes from a Secret mounted read-only, and `KUBECTL`, `KUBE_CONTEXT` and `KUBECONFIG` are set in the Surveyor's environment. With the chart, `surveyors[].image` points at the derived image (`ci/surveyor-exec-values.yaml`); the temporary directory is the entry's `emptyDir` already. The identity rules (a ServiceAccount bound to the `view` role, which does not include Secrets) are in §The Surveyor (a third role), Exec recipes, and in [surveyor-recipes](surveyor-recipes.md). ### Prompt tasks A task of `kind: prompt` (D1374) is a recurring chore of the operator's own that no shipped kind covers: a weekly digest of what changed, a monthly check that every runbook names a live owner. Its instructions are a file the operator wrote; the model has only the MCP tools the entry lists, and there is no shell and no code execution (code the Surveyor runs is a different mechanism). It runs inside the window, idle trigger, budget and priority order of every other task. | Option | Meaning | |---|---| | `name` | Required, `[a-z0-9-]{1,40}`, unique among the tasks, never containing `kb-doctor`; written into the task's log entries and commit reasons | | `model` | Required, a profile whose `run_tokens` is at least 8 000 (a task needs a grant of 8 000 tokens to start) | | `instructions_file` | Required, a relative path inside the directory of the `--config` file; at most 16 KiB of UTF-8 | | `tools` | Required, non-empty, a subset of the Surveyor's default allowlist plus `kb_review` and `kb_repair`, and a task with `kb_repair` can run any repair, removals and `junk_file` included (the `doctor` task's limits do not apply to it); a denied tool (`artifact_*`, `concept_delete`, ...) is a load error and nothing is implicit: list the read tools the task needs too | | `every` | Required, a Go duration of at least `1h` (`168h` is a week; no `d` or `w` units) | | `kbs` | Optional, a non-empty subset of the perimeter's `kbs`; omitted means all of them | **Where the instructions live.** In the config directory, shipped with the config: a ConfigMap with both keys in Kubernetes (a relative symlink inside the directory, which is how a ConfigMap volume exposes files, works; one that leaves it is refused), a read-only bind mount in compose. The file is read once at start, so a change needs a restart. It is never read from a KB, and its text appears in no log line, error or report. **Cadence.** After a run that reached the model the Surveyor files one marker, `task= at= day= stopped=done|steps|budget|error|shutdown writes=`, on the log path `surveyor//task/` (read it with `log_tail`). The task is due on a KB when none exists or `every` has elapsed since the newest, so a skipped period is not replayed: the next due time follows the actual last run. A due task whose profile has less than 8 000 tokens of grant waits and stays due. Renaming the task or the perimeter starts a new marker path, so it runs once more at once. Two replicas that find the task due together both run it (there is no lock; the bound is `replicas x grant`): write instructions that begin by checking whether this period's work exists. **What a task writes.** Every commit carries `Reason: prompt task [: ]`, set by the Surveyor, so `git log --grep 'prompt task '` finds a pass and each commit reverts alone. The task's own `log_append` lines are filed under `task/` whatever path the model passes, and an entry with a line starting `## ` or the text `kb-doctor` is refused, so a model can never forge a `surveyor/` budget or cadence entry. A task that lists `concept_write` can overwrite any page its token can write: the fences are the `tools` list, the token's scopes, `if_match` in the instructions, and the revertible commits. Example: a weekly digest of `kb-a`. ```yaml name: perimeter-a server_url: https://wiki.example.com/mcp token_env: SURVEYOR_TOKEN kbs: [kb-a, kb-b] schedule: window: {start: "02:00", end: "05:00", timezone: Europe/Rome} models: - name: cloud-small provider: anthropic model: model-x api_key_env: MODEL_API_KEY tier: small budget: {daily_tokens: 300000, run_tokens: 120000} tasks: - kind: prompt name: weekly-digest model: cloud-small instructions_file: prompts/weekly-digest.md tools: [changes_since, concept_list, concept_read, concept_write] every: 168h kbs: [kb-a] ``` and `prompts/weekly-digest.md`, whose steps are in this order because they make a double run harmless: ```markdown You write the weekly digest of this knowledge base. Follow these steps in order. 1. Call `concept_list` with `scope: digests`. If the newest id's date prefix is within the last 6 days of today's date (given above), stop and write nothing: this period's digest exists. 2. Call `changes_since` with `since: 7d`. 3. Call `concept_read` on the few pages that changed most, so the digest says what changed and not only that it did. 4. Call `concept_write` once, creating the page `digests/-weekly-digest` (ids are `YYYY-MM-DD-slug`), with the sections "What changed", "New pages" and "Open items". Every line links the concept it talks about. Never edit an existing page. 5. Answer in one sentence. ``` The journal `digests` must exist (created once with `map_create`, which the task does not list) and allow the type the page uses. The first window after the start runs the task; `git log` shows `Reason: prompt task weekly-digest: ...`, `log_tail` on `surveyor/perimeter-a/task/weekly-digest` shows one `task=weekly-digest at=... stopped=done writes=1` line, the next seven days of polls do nothing for `kb-a`, and `kb-b` is never touched. A prompt task is also how to go past what the `doctor` task covers without new code. `examples/prompt-tasks/kb-scout.md` reads the items no doctor rule takes (`concept_oversize`, `map_misfit`, `glossary_gap`, `read_hotspot`) and files the three most useful as proposals, in a map `gaps` that must exist: ```yaml - kind: prompt name: kb-scout model: cloud-small instructions_file: prompts/kb-scout.md tools: [work_list, kb_review, concept_read, concept_write] every: 168h ``` ### HTTP routing (D84) `MultiKBServer.Handler` (`internal/mcpserver/httpserver.go`) selects a KB three ways: - bare `/mcp` — auto-routes when exactly one KB is mounted (single-KB convenience); - `/mcp?kb=` — explicit selection by query parameter; - `/mcp/` — explicit selection by path (the form implied by `kbs[].name`, §Configuration above). If both `/mcp/` and `?kb=` are present and disagree, the request is rejected with `400 conflicting kb selection` rather than silently picking one; an unknown `` (either form) is `404 unknown kb`. A fourth route, `/mcp/routed` (D187, D288), always served, is the one agent clients use: it serves every mounted KB through one endpoint, advertising the union of the tools exactly once, with the KB carried as a `kb` tool argument (required for 2+ KBs, absent for one). `?kbs=kb-a,kb-b` on that URL narrows the connection to a subset; a name Meridian does not mount is served without it and reported in `kb_status.connection.unknown` (D756), unless it is the old name of a renamed KB (`kb_aliases`, written by `kb rename`), which selects that KB and is reported in `kb_status.connection.renamed` (D772); `400` only when no name resolves. The three routes above stay as plumbing with their exact behaviour, `tools/list` output included. A `?kb=` on `/mcp/routed` is `400 conflicting kb selection`. See `docs/transport-auth.md` §One routed topology. `cartographer connect` and `cartographer sync` write **one** entry per provider against a routed server, ` → /mcp/routed`, discovered from `/health`'s `mount_mode`/`routed_path`. A provider with an explicit KB binding gets `?kbs=` in that URL (names the server no longer mounts are left out); the default binding, every KB Meridian mounts, writes no `kbs`. Against a server that does **not** report `routed_path` Compass keeps writing one entry per mounted KB, `- → /mcp?kb=`, and a one-KB server keeps the single bare ` → /mcp` entry. ### The embedded Atlas UI (D227) The UI is English whatever the browser locale (labels, dates, times), exported replays included. In the Helm chart the switch is `atlas.enabled` (default `true`): `false` sets `web.enabled: false` in Meridian's config, a key the chart then owns, so `meridian.config.web` is refused. It only turns the Atlas off, which is never deployed alone; `/health` is served either way, so the probes keep working. It is meaningless with `meridian.enabled: false` (`ci/meridian-no-atlas-values.yaml`). With `web.enabled` on — the default in HTTP mode — the same binary also serves: - `/ui/` — the embedded read-only Atlas. Unknown paths **below** `/ui/` serve the shell so client-side routing works; unknown paths outside it stay `404`, which is what keeps the fallback from shadowing `/mcp`, `/health`, `/ready`, `/clients`, the OAuth metadata or `/api/`. `/ui` redirects permanently to `/ui/`, and `/` does the same from outside the auth chain. - `/api/v1/…` is not part of the Atlas: it is the public read-only API, served only with `api.enabled` and whatever `web.enabled` says (an Atlas-less Meridian can still offer it). It serves the `stable` and `preview` tiers of the same route table, without the Atlas's operator wording, and the event stream `/api/v1/kbs/{kb}/events` (`api.max_streams_per_token` open streams per token, `api.max_streams` in all; over either the answer is `429`). A reverse proxy must not buffer `text/event-stream` and must keep the connection open for at least the 20 s heartbeat (nginx: `proxy_buffering off`, `proxy_read_timeout` above 20 s). - The Work page draws the KB's dashboards (`dashboard_patch`, `control-plane.md` §MCP API) from a selector in its header, read-only: the default option is the Work board, the choice is kept in the address as `?dashboard=` and resets when the KB changes. Widgets are `stat`, `note`, `kanban`, `list`, `agenda`, `table`, `timeline` and `links` (cards like the Work board's, a `review_after` that is due in red, a kanban column showing the resolver's total, not the rows shown; an agenda lists the overdue entries first, then one row per day; a table sorts by a click on a header, a timeline lists the dated entries oldest first, grouped by `group_by` when given; `links` lists concept titles as links into the Atlas and an id the reader cannot see as "not found"; an id of another KB (`kb:/`) that resolved is drawn as text, the KB name beside the title, and one that did not as "not available" (`unresolved`) or "not reachable from this connection" (`out_of_scope`)); a widget that failed to resolve draws an error tile beside its neighbours, and an agent's edit appears within one revision poll. Editing is the agents' job: the page has no controls. - A concept body is rendered as untrusted Markdown: raw HTML is text, and no image is fetched from outside Meridian. An image whose relative path names an image asset of the concept itself (`![alt](diagram.svg)` in an expanded concept) is read from `GET /api/ui/v1/kbs/{kb}/asset` with the viewer's token and shown; any other image is a placeholder carrying its alt text (D2506). - `/api/ui/v1/…` — the JSON the UI reads (→ `control-plane.md` §Read-only UI API). Its Settings page lists every server and per-KB setting with its value and origin, read-only (D743, §Configuration above). Meridian's version, at the foot of the left rail, opens the release history: a sheet with every release, newest first, each changelog rendered as sanitised Markdown, the running release marked `Current`, and, above them, the upgrade command when a newer release is known; a cut changelog links to GitHub, a disabled check is said so, and the static demo, with no server to ask, says the same. `GET /api/ui/v1/releases` is the release history behind Meridian's version (D862): Meridian reads the GitHub release list when the route is asked (a browser cannot, the CSP is `connect-src 'self'`), up to 3 pages of 100 releases, each changelog cut at 64 KiB (`truncated`), and keeps it in memory for an hour, served `stale` when a refresh fails. The upgrade command for the install channel comes with it when a newer release is known. It obeys the update-check switch (`update_check`, `CARTOGRAPHER_NO_UPDATE_CHECK`, never on a `dev` build): off, the route answers `unavailable: "disabled"` and Meridian makes no call. The top bar shows, for the selected KB, in a badge that shares the theme button's control style, whether everything is on its remote (`kb_status`'s replication facts, read from `GET /api/ui/v1/kbs/{kb}/status`): `On remote`, `N to push`, `N behind`, `Push pending`, `Not verified`, `Push failed`, `Writes blocked`, and, as persistent warnings, `No remote` (not backed up; the popover names `cartographer kb attach --remote `) and `Not versioned` (the warning and problem states tint the badge); a click opens the details: count tiles, the state, the redacted remote, the branch and its source, last push and fetch (these three only for a KB with a remote) and the last error, cut to git's first `fatal:` line with a "Show the whole error" toggle. A push completing moves no concept file, so the live revision cannot drive it: the status is read again when the KB changes, when the revision moves, when the tab becomes visible, and every 10 s while the state is unsettled or every minute otherwise (never in a hidden tab). A principal that does not see the whole KB, an older server and the static demo get no indicator. The rail holds the panels Atlas, Activity, Work, Health, Artifacts and Settings (D818, D1901), and, only when an approved plugin declares a view or an app, an "Extensions" group between Artifacts and Settings (D1938): a view opens a page (`?panel=ext&ext=/`) that reads one public read-only route of the API as the Atlas's own principal and draws it with one of four fixed renderers (table, list, stats, key-value); an app is a plain link that opens in a new tab on its own origin. **Extending the Atlas** goes through views, external apps and the public API. Views: data a plugin ships (`docs/plugins.md` §The Atlas side), approved by digest, drawn by the Atlas's own code. External apps: the Atlas hands the app nothing (no token, no query parameter, no `postMessage`, no cookie; the shell sets `Referrer-Policy: no-referrer`); the app authenticates the person with its own login and reaches the KB with its own credential, a token an operator issues to it (read-only, KB-scoped, expiring), calling the public API from its own origin, which must be in the CORS allow-list. To build a different Atlas or a governance dashboard, use that public API. No plugin JavaScript ever runs in the Atlas: the CSP is `script-src 'self'` (`internal/webui/webui.go`, pinned by `TestContentSecurityPolicyIsExactlyTheShippedConstant`). Health shows the lint's findings and nothing else; what a person has to answer or decide is in Work (contradictions and gaps, the searches that found nothing under "to answer", the `kb_review` proposals under "to decide", D948). Artifacts has the tabs Agent kit, Instructions, Templates and Secrets (D1057), lists every kind of a tab, an empty one as an outline tile where its first artifact would go, and its Secrets tab has a card per Service that uses a value and per sops file, the same detail panel as an artifact); a retired concept (deprecated, superseded or archived, D820) is drawn on Activity's timeline with its status and where it went and why, read from the root `log.md` (D1146: the Retired tab is gone, and `panel=retired` links land on Activity); an archive map wears an "Archive" badge in the rail; the command palette's "Include archived" toggle adds archived pages to a search; pending sources are Work's "to ingest" column. Settings has the tabs Compass, Meridian, Knowledge Base, Surveyor and Plugins (the last, always present and read-only, lists each installed plugin with its state on Meridian, Compass and Surveyor (`approved`, `pending`, `changed`, `refused`, `not reported`), the short digest (the full one on hover) and, for `changed`, that the installed tree differs from the approved one; a row opens the plugin's views and apps as text before anyone opens an app; approval is a command on the component, never a button, and a narrowed token sees "Visible to the operator only"; D1976) (no counts on them; the Surveyor tab shows each reported Surveyor perimeter's typed values (no YAML pane), or the template of every key at its default while none has reported, and one tab per perimeter when several are visible; under the values a Sources block counts the picked KB's Sources by ingest status (pending, ingested, skipped; at the server's list cap of 500 a count reads "N+" and a status not seen "—") and lists the feeds whose last poll failed, whether or not a Surveyor has reported, and keeps the last good block when a read fails for a reason that may pass (it retries with back-off), and is absent on a 404; D1985), and opens on the Compass one: Compass's own settings first, as the viewer's last `sync` reported them (its agents, the workspaces with their isolation), then the KBs as a row of pills (the active one picked) and, for the picked one, the Compass keys that concern it: which of the machine's agents receive it and where (everywhere, or only the folders bound to it, through the bridge or over HTTP) and where its placeholders resolve on that machine. Each key shows its description and its value; the default, where it was set, the environment variable and the flag open on a click. A readable view and a YAML view are switched in the header; the Knowledge Base tab lists the KB's own keys and placeholders. Before any client of the viewer has reported, the Compass tab shows the keys of `.cartographer.yaml` at their defaults (`client_template`, D948). The `panel=services`, `panel=sources` and `panel=paths` links land on Secrets, Work and Settings. A cross-KB link `[[kb:/]]` in a page body is a link, to that page in its KB, only when the server says `resolved` for the caller (the concept's `cross` list); in any other state it is the text the author wrote, with no link and nothing of the other KB. The concept's Links tab lists those edges under "Other KBs", and the page graph draws a resolved one as a small stub node, read from `GET /api/ui/v1/kbs/{kb}/graph/external` beside the graph. The static bundle is reachable without a bearer token, because it is the page that asks for one and it carries no server or KB data; `/api/ui/v1` is not, and is filtered with the caller's own principal. The shell is served `no-cache` and hashed assets are immutable; every bundle file carries an `ETag`, so the shell and the unhashed files (`theme-init.js`, `brand/*`) revalidate with a 304. A missing path under `assets/` is a 404, never the shell (a tab opened before an upgrade then fails its lazy import and the Atlas says "reload"); the shell answers client routes only. All under a `default-src 'self'` CSP with no inline script and no eval. `web.enabled: false` registers neither route. The bundle has two build-time inputs that only the public Pages build sets (`web/src/api/static.ts`): `VITE_ATLAS_STATIC=1` (the D745 snapshot, below) and `VITE_ATLAS_LIVE_ORIGIN` (D800, the origin of the hosted MCP demo, retired). Unset, which is the embedded bundle's case, the UI is unchanged: same-origin `/api/ui/v1`, revision poll every 10 s. Stdio mode never serves the UI, whatever the setting says. #### The public static demo (D745) The documentation site also carries a demo of the Atlas at , with no server behind it. `demo/build.sh ` makes it: 1. it replays the demo KB, `demo/astronomy`, into a throwaway git repository as commits spread over the last five months, so Activity and the growth timeline have a history whenever it runs; 2. it builds the UI with `VITE_ATLAS_STATIC=1`, which makes the API client read JSON files next to `index.html` instead of `/api/ui/v1`, and adds a "Demo snapshot" link to the top bar; it also sets `VITE_ATLAS_LIVE_ORIGIN` (`DEMO_LIVE_ORIGIN` overrides it, empty turns it off), see below; 3. it serves that repository with the real binary and `demo/export.mjs` saves every answer the UI can ask for into `/api/`. Search takes free text, so it is the one request not exported: the export writes `search-index.json` and the browser searches it. **Live source (D800).** `demo/build.sh` also sets `VITE_ATLAS_LIVE_ORIGIN` to the hosted demo's origin, which is retired and no longer answers, so the build always ends on the snapshot. Once per page load, before its first API read, the Atlas asks `GET /api/ui/v1/kbs` (6 s, enough for a Cloud Run cold start). If that answers, every API read of the session, and the version read, goes to the origin, so the page shows both KBs, `astronomy` and `cartographer-docs`, and the revision poll runs every 20 s to stay inside the Worker's free quota (the origin's Worker answers CORS for the Pages origin and caches the reads for 5 s). If it does not answer, the session uses the exported snapshot exactly as above (astronomy only) and the top bar says the live demo is unavailable. There is no switching mid-session. The `docs` workflow runs it after `mkdocs build` and publishes it as `site/demo/`, on every change to `demo/`, `web/` or `CHANGELOG.md` (that is, on every release). `demo/astronomy` is a hand-written KB with invented, public content. It is also a small tour of the features: maps with contracts, journals, templates, a source ledger, contradictions and knowledge gaps, supersede and archive, services with sops-encrypted secrets, and skills, an agent and a hook. Its lint findings are kept on purpose, so Health has something to show. The secret values are fake, and the age key that encrypts them is not in the repository. #### The hosted MCP demo (D751, D800) **Retired.** The hosted demo's endpoint answers 503 and no live URL is published, the README no longer links it, and the static Atlas above falls back to its snapshot (its live-source probe finds no answer). What follows describes the service as built, which `deploy/demo/` and `demo.yml` still hold, not a running one. The demo's MCP side is a stateless, read-only Cloud Run service (`europe-west1`, scale to zero, one instance at most) running the released image plus two KBs (`deploy/demo/Dockerfile`): - `astronomy`, the replayed `demo/astronomy` baked into the image (`demo/replay.sh` is the replay `demo/build.sh` shares), read-only; - `cartographer-docs`, the documentation of the image's own binary: the build runs `cartographer docs export` of the base image and seals the tree with one commit, so it is read-only and nothing external is cloned at start. Auth stays `on` with one read token, `kb:astronomy:r;kb:cartographer-docs:r`; the demo has no write token and no write path (the guestbook of D800 is gone, D2053). A Cloudflare Worker forwards the hostname to the `*.run.app` URL (Cloud Run routes by Host), maps the public `/mcp` onto the routed mount `/mcp/routed`, and answers 404 under `/.well-known/`, so no client starts an OAuth flow and a client connects with the URL alone, a claude.ai or ChatGPT connector included (D789). Every tool takes a required `kb` (an enum of the two). The Worker sets the read token on every request, replacing the client's, and bounds a public surface with a 16 KB cap on every `/mcp` body (`deploy/demo/worker.js`, pure functions tested by `make demo-worker-test`); it keeps no list of tools, so a write tool, one added tomorrow included, reaches the server with the read token and is refused by its scope check. The edge cache and the free-tier limits: `GET /api/ui/v1/*` and `/health` are cached at the edge for 5 s keyed on the URL (every visitor shares the read token) and answered with CORS for the Pages origin (`ATLAS_ORIGIN`); one rate-limiting rule applies per client IP before the Worker; the Pages Atlas polls every 20 s instead of 10. The whole demo stays on free tiers (Worker 100k requests a day, Cloud Run monthly free tier with a 5 EUR budget alert); the table of what happens at each limit is in `deploy/demo/README.md`. The `*.run.app` URL stays reachable around Cloudflare, but only with a token, and neither is published; the instance cap is the backstop. `/ready` needs the token once auth is on, so the Cloud Run probes and the post-deploy check use `/health` (public, carries `ready`). Terraform, bootstrap and token rotation: `deploy/demo/README.md`. The `demo` workflow (`.github/workflows/demo.yml`) rebuilds and redeploys it on every release, then checks that the hostname initializes an MCP session without a token and fails when a `search` on `cartographer-docs` is not answered (both KBs are in the image, so nothing external can expire), so a change to the read tools or to `demo/astronomy` reaches it at the next release; `make demo-smoke` checks the image locally. An open Atlas follows the KB live (D337): while the tab is visible it asks `/api/ui/v1/kbs//revision` every ten seconds and, when the answer changes, refetches the open view in place — graph, concept, findings and lists — without a reload or a blank frame. The graph keeps every node it already has: new concepts appear beside a neighbour, removed ones go, and every change — nodes or links — gives the whole network a small knock that fades with distance (a few changes share one knock, no node moves faster than a single knock would move it, and a bulk change of more than 20 origins reheats the simulation instead of pushing), while the camera and its slow turn carry on undisturbed. A hidden tab does not poll and checks once on return. A caller that cannot see the whole KB gets no revision, so its Atlas does not refresh by itself. The revision of a KB also moves when a KB it is cross-linked with, in either direction, and the caller reads whole, changes; a KB with no cross link keeps the same token, and a caller who reads the linked KB only in part is not refreshed by it (its view refreshes on the next change of this KB or a reload). With two or more KBs visible, the top bar has a *KB map* button (hidden on a server that answers 404 on `/api/ui/v1/kb-map`). The panel (`?panel=kbmap`) draws one tree per hierarchy: a root KB (one with dependents and no declared dependency) above the KBs that depend on it, each hierarchy in its own hue; a KB with several dependencies sits under the first in alphabetical order and names the others, and a root whose dependents are all drawn elsewhere names them (*needed by*), and a KB no tree reaches (a cycle of relations) or with no relation at all is listed under *Standalone*. Each KB card shows its pages, its page changes of the last 7 days that the caller can see (the `work` changes of `changes_by_day`, not the whole-KB commit count, which a partial reader gets as 0) as a bar (log scale against the busiest KB) and a count, its lint findings when there are any (each half shown on its own when the other request fails) (read from `GET /kbs/{kb}/lint?limit=1` and `GET /kbs/{kb}/changes?since=7d&limit=1`, once per set of KBs), and its outgoing cross-KB link counts; the *Cross-KB links* list appears when there is a link. A card opens that KB's atlas; a KB whose relations could not be read is listed with the reason (a remote not fetched yet says to sync first). It draws what `GET /kb-map` says and computes no visibility, and refetches while the tab is visible (a repeat is a `304`). Behind an SSO reverse proxy that protects `/ui` and `/api/ui` only (leave `/mcp` on bearer auth) and injects a read-only bearer, the Atlas opens without the token prompt. The UI sends same-origin cookies so the proxy session reaches the API (D308). The origin rule of `/mcp` is fixed and keeps that setup working (D906): the proxy serves the page and the API from one origin, so a request's `Origin` has the `Host` it arrived with. To have the server see the person instead of one shared bearer, declare `auth.proxy_identity` (D1894, Proxy identity): the proxy authenticates with a token marked `proxy: true` (never admin: its scopes or roles are the ceiling of every person behind it, so a read-only bearer yields read-only people; whole-KB rules only, a selector is refused), sends the person in `user_header` and the groups in `groups_header`, and `group_roles` maps groups to roles. The header is believed only from `trusted_addresses` (CIDRs of the TCP peer, no `/0`, no implicit loopback; `X-Forwarded-For` is never used) and only on a `proxy: true` token. The proxy must overwrite both headers on every inbound request, and the server must not be reachable with the proxy token from an address that is not the proxy. `require_user` (default `true`) refuses with `401` a request on the proxy token that names no person: an absent header, or a peer outside `trusted_addresses`. A setup where the proxy also forwards requests without a person (one injected bearer for everyone) sets `require_user: false`, and such a request stays the proxy token's own. The block reloads with tokens and roles. Audit and commit trailers then name `user:`. A plugin that calls the server back (a hook server) gets its own token: `kind: client`, `expires_at`, scopes or roles, and `plugin: ` of a plugin pinned and enabled in `plugins`. Its principal is `plugin:/` in the audit and the commit trailers; it never reads secrets, and changes artifacts only if a role rule says `artifacts: rw` (`docs/transport-auth.md`, A token bound to a plugin). The Atlas draws its graph in 3D, as a live force-directed network (D234, D235): it breathes and turns slowly on its own; drag to orbit, zoom with the wheel or a pinch, click a concept to select it (nodes are not dragged). A *Motion* toggle, remembered per browser, pauses the drift, the slow panorama and the signals a selection sends along its links; `prefers-reduced-motion` starts it paused. The simulation advances at a fixed 60 Hz whatever the display's refresh rate, so the motion has the same pace on a 60 Hz and a 120 Hz screen (D736). A network whose simulation costs more than a quarter of a 60 Hz frame per tick drifts at half rate, which still breathes at half the CPU; only a tick past 12 ms rests the drift: it settles and stops, as with motion off, while the panorama and the signals still run; a smaller Map opened in its place breathes again (D889, D1044). With a concept open the network's breathing eases down to a fifth over about two seconds and, after the same quiet as the panorama, the camera circles the concept at a third of the panorama's pace. While the panorama turns with nobody at the controls, the camera eases slowly onto the fit, so hours of drift never carry the network off screen. The view draws only when something moves or changes, at most about 60 times a second whatever the display's refresh, so an untouched graph at rest costs no drawing at all. There is no 2D view: when the WebGL context is lost the graph area says so. The view draws up to the graph API's ceiling of concepts. On a KB whose list row (`GET /kbs`, `concepts_total`) counts more visible concepts than the threshold of the clusters route (1,200), the Atlas reads `/api/ui/v1/kbs//graph/clusters` instead of `/graph`, unless the URL says `graph=nodes`; the mode is known before the first graph request, which does not wait for the overview or the artifacts (D2077). The unfolded cluster ids live in the URL (`unfold=`, emptied on a KB switch); an id the server reports in `dropped_unfolds` leaves it, and the selected concept rides every request as `focus`, so a live refresh keeps it drawn and opening one that sits in a folded cluster asks for it once. A static snapshot always reads the flat graph. In the cluster view each folded large, dense community is a super-node (D2076; the overview is mixed: the server folds the largest communities of 10 or more concepts until at most 200 elements are drawn, and every other community stays open as plain concepts with their real edges, so the picture says how large the KB is and no cluster is smaller than 10; the small communities are grouped by Map only when they alone exceed the budget): a flat, unlit hexagon in its colour (a fixed orientation, always facing the camera; concepts are discs and artifacts diamonds in the same language, every body one camera-facing quad shaped and given a 1.25 px darker border by the fragment shader, one program and no extra draw call), a glyph no concept has, its radius following its concept count (square-root scale, 1.6x to 2x an average concept's), named "name · count" on hover (no always-on labels), and coloured as its members are in the flat view (a community past the palette, or a Map group, wears its dominant Map's hue, so none is grey). The layout treats super-nodes as bodies: each super-edge is one spring, shorter and stiffer as it stands for more links, larger ones repel harder across the whole picture, a collision of the glyph's drawn size plus a margin keeps them apart, and a centring (firmest on a cluster with no super-edge) keeps the lightly linked ones near the group; the concepts the overview leaves open are held among the glyphs (a short spring to the glyph they link or, with no link to a glyph, to a glyph of their own Map, spread over the Map's glyphs by their id, resting 12 to 30 units outside it, and a firm spring to a linked glyph), never on a ring around them. The links between two clusters are one super-edge drawn with three to eight overlaid strokes as it stands for more links (WebGL lines are one pixel wide); a link from a concept of an open cluster to a folded one ends on the super-node. At most one cluster is open, an accordion: opening another folds the first, and `?unfold=` holds one id (an older link's list keeps its last). Clicking a super-node, or zooming in on it near the middle of the canvas (never under reduced motion), opens it in place, as the simulation's own motion (never a planned move): its members are put over the glyph, with their real links, and grow in there while the cluster that was open shrinks into its glyph; nothing else is moved, and the simulation is reheated (0.3 opening, 0.25 folding) and cools at the default rate, so the neighbours adapt only as much as the physics wants; under reduced motion it is laid out at once. There is no hull outline: an open cluster's members mix into the graph by the general forces, with no room of their own, and a folded cluster has a soft hexagonal aura and an inner contour. Every glyph, loose concept and member keeps its normal colour and opacity whether a cluster is open or not, coloured by Map; leaf concepts' colours recede towards the background by weight (tone depth 0.4). The camera aims at the predicted rest of the picture for a graph of up to 600 nodes (`predictSettle`) and, for a larger graph still spreading, leads it by its velocity (lookahead), zooming out only as far as the larger picture needs and back in on a fold, never onto the opened zone, also when the page opens with `?unfold=`; the follow of a transition yields to a drag or a wheel of the reader. A breadcrumb at the top left, quiet text without a pill, says where the reader is: the KB's name (a link that folds the open cluster back to the overview), a chevron, and the open cluster with its count. Folding is Escape, the breadcrumb or the legend's Compact; a click on the background only deselects. In the Nodes view and inside an open cluster, past 6,000 links each node keeps its strongest links (towards its best-connected neighbours) and the rest are not drawn or laid out. The keyboard and a screen reader reach each folded cluster as a button named "cluster , concepts" (with a concept open or on a Map, the palette's pick of a folded concept unfolds its cluster). There is no banner and no cluster list: the legend is a fixed-width card of seven rows on a clustered KB, as on a flat one (six Maps and "N more Maps"): three clusters (the open one included), "N more clusters", two Maps of the concepts left open and "N more Maps", counting the KB's concepts and links. On a KB served clustered the legend has one button that cycles Compact (an open cluster folds, and the selected concept is cleared), Expand (label: Show all concepts: the flat `/graph`, `graph=nodes` in the URL, up to 7,500 concepts) and Group (Group into clusters: `/graph/clusters`). The mode is not remembered: a large KB always opens grouped. Expand and Group are a morph between two layouts (the layout is kept per mode), not a rebuild. Above 1,500 nodes the entrance opens as a flower, from the centre outwards and up to 2.6 times longer, the repulsion is coarser (theta 1.2) and applied every other tick at double strength, and a costly simulation runs at most one tick per frame. The graph waits for the KB's artifacts (up to 5 s) so they enter with it. A clustered scene breathes when idle exactly as a flat KB does. The growth replay is off in the cluster view. A browser without WebGL gets the concept list, search and inspector, with a note where the graph would be. The UI follows the system's light or dark scheme until the viewer picks one (D233). The reading panel is resizable: drag its left edge, or focus the edge and use the arrow keys (Shift for larger steps, Home/End for the extremes, Enter or a double-click for the default 420px). The width is remembered per browser (`cartographer.inspector.width` in localStorage) and clamped between 320px and the smaller of what leaves 280px of graph beside the rail and what the concept's prose can use — its 68ch reading measure plus padding (D281). Widening the panel reframes the selected concept in the graph it still shows; on a narrow screen the panel is a sheet and has no splitter (D239). Opening a KB, or switching to another, grows the graph from a seed at the orbit's centre: the nodes burst outward to their places, the edges fade in behind them, and the camera settles on a framing fitted to the KB's size, whatever it is. The graph is drawn as soon as it and the KB's artifacts arrive: the rail's Maps and counts fill in on their own, since they wait on the whole-KB lint (D736). A view seen before in the session is shown at once from memory while it refreshes. Choosing another Map of the same KB does not regrow it: the concepts both views draw keep their places, those leaving shrink away, those entering grow in beside a neighbour already placed, and the camera eases onto the new set (with reduced motion the swap is instant). Leaving the Atlas for another panel and coming back shows the graph settled where it was left, camera included. Selecting a concept, or closing the reading panel, fades the rest of the graph out or back in while the camera moves, rather than recolouring it at once. Every move the reader starts -- a camera flight, the Map contract sliding in with the canvas narrowing beside it, a folded group turning its chevron, a count running to its new value -- is timed on the one `--motion-*` scale of `web/src/styles/tokens.css`, the JavaScript ones included, and none lasts longer than `--motion-deliberate` (520 ms); with reduced motion each is instant. The *Replay growth* control replays how the KB grew (D367): the concepts appear in the order their files were first committed, those born in one commit along their links, in 8 to 20 seconds whatever the KB's size, under a timeline with one bar per day that saw concepts born. It can be paused, dragged or stepped with the arrow keys, keeps every node in frame, hides the legend and the camera controls while it runs, and stays open at the end until closed. *Export video*, a button of the replay's control bar, renders that replay as a clip to share (D691, which replaces D677's recorder), entirely in the browser and in the background: the Atlas stays usable while it runs, a hidden tab does not slow it, and switching KB or Map does not end it. A small progress pill ("Exporting video 42 %", Cancel) shows how far it is, and the file downloads when it is done. The frames are not captured from the screen: a second scene, in a detached container, is advanced by a virtual clock of exactly 1/60 s and drawn at twice the export size, then downsampled, so every frame is rendered and encoded at 60 fps, sharp on thin edges. Frames go through WebCodecs and the mediabunny muxer: H.264 High (level 4.2) in an MP4 where the browser encodes it (Chrome and Edge, Safari), else VP9 in a WebM (Firefox, Chromium builds without H.264), which the dialog says; no WebCodecs, no button. Sizes are 16:9 (1920×1080), 9:16 (1080×1920, the default) or 1:1 (1080×1080), at at most about 8 Mbit/s for 1080p (variable rate, a keyframe every 2 s), so a clip stays under some 25 MB and is far smaller on a small KB. The clip opens on a 1 s card with the Cartographer mark and the KB name (frame 0, so the thumbnail a messaging app shows is the logo, not a black frame), then the replay at its own pace (8 to 20 s) with the KB name, the date being replayed and the concept count (no node labels), 1.5 s on the full graph, and a 2.5 s end card. A selected concept is the orbit's pivot: dragging turns the graph around it, while it stays centred in the strip the panels leave visible, and everything outside its neighbourhood recedes. The skills, agents and hooks that reference concepts are drawn as diamonds linked to them; clicking one opens it on the Artifacts panel (D286). The legend colours nodes by Map, as the rail does (there is no community mode), never by lint findings: on a real KB a finding colour painted most of the graph one colour, and a KB's health is read on the Health panel (D307). The legend folds to its actions and counts, remembered per browser (`cartographer.panel.legend`). Ctrl/Cmd+K searches titles and ids at once and, after a pause in typing, the full text through the `search` tool, showing the excerpt that matched; it is the way to a concept, and there is no concept list beside the canvas. The brand in the top bar returns to the atlas on *All*, nothing selected; Meridian's version sits at the foot of the rail (a button: it opens the release history), and the connection status appears only when the server is unreachable. The rail lists the KB's Maps and Journals in two groups, *All* first, each with its count; a click always opens the Atlas on that Map, and the rail marks a Map only while the Atlas is open (Work, Activity and Health filter by Map inside the page). The reading panel folds the concept's outline into *On this page*, drops the body's leading title (the header shows it) and hides a trailing links section that lists nothing the *Links* tab does not already show (D287). The *Links* tab lists links by title — *Links to*, *Linked from*, and *Used by* for the artifacts that reference the concept. Activity, Work and Health are reading panels built from one page kit (D339): a header that says the answer in a sentence with its count in bold (long explanations behind a *?*), an open hero with no box around it — large figures, a chart where there is a series, and filters as pills (a pressed one lights up in its Map's colour) — then dense rows. They share one width, Map colours mark every row, and nothing is said twice: a count in the title is not repeated in the band, a section with nothing in it is left out rather than shown empty, and an empty answer is said in one line with a check. The **Activity** panel is `changes_since` for the reader: the concepts changed in the last day, week, month, quarter, year or ever (up to 500). With a Surveyor on the KB (D1985: at least one run reported for it in the `components` read, or a change made by a Surveyor) it has two tabs beside the window selector, **Users** and **Surveyor** (the control is labelled "Activity of"; the window is shared, the tab is local state and not in the URL); without one there is no control and the page is Users. **Users** (title "What users changed") is the people's changes. A change whose authors are all Surveyor authors (`surveyor//`) is left out, and a shared one shows its human authors only; there is no Surveyor tag on a row. A concept is *edited*, *new* or *reorganised* (moved, superseded, removed) by its latest content change (`last_edit_at`, `added`), and one only the background repair touched is *maintenance*, hidden unless the reader ticks the Maintenance chip. The hero has five figure tiles (*New*, *Edited*, *Reorganised*, *Retired*, *Touched*, the distinct concepts changed), a **When** strip, and the filters as chips: *Where* (one per Map, with its count) and *Who* (one avatar per author, busiest first, when there is more than one, and the Maintenance chip). The strip is a stacked smooth area per kind over hours, days, weeks or months by window size, drawn from the concepts of the answer; hovering it shows a card with the time, one row per kind and the total. A concept the KB retired (`GET .../retired`) wears its status instead of the kind of change, says what replaced it, why and where it was (D1146), and is counted in *Retired*. Below the hero the timeline groups the concepts by the day each one last changed, newest first, one row each on a rail in its Map's colour: time, title, Map, the kind of change when it is not a plain edit, the first recorded reason (upkeep reasons dropped when there is another) and the authors. Changing the window keeps the current answer on screen, dimmed, until the new one arrives. A window with no change shows a quiet notice with a button to the next wider window in place of the hero, followed by *Earlier*: the newest 20 earlier changes on the same timeline, read in the same round as the window. A row does not open the page: clicking it opens, under it, the concept's diff over the window (`GET /api/ui/v1/kbs/{kb}/diff`, warmed when the pointer reaches the row; D2436). The diff names the revisions it runs between and lists each file of the concept folded to its path, status and +/− counts; a file opens its changed lines with three lines of context, the rest folded. Each file has two icon buttons in a fixed place: *view file* (the whole file as it is at the end of the span; disabled for a binary or a deleted file) and *open page* (the page in the inspector; disabled when the page is gone). The inspector's × returns to the page it was opened from, with the row's diff open again. A static export has no diff route (its key is a time span, `demo/export.mjs`): the row then opens the page, as before. Under the timeline, the *Journal* section shows the tail of the KB's log (`log_append`) grouped by day under the same day headings and drawn on the same rail, one entry per `## `: its time and a node coloured by the Map of the first concept ID the entry names. A tool line (`concept_patch: map/id`) is one compact line whose concept opens; an agent's note shows its first line as the lead, the rest clamped with a Show more, as written and not rendered as Markdown. **Surveyor** (title "What the Surveyor did", D2437) is the runs of this KB: the server keeps the last 20 per perimeter in memory, and its persisted daily counters (`GET /api/ui/v1/kbs/{kb}/surveyor-history`, `control-plane.md` §Surveyor runs and alarms) reach back 90 days. The hero has five tiles: *Runs* (failed ones named in its tooltip), *Pages written* (created plus changed, counted from the Surveyor's commits, which are durable, so right for every window), *Tokens*, *Tokens wasted* (spent by runs that wrote no page) and *Last run*; a **When** strip of the runs per day by task, with failed ones apart; and the chips *What* (the task: poll, ingest, doctor, repair, synthesis) and *Where* (the Maps of the pages it wrote). When the counters reach back to the window's start the Runs, Tokens and failed figures are exact and carry no note; otherwise (a window that starts before the server began counting, 1y and All, an older server, or a caller that does not see the KB whole, answering 404) they count the kept runs, and when the window starts before the oldest kept run or a perimeter holds exactly 20 the Runs tile says "since " (the first day of the counters when the server answered them, else the oldest kept run), after any failed count in its tooltip. Under the hero, a **Runs per day** trend draws one column per day of the window (at most 90) from the counters, stacked ok, skipped and failed, with the same numbers in a table under "Runs per day as a table"; a server with no data directory adds "Kept in memory only: a restart forgets it." Below, the runs are grouped by day, newest first, every day open: each run is a head row on the rail in its task's colour (red when it failed or exhausted its budget) with " run", an outcome pill, the duration, the number of pages it wrote ("nothing written", or "N pages, M new"), the error when it failed, a bar for its tokens on the window's scale and its replica's avatar. The pages it wrote hang under it as Users rows, each with its own diff, whose span is the run (a minute of slack either side). Runs carry no page of their own: the pages of a run are the window's changes whose author is a Surveyor named by the run's replica (the exact path segment) and that carry the run's id (the `Surveyor-Run` trailer of the commit, returned per concept by `changes_since` as `surveyor_runs`; a change carrying other ids is never matched by time) or, when a change carries no id, whose time falls inside the run (start to start + duration, 5 s of slack for the two clocks); a page is listed under one run only, the newest that claims it. No wire field carries them, so a concept someone changed after the run is listed under that author on Users, not under the run (the changes route keeps each concept's newest change). What and Where narrow the runs (Where keeps the runs that wrote a page in that Map and only those pages). Ages are worded against the server's clock (`server.now` of the read), not the browser's. Work carries nothing of the Surveyor: its replicas, budgets and alarms are in Health. Below it, **Report candidates** (D1925) lists what the Surveyors noticed that a person might report to the Cartographer project, per Surveyor: the kind in words (tool error, protocol mismatch, contract mismatch), the tool and the code, how many times it was seen and when it was last seen (the server's stamp, worded against the server's clock). It is read from `GET /api/ui/v1/feedback/candidates`, which is server-wide and already filtered by what the caller sees whole; the Atlas shows the candidates that name the picked KB or none, starts blank when the KB changes, and reads the list again every minute while the tab is visible (candidates live in the server's memory and change without a commit). The section stands on its own, not inside the Surveyor tab: a protocol mismatch can be held with no run reported. Each row has a **Draft report** button: it asks `GET /api/ui/v1/feedback/candidates/draft?id=` (a `GET`, pure computation: the Atlas stays read-only and no model runs) and opens, under the row, the redacted title and body in read-only fields, the duplicate-search link first (GitHub destinations only), then **Open the report form**, a link that opens in a new tab (`target="_blank"`, `rel="noopener noreferrer"`; only an `http(s)` address is ever linked), and the sentence "Nothing has been sent: review the text, then submit it yourself." When the destination's URL carries the title only (the body is too long for a URL) the body has a **Copy the text** button. Nothing is opened or navigated on its own. The section is absent with no candidate, and when the operator set `feedback.destination: off` (the routes answer `404` `feedback_off`); any other failure of the read (a `5xx`, a `404` after a restart) keeps the last list and tries again with back-off, and a draft that fails says so and can be asked for again. The **Work** panel is where a person answers or decides (D302, D948). It is `work_list` for the reader: the concepts in an open phase, the concepts that are work by their `reason` (open contradictions, open gaps, pages past their `review_after`) and the unchecked items, to which it adds what has no page of its own, the searches that found nothing and the doctor's proposals. The band filters by Map (*Where*), by column and by staleness, each with its count; there is no text filter. The board lays the work out by column, in the order work moves: *to resolve* (an open contradiction: `commit_gate` blocks until someone decides which page holds), decision-needed, blocked, in-progress, open, *to answer* (the open gaps, `missing_context` and `open_question`, and the searches of `kb_status.search_misses` that found nothing; one that finds something now leaves the column and is listed under *Answered since*, D319), proposed, *to review* (a page past its `review_after` that is neither open by its status nor finished), *to decide* (the proposals of `kb_review`, `observation` items included, `GET /api/ui/v1/kbs//maintenance/review`), *to ingest* (pending sources) and *unchecked items* (a closed concept listed only for them); any other status a map's `open_statuses` names follows. The columns wrap into a grid (at least 300px wide) instead of scrolling sideways, all of one capped height, and a column's cards scroll inside it with a fade where more lies above or below. A card shows its Map, title, type (a contradiction its kind) and age (stale ones flagged), expands to its items, and opens the concept on the atlas; a search opens nothing. It is read-only: work changes through the agents' write tools. The pending sources, `kb_status` and the review list are each optional: without one (a caller that cannot see the whole KB has no `kb_status`) the board shows the rest. Above the board a strip lists, read-only, the live `cartographer surveyor` processes that declared the KB (perimeter and state, last run, one bar per model profile with `spent / limit` and its tier, when it was last seen, its next window; `GET /api/ui/v1/kbs//components`), then the Sources whose last poll failed (title, shape, the error, when it was checked, a link to the concept; `.../feeds`, keyed on the `feed_error` field). On top of the strip come the Surveyor alarms, one `error` row each with a one-line cause and the server's time (never one a Surveyor declared): an the alarms the `components` read carries for this KB or for none, in words (silent, degraded, protocol skew, and the ones a Surveyor reported; an alarm that names another KB is left out), and a replica whose budget is spent (once per replica). Nothing renders when all three are empty, and a failing or `404` route leaves the page as it was. When the Surveyors hold report candidates for the KB, a line under the strip counts them and points to Activity (nothing renders without one, or with feedback off). The components' live status (D1901) is the read-only answer to "what is deployed and healthy", and it sits at the top of each component's Settings tab, above its configuration: Meridian (version, start, the protocol it speaks and the range it serves), Compass (the machines that reported, their version and last sync) and, for the picked KB, the Surveyor (per perimeter tab: its health state, whether the registry expects it, its replicas against `min_replicas` with version, protocol and skew in words, tasks, state, last beat, budgets and next window, its recent runs and its alarms; an alarm tied to no KB shows its code and time only; with nothing deployed or expected it says so and links here). A read that fails or answers `404` (an older server) leaves the block out and the configuration stays. It starts nothing. The old `panel=components` link lands on Settings. The **Health** panel (D338, D365, D947, D948) shows what is wrong with the pages and nothing else: the lint's findings. What a person has to answer or decide is in Work. One read-only line under the lede says which Surveyor maintains the KB, who repairs it (that Surveyor, or Meridian) and when a doctor session last closed ("Maintained by team-a (2 replicas, running) · repairs by team-a · last doctor 2026-01-01 · next due 2026-01-15"); it is upkeep, not a finding, and renders only while a live Surveyor names the KB and the caller sees the whole KB. When the registry expects a Surveyor that is silent (or short of replicas) a notice line says so, and says that Meridian is repairing the KB meanwhile when it has taken the repair back; the rail's Health mark lights too. Neither is in the lint report or in the counts. With a Surveyor holding the repair, the findings that fix themselves name it instead of Cartographer. The page is about the KB alone, with no tab bar: the issues are the page, and a link at the bottom, *What Health checks*, shows *What it checks* in its place, with a link back. The components that serve the KB are in Settings. *Issues*: the title counts the kinds of issue found ("Cartographer found N kinds of issues"), the line under it every occurrence and how many pages carry one. The **page field** draws one square per page, clustered by Map under the Map's hue. A page with a problem takes the colour of the category of each of its problems (up to four, drawn as halves, stripes or quadrants); a page without one is dark (the legend names the categories present, and *fine*). A lit square opens its page, a Map's name filters the page to it (`hmap=` in the URL, one whole-KB `GET /api/ui/v1/kbs//lint` filtered by path, counts over the unfiltered findings) and pressing it again returns to the KB. Under it the issues are grouped by the category of the check, in the catalog's order (pages, templates, validity, links, values, maps, artifacts, the KB itself), each category with its own colour, the same in the squares, the legend and the bars, and folding: one card, a row per category with its count of kinds, only the first open. A lint finding is a problem and has no severity (D947): there are no bands of problems and suggestions, no count by severity and no trend. The doctor's `kb_review` items, observations included, are decisions, and the open contradictions too: both are in Work. In each category one row per kind, the heaviest first: its name, a bar for its weight against the heaviest row, and its count in its own unit (pages, maps, files, terms, templates…); a kind Cartographer fixes by itself says *fixes itself*. Hovering a row lights its pages in the field. An open row says *What it is* and *To fix*, then one line per case with its page count; the pages unfold on click, named by their last segment, and a file that is no page is named without a link. The rail does not filter here: a Map click opens the Atlas on it, and the Type and Status filters step aside. When nothing is found the page keeps its shape and says what was read instead of what was found: the field turns green, one square per page, and under it one row per family of rules says how many of its rules ran and found nothing; a family whose rules have nothing to read in this KB (D371) says so instead of claiming a pass. A row opens *What it checks* (the same view the bottom link opens). *What it checks* (`GET /api/ui/v1/kbs//checks`): how checking works in three steps (fixed rules, no AI; the sure fixes applied by Cartographer; the rest shown under *Issues*), the result on this KB (rules that pass, that found something, that have nothing to read here), then one folded line per category with what its rules read and what they found. Open, each rule is one line — its name, what it looks for, a mark when Cartographer fixes it by itself, its count — those that found something first; a rule that cannot run on this KB is greyed out with its reason (D371) instead of a zero. Like the rest of the UI the panel writes nothing. A caller that cannot see the whole KB gets the issues it can see. The rail marks Health with a dot while there are problems. The `panel=observatory` and `panel=maintenance` links open Health. The **Artifacts** section, last in the rail, shows what the KB ships to agent clients. It has tabs, each its own panel in the URL (D1057): **Agent kit** (`panel=artifacts`: skills, subagents, hooks and MCP descriptors, as tiles with a detail beside them), **Instructions** (`panel=instructions`: the curated `instructions.md` shown as its source), **Templates** (`panel=templates`: one card per type, busiest first, with how many concepts carry it — a button that opens the atlas filtered to the type — the one-line brief its template asks for, the frontmatter fields it adds beyond the common ones and the sections a new page starts with) and **Secrets**. The agent kit and the templates are catalog pages built like the others (D339): the title counts the artifacts of the tab, the line under it gives the findings of the tab's artifacts ("No artifact findings" when clean) and says when no client has reported a use yet. There is no text filter: the hero filters the agent kit by kind (each with its own mark and colour) and, when there is something to show, to the recently used, the idle (never used, or not in the last 42 days) or those with findings. Below, each kind is a section saying what that kind is — and, when all its artifacts go to the same clients, how many — with one tile per artifact: name, worst finding, two lines of description, its clients when they differ, and its last use once any use has been reported. Bundled skills are not listed: they belong to the binary; skills left out for failing validation are listed above the catalog. The **Instructions** tab is not a catalog: the instructions are one text every client receives as it is, so the page shows the file itself in the frame Settings shows its YAML in — file name and line count in the head, a copy button, numbered lines, Cmd/Ctrl-A selecting the file alone — under a line naming the clients whose instruction file it is written into. A KB without instructions shows the kind's empty tile. The **Templates** tab lists the template tiles; a template is not followed by the usage scanner, so it has no last-use cell, and it offers the atlas filtered to the concepts of its type. An artifact link from before the tabs (`panel=artifacts&artifact=template/`) opens the Templates tab with that template, and one to the instructions the Instructions tab; `artifactPanel(kind)` in `web/src/lib/viewstate.ts` is where a kind chooses its tab, and a kind nobody routes there lands in the agent kit. Every kind a tab lists gets a chip (the agent kit) and a section, **whether or not the KB ships one** (D864): the page is also how a reader learns what a KB can provide to its agent clients. An empty kind is an outline tile where its first artifact would go (D948): what the kind is, where its files go in the KB (`skills//SKILL.md`, shown as text), the clients that receive it or "Stays in the KB: no client receives it" for a template, and a *Docs* link to the page that explains it on GitHub (the repository's `main`, in a new tab). The kinds, their order, paths and docs come from Meridian (`kinds` in `GET …/artifacts`, from `contract.Kinds`); the blurb, the glyph and the colour of a kind are the page's own, and a kind it does not know gets a neutral glyph and no blurb. A *Show* slice hides the empty kinds, so "no match" still reads as no match, and a KB with nothing at all shows the empty kinds of the tab instead of a page-level empty state. Against a server that sends no `kinds` the page behaves as before: only the kinds that have an artifact, and the page-level empty state. Each client of an artifact carries its `mode` (D1697), the answer of the resolver a sync runs: `native` is the plain case and shows no tag; `degraded` (an agent a client without subagents receives as a skill), `skipped` and `unverified` show a tag whose title is the reason (`clients[].reason`). A requirement on an artifact the KB does not ship reads `unverified`, "depends on another KB": it may come from another KB bound to the same client. The kind tiles list the clients that receive agents as skills too. Against a server that sends no `mode` the page shows the names alone. Selecting a tile opens the artifact beside the catalog, as the reading panel opens beside the atlas, with a close button; on a narrow screen it takes the whole width with a way back. The detail gives its description, its signature, content hash and last use as one line of pills, the clients sync writes it to as a sentence, and its files: Markdown rendered (frontmatter as a light table without the name and description the header already shows, list values such as `tools` as chips folded past eight, nested values as a folded YAML block), anything else as plain text, a binary or over-256-KiB file named but not shown. Its findings are listed under **Findings**. A skill, agent or hook lists the concepts it reads, each opening on the atlas. The selection is in the URL (`panel=artifacts&artifact=/`, or `panel=templates&artifact=template/`). The section exists only for a principal that can read the whole KB, since artifacts are whole-KB resources (D238); the rail entry carries no count. The **Secrets** panel lists the KB's `secrets/*.sops.yaml` files (D708): per file its path, value count, last change and age recipients, then one row per value — its JSON pointer, its type and the concepts whose `secret_refs` name it — with the values masked. Key names are readable without a key, as they are in git. Pasting an age identity (`AGE-SECRET-KEY-1…`) and pressing *Decrypt* opens the values **in the browser**: Meridian only serves the ciphertext, never sees the key and never runs sops. Each value can then be shown or copied; *Lock*, closing the panel or switching KB forgets them, and the identity itself is not kept after the decryption. A key that is not a recipient of any file is reported as such. A KB with no secrets says where a file goes (`secrets/.sops.yaml`, from the `kind` the route sends, D864) and links the docs. Like the Artifacts panel it exists only for a principal that can read the whole KB. ### Runtime secrets Git credentials, MCP tokens, and the age/SOPS keys are runtime secrets — never in the bundles. The files of the credentials directory (§Credentials directory) and `CARTOGRAPHER_TOKENS` are mounted or configured outside committed YAML. ### Cold start `clone`/`pull` of the KBs (including bootstrapping the remotes in `kbs:`, §Bootstrapping a KB from a git remote) + rebuilding missing indices. **Listener first, then all KBs at once** (D348): in HTTP mode `serve` binds the port synchronously before any clone or index work (a second `serve` on a taken port exits at once, having changed nothing), so `/health` answers within a second of start. Until every KB is cloned, opened and reconciled, `/health` stays `200 status:"ok"` with `bootstrapping:true` and a `phase` (`cloning`, `mounting`, `indexing`), `/ready` is `503`, and every other path (`/mcp`, `/ui/`, …) is `503 kb bootstrapping, retry` with `Retry-After: 5`; then all KBs become available together (the routed mount registers the union of the KBs' tools, so a half-mounted server cannot be routed). On a cold `emptyDir` this window is the whole clone plus the first index build (minutes for a large KB); a restart that keeps the data pays only the reconcile. A failure during bootstrap (wrong remote, bad key) still ends the process, so it crash-loops visibly. stdio mode is unchanged: no listener, bootstrap runs before the transport, and it serves exactly one KB: more than one mount (`--kb a,b`, or `--data` with several KBs) stops with an error naming them, while one directory spelled two ways (a relative path, a symlink) counts once, in HTTP mode too. The persisted SQLite index (`/.cartographer/index.db`) is excluded from git via `.git/info/exclude` (D62, never versioned): after a fresh clone (e.g. pod restart) it starts empty even if the concepts are already on disk. At startup, for every mounted KB, Meridian reconciles content hashes from the `.md` files against the persisted index, adding new concepts, refreshing changed ones, and removing vanished ones — keyword/FTS5 only. The same reconciliation runs after a `SyncIn` pull that moves HEAD. Best-effort: an error doesn't block startup, it is logged to stderr. Imports and manual filesystem edits do not require a service restart: call the MCP `reindex` tool, or run `cartographer reindex [--kb ] [--full]` (against a server that mounts several KBs `--kb` is required, and the bare command says so). `--full` forwards `full: true`, rebuilding the index from every concept instead of diffing (D136). The CLI calls a healthy configured server over HTTP so it never opens that server's SQLite database; only when Meridian is down does it reconcile the configured local KB databases directly — there is no live in-memory index to rebuild in that case, so `--full` reports that it is reconciling instead. ### Administration Run `cartographer help` for the authoritative command list. Server lifecycle, KB create/clone, client connection/sync, import, resolve and reindex have CLI commands; concept writes, snapshots and contradiction resolution remain MCP tool operations. There is no separate runtime token-registration command. ### Fine-grained roles `auth.roles` declares named permission sets that narrow a token below whole-KB granularity (D118). Semantics, the resource classes and the enforcement guarantees are in [transport-auth](transport-auth.md) §Roles and fine-grained permissions; this is the operator view. Tokens and roles are reloaded on a running server, on `SIGHUP` or when the file changes (`auth.reload_interval`, default `30s`, `0` stops the polling): [transport-auth](transport-auth.md) §Reloading tokens and roles without a restart. ```yaml auth: mode: "on" roles: - name: runbook-editor rules: - kb: homelab access: rw # r | rw maps: [infra] # omit the key = every map; `maps: []` is refused types: [Runbook] # empty = every type - kb: reference access: r - name: automation-a # an automation token that cannot change artifacts rules: - kb: kb-a access: rw artifacts: r # rw (default) | r: everything above except changing skills, agents, hooks secrets: none # omit (default) | none: everything above except authority over secrets tokens: - token: ${CARTOGRAPHER_TOKEN} id: ci # stable principal id for logs; derived from a # token digest when omitted roles: [runbook-editor] ``` `${NAME}` as the whole value of `token` is read from the environment at startup; an unset or empty variable refuses startup, naming the field (#680). Any other value is taken literally. `artifacts: r` (#1405) is a narrower allow, not a deny: the rule grants what its `access` grants except `artifact_write`, `artifact_delete`, `artifact_move`, `skill_install`, `dashboard_patch`, `dashboard_delete` and the `/api/usage` report, which change what every client of the KB syncs and executes, or the dashboards every reader sees. `log_append`, `source_register`, `concept_*` and the reads stay allowed. A second rule of the same token without the key restores the write (rules are unioned); `artifacts: rw` with `access: r` is refused at startup. The Surveyor token recipe is a role like `automation-a` above: one role per perimeter, `rw` on the perimeter's KBs, `artifacts: r`, no other KB. Declare the token itself `kind: surveyor` with an `expires_at` (`transport-auth.md` §Token kinds and expiry): a role alone leaves it a `human` token, which keeps `secret_set` and `secret_resolve`, while the kind forces `artifacts: r` and `secrets: none` whatever the rules say. `secrets: none` (D1894) is the same shape for secrets: the rule grants what its `access` grants except `secret_resolve`, `secret_set`, `service_get` with `resolve_secrets`, and any `concept_write`, `concept_new`, `concept_patch`, `concept_batch`, `concept_merge` or `concept_expand` whose arguments name `secret_refs` or `secrets_source` (a conservative scan: a false positive denies). They answer `secrets_restricted`. An unselected rule (no maps, journals or types) of the token without the key restores them; on an `access: r` rule it is accepted and changes nothing but the Atlas, which then hides the KB's secret files. A `surveyor` token always has it. A write rule scoped to maps, journals or types holds no authority over the KB's secrets either (an unselected rule without the key is what grants it): a token whose write rules on a KB are all scoped, or carry `secrets: none`, cannot write `secret_refs` or `secrets_source`, whether a call names them or `concept_move`, `concept_archive` or `supersede` carries a concept that holds them, and answers `secrets_restricted`. Rollout notes: - **Nothing changes until you opt in.** Tokens without `roles` behave exactly as before: unscoped tokens stay admin, `scopes` keep granting whole-KB access. A role whose write rules on a KB are all scoped (maps, journals, types) no longer writes `secret_refs` or `secrets_source` there; add an unselected `rw` rule without `secrets: none` for a token that has to. - **Migrate one token at a time.** `roles` and `scopes` on the same token are unioned, so a token can gain a narrow role while keeping an existing scope. - **Validation is fatal at startup.** A duplicate role or principal ID, two tokens with the same secret value, an unknown role reference, an empty `kb`, an `access` other than `r`/`rw`, an `artifacts` other than `r`/`rw` (or `rw` on an `r` rule), an empty or traversal selector, or a rule that names both `maps` and `journals` (it would match nothing: split it in two) aborts the boot. Diagnostics name the role and rule index, never a token. - **Selectors are not validated against KB content**: a role may reference a map that does not exist yet, and grants nothing until it does. - Verify a rollout with a real request rather than by reading config: a token outside its perimeter receives a generic `not found`, deliberately indistinguishable from a missing concept. ### Audit log The compliance trail (D119) is always on (D905): `/audit/audit.log`, or `audit.log`, signed with `audit.key` from the credentials directory, which the first start generates when it is missing. Semantics and the guarantees are in [transport-auth](transport-auth.md) §Operational audit; this is the operator view. ```yaml audit: log: /var/lib/cartographer/audit.jsonl # empty = /audit/audit.log mode: required # best_effort (default) | required max_segment_bytes: 67108864 archive_dir: /var/lib/cartographer/audit-archive retention_days: 400 ``` The start logs where the log is and whether it is signed: `audit log: (mode , signed; verify with --public-key )`, or `unsigned` with a warning that says why. A session started with `serve --kb ` and no `data` (stdio, development and tests) keeps no audit log and no credentials directory in the home directory: the log runs only if `audit.log` is set, and the start logs `audit log: off` otherwise (`audit.mode: required` then does not start). Credentials are read from `credentials_dir` when it is set. A server with `data` or `kbs[]` is unchanged. Rollout notes: - **A restart waits for the previous process.** Only one process writes the log; a start that finds its lock held retries for up to 10 seconds, so a rolling or service restart, where the old process is still exiting, opens the log. A holder that stays longer is a live second writer: `required` does not start and `best_effort` starts without a log, as for any log that cannot be opened. - **Start in `best_effort`.** It is the default: a broken sink never blocks a call. Move to `required` only once the log's storage is as available as the service itself — in `required` mode an unwritable audit log takes MCP calls down with it, which is the correct trade for a compliance deployment and the wrong one everywhere else. - **Back up `archive_dir` together with the checkpoint index.** Retention only ever deletes a segment already covered by a signed checkpoint, so verification still succeeds afterwards, but only if the index survives. - **Keep the public key.** Without it `audit verify` checks the chain but not the signatures; it reports the unsigned count rather than silently passing. It is in the start's log line, and derives from `audit.key`: back the key up with the log, since a new one starts signing with a different key. - **An unsigned log stays verifiable.** A log that was kept without a key is signed from the first start that has one. With a key, a log in which no entry is signed is refused (`no signed entry`): a log kept unsigned for its whole life is verified without a key, or with `--signed-since` set after its last entry; `--signed-since` earlier than that start makes the unsigned entries fail. `audit verify` accepts its unsigned entries up to the first signature, which covers them through the hash chain, and up to the first checkpoint written with the key; an unsigned entry after either is reported. So a `best_effort` start without the key, once the log has been signed, leaves a log that `audit verify` refuses from that entry on: restore `audit.key` before restarting, or rotate the log and keep the old one aside. - Verify from the operator machine, not Meridian: both commands read files and never contact a running instance, so they work during an outage. ## Observability Cartographer emits structured operational messages and per-phase sync timing to stderr (the `timing` lines go through the same logger as the rest and carry its date and time). It does not expose Prometheus metrics or derive token/queue/search SLIs from the audit file; the audit log is evidence for compliance review (`cartographer audit verify|export`), not a metrics source. **A KB that cannot be mounted (#1963)**: a `kbs[]` or `--kb` KB whose path is missing or moved, or whose remote cannot be cloned at start, is skipped; Meridian starts with the others (over stdio, which serves one KB, it still stops). The log has one `ERROR` line per skipped KB with the path and the likely cause (`path missing: moved? update kbs[].path`; for a clone, git's remedy). It is reported, not hidden: `/health` lists it for a caller who reads that KB as `skipped_kbs: [{name, reason, retrying?}]` (omitted when none; `reason` names no server path), `kb_status` through the routed mount and `/mcp/` answer that it is not mounted and why, and `cartographer status` and `doctor` show it. With no `data` directory configured, a server left with nothing mounted and no clone to retry stops, naming the cause; with `data`, a sole skipped KB leaves the server up with no KB, as a fresh empty data directory does. A failed clone (`retrying: true`) is tried again after 30 s, doubling up to 15 min; Meridian has no live mount, so when one succeeds a server that knows it is supervised logs why and shuts down gracefully with exit status 75, for its supervisor to start it with that KB mounted; one run by hand logs that a restart is needed and keeps serving the others. It knows from `CARTOGRAPHER_SUPERVISED=1`, which the generated launchd plist and systemd unit set and which the Windows install records in the `service.env` beside the config (read by `serve` before the retry logic; a task a release candidate wrote passes `serve --supervised`, still accepted); a service installed before that falls back to `INVOCATION_ID` (systemd), a launchd job label and Kubernetes. A bare container is not supervised (`docker run` has no restart policy): one with a restart policy sets `CARTOGRAPHER_SUPERVISED=1`. The cron backend's supervisor restarts a stopped server too, but does not set the marker, so a restart there is the operator's. The Windows task's `RestartOnFailure` count of 3 is a lifetime budget, not per start: a fourth restart-to-mount does not happen. **Local health checks with TLS on**: the tray, `service status`, `service restart` and the upgrade repair, the `kb` commands that read `/health` (`kb list`, the guidance after `kb create`, `clone` and `unmount`, `--restart`) and `setup`'s readiness wait read `/health` through the loopback health listener (`tls.health_addr`), since the public address answers a clear request with `400`; `service status` still shows the public address. With `tls.health_addr: off` they report the server as not probeable and do not wait; the tray and `service status` cannot see the server then and show it as stopped / not checked (`health_skip_reason: no_health_listener`). Two local helpers need `/mcp` and do not work against a TLS server, and say so naming `tls.enabled`: `kb secrets init` and `setup`'s auth check (`setup` itself stops, as it provisions the cleartext loopback service); a probe of `/mcp` never goes to the health listener, which answers `404` to every path but `/health` and `/ready`. **Liveness vs readiness (D84, D119, D176)**: `/health` is liveness — `status:"ok"` unconditionally (D1096: with authentication on, an anonymous caller gets only `status`, `ready`, `version`, `started_at`, `build`, `component_protocol` and `component_min_protocol` (the integer component protocol window of `control-plane.md` §Component contract: no secret, no inventory, so a Surveyor can refuse an unsupported server before its first beat), and `mount_mode` + `routed_path` on a routed server; a valid token adds `kbs`, filtered to the KBs the token reads, and `latest_version`; a cache or proxy in front of `/health` must key on `Authorization` or forward one token, as the demo Worker does) (a probe that restarted the process on `status != "ok"` must never fire from a KB-mounting issue); it also carries a `ready: ` field for callers that want both signals from one request. `/ready` is the dedicated readiness endpoint: `200 {"ready":true}`, or `503 {"ready":false,"kbs":,"degraded":[…]}` otherwise, where `kbs` counts and `degraded` names only the KBs the caller's token reads (#1109, the rule of D1096; admin and the auth-off local admin see them all). `/ready` is **not** a public path: with auth on it answers `401` to an anonymous caller, so a plain `httpGet` readiness probe never passes (§Probes below). `/health` also carries `bootstrapping: true` and `phase` **only while the KBs are still being cloned and indexed** (D348; absent afterwards, so the steady-state shape is unchanged) — a client that reads `bootstrapping` treats the answer as "could not ask, retry", never as "zero KBs". `/ready` during that window is `503 {"ready":false,"kbs":0,"bootstrapping":true,"phase":"…"}`; every other path answers `503 kb bootstrapping, retry` with `Retry-After: 5`. With listen-first, `/health` answers in seconds, so a `startupProbe` on it (`failureThreshold` × `periodSeconds` sized to the worst clone-plus-reconcile, several minutes for a large KB) is a safety net rather than a requirement. `/health` also carries `started_at`, the RFC 3339 instant the answering process started, which is how a restart proves the new process answers rather than the old one before it exits ([D266](decisions/D266-a-windows-restart-waits-for-the-old-process-and-proves-the-new-one.md)), and `build`, the identity of the answering executable (`vcs:` when the binary was built from a clean checkout with the VCS revision embedded, `sha256:` of the file otherwise; absent when neither is available, and from a server that predates the field), which tells apart two builds that share a version, such as a release candidate rebuilt under the same tag ([D2164](decisions/D2164-health-build-identity.md)), and `latest_version` **only when** Meridian's own update check knows of a newer release (`update_check`, D254): absent means unknown or up to date, so the shape a probe depends on is unchanged. A server running as the container image reports it only once the image tag exists on ghcr.io (anonymous token, manifest `HEAD`; `CARTOGRAPHER_UPDATE_REGISTRY_URL` for tests), and a failed or negative check is retried after an hour ([D1351](decisions/D1351-update-check-waits-for-the-channel.md)); any other server relies on the release being published last (D1350). **A push that does not leave is visible to humans.** Each KB entry of an identified caller's `/health` carries a `push` object, `{push_state, unpushed_commits, remedy}`, only while the KB's push state is `failed` or its oldest unpushed commit is at least three minutes old (`kb.PushLagThreshold`; a push is debounced and retried, so a transient failure stays quiet). The age is the committer time of that commit on the server, never a time a client declared. `remedy` is one fixed sentence chosen by classifying `last_error` (identity refusal, protected branch or hook, a permanent push refusal such as write access, a repository rule or a size limit with the rule's sentence minus the remote's line, a recognised network failure, else "the cause is in the server's log"), never git's own text and never a command, so it is the same for every reader (D1101); the operator reads the specific cause in `kb_status` and `sync_status`. The object is given only to a principal that may read the whole KB (the rule of `sync_status`, which reports the same data): a token narrowed to a selector sees the KB on `/health` and no `push` field, and an anonymous probe sees no KB at all. Unlike `capabilities` it is computed from the clone and the remote-tracking ref with no network, and reused for 15 seconds per KB. `cartographer status`, `doctor` and the tray read it. A KB's `capabilities` on `/health` (which `doctor` and the Atlas KB list read) are derived from the KB when an identified caller asks (an anonymous probe, `/ready` and the Atlas-less paths never read them), reused for 15 seconds per KB: a key added to `credentials_dir` after start shows within 15 s with no restart (#2150); `kb_status` computes it on each call. **Probes.** `livenessProbe` (and a `startupProbe`) on `/health`: public, `200` whenever the process answers; `serve` binds first and answers `/health` within a second, while the KBs clone and index, so liveness never fires during a cold clone and the startup probe is a safety net rather than a requirement. Auth off (the local service, a trusted network): `readinessProbe` as an `httpGet` on `/ready`. Auth on, the K8s example above: `/ready` needs a bearer token, and `/health` is `200` while Meridian is not ready, so an anonymous `httpGet` cannot tell. The chart's readiness probe is therefore an `exec` that reads the body of `/health`, which carries `ready` for an anonymous caller (the same `readiness()` as `/ready`; it relies on `wget` in the image, which `test/smoke/image.sh` pins), with a five-minute startup allowance. To use the documented token route instead, set `meridian.probes.readiness.tokenSecret`: any valid token is enough, because the probe reads the status code and not the body; use a dedicated token with a read scope on one KB (`CARTOGRAPHER_TOKENS` entry `|kb::r`), kept in a Secret and passed to the container as an env var, and run the request from an `exec` probe so it stays out of the pod spec: ```yaml env: - name: PROBE_TOKEN valueFrom: secretKeyRef: { name: cartographer-probe, key: token } readinessProbe: exec: command: ["sh", "-c", "wget -q -O /dev/null --header \"Authorization: Bearer $PROBE_TOKEN\" http://127.0.0.1:39273/ready"] ``` An `httpGet` probe with `httpHeaders: [{name: Authorization, value: "Bearer …"}]` works too, with the token written in the pod spec. `terminationGracePeriodSeconds` must cover the shutdown: an HTTP drain of at most 10 s, then each KB's pending push, one after the other, at most 10 s each, so 10 s plus 10 s per KB in the worst case (the chart defaults to 60). Two things make a server not ready, and both are reported by either endpoint: - **no KB mounted** — e.g. a fresh local install with an empty data dir (§Cold start): `503 {"ready":false,"kbs":0}`; - **a required-mode audit sink that is unhealthy** (D119) — Meridian will reject every required-mode call, so readiness fails *before* the next one is refused rather than after. The response names the affected KBs (`"degraded":["",…]`), and `/health` carries each KB's audit state under `kbs[].audit`, because a single boolean says something is wrong and nothing about where to look. The audit gate applies on the HTTP path whatever the KB count: `serve` builds a multi-KB server even for one mounted KB, so a single-KB HTTP deployment is gated exactly like a multi-KB one (D176). A deployment with no audit sink, or one in `best_effort` mode, is unaffected. **Connected clients (D129)**: `GET /clients` reports which clients have talked to this process, with their self-reported name and version, the protocol version and era, a request count and a last-seen timestamp, limited to the KBs the token can read (shape and caveats: `transport-auth.md` §Client roster). Unlike `/health` it requires a bearer token when auth is enabled, as `/ready` does, so it is not a probe target: ```bash curl -sH "Authorization: Bearer $TOKEN" https:///clients | jq ``` The tally lives in memory and resets when the pod restarts — it answers "what is connecting right now", not "what connected last week"; that question belongs to the audit log. ## Backup and disaster recovery ### RPO/RTO The git remote is the primary copy: the push **debounce** determines how many commits are lost if the host dies → fix the cadence and **replicate** the remote. ### Lost SOPS key A truly unrecoverable scenario. Prevent it with multi-recipient escrow + restore testing (→ [`skills-services-secrets.md`](skills-services-secrets.md) §Operational guidance). ### Working-tree crash recovery Meridian does not repair arbitrary interrupted git state at boot. Before mounting, inspect and clean up an active merge/rebase, stale lock file or unexpected working-tree changes using normal git recovery procedures. Keep a backup before discarding any state. ### External component failures | Component | Behavior | |---|---| | Git remote unreachable | The local commit remains; asynchronous push logs the failure and a later sync retries | | Invalid/expired git credentials | The git command fails and the error is surfaced; rotate the configured token/key | | Disk full | Atomic writes fail cleanly | | Corrupted SQLite index | Rebuilt from the `.md` files | ## Upgrades, schema migration, and repo growth - **Server upgrade** with mounted KBs: graceful HTTP shutdown flushes pending pushes before the process exits. - **Native local upgrade** (Homebrew Cask or `install.sh update`): self-repairing (D121). Either path replaces the binary behind a stable path, but cannot replace the image of a process already running it. `install.sh update` calls `cartographer upgrade-repair` on the new binary right away. The Cask cannot: its install steps run in Homebrew's sandbox (temporary `HOME`, no network), so after `brew upgrade` the old process keeps serving until the next `cartographer sync` — the session-start hook, the scheduled timer or a manual run — performs the same replacement before syncing (D199). It acts only on a running service whose program is that same binary, on the loopback endpoint Compass syncs against, reporting a different version; a failed replacement is a warning and the sync proceeds. `upgrade-repair` stays available to do it immediately. It gracefully replaces a **running** service (`SIGTERM` — on Windows the named shutdown event plus an explicit relaunch of the task, since a Scheduled Task supervises nothing, D217 — so in-flight requests drain and pending pushes flush), waits until `/health` reports `status:"ok"` **and** the installed version, then reconciles the configured providers in place with the ordinary `cartographer sync` policy. Before signalling it compares the program the service definition runs (plist `ProgramArguments[0]`, unit `ExecStart`, task `Command`) with the running executable: when they differ (an `install.sh` copy next to a Cask), a `SIGTERM` would bring the old binary back, so it re-renders the whole definition for the running binary (what `service install` writes: hand edits to the definition are replaced, and it says so), reloads the job, says which binary it switched from and to, and waits up to 30 s for `/health` to report the installed version instead of replacing again. It refuses, with exit `2` and the manual `service install` command, when the running binary is under the temp directory, a go-build cache or a version-pinned Caskroom path; a definition it cannot read is a warning, not a silent skip; the lazy repair before `sync` never switches, it skips a service that runs another binary. It is idempotent: if `/health` already advertises the installed version it skips the restart and only syncs. A deliberately stopped or uninstalled service stays that way, and a client pointed at a non-loopback (or different local) endpoint has its provider sync skipped rather than run against a possibly remote server. **Still needed afterwards:** restart already-open provider sessions, which is what reopens the MCP connection and reloads the repaired configuration. - **When the repair does not complete**: exit `1` means the binary and the service are fine but provider sync is pending — the underlying error is printed and `cartographer sync` is the retry. Exit `2` means a running native service could not be replaced and verified; no provider sync was attempted, and `install.sh update` fails visibly. Investigate with `cartographer service status` and the Meridian log, then retry `cartographer upgrade-repair`. `cartographer status` reports any residual skew and points at the same command. - **Knowing that one exists** ([D254](decisions/D254-agents-are-told-when-cartographer-is-out-of-date.md)): on a client, the session-start hook runs `cartographer update notice`, which tells the agent — and through it the user — when a newer release exists and names the upgrade command for the channel the binary came from; `status` and `doctor` report the same from the cache. A server reports its own staleness as `latest_version` in `/health` and `kb_status`, versions only, for clients without session hooks and for remote operators; the generated instructions block tells the agent to relay a `kb_status` `latest_version` to the user once, with the upgrade command `cartographer update check` prints. Both `update notice` and Meridian's check re-ask GitHub, inside the 24 h TTL, when the cached latest equals the running version, so a release published just after a check is not hidden for a day ([D320](decisions/D320-upgrades-and-provisioning-tell-the-user-what-changed.md)). The Atlas adds the history behind the version, with each release's changelog and the same upgrade command, fetched by Meridian on demand under the same switch ([D862](decisions/D862-release-history-in-the-atlas.md)). - **Kubernetes and remote servers**: unchanged. Bump the image tag, or with the Helm chart (§Example: K8s pod) the chart version: the image tag is the chart's `appVersion`, so an upgrade is `helm upgrade oci://ghcr.io/beppetemp/charts/cartographer --version `, and the Surveyors of the release follow the same tag. The rule below holds unchanged: run by an operator `helm upgrade` applies at once, but under a GitOps controller the chart version (or the values) is merged and applied later, so read the Deployment's image back before trusting `kubectl rollout status`. Connected clients surface the version skew (D95) while the rollout catches up. The step ends on a **verified image**, not on a rollout ([D221](decisions/D221-the-kubernetes-upgrade-step-ends-on-a-verified-image.md)): read the Deployment's container image back and check it is the new tag *before* waiting for rollout, because until the manifest is actually applied — here by Flux on its own reconcile interval, see §CI/CD below — `kubectl rollout status` returns success immediately about the old ReplicaSet. `upgrade-repair` is for native local installations only — it is the loopback case by construction. The client-side counterpart is [D142](decisions/D142-reconnect-rebuild-a-client-configuration-never.md): each provider's lockfile entry records the `server_version` its state was materialized against, so the next `cartographer sync` prints one line saying Meridian changed, then syncs normally; `status` and `doctor` are the commands that recommend `cartographer reconnect` ([D220](decisions/D220-sync-states-the-server-change-without-recommending.md)). `sync` repairs in place and is the right tool for almost everything; `reconnect` (a full disconnect + connect, preserving every setting) is for what an incremental sync structurally cannot see — files and registrations an *older Cartographer version* wrote under names that are not in the current managed set. It is never automatic, and after it, already-open provider sessions still have to be restarted. The verification step that closes the loop is `cartographer doctor` ([D143](decisions/D143-doctor-a-separate-command-that-diagnoses-and-never.md)): read-only, exit 0/1/2, it reports what is left over or missing on Compass — residual MCP entries for unmounted KBs, a duplicated instructions block, a hook registered twice, a v1 lockfile — and names the command that fixes each one. - **0.29: the client sends its token only to a server that answers as one** (5043daf6): a `server_url` whose anonymous `/health` is refused (an older proxy), or that redirects to another host, now fails every token-carrying command with "does not answer as a Cartographer server; the token was not sent". Allow an anonymous `/health` through the proxy and point `server_url` at the final host (`configurator.md` §`cartographer connect`, the paragraph “Where the token goes”). - **A token with no `kind` is a `human` token, including one made for a Surveyor before the 0.29 candidates set `kind: surveyor`** (0.28 had no worker): it keeps `secret_set` and `secret_resolve`. When moving a worker to the Surveyor, declare its token `kind: surveyor` with an `expires_at` in the server's `auth.tokens` (the kind forces `artifacts: r` and `secrets: none`, `transport-auth.md` §Token kinds and expiry) and renew it before it expires. - **0.29: the `sync_apply` tool is removed**: a script or an agent that calls it gets `tool not found`. The server never writes a client's directory; run `cartographer sync` on the client machine, which reads the manifest through `sync_pull` (`control-plane.md` §MCP API, the note after the `sync_status` row). - **0.29: a write into a folder with no `_map.md` is refused** (`unmapped_folder`) when the KB declares Maps. - **0.29: `audit verify` and `audit export` exit 3** on an intact chain that has unfinished attempts; the next server start appends `interrupted` completions. - **0.29: `connect` refuses** an invalid Codex `config.toml`, a `/mcp/` URL and a URL whose path does not end in `/mcp`. - **0.29: `connect` refuses a `--server-url` with `?kb=`**: choose the KB with `--kb ` or `/mcp/`. - **0.29: `sync`, `reconnect` and `upgrade-repair` exit 3** on a denied prune or an unreadable bound workspace (`configurator.md`, `sync.md`). - **0.29: `status` shows `[no access]`, not `[moved]`**, for a bound workspace the process cannot read; the tray shows No access or Approval pending. - **0.29: a denied write on one provider skips only that provider**: `sync` applies the others and exits 3, not 2 (a denied write is a per-provider refusal, not an abort); `connect` keeps the permission error fatal (`sync.md`, #2242). - **0.29: `lint`, `validate` and `gate_check` refuse an unknown `scope`** with `unknown scope "x"; use a map name (map_list) or an id prefix`; `lint` no longer answers `count: 0` for a mistyped one (#2239). - **0.29: `service install` refuses a `--config` the server cannot load** and stops nothing (`--config-only` runs the same check, #2242). - **0.29: an invalid `mcp/.json` is left out of `sync_pull`** with an issue (lint `mcp_invalid`): a descriptor served before disappears from clients until it is fixed. - **0.29: malformed `secret_refs` are refused** (`secret_ref_broken`). - **0.29: the write gate judges `unknown_type`**, and `services/` is never `unmapped_folder`. - **0.29: `gate_check` with empty `changed_ids` fails** on open non-gap Contradictions (`blocked_by`). - **0.29: a Contradiction is closed by `resolution_status`** (`resolved` or `wontfix`); the new `contradiction_status` lint may flag existing KBs. - **0.29: these calls are now errors**: `lint` with an unknown check, `graph_neighbors` on an unknown id, `secret_set` with an empty value, `concept_write` with an unresolvable `secret_refs`, `asset_read` with `encoding: text` on binary content. - **0.29: `write_veto` no longer judges** read-only calls or `kb_repair` dry runs. - **A role rule that names both `maps` and `journals` stops the boot** (#2508): it never granted anything (a concept is in a map or in a journal, and the selectors of a rule are intersected), so the role silently lacked both. Split it into one rule for the maps and one for the journals before upgrading. - **0.31: a proxy-token request that names no trusted user is refused** (`auth.proxy_identity.require_user`, default `true`): no header, or a peer outside `trusted_addresses`, is a `401`, no longer the token's own. A deployment that relies on that sets `require_user: false` ([transport-auth.md](transport-auth.md)). - **0.31: `/api/ui/v1` and `/api/v1` reads are audited** (D2512): expect more audit volume (the Atlas polls), and in `audit.mode: required` a read that cannot be recorded answers `503`. - **0.31: the secret resolver's `ttl_seconds` cache spans requests**, keyed on the caller, concept, name and key (`hooks.md`). - **0.31: the Helm chart's root filesystem is read-only** (`readOnlyRootFilesystem: true`): a plugin or hook that writes outside `/data` and `/tmp` fails; `meridian.securityContext.readOnlyRootFilesystem: false` is the way back. - **0.30.1: an MCP approval binds the targets of the secret references it cites** ([D2491](decisions/D2491-secret-ref-binding.md)). The binding applies only on a client at 0.30.1 or later: an older client launches whatever the descriptor resolves to, so update every machine that runs a launcher. An approval made before this release has no binding, so a descriptor that cites `${secret:}` is refused (`approved before secret references were bound`) until it is renewed with `cartographer approve mcp --kb `; descriptors with no secret reference are unaffected. Update the server before the clients: a new client refuses an old server with "update the server". A `rw` token scoped to maps, journals or types can no longer write `secret_refs` or `secrets_source`, nor any argument that names those fields (`secrets_restricted`). Re-approving needs a reachable server and a token allowed `secret_resolve`. - **0.30.1: `review_after` is read only as `YYYY-MM-DD` or RFC 3339** (the latter counts as its UTC day). A timestamp without a time zone is no longer a date: it no longer pauses `stale_open`, and a page that pairs it with `waiting_on` gets `wait_undated`. - **0.30.1: a Contradiction without `resolution_status` counts as open** everywhere it is counted; `commit_gate` and `gate_check` warn on such a Contradiction instead of blocking. - **0.30: `connect --kb all` records `kbs: all`** instead of the names mounted at that moment: the provider follows the server, so a KB mounted later reaches it too. A script that re-runs `connect --kb all` over a provider bound to a list turns that list into `all`; to keep a fixed set, name the KBs (`--kb a,b`) or run `client bind [,...]` (`configurator.md` §`cartographer connect`, the `--kb` row). A `--workspace` binding still records the names mounted now. - **0.29: bare `cartographer` no longer opens a TUI**: with no arguments in a terminal it prints a short status of the machine and the usage, otherwise the usage only. Use `cartographer status` for the full report (`configurator.md` §Bare `cartographer`). - **`sync` exits 3 when the symlink guard refused a write** (#2099): a script or a timer that treated every non-zero `sync` exit as a crash, or only 0 as success, now sees 3 when a destination is a symlink that is not listed under `providers..allow_symlinks`; the other providers were still written, and the line on stderr (`sync refused to write: …`) names provider and parts. List the link or replace it (`configurator.md` §Symlinked config files and directories are refused unless listed); a dry run still exits 0. An artifact the client refuses for its own content (a file path, a name) exits 3 too, with its own line (`the KB holds an artifact this client refuses`) and no link hint. - **KB format changes**: follow the release notes and back up the git remote before a migration. There is no general automatic schema migration engine. - **Repo growth**: keep large binary/source archives outside the KB and link them; Cartographer is optimized for Markdown knowledge repositories. ## CI/CD: release + deploy pipeline The GitHub Actions workflows (`.github/workflows/`): - **`ci.yml`** — on a PR, on push to `main`, on `merge_group` (inert here: a merge queue needs an organization-owned repository) and on `workflow_dispatch`; what a PR runs is in `testing.md` §Go tests (D1592, D1610, D1704). A contributor's PR runs the `test` job (`make gate`, then `make smoke-http`, `make smoke`, `make e2e` and `make test-install`; Go from `go.mod`, git identity configured for git-backed tests), `web` (a `video` and a `browser` leg) when the frontend or what `bin/cartographer` imports changed, `pr-title` and `plan-gate`; `gate` collects `test` and the web legs. A maintainer's PR runs `changes`, `gate` (it looks for the `signoff` status that `make signoff` posted, `scripts/ci-gate.sh`), `pr-title` and `plan-gate`, and skips `test` and the web legs. The heavy legs never run on a PR: `test-windows` (the tests in shards plus `install.ps1`, on Windows runners, D785), `test-macos` (`macos-latest`: `test/macos/` against the real launchd, `install.sh` and the Cask GoReleaser renders, D997), `test-linux-nosystemd` (Alpine and Debian containers with no init: `setup` and the service verbs on the cron backend against a real cron daemon, `test/linux/`, D1682), `docker` (the Dockerfile's `test` stage, `go vet` only: the gate already ran the tests, `test/smoke/image.sh` on the built server image, `test/smoke/surveyor-image.sh` on the `surveyor` stage and `make demo-smoke` on top of the server image, D995, D1440) and `demo-edge` (the demo Worker tests and Terraform check) run on `merge_group`, on push to `main` and on dispatch (the release PR and the release candidate run `docker` and `test-macos` too), so a Windows- or macOS-only break is caught by the hosted train gate, which dispatches `ci.yml` with them; `main` is the net for a build-host gate and for a contributor's merge, tracked by the `ci-red` issue. `smoke-http` and `e2e` run with no git identity (they isolate their own git config), so a host without one is exercised; the Go tests get the identity above. A `forge` job (Forgejo and GitLab CE in containers, `test/forge/run.sh`, D996) runs on the release PR, on a PR touching `test/forge/` and on `workflow_dispatch`, never on `main` and not as a required check. A `helm` job (`scripts/install-helm.sh` installs the pinned Helm, then `make helm-check`: `helm lint --strict` and `helm template` over `deploy/helm/cartographer/ci/` and the assertions of `test/helm/run.sh`, D1441) is kept out of `make gate`; on a PR it runs only when the PR touches the chart, its tests, the install script, the Makefile, `ci.yml` or the filter script, on `main` always. On a PR the `changes` job (`scripts/ci-filters.sh`, D994) decides `web`, `forge` and `helm` (the `windows` and `demo` filters remain in the script but no job reads them since D1592), failing open; on the release-please PR (D255, D672) every job runs, and a `main-status` job keeps one `ci-red` issue open while `main` is red (it watches the jobs that are not required checks, and names the red legs the gate of each train in the range did not run, `scripts/main-red.sh`); a `quarantine` job runs on push to `main` only, outside every verdict, and holds `issues: write` to comment on the issue of a lapsed entry (`testing.md` §Go tests). `gate`, `pr-title` and `plan-gate` are the required status checks on `main`'s ruleset. Runs on `main` coalesce (one running, the newest pending); `test-windows` and `web` only collect their legs on `main`. - **`pr-title.yml`** — on a PR opened, edited, pushed to or reopened: the required `pr-title` check, lint of what release-please will read from the squash commit (D865). The title must be a conventional commit whose scope, when it has one, is a canonical one (`internal/changelog.CanonicalScopes()`; a test compares the list with the workflow's), and no line of the body that starts like a conventional header (`feat(mcp): …`) may be wrapped onto the next line, because release-please keeps only the first physical line of such an entry (`go run ./internal/changelog/gen -check-body`; the body reaches it through the environment, never interpolated). It is a workflow of its own, not a job of `ci.yml`, because it must re-run on `edited` and that trigger in `ci.yml` would re-run the whole suite on every PR edit. The ruleset requires the job name, not the workflow. - **`privacy.yml`** — on every push, PR (opened, edited, reopened: a push to a PR is scanned by the `push` run), issue and comment: scans the published commits and text for private names, held only as HMAC digests in the `PRIVACY_GUARD_DIGESTS`/`PRIVACY_GUARD_KEY` secrets; a hit fails the run and redacts the text (D259). Skipped on forks; issue and comment text is scanned only when its author or editor has write access. - **`release-please.yml`** — on every push to `main`: maintains the **release PR** (semver bump computed from conventional commits + `CHANGELOG.md`). On merge, it creates the `vX.Y.Z` tag and the GitHub Release **as a draft** (`"draft": true` with `"force-tag-creation": true` in `release-please-config.json`, so the tag exists and starts `release.yml`) with the notes (the merged PR body between its `---` lines); `release.yml`'s `publish` job un-drafts it last, and the update check skips a draft (D1350). Its `release-pr` job runs after it on every push to `main`, on the open release PR's branch: it regenerates `docs/decisions.md` (D328) and groups the newest `CHANGELOG.md` section by area (`make changelog-areas`, `internal/changelog`, D865) — one `### ` heading per area with its Features and Bug Fixes, the scope prefix dropped, `dev`/`demo`/`deploy`/`ci` entries left out — then pushes one commit for both files when either changed and shows the same grouped section on the PR: it cuts the `CHANGELOG.md` section with `gen -split` (at most 60000 characters a part), puts part 1 in the body inside release-please's own header and footer (so release-please can still parse the body on merge) and the rest in comments of the PR marked ``, edited in place or created as the changelog changes, so the release page reads like the changelog whatever its length (release-please replaces a body over GitHub's 65536 characters with a link). A section with no entries yet (only `ci`, `dev`, `demo` or `deploy` commits) makes `gen` exit 3: the notes step, which runs the built binary because `go run` would report 1, logs a notice and the later steps leave the PR body and the notes comments as they are, while `release.yml` still fails on it. The same pass drops the entries release-please writes twice (#1670): within a section, an entry whose commit hash equals another's and whose text is identical to it or a strict prefix of it (the truncated half of a wrapped body line) keeps the longer line, and an entry with the same text as an earlier one (two commits of one PR) is dropped. The step that runs the branch's code (`go run ./internal/changelog/gen`) holds no secret: the PAT is set on `origin` for the push only and taken off again, and the other steps that hold it run `gh` only. The limit: a step that runs the branch's code can still write `$GITHUB_ENV` or `$GITHUB_PATH` for the steps after it, so those PAT steps are as sound as the branch they follow. Both steps are idempotent because release-please rewrites its branch and body on every push. Uses the `RELEASE_PLEASE_TOKEN` PAT (PRs opened with the default `GITHUB_TOKEN` do not trigger `pull_request` workflows). - **`plan-gate.yml`** — on a PR (`pull_request_target`, so the workflow and `pr-triage.sh` come from the base branch) the required `plan-gate` check, `pr-triage.sh --gate`, the size rule of `CONTRIBUTING.md` §Pull requests (D955). Read-only: it sets nothing on the PR, and no milestone is read or written (D1453). The PR's file list is parsed strictly: one tab-separated row per file with control characters in the name escaped (`gh api --jq` with `@tsv`), and a size that is not all digits counts for nothing and never reaches shell arithmetic, so a file name with control characters or a non-numeric size field cannot change the sums or the review tier. The role follows the repository permission (D955): an `author_association` of OWNER is a maintainer, a MEMBER or COLLABORATOR only when `collaborators//permission` says admin, maintain or write (a read or triage user, or an unreadable answer, is a contributor, whose `Size exception:` body line is ignored). - **`release-train.yml`** — the release on demand (D1384): `workflow_dispatch` only, no schedule, with `action=rc|release|discard`. The `train` job, which holds the PAT, runs `gh` only and no `uses:`; the `freeze` and `discard` jobs check out `main` (SHA-pinned, no credentials kept) and never see it. **`rc`** dispatches `preview.yml` with `v-rc..` (`` read from the release PR title, date in UTC, `` one more than the highest of the day's `preview.yml` runs of any status, read from the newest 50 run titles: a failed build leaves no tag, only its title; a read that fails stops the step and dispatches nothing; D2312) and comments the tag, the image and the pre-release URL on the release PR; the candidate opens the freeze. **`release`** merges the release PR (`gh pr merge --squash --match-head-commit`, with `RELEASE_PLEASE_TOKEN`: a merge by `GITHUB_TOKEN` triggers no `push` workflow, so release-please would never tag) only if the PR comes from this repository, the newest successful release candidate build (read from the run's `conclusion`, not `gh run list --status success`, which misses a build that succeeded on a re-run of its failed jobs, #2355) is of the head of `main`, `rc-ok` was added after that build by a maintainer, no `feat`, `perf`, `refactor` or breaking commit landed on `main` since the commit of the **oldest** candidate of the pending version (`scripts/freeze-open.sh --candidate`; the newest is always the head of `main`, so measuring from it would never block), every required check passed, and the security gate is clear (no open Dependabot or code scanning alert, no draft advisory with an open PR in its private fork, read with the `SECURITY_GATE_TOKEN` read-only PAT; a missing token or a failed call is not clear; the skip comment never says which check failed, and the log names a failed read by number (1 Dependabot, 2 code scanning, 3 advisories and their private forks' PRs, one number so the log never tells a private fork exists) and HTTP status, never by content, so an expired or under-scoped PAT is told from an open alert, #1811); otherwise it comments why and the release is dispatched again. **`discard`** deletes the candidates of the pending version with their tags (`contents: write`, `github.token`), removes `rc-ok` and comments on the release PR; the freeze closes. `internal/repodocs/release_train_test.go` pins the absence of a schedule, the actions, the freeze look-back and the merge token. The flow is `CONTRIBUTING.md` §Releases. - **`release.yml`** — on the `v*` tag, never one with a pre-release suffix such as a release candidate's (`!v*-*`, D1192): **GoReleaser** (`.goreleaser.yaml`) builds the `darwin/linux/windows × amd64/arm64` binaries plus `linux/arm` (GOARM=7) (`-X main.version=v`, read by `cartographer version`), attaches them to the existing draft release (`release.draft: true` and `use_existing_draft: true`, and a step after it fails the job if the release is no longer exactly one draft, D1350) with one SPDX SBOM per platform binary (`sboms:`, syft installed at a pinned version and sha256) and `sha256sums.txt` (`release.mode: keep-existing` — the release and its notes belong to release-please), generates the Homebrew cask (`skip_upload: true`, kept as the `cask` artifact; macOS only); in parallel, buildx publishes the multi-arch server image `ghcr.io/beppetemp/cartographer:` and then the Surveyor image `ghcr.io/beppetemp/cartographer-surveyor:` (the `surveyor` target, D1440), both with max-mode provenance and an SBOM. Both jobs then attest what they published with `actions/attest-build-provenance` (keyless, Sigstore, through the job's OIDC identity: `id-token: write` and `attestations: write`, no signing secret) — the `goreleaser` job one attestation over every asset listed in `sha256sums.txt` and one over `sha256sums.txt` itself, the `docker` job one over each image's own digest, pushed to the registry (D1022; see §Verifying a release). After the release is published, the `mcp-registry` job (`needs: publish`) publishes Meridian's metadata to the official **MCP Registry** (`io.github.beppetemp/cartographer`, OCI package pointing at the ghcr image): `mcp-publisher login github-oidc` (no long-lived secret) + `publish` with `server.json` (repo root; `version` and image tag are stamped by the job). The entry declares the stdio package as `docker run -i --rm --mount type=bind,src=,dst=/kb serve --kb /kb`: the image's entrypoint is `cartographer` with no `CMD`, which alone prints the usage and exits 0 (#1438), so the arguments and the bind mount of a required, client-asked KB folder (a `kb_path` variable; a folder that is not a KB makes `serve` exit with an error on stderr) are part of the entry, and the job's `jq` rewrites only `version` and `packages[0].identifier`; the folder must be writable by the image's non-root `cartographer` user. `internal/repodocs/server_json_test.go` pins the arguments. Ownership is verified via the `io.modelcontextprotocol.server.name` LABEL baked into the image. A final `prerelease-flag` job marks a `v0.*` release as a GitHub **pre-release** and reads the flag back, failing the release if it is not set (D82, D211): the `"prerelease": true` key in `release-please-config.json` does **not** set it — this job does. Because a pre-release is invisible to the `releases/latest` API endpoint, `install.sh` resolves the newest tag through `/releases?per_page=10` instead, skipping every tag with a semver pre-release suffix (a release candidate), never by the flag. A `chart` job (`needs: docker`: the chart never exists before the images it points to) runs `make helm-check`, packages `deploy/helm/cartographer` stamped from the tag (`helm package --version --app-version `: no commit, release-please does not touch `Chart.yaml`, as with `server.json`), pushes it to `oci://ghcr.io/beppetemp/charts` as `ghcr.io/beppetemp/charts/cartographer:`, reads the digest `helm push` prints back (a push that reports another reference or no digest fails) and attests it like the images (`push-to-registry: true`, D1441). A `publish` job (`needs: goreleaser, prerelease-flag, docker, chart`) then un-drafts the release (`draft=false` through the releases API, by id: the get-release-by-tag endpoint does not return drafts, with the release body set in the same call to the `## []` section of `CHANGELOG.md` at the tag, which `go run ./internal/changelog/gen -file CHANGELOG.md -section ` extracts in earlier steps that hold no secret; a body over 125,000 characters fails the job before un-drafting, and the grouped changelog, not release-please's ungrouped notes file, is what the release page shows, D1832) and reads `draft` and `prerelease` back, failing if the release is still a draft or lost the pre-release flag of a 0.x tag (D1350): until it runs the release is invisible to the update check, `install.sh` and `install.ps1`, so a red or retried job leaves a draft, never an announced version no channel can install. Two jobs with `needs: publish` then move the channels that point at "the newest": `cask` pushes the generated cask to `BeppeTemp/homebrew-tap` (`HOMEBREW_TAP_TOKEN` PAT), and `latest` retags `:latest` from `:` on both images with `docker buildx imagetools create` (same digest, so the D1022 attestation holds). A failure of either after `publish` leaves the release public and that channel one version behind: re-run the job (D1350 amended). A last `candidate-cleanup` job (`needs: goreleaser`) deletes the pre-releases `v-rc.[.]` of the version shipped, with their tags; candidates of other versions stay, and a failed deletion is a warning, never a failed release. - **`preview.yml`** — dispatched by `release-train.yml` or by hand with a pre-release tag (`vX.Y.Z-`, anything else is refused): the release candidate, so an unreleased `main` can run on a real deployment and as native service and client before the release PR is merged (D303, D1192). The `docker` job builds the same multi-arch image as `release.yml` and pushes **only** `ghcr.io/beppetemp/cartographer:` and `ghcr.io/beppetemp/cartographer-surveyor:` (its layer cache is scoped to the run); before the login and the first push it builds each amd64 image, loads it and runs `test/smoke/image.sh` and `test/smoke/surveyor-image.sh` on them (D995, D1440): a red smoke fails the run, so nothing is published and `release-train.yml` names the failed build in its skip comment. A `chart` job (`needs: docker`, `packages: write` only) packages and pushes the candidate chart `ghcr.io/beppetemp/charts/cartographer:` with the same steps as `release.yml` and no attestation; `binaries` does not wait for it, and a red chart job fails the run, so no candidate counts as successful. The `binaries` job (`needs: docker`, the only job with `contents: write`) tags the commit locally, runs GoReleaser in release mode with `--skip=publish,announce,sbom,homebrew` (the same archives and `sha256sums.txt` as a release, no tap push, no SBOMs), checks that the linux/amd64 binary prints the tag, and publishes a GitHub **pre-release** `` with `gh release create --prerelease --latest=false` and `GITHUB_TOKEN` (whose tag starts no `push` workflow); a run of a tag started again by hand replaces that pre-release (`release-train.yml` gives every candidate its own tag), other candidates are kept until `release.yml` deletes them. No `latest` image of either, cask or MCP Registry entry, and GitHub's latest release does not move. It also calls `film.yml` as a blocking job (below). The workflow is also callable (`workflow_call`, inputs `tag` and `rehearsal`, default false) by the nightly's rehearsal: with `rehearsal` true every step that logs in, pushes, deletes or creates is skipped and so is the film, and a dispatch is never one (`TestPreviewRehearsalPublishesNothing`). `gh workflow run preview.yml -f tag=v0.18.0-rc.1`; `internal/repodocs/release_train_test.go` pins the job order, the flags and the absence of every stable secret. - **`docs.yml`** — on a push to `main` that touches `docs/`, `mkdocs.yml`, `demo/`, `web/` (but not `web/e2e/`), `CHANGELOG.md` or the workflow itself (and by hand): builds the site with MkDocs Material (`--strict`, so a broken link fails it) and deploys it to GitHub Pages; on a PR it only builds. Only the deploy job holds the `pages` concurrency group; runs on `main` coalesce. - **`film.yml`** — called by `preview.yml` (and runnable by hand, which always renders): re-renders the films listed in `film/films.txt` when the hash of their inputs (`film/inputs.sh`) differs from the `Film-Tree:` trailer on the `readme-film` branch, and force-pushes every film's WebP there in one commit (D807, D1068). A render failure is blocking: `preview.yml` goes red, `release-train.yml` finds no successful candidate and the release gate skips. The `render` job runs the checked-out code read-only; the `publish` job holds `contents: write` and runs only `film/publish.sh` from `main`. A manual run of another ref is refused unless that commit is on `main` or under a tag. - **`demo.yml`** — called by `release.yml` after the image push (and runnable by hand for a given tag): builds `deploy/demo/Dockerfile` on that release's image and deploys it to the (retired) hosted MCP demo on Cloud Run through Workload Identity Federation (D751). Skipped while `vars.GCP_WIF_PROVIDER` is empty; `mcp-registry` does not wait for it. - **`hero.yml`** — called by `release.yml` as the `hero` job (and runnable by hand for a given tag, which always records): when the tag's `web/` tree differs from the one the README's hero was recorded from (`web/scripts/hero-needed.sh`), it runs `make hero` on the runner (headless, no GPU, deterministic, D790) and force-pushes the result as the single commit of the orphan branch `readme-assets` (`web/scripts/publish-hero.sh`), where the README reads it from `raw.githubusercontent.com`. `contents: write` on `GITHUB_TOKEN` is all it holds, it never pushes to `main`, and nothing waits on it: a failed recording never blocks a release. It restores no npm or browser cache (it holds the write token), so the browser is downloaded every run. - **`dependabot-automerge.yml`** — on Dependabot PRs: enables auto-merge for patch and minor rounds of Go modules and actions (D329); Docker image PRs are never auto-merged, because the `docker` job is not a required check. It does not arm auto-merge while the freeze is open (`scripts/freeze-open.sh`, D1180, D1384): a release candidate newer than the latest stable release exists. The major and docker rule is `scripts/dependabot-eligible.sh`, shared with `dependabot-arm.yml`. - **`dependabot-arm.yml`** — keeps Dependabot out of the freeze (D1180, D1384): one reconciling job on `workflow_run` of `release`, `preview` and `release-train` (completed, whatever the conclusion) and `workflow_dispatch`, no schedule. Freeze open (`scripts/freeze-open.sh`): it cancels auto-merge on the open Dependabot PRs; closed: it arms them (`gh pr merge --auto --squash`, same eligibility rule). Each PR's outcome goes in the job summary and any failure fails the job. - **`nightly.yml`** — the acceptance lanes that need no private machine, on `main` every night (cron, off the hour) and on `workflow_dispatch` (input `lanes`, default all); never on a PR or a push, and a dispatch on another ref fails the first step of every job but `rehearsal`, which has no step and is skipped by its `if`. `range` validates the `lanes` input (`scripts/nightly-lanes.sh`: names split on commas and trimmed, an unknown one fails the run naming it) and names the commits since the last green scheduled run (none: since the newest stable tag); only a run of every lane, scheduled or dispatched with the full set, may close the `nightly-red` issue, and only a scheduled run is that base, so a partial dispatch never clears a red night; every job also runs on the upstream repository only, not on a fork, and a scheduled run with none skips every lane and is green; `build` makes the release-shaped Linux binary with GoReleaser (no cache); `battery` runs `make e2e-nightly` (with `sops`, `age` and `python3`) and `test/smoke/http.sh` on it, `upgrade` runs `make e2e-upgrade` as the release PR's `upgrade-e2e` job does, and `quarantine` runs the quarantined tests outside the verdict, red only for a list that does not parse; both use that binary through `E2E_PREBUILT=1`, since `run.sh` otherwise rebuilds it. `rehearsal` calls `preview.yml` with `rehearsal: true` and the tag `v0.0.0-nightly.` (not a candidate's shape, so `release-train.yml` never counts it): the images built and smoked, the chart checked and packaged, the binaries built and their version smoked, and nothing logged in to, pushed, deleted, created or cached (no image, chart, release, tag or cache entry: the smoke builds write no `cache-to` in a rehearsal); it is the one job with `contents: write` and `packages: write`, because a caller must grant what the called jobs declare, and it has no step of its own. `report` is the only job with `issues: write` and checks out nothing: it prints the lane table in the run summary, opens (or comments on) the `nightly-red` issue with the red lanes, the range and a `Found-by: nightly` line, and closes it on the next green night. No job holds a secret or an environment and none calls a model; the top-level permission is `contents: read` and runs on `main` are never cancelled (`TestNightlyRunsOnScheduleReadOnlyAndHoldsNoSecret`). - **`security.yml`** — on push to `main`, on a PR touching `go.mod`/`go.sum`, `web/` dependencies or the workflows, weekly (Sunday 03:17 UTC) and by hand (D1020): `vulncheck` (govulncheck on the latest Go toolchain, so the finding is about our code and modules, and `npm audit` of the `web/` production dependencies, from the lockfile, high severity and up), `workflows` (actionlint and zizmor, `make lint-workflows`, with the accepted exceptions in `.github/zizmor.yml`) and, from `codeql.yml` (push to `main`, weekly and on demand, not on a PR), `codeql` (Go, JavaScript/TypeScript and the workflows). None is a required check. A red scan on `main` or on the weekly run opens one `vuln-scan` issue that carries the run link only; a real vulnerability goes through a private advisory (`SECURITY.md`). CodeQL's *default setup* must stay disabled in Settings → Code security, or the analysis is uploaded twice. Every action in the workflows is pinned by full commit SHA with its version in a trailing `# vX.Y.Z` comment, and `internal/repodocs/workflows_test.go` fails on any other reference; the release workflow downloads `mcp-publisher` at a pinned version and verifies its sha256, and the base images of both Dockerfiles are pinned by digest. A job that holds a write token restores no shared cache and installs nothing it has not hashed: no `cache:` input other than off (the setup actions need an explicit `cache: false`, they cache by default; `setup-node` v7 refuses that value and takes `package-manager-cache: false`), no `actions/cache` step, and an image cache (`type=gha`) only scoped to the run (`TestWriteTokenJobsRestoreNoSharedCache`); a Python tool is installed with `--require-hashes --only-binary=:all:` from a lock in `.github/pip/` (`docs.yml`, `make lint-workflows`; `TestPipInstallsRequireHashes`). Checkouts do not persist the token, and `release.yml` and `release-please.yml` grant write permissions per job, not to the whole workflow. Dependency updates (Go modules, action versions and Docker base images) come from **Dependabot** (`.github/dependabot.yml`, weekly, grouped PRs, with a 7-day cooldown, 14 for a major bump, so a compromised release is yanked before it is proposed). It keeps the SHA pins and their version comments current. Patch and minor rounds of Go modules and actions merge themselves through GitHub auto-merge once the required checks pass (`dependabot-automerge.yml`, D329; not during the freeze, D1180); a major bump and any Docker image bump wait for a maintainer. The frontend's npm dependencies are not on Dependabot's version rounds: `web/package-lock.json` is part of the bundle's provenance hash, so a lockfile bump without `make web` fails `test`. A security alert on them is fixed by hand — update the package in `web/`, then `make web` and commit both. The production ones are audited weekly by `security.yml`. **Repository settings no file can enforce** (maintainer, Settings): a tag ruleset for `v*` (only the maintainer creates, updates or deletes release tags); Actions → General → "Require actions to be pinned to a full-length commit SHA"; "Require approval for all outside collaborators" for fork-PR workflows; and CodeQL default setup disabled (above). **Deployment** to the maintainer's infrastructure happens outside the pipeline: the cluster is GitOps, and the image tag bump in the manifests repo is reconciled by Flux (D68). CI does not run `kubectl apply`: it would be redundant, would conflict with Flux's drift control, and would require a long-lived kubeconfig in the repo's secrets. **The Windows assets** ([D252](decisions/D252-windows-installs-through-install-ps1-not-winget.md)). The darwin and linux assets stay raw per-platform binaries, because that is what `install.sh` downloads and verifies against its line in `sha256sums.txt`; the two Windows assets are **zips** (`cartographer-windows-{amd64,arm64}.zip`, each containing `cartographer.exe`), which is what `install.ps1` downloads, verifies and extracts. Renaming them breaks every existing Windows `install.ps1 update`, the same way a rename breaks `install.sh`; `test/install/goreleaser_guard.sh` pins the shape. There is no package-manager submission for Windows: nothing in the release depends on a third-party review. Secrets required in the GitHub repo: `RELEASE_PLEASE_TOKEN`, `HOMEBREW_TAP_TOKEN`, `SECURITY_GATE_TOKEN` (read-only fine-grained PAT on all the owner's repositories: Dependabot alerts, Code scanning alerts, Repository security advisories, Pull requests; without it every train skips, D1123). `GITHUB_TOKEN` is provided automatically by Actions (for ghcr.io the `packages: write` permission declared in the workflow is enough). The end-to-end operator procedure (release, rollout verification, local client update) lives outside the repo, in the maintainer's local tooling: it contains details of the private deployment infrastructure. ### Verifying a release `sha256sums.txt` is published by the same job as the binaries, so it catches a corrupted download, not a replaced asset. Every release asset (binaries, Windows zips, SBOMs, `sha256sums.txt`) and the ghcr images and the Helm chart (`ghcr.io/beppetemp/charts/cartographer:`, the version without the tag's `v`) also carry a GitHub artifact attestation, signed keyless with this repository's `release.yml` identity. With the `gh` CLI: ```bash gh attestation verify cartographer-linux-amd64 --repo BeppeTemp/cartographer gh attestation verify oci://ghcr.io/beppetemp/cartographer: --repo BeppeTemp/cartographer docker buildx imagetools inspect ghcr.io/beppetemp/cartographer: --format '{{json .SBOM}}' gh attestation verify oci://ghcr.io/beppetemp/cartographer-surveyor: --repo BeppeTemp/cartographer docker buildx imagetools inspect ghcr.io/beppetemp/cartographer-surveyor: --format '{{json .SBOM}}' gh attestation verify oci://ghcr.io/beppetemp/charts/cartographer: --repo BeppeTemp/cartographer helm pull oci://ghcr.io/beppetemp/charts/cartographer --version ``` A modified copy of an asset fails the first command. The installers do not require `gh`: they keep verifying `sha256sums.txt` only, and attestation verification is for whoever wants the stronger proof (D1022). The SBOMs are the release assets `cartographer___.sbom.json`. `preview.yml` images and charts are not attested. The chart's `gh attestation verify` line has not been exercised on a published chart: no stable release carries an attested chart yet, so it is untested and may need correcting once one does. ### Internal mirrors An organization that keeps its own copy of Cartographer, for a network with no route to GitHub or to pin what its hosts run, mirrors three things, and verifies each once, where the copy is made, because the hosts that install from the mirror cannot reach the attestations. - **The repository.** A mirror is a copy of the tags as published, `LICENSE` and `NOTICE` kept intact (Apache-2.0); a copy whose code differs is a fork, and its binaries are no longer the ones the attestations name. Follow the release tags, not `main`: a tag is what a release was built from. - **The release assets and images.** The mirror pipeline downloads the binaries, `sha256sums.txt` and the SBOMs of a tag, runs `gh attestation verify` on each asset (§Verifying a release), and publishes only what passed. Images and the Helm chart are copied by digest (`crane copy` or `skopeo copy` of `ghcr.io/beppetemp/cartographer@sha256:…`) after `gh attestation verify oci://…`, and deployed by that digest, never by a tag the mirror could move. `sha256sums.txt` on the mirror catches a corrupted download, not a replaced asset, since it comes from the same place: the proof is the attestation the pipeline checked. A mirror that wants its hosts to check the copy themselves publishes its own signed list (the asset names, sizes and SHA-256 sums, signed with a key that lives only in the pipeline); Cartographer does not read or verify such a list, the host's own tooling does. - **Plugins.** A plugin is a git repository (`plugins.md`): mirror it like any repository and install it from the internal URL. Approval is per version and per tree, so the copy is approved like the original. What reads GitHub, and what to do on a host that cannot: - **The installers.** `install.sh` and `install.ps1` read the release list and the assets from GitHub only; the endpoint variables of `install.ps1` exist for its test suite. From a mirror, install by hand: download the binary and the mirrored `sha256sums.txt`, check the line for the asset (`sha256sum -c --ignore-missing sha256sums.txt`), place the binary on `PATH`, and run `cartographer upgrade-repair` as the installers do after a replacement (§Upgrades, schema migration, and repo growth). The Homebrew tap reads GitHub too. - **The update check.** Meridian and Compass ask GitHub for the newest release; where that fails the answer is "unknown" and nothing is printed, after a 3 s timeout per lookup. On hosts that never reach GitHub set `CARTOGRAPHER_NO_UPDATE_CHECK=1` (or `update_check: false` on Meridian, §Environment variables), so nothing is attempted. The override variables of `internal/updatecheck` are for tests and are not a way to point the check at a mirror. ### Client installation (`install.sh`, `install.ps1`) One channel per platform: `brew install beppetemp/tap/cartographer` on macOS (cask from the tap), `install.ps1` (repo root) on Windows, and `install.sh` (repo root) on Linux or on a macOS without Homebrew. The script downloads the latest `cartographer` binary from the most recent GitHub Release for the current platform: ```bash curl -fsSL https://raw.githubusercontent.com/BeppeTemp/cartographer/main/install.sh | sh curl -fsSL .../install.sh | sh -s -- update # updates if not already on the latest release curl -fsSL .../install.sh | sh -s -- uninstall ``` `uninstall` also lists the cron definitions `~/.config/cartographer/cron/{server,sync}.cron` among the leftover units. No package-manager dependency: pure POSIX `sh` needing `curl` or `wget` (GNU or busybox; a busybox wget without HTTPS support fails the download and says so) and a SHA-256 tool (`sha256sum`, `shasum`, `openssl` or busybox; with none it refuses to install), mapping `uname -m` to the asset (`armv7l`/`armv8l`, or an `aarch64` kernel with a 32-bit userland, get `cartographer-linux-arm`, built with GOARM=7; ARMv6 and ARMv5 are refused), verifies the checksum against `sha256sums.txt` (a manifest that cannot be downloaded, has no line for the asset or does not match stops the install: every release ships it, D1022), installs into `/usr/local/bin` (falling back to `~/.local/bin` if not writable, overridable with `CARTOGRAPHER_INSTALL_DIR`). See `docs/configurator.md` §Installation. **The newest release, never a candidate** (D1192). Both installers read one page of `/releases?per_page=100` (candidates stay until their version ships, D1384, so ten would not always reach a stable tag; the Go update check follows up to three pages) and take the first tag without a semver pre-release suffix (`v0.28.0-rc.20261111.1` is skipped), never judging by GitHub's `prerelease` flag, which every 0.x release carries; `cartographer update check`, `kb_status` `latest_version` and the Atlas history apply the same rule (`internal/updatecheck`). `CARTOGRAPHER_INSTALL_TAG=` installs that tag instead, a release candidate included, without reading the list and with the same mandatory checksum check (`curl -fsSL …/install.sh | CARTOGRAPHER_INSTALL_TAG=v0.28.0-rc.20261111.1 sh`; on Windows set `$env:CARTOGRAPHER_INSTALL_TAG` first). The installed version is compared with the tag verbatim, so a candidate installs over a stable binary, and `update` without the variable goes back to the newest stable release (a downgrade while the candidate's version is not out; schema migrations are not reverted). The procedure for trying a candidate is `CONTRIBUTING.md` §Releases. **`install.sh` is Darwin and Linux only, and says so where it matters.** Run from Git Bash, MSYS2 or Cygwin — where `uname -s` reports `MINGW64_NT-…`, `MSYS_NT-…` or `CYGWIN_NT-…` — it refuses with the `install.ps1` command instead of a generic "unsupported OS", because that string is the whole remedy. **`install.ps1` is the Windows counterpart, with the same contract** (D252): `irm https://raw.githubusercontent.com/BeppeTemp/cartographer/main/install.ps1 | iex` installs; `update` and `uninstall [-BinaryOnly]` are passed through `& ([scriptblock]::Create((irm …/install.ps1))) `. It resolves the newest tag through `/releases?per_page=10` like `install.sh`, skipping release candidates and honouring `CARTOGRAPHER_INSTALL_TAG` the same way, downloads `cartographer-windows-.zip` for the **OS** architecture (an x64 PowerShell on ARM64 still gets the native build), and refuses on a missing `sha256sums.txt`, a missing line for the asset, or a digest mismatch, exactly as `install.sh` does. It installs into `%LOCALAPPDATA%\Cartographer\bin` (`CARTOGRAPHER_INSTALL_DIR` overrides) and adds that directory to the **user** `PATH` and to the current process's, so under `iex` the command works on the next line. Windows refuses to overwrite a running executable but allows renaming it: an update moves the old `cartographer.exe` aside as `cartographer.exe.old`, drops the new one in, runs `upgrade-repair` with the same exit-code handling as `install.sh`, and deletes the leftovers once nothing holds them — so no `service stop` is needed around it. `uninstall` refuses while `%LOCALAPPDATA%\cartographer\tasks\serve.xml`, `sync.xml` or `tray.xml` exists, naming the teardown, and removes the `PATH` entry with the binary. The script never calls `exit` (under `iex` that would close the user's window) and sets its preference variables only inside functions, so the caller's session is left as found. It is exercised end to end by the `test-windows (install.ps1)` CI leg, under PowerShell 7 and Windows PowerShell 5.1, by `test/install/windows/run.ps1`. After replacing the binary the script runs `cartographer upgrade-repair` (D121, §Upgrades, schema migration, and repo growth) instead of a bare `service restart`: a running service is gracefully replaced and version-verified, a stopped or absent one is left alone, and the configured providers are re-synchronized. A pending provider sync (exit `1`) is logged without failing the update; an unverifiable running service (exit `2`) fails the `update` command **after** the new binary is in place. The generated Homebrew Cask runs the same command from its post-install hook, non-fatally: its source of truth is `.goreleaser.yaml` in this repository, never a hand edit in the tap. > The repo is public on GitHub: a plain `curl` works with no authentication. The script supports an optional `GITHUB_TOKEN` to avoid API rate limits on frequent runs (e.g. CI).