Skip to content

Shared failed-task structured-error reader + BuildFailureError pattern task (4.4.0) - #223

Merged
ognjenkatic merged 3 commits into
masterfrom
CxODEV-1875-failed-task-error-reader
Aug 27, 2026
Merged

Shared failed-task structured-error reader + BuildFailureError pattern task (4.4.0)#223
ognjenkatic merged 3 commits into
masterfrom
CxODEV-1875-failed-task-error-reader

Conversation

@ognjenkatic

@ognjenkatic ognjenkatic commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Consumers of the structured_error task-output contract have been re-implementing the same two pieces: the descent through a failed execution to the task that actually failed, and the harvest of its declared classification. Multiple hand-maintained copies drift — this moves the machinery next to the contract it reads.

ConductorSharp.Engine

  • Util/FailedTaskStructuredErrorReader: TryReadAsync (null when the failure declared nothing) and ReadOrFallbackAsync (never null — UNCLASSIFIED + a caller-supplied sanitized generic reason on a miss; raw internals only ever go into the diagnostic message, never the reason). FindDeepestFailedTaskAsync is public for consumers that need the raw task. Registered in DI by the builder.
  • StructuredError.UnclassifiedCode — the reserved code becomes contract vocabulary.
  • ReadOrFallback keeps a declared message when present (4.3.0 semantics), else fills a workflowId/taskId/ref/reason locator.

ConductorSharp.Patterns

  • BuildFailureError worker (CSH_PATTERNS_build_failure_error), registered by AddConductorSharpPatterns: input { workflowId, genericReason?, fallbackReason? } → output { error: StructuredError }, for failure workflows that persist the classification atomically with the failed state. Registered under the shared task name: the task is a stateless read-only lookup, so multiple services polling one queue is safe by design (Conductor task domains remain the lever if poller isolation is ever needed).

No consumer specifics leak in: entity mapping and boundary reason texts stay with callers — the sanitized generic reason is a parameter; the library default is neutral.

Versions 4.3.0 → 4.4.0. Tests: 8 new (descent, FORK/JOIN skipping, fallback sanitization, message precedence) — 70/70 green. v3 backport (3.10.0) in a sibling PR.

🤖 Generated with Claude Code

@ognjenkatic
ognjenkatic force-pushed the CxODEV-1875-failed-task-error-reader branch from e2752ba to 1f066b4 Compare August 26, 2026 15:52
@ognjenkatic ognjenkatic changed the title CxODEV-1875: shared failed-task structured-error reader + BuildFailureError pattern task (4.4.0) Shared failed-task structured-error reader + BuildFailureError pattern task (4.4.0) Aug 26, 2026
@ognjenkatic
ognjenkatic force-pushed the CxODEV-1875-failed-task-error-reader branch 3 times, most recently from c97bad2 to fe78491 Compare August 26, 2026 16:51
…n task

Extracts the deepest-failed-task descent and the structured_error harvest
(UNCLASSIFIED fallback, sanitized reason, diagnostic message) that
consumers of the contract were each re-implementing. Engine ships the
reader (DI-registered); Patterns ships a generic BuildFailureError worker
for failure workflows. Boundary concerns stay with callers - the
sanitized generic reason is a parameter, not baked in.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ognjenkatic
ognjenkatic force-pushed the CxODEV-1875-failed-task-error-reader branch from fe78491 to 3fdb38f Compare August 26, 2026 18:15
An out parameter rules out async, so the method is synchronous and
blocks on the underlying Conductor call.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ognjenkatic
ognjenkatic force-pushed the CxODEV-1875-failed-task-error-reader branch from f14eaec to bb3de89 Compare August 27, 2026 07:15
…e naming

Consumers read the contract through FailedTaskStructuredErrorReader and
produce it by throwing StructuredErrorException; nobody outside the
assembly needs the serializer itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ognjenkatic
ognjenkatic merged commit 28e05fc into master Aug 27, 2026
1 check passed
@ognjenkatic
ognjenkatic deleted the CxODEV-1875-failed-task-error-reader branch August 27, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant