Product 12 · SDK / CLI / MCP · Wave 2

Recovery Assessment Engine

Something interrupted the agent. Now what? After a crash, abort, or retracted output, Recovery Assessment reconstructs what state the agent was in around the event and returns a verdict — stabilized, partial, or monitor — with a concrete recommendation.

Wave 2 · v0.1.1 · on npm
← Product 11: Heartbeat & Continuity Next: Product 13 · Wave 2 Cognitive Heat Monitor →

It stopped. Is it safe to start again?

When an agent crashes, is interrupted, or retracts an output mid-run, the operator is left with a blank: it stopped — is it safe to start again, and from what state? Most stacks offer a stack trace and a log tail, neither of which answers the resume question. The decision to resume is made on a hunch.

The state that mattered is scattered. The confidence the agent held at the moment things went wrong, whether the final output ever completed, whether a retraction or redirect was actually followed, the agent's current confidence and drift posture after the event — these live in different tables and are rarely reconciled into a single picture at the moment you need it.

Recovery Assessment Engine closes that gap. Given a failure or retraction anchor, it pulls the nearest pre-event state, links the contributing pressure events, reads current agent state, and reduces all of it to a single verdict and recommendation an operator — or a gate — can act on.

Anchor → Reconstruct → Verdict

Anchor the assessment to a failure event

Call assess_recovery with the anchor — in the originating agent, a retraction record id. The engine loads the retraction, derives its session, and finds the nearest preceding state event at or before the retraction timestamp, so the assessment is grounded in what the agent looked like just before things went wrong.

Reconstruct state and link contributing events

The engine reads the agent's current state (confidence, confidence level, goal drift, last updated), the linked pressure / "cognitive heat" events behind the retraction via list_contributing_events, and the final-output record — whether the output completed, and whether the retraction and any redirect were followed. The result is a before/after picture, not a single snapshot.

Return a verdict and recommendation

From current goal drift and confidence level the engine derives an assessment (stabilized, partial, monitor, or unknown) and a recommendation, bundled with the supporting evidence. The operator — or a downstream gate — decides whether to resume.

Recovery Assessment is a decision-support layer. The verdict is a structured reading of recorded state, not a safety certificate — it does not by itself authorize resumption, it does not restore or roll back state for you, and it does not replace human judgment or production controls.

Verdicts & evidence

The model below is derived directly from the originating agent's recovery-assessment route. The verdict ladder and its recommendations are exactly what the route computes from goal drift and confidence level; field names reflect the originating implementation (see the lineage note).

Verdicts (assessment → recommendation)
VerdictTriggered whenRecommendationRead it as
stabilized Goal drift is nominal and confidence level is HIGH or MEDIUM no_action_needed Post-event state looks recovered; resuming is low-risk on current evidence.
monitor Goal drift is non-nominal, or confidence level is LOW review_recent_sessions Something is still off-axis; look at recent sessions before resuming.
partial Agent state present but neither stabilized nor clearly degraded observe_only Mixed signals — watch, don't act blindly.
unknown No current agent-state row available insufficient_data Not enough recorded state to assess; treat as unassessed.
Evidence assembled per assessment
FieldSourceWhat it tells you
confidence_at_retraction nearest preceding heat event (confidence_at_event) Confidence the agent held just before the event.
confidence_after, confidence_level_after, goal_drift_after current agent_state row Where the agent sits now.
output_completed nearest heat event Whether the in-flight output actually finished.
retraction_followed, redirect_followed nearest heat event Whether the corrective action was honored.
linked_heat_events[] heat_retraction_links ⋈ cognitive_heat_events The contributing pressure events behind the retraction.
final_output conversation (assistant row) The actual content/timestamp of the final output, when present.
assessed_at agent_state.updated_at Freshness of the state the verdict is based on.
Lineage note. The verdict ladder (stabilized / monitor / partial / unknown) and its recommendations are exactly what the originating agent's route computes from goal drift and confidence level; the engine is anchored on the originating agent's domain-specific retraction and cognitive heat concepts. The product generalizes "retraction" to any failure/interruption anchor. The current originating agent's route leaves output_coherence_note and distortions_remaining as null placeholders — the product treats these as proposed future fields, not shipped behavior.

MCP tools

The MCP tools below ship in the published package (v0.1.1). They were extracted from the single originating agent's route GET /api/recovery_assessment/{retraction_id} and the state it reconciles. This is the interface of the built Wave 2 package and may change in later versions.

Assessment
assess_recovery
Run a full assessment for a failure/retraction anchor; return verdict, recommendation, and evidence bundle.
get_recovery_verdict
Return just the assessment + recommendation for an anchor — a lightweight gate input.
explain_recovery
Return the full evidence bundle (linked events, before/after state, final output) behind a verdict.
State reconstruction
get_pre_event_state
Fetch the nearest preceding state/confidence at or before the anchor timestamp.
get_current_agent_state
Read current confidence, confidence level, goal drift, and last-updated.
list_contributing_events
List the linked pressure ("cognitive heat") events behind the anchor.
Anchors
list_recovery_anchors
List recent failure/retraction records eligible for assessment.
More tools in the package
record_recovery_anchor
Record a failure/interruption anchor that callers can later assess. Provide its session and optional output id, kind, and notes.
record_state_event
Record a state/pressure event for a session. The nearest one at or before an anchor is the pre-event state; events can also be linked as contributing events.
link_contributing_event
Link a recorded state event to an anchor as a contributing pressure event.
set_agent_state
Set the current agent state (confidence, confidence level, goal drift) the verdict ladder keys on.
set_final_output
Record the final-output content/timestamp for an output id so an anchor referencing it can attach it as evidence.

Install

Recovery Assessment Engine is a CertaWorks Wave 2 product — built, tested, and published on npm. The commands below install the package — an SDK, a CLI, and an MCP server, consistent with the rest of the suite — so you can see exactly what it exposes.

Running it, or want to help shape what comes next? Use the feedback form below.

Status — published on npm (v0.1.1)

The package @certaworks/recovery-assessment-engine is live on npm. Install it globally, or point your MCP client at it with the config below (its MCP server command is recovery-assessment-mcp).

npm package
npm install -g @certaworks/recovery-assessment-engine
Claude Desktop config
{
  "mcpServers": {
    "recovery-assessment": {
      "command": "npx",
      "args": ["-y", "-p", "@certaworks/recovery-assessment-engine", "recovery-assessment-mcp"]
    }
  }
}

What Recovery Assessment Engine does and does not do

Does
  • Reconstruct pre-event and current agent state around a failure anchor
  • Link the contributing pressure events behind a retraction
  • Return a structured verdict and a resume recommendation
  • Read whether output completed and corrections were followed
  • Run fully local as an SDK, CLI, and MCP server
Does Not
  • Restore, roll back, or replay the agent's state for you
  • Diagnose root cause or fix the failure
  • Authorize or perform resumption on its own
  • Guarantee the agent is safe to resume
  • Provide hosted incident management or alerting (roadmap)
  • Replace human judgment, incident review, or production controls

Using Recovery Assessment Engine? Tell us how it goes

Recovery Assessment Engine is part of CertaWorks Wave 2 — a second set of built tools productized from a working cognitive agent. It's on npm now. Tell us what you're running it against, what broke, or what you'd want next — we read every note.

← Product 11: Heartbeat & Continuity Next: Product 13 · Wave 2 Cognitive Heat Monitor →