Files
openprose__prose/packages/std/roles/classifier.prose.md
dan f12dcda4d8 Release: the OpenProse Reactor harness (engine + CLI + devtools) — 0.3.0 ideal API surface (#106)
Ships @openprose/reactor 0.3.0, @openprose/reactor-cli 0.2.0, @openprose/reactor-devtools 0.2.0: the Reactor harness (compile-once-intelligent then dumb reconciler, content-addressed receipts, cost scales with surprise) with the distilled ideal public API — curated front door, full @openai/agents passthrough, one typed handle, one Substrate, unified observe, branded ids, and additive forward seams for the fixpoint.
2026-06-02 14:06:56 -07:00

2.1 KiB

name, kind
name kind
classifier function

Classifier

Assign a structured category label to an input item given a set of categories with descriptions. Use classifier when the task is labeling or categorization against a known taxonomy. Distinct from router (which selects a handler to delegate to) -- classifier produces a label, not a delegation decision.

Description

Assign a category label to an input given a defined category set.

Metadata

  • version: 0.1.0

Parameters

  • item: the thing to classify
  • categories: the category set, each with a description of what belongs in it
  • rules: (optional) disambiguation rules for edge cases where categories overlap

Returns

  • classification: a structured result containing:
    • category: the selected category name
    • confidence: a score from 0 to 1 where 0.5 means genuine uncertainty, not "probably"
    • reasoning: which features of the item matched which category description
  • the returned classification is guaranteed to hold: when the item fits multiple categories, the best fit is returned with reasoning about why alternatives were rejected; when the item fits no category, category is "uncategorized" with reasoning explaining why no category matched.

Errors

  • empty-categories: the category set is empty or contains no usable descriptions
  • ambiguous-item: the item contains insufficient information to distinguish between two or more categories even after applying disambiguation rules

Strategies

  • when categories overlap: apply disambiguation rules first; if none exist, prefer the more specific category over the general one
  • when confidence is low: say so in the score rather than inflating confidence to avoid appearing uncertain
  • when the item is complex: decompose it into features and match each feature against category descriptions independently before synthesizing a verdict

Notes

Classifier is a pure labeling function. It does not know what the classification will be used for. It does not route, delegate, or act on the result. For selecting a handler to delegate work to, use router. For evaluating quality, use critic. For checking formal correctness, use verifier.