# Health Debug — cabrain Brain Index & Taxonomy

> **Brain (namespace):** `healthdebug` on cabrain (`http://127.0.0.1:9310`, MCP binary `E:/Sites/ToGo/bin/brain-mcp.exe`, agent `healthdebug-agent`).
> This file is the human-readable table of contents for what the brain stores and the **classification convention** every session must follow so memories stay easy to read and find. Last reorganized 2026-09-01.

## How memories are classified

Every memory carries a `metadata` block with this schema:

```json
{
  "project": "healthdebug",
  "type": "<category — THIS is the field brain_details buckets by; always = category>",
  "category": "<one of the categories below (same value as type)>",
  "era": "greenfield | legacy | cross",
  "status": "current | superseded | stale",
  "surface": "backend | web | chrome | apple | android | desktop | wear | mcp | infra | cross",
  "module": "<optional: engine/module id, e.g. M1-hydration>",
  "doc": "<optional: docs/plan/NN-....md>",
  "title": "<short human title>",
  "tags": ["…"]
}
```

**The bucket field is `metadata.type`.** cabrain's `brain_details.types` breakdown and the `memory_recall` `types` filter group by `metadata.type`. The domain type is **not** settable via a top-level `type`/`memory_type` field on `retain` or `memory/edit` (those are ignored and everything defaults to the bucket `item`) — it is read from `metadata.type`. So **always set `metadata.type` to the category** (we mirror the same value into `category` for clarity). Setting only `category` leaves the memory in the `item` bucket.

**Writer convention (important):** the `retain` API does **not** accept metadata. So every write is two steps: (1) `retain` the content, (2) `memory/edit` the returned id to attach the `metadata` block above (with `type` set). Give every memory a **unique `source_ref`** (writing several with the same source_ref makes each supersede the last). See `[[cabrain-mcp-access]]`.

## Categories

| Category | What goes here |
|---|---|
| `core-opinion` | The two non-negotiable product opinions. |
| `spec` | Product/tech spec facts: stack, schema rules, colors, i18n, security model. |
| `architecture-decision` | Cross-cutting decisions (SSOT thin clients, one-plugin-per-engine, MCP surface). |
| `protocol-engine` | The 8 protocol engines and their parameters. |
| `platform-plan` | Per-surface PRDs (web, chrome, apple, android, desktop, mcp). |
| `divergence` | The five known legacy iOS/Android parity gaps. |
| `plan-corpus` | Plan index, phase sequence, current project status. |
| `open-question` | Decisions pending on Fady / design. |
| `legacy-reference` | Facts about the OLD codebase at `E:\Sites\healthdebug` (reference only). |
| `secret-inventory` | Inventory of legacy keys/credentials (values live in the secrets vault). |
| `ops-deployment` | Hosting, topology, supervisors, repo/infra facts. |
| `session-handoff` | Per-session build handoffs (see `docs/plan/13-execution-modules-and-sessions.md`). |
| `brain-index` | This meta record. |

`era`/`status` let agents prefer current greenfield knowledge over superseded legacy facts. Stale/superseded legacy memories were down-weighted in importance so current knowledge ranks first.

## Current inventory (by category)

**core-opinion**
- `2f40e8d4` Greenfield reset and the Two Core Opinions

**spec**
- `da3ba306` Tech stack, schema & migration rules, color spec, i18n
- `a47a8c58` Security, AI BYOK, IoT & future B2B

**architecture-decision**
- `12d436df` MCP as a first-class client surface
- `0af687c4` One ToGO plugin per protocol engine

**protocol-engine**
- `8e596547` The 8 Protocol Engines and their parameters

**platform-plan**
- `cb6cbede` Chrome extension PRD (Phase 3)
- `b0568a1a` Apple suite PRD (Phase 4)
- `dc755992` Android suite PRD (Phase 5)
- `1a4fbe5e` Electron desktop PRD (Phase 6)

**divergence**
- `bc51a2b1` Five known iOS vs Android divergences

**plan-corpus**
- `14ce45d3` Execution sequence and PAUSED status
- `097d26cb` Plan corpus index (docs 00–12)

**open-question**
- `6abe4493` Open decisions for Fady

**legacy-reference** (era=legacy; superseded/stale are down-weighted)
- `bb5929b5` Legacy reference map of the old code *(current)*
- `223b2069` Legacy API authorization invariants
- `6c56b3e5` Legacy auth & isolation invariants
- `6069cbb0` Legacy togo generator workarounds
- `9d7ee1e2` Legacy update-gate contract (app_releases)
- `a253da89` Legacy drinks registry DB resource
- `e2de4a77` Legacy analytics privacy line
- `ecfdb60e` Legacy i18n coverage trap
- `07866eb5` Legacy design-system SSOT & Material 3 mappings
- `430883a6` Legacy Android running on hardware
- `911186c7` Legacy landing-page i18n bugs
- `ebbcde2d` Legacy 6-engine protocol model *(superseded)*
- `d159cd6f` Legacy mobile sync contract *(superseded)*
- `1bf24939` Legacy repo branches & web identity *(superseded)*
- `1f5b5689` Legacy everywhere roadmap *(superseded)*
- `34310400` Legacy Android not buildable *(stale, contradicted by 430883a6)*
- `d298100f` Legacy issue backlog index *(stale)*
- `3568ed1f` Legacy outstanding-work list 2026-08-26 *(stale)*

**secret-inventory**
- `17712456` Legacy keys & credentials inventory
- `97145768` Legacy release-pipeline gaps & carry-forward

**ops-deployment**
- `5b21ff07` Legacy prod hosting topology (NPM & Cloudflare)
- `758cfd29` Legacy production topology & DB fork
- `dd1328d2` Legacy prod host process supervisor
- `afe1220b` Legacy healthdebug togo app bootstrap & ports
- `611a0896` Legacy public path & URL
- `8dfd69fe` Legacy repo moved from C: to E:

**Secrets vault** (not memories — values, retrieved via `secret_reveal`): `legacy-auth-secret-dev`, `legacy-auth-secret-production`, `legacy-postgres-password-production`, `legacy-android-keystore-password`, `legacy-backup-encryption-key`, `apple-asc-api-key-id`, `apple-asc-issuer-id`, `apple-developer-team-id`, `cloudflare-zone-id-fadymondy-com`.

## Removed 2026-09-01
- Test probe memory and a stale duplicate of the execution-status memory were soft-invalidated (forgotten).
