# memory care

Workspace installs include `.brigade/memory-care.example.json` as a legacy scanner wiring contract, and `brigade memory care init` writes the active gitignored `.brigade/memory-care.toml` scanner config.

## Commands

- `brigade memory care init` writes the active gitignored `.brigade/memory-care.toml` scanner config.
- `brigade memory care scan` scans local memory cards for stale, expired, undersourced, contradictory, missing-index-link, orphaned-card, oversized-card, missing-frontmatter, missing-reviewed, and missing-freshness issues without editing memory.
- `brigade memory care plan-fixes` builds a planning-only view for low-risk metadata repairs. It never writes card files.
- `brigade memory care backfill` bulk-repairs cards that predate the freshness convention by deriving `last_reviewed` from each card's last git commit date and proposing `fresh_until` from the configured stale window. Dry-run by default; `--apply` writes frontmatter without overwriting existing values and records a receipt under `.brigade/memory-care/backfills/`.
- `brigade memory care status` reports memory-care scan freshness and open refresh candidates.
- `brigade memory care doctor` reports memory-care config and queue health.
- `brigade memory care import-issues` routes the latest memory-care refresh queue into the work inbox. The queue resolves from `.brigade/memory-care/decay/refresh-queue.json`, falling back to the legacy `memory/cards/decay/` location.
- `brigade memory care closeout` writes closeout metadata marking the current refresh queue reviewed (or deferred with `--defer`); supports `--reason`.

```bash
brigade memory care init
brigade memory care scan
brigade memory care plan-fixes
brigade memory care backfill
brigade memory care backfill --apply
brigade memory care status
brigade memory care doctor
brigade memory care import-issues
brigade memory care closeout
```

Related work-inbox converters:

```bash
brigade work import memory-care
brigade work import memory-refresh
```

- `brigade work import memory-care` converts the refresh queue into imports. It defaults to `memory/cards/decay/refresh-queue.json` under the target, overridable with `--queue`.
- `brigade work import memory-refresh` converts memory-refresh candidates into task imports with card identity, reason, evidence summary, and acceptance criteria.

## How memory care fits doctor

`brigade doctor` checks installed bootstrap files against hard byte budgets so overgrown files fail before agents load truncated context. It also checks:

- `memory/cards/*.md` budgets
- `MEMORY.md` card links under `memory/cards/`
- memory-care config, scan freshness, open refresh candidates, and queue validity
- corrupt scan or refresh-queue JSON once the loop is wired

Missing memory-care state is advisory for fresh installs. Bootstrap truncation is a hard failure to prevent, not a cosmetic warning.

Memory care is local and explicit. Brigade writes scan reports and work imports, but it does not edit memory cards, run a scheduler, mutate canonical memory, or use LLM inference for contradictions.