You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/challenges.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,3 +37,17 @@ Public routes are exposed through:
37
37
```
38
38
39
39
The master blocks `/internal/*`, `/health`, and `/version` from the public proxy.
40
+
41
+
## Proxy failure behavior
42
+
43
+
Platform proxy should preserve challenge-origin non-2xx responses when the challenge answered with a safe response. Transport failures, unreachable services, missing Kubernetes targets, DNS failures, and connection timeouts become safe 502 responses at Platform. Frontends should render unavailable copy and retry with backoff instead of showing raw text such as `Platform request failed with status 502`.
44
+
45
+
Operator checklist for challenge 502s:
46
+
47
+
1. Confirm ingress includes `/challenges` and routes it to Platform proxy.
48
+
2. Confirm the slug maps to a running challenge service.
49
+
3. Confirm challenge service health, service DNS, service port, and pod readiness.
50
+
4. In Kubernetes target mode, confirm target assignment, target health, and capacity state.
51
+
5. Check whether the response came from proxy transport handling or from the challenge origin. Only transport failures should be rewritten to 502.
52
+
53
+
Agent Challenge env and launch routes are public proxy routes, but Platform does not store their request bodies or per-submission env values. The allowed Platform paths are `GET/PUT /challenges/agent-challenge/submissions/{id}/env`, `POST /challenges/agent-challenge/submissions/{id}/env/confirm-empty`, and `POST /challenges/agent-challenge/submissions/{id}/launch`. The challenge-local paths are `GET/PUT /submissions/{id}/env`, `POST /submissions/{id}/env/confirm-empty`, and `POST /submissions/{id}/launch`. Only signed miner headers `X-Hotkey`, `X-Signature`, `X-Nonce`, and `X-Timestamp` are preserved for those routes.
Copy file name to clipboardExpand all lines: docs/miner/README.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,10 @@ GET /v1/registry
43
43
GET /challenges/agent-challenge/benchmarks
44
44
GET /challenges/agent-challenge/submissions/{id}/status
45
45
GET /challenges/agent-challenge/submissions/{id}/events
46
+
GET /challenges/agent-challenge/submissions/{id}/env
47
+
PUT /challenges/agent-challenge/submissions/{id}/env
48
+
POST /challenges/agent-challenge/submissions/{id}/env/confirm-empty
49
+
POST /challenges/agent-challenge/submissions/{id}/launch
46
50
GET /challenges/agent-challenge/leaderboard
47
51
```
48
52
@@ -59,6 +63,54 @@ For v1 lists, `/challenges/agent-challenge/submissions` returns the latest 100 s
59
63
60
64
The public proxy blocks `/internal/*`, `/health`, and `/version`.
61
65
66
+
## Agent Challenge Miner Env Actions
67
+
68
+
After Agent Challenge analysis allows an artifact, a master validator pauses it at public state `Waiting for miner action`. The exact challenge lifecycle is `analysis_allowed -> waiting_miner_env -> tb_queued -> tb_running`. The miner must either save env vars or confirm that no env vars are needed before launch.
69
+
70
+
Platform public paths, including the exact shorthand `GET/PUT /challenges/agent-challenge/submissions/{id}/env`:
71
+
72
+
```http
73
+
GET /challenges/agent-challenge/submissions/{id}/env
74
+
PUT /challenges/agent-challenge/submissions/{id}/env
75
+
POST /challenges/agent-challenge/submissions/{id}/env/confirm-empty
76
+
POST /challenges/agent-challenge/submissions/{id}/launch
77
+
```
78
+
79
+
Agent Challenge local paths behind the proxy, including the exact shorthand `GET/PUT /submissions/{id}/env`:
80
+
81
+
```http
82
+
GET /submissions/{id}/env
83
+
PUT /submissions/{id}/env
84
+
POST /submissions/{id}/env/confirm-empty
85
+
POST /submissions/{id}/launch
86
+
```
87
+
88
+
These requests are signed by the miner. Docs and examples must use fake placeholders only:
89
+
90
+
```http
91
+
X-Hotkey: <miner-hotkey>
92
+
X-Signature: <signature>
93
+
X-Nonce: <nonce>
94
+
X-Timestamp: <timestamp>
95
+
```
96
+
97
+
Env keys must match `^[A-Za-z_][A-Za-z0-9_]{0,127}$`. Each request can contain at most 64 keys, each value is limited to 16 KiB, and the total payload is limited to 128 KiB. `PUT /env` replaces the full env set. `POST /env/confirm-empty` is required when the agent needs zero env vars, so it does not stay stuck waiting for miner action. `POST /launch` locks env metadata and starts Terminal-Bench queueing.
98
+
99
+
Env values are write-only. Responses expose metadata only: keys, count, empty confirmation, lock state, and timestamps. Values are scoped to the master validator, encrypted at rest in Agent Challenge storage, injected into the Harbor/Terminal-Bench runtime, and cannot be retrieved after submission. Platform registry and Platform proxy do not store per-submission env values. Platform only forwards the allowed signed miner headers for these env and launch routes and keeps other sensitive caller headers stripped.
100
+
101
+
## Agent Challenge 502 Troubleshooting
102
+
103
+
A 502 under `/challenges/agent-challenge/...` is a safe unavailable state from Platform proxy transport handling. Frontends should render safe unavailable copy, not raw text such as `Platform request failed with status 502`.
104
+
105
+
Checklist:
106
+
107
+
1. Confirm ingress routes `/challenges` to Platform proxy. A route for `/v1/challenges` alone is not enough.
108
+
2. Confirm Platform proxy slug routing points at the Agent Challenge service and still blocks `/internal/*`, `/health`, and `/version`.
109
+
3. Confirm Agent Challenge health, pod readiness, service DNS, and service port from the Platform namespace.
110
+
4. In Kubernetes target mode, confirm target assignment, target health, and capacity state.
111
+
5. Separate proxy transport failures from challenge-origin non-2xx responses. Transport failures become safe 502 responses. Challenge-origin non-2xx responses should pass through as safe validation, auth, replay, rate-limit, or challenge error responses.
112
+
6. If the failing request is an env action, confirm the request uses `GET/PUT /challenges/agent-challenge/submissions/{id}/env`, `POST /challenges/agent-challenge/submissions/{id}/env/confirm-empty`, or `POST /challenges/agent-challenge/submissions/{id}/launch`, and includes only the signed miner header names above.
* Agent Challenge env and launch proxy routes preserve only `X-Hotkey`, `X-Signature`, `X-Nonce`, and `X-Timestamp` for signed miner actions.
14
15
15
16
## Production Policy Boundaries
16
17
@@ -43,6 +44,10 @@ Kubernetes broker runs attempt to delete the Job, NetworkPolicy, and mount Secre
43
44
44
45
Admin tokens, challenge tokens, kubeconfigs, production database URLs, per-challenge database URLs, registry credentials, and wallet material must come from files, environment variables, or Kubernetes Secrets. Don't store clear text secrets in registry metadata responses, docs, or evidence files.
45
46
47
+
Agent Challenge miner env values are per-submission secrets owned by the challenge, not by Platform registry. They are master-validator scoped, encrypted at rest by Agent Challenge, injected into Harbor/Terminal-Bench runtime, and cannot be retrieved after submission. Platform proxy forwards the request body to the challenge but must not parse, persist, log, registry-serialize, or evidence-capture submitted env values. Public responses can expose metadata only: env keys, count, empty confirmation, lock state, and timestamps.
48
+
46
49
## Failure Behavior
47
50
48
51
If a challenge fails health checks or `get_weights`, its contribution is zero for that epoch. The master doesn't auto-disable it.
52
+
53
+
For public challenge requests, transport failures at ingress, Platform proxy, challenge service discovery, or Kubernetes target routing become safe 502 responses. Challenge-origin non-2xx responses should pass through when they are safe. User interfaces should render unavailable copy and must not display raw text such as `Platform request failed with status 502`.
0 commit comments