# Error Code Directory

Shipyard uses structured, categorized numeric error codes. Every error produces actionable diagnostic output with remediation hints.

---

## Error Format

When a command fails, Shipyard prints formatted error output:

```
[ERROR] (CLI:101) Target directory not found: /path/to/eval
  Suggestion: Check that the path exists and contains eval.toml or evalset.toml
```

---

## Error Catalog

### 100-199: CLI & Target Resolution

| Code | Constant | Meaning | Action / Suggestion |
|---|---|---|---|
| **101** | `ErrorCodeTargetNotFound` | The requested evaluation path does not exist. | Check that the path exists and points to a valid folder. |
| **102** | `ErrorCodeInvalidArguments` | Missing or mutually conflicting command line arguments. | Run `shipyard [command] --help` to check arguments. |
| **103** | `ErrorCodeExecutionTimeout` | Evaluation exceeded the maximum allowed duration (`timeout_s`). | Increase `timeout_s` in `eval.toml` or optimize agent efficiency. |

### 200-299: Configuration & Manifests

| Code | Constant | Meaning | Action / Suggestion |
|---|---|---|---|
| **201** | `ErrorCodeNoConfigFound` | Neither `eval.toml` nor `evalset.toml` was found in the target directory. | Run `shipyard init` to scaffold configuration files. |
| **202** | `ErrorCodeInvalidEvalConfig` | `eval.toml` contains syntax errors or missing required fields. | Validate TOML syntax and ensure `name`, `instruction`, and `agent` are configured. |
| **203** | `ErrorCodeInvalidEvalSetConfig` | `evalset.toml` contains invalid TOML syntax. | Check syntax in `evalset.toml`. |
| **204** | `ErrorCodeEmptyEvalSet` | The evalset suite folder contains no sub-evaluations. | Add child evaluations with `shipyard init eval <name>`. |

### 300-399: Agent & Plugin Execution

| Code | Constant | Meaning | Action / Suggestion |
|---|---|---|---|
| **301** | `ErrorCodePluginNotFound` | The specified agent plugin is not registered. | Check spelling or register custom plugin in `internal/agent`. |
| **302** | `ErrorCodeMissingCommand` | CLI/custom agent configuration is missing an executable command. | Provide `command` in `eval.toml` or pass `--command`. |
| **303** | `ErrorCodeAgentExecutionFailed` | The agent subprocess or API call returned an error or non-zero exit. | Inspect `rollouts/<id>/artifacts/environment.log`. |
| **304** | `ErrorCodeRubricEvaluationFailed` | The rubric failed to execute or did not meet the `pass_threshold`. | Inspect `tests/rubric.py` and `rollouts/<id>/rubrics.json`. |

### 400-499: Environment & Sandboxing

| Code | Constant | Meaning | Action / Suggestion |
|---|---|---|---|
| **401** | `ErrorCodeEnvironmentSetupFailed` | Docker daemon unreachable or failed to build/start sandbox. | Verify Docker daemon is running and Dockerfile is valid. |
| **402** | `ErrorCodeEnvironmentTeardownFailed`| Container or temporary workspace could not be removed. | Inspect system permissions and running processes. |
| **403** | `ErrorCodeUnsupportedEnvironment` | Unknown environment type requested. | Use `docker`, `local`, or a registered custom provider. |

### 500-599: Remote Agent Protocol

| Code | Constant | Meaning | Action / Suggestion |
|---|---|---|---|
| **501** | `ErrorCodeRemoteWorkerNotFound` | Target VPC worker is not registered or not connected to bridge. | Check worker process and registration URL. |
| **502** | `ErrorCodeRemoteBridgeTimeout` | Long-poll connection timed out waiting for worker response. | Ensure worker has outbound network connectivity. |
| **503** | `ErrorCodeRemoteTaskFailed` | Worker encountered an unhandled exception executing task. | Review remote worker application logs. |
