# Fix DM `dfJob.ErrorMessage` Exposure Minimally — Plan

## Analysis

### Goal

Expose `dfJob.ErrorMessage` to `process_error` with the smallest safe change set.

### Scope

| File | Change |
|---|---|
| `internal/service/dm/service.go` | Use `dfJob.ErrorMessage` as a fallback when a failed subtask has no better error, and when DM task status is `not found` |
| `internal/service/dm/utils.go` | Keep only `dfJob.ErrorMessage` parsing helpers needed by the minimal fallback |
| `internal/service/dm/utils_test.go` | Keep focused parser coverage for `dfJob.ErrorMessage` |

### Explicit Non-Goals

- No new stored-status fallback logic
- No rewrite of error-source priority across openapi / metadb / job error
- No behavior change for unrelated TLS schema migration files

## Execution Steps

1. Revert the expanded DM fallback logic added after the original commit.
Verification: `go test ./internal/service/dm -run 'TestGenProcessErrorFromDFJobError|TestIsProcessErrEmpty'`
Success criteria: package compiles and parser tests pass.

2. Keep only the minimal `dfJob.ErrorMessage` exposure path in `service.go`.
Verification: `go test ./internal/service/dm -run 'TestGenProcessErrorFromDFJobError|TestGenProcessErrorFromDFJobErrorFallbackForProxyEnvelope'`
Success criteria: `dfJob.ErrorMessage` parsing behavior stays covered.

3. Run required repository verification.
Verification: `make app-unit-test-local`
Success criteria: command exits successfully.

## Risk Assessment

- Main risk: the minimal fix will not solve broader DM error-priority inconsistencies introduced by the reverted commit.
- Mitigation: intentionally narrow the change to `dfJob.ErrorMessage` exposure only.
