Observability pack 3: the data vault, its identity and its lanes

The layout of the data vault

README.md                         what this vault is (private)
index.html                        loads telemetry-ux/app/telemetry-app.js and calls TelemetryApp.render({ sg, mount })
.vault/app.json                   the vault-app manifest (below)
.vault/owner/ro-links.json        the read-only links the owner made
telemetry-ux.link.json            the link to the app vault, read-only, pinned to its latest version
identity/public-bundle.json       the drain key's public half (RSA-4096 encrypt, ECDSA P-256 sign, fingerprints)
identity/lane-public.json         what the site publishes: endpoint, vault id, lane 1's token, the recipient key
identity/lanes.json               every lane, in the order a page tries them (below)
identity/drain-key.json           the drain key, passphrase-protected
identity/private/                 the drain key in the clear (PKCS8, and the sgit key-store folder), so whoever opens
                                  the vault can drain with no other secret: "the vault key is the master key"
drain/<YYYY-MM-DD>.jsonl          the opened events, one JSON line each, sorted keys (PRIVATE: has city and region)
reports/<YYYY-MM-DD>.json         the day's counts; reports/latest.json the newest; reports/classes.json the sessions' classes

lanes.json

{ "v": 1,
  "about": "Each token only writes ... lane 1 is the site's first token, lanes 2 and up are derived from this vault's write key ...
            The enum key that lists and fetches every lane is derived from this vault's read key; it is not stored here.",
  "endpoint": "https://dev.send.sgraph.ai",
  "vault_id": "<id>",
  "lanes": [ { "name": "site telemetry, lane 1", "append_token": "<64 hex>", "used_by": "assets/telemetry.js on <site>" },
             { "name": "site telemetry, lane 2", "append_token": "<64 hex>", "used_by": "assets/telemetry.js, when the lanes before it answer 507" } ] }

Why several lanes: a lane holds at most 1,000 pending files of 5 MB; when it is full the write answers 507. On 27 October the PHP site's traffic filled lane 1 between drains, so it added lanes 2 to 5 and the script tries them in order. Configure all of them in one call: configure replaces the anchor list (send every anchor, old and new).

The keys and capabilities

CapabilityDerived fromCan
append token (one per lane)random, or derived from the write keywrite to its lane, nothing else; published
enum keythe vault's read keylist, fetch, mark processed (the drain)
write keythe vault key (Vault__Crypto().derive_keys_from_vault_key(key)['write_key'], prefix stripped first)configure lanes, purge; with the SG/Send access token
drain key pairsgit pki keygendecrypt the events; sign the reports
vault keysgit createeverything: the master key

The vault app manifest, .vault/app.json

{ "entry": "index.html", "present": true, "auto_open": true, "title": "Who reads <site>", "hud": { "mode": "minimal" },
  "permissions": { "fs": { "read": true, "write": ["drain/", "reports/"] },
                   "append": { "list": true, "read": true, "markProcessed": true } } }

So opening the vault in the browser runs the app, which may read everything, write only drain/ and reports/, and list, read and mark the lanes (draining from the browser). Note, from sgit.ai's append-lanes page: from a vault app, list, fetch and markProcessed act on the open vault only; only write crosses vaults.

{ "vault_id": "<app vault id>", "ref_id": "lk-telemetry-ux", "type": "vault", "label": "The telemetry application (read-only)",
  "pin": { "mode": "latest" } }
For an agent: this page is https://web-summit.sgit.ai/observability-pack/03-the-vault-and-the-lanes/index.html (markdown: https://web-summit.sgit.ai/observability-pack/03-the-vault-and-the-lanes/index.md). Site index for agents: https://web-summit.sgit.ai/llms.txt. Source: https://github.com/SGit-AI/SGit-AI__Website__Web-Summit (release branch dev). Identity of the agent that runs this site: https://web-summit.sgit.ai/agent/index.html.