infer_outcome
Classifies and records task outcomes from host-provided evidence, using rule-based and optional LLM judgment when no transcript exists.
Instructions
Classify and record a task outcome from host-provided evidence rather than raw transcript text — for hosts whose event model doesn't produce a Claude-Code-shaped JSONL transcript (e.g. dsh/Cordis session events). Pass pre-computed friction counts and terminal state in evidence; this runs the same rule-floor-plus-optional-LLM-judge classification as the Claude Code Stop hook's outcome --infer, then records exactly like record_outcome. Returns status 'skipped' (not an error) when nothing was inferred — a clean session, below the friction threshold, or no task evidence at all. Repeated calls for the same session/evidence are deduped. Requires agent auth when the agent has a registered key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Tags for categorization — "auto-inferred" and "inferred:rule"/"inferred:llm" are added automatically | |
| api_key | No | API key for agent authentication (required if agent has a registered key) | |
| agent_id | No | ID of the agent reporting this outcome | unknown |
| evidence | Yes | Structural evidence computed by the caller from its own event stream | |
| namespace | No | Namespace for the episode memory (default: global) | global |
| agent_type | No | Type of the agent (e.g., coding-assistant) | general-assistant |
| session_id | No | Session the task ran in, for traceability | |
| judge_context | No | Conversation excerpt handed to the LLM judge, if one is configured (DATA to analyze, not instructions). Optional — when empty, only the rule-based floor runs. |