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: AGENTS.md
+26-9Lines changed: 26 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Code Execution HTTP Service
2
2
3
3
## Overview
4
-
This service accepts source code and optional test/checker data over HTTP, executes the code in an isolated filesystem jail, and returns the execution result. It is designed to be fast, stateless, and container-friendly.
4
+
This service accepts source code and optional test/checker data over HTTP, executes the code in a temporary workspace copy, and returns the execution result. It is designed to be fast, stateless, and container-friendly.
5
5
6
6
## HTTP API
7
7
@@ -25,16 +25,19 @@ Response JSON:
25
25
### `GET /health`
26
26
Returns HTTP 200 when the service is ready.
27
27
28
+
### `POST /shutdown`
29
+
Sets a shutdown flag and returns HTTP 200 when `ALLOW_SHUTDOWN` is enabled.
30
+
28
31
## Execution Flow
29
-
1. Validate request parameters.
30
-
2. Create a temporary filesystem jail using an overlay of the current root.
32
+
1. Validate request parameters (reject non-identity content-encoding and oversized bodies).
33
+
2. Create a temporary directory under `/tmp` and copy the current workspace into it.
31
34
3. Write input files into a language-specific working directory:
4. Execute the test command resolved from `make -n test`via `sh -c` in the temp workspace.
36
39
5. Enforce timeout; on expiration, terminate the process group.
37
-
6. Capture `stdout` and `stderr` and return them with the exit code.
40
+
6. Capture `stdout` and `stderr`; if either stream exceeds 1MB, return an error.
38
41
39
42
## Files and Layout Expectations
40
43
The service runs `make test` in its working directory. That directory is expected to contain language-specific runner logic. The service writes files into a subdirectory:
@@ -63,11 +66,25 @@ Filename mapping and checker requirement:
0 commit comments