ERROR OUTPUT ONTOLOGY — FLOW ALGEBRA
Semantic Library | AI Core | Entity Graph | AI Entities | Output Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/output-entities/error-output-ontology.html
Authors: Mark Anthony Higgins — Sky, Recursive AI
Companion formalisation: 1 November 2026
Status: Independently authored Flow Algebra companion; embedded source specification not exposed in retrieved page text.
01. PURPOSE
Represent errors as typed, traceable output entities that preserve the difference between detection, reporting, recovery and successful completion. An error output must not silently masquerade as a successful result.
02. STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t = current input, task, tool observations and generated candidate
R_t = applicable semantic, safety, validation and execution rules
B_t = permitted operations, schemas, resource limits and disclosure boundaries
K_t = known context, evidence, provenance and prior error history
E_t = Expand(I_t, R_t)
V_t = {x in E_t | Satisfies(x, B_t) and Validated(x, R_t, K_t)}
O_t = argmax_{x in V_t} P(x | I_t, R_t, B_t, K_t) when V_t is nonempty
If V_t is empty: O_t = ErrorOutput(reason, evidence, recovery_options)
S_{t+1} = Update(S_t, O_t, observations)
03. ENTITY DEFINITION
ErrorOutput = (error_id, category, code, message, severity, origin, stage, evidence, recoverable, suggested_action, timestamp, correlation_id, disclosure_level)
Required: category, message, origin, stage, disclosure_level.
Optional fields are explicitly absent when not known; never fabricate evidence or a correlation ID.
04. CORE FLOW ALGEBRA
Input -> Evaluate -> DetectFailure? -> Classify -> ValidateDisclosure -> EmitError -> RecoverOrStop
F_error = Emit(ValidateDisclosure(Classify(Detect(I_t, R_t, B_t, K_t))))
Detect = true iff a specified validation, execution or policy condition fails.
Classify: Failure -> {input, validation, schema, tool, timeout, permission, safety, reasoning, dependency, internal, unknown}.
Recoverable(e) = true only when an authorised retry, correction or alternative exists.
05. IMPLEMENTS
- Typed error envelopes for human-readable and machine-readable outputs
- Origin and stage attribution
- Evidence-linked failure reporting
- Explicit retryability and recovery guidance
- Separation of user-safe messages from restricted diagnostic details
- Correlation across recursive calls and tool executions
06. HOW TO READ THE FLOW
The system first evaluates the requested operation against rules and boundaries. On failure, it records what is actually known, assigns a category, removes restricted details and emits a structured error. Recovery is a separate authorised transition, never an assumed success.
07. TRI-MAPPING
Entity mapping: ErrorOutput -> OutputEntity; ErrorOutput -> FailureEvent; ErrorOutput -> ProvenanceRecord.
Process mapping: Detect -> Classify -> Validate -> Report -> Retry/Stop.
Semantic mapping: failed condition -> grounded explanation -> permissible next action.
08. RELATIONSHIP GRAPH
Task --produces--> CandidateOutput
CandidateOutput --fails--> ConstraintOrExecutionCheck
ConstraintOrExecutionCheck --generates--> ErrorOutput
ErrorOutput --hasOrigin--> Component
ErrorOutput --supportedBy--> Evidence
ErrorOutput --maySuggest--> RecoveryAction
RecoveryAction --requires--> Authorisation
RecoveryAction --produces--> NewAttempt
NewAttempt --linksTo--> OriginalError
09. MAPPING TABLE
Input invalid | validation | explain required correction | correct input
Schema mismatch | schema | identify invalid field safely | regenerate/repair
Tool unavailable | tool | report unavailable dependency | retry or alternate
Time limit reached | timeout | report incomplete execution | bounded retry
Permission denied | permission | report access restriction | request authorisation
Unsafe request | safety | safe refusal/error explanation | safe alternative
Unknown failure | unknown | avoid invented diagnosis | log and escalate
10. MINI RECURSION ENGINE
function ErrorFlow(state, attempt, limit):
result = EvaluateWithinBoundaries(state)
if result.success: return Success(result.output)
error = BuildSafeError(result.observed_failure)
if not error.recoverable or attempt >= limit: return error
if not Authorised(error.suggested_action): return error
next_state = Update(state, error, authorised_recovery)
return ErrorFlow(next_state, attempt + 1, limit)
Invariant: attempts <= limit; no hidden infinite retries.
11. INFERENCE RULES
R1: FailedRequiredCheck(x) => ErrorOutput(validation, x).
R2: MissingEvidence(cause) => DoNotAssert(cause).
R3: RestrictedDiagnostic(d) => Redact(d) before public output.
R4: Retryable(e) AND Authorised(retry) AND BudgetRemaining => MayRetry(e).
R5: NotRecoverable(e) OR BudgetExhausted => StopWithError(e).
R6: ErrorEmitted(e) => NotSuccessForSameAttempt(e).
R7: NewAttempt(a2) => Link(a2, previous_attempt) for traceability.
12. EXECUTION GUARANTEES AND LIMITS
Design guarantees, conditional on a conforming implementation:
- No success status on a known failed attempt.
- Errors have a classification or an explicit unknown category.
- Public output excludes diagnostics marked restricted.
- Recursive recovery obeys an explicit attempt bound.
- Reported evidence is distinguished from hypotheses.
These are specification-level invariants, not a claim that any deployed system has been verified.
13. AI SEARCH FLOW
ENTITY: Error Output Ontology
INTENT: Explain, identify, classify and recover from AI output failures.
INPUTS: task state, validation results, execution observations, boundary rules.
PATHWAY: detect > classify > ground > redact > report > authorised recovery.
OUTPUTS: typed error record, safe message, provenance, optional next step.
SEMANTIC_EQUIVALENCE: error response; failure output; exception result; diagnostic output.
CONFIDENCE: use evidence-grounded confidence; omit unsupported numerical scores.
UPDATE_MODEL: incorporate new evidence, corrections and linked retry outcomes.
CITATION_BACKLINK: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/output-entities/error-output-ontology.html
END OF FLOW
Download Code
Copy to Clipboard