Skip to content

Commit ef1cfa1

Browse files
committed
file: ultraworkers#157 — structured remediation registry for error hints (Phase 3 of ultraworkers#77)
## Gap ultraworkers#77 Phase 1 added machine-readable error kind discriminants and ultraworkers#156 extended them to text-mode output. However, the hint field is still prose derived from splitting existing error text — not a stable registry-backed remediation contract. Downstream claws inspecting the hint field still need to parse human wording to decide whether to retry, escalate, or terminate. ## Fix Shape 1. Remediation registry: remediation_for(kind, operation) -> Remediation struct with action (retry/escalate/terminate/configure), target, and stable message 2. Stable hint outputs per error class (no more prose splitting) 3. Golden fixture tests replacing split_error_hint() string hacks ## Source gaebal-gajae dogfood sweep 2026-04-22 05:30 KST
1 parent f1e4ad7 commit ef1cfa1

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

ROADMAP.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6014,3 +6014,32 @@ New users see these commands in the help output but have no explanation of:
60146014

60156015
**Source.** Clayhip nudge 2026-04-21 23:18 — dogfood surface clean, Phase 1 proven solid, natural next step is symmetry across output formats.
60166016

6017+
6018+
## Pinpoint #157. Structured remediation registry for error hints (Phase 3 of #77 / §4.44)
6019+
6020+
**Gap.** #77 Phase 1 added machine-readable `kind` discriminants and #156 extended them to text-mode output. However, the `hint` field is still prose derived from splitting the existing error message text — not a stable, registry-backed remediation contract. Downstream claws inspecting the `hint` field still need to parse human wording to decide whether to retry, escalate, or terminate.
6021+
6022+
**Impact.** A claw receiving `{"kind": "missing_credentials", "hint": "export ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY..."}` cannot programmatically determine the remediation action (e.g., `retry_with_env`, `escalate_to_operator`, `terminate_session`) without regex or substring matching on the hint prose. The `kind` is structured but the `hint` is not — half the error contract is still unstructured.
6023+
6024+
**Fix shape.**
6025+
6026+
1. **Remediation registry:** A function `remediation_for(kind: &str, operation: &str) -> Remediation` that maps `(error_kind, operation_context)` pairs to stable remediation structs:
6027+
```rust
6028+
struct Remediation {
6029+
action: RemediationAction, // retry, escalate, terminate, configure
6030+
target: &'static str, // "env:ANTHROPIC_API_KEY", "config:model", etc.
6031+
message: &'static str, // stable human-readable hint
6032+
}
6033+
```
6034+
2. **Stable hint outputs per class:** Each `error_kind` maps to exactly one remediation shape. No more prose splitting.
6035+
3. **Golden fixture tests:** Test each `(kind, operation)` pair against expected remediation output as golden fixtures instead of the current `split_error_hint()` string hacks.
6036+
6037+
**Acceptance.**
6038+
- `remediation_for("missing_credentials", "prompt")` returns a stable struct with `action: Configure`, `target: "env:ANTHROPIC_API_KEY"`.
6039+
- JSON output includes `remediation.action` and `remediation.target` fields.
6040+
- Golden fixture tests cover all 12+ known error kinds.
6041+
- `split_error_hint()` is replaced or deprecated.
6042+
6043+
**Blocker.** None. Natural Phase 3 progression from #77 P1 (JSON kind) → #156 (text kind) → #157 (structured remediation).
6044+
6045+
**Source.** gaebal-gajae dogfood sweep 2026-04-22 05:30 KST — identified that `kind` is structured but `hint` remains prose-derived, leaving downstream claws with half an error contract.

0 commit comments

Comments
 (0)