# Lineage spine (edge)

**ST:** `[ST:portfolio:docs:lineage]`  
**Stores:** KV `NEXUS_KV` + optional D1 `bluehand-nexus-lineage`

## Principles

- **Append-only** events at the edge — no silent mutation of portfolio repos.
- Edge lineage is **cache-only telemetry** — Supabase is canonical portfolio state; SigMem0 owns continuity substrate.
- Each deploy should emit a `lineage.append` with version + git head metadata.

## KV key layout

| Key pattern | Content |
|-------------|---------|
| `lineage:<ms>` | JSON event |
| `config:mcp` | Capability manifest (planned) |
| `state:version` | Deployed nexus version |

## Event format

```json
{
  "ts": 1718560000,
  "actor": "mcp",
  "op": "lineage.append",
  "payload": { "deploy": "bluehand-nexus-core@0.1.0", "git": "abc1234" },
  "nexus_version": "0.1.0"
}
```

## D1 schema

See `surfaces/nexus-core/schema/lineage.sql`.

## Query (operator)

```bash
# After deploy with Access session or local wrangler dev
curl -sS 'https://api.bluehand.dev/mcp/events?limit=10'
```

## Authority

Lineage visibility **≠** permission to act. See [authority-chain](../architecture/authority-chain.md).
