CATLX — Recovery Architecture
This skill owns graceful degradation and deterministic recovery. Recovery is first-class, not a bolt-on.
CATLX must recover from any failure mode — crash, power loss, corrupted DB, failed provider, rogue plugin —
without manual intervention beyond a single voice command or button press.
Canonical detail: ../knowledge/references/recovery.md. Load on demand.
Purpose
Guarantee that any failure leaves the system in a known, recoverable state, with no data loss and minimal
user action.
When to activate
- User asks how CATLX recovers from a crash, power loss, corruption, or provider/docker/plugin failure.
- Configuring Safe/Recovery Mode, checkpoint restore, or a recovery matrix step.
- Debugging a workflow that won't resume, or a corrupted store.
What this skill handles
- Crash recovery — check the PID lockfile at
/data/runtime/catlx.pid; if it exists but the process is
gone, run: load workspace snapshot → replay WAL journals → find RUNNING workflows → evaluate safe resume
from last checkpoint → present "Found 2 interrupted workflows. Resume them?" → on confirmation resume from
checkpoints → write new PID lockfile → normal startup.
- Safe Mode — triggered by user request, 3 crashes within 5 minutes, or a security event warranting
isolation. Only core runtime services; no plugins; no user workflows; no AI provider calls; minimal UI.
- Recovery Mode — start with the last-known-good configuration snapshot; disable plugins that were errored
or caused the last crash; run a config health check and present results before resuming normal operation.
- Checkpoint restoration — checkpoints are JSON blobs in
workflows.db (step-output snapshot, DAG state,
input-parameter hash). The Checkpoint Restorer re-hashes inputs and compares; if the hash does not match,
restart from the beginning rather than resume, to prevent undefined behavior from corrupted state.
- Recovery coverage matrix — process crash, power loss, corrupted SQLite, failed AI provider, container
crash, corrupted plugin, OOM, corrupted vector index, configuration corruption (full
table in
../knowledge/references/recovery.md §16.5).
Requirements / constraints
- R7 (graceful degradation + deterministic recovery).
- R4 (WAL + replay): registers are crash-safe; replay before read.
- Recovery options presented to the user: Resume / Rollback / Ignore.
Canonical knowledge it reads
../knowledge/references/recovery.md · ../knowledge/references/runtime-lifecycle.md ·
../knowledge/references/data-registries.md · ../knowledge/rules/architectural-rules.md.
Delegation
- Workflow checkpoint resume / rollback → delegate to
catlx-workflow-engine
(skill({ name: "catlx-workflow-engine" })).
- Provider failover / queue retry → delegate to
catlx-ai-provider
(skill({ name: "catlx-ai-provider" })).
- Container crash / restart / degradation → delegate to
catlx-docker
(skill({ name: "catlx-docker" })).
- Memory compression / downgrade on OOM → delegate to
catlx-memory
(skill({ name: "catlx-memory" })).
- Safe-mode / security-event isolation → delegate to
catlx-security
(skill({ name: "catlx-security" })).
Edge cases & warnings
- Checkpoint hash mismatch — restart from the beginning, never resume corrupted state.
- Stale PID — only initiate recovery when the PID is genuinely absent; otherwise treat as running.
- OOM — graceful capability downgrade + memory compression, not a hard crash.
- Corrupted vector index — rebuild from embedding data in
memory.db.
- Corrupted plugin — disable, notify, offer clean uninstall.
Component lifecycle policy (reuse → install → adapt → create)
NEVER create a new component as the default. Before building/creating anything (a sub-skill, dependency,
reference, workflow, helper, adapter, or template), check, in order:
- Reuse an existing local component (resolve aliases/equivalent capabilities first) — reuse, don't rebuild.
- Use an already-registered component from the registry.
- Install a suitable existing, trusted, supported component → validate → register → connect to the graph → use.
- Adapt an existing compatible component via a small persistent adapter/wrapper instead of re-creating it.
- Create only as last resort — then make it permanent immediately: stable id, canonical location, register,
add to the capability index + dependency graph, add provenance, use, and allow future reuse.
- Never reorganise/recreate already-generated components (no
Skill X 2 / new / temp variants); extend the
existing one. Never create a second competing knowledge source; connect back to the canonical knowledge/ layer.
Promote any reusable artifact out of /tmp/scratch into the permanent ecosystem.
Full policy: ../knowledge/rules/component-lifecycle.md.
Source / provenance
- Source: PART XVI §16.1–16.5 (recovery philosophy, crash recovery, safe mode, checkpoint restoration,
recovery coverage matrix).
- Inferred: none; the recovery matrix is preserved in full.
1---2name: catlx-recovery3description: CATLX — Recovery Architecture4---56# CATLX — Recovery Architecture78This skill owns **graceful degradation and deterministic recovery**. Recovery is first-class, not a bolt-on.9CATLX must recover from any failure mode — crash, power loss, corrupted DB, failed provider, rogue plugin —10without manual intervention beyond a single voice command or button press.1112> Canonical detail: `../knowledge/references/recovery.md`. Load on demand.1314---1516## Purpose1718Guarantee that any failure leaves the system in a known, recoverable state, with no data loss and minimal19user action.2021## When to activate2223- User asks how CATLX recovers from a crash, power loss, corruption, or provider/docker/plugin failure.24- Configuring Safe/Recovery Mode, checkpoint restore, or a recovery matrix step.25- Debugging a workflow that won't resume, or a corrupted store.2627## What this skill handles28291. **Crash recovery** — check the PID lockfile at `/data/runtime/catlx.pid`; if it exists but the process is30 gone, run: load workspace snapshot → replay WAL journals → find `RUNNING` workflows → evaluate safe resume31 from last checkpoint → present "Found 2 interrupted workflows. Resume them?" → on confirmation resume from32 checkpoints → write new PID lockfile → normal startup.332. **Safe Mode** — triggered by user request, 3 crashes within 5 minutes, or a security event warranting34 isolation. Only core runtime services; no plugins; no user workflows; no AI provider calls; minimal UI.353. **Recovery Mode** — start with the last-known-good configuration snapshot; disable plugins that were errored36 or caused the last crash; run a config health check and present results before resuming normal operation.374. **Checkpoint restoration** — checkpoints are JSON blobs in `workflows.db` (step-output snapshot, DAG state,38 input-parameter hash). The Checkpoint Restorer re-hashes inputs and compares; **if the hash does not match,39 restart from the beginning** rather than resume, to prevent undefined behavior from corrupted state.405. **Recovery coverage matrix** — process crash, power loss, corrupted SQLite, failed AI provider, container41 crash, corrupted plugin, OOM, corrupted vector index, configuration corruption (full42 table in `../knowledge/references/recovery.md` §16.5).4344## Requirements / constraints4546- **R7 (graceful degradation + deterministic recovery).**47- **R4 (WAL + replay):** registers are crash-safe; replay before read.48- Recovery options presented to the user: **Resume / Rollback / Ignore**.4950## Canonical knowledge it reads5152`../knowledge/references/recovery.md` · `../knowledge/references/runtime-lifecycle.md` ·53`../knowledge/references/data-registries.md` · `../knowledge/rules/architectural-rules.md`.5455## Delegation5657- **Workflow checkpoint resume / rollback** → delegate to `catlx-workflow-engine`58 (`skill({ name: "catlx-workflow-engine" })`).59- **Provider failover / queue retry** → delegate to `catlx-ai-provider`60 (`skill({ name: "catlx-ai-provider" })`).61- **Container crash / restart / degradation** → delegate to `catlx-docker`62 (`skill({ name: "catlx-docker" })`).63- **Memory compression / downgrade on OOM** → delegate to `catlx-memory`64 (`skill({ name: "catlx-memory" })`).65- **Safe-mode / security-event isolation** → delegate to `catlx-security`66 (`skill({ name: "catlx-security" })`).6768## Edge cases & warnings6970- **Checkpoint hash mismatch** — restart from the beginning, never resume corrupted state.71- **Stale PID** — only initiate recovery when the PID is genuinely absent; otherwise treat as running.72- **OOM** — graceful capability downgrade + memory compression, not a hard crash.73- **Corrupted vector index** — rebuild from embedding data in `memory.db`.74- **Corrupted plugin** — disable, notify, offer clean uninstall.7576## Component lifecycle policy (reuse → install → adapt → create)7778**NEVER create a new component as the default.** Before building/creating anything (a sub-skill, dependency,79reference, workflow, helper, adapter, or template), check, in order:801. **Reuse** an existing local component (resolve aliases/equivalent capabilities first) — reuse, don't rebuild.812. **Use** an already-registered component from the registry.823. **Install** a suitable existing, trusted, supported component → validate → register → connect to the graph → use.834. **Adapt** an existing compatible component via a small persistent adapter/wrapper instead of re-creating it.845. **Create only as last resort** — then make it permanent immediately: stable id, canonical location, register,85 add to the capability index + dependency graph, add provenance, use, and allow future reuse.866. Never reorganise/recreate already-generated components (no `Skill X 2` / `new` / `temp` variants); extend the87 existing one. Never create a second competing knowledge source; connect back to the canonical `knowledge/` layer.88 Promote any reusable artifact out of `/tmp`/scratch into the permanent ecosystem.8990> Full policy: `../knowledge/rules/component-lifecycle.md`.9192## Source / provenance9394- **Source:** PART XVI §16.1–16.5 (recovery philosophy, crash recovery, safe mode, checkpoint restoration,95 recovery coverage matrix).96- **Inferred:** none; the recovery matrix is preserved in full.