bochencs commited on
Commit
aae6b0c
·
verified ·
1 Parent(s): 36e87e0

Refine multidomain tasks and episode deadlines

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. LICENSES/MIT-Python-Repair.txt +21 -0
  2. LICENSES/README.txt +2 -2
  3. MANIFEST.json +0 -0
  4. README.md +10 -16
  5. REGISTRATION.json +13 -22
  6. SHA256SUMS +52 -194
  7. SOURCE_LOCK.json +0 -0
  8. components/awm/Dockerfile +3 -16
  9. components/awm/NOTICE +1 -1
  10. components/awm/TASKS.json +0 -36
  11. components/awm/config.json +0 -11
  12. components/awm/private/tasks/awm-manufacturing-1-schedule/SOURCE.json +0 -11
  13. components/awm/private/tasks/awm-manufacturing-1-schedule/initial.db +0 -3
  14. components/awm/private/tasks/awm-manufacturing-1-schedule/original_api.py +0 -1524
  15. components/awm/private/tasks/awm-manufacturing-1-schedule/original_verifier.py +0 -104
  16. components/awm/runtime/awm/adapter.py +7 -4
  17. components/awm/runtime/awm/worker.py +3 -0
  18. components/awm/upstream/manufacturing_execution_system_1-gen_db.jsonl +0 -1
  19. components/awm/upstream/manufacturing_execution_system_1-gen_envs.jsonl +0 -0
  20. components/awm/upstream/manufacturing_execution_system_1-gen_sample.jsonl +0 -1
  21. components/loui/.dockerignore +2 -0
  22. components/loui/Dockerfile +12 -0
  23. components/loui/README.md +7 -0
  24. components/loui/SOURCE.json +21 -0
  25. components/loui/config.json +61 -0
  26. components/{mimo-code/source_bundle/runtime/code_runtime → loui/runtime/common}/__init__.py +0 -0
  27. components/{mimo-code/source_bundle → loui}/runtime/common/contracts.py +0 -0
  28. components/{mimo-code/source_bundle → loui}/runtime/common/models.py +0 -0
  29. components/{mimo-code/source_bundle/pristine-other/vendor/plaso/dfwinreg → loui/runtime/loui}/__init__.py +0 -0
  30. components/loui/runtime/loui/child.py +77 -0
  31. components/loui/runtime/loui/environment.py +159 -0
  32. components/loui/runtime/loui/executor.py +66 -0
  33. components/{mimo-code/source_bundle/runtime/code_runtime → loui/runtime/loui}/server.py +5 -5
  34. components/loui/tasks/expression-3/instruction.md +2 -0
  35. components/loui/tasks/incident-3/instruction.md +2 -0
  36. components/loui/upstream/LICENSE +21 -0
  37. components/loui/upstream/v3/README.md +59 -0
  38. components/loui/upstream/v3/execution.py +154 -0
  39. components/loui/upstream/v3/hard_tasks.py +101 -0
  40. components/loui/upstream/v3/server.py +85 -0
  41. components/loui/upstream/v3/tasks.jsonl +24 -0
  42. components/loui/upstream/v3/tasks.py +309 -0
  43. components/math/ADAPTATIONS.txt +2 -3
  44. components/math/Dockerfile +5 -0
  45. components/math/FILE_ALLOWLIST.json +0 -603
  46. components/math/MANIFEST.json +0 -58
  47. components/math/NOTICE.txt +3 -5
  48. components/math/SOURCE.json +9 -17
  49. components/math/TASKS.json +8 -86
  50. components/math/config.json +0 -105
LICENSES/MIT-Python-Repair.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Louis Grenard
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
LICENSES/README.txt CHANGED
@@ -2,8 +2,8 @@ Each upstream component retains its own license and attribution.
2
 
3
  PDBThink original tasks and checkers: Open Athena, Apache-2.0. The upstream source identifies the coordinates as wwPDB CC0 material. See Apache-2.0-PDBThink.txt and components/pdbthink/licenses/.
4
  TMax original task data: Ai2, ODC-BY 1.0. TMax-NOTICE.txt and the original author citations are retained. The upstream card also specifies research and educational use, the Ai2 Responsible Use Guidelines, and upstream terms for generated content. Those source requirements continue to apply. See ODC-BY-1.0.txt.
5
- MiMo original training tasks, task assets, and embedded Requests and Plaso code: the original Apache-2.0 licenses and associated notices retain their file-specific scope, as recorded in components/mimo-code/licenses/ and SOURCE.json.
6
- MathConstraint Costas, Ramsey, and Social Golfers: Viresh Pati and contributors, CC BY 4.0, obtained through amphora's pinned Harbor revision. The image also contains an unregistered RLVE round-robin alternative with its original MIT notice. See components/math/licenses/, NOTICE.txt, and SOURCE.json.
7
  AgentWorldModel: Zhaoyang Wang, Canwen Xu, Boyi Liu, Yite Wang, Siwei Han, Zhewei Yao, Huaxiu Yao, and Yuxiong He, CC BY 4.0. See CC-BY-4.0.txt, components/awm/NOTICE, and LICENSE_SCOPE.json.
8
  The project's existing MIT license applies to the new adapters and packaging documentation only. It does not replace or alter any upstream license.
9
 
 
2
 
3
  PDBThink original tasks and checkers: Open Athena, Apache-2.0. The upstream source identifies the coordinates as wwPDB CC0 material. See Apache-2.0-PDBThink.txt and components/pdbthink/licenses/.
4
  TMax original task data: Ai2, ODC-BY 1.0. TMax-NOTICE.txt and the original author citations are retained. The upstream card also specifies research and educational use, the Ai2 Responsible Use Guidelines, and upstream terms for generated content. Those source requirements continue to apply. See ODC-BY-1.0.txt.
5
+ MathConstruct Costas: Viresh Pati and contributors, CC BY 4.0, obtained through amphora's pinned Harbor revision. See components/math/licenses/, NOTICE.txt, and SOURCE.json.
6
+ Python repair tasks: Louistiti, MIT. Original tasks, generators and scoring code are preserved in components/loui/upstream/.
7
  AgentWorldModel: Zhaoyang Wang, Canwen Xu, Boyi Liu, Yite Wang, Siwei Han, Zhewei Yao, Huaxiu Yao, and Yuxiong He, CC BY 4.0. See CC-BY-4.0.txt, components/awm/NOTICE, and LICENSE_SCOPE.json.
8
  The project's existing MIT license applies to the new adapters and packaging documentation only. It does not replace or alter any upstream license.
9
 
MANIFEST.json CHANGED
The diff for this file is too large to render. See raw diff
 
README.md CHANGED
@@ -19,32 +19,26 @@ configs:
19
  path: tasks.jsonl
20
  ---
21
 
22
- This dataset contains 15 fixed training tasks served by five OpenEnv images.
23
 
24
  | Task type | Count | Source |
25
  |---|---:|---|
26
- | Software repair | 2 | MiMo |
27
- | Database and financial data processing | 3 | TMax |
28
- | Business API workflows | 1 | AgentWorldModel |
29
  | Manufacturing log processing | 1 | TMax |
30
  | Video analysis | 1 | TMax |
31
  | Physical parameter identification | 1 | TMax |
32
- | Mathematical constraint construction | 3 | MathConstruct |
33
- | Protein geometry | 3 | PDBThink |
34
 
35
- `tasks.jsonl` lists task IDs, original instruction paths, and pinned source revisions. Each ID represents one original task. Reset restores its original inputs or database. The preserved original checkers compute binary rewards of 0 or 1.
36
 
37
- `components/` contains runtime adapters, original tasks, inputs, checkers, and dependency records. `upstream/` preserves original Harbor materials. All images serve `schema.json`. Episodes use one persistent WebSocket connection at `/ws`. The shell environments use the pinned SDK's stateless HTTP inspection routes. Software, data, and mathematical tasks use `exec` and `finish`; business tasks use `call` and `finish`; protein tasks accept one `submit_answer` call.
38
 
39
- `REGISTRATION.json` lists the 15 registered training IDs and two unregistered alternatives available in the images. `SOURCE_LOCK.json`, `MANIFEST.json`, and `SHA256SUMS` record source provenance and file hashes. Licenses and attribution appear in `LICENSES/README.txt` and the component notices.
40
 
41
- Validate the local dataset:
42
-
43
- ```sh
44
- python3 -B validate_dataset.py
45
- ```
46
-
47
- Restore required source directories after downloading from Hugging Face:
48
 
49
  ```sh
50
  python3 -B prepare_source_tree.py
 
19
  path: tasks.jsonl
20
  ---
21
 
22
+ Eleven original training tasks served by five OpenEnv images.
23
 
24
  | Task type | Count | Source |
25
  |---|---:|---|
26
+ | Python repair | 2 | Louistiti/openenv-python-repair |
27
+ | Structured data workflows | 3 | TMax |
28
+ | Business API workflow | 1 | AgentWorldModel |
29
  | Manufacturing log processing | 1 | TMax |
30
  | Video analysis | 1 | TMax |
31
  | Physical parameter identification | 1 | TMax |
32
+ | Mathematical constraint construction | 1 | MathConstruct |
33
+ | Protein geometry | 1 | PDBThink |
34
 
35
+ `tasks.jsonl` records task IDs, original instructions and pinned sources. Each ID selects one original task. Reset restores its workspace or database; the Python repair tasks use the original seeded generator, with seed 0 by default. Original graders determine rewards. Python repair uses the original mean of behavior-group pass fractions; the other tasks use binary rewards.
36
 
37
+ `components/` contains runtime adapters, task inputs, original graders and dependency records. `upstream/` preserves the selected Harbor materials. All images serve `schema.json` through one persistent WebSocket connection at `/ws`. Shell tasks use `exec` and `finish`; Python repair and business workflows use `call` and `finish`; protein geometry uses `submit_answer` through `call`.
38
 
39
+ `REGISTRATION.json` records the 11 available task IDs. `SOURCE_LOCK.json` records provenance; `MANIFEST.json` and `SHA256SUMS` cover package files. Licenses and attribution are in `LICENSES/README.txt` and the component notices.
40
 
41
+ Validate a downloaded dataset and restore required empty source directories:
 
 
 
 
 
 
42
 
43
  ```sh
44
  python3 -B prepare_source_tree.py
REGISTRATION.json CHANGED
@@ -1,33 +1,24 @@
1
  {
 
2
  "selected_task_ids": [
3
- "candidate-1005-software-systems",
4
- "task_008667_2151f271",
5
- "construct-mc-ramsey-l4-s0",
6
  "awm-accounting-1-invoice",
 
 
 
7
  "task_000260_7b7cc286",
8
- "pdbthink-s09-70c0778d985e571dde37",
9
  "task_000663_dff2c340",
10
- "candidate-1001-security-forensics",
11
- "task_000056_f726766b",
12
- "construct-mc-social-golfers-l4-s0",
13
  "pdbthink-s09-7ba4aa076b6bb5633953",
 
 
14
  "task_005684_3c8594a3",
15
- "construct-mc-costas-array-l3-s0",
16
- "task_008998_ae4cbe72",
17
- "pdbthink-s09-772d9c283d4255fc0a11"
18
  ],
19
- "selected_count": 15,
20
  "skill_family_count": 8,
21
  "unregistered_available_tasks": {
22
- "math": [
23
- "construct-rlve-round-robin-scores-l3-s0"
24
- ],
25
- "awm": [
26
- "awm-manufacturing-1-schedule"
27
- ]
28
- },
29
- "not_in_primary_package": [
30
- "PortSim w04"
31
- ],
32
- "rule": "Only IDs in tasks.jsonl and the submission payload receive training steps. Additional image-supported original tasks are unregistered backups, not extra selected questions."
33
  }
 
1
  {
2
+ "selected_count": 11,
3
  "selected_task_ids": [
 
 
 
4
  "awm-accounting-1-invoice",
5
+ "incident-3",
6
+ "task_008667_2151f271",
7
+ "construct-mc-costas-array-l3-s0",
8
  "task_000260_7b7cc286",
 
9
  "task_000663_dff2c340",
 
 
 
10
  "pdbthink-s09-7ba4aa076b6bb5633953",
11
+ "expression-3",
12
+ "task_000056_f726766b",
13
  "task_005684_3c8594a3",
14
+ "task_008998_ae4cbe72"
 
 
15
  ],
 
16
  "skill_family_count": 8,
17
  "unregistered_available_tasks": {
18
+ "math": [],
19
+ "tmax": [],
20
+ "awm": [],
21
+ "pdbthink": [],
22
+ "loui": []
23
+ }
 
 
 
 
 
24
  }
SHA256SUMS CHANGED
@@ -1,37 +1,36 @@
 
 
1
  c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSES/Apache-2.0-PDBThink.txt
2
  9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94 LICENSES/CC-BY-4.0.txt
 
3
  c9d5f2c24789a4ee7502fd1426c6a2090ba766b24f20d0ef663d3b149b7466d3 LICENSES/MIT-adapters.txt
4
  11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b LICENSES/ODC-BY-1.0.txt
5
- 584119e89dde3125ead1266f2b0df8e5703aa39db498802d8c939324ffd0d8ce LICENSES/README.txt
6
  85da239bb4104a67e515dca538d1a4b345eed77c5d460fe76625bae905b431ed LICENSES/TMax-NOTICE.txt
7
- 88011d8f7ec7dd3059087b3e05b438ed9f45062bcdd043a42694dd39700aae9a MANIFEST.json
8
- 7162a7f9d49b938162356dc1e2a35d999bc79b3247324343b24ffe09e173fd66 README.md
9
- 458a593d295c61d4e72f48123e12a530396eba64bb1e98336c5df64cd1d1fbb6 REGISTRATION.json
10
- 14d4f724a7d088631ec18c95d1225162bddb4e69560d8661fc1b4b4321958079 SOURCE_LOCK.json
11
  9338fe69c7472bfb396c70489e4edf64d6a30cf696da9a4579d30c743414c529 components/awm/ADAPTATIONS.txt
12
- 1c26892b11e285d319e7ebc65f6cb275d38e5a4e5b581f9d022b026d72a3a3db components/awm/Dockerfile
13
  1ea6a4d0c80da30d5f658364aaef2664cf09f32da0bce23c448e1fc1e4c4a7a6 components/awm/LICENSE_SCOPE.json
14
- 4d91952ef79d73182302464db3d190b0427ac04754eb6b7f5b1e8ad739c0bb1c components/awm/NOTICE
15
  ae057f0e66d0e924e81f553e729148cd98161bf070283928ef4fb658e9cf3546 components/awm/SOURCE_CREDITS.json
16
- 4d97456d2794c1f347c47f3c32733294d83778165d99b923bae4ebeec15261b2 components/awm/TASKS.json
17
  65d41089191536d5940648213b09924ba93e55d92df0080634e16d13615fd1ac components/awm/awm-requirements.lock
18
- 1639f6ced0ae83cb1f87bb2737578602c1d410b2974ca2a889302e6a186b29fa components/awm/config.json
19
  3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58 components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json
20
  8ad2959536e44caba47bcbeca9018e47e7157783194d19b429aa8f22a60f4771 components/awm/private/tasks/awm-accounting-1-invoice/initial.db
21
  57362b907a2d454bbd29b95dfebb7d84207ce9d7e22533eaf54853ee4fb84990 components/awm/private/tasks/awm-accounting-1-invoice/original_api.py
22
  3cd0d63022caa900e32bda0b0d3ae5c9948ce3c195b77ba1906c7ddebea9c58b components/awm/private/tasks/awm-accounting-1-invoice/original_verifier.py
23
- 93eda02b7f5e0bd7aca37a2becc3fd20925472a8f33143171e4cc250564ff7b3 components/awm/private/tasks/awm-manufacturing-1-schedule/SOURCE.json
24
- 9a523ebee8c25ca61aa43075c6263e5d3b310d39157ebddabea4cb754e610a1c components/awm/private/tasks/awm-manufacturing-1-schedule/initial.db
25
- ff94326bc0d2a826a2a211512a617f0b9f5d91866b9c77ea17f6502f77b75aa6 components/awm/private/tasks/awm-manufacturing-1-schedule/original_api.py
26
- f0cd8fa0f1a17e76f8e87cfbe59a81645a750999f747be36b8d25d9244e5b8f1 components/awm/private/tasks/awm-manufacturing-1-schedule/original_verifier.py
27
  0078892ae5870080b3417677926bc64f4f87ba9e8110ff400f18954e361455fc components/awm/requirements.lock
28
  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/awm/runtime/awm/__init__.py
29
- 98218136805b95d2cc5e98e190ef79e6d0a9c2950d8f61844b4672d4e2dac651 components/awm/runtime/awm/adapter.py
30
  0638af1cd1c6a311ee85109143ec6a59646a5f3d41c4b30312526dec561da33d components/awm/runtime/awm/launch_service.py
31
  f47b0cc104a7a962fc932c4d3f3bb8bfcf1524dec049b9c2c33161924038b94e components/awm/runtime/awm/openenv_app.py
32
  484c7caeaa301b91f468a9e55a251a6b529c6f9d0f2e4951c9602071c40ebcea components/awm/runtime/awm/server.py
33
  b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f components/awm/runtime/awm/wire_client.py
34
- 081a6126e3d351e22e564c02f0d79522f4228994c3ff57f7074d968142fd4b1d components/awm/runtime/awm/worker.py
35
  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/awm/runtime/common/__init__.py
36
  b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/awm/runtime/common/contracts.py
37
  7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e components/awm/runtime/common/http_routes.py
@@ -40,17 +39,35 @@ b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/awm
40
  1cd23311c95c9919621b226c99dcab54faf815300c72cd542a394a5e69463a6e components/awm/upstream/accounting_1-gen_db.jsonl
41
  99f1883338fa6f4827cb9c6c4c9cf9222c28a2a9842202cbe524921921de3ae3 components/awm/upstream/accounting_1-gen_envs.jsonl
42
  28cf8d5611b0d63b9e17d0e991e328c2970cfef5595c08d084f2b1bad7a441fd components/awm/upstream/accounting_1-gen_sample.jsonl
43
- a50a67f6680c40b779f831067fe84d5633a10af60c6b488a4d6510fa818f45f3 components/awm/upstream/manufacturing_execution_system_1-gen_db.jsonl
44
- 882e62163cdd51b0dba39ceb6ad110f263001681e68961648a5acad2d9e20c28 components/awm/upstream/manufacturing_execution_system_1-gen_envs.jsonl
45
- fe9ae64f008a723f8ec10bc02a754a810243f0e97e82221b0ed730faf5cce63a components/awm/upstream/manufacturing_execution_system_1-gen_sample.jsonl
46
- 67afb4d3cf0def4023ec8a5320476a19e813d48fc4772a043e2ae991817928e3 components/math/ADAPTATIONS.txt
47
- f447268ed179fc7f665bc58d47fafa01816a052aed273b9a6175876e9eddf241 components/math/FILE_ALLOWLIST.json
48
- 4fa8e9eb8d691c26e8ecdc220af8681db0b5e112570942e14e2ce635232897af components/math/MANIFEST.json
49
- 73b544ecebc5d10e34e72f187bfdccf8ad66c9df4c37b03eeca7323a12401248 components/math/NOTICE.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  a037cf3ce617aa3e0216bf5e0677d229679bfffdd30dba9057b58bb413c39732 components/math/SDK_DEPENDENCIES.json
51
- a91ceb6c6b39e532fbef753034f1979d2364672d9bb6a45395c946dd8208befd components/math/SOURCE.json
52
- fe67677e50ff773b044feb9122e26a4dbb1dc647a5c88ba9db0adf952167104a components/math/TASKS.json
53
- ef82018da2f904b091c0c306fc4c574b90eca0f6e488a9c66f747be2681064c5 components/math/config.json
54
  9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94 components/math/licenses/MathConstraint-LICENSE
55
  10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e components/math/licenses/RLVE-LICENSE
56
  200b2ce93f2a5b9671165f9aea3cc4d89db995352c1e1e3db6d418262b058516 components/math/licenses/UPSTREAM_COLLECTION_LICENSES.md
@@ -60,7 +77,7 @@ b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/mat
60
  26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/math/runtime/common/models.py
61
  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/math/runtime/native_shell/__init__.py
62
  80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3 components/math/runtime/native_shell/actor_launcher.py
63
- 0b2d9a50ee5d97721a7ca24b728687a9bab474b33e788524118625ebc346ad0e components/math/runtime/native_shell/backend.py
64
  cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53 components/math/runtime/native_shell/environment.py
65
  31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e components/math/runtime/native_shell/guard.py
66
  db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b components/math/runtime/native_shell/launch_service.py
@@ -76,149 +93,12 @@ b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32 components/mat
76
  15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5 components/math/upstream/construct-mc-costas-array-l3-s0/tests/instance.json
77
  d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73 components/math/upstream/construct-mc-costas-array-l3-s0/tests/run.py
78
  a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e components/math/upstream/construct-mc-costas-array-l3-s0/tests/test.sh
79
- 56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c components/math/upstream/construct-mc-ramsey-l4-s0/environment/Dockerfile
80
- 9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92 components/math/upstream/construct-mc-ramsey-l4-s0/environment/instance.json
81
- dacf1d28faa912ac766cb9a8859b9a2d08940d2c52a9f8460c85ce0595a16c81 components/math/upstream/construct-mc-ramsey-l4-s0/instruction.md
82
- d2ea623dfdf1ab4864399d4231f17b7c6800cc73e1ad9d1c583816d149dca377 components/math/upstream/construct-mc-ramsey-l4-s0/task.toml
83
- 923f9e1258610a3cc3d5c2984b1855ed7341af13bc7592ff42aed0e0f91fc74d components/math/upstream/construct-mc-ramsey-l4-s0/tests/check.py
84
- 9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92 components/math/upstream/construct-mc-ramsey-l4-s0/tests/instance.json
85
- d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73 components/math/upstream/construct-mc-ramsey-l4-s0/tests/run.py
86
- a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e components/math/upstream/construct-mc-ramsey-l4-s0/tests/test.sh
87
- 56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c components/math/upstream/construct-mc-social-golfers-l4-s0/environment/Dockerfile
88
- cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73 components/math/upstream/construct-mc-social-golfers-l4-s0/environment/instance.json
89
- a638ef887b79167571086549b8d9438447d07b800772aac868b3e9a2e6899cd2 components/math/upstream/construct-mc-social-golfers-l4-s0/instruction.md
90
- fb08db6bba18360321c1ac959d0af5f655435579d5cb88864d924897254c7546 components/math/upstream/construct-mc-social-golfers-l4-s0/task.toml
91
- 9514518058e308fc2ae0ec0b8ce8a50993d5dfa09708ac9c3609e1edbbae126a components/math/upstream/construct-mc-social-golfers-l4-s0/tests/check.py
92
- cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73 components/math/upstream/construct-mc-social-golfers-l4-s0/tests/instance.json
93
- d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73 components/math/upstream/construct-mc-social-golfers-l4-s0/tests/run.py
94
- a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e components/math/upstream/construct-mc-social-golfers-l4-s0/tests/test.sh
95
- 56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c components/math/upstream/construct-rlve-round-robin-scores-l3-s0/environment/Dockerfile
96
- b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a components/math/upstream/construct-rlve-round-robin-scores-l3-s0/environment/instance.json
97
- db8d002ee820a699d6b7b819cb88ed583990529649255af446c22c98889ad370 components/math/upstream/construct-rlve-round-robin-scores-l3-s0/instruction.md
98
- d42f4225ae8850e6abe3e1b612b0da6f2e896322a3e9e00e6addb988a8f8332a components/math/upstream/construct-rlve-round-robin-scores-l3-s0/task.toml
99
- 930cd10836482427303a497cfa896934ccdc24116879eaa4c5d32a572d01353c components/math/upstream/construct-rlve-round-robin-scores-l3-s0/tests/check.py
100
- b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a components/math/upstream/construct-rlve-round-robin-scores-l3-s0/tests/instance.json
101
- d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73 components/math/upstream/construct-rlve-round-robin-scores-l3-s0/tests/run.py
102
- a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e components/math/upstream/construct-rlve-round-robin-scores-l3-s0/tests/test.sh
103
- 192dcb50c9e90d1d46170b9f4c0f17578d58cbb586445e5bcf60e2b8c092c915 components/mimo-code/README.txt
104
- a037cf3ce617aa3e0216bf5e0677d229679bfffdd30dba9057b58bb413c39732 components/mimo-code/SDK_DEPENDENCIES.json
105
- 1d8034fd8f402d3cfbcb68e6a666ffb8b10f2374d1f2dfaa623a91a320fd7ada components/mimo-code/SDK_RUNTIME.json
106
- 150edf38d6ba4b6ba26ec991f256f7e2630935b3951a16e8688d8d86ad1eac85 components/mimo-code/SOURCE.json
107
- cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 components/mimo-code/licenses/plaso-Apache-2.0.txt
108
- 09e8a9bcec8067104652c168685ab0931e7868f9c8284b66f5ae6edae5f1130b components/mimo-code/licenses/requests-Apache-2.0.txt
109
- 54af5390562f313695c706cc01071a28928f25025f50306c02f3f519faaf5b49 components/mimo-code/source_bundle/Dockerfile
110
- 5306cc468a50dae571cb5c6a6d03ad28a0c6b1cde765730831aa1b3b2e3996e3 components/mimo-code/source_bundle/config.json
111
- 836618cb7e01e236878d367272157e4be6a31d538bf8b9f8cc9ed630aac04482 components/mimo-code/source_bundle/openenv-requirements.lock
112
- fdc4026cc5e1301ffb6bdfd12f61c9d1591909ddf05501b43ef6ade47d01641f components/mimo-code/source_bundle/pristine-other/Dockerfile
113
- 34adb79a4013c52a9e46791281763841a36fe1f500beb8a2be547e5975af0526 components/mimo-code/source_bundle/pristine-other/requirements-shared.txt
114
- cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 components/mimo-code/source_bundle/pristine-other/vendor/plaso/LICENSE
115
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/mimo-code/source_bundle/pristine-other/vendor/plaso/dfwinreg/__init__.py
116
- 082bb8b1c061c3ce920949abc37528ec77e292758ce68423657cd5d2d87897a0 components/mimo-code/source_bundle/pristine-other/vendor/plaso/dfwinreg/errors.py
117
- b92752fa2da3ff17c53e164eccf8a91905ed6fb71551c531d7927ff0a9dab271 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/containers/events.py
118
- 22061b1f10090bbecda41391007c7e2295baaf4f1f4797b5babff82bd43a5387 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/containers/interface.py
119
- 0d84bc47cd82f1d57e884c918b5dd75d81bbc1a80380890b3a54edd420e0f22c components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/containers/manager.py
120
- 69aa7937cb245410683d37f42ceebaff039d2b5796065f4c0c4618290ffb4a5e components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/containers/time_events.py
121
- 1be04adf9ae090fa68333eb26f087e4d09edecb843340404e9b51bedf32a94aa components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/containers/windows_events.py
122
- a11900d7bc98b80e318e0967f0218aca2e304d328954da20139fc342bb2fb697 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/lib/definitions.py
123
- e18590112b9db1dfcc0c4df44750678cc886134452e1619248a2ef07544d7143 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/interface.py
124
- ff2e0bed3543e230ff9d98b044356199e9419b99cef7faa997d21811d598ab4a components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/mediator.py
125
- 88a70819243e00cf6557c40c1ebe21eb87ee06272e69c18d7c93ea6c5baac0b4 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/plugins.py
126
- f5f747e98a017ebd019ddba45c36ea73c5de1f3b48d3238cec8cb44b39919793 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/winreg_parser.py
127
- e026e975023b44b9c99dfb22b1d4d4b99d396019aed592d08bf2adc636ccc069 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/winreg_plugins/default.py
128
- 2ef4e78f16ef5a1c9850aa08615737d01e2953d837dbf4692d9be18f205439e2 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/winreg_plugins/interface.py
129
- 4711ac18d81ff23cf782b870861ef5f841a14cbfccc23fcaa7d995d6df04ee7e components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/winreg_plugins/network_drives.py
130
- b33bf0efb841b2d19941aa2dc1b517fac09b60dc50f2c01841231cd04195ad27 components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/winreg_plugins/services.py
131
- 956ba2a62fdb6860f71a345b4bdeffdda1b90de618f2fc51a29a7ebea829641a components/mimo-code/source_bundle/pristine-other/vendor/plaso/plaso/parsers/winreg_plugins/timezone.py
132
- 84d16f933ae230cb9c53ec4d0addc397380705017079ee8c5430465b1035a6fb components/mimo-code/source_bundle/pristine-other/vendor/plaso/pytz/__init__.py
133
- ad2fab71ce6887529d53aaedaf50b793a769e8ac34c596342e00491434a6ebd3 components/mimo-code/source_bundle/pristine-other/vendor/plaso/requirements.txt
134
- 9c3a29f59a514add92378b7885a35b73a9695631fcc27849ed198fe481f33fc6 components/mimo-code/source_bundle/pristine-other/vendor/plaso/setup.py
135
- 67aa9abe820736c53b272f93e86569d3aa7ef113fcff02696ebcd34185d991c5 components/mimo-code/source_bundle/pristine-other/vendor/plaso/test_data/regf/100_sub_keys.hiv
136
- 370cdc7037cd01aeeae15dd0e86a44239138425372efd2cf35f066c1fbb36f50 components/mimo-code/source_bundle/pristine-other/vendor/plaso/test_data/regf/corrupt_sub_key_list.hiv
137
- 4e7e2bb2ff10353a6b8ec54b11ed0420b8ab6c45483c7e77e761accb310acd75 components/mimo-code/source_bundle/pristine-other/vendor/plaso/tests/parsers/winreg_plugins/interface.py
138
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/mimo-code/source_bundle/pristine-other/vendor/plaso/tools/__init__.py
139
- 5906eb2e26a100d1b993cc982ebdc7cbb18d74788a70f3446e8e7a50c04b111d components/mimo-code/source_bundle/pristine-other/vendor/plaso/tools/run_case.py
140
- fdc4026cc5e1301ffb6bdfd12f61c9d1591909ddf05501b43ef6ade47d01641f components/mimo-code/source_bundle/pristine/Dockerfile
141
- 34adb79a4013c52a9e46791281763841a36fe1f500beb8a2be547e5975af0526 components/mimo-code/source_bundle/pristine/requirements-shared.txt
142
- 8d76dedce7d7a38ea383d8db3784f3ab808648a3bb19d613efa6e01088daea49 components/mimo-code/source_bundle/pristine/tools/run_regression.py
143
- 09e8a9bcec8067104652c168685ab0931e7868f9c8284b66f5ae6edae5f1130b components/mimo-code/source_bundle/pristine/vendor/requests/LICENSE
144
- 345f26b9f691435e39d0eb6f7f4150a390f43175b22f8d61ac95e7f2827f0a77 components/mimo-code/source_bundle/pristine/vendor/requests/pyproject.toml
145
- 80534322a1a3167d8775829ee220a6acf4fe455f3f778c4b8e94bcf7fadfa0b5 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/__init__.py
146
- abba90670b0370a3dc40d97c2dea46a35d4bec941ff10d7c3cf3098ef04a17f9 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/__version__.py
147
- 4c7d8d132c9898fc7d715e473f3ac74785ddc4ab96d2c9240f87835dc6d981ff components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/_internal_utils.py
148
- d06df79f54a279c0cc3faec596c446246d5ad14edfd529eb328defbd62a44a89 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/_types.py
149
- cc9b1b02694fee0353481fbad84fe3ddbedec4441dba54df7914c63f2aa85937 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/adapters.py
150
- 4d15480ac046f089209798e8650476ef4a28ebe6f81b400758f8ef42ec6b5509 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/api.py
151
- fdc8bb34a8a5a088b169ca13277d107b0bc94ee63ed5e89dd4f5569d9b2bb04c components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/auth.py
152
- fd9c6b83359cef90ff6c4eeeab8dcc2388da382ebca7d00a499b3c0b434a87e4 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/certs.py
153
- 4a51c5ab07b015c298d6ea69d71502979cd3ed6b935d88e4433ce5341dacf584 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/compat.py
154
- 05d12b965c76f229803e17aef1c9969d712e4f4d0f6a06c05e0a47212fd5b417 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/cookies.py
155
- c5e18f3352454968e337bb3056f0867df2f37c0a0d2c1a77dc05e7e0b3c0411b components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/exceptions.py
156
- e5845e93980b2e25be418fb7fe0b8e6e999fef8f84afc5a43f4546efdc24691f components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/help.py
157
- ebd8a02475d31a0e473a8f553e9501ff43645b9563885ad52844e7a63f0d76ab components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/hooks.py
158
- 557962f283e48bb20604129509979803687c9bf8b43e5d0f38e8d5037a5c2131 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/models.py
159
- fe0d2067af355320252874631fa91a9db6a8c71d9e01beaacdc5e2383c932287 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/packages.py
160
- e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/py.typed
161
- 3d2089736ced93b2b405624a943f866d22652b17df06a85eb010f86272fc3e7d components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/sessions.py
162
- 1950f47c89cf18019787e07d8ce48f66d6b38e622f7d94d70a90247fee6c040e components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/status_codes.py
163
- ba9460c39078f25e6f1d2a24ac941ac6f8d2ee97197fa8c8d0c262d8a1e67a02 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/structures.py
164
- b879cb3f671cf1c28e8ff9b2b02151bcdb8974b4820a514cfdd1f5a038443cd2 components/mimo-code/source_bundle/pristine/vendor/requests/src/requests/utils.py
165
- ac7f253daae0905f9b3dec647cae736bb3c090185aa373b30b3e851599e5342c components/mimo-code/source_bundle/pristine/vendor/requests/tests/__init__.py
166
- 6d65ffb582519f80a66c5d1ef571e3c33395a199f9e67fcb500c6ad2d7800e0a components/mimo-code/source_bundle/pristine/vendor/requests/tests/conftest.py
167
- 91ee3b9532c67d6fd533f9f8a7e910a63eb5a0558e569cc2ac20d2c047a5369d components/mimo-code/source_bundle/pristine/vendor/requests/tests/test_requests.py
168
- 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/mimo-code/source_bundle/runtime/code_runtime/__init__.py
169
- 80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3 components/mimo-code/source_bundle/runtime/code_runtime/actor_launcher.py
170
- 688cedd88a85a7d558b7cfd8c8fa3d69b0a187bf218b6bd61e6fe3613f34fa36 components/mimo-code/source_bundle/runtime/code_runtime/backend.py
171
- 4ebf25639af6ccbe8faad346be45e2b5dd778e659b2a34faec51b6ad62e68102 components/mimo-code/source_bundle/runtime/code_runtime/code_child_launcher.py
172
- ef8546819e3ece598ae9032254beb550f030f703f486bbfa9fe754a321f85430 components/mimo-code/source_bundle/runtime/code_runtime/environment.py
173
- 31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e components/mimo-code/source_bundle/runtime/code_runtime/guard.py
174
- e5df97cf4e32894de79f90ea5f70074fd83cdcfe191a1c013af737fbbad02025 components/mimo-code/source_bundle/runtime/code_runtime/launch_service.py
175
- 1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e components/mimo-code/source_bundle/runtime/code_runtime/process_scope.py
176
- 075d79e99e1db147aa811e0e4ec3468392521f49f62a64d9b4823852dac7d2c0 components/mimo-code/source_bundle/runtime/code_runtime/server.py
177
- 498d6a11a28f849e75b62e3e543f9b29cd36dfdf2c7e646c87bc3cbec0e8d8bf components/mimo-code/source_bundle/runtime/code_runtime/trusted_checker.py
178
- 6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465 components/mimo-code/source_bundle/runtime/code_runtime/verifier_launcher.py
179
- b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af components/mimo-code/source_bundle/runtime/code_runtime/wire_client.py
180
- 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/mimo-code/source_bundle/runtime/common/__init__.py
181
- b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/mimo-code/source_bundle/runtime/common/contracts.py
182
- 7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e components/mimo-code/source_bundle/runtime/common/http_routes.py
183
- 26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/mimo-code/source_bundle/runtime/common/models.py
184
- 6d55a1b1cb882a951518a74f06dbd70bdb845a3669b4ad0210e4aff0c56d82a3 components/mimo-code/source_bundle/source-other/instruction.md
185
- 88538e9f67364bbdea3a753ba3a6cb3cc66ca998e2e6ffe2e92190e36125f1bd components/mimo-code/source_bundle/source-other/task.toml
186
- 336149b10b45d03b7774ba589d984e9663135cfc660f3a133fc482a8716d0e3a components/mimo-code/source_bundle/source-other/tests/anti_hack_guard.py
187
- 5ceff9d56caaa93b84f9d8bdc55009efca27f7e3e0fe9f6e7fc18e2f6aca9b1b components/mimo-code/source_bundle/source-other/tests/fixtures/expected.json
188
- dcd500a72c68f04bd5d7b9faadde661274cb2648fb1d064b79b868908463b756 components/mimo-code/source_bundle/source-other/tests/fixtures/pristine_env_manifest.json
189
- 8152f7541a6105f16a8da923f375093607fddf1adba35c816eab455080af061e components/mimo-code/source_bundle/source-other/tests/task_test.sh
190
- 5034fb5c341b758a915ae4e59abbc5c27fb39894ff37b0e8b02233b3156a1c35 components/mimo-code/source_bundle/source-other/tests/test.sh
191
- 266d7ff9688685eef6ee0fbe7a35935dfe1fed615604843d175a9369adb6a279 components/mimo-code/source_bundle/source-other/tests/test_outputs.py
192
- 44d9729328960cc04484e8ff23d492ac54edfc83f5910c24301742c895b96920 components/mimo-code/source_bundle/source/instruction.md
193
- 5cc7f78314cff7486514a872696334ea7add1614ab4d0e0c575f281a89f7425d components/mimo-code/source_bundle/source/task.toml
194
- 336149b10b45d03b7774ba589d984e9663135cfc660f3a133fc482a8716d0e3a components/mimo-code/source_bundle/source/tests/anti_hack_guard.py
195
- 544b5385c6ded480cc93e3c39938fce50b1ec7185d6e6052c5d53b9514968921 components/mimo-code/source_bundle/source/tests/fixtures/pristine_env_manifest.json
196
- 24593e6c78d47ddcb3e95e62464ca66169005ef390b5bef717a1bc3952f1fb38 components/mimo-code/source_bundle/source/tests/fixtures/regression_cases.json
197
- 786d65d844825a6cc7827d64dd9b34f388ef1f2be78c609e3a84ede8ed363bf1 components/mimo-code/source_bundle/source/tests/task_test.sh
198
- 5034fb5c341b758a915ae4e59abbc5c27fb39894ff37b0e8b02233b3156a1c35 components/mimo-code/source_bundle/source/tests/test.sh
199
- ae66085efc08ce1ac14b78e4aa9635452528c4ace0c2eddb79aeb3c023487a0c components/mimo-code/source_bundle/source/tests/test_outputs.py
200
  b0cbd2dbfe130357ab86c48b3f0ee1acca985828022542d97f1f9d77e147f261 components/pdbthink/DEPENDENCIES.json
201
- 0c2bd4c86b8d834a907605e71d8dc3763513da29cf07c324eb718c8818b1ec45 components/pdbthink/Dockerfile
202
- 4ac5bc8faf3c53e689d3e1857e81c904da28c239dacc10e69c6f6bee67ba687a components/pdbthink/config.json
203
  7c98afbca1961f056579b344a5552c574582c6c19926578a748519fdd99496d7 components/pdbthink/licenses/DEPENDENCIES.json
204
  c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 components/pdbthink/licenses/LICENSE-PDBTHINK
205
- ce75bb41edfeadb6dbe07aa8a8feacc4ed326c27695327ab56a45d80f38045cc components/pdbthink/licenses/SOURCE.json
206
- 56e4865b7517b35a7d316a8881561b622f10af0b29bd8394c59a4316ae285e1c components/pdbthink/private/tasks/pdbthink-s09-70c0778d985e571dde37/public_task.json
207
- 8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f components/pdbthink/private/tasks/pdbthink-s09-70c0778d985e571dde37/tests/coordinate_scoring/__init__.py
208
- 72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c components/pdbthink/private/tasks/pdbthink-s09-70c0778d985e571dde37/tests/coordinate_scoring/parse.py
209
- 8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34 components/pdbthink/private/tasks/pdbthink-s09-70c0778d985e571dde37/tests/coordinate_scoring/scorers.py
210
- 1519e6cc81fa143b8fa97d394b831df6f896e0e8e3deab637f799bd23000e4b4 components/pdbthink/private/tasks/pdbthink-s09-70c0778d985e571dde37/tests/gold.json
211
- bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 components/pdbthink/private/tasks/pdbthink-s09-70c0778d985e571dde37/tests/test.sh
212
- 628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4 components/pdbthink/private/tasks/pdbthink-s09-70c0778d985e571dde37/tests/verifier.toml
213
- 91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c components/pdbthink/private/tasks/pdbthink-s09-70c0778d985e571dde37/tests/verify.py
214
- 5d2dfa7c57a5c628a9c12cd097e7b644a155e380f1f6af48233560dbab0b4376 components/pdbthink/private/tasks/pdbthink-s09-772d9c283d4255fc0a11/public_task.json
215
- 8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f components/pdbthink/private/tasks/pdbthink-s09-772d9c283d4255fc0a11/tests/coordinate_scoring/__init__.py
216
- 72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c components/pdbthink/private/tasks/pdbthink-s09-772d9c283d4255fc0a11/tests/coordinate_scoring/parse.py
217
- 8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34 components/pdbthink/private/tasks/pdbthink-s09-772d9c283d4255fc0a11/tests/coordinate_scoring/scorers.py
218
- 995383611b5cf7f9f9d766df703fa00d02e445329f992f4c1a31f8e1e508a390 components/pdbthink/private/tasks/pdbthink-s09-772d9c283d4255fc0a11/tests/gold.json
219
- bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 components/pdbthink/private/tasks/pdbthink-s09-772d9c283d4255fc0a11/tests/test.sh
220
- 628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4 components/pdbthink/private/tasks/pdbthink-s09-772d9c283d4255fc0a11/tests/verifier.toml
221
- 91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c components/pdbthink/private/tasks/pdbthink-s09-772d9c283d4255fc0a11/tests/verify.py
222
  7d267c32438351a4d92533f6e9960da36a1e39c768ad56988904029cb90da0c5 components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/public_task.json
223
  8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py
224
  72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py
@@ -240,11 +120,11 @@ cc89f1e687da1a71af567ac450fd761da0e5d4fe56901695de304aabd81c59bd components/pdb
240
  b1f6f82ff9e113aedd742a8f4b0c18c545020677503765ee913c31e20964b96f components/pdbthink/runtime/pdbthink/transport.py
241
  b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f components/pdbthink/runtime/pdbthink/wire_client.py
242
  58d031f7955f7f774733189b8297a1db7f515bb206c26ac50fad68f580848974 components/tmax/DEPENDENCIES.json
243
- 6c373bb2e8fbf7431a9366d5e2890811a59aa0915511828f50195e377fee5930 components/tmax/FILE_ALLOWLIST.json
244
  9ae187d852f4cd6974fc9c65fba942df4e5586d73ddb3c48916a09376a3d36ac components/tmax/LICENSE_SCOPE.json
245
  f30eb64313c2645348ca3d965c40c9a466eb3754f3302206e44133d19bc87d6a components/tmax/NOTICE.txt
246
- 8228f41f6ed3488d787e85f78ec8d9358ff8d5d515c6ec537ab0eb06537048d1 components/tmax/SOURCE.json
247
- 9296f353c436adf1f5019adb05854fec1bb4601f8201a3f5763bf3b4116399e5 components/tmax/TASKS.json
248
  e2aff0a5d12d5f45d675854f26b6b5164bfac7fe1cf4193dab4ce879021bae64 components/tmax/config.json
249
  11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b components/tmax/licenses/ODC-BY-1.0.txt
250
  0e66e8816b8f2b4a17d37ec7abc5b8ca5708bae9d71d2c5323d8666d7e7ffa1d components/tmax/licenses/TMAX_DATASET_README.md
@@ -255,7 +135,7 @@ b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/tma
255
  26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/tmax/runtime/common/models.py
256
  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/tmax/runtime/native_shell/__init__.py
257
  80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3 components/tmax/runtime/native_shell/actor_launcher.py
258
- dadbc516c1d4d5ea64dda08dffd9be3f00f159abe62967a032473f6e79c85d9c components/tmax/runtime/native_shell/backend.py
259
  cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53 components/tmax/runtime/native_shell/environment.py
260
  31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e components/tmax/runtime/native_shell/guard.py
261
  db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b components/tmax/runtime/native_shell/launch_service.py
@@ -323,29 +203,7 @@ ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535 components/tma
323
  c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9 components/tmax/upstream/task_008998_ae4cbe72/task.toml
324
  abea24b268b08f72897859e527fe90c89c08d2afab7305cf52d4255f2feeb897 prepare_source_tree.py
325
  10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4 schema.json
326
- 5eba017b2fb18e65bb63d7116df8aa502c90e157c5be4d67021b60a57b7ae848 tasks.jsonl
327
- 66b564f58a409177999eda6eea1e5c8009d88c6d72faffa1bac7c497b800a460 upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/environment/Dockerfile
328
- 33d86986d7b9d0a12678be7326d02048cf812cb536fc45fdb2837c9772c64ddf upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/instruction.md
329
- f61bc6944b49d7a8095eef3903cd4b10982417f02c04f4d2b47620dd2128f30d upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/prompt.json
330
- eaf162755c72fae0936eab27b370732356f5b184aa1077e543b46f8ce327db7d upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/task.toml
331
- 8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/tests/coordinate_scoring/__init__.py
332
- 72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/tests/coordinate_scoring/parse.py
333
- 8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34 upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/tests/coordinate_scoring/scorers.py
334
- 1519e6cc81fa143b8fa97d394b831df6f896e0e8e3deab637f799bd23000e4b4 upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/tests/gold.json
335
- bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/tests/test.sh
336
- 628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4 upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/tests/verifier.toml
337
- 91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c upstream/pdbthink/pdbthink-s09-70c0778d985e571dde37/tests/verify.py
338
- 66b564f58a409177999eda6eea1e5c8009d88c6d72faffa1bac7c497b800a460 upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/environment/Dockerfile
339
- 1eba6ac44775863993c8215f0d146cdccc7e8874a05b694e79db776e375dd7b1 upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/instruction.md
340
- 77c1f05eb4f17a1d1b3291d916c999104262acfd9180ef775fa51232228ec2bc upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/prompt.json
341
- 3c85ab2cfb5782ee7b40bd4fb0ef1b323d1874e6f2ffb23554b7b630ea46454c upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/task.toml
342
- 8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/tests/coordinate_scoring/__init__.py
343
- 72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/tests/coordinate_scoring/parse.py
344
- 8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34 upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/tests/coordinate_scoring/scorers.py
345
- 995383611b5cf7f9f9d766df703fa00d02e445329f992f4c1a31f8e1e508a390 upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/tests/gold.json
346
- bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/tests/test.sh
347
- 628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4 upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/tests/verifier.toml
348
- 91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c upstream/pdbthink/pdbthink-s09-772d9c283d4255fc0a11/tests/verify.py
349
  66b564f58a409177999eda6eea1e5c8009d88c6d72faffa1bac7c497b800a460 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile
350
  21dc586748f23a8630118831399e1c40d62443444d454bf6f5e7f60ba334b06f upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md
351
  97d07b9814fff65f7cd78bf968d4854aa2aa75e8535ceb574b35a93dbf087db0 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/prompt.json
@@ -357,4 +215,4 @@ bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 upstream/pdbth
357
  bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh
358
  628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml
359
  91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py
360
- 26ee528d240a5208cf89d540b8e0a3ceb26435a15dc1fbb57f7034c8e6eec980 validate_dataset.py
 
1
+ 24641eca9bbd24aa8a02bda3cd37dcfb8445345df9b7b4997116ffd62746201e .gitattributes
2
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 LICENSE
3
  c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSES/Apache-2.0-PDBThink.txt
4
  9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94 LICENSES/CC-BY-4.0.txt
5
+ a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6 LICENSES/MIT-Python-Repair.txt
6
  c9d5f2c24789a4ee7502fd1426c6a2090ba766b24f20d0ef663d3b149b7466d3 LICENSES/MIT-adapters.txt
7
  11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b LICENSES/ODC-BY-1.0.txt
8
+ ff16b8cf78343a7a32fbcb321a9ca9b1d3507bb320d2435b92577eba750e93ce LICENSES/README.txt
9
  85da239bb4104a67e515dca538d1a4b345eed77c5d460fe76625bae905b431ed LICENSES/TMax-NOTICE.txt
10
+ 7b862fd6aedfdf16a100c140f256175f666f670be7a8741bb27e95a972234a43 MANIFEST.json
11
+ 11cfaddb6a6a011f4233b7217642bc2c1f2441e4be6749e175848d96912d78d0 README.md
12
+ 1bcb19ab0927ecf8e0aeb7a11fff5fca73cf62387ecf56ac358ac294a09a7d36 REGISTRATION.json
13
+ 4c6adc57279eb141e7c438621424616064194ad4421b74cc876a7414be7b23aa SOURCE_LOCK.json
14
  9338fe69c7472bfb396c70489e4edf64d6a30cf696da9a4579d30c743414c529 components/awm/ADAPTATIONS.txt
15
+ c2b8e74a2b134a9efcbc78332d6688b4d44c0e9039f64b0e664f281824886060 components/awm/Dockerfile
16
  1ea6a4d0c80da30d5f658364aaef2664cf09f32da0bce23c448e1fc1e4c4a7a6 components/awm/LICENSE_SCOPE.json
17
+ 1aeed83147ee7f0ef0e0ab8bf92ab49404b86a135436bd32772e4e89e007b702 components/awm/NOTICE
18
  ae057f0e66d0e924e81f553e729148cd98161bf070283928ef4fb658e9cf3546 components/awm/SOURCE_CREDITS.json
19
+ 9696c2ccb89108c6d7edaa0fec84092ae3251ef049e5d43252341c29f03ce88e components/awm/TASKS.json
20
  65d41089191536d5940648213b09924ba93e55d92df0080634e16d13615fd1ac components/awm/awm-requirements.lock
21
+ 679c2e8e5ca63963ab80b2e89a14df5204fb0b70dad25714efb1f0b89cad8424 components/awm/config.json
22
  3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58 components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json
23
  8ad2959536e44caba47bcbeca9018e47e7157783194d19b429aa8f22a60f4771 components/awm/private/tasks/awm-accounting-1-invoice/initial.db
24
  57362b907a2d454bbd29b95dfebb7d84207ce9d7e22533eaf54853ee4fb84990 components/awm/private/tasks/awm-accounting-1-invoice/original_api.py
25
  3cd0d63022caa900e32bda0b0d3ae5c9948ce3c195b77ba1906c7ddebea9c58b components/awm/private/tasks/awm-accounting-1-invoice/original_verifier.py
 
 
 
 
26
  0078892ae5870080b3417677926bc64f4f87ba9e8110ff400f18954e361455fc components/awm/requirements.lock
27
  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/awm/runtime/awm/__init__.py
28
+ 887e81b7aab249861166099b3b4f0778f9041324640b904140d1b055d5a0bff1 components/awm/runtime/awm/adapter.py
29
  0638af1cd1c6a311ee85109143ec6a59646a5f3d41c4b30312526dec561da33d components/awm/runtime/awm/launch_service.py
30
  f47b0cc104a7a962fc932c4d3f3bb8bfcf1524dec049b9c2c33161924038b94e components/awm/runtime/awm/openenv_app.py
31
  484c7caeaa301b91f468a9e55a251a6b529c6f9d0f2e4951c9602071c40ebcea components/awm/runtime/awm/server.py
32
  b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f components/awm/runtime/awm/wire_client.py
33
+ b02f482ee9e55df0998b9fcc839a6172cbd1daf40701082062fa49416b31d6e0 components/awm/runtime/awm/worker.py
34
  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/awm/runtime/common/__init__.py
35
  b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/awm/runtime/common/contracts.py
36
  7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e components/awm/runtime/common/http_routes.py
 
39
  1cd23311c95c9919621b226c99dcab54faf815300c72cd542a394a5e69463a6e components/awm/upstream/accounting_1-gen_db.jsonl
40
  99f1883338fa6f4827cb9c6c4c9cf9222c28a2a9842202cbe524921921de3ae3 components/awm/upstream/accounting_1-gen_envs.jsonl
41
  28cf8d5611b0d63b9e17d0e991e328c2970cfef5595c08d084f2b1bad7a441fd components/awm/upstream/accounting_1-gen_sample.jsonl
42
+ 05cc6ae53cfd6129f1d7010aa874c6cf0a6019b1adfeff3f4fab27f2d04f43ca components/loui/.dockerignore
43
+ 0b1054575ac49a8a80a9777e67280b41549b7ff6da909301b0fa8d87c1d8833d components/loui/Dockerfile
44
+ 6321514f0aac58cdcd022b38f1be9c499d70b1f82a57a45a6878d816a4bcf293 components/loui/README.md
45
+ 77ce88ca01b6eaad2babc63f0bc078674597336451275db2d72e282bf84b2592 components/loui/SOURCE.json
46
+ 93e90e21198aa146280df24300947b36561b3c41fb51494f0bf5c2b793fc7330 components/loui/config.json
47
+ 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/loui/runtime/common/__init__.py
48
+ b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/loui/runtime/common/contracts.py
49
+ 26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/loui/runtime/common/models.py
50
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/loui/runtime/loui/__init__.py
51
+ c4774351bdbd8a044cd20bcd7111ac4db7403feccb9444acf663e71140b27888 components/loui/runtime/loui/child.py
52
+ edd467b474dc0982c9b6c91a9f0150432fa8b9a5c6b62c8187bc9cc9f440a22a components/loui/runtime/loui/environment.py
53
+ 7c70a736ee8c5afbb3b5cf3e8113242e4dbb9efc3abe3a2027948474121d59f8 components/loui/runtime/loui/executor.py
54
+ c3ae4e00495724083e73085bd4dccdf3493094ef2e14c0bb017f6502d264244b components/loui/runtime/loui/server.py
55
+ 09ef2d8fc856ca3dc5662c279df705e9accc827f4472dc34758ffe769d116128 components/loui/tasks/expression-3/instruction.md
56
+ 682c7db0f0911e85174652574349fbe957c1cc235a68d224c569e405d9674452 components/loui/tasks/incident-3/instruction.md
57
+ a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6 components/loui/upstream/LICENSE
58
+ bf5da0c7b871459278ad174cfd3c4ba90de9fbe74d35decce007bed13535d32d components/loui/upstream/v3/README.md
59
+ 578814be5152b9b00c7eeae387544a94db159c9e8e3456e5cb56b31b6a731e9a components/loui/upstream/v3/execution.py
60
+ f140fcf554e97b67afb14e961affc46c14320cb784fe1f7444585e77ceb89ea0 components/loui/upstream/v3/hard_tasks.py
61
+ 67f546daef6e7902c12754cbbd883657e57d2cb21e109275af123c552cc93422 components/loui/upstream/v3/server.py
62
+ 9715cdabe6e67287399a3fe2bad435852510bf854982d2f6695b3d87db395c88 components/loui/upstream/v3/tasks.jsonl
63
+ 71caf0175532025bf138398229d466f18e5e03365b48853efd92f61f6dae2d66 components/loui/upstream/v3/tasks.py
64
+ 83af5f0a6ae61c968b666a5d1854020a8ee8cf174562ca9d59afc397f46444ae components/math/ADAPTATIONS.txt
65
+ f6f0505f720c1b8bb8202cbdc8c5d16f270646dc006b47fdbc1d8852f757c848 components/math/Dockerfile
66
+ a4650234425608cbdb194ace7ba22812b4c14c1609a8a7808c2997bf92cdd2c7 components/math/NOTICE.txt
67
  a037cf3ce617aa3e0216bf5e0677d229679bfffdd30dba9057b58bb413c39732 components/math/SDK_DEPENDENCIES.json
68
+ 4d29eba8369ddbcbeab51dabe14f411512b1117b3787f59c1d406938f0b927ac components/math/SOURCE.json
69
+ 5b232f75ae416ebe7094f0c85010ac6cb41dfecfd601aa7b5ed51712e75dc29a components/math/TASKS.json
70
+ a0707b688bdabc7c7634d41bcd9031b6639896a2fc4b04ec6a06c2ac11dfb68c components/math/config.json
71
  9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94 components/math/licenses/MathConstraint-LICENSE
72
  10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e components/math/licenses/RLVE-LICENSE
73
  200b2ce93f2a5b9671165f9aea3cc4d89db995352c1e1e3db6d418262b058516 components/math/licenses/UPSTREAM_COLLECTION_LICENSES.md
 
77
  26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/math/runtime/common/models.py
78
  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/math/runtime/native_shell/__init__.py
79
  80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3 components/math/runtime/native_shell/actor_launcher.py
80
+ 34dba81df98422b07004d85a922d7db1246532a9d24b0be7eb103b89e0894e4e components/math/runtime/native_shell/backend.py
81
  cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53 components/math/runtime/native_shell/environment.py
82
  31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e components/math/runtime/native_shell/guard.py
83
  db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b components/math/runtime/native_shell/launch_service.py
 
93
  15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5 components/math/upstream/construct-mc-costas-array-l3-s0/tests/instance.json
94
  d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73 components/math/upstream/construct-mc-costas-array-l3-s0/tests/run.py
95
  a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e components/math/upstream/construct-mc-costas-array-l3-s0/tests/test.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  b0cbd2dbfe130357ab86c48b3f0ee1acca985828022542d97f1f9d77e147f261 components/pdbthink/DEPENDENCIES.json
97
+ a059eac1b72cef773aee8d849c48f0b090e5d87802cfdf8ae3e8456595ba4e87 components/pdbthink/Dockerfile
98
+ 6329e8c6c33a5f04e11dbdcba6f43bb7dba10439d969a97b28901d7681ece8b6 components/pdbthink/config.json
99
  7c98afbca1961f056579b344a5552c574582c6c19926578a748519fdd99496d7 components/pdbthink/licenses/DEPENDENCIES.json
100
  c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 components/pdbthink/licenses/LICENSE-PDBTHINK
101
+ b799de2e9e91ea8ee515bca1fee21cef759b73938cf952e629c8fb9543cc6638 components/pdbthink/licenses/SOURCE.json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  7d267c32438351a4d92533f6e9960da36a1e39c768ad56988904029cb90da0c5 components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/public_task.json
103
  8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py
104
  72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py
 
120
  b1f6f82ff9e113aedd742a8f4b0c18c545020677503765ee913c31e20964b96f components/pdbthink/runtime/pdbthink/transport.py
121
  b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f components/pdbthink/runtime/pdbthink/wire_client.py
122
  58d031f7955f7f774733189b8297a1db7f515bb206c26ac50fad68f580848974 components/tmax/DEPENDENCIES.json
123
+ 7c4a25fee86ff7295519547dac7f594103c7137ec746423dd452c076a920cbb4 components/tmax/Dockerfile
124
  9ae187d852f4cd6974fc9c65fba942df4e5586d73ddb3c48916a09376a3d36ac components/tmax/LICENSE_SCOPE.json
125
  f30eb64313c2645348ca3d965c40c9a466eb3754f3302206e44133d19bc87d6a components/tmax/NOTICE.txt
126
+ e0e598c0fc7ac71b15ee4668ad88f11b9e1084d62610d0535038d5a034d1c946 components/tmax/SOURCE.json
127
+ 7b4d7c93c6f7477c2962ee8ae8746bfe941991de3b940400013a15d1bba87536 components/tmax/TASKS.json
128
  e2aff0a5d12d5f45d675854f26b6b5164bfac7fe1cf4193dab4ce879021bae64 components/tmax/config.json
129
  11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b components/tmax/licenses/ODC-BY-1.0.txt
130
  0e66e8816b8f2b4a17d37ec7abc5b8ca5708bae9d71d2c5323d8666d7e7ffa1d components/tmax/licenses/TMAX_DATASET_README.md
 
135
  26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/tmax/runtime/common/models.py
136
  01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/tmax/runtime/native_shell/__init__.py
137
  80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3 components/tmax/runtime/native_shell/actor_launcher.py
138
+ 4b71d8cd0f017716e6df6cc64ee268a725be5fb6e363034bae2f9c8b0184b0ba components/tmax/runtime/native_shell/backend.py
139
  cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53 components/tmax/runtime/native_shell/environment.py
140
  31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e components/tmax/runtime/native_shell/guard.py
141
  db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b components/tmax/runtime/native_shell/launch_service.py
 
203
  c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9 components/tmax/upstream/task_008998_ae4cbe72/task.toml
204
  abea24b268b08f72897859e527fe90c89c08d2afab7305cf52d4255f2feeb897 prepare_source_tree.py
205
  10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4 schema.json
206
+ c732c9b64fa1482028dc6fb2c0839496275e3250914df6e94e3dd6788cb04d43 tasks.jsonl
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  66b564f58a409177999eda6eea1e5c8009d88c6d72faffa1bac7c497b800a460 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile
208
  21dc586748f23a8630118831399e1c40d62443444d454bf6f5e7f60ba334b06f upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md
209
  97d07b9814fff65f7cd78bf968d4854aa2aa75e8535ceb574b35a93dbf087db0 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/prompt.json
 
215
  bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh
216
  628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml
217
  91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py
218
+ 0a92b0131b3b069468a5c0e32016a4f76b3f11395531a223b9a131175c2ae274 validate_dataset.py
SOURCE_LOCK.json CHANGED
The diff for this file is too large to render. See raw diff
 
components/awm/Dockerfile CHANGED
@@ -1,18 +1,5 @@
1
- FROM python:3.12-slim-bookworm@sha256:392307d22300de8b5986851a12d9176dfc0fc073e65bf6523ebd7dcbeb23564e
2
  USER root
3
- COPY wheels /tmp/sdk-wheels
4
- COPY requirements.lock /opt/awm/requirements.lock
5
- RUN python -m pip install --no-cache-dir --no-index --find-links=/tmp/sdk-wheels --require-hashes -r /opt/awm/requirements.lock && python -m pip check && rm -rf /tmp/sdk-wheels
6
- COPY awm_wheels /tmp/awm-wheels
7
- COPY awm-requirements.lock /opt/awm/awm-requirements.lock
8
- RUN python -m venv /opt/awm-venv && /opt/awm-venv/bin/python -m pip install --no-cache-dir --no-index --find-links=/tmp/awm-wheels --require-hashes -r /opt/awm/awm-requirements.lock && /opt/awm-venv/bin/python -m pip check && rm -rf /tmp/awm-wheels
9
- COPY runtime /opt/awm/runtime
10
- COPY private /opt/awm/private
11
  COPY config.json /opt/awm/config.json
12
- COPY NOTICE SOURCE_CREDITS.json /opt/awm/
13
- RUN chmod -R go-rwx /opt/awm && mkdir -p /var/lib/awm && chmod 700 /var/lib/awm
14
- ENV PYTHONPATH=/opt/awm/runtime PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 ENABLE_WEB_INTERFACE=false OPENENV_MODE=simulation GRADIO_ANALYTICS_ENABLED=false HF_HUB_OFFLINE=1
15
- WORKDIR /opt/awm
16
- EXPOSE 8000
17
- HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3).read()"]
18
- CMD ["python", "-m", "awm.server"]
 
1
+ FROM ghcr.io/bochencs/openenv-awm@sha256:ca13dd484ed50f5f72e1de652ab55ac25dd7550ee1558f553a3d6eae5a07cb95
2
  USER root
 
 
 
 
 
 
 
 
3
  COPY config.json /opt/awm/config.json
4
+ COPY runtime/awm/adapter.py runtime/awm/worker.py /opt/awm/runtime/awm/
5
+ RUN rm -rf /opt/awm/private/tasks/awm-manufacturing-1-schedule && chmod 600 /opt/awm/config.json
 
 
 
 
 
components/awm/NOTICE CHANGED
@@ -1,4 +1,4 @@
1
- This image adapts two unchanged original train tasks from AgentWorldModel-1K.
2
  Authors: Zhaoyang Wang, Canwen Xu, Boyi Liu, Yite Wang, Siwei Han, Zhewei Yao, Huaxiu Yao, Yuxiong He.
3
  Dataset: https://huggingface.co/datasets/Snowflake/AgentWorldModel-1K/tree/dde80a0283fe781bdc51656bce57063dc5650213
4
  License: Creative Commons Attribution 4.0 International (CC BY 4.0).
 
1
+ This image adapts one unchanged original train task from AgentWorldModel-1K.
2
  Authors: Zhaoyang Wang, Canwen Xu, Boyi Liu, Yite Wang, Siwei Han, Zhewei Yao, Huaxiu Yao, Yuxiong He.
3
  Dataset: https://huggingface.co/datasets/Snowflake/AgentWorldModel-1K/tree/dde80a0283fe781bdc51656bce57063dc5650213
4
  License: Creative Commons Attribution 4.0 International (CC BY 4.0).
components/awm/TASKS.json CHANGED
@@ -6,7 +6,6 @@
6
  "source_record": "gen_tasks.jsonl#scenario=accounting_1;tasks[1]",
7
  "source_instruction_sha256": "a08b48d978d8a70cfea5c6e871d079622fc99ac8438fb38d6d6816bdfa399c99",
8
  "original_limits": null,
9
- "original_limits_note": "No numeric episode/CPU/memory limits were found in the selected AWM dataset rows; do not infer defaults.",
10
  "adapter_limits": {
11
  "episode_seconds": 600,
12
  "cpus": 1,
@@ -33,40 +32,5 @@
33
  "SOURCE.json": "3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58"
34
  },
35
  "license": "CC-BY-4.0"
36
- },
37
- {
38
- "task_id": "awm-manufacturing-1-schedule",
39
- "source_repo": "Snowflake/AgentWorldModel-1K",
40
- "source_revision": "dde80a0283fe781bdc51656bce57063dc5650213",
41
- "source_record": "gen_tasks.jsonl#scenario=manufacturing_execution_system_1;tasks[5]",
42
- "source_instruction_sha256": "95404884accb6e78e1a8421cf62b7a6379955bf931dd35ccd71900d01f5180e4",
43
- "original_limits": null,
44
- "original_limits_note": "No numeric episode/CPU/memory limits were found in the selected AWM dataset rows; do not infer defaults.",
45
- "adapter_limits": {
46
- "episode_seconds": 600,
47
- "cpus": 1,
48
- "memory_mb": 2048,
49
- "max_context_length": 32768,
50
- "max_completion_tokens": 32768
51
- },
52
- "interface": {
53
- "schema_sha256": "10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4",
54
- "ops": [
55
- "call",
56
- "finish"
57
- ],
58
- "business_tools": "Unchanged original FastApiMCP 0.4.0 operation names and argument schemas",
59
- "shell": false,
60
- "reset": "Fixed task_id, fresh original seed copy, no random task substitution",
61
- "reward": "0 or 1 from original pure-code state verifier at finish; terminal immutable"
62
- },
63
- "tool_count": 50,
64
- "original_files_sha256": {
65
- "original_api.py": "ff94326bc0d2a826a2a211512a617f0b9f5d91866b9c77ea17f6502f77b75aa6",
66
- "original_verifier.py": "f0cd8fa0f1a17e76f8e87cfbe59a81645a750999f747be36b8d25d9244e5b8f1",
67
- "initial.db": "9a523ebee8c25ca61aa43075c6263e5d3b310d39157ebddabea4cb754e610a1c",
68
- "SOURCE.json": "93eda02b7f5e0bd7aca37a2becc3fd20925472a8f33143171e4cc250564ff7b3"
69
- },
70
- "license": "CC-BY-4.0"
71
  }
72
  ]
 
6
  "source_record": "gen_tasks.jsonl#scenario=accounting_1;tasks[1]",
7
  "source_instruction_sha256": "a08b48d978d8a70cfea5c6e871d079622fc99ac8438fb38d6d6816bdfa399c99",
8
  "original_limits": null,
 
9
  "adapter_limits": {
10
  "episode_seconds": 600,
11
  "cpus": 1,
 
32
  "SOURCE.json": "3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58"
33
  },
34
  "license": "CC-BY-4.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
  ]
components/awm/config.json CHANGED
@@ -10,17 +10,6 @@
10
  "SOURCE.json": "3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58"
11
  },
12
  "timeout_seconds": 600
13
- },
14
- {
15
- "task_id": "awm-manufacturing-1-schedule",
16
- "split": "train",
17
- "original_sha256": {
18
- "original_api.py": "ff94326bc0d2a826a2a211512a617f0b9f5d91866b9c77ea17f6502f77b75aa6",
19
- "original_verifier.py": "f0cd8fa0f1a17e76f8e87cfbe59a81645a750999f747be36b8d25d9244e5b8f1",
20
- "initial.db": "9a523ebee8c25ca61aa43075c6263e5d3b310d39157ebddabea4cb754e610a1c",
21
- "SOURCE.json": "93eda02b7f5e0bd7aca37a2becc3fd20925472a8f33143171e4cc250564ff7b3"
22
- },
23
- "timeout_seconds": 600
24
  }
25
  ]
26
  }
 
10
  "SOURCE.json": "3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58"
11
  },
12
  "timeout_seconds": 600
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
  ]
15
  }
components/awm/private/tasks/awm-manufacturing-1-schedule/SOURCE.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "repo": "Snowflake/AgentWorldModel-1K",
3
- "revision": "dde80a0283fe781bdc51656bce57063dc5650213",
4
- "scenario": "manufacturing_execution_system_1",
5
- "task_idx": 5,
6
- "task": "For job 'J-2025-0332', create three job_tasks: (1) cutting at work_center 'Laser Cutter LC-01' requiring_skill_level = 'intermediate' with planned_start '2026-01-05T08:00:00' and planned_finish '2026-01-05T10:00:00'; (2) welding at 'Weld Cell WC-02' requiring_skill_level = 'advanced' from '2026-01-05T11:00:00' to '2026-01-05T14:00:00'; and (3) painting at 'Paint Booth PB-01' requiring_skill_level = 'intermediate' from '2026-01-06T09:00:00' to '2026-01-06T11:00:00'.",
7
- "task_id": "awm-manufacturing-1-schedule",
8
- "license": "CC-BY-4.0",
9
- "split": "train",
10
- "original_format": "FastAPI through FastApiMCP 0.4.0"
11
- }
 
 
 
 
 
 
 
 
 
 
 
 
components/awm/private/tasks/awm-manufacturing-1-schedule/initial.db DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:9a523ebee8c25ca61aa43075c6263e5d3b310d39157ebddabea4cb754e610a1c
3
- size 307200
 
 
 
 
components/awm/private/tasks/awm-manufacturing-1-schedule/original_api.py DELETED
@@ -1,1524 +0,0 @@
1
- from fastapi import FastAPI, Query, Path, Body
2
- from pydantic import BaseModel, Field, ConfigDict
3
- from typing import Optional, List
4
- from sqlalchemy import create_engine, Column, Integer, String, Float, DateTime, Date, ForeignKey, UniqueConstraint, Index, REAL
5
- from sqlalchemy.orm import declarative_base, relationship, sessionmaker
6
- from datetime import datetime
7
- import os
8
-
9
- database_url = os.getenv("DATABASE_PATH", "sqlite:///outputs/databases/craftbench_custom_manufacturing_job_tracker.db")
10
- engine = create_engine(database_url, connect_args={"check_same_thread": False} if database_url.startswith("sqlite") else {})
11
- SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
12
- Base = declarative_base()
13
-
14
- class User(Base):
15
- __tablename__ = "users"
16
- id = Column(Integer, primary_key=True)
17
- username = Column(String, unique=True, nullable=False, index=True)
18
- email = Column(String, unique=True, nullable=False, index=True)
19
- full_name = Column(String)
20
- created_at = Column(DateTime, default=datetime.utcnow)
21
- updated_at = Column(DateTime, default=datetime.utcnow)
22
-
23
- class Customer(Base):
24
- __tablename__ = "customers"
25
- id = Column(Integer, primary_key=True)
26
- name = Column(String, unique=True, nullable=False, index=True)
27
- billing_address = Column(String, nullable=False)
28
- contact_person = Column(String)
29
- email = Column(String)
30
- phone = Column(String)
31
- created_at = Column(DateTime, default=datetime.utcnow)
32
- updated_at = Column(DateTime, default=datetime.utcnow)
33
-
34
- class ProductTemplate(Base):
35
- __tablename__ = "product_templates"
36
- id = Column(Integer, primary_key=True)
37
- name = Column(String, unique=True, nullable=False, index=True)
38
- description = Column(String)
39
- created_at = Column(DateTime, default=datetime.utcnow)
40
- updated_at = Column(DateTime, default=datetime.utcnow)
41
-
42
- class ProductTemplateOption(Base):
43
- __tablename__ = "product_template_options"
44
- id = Column(Integer, primary_key=True)
45
- product_template_id = Column(Integer, ForeignKey("product_templates.id", ondelete="CASCADE"), nullable=False)
46
- option_name = Column(String, nullable=False)
47
- option_value = Column(String, nullable=False)
48
- created_at = Column(DateTime, default=datetime.utcnow)
49
- updated_at = Column(DateTime, default=datetime.utcnow)
50
- __table_args__ = (UniqueConstraint("product_template_id", "option_name", "option_value"),)
51
- product_template = relationship("ProductTemplate", foreign_keys=[product_template_id])
52
-
53
- class StandardTaskSequence(Base):
54
- __tablename__ = "standard_task_sequences"
55
- id = Column(Integer, primary_key=True)
56
- product_template_id = Column(Integer, ForeignKey("product_templates.id", ondelete="CASCADE"), nullable=False)
57
- sequence_order = Column(Integer, nullable=False)
58
- task_name = Column(String, nullable=False)
59
- default_planned_duration_hours = Column(REAL, nullable=False)
60
- created_at = Column(DateTime, default=datetime.utcnow)
61
- updated_at = Column(DateTime, default=datetime.utcnow)
62
- __table_args__ = (UniqueConstraint("product_template_id", "sequence_order"),)
63
- product_template = relationship("ProductTemplate", foreign_keys=[product_template_id])
64
-
65
- class CustomSpec(Base):
66
- __tablename__ = "custom_specs"
67
- id = Column(Integer, primary_key=True)
68
- customer_id = Column(Integer, ForeignKey("customers.id", ondelete="RESTRICT"), nullable=False)
69
- product_template_id = Column(Integer, ForeignKey("product_templates.id", ondelete="RESTRICT"), nullable=False)
70
- notes = Column(String)
71
- created_at = Column(DateTime, default=datetime.utcnow)
72
- updated_at = Column(DateTime, default=datetime.utcnow)
73
- customer = relationship("Customer", foreign_keys=[customer_id])
74
- product_template = relationship("ProductTemplate", foreign_keys=[product_template_id])
75
-
76
- class CustomSpecOption(Base):
77
- __tablename__ = "custom_spec_options"
78
- id = Column(Integer, primary_key=True)
79
- custom_spec_id = Column(Integer, ForeignKey("custom_specs.id", ondelete="CASCADE"), nullable=False)
80
- option_name = Column(String, nullable=False)
81
- option_value = Column(String, nullable=False)
82
- created_at = Column(DateTime, default=datetime.utcnow)
83
- updated_at = Column(DateTime, default=datetime.utcnow)
84
- __table_args__ = (UniqueConstraint("custom_spec_id", "option_name"),)
85
- custom_spec = relationship("CustomSpec", foreign_keys=[custom_spec_id])
86
-
87
- class CustomSpecNumericParam(Base):
88
- __tablename__ = "custom_spec_numeric_params"
89
- id = Column(Integer, primary_key=True)
90
- custom_spec_id = Column(Integer, ForeignKey("custom_specs.id", ondelete="CASCADE"), nullable=False)
91
- param_name = Column(String, nullable=False)
92
- param_value = Column(REAL, nullable=False)
93
- unit = Column(String)
94
- created_at = Column(DateTime, default=datetime.utcnow)
95
- updated_at = Column(DateTime, default=datetime.utcnow)
96
- __table_args__ = (UniqueConstraint("custom_spec_id", "param_name"),)
97
- custom_spec = relationship("CustomSpec", foreign_keys=[custom_spec_id])
98
-
99
- class Quote(Base):
100
- __tablename__ = "quotes"
101
- id = Column(Integer, primary_key=True)
102
- quote_number = Column(String, unique=True, nullable=False)
103
- customer_id = Column(Integer, ForeignKey("customers.id", ondelete="RESTRICT"), nullable=False)
104
- custom_spec_id = Column(Integer, ForeignKey("custom_specs.id", ondelete="SET NULL"))
105
- estimated_hours = Column(REAL, nullable=False)
106
- material_cost = Column(REAL, nullable=False)
107
- labor_rate = Column(REAL, nullable=False)
108
- status = Column(String, nullable=False)
109
- internal_note = Column(String)
110
- created_at = Column(DateTime, default=datetime.utcnow)
111
- updated_at = Column(DateTime, default=datetime.utcnow)
112
- customer = relationship("Customer", foreign_keys=[customer_id])
113
- custom_spec = relationship("CustomSpec", foreign_keys=[custom_spec_id])
114
-
115
- class Job(Base):
116
- __tablename__ = "jobs"
117
- id = Column(Integer, primary_key=True)
118
- job_number = Column(String, unique=True, nullable=False, index=True)
119
- customer_id = Column(Integer, ForeignKey("customers.id", ondelete="RESTRICT"), nullable=False)
120
- quote_id = Column(Integer, ForeignKey("quotes.id", ondelete="SET NULL"))
121
- custom_spec_id = Column(Integer, ForeignKey("custom_specs.id", ondelete="SET NULL"))
122
- priority = Column(String, nullable=False)
123
- due_date = Column(Date)
124
- status = Column(String, nullable=False)
125
- created_at = Column(DateTime, default=datetime.utcnow)
126
- updated_at = Column(DateTime, default=datetime.utcnow)
127
- customer = relationship("Customer", foreign_keys=[customer_id])
128
- quote = relationship("Quote", foreign_keys=[quote_id])
129
- custom_spec = relationship("CustomSpec", foreign_keys=[custom_spec_id])
130
-
131
- class WorkCenter(Base):
132
- __tablename__ = "work_centers"
133
- id = Column(Integer, primary_key=True)
134
- name = Column(String, unique=True, nullable=False, index=True)
135
- description = Column(String)
136
- created_at = Column(DateTime, default=datetime.utcnow)
137
- updated_at = Column(DateTime, default=datetime.utcnow)
138
-
139
- class JobTask(Base):
140
- __tablename__ = "job_tasks"
141
- id = Column(Integer, primary_key=True)
142
- task_code = Column(String, unique=True, nullable=False)
143
- job_id = Column(Integer, ForeignKey("jobs.id", ondelete="CASCADE"), nullable=False)
144
- sequence_order = Column(Integer, nullable=False)
145
- task_name = Column(String, nullable=False)
146
- work_center_id = Column(Integer, ForeignKey("work_centers.id", ondelete="RESTRICT"), nullable=False)
147
- requiring_skill_level = Column(String)
148
- planned_start = Column(DateTime)
149
- planned_finish = Column(DateTime)
150
- planned_duration_hours = Column(REAL)
151
- actual_start = Column(DateTime)
152
- actual_finish = Column(DateTime)
153
- created_at = Column(DateTime, default=datetime.utcnow)
154
- updated_at = Column(DateTime, default=datetime.utcnow)
155
- __table_args__ = (UniqueConstraint("job_id", "sequence_order"),)
156
- job = relationship("Job", foreign_keys=[job_id])
157
- work_center = relationship("WorkCenter", foreign_keys=[work_center_id])
158
-
159
- class TimeLog(Base):
160
- __tablename__ = "time_logs"
161
- id = Column(Integer, primary_key=True)
162
- job_task_id = Column(Integer, ForeignKey("job_tasks.id", ondelete="CASCADE"), nullable=False)
163
- operator_username = Column(String, nullable=False)
164
- work_center_id = Column(Integer, ForeignKey("work_centers.id", ondelete="RESTRICT"), nullable=False)
165
- log_start = Column(DateTime, default=datetime.utcnow)
166
- actual_duration_hours = Column(REAL, nullable=False)
167
- scrap_quantity = Column(Integer, default=0)
168
- note = Column(String)
169
- created_at = Column(DateTime, default=datetime.utcnow)
170
- updated_at = Column(DateTime, default=datetime.utcnow)
171
- job_task = relationship("JobTask", foreign_keys=[job_task_id])
172
- work_center = relationship("WorkCenter", foreign_keys=[work_center_id])
173
-
174
- class Material(Base):
175
- __tablename__ = "materials"
176
- id = Column(Integer, primary_key=True)
177
- name = Column(String, unique=True, nullable=False, index=True)
178
- unit_of_measure = Column(String, nullable=False)
179
- created_at = Column(DateTime, default=datetime.utcnow)
180
- updated_at = Column(DateTime, default=datetime.utcnow)
181
-
182
- class InventoryLot(Base):
183
- __tablename__ = "inventory_lots"
184
- id = Column(Integer, primary_key=True)
185
- lot_number = Column(String, unique=True, nullable=False, index=True)
186
- material_id = Column(Integer, ForeignKey("materials.id", ondelete="RESTRICT"), nullable=False)
187
- on_hand_quantity = Column(REAL, nullable=False)
188
- reserved_quantity = Column(REAL, nullable=False, default=0)
189
- created_at = Column(DateTime, default=datetime.utcnow)
190
- updated_at = Column(DateTime, default=datetime.utcnow)
191
- material = relationship("Material", foreign_keys=[material_id])
192
-
193
- class MaterialReservation(Base):
194
- __tablename__ = "material_reservations"
195
- id = Column(Integer, primary_key=True)
196
- job_id = Column(Integer, ForeignKey("jobs.id", ondelete="CASCADE"), nullable=False)
197
- inventory_lot_id = Column(Integer, ForeignKey("inventory_lots.id", ondelete="RESTRICT"), nullable=False)
198
- quantity = Column(REAL, nullable=False)
199
- created_at = Column(DateTime, default=datetime.utcnow)
200
- updated_at = Column(DateTime, default=datetime.utcnow)
201
- job = relationship("Job", foreign_keys=[job_id])
202
- inventory_lot = relationship("InventoryLot", foreign_keys=[inventory_lot_id])
203
-
204
- class Shipment(Base):
205
- __tablename__ = "shipments"
206
- id = Column(Integer, primary_key=True)
207
- shipment_number = Column(String, unique=True, nullable=False)
208
- job_id = Column(Integer, ForeignKey("jobs.id", ondelete="RESTRICT"), nullable=False)
209
- customer_id = Column(Integer, ForeignKey("customers.id", ondelete="RESTRICT"), nullable=False)
210
- delivery_status = Column(String, nullable=False)
211
- shipped_at = Column(DateTime)
212
- delivered_at = Column(DateTime)
213
- created_at = Column(DateTime, default=datetime.utcnow)
214
- updated_at = Column(DateTime, default=datetime.utcnow)
215
- job = relationship("Job", foreign_keys=[job_id])
216
- customer = relationship("Customer", foreign_keys=[customer_id])
217
-
218
- class ShipmentPackage(Base):
219
- __tablename__ = "shipment_packages"
220
- id = Column(Integer, primary_key=True)
221
- shipment_id = Column(Integer, ForeignKey("shipments.id", ondelete="CASCADE"), nullable=False)
222
- package_number = Column(Integer, nullable=False)
223
- weight_kg = Column(REAL, nullable=False)
224
- tracking_number = Column(String, nullable=False)
225
- created_at = Column(DateTime, default=datetime.utcnow)
226
- updated_at = Column(DateTime, default=datetime.utcnow)
227
- __table_args__ = (UniqueConstraint("shipment_id", "package_number"), UniqueConstraint("tracking_number"),)
228
- shipment = relationship("Shipment", foreign_keys=[shipment_id])
229
-
230
- Index("idx_users_username", User.username)
231
- Index("idx_users_email", User.email)
232
- Index("idx_customers_name", Customer.name)
233
- Index("idx_product_templates_name", ProductTemplate.name)
234
- Index("idx_pto_template", ProductTemplateOption.product_template_id)
235
- Index("idx_pto_name_value", ProductTemplateOption.option_name, ProductTemplateOption.option_value)
236
- Index("idx_sts_template", StandardTaskSequence.product_template_id)
237
- Index("idx_custom_specs_customer", CustomSpec.customer_id)
238
- Index("idx_custom_specs_template", CustomSpec.product_template_id)
239
- Index("idx_quotes_customer", Quote.customer_id)
240
- Index("idx_quotes_status", Quote.status)
241
- Index("idx_jobs_job_number", Job.job_number)
242
- Index("idx_jobs_customer", Job.customer_id)
243
- Index("idx_jobs_status", Job.status)
244
- Index("idx_jobs_due_date", Job.due_date)
245
- Index("idx_work_centers_name", WorkCenter.name)
246
- Index("idx_job_tasks_job", JobTask.job_id)
247
- Index("idx_job_tasks_work_center", JobTask.work_center_id)
248
- Index("idx_job_tasks_planned_range", JobTask.planned_start, JobTask.planned_finish)
249
- Index("idx_time_logs_job_task", TimeLog.job_task_id)
250
- Index("idx_time_logs_work_center", TimeLog.work_center_id)
251
- Index("idx_time_logs_log_start", TimeLog.log_start)
252
- Index("idx_materials_name", Material.name)
253
- Index("idx_inventory_lots_material", InventoryLot.material_id)
254
- Index("idx_inventory_lots_lot_number", InventoryLot.lot_number)
255
- Index("idx_material_reservations_job", MaterialReservation.job_id)
256
- Index("idx_material_reservations_lot", MaterialReservation.inventory_lot_id)
257
- Index("idx_shipments_job", Shipment.job_id)
258
- Index("idx_shipments_customer", Shipment.customer_id)
259
- Index("idx_shipments_status", Shipment.delivery_status)
260
- Index("idx_shipment_packages_shipment", ShipmentPackage.shipment_id)
261
- Index("idx_shipment_packages_tracking", ShipmentPackage.tracking_number)
262
-
263
- Base.metadata.create_all(bind=engine)
264
-
265
- app = FastAPI(title="CraftBench Custom Manufacturing Job Tracker", version="1.0.0")
266
-
267
- class CustomerCreateRequest(BaseModel):
268
- name: str = Field(..., description="Unique customer name", example="Acme Robotics LLC")
269
- billing_address: str = Field(..., description="Full billing address", example="1200 Industrial Way, Dayton, OH 45402")
270
- contact_person: Optional[str] = Field(None, description="Primary contact person name", example="Maria Santos")
271
- email: Optional[str] = Field(None, description="Primary contact email", example="m.santos@acmerobotics.com")
272
- phone: Optional[str] = Field(None, description="Primary contact phone", example="+1-937-555-0142")
273
-
274
- class CustomerResponse(BaseModel):
275
- model_config = ConfigDict(from_attributes=True)
276
- id: int = Field(..., description="Customer primary key", example=1)
277
- name: str = Field(..., description="Customer name", example="Acme Robotics LLC")
278
- billing_address: str = Field(..., description="Billing address", example="1200 Industrial Way, Dayton, OH 45402")
279
- contact_person: Optional[str] = Field(None, description="Contact person", example="Maria Santos")
280
- email: Optional[str] = Field(None, description="Contact email", example="m.santos@acmerobotics.com")
281
- phone: Optional[str] = Field(None, description="Contact phone", example="+1-937-555-0142")
282
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T10:15:00Z")
283
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T10:15:00Z")
284
-
285
- class CustomersListResponse(BaseModel):
286
- items: List[CustomerResponse] = Field(..., description="List of customers", example=[])
287
- total: int = Field(..., description="Total customers matching filter", example=1)
288
-
289
- class ProductTemplateCreateRequest(BaseModel):
290
- name: str = Field(..., description="Unique product template name", example="Steel Workbench Pro")
291
- description: Optional[str] = Field(None, description="Template description", example="Heavy-duty steel workbench for industrial use")
292
-
293
- class ProductTemplateResponse(BaseModel):
294
- model_config = ConfigDict(from_attributes=True)
295
- id: int = Field(..., description="Product template primary key", example=1)
296
- name: str = Field(..., description="Template name", example="Steel Workbench Pro")
297
- description: Optional[str] = Field(None, description="Template description", example="Heavy-duty steel workbench for industrial use")
298
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T10:20:00Z")
299
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T10:20:00Z")
300
-
301
- class ProductTemplatesListResponse(BaseModel):
302
- items: List[ProductTemplateResponse] = Field(..., description="List of product templates", example=[])
303
- total: int = Field(..., description="Total templates matching filter", example=1)
304
-
305
- class ProductTemplateOptionCreateRequest(BaseModel):
306
- option_name: str = Field(..., description="Name of the option", example="color")
307
- option_value: str = Field(..., description="Allowed value for the option", example="blue")
308
-
309
- class ProductTemplateOptionResponse(BaseModel):
310
- model_config = ConfigDict(from_attributes=True)
311
- id: int = Field(..., description="Option primary key", example=1)
312
- product_template_id: int = Field(..., description="Associated product template ID", example=1)
313
- option_name: str = Field(..., description="Option name", example="color")
314
- option_value: str = Field(..., description="Option value", example="blue")
315
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T10:25:00Z")
316
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T10:25:00Z")
317
-
318
- class ProductTemplateOptionsListResponse(BaseModel):
319
- items: List[ProductTemplateOptionResponse] = Field(..., description="List of template options", example=[])
320
-
321
- class StandardTaskSequenceCreateRequest(BaseModel):
322
- sequence_order: int = Field(..., description="Order of this task in the sequence", example=1)
323
- task_name: str = Field(..., description="Name of the task operation", example="cutting")
324
- default_planned_duration_hours: float = Field(..., description="Default planned duration in hours", example=1.5)
325
-
326
- class StandardTaskSequenceResponse(BaseModel):
327
- model_config = ConfigDict(from_attributes=True)
328
- id: int = Field(..., description="Standard task primary key", example=1)
329
- product_template_id: int = Field(..., description="Template ID", example=1)
330
- sequence_order: int = Field(..., description="Sequence order index", example=1)
331
- task_name: str = Field(..., description="Task name", example="cutting")
332
- default_planned_duration_hours: float = Field(..., description="Planned duration in hours", example=1.5)
333
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T10:30:00Z")
334
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T10:30:00Z")
335
-
336
- class StandardTaskSequencesListResponse(BaseModel):
337
- items: List[StandardTaskSequenceResponse] = Field(..., description="Standard task sequence steps", example=[])
338
-
339
- class CustomSpecCreateRequest(BaseModel):
340
- customer_id: int = Field(..., description="Customer ID owning the spec", example=1)
341
- product_template_id: int = Field(..., description="Product template ID", example=1)
342
- notes: Optional[str] = Field(None, description="Freeform notes about the custom spec", example="Blue 6ft workbench with powder coat")
343
-
344
- class CustomSpecResponse(BaseModel):
345
- model_config = ConfigDict(from_attributes=True)
346
- id: int = Field(..., description="Custom spec primary key", example=1)
347
- customer_id: int = Field(..., description="Customer ID", example=1)
348
- product_template_id: int = Field(..., description="Product template ID", example=1)
349
- notes: Optional[str] = Field(None, description="Notes", example="Blue 6ft workbench with powder coat")
350
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T10:35:00Z")
351
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T10:35:00Z")
352
-
353
- class CustomSpecsListResponse(BaseModel):
354
- items: List[CustomSpecResponse] = Field(..., description="Custom specs", example=[])
355
- total: int = Field(..., description="Total matching custom specs", example=1)
356
-
357
- class CustomSpecOptionUpsertRequest(BaseModel):
358
- option_name: str = Field(..., description="Option name", example="color")
359
- option_value: str = Field(..., description="Option value to store", example="blue")
360
-
361
- class CustomSpecOptionResponse(BaseModel):
362
- model_config = ConfigDict(from_attributes=True)
363
- id: int = Field(..., description="Custom spec option ID", example=1)
364
- custom_spec_id: int = Field(..., description="Parent custom spec ID", example=1)
365
- option_name: str = Field(..., description="Option name", example="color")
366
- option_value: str = Field(..., description="Option value", example="blue")
367
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T10:40:00Z")
368
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T10:45:00Z")
369
-
370
- class CustomSpecOptionsListResponse(BaseModel):
371
- items: List[CustomSpecOptionResponse] = Field(..., description="Custom spec options", example=[])
372
-
373
- class CustomSpecNumericParamUpsertRequest(BaseModel):
374
- param_name: str = Field(..., description="Parameter name", example="length")
375
- param_value: float = Field(..., description="Numeric value", example=1830.0)
376
- unit: Optional[str] = Field(None, description="Measurement unit", example="mm")
377
-
378
- class CustomSpecNumericParamResponse(BaseModel):
379
- model_config = ConfigDict(from_attributes=True)
380
- id: int = Field(..., description="Numeric param ID", example=1)
381
- custom_spec_id: int = Field(..., description="Custom spec ID", example=1)
382
- param_name: str = Field(..., description="Parameter name", example="length")
383
- param_value: float = Field(..., description="Parameter value", example=1830.0)
384
- unit: Optional[str] = Field(None, description="Parameter unit", example="mm")
385
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T10:45:00Z")
386
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T10:50:00Z")
387
-
388
- class CustomSpecNumericParamsListResponse(BaseModel):
389
- items: List[CustomSpecNumericParamResponse] = Field(..., description="Numeric parameters", example=[])
390
-
391
- class QuoteCreateRequest(BaseModel):
392
- quote_number: str = Field(..., description="Unique quote number", example="Q-2025-0147")
393
- customer_id: int = Field(..., description="Customer ID for this quote", example=1)
394
- custom_spec_id: Optional[int] = Field(None, description="Linked custom spec ID", example=1)
395
- estimated_hours: float = Field(..., description="Estimated labor hours", example=12.0)
396
- material_cost: float = Field(..., description="Estimated material cost", example=420.0)
397
- labor_rate: float = Field(..., description="Labor rate per hour", example=65.0)
398
- status: str = Field(..., description="Quote status", example="sent")
399
- internal_note: Optional[str] = Field(None, description="Internal reference note", example="Rush order requested")
400
-
401
- class QuoteResponse(BaseModel):
402
- model_config = ConfigDict(from_attributes=True)
403
- id: int = Field(..., description="Quote ID", example=1)
404
- quote_number: str = Field(..., description="Quote number", example="Q-2025-0147")
405
- customer_id: int = Field(..., description="Customer ID", example=1)
406
- custom_spec_id: Optional[int] = Field(None, description="Custom spec ID or null", example=1)
407
- estimated_hours: float = Field(..., description="Estimated hours", example=12.0)
408
- material_cost: float = Field(..., description="Material cost", example=420.0)
409
- labor_rate: float = Field(..., description="Labor rate", example=65.0)
410
- status: str = Field(..., description="Quote status", example="sent")
411
- internal_note: Optional[str] = Field(None, description="Internal note", example="Rush order requested")
412
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T10:55:00Z")
413
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T10:55:00Z")
414
-
415
- class QuotesListItemResponse(BaseModel):
416
- model_config = ConfigDict(from_attributes=True)
417
- id: int = Field(..., description="Quote ID", example=1)
418
- quote_number: str = Field(..., description="Quote number", example="Q-2025-0147")
419
- customer_id: int = Field(..., description="Customer ID", example=1)
420
- status: str = Field(..., description="Quote status", example="accepted")
421
- estimated_hours: float = Field(..., description="Estimated hours", example=12.0)
422
- material_cost: float = Field(..., description="Material cost", example=420.0)
423
- labor_rate: float = Field(..., description="Labor rate", example=65.0)
424
-
425
- class QuotesListResponse(BaseModel):
426
- items: List[QuotesListItemResponse] = Field(..., description="Quotes", example=[])
427
- total: int = Field(..., description="Total matching quotes", example=1)
428
-
429
- class QuoteUpdateRequest(BaseModel):
430
- status: Optional[str] = Field(None, description="New status for the quote", example="sent")
431
- internal_note: Optional[str] = Field(None, description="Updated internal note", example="Customer confirmed")
432
-
433
- class QuoteUpdateResponse(BaseModel):
434
- model_config = ConfigDict(from_attributes=True)
435
- id: int = Field(..., description="Quote ID", example=1)
436
- quote_number: str = Field(..., description="Quote number", example="Q-2025-0147")
437
- status: str = Field(..., description="Updated status", example="sent")
438
- internal_note: Optional[str] = Field(None, description="Updated note", example="Customer confirmed")
439
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-02T09:00:00Z")
440
-
441
- class JobCreateRequest(BaseModel):
442
- job_number: str = Field(..., description="Unique job number", example="J-2025-0332")
443
- customer_id: int = Field(..., description="Customer ID", example=1)
444
- quote_id: Optional[int] = Field(None, description="Linked quote ID", example=1)
445
- custom_spec_id: Optional[int] = Field(None, description="Linked custom spec ID", example=1)
446
- priority: str = Field(..., description="Job priority", example="high")
447
- due_date: Optional[datetime] = Field(None, description="Job due date (YYYY-MM-DD)", example="2026-01-20T00:00:00")
448
- status: str = Field(..., description="Job status", example="planned")
449
-
450
- class JobResponse(BaseModel):
451
- model_config = ConfigDict(from_attributes=True)
452
- id: int = Field(..., description="Job ID", example=1)
453
- job_number: str = Field(..., description="Job number", example="J-2025-0332")
454
- customer_id: int = Field(..., description="Customer ID", example=1)
455
- quote_id: Optional[int] = Field(None, description="Quote ID", example=1)
456
- custom_spec_id: Optional[int] = Field(None, description="Custom spec ID", example=1)
457
- priority: str = Field(..., description="Job priority", example="high")
458
- due_date: Optional[datetime] = Field(None, description="Due date", example="2026-01-20T00:00:00")
459
- status: str = Field(..., description="Job status", example="planned")
460
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T11:00:00Z")
461
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T11:00:00Z")
462
-
463
- class JobsListItemResponse(BaseModel):
464
- model_config = ConfigDict(from_attributes=True)
465
- id: int = Field(..., description="Job ID", example=1)
466
- job_number: str = Field(..., description="Job number", example="J-2025-0332")
467
- customer_id: int = Field(..., description="Customer ID", example=1)
468
- status: str = Field(..., description="Job status", example="planned")
469
- priority: str = Field(..., description="Job priority", example="high")
470
- due_date: Optional[datetime] = Field(None, description="Due date", example="2026-01-20T00:00:00")
471
-
472
- class JobsListResponse(BaseModel):
473
- items: List[JobsListItemResponse] = Field(..., description="Jobs", example=[])
474
- total: int = Field(..., description="Total matching jobs", example=1)
475
-
476
- class JobUpdateRequest(BaseModel):
477
- status: Optional[str] = Field(None, description="New job status", example="shipped")
478
- priority: Optional[str] = Field(None, description="New job priority", example="high")
479
- due_date: Optional[datetime] = Field(None, description="Updated job due date", example="2026-01-22T00:00:00")
480
-
481
- class JobUpdateResponse(BaseModel):
482
- model_config = ConfigDict(from_attributes=True)
483
- id: int = Field(..., description="Job ID", example=1)
484
- job_number: str = Field(..., description="Job number", example="J-2025-0279")
485
- status: str = Field(..., description="Updated status", example="shipped")
486
- priority: str = Field(..., description="Updated priority", example="high")
487
- due_date: Optional[datetime] = Field(None, description="Updated due date", example="2026-01-22T00:00:00")
488
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-02T10:00:00Z")
489
-
490
- class WorkCenterCreateRequest(BaseModel):
491
- name: str = Field(..., description="Unique work center name", example="Laser Cutter LC-01")
492
- description: Optional[str] = Field(None, description="Description of the work center", example="High power laser cutting machine")
493
-
494
- class WorkCenterResponse(BaseModel):
495
- model_config = ConfigDict(from_attributes=True)
496
- id: int = Field(..., description="Work center ID", example=1)
497
- name: str = Field(..., description="Work center name", example="Laser Cutter LC-01")
498
- description: Optional[str] = Field(None, description="Work center description", example="High power laser cutting machine")
499
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T11:10:00Z")
500
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T11:10:00Z")
501
-
502
- class WorkCentersListResponse(BaseModel):
503
- items: List[WorkCenterResponse] = Field(..., description="Work centers", example=[])
504
-
505
- class JobTaskCreateRequest(BaseModel):
506
- task_code: str = Field(..., description="Unique task code", example="JT-8793")
507
- job_id: int = Field(..., description="Associated job ID", example=1)
508
- sequence_order: int = Field(..., description="Order within the job sequence", example=1)
509
- task_name: str = Field(..., description="Task operation name", example="cutting")
510
- work_center_id: int = Field(..., description="Work center ID for this task", example=1)
511
- requiring_skill_level: Optional[str] = Field(None, description="Required operator skill level", example="intermediate")
512
- planned_start: Optional[datetime] = Field(None, description="Planned start datetime in ISO8601", example="2026-01-05T08:00:00")
513
- planned_finish: Optional[datetime] = Field(None, description="Planned finish datetime in ISO8601", example="2026-01-05T10:00:00")
514
- planned_duration_hours: Optional[float] = Field(None, description="Planned duration in hours", example=2.0)
515
-
516
- class JobTaskResponse(BaseModel):
517
- model_config = ConfigDict(from_attributes=True)
518
- id: int = Field(..., description="Job task ID", example=1)
519
- task_code: str = Field(..., description="Unique task code", example="JT-8793")
520
- job_id: int = Field(..., description="Job ID", example=1)
521
- sequence_order: int = Field(..., description="Sequence order", example=1)
522
- task_name: str = Field(..., description="Task name", example="cutting")
523
- work_center_id: int = Field(..., description="Work center ID", example=1)
524
- requiring_skill_level: Optional[str] = Field(None, description="Required skill level", example="intermediate")
525
- planned_start: Optional[datetime] = Field(None, description="Planned start datetime", example="2026-01-05T08:00:00")
526
- planned_finish: Optional[datetime] = Field(None, description="Planned finish datetime", example="2026-01-05T10:00:00")
527
- planned_duration_hours: Optional[float] = Field(None, description="Planned duration hours", example=2.0)
528
- actual_start: Optional[datetime] = Field(None, description="Actual start datetime or null", example=None)
529
- actual_finish: Optional[datetime] = Field(None, description="Actual finish datetime or null", example=None)
530
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T11:15:00Z")
531
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T11:15:00Z")
532
-
533
- class JobTasksListItemResponse(BaseModel):
534
- model_config = ConfigDict(from_attributes=True)
535
- id: int = Field(..., description="Task ID", example=1)
536
- task_code: str = Field(..., description="Task code", example="JT-8793")
537
- job_id: int = Field(..., description="Job ID", example=1)
538
- sequence_order: int = Field(..., description="Sequence order", example=1)
539
- task_name: str = Field(..., description="Task name", example="cutting")
540
- work_center_id: int = Field(..., description="Work center ID", example=1)
541
- planned_start: Optional[datetime] = Field(None, description="Planned start", example="2026-01-05T08:00:00")
542
- planned_finish: Optional[datetime] = Field(None, description="Planned finish", example="2026-01-05T10:00:00")
543
- planned_duration_hours: Optional[float] = Field(None, description="Planned duration", example=2.0)
544
-
545
- class JobTasksListResponse(BaseModel):
546
- items: List[JobTasksListItemResponse] = Field(..., description="Job tasks", example=[])
547
- total: int = Field(..., description="Total matching tasks", example=3)
548
-
549
- class TimeLogCreateRequest(BaseModel):
550
- job_task_id: int = Field(..., description="Job task ID being logged", example=1)
551
- operator_username: str = Field(..., description="Username of the operator", example="op_jwilliams")
552
- work_center_id: int = Field(..., description="Work center ID where work was performed", example=2)
553
- log_start: Optional[datetime] = Field(None, description="Start datetime of the log; defaults to now", example="2026-01-05T11:05:00")
554
- actual_duration_hours: float = Field(..., description="Actual duration in hours", example=2.4)
555
- scrap_quantity: Optional[int] = Field(None, description="Quantity scrapped during this log", example=1)
556
- note: Optional[str] = Field(None, description="Notes about the work performed", example="Rewelded one bracket")
557
-
558
- class TimeLogResponse(BaseModel):
559
- model_config = ConfigDict(from_attributes=True)
560
- id: int = Field(..., description="Time log ID", example=1)
561
- job_task_id: int = Field(..., description="Job task ID", example=1)
562
- operator_username: str = Field(..., description="Operator username", example="op_jwilliams")
563
- work_center_id: int = Field(..., description="Work center ID", example=2)
564
- log_start: Optional[datetime] = Field(None, description="Log start datetime", example="2026-01-05T11:05:00")
565
- actual_duration_hours: float = Field(..., description="Actual duration hours", example=2.4)
566
- scrap_quantity: Optional[int] = Field(None, description="Scrap quantity", example=1)
567
- note: Optional[str] = Field(None, description="Log note", example="Rewelded one bracket")
568
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2026-01-05T13:50:00Z")
569
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2026-01-05T13:50:00Z")
570
-
571
- class TimeLogsListItemResponse(BaseModel):
572
- model_config = ConfigDict(from_attributes=True)
573
- id: int = Field(..., description="Time log ID", example=1)
574
- job_task_id: int = Field(..., description="Job task ID", example=1)
575
- operator_username: str = Field(..., description="Operator username", example="op_jwilliams")
576
- work_center_id: int = Field(..., description="Work center ID", example=2)
577
- log_start: Optional[datetime] = Field(None, description="Log start datetime", example="2026-01-05T11:05:00")
578
- actual_duration_hours: float = Field(..., description="Duration hours", example=2.4)
579
- scrap_quantity: Optional[int] = Field(None, description="Scrap quantity", example=1)
580
-
581
- class TimeLogsListResponse(BaseModel):
582
- items: List[TimeLogsListItemResponse] = Field(..., description="Time logs", example=[])
583
- total: int = Field(..., description="Total matching time logs", example=5)
584
-
585
- class MaterialCreateRequest(BaseModel):
586
- name: str = Field(..., description="Unique material name", example="Cold Rolled Steel Sheet 2mm")
587
- unit_of_measure: str = Field(..., description="Unit of measure", example="kg")
588
-
589
- class MaterialResponse(BaseModel):
590
- model_config = ConfigDict(from_attributes=True)
591
- id: int = Field(..., description="Material ID", example=1)
592
- name: str = Field(..., description="Material name", example="Cold Rolled Steel Sheet 2mm")
593
- unit_of_measure: str = Field(..., description="Unit of measure", example="kg")
594
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T11:25:00Z")
595
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T11:25:00Z")
596
-
597
- class MaterialsListResponse(BaseModel):
598
- items: List[MaterialResponse] = Field(..., description="Materials", example=[])
599
-
600
- class InventoryLotCreateRequest(BaseModel):
601
- lot_number: str = Field(..., description="Unique lot identifier", example="LOT-CRS-2401")
602
- material_id: int = Field(..., description="Associated material ID", example=1)
603
- on_hand_quantity: float = Field(..., description="Initial on hand quantity", example=1000.0)
604
- reserved_quantity: Optional[float] = Field(0.0, description="Initial reserved quantity", example=0.0)
605
-
606
- class InventoryLotResponse(BaseModel):
607
- model_config = ConfigDict(from_attributes=True)
608
- id: int = Field(..., description="Inventory lot ID", example=1)
609
- lot_number: str = Field(..., description="Lot number", example="LOT-CRS-2401")
610
- material_id: int = Field(..., description="Material ID", example=1)
611
- on_hand_quantity: float = Field(..., description="On hand quantity", example=1000.0)
612
- reserved_quantity: float = Field(..., description="Reserved quantity", example=150.0)
613
- created_at: Optional[datetime] = Field(None, description="Creation time", example="2025-01-01T11:30:00Z")
614
- updated_at: Optional[datetime] = Field(None, description="Last update time", example="2025-01-01T11:30:00Z")
615
-
616
- class InventoryLotsListItemResponse(BaseModel):
617
- model_config = ConfigDict(from_attributes=True)
618
- id: int = Field(..., description="Lot ID", example=1)
619
- lot_number: str = Field(..., description="Lot number", example="LOT-CRS-2401")
620
- material_id: int = Field(..., description="Material ID", example=1)
621
- on_hand_quantity: float = Field(..., description="On hand quantity", example=850.0)
622
- reserved_quantity: float = Field(..., description="Reserved quantity", example=150.0)
623
-
624
- class InventoryLotsListResponse(BaseModel):
625
- items: List[InventoryLotsListItemResponse] = Field(..., description="Inventory lots", example=[])
626
-
627
- class InventoryLotAdjustRequest(BaseModel):
628
- on_hand_delta: Optional[float] = Field(None, description="Delta to apply to on_hand_quantity", example=-150.0)
629
- reserved_delta: Optional[float] = Field(None, description="Delta to apply to reserved_quantity", example=150.0)
630
-
631
- class InventoryLotAdjustResponse(BaseModel):
632
- model_config = ConfigDict(from_attributes=True)
633
- id: int = Field(..., description="Inventory lot ID", example=1)
634
- lot_number: str = Field(..., description="Lot number", example="LOT-CRS-2401")
635
- on_hand_quantity: float = Field(..., description="Updated on hand quantity", example=850.0)
636
- reserved_quantity: float = Field(..., description="Updated reserved quantity", example=150.0)
637
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-02T09:00:00Z")
638
-
639
- class MaterialReservationCreateRequest(BaseModel):
640
- job_id: int = Field(..., description="Job ID that is reserving material", example=1)
641
- inventory_lot_id: int = Field(..., description="Inventory lot ID to reserve from", example=1)
642
- quantity: float = Field(..., description="Quantity to reserve", example=150.0)
643
-
644
- class MaterialReservationResponse(BaseModel):
645
- model_config = ConfigDict(from_attributes=True)
646
- id: int = Field(..., description="Material reservation ID", example=1)
647
- job_id: int = Field(..., description="Job ID", example=1)
648
- inventory_lot_id: int = Field(..., description="Inventory lot ID", example=1)
649
- quantity: float = Field(..., description="Reserved quantity", example=150.0)
650
- created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-01T11:35:00Z")
651
- updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-01T11:35:00Z")
652
-
653
- class MaterialReservationsListItemResponse(BaseModel):
654
- model_config = ConfigDict(from_attributes=True)
655
- id: int = Field(..., description="Reservation ID", example=1)
656
- job_id: int = Field(..., description="Job ID", example=1)
657
- inventory_lot_id: int = Field(..., description="Inventory lot ID", example=1)
658
- quantity: float = Field(..., description="Reserved quantity", example=150.0)
659
-
660
- class MaterialReservationsListResponse(BaseModel):
661
- items: List[MaterialReservationsListItemResponse] = Field(..., description="Material reservations", example=[])
662
-
663
- class ShipmentCreateRequest(BaseModel):
664
- shipment_number: str = Field(..., description="Unique shipment number", example="SHP-2025-0101")
665
- job_id: int = Field(..., description="Job ID being shipped", example=1)
666
- customer_id: int = Field(..., description="Customer receiving the shipment", example=1)
667
- delivery_status: str = Field(..., description="Shipment status", example="in_transit")
668
- shipped_at: Optional[datetime] = Field(None, description="Datetime when shipment left the facility", example="2026-01-10T15:00:00")
669
- delivered_at: Optional[datetime] = Field(None, description="Datetime when shipment was delivered", example=None)
670
-
671
- class ShipmentResponse(BaseModel):
672
- model_config = ConfigDict(from_attributes=True)
673
- id: int = Field(..., description="Shipment ID", example=1)
674
- shipment_number: str = Field(..., description="Shipment number", example="SHP-2025-0101")
675
- job_id: int = Field(..., description="Job ID", example=1)
676
- customer_id: int = Field(..., description="Customer ID", example=1)
677
- delivery_status: str = Field(..., description="Shipment status", example="in_transit")
678
- shipped_at: Optional[datetime] = Field(None, description="Shipped datetime", example="2026-01-10T15:00:00")
679
- delivered_at: Optional[datetime] = Field(None, description="Delivered datetime or null", example=None)
680
- created_at: Optional[datetime] = Field(None, description="Creation time", example="2026-01-10T15:05:00Z")
681
- updated_at: Optional[datetime] = Field(None, description="Last update time", example="2026-01-10T15:05:00Z")
682
-
683
- class ShipmentsListItemResponse(BaseModel):
684
- model_config = ConfigDict(from_attributes=True)
685
- id: int = Field(..., description="Shipment ID", example=1)
686
- shipment_number: str = Field(..., description="Shipment number", example="SHP-2025-0101")
687
- job_id: int = Field(..., description="Job ID", example=1)
688
- customer_id: int = Field(..., description="Customer ID", example=1)
689
- delivery_status: str = Field(..., description="Shipment status", example="in_transit")
690
-
691
- class ShipmentsListResponse(BaseModel):
692
- items: List[ShipmentsListItemResponse] = Field(..., description="Shipments", example=[])
693
-
694
- class ShipmentUpdateRequest(BaseModel):
695
- delivery_status: Optional[str] = Field(None, description="New delivery status", example="delivered")
696
- shipped_at: Optional[datetime] = Field(None, description="Updated shipped_at datetime", example="2026-01-10T15:00:00")
697
- delivered_at: Optional[datetime] = Field(None, description="Updated delivered_at datetime", example="2026-01-15T11:30:00")
698
-
699
- class ShipmentUpdateResponse(BaseModel):
700
- model_config = ConfigDict(from_attributes=True)
701
- id: int = Field(..., description="Shipment ID", example=1)
702
- shipment_number: str = Field(..., description="Shipment number", example="SHP-2025-0101")
703
- delivery_status: str = Field(..., description="Updated delivery status", example="delivered")
704
- shipped_at: Optional[datetime] = Field(None, description="Shipped datetime", example="2026-01-10T15:00:00")
705
- delivered_at: Optional[datetime] = Field(None, description="Delivered datetime", example="2026-01-15T11:30:00")
706
- updated_at: Optional[datetime] = Field(None, description="Last update time", example="2026-01-15T11:35:00Z")
707
-
708
- class ShipmentPackageCreateRequest(BaseModel):
709
- shipment_id: int = Field(..., description="Shipment ID that this package belongs to", example=1)
710
- package_number: int = Field(..., description="Sequential package number within the shipment", example=1)
711
- weight_kg: float = Field(..., description="Weight of the package in kg", example=45.0)
712
- tracking_number: str = Field(..., description="Unique tracking number", example="CBX123456US")
713
-
714
- class ShipmentPackageResponse(BaseModel):
715
- model_config = ConfigDict(from_attributes=True)
716
- id: int = Field(..., description="Shipment package ID", example=1)
717
- shipment_id: int = Field(..., description="Shipment ID", example=1)
718
- package_number: int = Field(..., description="Package number within shipment", example=1)
719
- weight_kg: float = Field(..., description="Package weight in kg", example=45.0)
720
- tracking_number: str = Field(..., description="Tracking number", example="CBX123456US")
721
- created_at: Optional[datetime] = Field(None, description="Creation time", example="2026-01-10T15:10:00Z")
722
- updated_at: Optional[datetime] = Field(None, description="Last update time", example="2026-01-10T15:10:00Z")
723
-
724
- class ShipmentPackagesListItemResponse(BaseModel):
725
- model_config = ConfigDict(from_attributes=True)
726
- id: int = Field(..., description="Package ID", example=1)
727
- shipment_id: int = Field(..., description="Shipment ID", example=1)
728
- package_number: int = Field(..., description="Package number", example=1)
729
- weight_kg: float = Field(..., description="Weight in kg", example=38.5)
730
- tracking_number: str = Field(..., description="Tracking number", example="CBX123457US")
731
-
732
- class ShipmentPackagesListResponse(BaseModel):
733
- items: List[ShipmentPackagesListItemResponse] = Field(..., description="Shipment packages", example=[])
734
-
735
- class CapacityTaskItem(BaseModel):
736
- job_task_id: int = Field(..., description="Job task ID", example=10)
737
- task_code: str = Field(..., description="Task code", example="JT-8801")
738
- job_id: int = Field(..., description="Job ID", example=5)
739
- task_name: str = Field(..., description="Task name", example="cutting")
740
- planned_start: Optional[datetime] = Field(None, description="Planned start datetime", example="2026-01-05T08:00:00")
741
- planned_finish: Optional[datetime] = Field(None, description="Planned finish datetime", example="2026-01-05T10:00:00")
742
- planned_duration_hours: Optional[float] = Field(None, description="Planned hours for this task", example=2.0)
743
- actual_hours: float = Field(..., description="Sum of actual_duration_hours from time_logs", example=1.8)
744
-
745
- class CapacityUtilizationResponse(BaseModel):
746
- work_center_id: int = Field(..., description="Analyzed work center ID", example=1)
747
- planned_from: datetime = Field(..., description="Start of analysis window", example="2026-01-01T00:00:00")
748
- planned_to: datetime = Field(..., description="End of analysis window", example="2026-01-31T23:59:59")
749
- total_planned_hours: float = Field(..., description="Sum of planned_duration_hours", example=120.0)
750
- total_actual_hours: float = Field(..., description="Sum of actual_duration_hours", example=98.5)
751
- job_tasks: List[CapacityTaskItem] = Field(..., description="Job tasks scheduled in the period", example=[])
752
-
753
- @app.post("/api/customers", response_model=CustomerResponse, summary="Create a new customer", description="Add a new customer with billing and contact details", tags=["customers"], operation_id="create_customer")
754
- async def create_customer(request: CustomerCreateRequest = Body(...)) -> CustomerResponse:
755
- session = SessionLocal()
756
- obj = Customer(
757
- name=request.name,
758
- billing_address=request.billing_address,
759
- contact_person=request.contact_person,
760
- email=request.email,
761
- phone=request.phone,
762
- created_at=datetime.utcnow(),
763
- updated_at=datetime.utcnow(),
764
- )
765
- session.add(obj)
766
- session.commit()
767
- session.refresh(obj)
768
- session.close()
769
- return CustomerResponse.model_validate(obj)
770
-
771
- @app.get("/api/customers", response_model=CustomersListResponse, summary="List customers with optional name filter", description="Retrieve customers, optionally filtering by exact or partial name", tags=["customers"], operation_id="list_customers")
772
- async def list_customers(name: Optional[str] = Query(None, description="Filter by name containing this text", example="Acme"), limit: Optional[int] = Query(50, description="Maximum records to return", example=50), offset: Optional[int] = Query(0, description="Offset for pagination", example=0)) -> CustomersListResponse:
773
- session = SessionLocal()
774
- query = session.query(Customer)
775
- if name is not None:
776
- query = query.filter(Customer.name.contains(name))
777
- total = query.count()
778
- objs = query.offset(offset).limit(limit).all()
779
- items = [CustomerResponse.model_validate(o) for o in objs]
780
- session.close()
781
- return CustomersListResponse(items=items, total=total)
782
-
783
- @app.get("/api/customers/{customer_id}", response_model=CustomerResponse, summary="Get a customer by ID", description="Retrieve a single customer record by its numeric ID", tags=["customers"], operation_id="get_customer_by_id")
784
- async def get_customer_by_id(customer_id: int = Path(..., description="Customer primary key ID", example=1)) -> CustomerResponse:
785
- session = SessionLocal()
786
- obj = session.query(Customer).filter(Customer.id == customer_id).first()
787
- session.close()
788
- if obj is None:
789
- return CustomerResponse(id=0, name="", billing_address="", contact_person=None, email=None, phone=None, created_at=None, updated_at=None)
790
- return CustomerResponse.model_validate(obj)
791
-
792
- @app.get("/api/customers/by-name/{customer_name}", response_model=CustomerResponse, summary="Get a customer by exact name", description="Lookup a single customer using its unique name", tags=["customers"], operation_id="get_customer_by_name")
793
- async def get_customer_by_name(customer_name: str = Path(..., description="Exact customer name to lookup", example="Acme Robotics LLC")) -> CustomerResponse:
794
- session = SessionLocal()
795
- obj = session.query(Customer).filter(Customer.name == customer_name).first()
796
- session.close()
797
- if obj is None:
798
- return CustomerResponse(id=0, name="", billing_address="", contact_person=None, email=None, phone=None, created_at=None, updated_at=None)
799
- return CustomerResponse.model_validate(obj)
800
-
801
- @app.post("/api/product-templates", response_model=ProductTemplateResponse, summary="Create a new product template", description="Define a new product template record with optional description", tags=["product_templates"], operation_id="create_product_template")
802
- async def create_product_template(request: ProductTemplateCreateRequest = Body(...)) -> ProductTemplateResponse:
803
- session = SessionLocal()
804
- obj = ProductTemplate(
805
- name=request.name,
806
- description=request.description,
807
- created_at=datetime.utcnow(),
808
- updated_at=datetime.utcnow(),
809
- )
810
- session.add(obj)
811
- session.commit()
812
- session.refresh(obj)
813
- session.close()
814
- return ProductTemplateResponse.model_validate(obj)
815
-
816
- @app.get("/api/product-templates", response_model=ProductTemplatesListResponse, summary="List product templates", description="Retrieve product templates with optional name filter", tags=["product_templates"], operation_id="list_product_templates")
817
- async def list_product_templates(name: Optional[str] = Query(None, description="Filter templates containing this name", example="Workbench"), limit: Optional[int] = Query(50, description="Max number of templates to return", example=50), offset: Optional[int] = Query(0, description="Offset for pagination", example=0)) -> ProductTemplatesListResponse:
818
- session = SessionLocal()
819
- query = session.query(ProductTemplate)
820
- if name is not None:
821
- query = query.filter(ProductTemplate.name.contains(name))
822
- total = query.count()
823
- objs = query.offset(offset).limit(limit).all()
824
- items = [ProductTemplateResponse.model_validate(o) for o in objs]
825
- session.close()
826
- return ProductTemplatesListResponse(items=items, total=total)
827
-
828
- @app.get("/api/product-templates/{product_template_id}", response_model=ProductTemplateResponse, summary="Get product template by ID", description="Retrieve a single product template using its ID", tags=["product_templates"], operation_id="get_product_template_by_id")
829
- async def get_product_template_by_id(product_template_id: int = Path(..., description="Product template ID", example=1)) -> ProductTemplateResponse:
830
- session = SessionLocal()
831
- obj = session.query(ProductTemplate).filter(ProductTemplate.id == product_template_id).first()
832
- session.close()
833
- if obj is None:
834
- return ProductTemplateResponse(id=0, name="", description=None, created_at=None, updated_at=None)
835
- return ProductTemplateResponse.model_validate(obj)
836
-
837
- @app.get("/api/product-templates/by-name/{template_name}", response_model=ProductTemplateResponse, summary="Get product template by exact name", description="Lookup a product template using its unique name", tags=["product_templates"], operation_id="get_product_template_by_name")
838
- async def get_product_template_by_name(template_name: str = Path(..., description="Exact product template name", example="Steel Workbench Pro")) -> ProductTemplateResponse:
839
- session = SessionLocal()
840
- obj = session.query(ProductTemplate).filter(ProductTemplate.name == template_name).first()
841
- session.close()
842
- if obj is None:
843
- return ProductTemplateResponse(id=0, name="", description=None, created_at=None, updated_at=None)
844
- return ProductTemplateResponse.model_validate(obj)
845
-
846
- @app.post("/api/product-templates/{product_template_id}/options", response_model=ProductTemplateOptionResponse, summary="Create an option for a product template", description="Add a single option value for a given product template", tags=["product_template_options"], operation_id="create_product_template_option")
847
- async def create_product_template_option(product_template_id: int = Path(..., description="Parent product template ID", example=1), request: ProductTemplateOptionCreateRequest = Body(...)) -> ProductTemplateOptionResponse:
848
- session = SessionLocal()
849
- obj = ProductTemplateOption(
850
- product_template_id=product_template_id,
851
- option_name=request.option_name,
852
- option_value=request.option_value,
853
- created_at=datetime.utcnow(),
854
- updated_at=datetime.utcnow(),
855
- )
856
- session.add(obj)
857
- session.commit()
858
- session.refresh(obj)
859
- session.close()
860
- return ProductTemplateOptionResponse.model_validate(obj)
861
-
862
- @app.get("/api/product-templates/{product_template_id}/options", response_model=ProductTemplateOptionsListResponse, summary="List options for a product template", description="Retrieve all option values for a specific product template", tags=["product_template_options"], operation_id="list_product_template_options")
863
- async def list_product_template_options(product_template_id: int = Path(..., description="Product template ID", example=1), option_name: Optional[str] = Query(None, description="Filter by option name", example="color")) -> ProductTemplateOptionsListResponse:
864
- session = SessionLocal()
865
- query = session.query(ProductTemplateOption).filter(ProductTemplateOption.product_template_id == product_template_id)
866
- if option_name is not None:
867
- query = query.filter(ProductTemplateOption.option_name == option_name)
868
- objs = query.all()
869
- items = [ProductTemplateOptionResponse.model_validate(o) for o in objs]
870
- session.close()
871
- return ProductTemplateOptionsListResponse(items=items)
872
-
873
- @app.post("/api/product-templates/{product_template_id}/standard-tasks", response_model=StandardTaskSequenceResponse, summary="Create a standard task for a template", description="Add a single task step into a product template's standard sequence", tags=["standard_task_sequences"], operation_id="create_standard_task_sequence")
874
- async def create_standard_task_sequence(product_template_id: int = Path(..., description="Product template ID", example=1), request: StandardTaskSequenceCreateRequest = Body(...)) -> StandardTaskSequenceResponse:
875
- session = SessionLocal()
876
- obj = StandardTaskSequence(
877
- product_template_id=product_template_id,
878
- sequence_order=request.sequence_order,
879
- task_name=request.task_name,
880
- default_planned_duration_hours=request.default_planned_duration_hours,
881
- created_at=datetime.utcnow(),
882
- updated_at=datetime.utcnow(),
883
- )
884
- session.add(obj)
885
- session.commit()
886
- session.refresh(obj)
887
- session.close()
888
- return StandardTaskSequenceResponse.model_validate(obj)
889
-
890
- @app.get("/api/product-templates/{product_template_id}/standard-tasks", response_model=StandardTaskSequencesListResponse, summary="List standard tasks for a template", description="Retrieve all standard tasks for a product template ordered by sequence", tags=["standard_task_sequences"], operation_id="list_standard_task_sequences")
891
- async def list_standard_task_sequences(product_template_id: int = Path(..., description="Product template ID", example=1)) -> StandardTaskSequencesListResponse:
892
- session = SessionLocal()
893
- objs = session.query(StandardTaskSequence).filter(StandardTaskSequence.product_template_id == product_template_id).order_by(StandardTaskSequence.sequence_order.asc()).all()
894
- items = [StandardTaskSequenceResponse.model_validate(o) for o in objs]
895
- session.close()
896
- return StandardTaskSequencesListResponse(items=items)
897
-
898
- @app.post("/api/custom-specs", response_model=CustomSpecResponse, summary="Create a custom specification", description="Create a custom specification linking a customer and product template", tags=["custom_specs"], operation_id="create_custom_spec")
899
- async def create_custom_spec(request: CustomSpecCreateRequest = Body(...)) -> CustomSpecResponse:
900
- session = SessionLocal()
901
- obj = CustomSpec(
902
- customer_id=request.customer_id,
903
- product_template_id=request.product_template_id,
904
- notes=request.notes,
905
- created_at=datetime.utcnow(),
906
- updated_at=datetime.utcnow(),
907
- )
908
- session.add(obj)
909
- session.commit()
910
- session.refresh(obj)
911
- session.close()
912
- return CustomSpecResponse.model_validate(obj)
913
-
914
- @app.get("/api/custom-specs", response_model=CustomSpecsListResponse, summary="List custom specs", description="List custom specs with optional filters by customer or product template", tags=["custom_specs"], operation_id="list_custom_specs")
915
- async def list_custom_specs(customer_id: Optional[int] = Query(None, description="Filter by customer ID", example=1), product_template_id: Optional[int] = Query(None, description="Filter by product template ID", example=1), limit: Optional[int] = Query(50, description="Max records to return", example=50), offset: Optional[int] = Query(0, description="Offset for pagination", example=0)) -> CustomSpecsListResponse:
916
- session = SessionLocal()
917
- query = session.query(CustomSpec)
918
- if customer_id is not None:
919
- query = query.filter(CustomSpec.customer_id == customer_id)
920
- if product_template_id is not None:
921
- query = query.filter(CustomSpec.product_template_id == product_template_id)
922
- total = query.count()
923
- objs = query.offset(offset).limit(limit).all()
924
- items = [CustomSpecResponse.model_validate(o) for o in objs]
925
- session.close()
926
- return CustomSpecsListResponse(items=items, total=total)
927
-
928
- @app.get("/api/custom-specs/{custom_spec_id}", response_model=CustomSpecResponse, summary="Get custom spec by ID", description="Retrieve a single custom spec by its ID", tags=["custom_specs"], operation_id="get_custom_spec_by_id")
929
- async def get_custom_spec_by_id(custom_spec_id: int = Path(..., description="Custom spec ID", example=1)) -> CustomSpecResponse:
930
- session = SessionLocal()
931
- obj = session.query(CustomSpec).filter(CustomSpec.id == custom_spec_id).first()
932
- session.close()
933
- if obj is None:
934
- return CustomSpecResponse(id=0, customer_id=0, product_template_id=0, notes=None, created_at=None, updated_at=None)
935
- return CustomSpecResponse.model_validate(obj)
936
-
937
- @app.post("/api/custom-specs/{custom_spec_id}/options", response_model=CustomSpecOptionResponse, summary="Create or update a custom spec option", description="Set a named option value for a custom spec, upserting by option name", tags=["custom_spec_options"], operation_id="upsert_custom_spec_option")
938
- async def upsert_custom_spec_option(custom_spec_id: int = Path(..., description="Custom spec ID", example=1), request: CustomSpecOptionUpsertRequest = Body(...)) -> CustomSpecOptionResponse:
939
- session = SessionLocal()
940
- obj = session.query(CustomSpecOption).filter(CustomSpecOption.custom_spec_id == custom_spec_id, CustomSpecOption.option_name == request.option_name).first()
941
- now = datetime.utcnow()
942
- if obj is None:
943
- obj = CustomSpecOption(
944
- custom_spec_id=custom_spec_id,
945
- option_name=request.option_name,
946
- option_value=request.option_value,
947
- created_at=now,
948
- updated_at=now,
949
- )
950
- session.add(obj)
951
- else:
952
- obj.option_value = request.option_value
953
- obj.updated_at = now
954
- session.commit()
955
- session.refresh(obj)
956
- session.close()
957
- return CustomSpecOptionResponse.model_validate(obj)
958
-
959
- @app.get("/api/custom-specs/{custom_spec_id}/options", response_model=CustomSpecOptionsListResponse, summary="List options for a custom spec", description="Retrieve all option name/value pairs for a custom spec", tags=["custom_spec_options"], operation_id="list_custom_spec_options")
960
- async def list_custom_spec_options(custom_spec_id: int = Path(..., description="Custom spec ID", example=1)) -> CustomSpecOptionsListResponse:
961
- session = SessionLocal()
962
- objs = session.query(CustomSpecOption).filter(CustomSpecOption.custom_spec_id == custom_spec_id).all()
963
- items = [CustomSpecOptionResponse.model_validate(o) for o in objs]
964
- session.close()
965
- return CustomSpecOptionsListResponse(items=items)
966
-
967
- @app.post("/api/custom-specs/{custom_spec_id}/numeric-params", response_model=CustomSpecNumericParamResponse, summary="Create or update a numeric param", description="Set a numeric parameter with unit for a custom spec, upserting by name", tags=["custom_spec_numeric_params"], operation_id="upsert_custom_spec_numeric_param")
968
- async def upsert_custom_spec_numeric_param(custom_spec_id: int = Path(..., description="Custom spec ID", example=1), request: CustomSpecNumericParamUpsertRequest = Body(...)) -> CustomSpecNumericParamResponse:
969
- session = SessionLocal()
970
- obj = session.query(CustomSpecNumericParam).filter(CustomSpecNumericParam.custom_spec_id == custom_spec_id, CustomSpecNumericParam.param_name == request.param_name).first()
971
- now = datetime.utcnow()
972
- if obj is None:
973
- obj = CustomSpecNumericParam(
974
- custom_spec_id=custom_spec_id,
975
- param_name=request.param_name,
976
- param_value=request.param_value,
977
- unit=request.unit,
978
- created_at=now,
979
- updated_at=now,
980
- )
981
- session.add(obj)
982
- else:
983
- obj.param_value = request.param_value
984
- obj.unit = request.unit
985
- obj.updated_at = now
986
- session.commit()
987
- session.refresh(obj)
988
- session.close()
989
- return CustomSpecNumericParamResponse.model_validate(obj)
990
-
991
- @app.get("/api/custom-specs/{custom_spec_id}/numeric-params", response_model=CustomSpecNumericParamsListResponse, summary="List numeric params for a custom spec", description="Retrieve all numeric parameters and units for a custom spec", tags=["custom_spec_numeric_params"], operation_id="list_custom_spec_numeric_params")
992
- async def list_custom_spec_numeric_params(custom_spec_id: int = Path(..., description="Custom spec ID", example=1)) -> CustomSpecNumericParamsListResponse:
993
- session = SessionLocal()
994
- objs = session.query(CustomSpecNumericParam).filter(CustomSpecNumericParam.custom_spec_id == custom_spec_id).all()
995
- items = [CustomSpecNumericParamResponse.model_validate(o) for o in objs]
996
- session.close()
997
- return CustomSpecNumericParamsListResponse(items=items)
998
-
999
- @app.post("/api/quotes", response_model=QuoteResponse, summary="Create a quote", description="Create a quote linked to a customer and optional custom spec", tags=["quotes"], operation_id="create_quote")
1000
- async def create_quote(request: QuoteCreateRequest = Body(...)) -> QuoteResponse:
1001
- session = SessionLocal()
1002
- obj = Quote(
1003
- quote_number=request.quote_number,
1004
- customer_id=request.customer_id,
1005
- custom_spec_id=request.custom_spec_id,
1006
- estimated_hours=request.estimated_hours,
1007
- material_cost=request.material_cost,
1008
- labor_rate=request.labor_rate,
1009
- status=request.status,
1010
- internal_note=request.internal_note,
1011
- created_at=datetime.utcnow(),
1012
- updated_at=datetime.utcnow(),
1013
- )
1014
- session.add(obj)
1015
- session.commit()
1016
- session.refresh(obj)
1017
- session.close()
1018
- return QuoteResponse.model_validate(obj)
1019
-
1020
- @app.get("/api/quotes", response_model=QuotesListResponse, summary="List quotes with filters", description="Retrieve quotes filtered by customer, status, or quote number", tags=["quotes"], operation_id="list_quotes")
1021
- async def list_quotes(quote_number: Optional[str] = Query(None, description="Filter by exact quote number", example="Q-2025-0147"), customer_id: Optional[int] = Query(None, description="Filter by customer ID", example=1), status: Optional[str] = Query(None, description="Filter by quote status", example="accepted"), limit: Optional[int] = Query(50, description="Max records to return", example=50), offset: Optional[int] = Query(0, description="Offset for pagination", example=0)) -> QuotesListResponse:
1022
- session = SessionLocal()
1023
- query = session.query(Quote)
1024
- if quote_number is not None:
1025
- query = query.filter(Quote.quote_number == quote_number)
1026
- if customer_id is not None:
1027
- query = query.filter(Quote.customer_id == customer_id)
1028
- if status is not None:
1029
- query = query.filter(Quote.status == status)
1030
- total = query.count()
1031
- objs = query.offset(offset).limit(limit).all()
1032
- items = [QuotesListItemResponse.model_validate(o) for o in objs]
1033
- session.close()
1034
- return QuotesListResponse(items=items, total=total)
1035
-
1036
- @app.get("/api/quotes/by-number/{quote_number}", response_model=QuoteResponse, summary="Get quote by quote number", description="Retrieve a single quote by its unique quote_number", tags=["quotes"], operation_id="get_quote_by_number")
1037
- async def get_quote_by_number(quote_number: str = Path(..., description="Exact quote number to lookup", example="Q-2025-0147")) -> QuoteResponse:
1038
- session = SessionLocal()
1039
- obj = session.query(Quote).filter(Quote.quote_number == quote_number).first()
1040
- session.close()
1041
- if obj is None:
1042
- return QuoteResponse(id=0, quote_number="", customer_id=0, custom_spec_id=None, estimated_hours=0.0, material_cost=0.0, labor_rate=0.0, status="", internal_note=None, created_at=None, updated_at=None)
1043
- return QuoteResponse.model_validate(obj)
1044
-
1045
- @app.patch("/api/quotes/{quote_id}", response_model=QuoteUpdateResponse, summary="Update quote status or note", description="Update mutable fields such as status or internal_note for a quote", tags=["quotes"], operation_id="update_quote_partial")
1046
- async def update_quote_partial(quote_id: int = Path(..., description="Quote ID to update", example=1), request: QuoteUpdateRequest = Body(...)) -> QuoteUpdateResponse:
1047
- session = SessionLocal()
1048
- obj = session.query(Quote).filter(Quote.id == quote_id).first()
1049
- now = datetime.utcnow()
1050
- if obj is not None:
1051
- if request.status is not None:
1052
- obj.status = request.status
1053
- if request.internal_note is not None:
1054
- obj.internal_note = request.internal_note
1055
- obj.updated_at = now
1056
- session.commit()
1057
- session.refresh(obj)
1058
- session.close()
1059
- if obj is None:
1060
- return QuoteUpdateResponse(id=0, quote_number="", status="", internal_note=None, updated_at=None)
1061
- return QuoteUpdateResponse.model_validate(obj)
1062
-
1063
- @app.post("/api/jobs", response_model=JobResponse, summary="Create a job", description="Create a manufacturing job linked to customer, quote, and custom spec", tags=["jobs"], operation_id="create_job")
1064
- async def create_job(request: JobCreateRequest = Body(...)) -> JobResponse:
1065
- session = SessionLocal()
1066
- due = None
1067
- if request.due_date is not None:
1068
- if isinstance(request.due_date, datetime):
1069
- due = request.due_date.date()
1070
- obj = Job(
1071
- job_number=request.job_number,
1072
- customer_id=request.customer_id,
1073
- quote_id=request.quote_id,
1074
- custom_spec_id=request.custom_spec_id,
1075
- priority=request.priority,
1076
- due_date=due,
1077
- status=request.status,
1078
- created_at=datetime.utcnow(),
1079
- updated_at=datetime.utcnow(),
1080
- )
1081
- session.add(obj)
1082
- session.commit()
1083
- session.refresh(obj)
1084
- session.close()
1085
- resp_due = None
1086
- if obj.due_date is not None:
1087
- resp_due = datetime.combine(obj.due_date, datetime.min.time())
1088
- return JobResponse(
1089
- id=obj.id,
1090
- job_number=obj.job_number,
1091
- customer_id=obj.customer_id,
1092
- quote_id=obj.quote_id,
1093
- custom_spec_id=obj.custom_spec_id,
1094
- priority=obj.priority,
1095
- due_date=resp_due,
1096
- status=obj.status,
1097
- created_at=obj.created_at,
1098
- updated_at=obj.updated_at,
1099
- )
1100
-
1101
- @app.get("/api/jobs", response_model=JobsListResponse, summary="List jobs with filters", description="Retrieve jobs filtered by customer, status, or job_number", tags=["jobs"], operation_id="list_jobs")
1102
- async def list_jobs(job_number: Optional[str] = Query(None, description="Filter by exact job number", example="J-2025-0332"), customer_id: Optional[int] = Query(None, description="Filter by customer ID", example=1), status: Optional[str] = Query(None, description="Filter by job status", example="planned"), due_date_from: Optional[datetime] = Query(None, description="Filter by due date on or after this date", example="2026-01-01T00:00:00"), due_date_to: Optional[datetime] = Query(None, description="Filter by due date on or before this date", example="2026-01-31T00:00:00"), limit: Optional[int] = Query(50, description="Max records to return", example=50), offset: Optional[int] = Query(0, description="Offset for pagination", example=0)) -> JobsListResponse:
1103
- session = SessionLocal()
1104
- query = session.query(Job)
1105
- if job_number is not None:
1106
- query = query.filter(Job.job_number == job_number)
1107
- if customer_id is not None:
1108
- query = query.filter(Job.customer_id == customer_id)
1109
- if status is not None:
1110
- query = query.filter(Job.status == status)
1111
- if due_date_from is not None:
1112
- query = query.filter(Job.due_date >= due_date_from.date())
1113
- if due_date_to is not None:
1114
- query = query.filter(Job.due_date <= due_date_to.date())
1115
- total = query.count()
1116
- objs = query.offset(offset).limit(limit).all()
1117
- items: List[JobsListItemResponse] = []
1118
- for o in objs:
1119
- resp_due = None
1120
- if o.due_date is not None:
1121
- resp_due = datetime.combine(o.due_date, datetime.min.time())
1122
- items.append(JobsListItemResponse(id=o.id, job_number=o.job_number, customer_id=o.customer_id, status=o.status, priority=o.priority, due_date=resp_due))
1123
- session.close()
1124
- return JobsListResponse(items=items, total=total)
1125
-
1126
- @app.get("/api/jobs/by-number/{job_number}", response_model=JobResponse, summary="Get job by job number", description="Retrieve a single job by its unique job_number", tags=["jobs"], operation_id="get_job_by_number")
1127
- async def get_job_by_number(job_number: str = Path(..., description="Exact job number to lookup", example="J-2025-0332")) -> JobResponse:
1128
- session = SessionLocal()
1129
- obj = session.query(Job).filter(Job.job_number == job_number).first()
1130
- session.close()
1131
- if obj is None:
1132
- return JobResponse(id=0, job_number="", customer_id=0, quote_id=None, custom_spec_id=None, priority="", due_date=None, status="", created_at=None, updated_at=None)
1133
- resp_due = None
1134
- if obj.due_date is not None:
1135
- resp_due = datetime.combine(obj.due_date, datetime.min.time())
1136
- return JobResponse(id=obj.id, job_number=obj.job_number, customer_id=obj.customer_id, quote_id=obj.quote_id, custom_spec_id=obj.custom_spec_id, priority=obj.priority, due_date=resp_due, status=obj.status, created_at=obj.created_at, updated_at=obj.updated_at)
1137
-
1138
- @app.patch("/api/jobs/{job_id}", response_model=JobUpdateResponse, summary="Update job status or priority", description="Update mutable job fields like status, priority, or due_date", tags=["jobs"], operation_id="update_job_partial")
1139
- async def update_job_partial(job_id: int = Path(..., description="Job ID to update", example=1), request: JobUpdateRequest = Body(...)) -> JobUpdateResponse:
1140
- session = SessionLocal()
1141
- obj = session.query(Job).filter(Job.id == job_id).first()
1142
- now = datetime.utcnow()
1143
- if obj is not None:
1144
- if request.status is not None:
1145
- obj.status = request.status
1146
- if request.priority is not None:
1147
- obj.priority = request.priority
1148
- if request.due_date is not None:
1149
- if isinstance(request.due_date, datetime):
1150
- obj.due_date = request.due_date.date()
1151
- obj.updated_at = now
1152
- session.commit()
1153
- session.refresh(obj)
1154
- session.close()
1155
- if obj is None:
1156
- return JobUpdateResponse(id=0, job_number="", status="", priority="", due_date=None, updated_at=None)
1157
- resp_due = None
1158
- if obj.due_date is not None:
1159
- resp_due = datetime.combine(obj.due_date, datetime.min.time())
1160
- return JobUpdateResponse(id=obj.id, job_number=obj.job_number, status=obj.status, priority=obj.priority, due_date=resp_due, updated_at=obj.updated_at)
1161
-
1162
- @app.post("/api/work-centers", response_model=WorkCenterResponse, summary="Create a work center", description="Create a new work center such as a machine or cell", tags=["work_centers"], operation_id="create_work_center")
1163
- async def create_work_center(request: WorkCenterCreateRequest = Body(...)) -> WorkCenterResponse:
1164
- session = SessionLocal()
1165
- obj = WorkCenter(
1166
- name=request.name,
1167
- description=request.description,
1168
- created_at=datetime.utcnow(),
1169
- updated_at=datetime.utcnow(),
1170
- )
1171
- session.add(obj)
1172
- session.commit()
1173
- session.refresh(obj)
1174
- session.close()
1175
- return WorkCenterResponse.model_validate(obj)
1176
-
1177
- @app.get("/api/work-centers", response_model=WorkCentersListResponse, summary="List work centers", description="Retrieve work centers with optional name filter", tags=["work_centers"], operation_id="list_work_centers")
1178
- async def list_work_centers(name: Optional[str] = Query(None, description="Filter by name containing this text", example="Laser Cutter")) -> WorkCentersListResponse:
1179
- session = SessionLocal()
1180
- query = session.query(WorkCenter)
1181
- if name is not None:
1182
- query = query.filter(WorkCenter.name.contains(name))
1183
- objs = query.all()
1184
- items = [WorkCenterResponse.model_validate(o) for o in objs]
1185
- session.close()
1186
- return WorkCentersListResponse(items=items)
1187
-
1188
- @app.get("/api/work-centers/by-name/{work_center_name}", response_model=WorkCenterResponse, summary="Get work center by name", description="Lookup a work center by its unique name", tags=["work_centers"], operation_id="get_work_center_by_name")
1189
- async def get_work_center_by_name(work_center_name: str = Path(..., description="Exact work center name", example="Laser Cutter LC-01")) -> WorkCenterResponse:
1190
- session = SessionLocal()
1191
- obj = session.query(WorkCenter).filter(WorkCenter.name == work_center_name).first()
1192
- session.close()
1193
- if obj is None:
1194
- return WorkCenterResponse(id=0, name="", description=None, created_at=None, updated_at=None)
1195
- return WorkCenterResponse.model_validate(obj)
1196
-
1197
- @app.post("/api/job-tasks", response_model=JobTaskResponse, summary="Create a job task", description="Create a single job task step for a specific job and work center", tags=["job_tasks"], operation_id="create_job_task")
1198
- async def create_job_task(request: JobTaskCreateRequest = Body(...)) -> JobTaskResponse:
1199
- session = SessionLocal()
1200
- obj = JobTask(
1201
- task_code=request.task_code,
1202
- job_id=request.job_id,
1203
- sequence_order=request.sequence_order,
1204
- task_name=request.task_name,
1205
- work_center_id=request.work_center_id,
1206
- requiring_skill_level=request.requiring_skill_level,
1207
- planned_start=request.planned_start,
1208
- planned_finish=request.planned_finish,
1209
- planned_duration_hours=request.planned_duration_hours,
1210
- actual_start=None,
1211
- actual_finish=None,
1212
- created_at=datetime.utcnow(),
1213
- updated_at=datetime.utcnow(),
1214
- )
1215
- session.add(obj)
1216
- session.commit()
1217
- session.refresh(obj)
1218
- session.close()
1219
- return JobTaskResponse.model_validate(obj)
1220
-
1221
- @app.get("/api/job-tasks", response_model=JobTasksListResponse, summary="List job tasks with filters", description="List job tasks filtered by job, work center, or date range", tags=["job_tasks"], operation_id="list_job_tasks")
1222
- async def list_job_tasks(job_id: Optional[int] = Query(None, description="Filter by job ID", example=1), work_center_id: Optional[int] = Query(None, description="Filter by work center ID", example=1), planned_start_from: Optional[datetime] = Query(None, description="Filter tasks with planned_start on or after this datetime", example="2026-01-01T00:00:00"), planned_finish_to: Optional[datetime] = Query(None, description="Filter tasks with planned_finish on or before this datetime", example="2026-01-31T23:59:59"), limit: Optional[int] = Query(100, description="Max records to return", example=100), offset: Optional[int] = Query(0, description="Offset for pagination", example=0)) -> JobTasksListResponse:
1223
- session = SessionLocal()
1224
- query = session.query(JobTask)
1225
- if job_id is not None:
1226
- query = query.filter(JobTask.job_id == job_id)
1227
- if work_center_id is not None:
1228
- query = query.filter(JobTask.work_center_id == work_center_id)
1229
- if planned_start_from is not None:
1230
- query = query.filter(JobTask.planned_start >= planned_start_from)
1231
- if planned_finish_to is not None:
1232
- query = query.filter(JobTask.planned_finish <= planned_finish_to)
1233
- total = query.count()
1234
- objs = query.offset(offset).limit(limit).all()
1235
- items = [JobTasksListItemResponse.model_validate(o) for o in objs]
1236
- session.close()
1237
- return JobTasksListResponse(items=items, total=total)
1238
-
1239
- @app.get("/api/job-tasks/by-code/{task_code}", response_model=JobTaskResponse, summary="Get job task by task code", description="Retrieve a single job task by its unique task_code", tags=["job_tasks"], operation_id="get_job_task_by_code")
1240
- async def get_job_task_by_code(task_code: str = Path(..., description="Task code to lookup", example="JT-8793")) -> JobTaskResponse:
1241
- session = SessionLocal()
1242
- obj = session.query(JobTask).filter(JobTask.task_code == task_code).first()
1243
- session.close()
1244
- if obj is None:
1245
- return JobTaskResponse(id=0, task_code="", job_id=0, sequence_order=0, task_name="", work_center_id=0, requiring_skill_level=None, planned_start=None, planned_finish=None, planned_duration_hours=None, actual_start=None, actual_finish=None, created_at=None, updated_at=None)
1246
- return JobTaskResponse.model_validate(obj)
1247
-
1248
- @app.post("/api/time-logs", response_model=TimeLogResponse, summary="Create a time log for a job task", description="Record actual time, scrap, and notes for a job task at a work center", tags=["time_logs"], operation_id="create_time_log")
1249
- async def create_time_log(request: TimeLogCreateRequest = Body(...)) -> TimeLogResponse:
1250
- session = SessionLocal()
1251
- log_start_value = request.log_start if request.log_start is not None else datetime.utcnow()
1252
- scrap_quantity_value = request.scrap_quantity if request.scrap_quantity is not None else 0
1253
- obj = TimeLog(
1254
- job_task_id=request.job_task_id,
1255
- operator_username=request.operator_username,
1256
- work_center_id=request.work_center_id,
1257
- log_start=log_start_value,
1258
- actual_duration_hours=request.actual_duration_hours,
1259
- scrap_quantity=scrap_quantity_value,
1260
- note=request.note,
1261
- created_at=datetime.utcnow(),
1262
- updated_at=datetime.utcnow(),
1263
- )
1264
- session.add(obj)
1265
- session.commit()
1266
- session.refresh(obj)
1267
- session.close()
1268
- return TimeLogResponse.model_validate(obj)
1269
-
1270
- @app.get("/api/time-logs", response_model=TimeLogsListResponse, summary="List time logs with filters", description="List time logs by job_task, work center, or date range", tags=["time_logs"], operation_id="list_time_logs")
1271
- async def list_time_logs(job_task_id: Optional[int] = Query(None, description="Filter by job task ID", example=1), work_center_id: Optional[int] = Query(None, description="Filter by work center ID", example=2), log_start_from: Optional[datetime] = Query(None, description="Filter logs with log_start on or after this datetime", example="2026-01-01T00:00:00"), log_start_to: Optional[datetime] = Query(None, description="Filter logs with log_start on or before this datetime", example="2026-01-31T23:59:59"), limit: Optional[int] = Query(100, description="Max records to return", example=100), offset: Optional[int] = Query(0, description="Offset for pagination", example=0)) -> TimeLogsListResponse:
1272
- session = SessionLocal()
1273
- query = session.query(TimeLog)
1274
- if job_task_id is not None:
1275
- query = query.filter(TimeLog.job_task_id == job_task_id)
1276
- if work_center_id is not None:
1277
- query = query.filter(TimeLog.work_center_id == work_center_id)
1278
- if log_start_from is not None:
1279
- query = query.filter(TimeLog.log_start >= log_start_from)
1280
- if log_start_to is not None:
1281
- query = query.filter(TimeLog.log_start <= log_start_to)
1282
- total = query.count()
1283
- objs = query.offset(offset).limit(limit).all()
1284
- items = [TimeLogsListItemResponse.model_validate(o) for o in objs]
1285
- session.close()
1286
- return TimeLogsListResponse(items=items, total=total)
1287
-
1288
- @app.post("/api/materials", response_model=MaterialResponse, summary="Create a material", description="Create a new material definition with unit of measure", tags=["materials"], operation_id="create_material")
1289
- async def create_material(request: MaterialCreateRequest = Body(...)) -> MaterialResponse:
1290
- session = SessionLocal()
1291
- obj = Material(
1292
- name=request.name,
1293
- unit_of_measure=request.unit_of_measure,
1294
- created_at=datetime.utcnow(),
1295
- updated_at=datetime.utcnow(),
1296
- )
1297
- session.add(obj)
1298
- session.commit()
1299
- session.refresh(obj)
1300
- session.close()
1301
- return MaterialResponse.model_validate(obj)
1302
-
1303
- @app.get("/api/materials", response_model=MaterialsListResponse, summary="List materials", description="Retrieve materials with optional name filter", tags=["materials"], operation_id="list_materials")
1304
- async def list_materials(name: Optional[str] = Query(None, description="Filter materials containing this name", example="Cold Rolled Steel")) -> MaterialsListResponse:
1305
- session = SessionLocal()
1306
- query = session.query(Material)
1307
- if name is not None:
1308
- query = query.filter(Material.name.contains(name))
1309
- objs = query.all()
1310
- items = [MaterialResponse.model_validate(o) for o in objs]
1311
- session.close()
1312
- return MaterialsListResponse(items=items)
1313
-
1314
- @app.get("/api/materials/by-name/{material_name}", response_model=MaterialResponse, summary="Get material by name", description="Lookup a material by its unique name", tags=["materials"], operation_id="get_material_by_name")
1315
- async def get_material_by_name(material_name: str = Path(..., description="Exact material name", example="Cold Rolled Steel Sheet 2mm")) -> MaterialResponse:
1316
- session = SessionLocal()
1317
- obj = session.query(Material).filter(Material.name == material_name).first()
1318
- session.close()
1319
- if obj is None:
1320
- return MaterialResponse(id=0, name="", unit_of_measure="", created_at=None, updated_at=None)
1321
- return MaterialResponse.model_validate(obj)
1322
-
1323
- @app.post("/api/inventory-lots", response_model=InventoryLotResponse, summary="Create an inventory lot", description="Create a new inventory lot for a material with quantity balances", tags=["inventory_lots"], operation_id="create_inventory_lot")
1324
- async def create_inventory_lot(request: InventoryLotCreateRequest = Body(...)) -> InventoryLotResponse:
1325
- session = SessionLocal()
1326
- reserved = request.reserved_quantity if request.reserved_quantity is not None else 0.0
1327
- obj = InventoryLot(
1328
- lot_number=request.lot_number,
1329
- material_id=request.material_id,
1330
- on_hand_quantity=request.on_hand_quantity,
1331
- reserved_quantity=reserved,
1332
- created_at=datetime.utcnow(),
1333
- updated_at=datetime.utcnow(),
1334
- )
1335
- session.add(obj)
1336
- session.commit()
1337
- session.refresh(obj)
1338
- session.close()
1339
- return InventoryLotResponse.model_validate(obj)
1340
-
1341
- @app.get("/api/inventory-lots", response_model=InventoryLotsListResponse, summary="List inventory lots", description="List inventory lots filtered by material or lot_number", tags=["inventory_lots"], operation_id="list_inventory_lots")
1342
- async def list_inventory_lots(lot_number: Optional[str] = Query(None, description="Filter by exact lot number", example="LOT-CRS-2401"), material_id: Optional[int] = Query(None, description="Filter by material ID", example=1)) -> InventoryLotsListResponse:
1343
- session = SessionLocal()
1344
- query = session.query(InventoryLot)
1345
- if lot_number is not None:
1346
- query = query.filter(InventoryLot.lot_number == lot_number)
1347
- if material_id is not None:
1348
- query = query.filter(InventoryLot.material_id == material_id)
1349
- objs = query.all()
1350
- items = [InventoryLotsListItemResponse.model_validate(o) for o in objs]
1351
- session.close()
1352
- return InventoryLotsListResponse(items=items)
1353
-
1354
- @app.get("/api/inventory-lots/by-number/{lot_number}", response_model=InventoryLotResponse, summary="Get inventory lot by lot number", description="Retrieve a single inventory lot by its unique lot_number", tags=["inventory_lots"], operation_id="get_inventory_lot_by_number")
1355
- async def get_inventory_lot_by_number(lot_number: str = Path(..., description="Exact lot number", example="LOT-CRS-2401")) -> InventoryLotResponse:
1356
- session = SessionLocal()
1357
- obj = session.query(InventoryLot).filter(InventoryLot.lot_number == lot_number).first()
1358
- session.close()
1359
- if obj is None:
1360
- return InventoryLotResponse(id=0, lot_number="", material_id=0, on_hand_quantity=0.0, reserved_quantity=0.0, created_at=None, updated_at=None)
1361
- return InventoryLotResponse.model_validate(obj)
1362
-
1363
- @app.post("/api/inventory-lots/{inventory_lot_id}/adjust", response_model=InventoryLotAdjustResponse, summary="Adjust inventory lot quantities", description="Atomically adjust on_hand_quantity and reserved_quantity for a lot", tags=["inventory_lots"], operation_id="adjust_inventory_lot")
1364
- async def adjust_inventory_lot(inventory_lot_id: int = Path(..., description="Inventory lot ID", example=1), request: InventoryLotAdjustRequest = Body(...)) -> InventoryLotAdjustResponse:
1365
- session = SessionLocal()
1366
- obj = session.query(InventoryLot).filter(InventoryLot.id == inventory_lot_id).first()
1367
- if obj is not None:
1368
- if request.on_hand_delta is not None:
1369
- obj.on_hand_quantity = obj.on_hand_quantity + request.on_hand_delta
1370
- if request.reserved_delta is not None:
1371
- obj.reserved_quantity = obj.reserved_quantity + request.reserved_delta
1372
- obj.updated_at = datetime.utcnow()
1373
- session.commit()
1374
- session.refresh(obj)
1375
- session.close()
1376
- if obj is None:
1377
- return InventoryLotAdjustResponse(id=0, lot_number="", on_hand_quantity=0.0, reserved_quantity=0.0, updated_at=None)
1378
- return InventoryLotAdjustResponse.model_validate(obj)
1379
-
1380
- @app.post("/api/material-reservations", response_model=MaterialReservationResponse, summary="Create a material reservation", description="Reserve a quantity from an inventory lot for a job", tags=["material_reservations"], operation_id="create_material_reservation")
1381
- async def create_material_reservation(request: MaterialReservationCreateRequest = Body(...)) -> MaterialReservationResponse:
1382
- session = SessionLocal()
1383
- obj = MaterialReservation(
1384
- job_id=request.job_id,
1385
- inventory_lot_id=request.inventory_lot_id,
1386
- quantity=request.quantity,
1387
- created_at=datetime.utcnow(),
1388
- updated_at=datetime.utcnow(),
1389
- )
1390
- session.add(obj)
1391
- lot = session.query(InventoryLot).filter(InventoryLot.id == request.inventory_lot_id).first()
1392
- if lot is not None:
1393
- lot.reserved_quantity = lot.reserved_quantity + request.quantity
1394
- lot.on_hand_quantity = lot.on_hand_quantity - request.quantity
1395
- lot.updated_at = datetime.utcnow()
1396
- session.commit()
1397
- session.refresh(obj)
1398
- session.close()
1399
- return MaterialReservationResponse.model_validate(obj)
1400
-
1401
- @app.get("/api/material-reservations", response_model=MaterialReservationsListResponse, summary="List material reservations", description="List material reservations filtered by job or inventory lot", tags=["material_reservations"], operation_id="list_material_reservations")
1402
- async def list_material_reservations(job_id: Optional[int] = Query(None, description="Filter by job ID", example=1), inventory_lot_id: Optional[int] = Query(None, description="Filter by inventory lot ID", example=1)) -> MaterialReservationsListResponse:
1403
- session = SessionLocal()
1404
- query = session.query(MaterialReservation)
1405
- if job_id is not None:
1406
- query = query.filter(MaterialReservation.job_id == job_id)
1407
- if inventory_lot_id is not None:
1408
- query = query.filter(MaterialReservation.inventory_lot_id == inventory_lot_id)
1409
- objs = query.all()
1410
- items = [MaterialReservationsListItemResponse.model_validate(o) for o in objs]
1411
- session.close()
1412
- return MaterialReservationsListResponse(items=items)
1413
-
1414
- @app.post("/api/shipments", response_model=ShipmentResponse, summary="Create a shipment", description="Create a shipment record for a job and customer with initial status", tags=["shipments"], operation_id="create_shipment")
1415
- async def create_shipment(request: ShipmentCreateRequest = Body(...)) -> ShipmentResponse:
1416
- session = SessionLocal()
1417
- obj = Shipment(
1418
- shipment_number=request.shipment_number,
1419
- job_id=request.job_id,
1420
- customer_id=request.customer_id,
1421
- delivery_status=request.delivery_status,
1422
- shipped_at=request.shipped_at,
1423
- delivered_at=request.delivered_at,
1424
- created_at=datetime.utcnow(),
1425
- updated_at=datetime.utcnow(),
1426
- )
1427
- session.add(obj)
1428
- session.commit()
1429
- session.refresh(obj)
1430
- session.close()
1431
- return ShipmentResponse.model_validate(obj)
1432
-
1433
- @app.get("/api/shipments", response_model=ShipmentsListResponse, summary="List shipments", description="List shipments filtered by job, customer, or status", tags=["shipments"], operation_id="list_shipments")
1434
- async def list_shipments(shipment_number: Optional[str] = Query(None, description="Filter by shipment number", example="SHP-2025-0101"), job_id: Optional[int] = Query(None, description="Filter by job ID", example=1), customer_id: Optional[int] = Query(None, description="Filter by customer ID", example=1), delivery_status: Optional[str] = Query(None, description="Filter by delivery status", example="in_transit")) -> ShipmentsListResponse:
1435
- session = SessionLocal()
1436
- query = session.query(Shipment)
1437
- if shipment_number is not None:
1438
- query = query.filter(Shipment.shipment_number == shipment_number)
1439
- if job_id is not None:
1440
- query = query.filter(Shipment.job_id == job_id)
1441
- if customer_id is not None:
1442
- query = query.filter(Shipment.customer_id == customer_id)
1443
- if delivery_status is not None:
1444
- query = query.filter(Shipment.delivery_status == delivery_status)
1445
- objs = query.all()
1446
- items = [ShipmentsListItemResponse.model_validate(o) for o in objs]
1447
- session.close()
1448
- return ShipmentsListResponse(items=items)
1449
-
1450
- @app.patch("/api/shipments/{shipment_id}", response_model=ShipmentUpdateResponse, summary="Update shipment status or dates", description="Update shipment delivery_status, shipped_at, or delivered_at", tags=["shipments"], operation_id="update_shipment_partial")
1451
- async def update_shipment_partial(shipment_id: int = Path(..., description="Shipment ID", example=1), request: ShipmentUpdateRequest = Body(...)) -> ShipmentUpdateResponse:
1452
- session = SessionLocal()
1453
- obj = session.query(Shipment).filter(Shipment.id == shipment_id).first()
1454
- now = datetime.utcnow()
1455
- if obj is not None:
1456
- if request.delivery_status is not None:
1457
- obj.delivery_status = request.delivery_status
1458
- if request.shipped_at is not None:
1459
- obj.shipped_at = request.shipped_at
1460
- if request.delivered_at is not None:
1461
- obj.delivered_at = request.delivered_at
1462
- obj.updated_at = now
1463
- session.commit()
1464
- session.refresh(obj)
1465
- session.close()
1466
- if obj is None:
1467
- return ShipmentUpdateResponse(id=0, shipment_number="", delivery_status="", shipped_at=None, delivered_at=None, updated_at=None)
1468
- return ShipmentUpdateResponse.model_validate(obj)
1469
-
1470
- @app.post("/api/shipment-packages", response_model=ShipmentPackageResponse, summary="Create a shipment package", description="Create a single package entry for an existing shipment", tags=["shipment_packages"], operation_id="create_shipment_package")
1471
- async def create_shipment_package(request: ShipmentPackageCreateRequest = Body(...)) -> ShipmentPackageResponse:
1472
- session = SessionLocal()
1473
- obj = ShipmentPackage(
1474
- shipment_id=request.shipment_id,
1475
- package_number=request.package_number,
1476
- weight_kg=request.weight_kg,
1477
- tracking_number=request.tracking_number,
1478
- created_at=datetime.utcnow(),
1479
- updated_at=datetime.utcnow(),
1480
- )
1481
- session.add(obj)
1482
- session.commit()
1483
- session.refresh(obj)
1484
- session.close()
1485
- return ShipmentPackageResponse.model_validate(obj)
1486
-
1487
- @app.get("/api/shipment-packages", response_model=ShipmentPackagesListResponse, summary="List shipment packages", description="List packages filtered by shipment or tracking_number", tags=["shipment_packages"], operation_id="list_shipment_packages")
1488
- async def list_shipment_packages(shipment_id: Optional[int] = Query(None, description="Filter by shipment ID", example=1), tracking_number: Optional[str] = Query(None, description="Filter by tracking number", example="CBX123456US")) -> ShipmentPackagesListResponse:
1489
- session = SessionLocal()
1490
- query = session.query(ShipmentPackage)
1491
- if shipment_id is not None:
1492
- query = query.filter(ShipmentPackage.shipment_id == shipment_id)
1493
- if tracking_number is not None:
1494
- query = query.filter(ShipmentPackage.tracking_number == tracking_number)
1495
- objs = query.all()
1496
- items = [ShipmentPackagesListItemResponse.model_validate(o) for o in objs]
1497
- session.close()
1498
- return ShipmentPackagesListResponse(items=items)
1499
-
1500
- @app.get("/api/work-centers/{work_center_id}/capacity-utilization", response_model=CapacityUtilizationResponse, summary="Get work center capacity utilization", description="Aggregate planned vs actual hours for a work center over a date range", tags=["capacity", "work_centers", "job_tasks", "time_logs"], operation_id="get_work_center_capacity_utilization")
1501
- async def get_work_center_capacity_utilization(work_center_id: int = Path(..., description="Work center ID to analyze", example=1), planned_from: datetime = Query(..., description="Start of planned window (inclusive, ISO8601 datetime)", example="2026-01-01T00:00:00"), planned_to: datetime = Query(..., description="End of planned window (inclusive, ISO8601 datetime)", example="2026-01-31T23:59:59")) -> CapacityUtilizationResponse:
1502
- session = SessionLocal()
1503
- tasks_query = session.query(JobTask).filter(JobTask.work_center_id == work_center_id, JobTask.planned_start != None, JobTask.planned_finish != None, JobTask.planned_start >= planned_from, JobTask.planned_finish <= planned_to)
1504
- tasks = tasks_query.all()
1505
- total_planned_hours = 0.0
1506
- total_actual_hours = 0.0
1507
- items: List[CapacityTaskItem] = []
1508
- for t in tasks:
1509
- planned = t.planned_duration_hours if t.planned_duration_hours is not None else 0.0
1510
- total_planned_hours = total_planned_hours + planned
1511
- logs = session.query(TimeLog).filter(TimeLog.job_task_id == t.id, TimeLog.work_center_id == work_center_id).all()
1512
- actual_sum = 0.0
1513
- for lg in logs:
1514
- actual_sum = actual_sum + float(lg.actual_duration_hours)
1515
- total_actual_hours = total_actual_hours + actual_sum
1516
- items.append(CapacityTaskItem(job_task_id=t.id, task_code=t.task_code, job_id=t.job_id, task_name=t.task_name, planned_start=t.planned_start, planned_finish=t.planned_finish, planned_duration_hours=t.planned_duration_hours if t.planned_duration_hours is not None else 0.0, actual_hours=actual_sum))
1517
- session.close()
1518
- return CapacityUtilizationResponse(work_center_id=work_center_id, planned_from=planned_from, planned_to=planned_to, total_planned_hours=total_planned_hours, total_actual_hours=total_actual_hours, job_tasks=items)
1519
-
1520
- if __name__ == "__main__":
1521
- import uvicorn
1522
- host = os.getenv("HOST", "127.0.0.1")
1523
- port = int(os.getenv("PORT", "8000"))
1524
- uvicorn.run(app, host=host, port=port)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
components/awm/private/tasks/awm-manufacturing-1-schedule/original_verifier.py DELETED
@@ -1,104 +0,0 @@
1
- def verify_task_completion(initial_db_path: str, final_db_path: str, final_answer: str | None = None) -> dict:
2
- import sqlite3
3
- from datetime import datetime
4
-
5
- def safe_query(db_path: str, query: str, params: tuple = ()) -> list:
6
- try:
7
- conn = sqlite3.connect(f"file:{db_path}?mode=ro", uri=True)
8
- cursor = conn.cursor()
9
- cursor.execute(query, params)
10
- results = cursor.fetchall()
11
- conn.close()
12
- return results
13
- except Exception:
14
- return []
15
-
16
- # Get job_id for J-2025-0332
17
- job_query = "SELECT id FROM jobs WHERE job_number = ?"
18
- job_results = safe_query(final_db_path, job_query, ('J-2025-0332',))
19
- if not job_results:
20
- return {"result": "others"}
21
- job_id = job_results[0][0]
22
-
23
- # Get work center IDs
24
- wc_query = "SELECT id, name FROM work_centers WHERE name IN (?, ?, ?)"
25
- wc_results = safe_query(final_db_path, wc_query, ('Laser Cutter LC-01', 'Weld Cell WC-02', 'Paint Booth PB-01'))
26
- if len(wc_results) != 3:
27
- return {"result": "others"}
28
-
29
- wc_map = {name: wc_id for wc_id, name in wc_results}
30
- laser_cutter_id = wc_map.get('Laser Cutter LC-01')
31
- weld_cell_id = wc_map.get('Weld Cell WC-02')
32
- paint_booth_id = wc_map.get('Paint Booth PB-01')
33
-
34
- if not all([laser_cutter_id, weld_cell_id, paint_booth_id]):
35
- return {"result": "others"}
36
-
37
- # Count initial job_tasks for this job
38
- initial_tasks_query = "SELECT COUNT(*) FROM job_tasks WHERE job_id = ?"
39
- initial_count_result = safe_query(initial_db_path, initial_tasks_query, (job_id,))
40
- initial_count = initial_count_result[0][0] if initial_count_result else 0
41
-
42
- # Count final job_tasks for this job
43
- final_count_result = safe_query(final_db_path, initial_tasks_query, (job_id,))
44
- final_count = final_count_result[0][0] if final_count_result else 0
45
-
46
- # Should have exactly 3 more tasks
47
- if final_count != initial_count + 3:
48
- return {"result": "others"}
49
-
50
- # Get all job_tasks for this job from final database
51
- tasks_query = """SELECT task_name, work_center_id, requiring_skill_level,
52
- planned_start, planned_finish
53
- FROM job_tasks
54
- WHERE job_id = ?
55
- ORDER BY id"""
56
- final_tasks = safe_query(final_db_path, tasks_query, (job_id,))
57
-
58
- if len(final_tasks) < 3:
59
- return {"result": "others"}
60
-
61
- # Get the last 3 tasks (newly added)
62
- new_tasks = final_tasks[-3:]
63
-
64
- # Expected task definitions
65
- expected_tasks = [
66
- ('cutting', laser_cutter_id, 'intermediate', '2026-01-05 08:00:00', '2026-01-05 10:00:00'),
67
- ('welding', weld_cell_id, 'advanced', '2026-01-05 11:00:00', '2026-01-05 14:00:00'),
68
- ('painting', paint_booth_id, 'intermediate', '2026-01-06 09:00:00', '2026-01-06 11:00:00')
69
- ]
70
-
71
- # Verify each new task matches expected values
72
- for i, (task_name, work_center_id, skill_level, planned_start, planned_finish) in enumerate(new_tasks):
73
- expected = expected_tasks[i]
74
-
75
- # Check task_name
76
- if task_name != expected[0]:
77
- return {"result": "others"}
78
-
79
- # Check work_center_id
80
- if work_center_id != expected[1]:
81
- return {"result": "others"}
82
-
83
- # Check requiring_skill_level
84
- if skill_level != expected[2]:
85
- return {"result": "others"}
86
-
87
- # Check planned_start (normalize format)
88
- if planned_start:
89
- planned_start_normalized = planned_start.replace('T', ' ').replace('.000000', '')
90
- if planned_start_normalized != expected[3]:
91
- return {"result": "others"}
92
- else:
93
- return {"result": "others"}
94
-
95
- # Check planned_finish (normalize format)
96
- if planned_finish:
97
- planned_finish_normalized = planned_finish.replace('T', ' ').replace('.000000', '')
98
- if planned_finish_normalized != expected[4]:
99
- return {"result": "others"}
100
- else:
101
- return {"result": "others"}
102
-
103
- # All checks passed
104
- return {"result": "complete"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
components/awm/runtime/awm/adapter.py CHANGED
@@ -58,7 +58,7 @@ class AWMAdapter:
58
 
59
  def _terminal(self):
60
  if self.reward is None:
61
- self._worker('finalize');value=self._worker('verify');reward=value['reward']
62
  if type(reward) not in (int,float) or not math.isfinite(reward) or reward not in (0,1):raise RuntimeError('Invalid original AWM reward')
63
  self.reward=float(reward)
64
  self.done=True
@@ -70,13 +70,16 @@ class AWMAdapter:
70
  if hasattr(action,'action_payload'):action=action.action_payload()
71
  jsonschema.validate(action,ACTION_SCHEMA)
72
  if self.done:return self._terminal()
73
- if time.monotonic()-self.started>=self.registry[self.task_id]['timeout_seconds']:return self._terminal()
74
  if action['op']=='finish':return self._terminal()
 
 
75
  if action['op']=='exec':
76
  return observation_payload(self.task_id,'Shell execution is unavailable. Use a listed business tool.',{'is_error':True,'tool_calls':self.tool_calls},reward=0.0,done=False)
77
  value=self._worker('call',{'name':action['tool'],'arguments':action['arguments']});self.tool_calls=value['tool_calls']
78
- if time.monotonic()-self.started>=self.registry[self.task_id]['timeout_seconds']:return self._terminal()
79
- return observation_payload(self.task_id,value['content'],{'is_error':value['is_error'],'tool_calls':self.tool_calls},reward=0.0,done=False)
 
 
80
 
81
  @property
82
  @serialized
 
58
 
59
  def _terminal(self):
60
  if self.reward is None:
61
+ value=self._worker('finish');reward=value['reward']
62
  if type(reward) not in (int,float) or not math.isfinite(reward) or reward not in (0,1):raise RuntimeError('Invalid original AWM reward')
63
  self.reward=float(reward)
64
  self.done=True
 
70
  if hasattr(action,'action_payload'):action=action.action_payload()
71
  jsonschema.validate(action,ACTION_SCHEMA)
72
  if self.done:return self._terminal()
 
73
  if action['op']=='finish':return self._terminal()
74
+ if time.monotonic()-self.started>=self.registry[self.task_id]['timeout_seconds']:
75
+ return observation_payload(self.task_id,'Episode time limit reached. Send {"op":"finish"}.',{'finish_required':True,'tool_calls':self.tool_calls},reward=0.0,done=False)
76
  if action['op']=='exec':
77
  return observation_payload(self.task_id,'Shell execution is unavailable. Use a listed business tool.',{'is_error':True,'tool_calls':self.tool_calls},reward=0.0,done=False)
78
  value=self._worker('call',{'name':action['tool'],'arguments':action['arguments']});self.tool_calls=value['tool_calls']
79
+ data={'is_error':value['is_error'],'tool_calls':self.tool_calls}
80
+ if time.monotonic()-self.started>=self.registry[self.task_id]['timeout_seconds']:
81
+ data['finish_required']=True
82
+ return observation_payload(self.task_id,value['content'],data,reward=0.0,done=False)
83
 
84
  @property
85
  @serialized
components/awm/runtime/awm/worker.py CHANGED
@@ -135,6 +135,9 @@ async def main():
135
  request=json.loads(base64.b64decode(sys.argv[4])) if len(sys.argv)>4 else {}
136
  if operation=='reset':result=controller.reset()
137
  elif operation=='call':result=await controller.call(request['name'],request['arguments'])
 
 
 
138
  elif operation=='finalize':result=controller.finalize()
139
  elif operation=='verify':
140
  result=controller.verify()
 
135
  request=json.loads(base64.b64decode(sys.argv[4])) if len(sys.argv)>4 else {}
136
  if operation=='reset':result=controller.reset()
137
  elif operation=='call':result=await controller.call(request['name'],request['arguments'])
138
+ elif operation=='finish':
139
+ controller.finalize()
140
+ result=controller.verify()
141
  elif operation=='finalize':result=controller.finalize()
142
  elif operation=='verify':
143
  result=controller.verify()
components/awm/upstream/manufacturing_execution_system_1-gen_db.jsonl DELETED
@@ -1 +0,0 @@
1
- {"scenario": "manufacturing_execution_system_1", "db_schema": {"tables": [{"name": "users", "ddl": "CREATE TABLE users (\n id INTEGER PRIMARY KEY,\n username TEXT UNIQUE NOT NULL,\n email TEXT UNIQUE NOT NULL,\n full_name TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP\n);", "indexes": ["CREATE INDEX idx_users_username ON users(username);", "CREATE INDEX idx_users_email ON users(email);"]}, {"name": "customers", "ddl": "CREATE TABLE customers (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n billing_address TEXT NOT NULL,\n contact_person TEXT,\n email TEXT,\n phone TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP\n);", "indexes": ["CREATE INDEX idx_customers_name ON customers(name);"]}, {"name": "product_templates", "ddl": "CREATE TABLE product_templates (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n description TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP\n);", "indexes": ["CREATE INDEX idx_product_templates_name ON product_templates(name);"]}, {"name": "product_template_options", "ddl": "CREATE TABLE product_template_options (\n id INTEGER PRIMARY KEY,\n product_template_id INTEGER NOT NULL,\n option_name TEXT NOT NULL,\n option_value TEXT NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (product_template_id) REFERENCES product_templates(id) ON DELETE CASCADE,\n UNIQUE (product_template_id, option_name, option_value)\n);", "indexes": ["CREATE INDEX idx_pto_template ON product_template_options(product_template_id);", "CREATE INDEX idx_pto_name_value ON product_template_options(option_name, option_value);"]}, {"name": "standard_task_sequences", "ddl": "CREATE TABLE standard_task_sequences (\n id INTEGER PRIMARY KEY,\n product_template_id INTEGER NOT NULL,\n sequence_order INTEGER NOT NULL,\n task_name TEXT NOT NULL,\n default_planned_duration_hours REAL NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (product_template_id) REFERENCES product_templates(id) ON DELETE CASCADE,\n UNIQUE (product_template_id, sequence_order)\n);", "indexes": ["CREATE INDEX idx_sts_template ON standard_task_sequences(product_template_id);"]}, {"name": "custom_specs", "ddl": "CREATE TABLE custom_specs (\n id INTEGER PRIMARY KEY,\n customer_id INTEGER NOT NULL,\n product_template_id INTEGER NOT NULL,\n notes TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE RESTRICT,\n FOREIGN KEY (product_template_id) REFERENCES product_templates(id) ON DELETE RESTRICT\n);", "indexes": ["CREATE INDEX idx_custom_specs_customer ON custom_specs(customer_id);", "CREATE INDEX idx_custom_specs_template ON custom_specs(product_template_id);"]}, {"name": "custom_spec_options", "ddl": "CREATE TABLE custom_spec_options (\n id INTEGER PRIMARY KEY,\n custom_spec_id INTEGER NOT NULL,\n option_name TEXT NOT NULL,\n option_value TEXT NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (custom_spec_id) REFERENCES custom_specs(id) ON DELETE CASCADE,\n UNIQUE (custom_spec_id, option_name)\n);", "indexes": ["CREATE INDEX idx_cso_custom_spec ON custom_spec_options(custom_spec_id);"]}, {"name": "custom_spec_numeric_params", "ddl": "CREATE TABLE custom_spec_numeric_params (\n id INTEGER PRIMARY KEY,\n custom_spec_id INTEGER NOT NULL,\n param_name TEXT NOT NULL,\n param_value REAL NOT NULL,\n unit TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (custom_spec_id) REFERENCES custom_specs(id) ON DELETE CASCADE,\n UNIQUE (custom_spec_id, param_name)\n);", "indexes": ["CREATE INDEX idx_csnp_custom_spec ON custom_spec_numeric_params(custom_spec_id);"]}, {"name": "quotes", "ddl": "CREATE TABLE quotes (\n id INTEGER PRIMARY KEY,\n quote_number TEXT NOT NULL UNIQUE,\n customer_id INTEGER NOT NULL,\n custom_spec_id INTEGER,\n estimated_hours REAL NOT NULL,\n material_cost REAL NOT NULL,\n labor_rate REAL NOT NULL,\n status TEXT NOT NULL,\n internal_note TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE RESTRICT,\n FOREIGN KEY (custom_spec_id) REFERENCES custom_specs(id) ON DELETE SET NULL\n);", "indexes": ["CREATE INDEX idx_quotes_customer ON quotes(customer_id);", "CREATE INDEX idx_quotes_status ON quotes(status);"]}, {"name": "jobs", "ddl": "CREATE TABLE jobs (\n id INTEGER PRIMARY KEY,\n job_number TEXT NOT NULL UNIQUE,\n customer_id INTEGER NOT NULL,\n quote_id INTEGER,\n custom_spec_id INTEGER,\n priority TEXT NOT NULL,\n due_date DATE,\n status TEXT NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE RESTRICT,\n FOREIGN KEY (quote_id) REFERENCES quotes(id) ON DELETE SET NULL,\n FOREIGN KEY (custom_spec_id) REFERENCES custom_specs(id) ON DELETE SET NULL\n);", "indexes": ["CREATE INDEX idx_jobs_job_number ON jobs(job_number);", "CREATE INDEX idx_jobs_customer ON jobs(customer_id);", "CREATE INDEX idx_jobs_status ON jobs(status);", "CREATE INDEX idx_jobs_due_date ON jobs(due_date);"]}, {"name": "work_centers", "ddl": "CREATE TABLE work_centers (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n description TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP\n);", "indexes": ["CREATE INDEX idx_work_centers_name ON work_centers(name);"]}, {"name": "job_tasks", "ddl": "CREATE TABLE job_tasks (\n id INTEGER PRIMARY KEY,\n task_code TEXT NOT NULL UNIQUE,\n job_id INTEGER NOT NULL,\n sequence_order INTEGER NOT NULL,\n task_name TEXT NOT NULL,\n work_center_id INTEGER NOT NULL,\n requiring_skill_level TEXT,\n planned_start DATETIME,\n planned_finish DATETIME,\n planned_duration_hours REAL,\n actual_start DATETIME,\n actual_finish DATETIME,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE CASCADE,\n FOREIGN KEY (work_center_id) REFERENCES work_centers(id) ON DELETE RESTRICT,\n UNIQUE (job_id, sequence_order)\n);", "indexes": ["CREATE INDEX idx_job_tasks_job ON job_tasks(job_id);", "CREATE INDEX idx_job_tasks_work_center ON job_tasks(work_center_id);", "CREATE INDEX idx_job_tasks_planned_range ON job_tasks(planned_start, planned_finish);"]}, {"name": "time_logs", "ddl": "CREATE TABLE time_logs (\n id INTEGER PRIMARY KEY,\n job_task_id INTEGER NOT NULL,\n operator_username TEXT NOT NULL,\n work_center_id INTEGER NOT NULL,\n log_start DATETIME DEFAULT CURRENT_TIMESTAMP,\n actual_duration_hours REAL NOT NULL,\n scrap_quantity INTEGER DEFAULT 0,\n note TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (job_task_id) REFERENCES job_tasks(id) ON DELETE CASCADE,\n FOREIGN KEY (work_center_id) REFERENCES work_centers(id) ON DELETE RESTRICT\n);", "indexes": ["CREATE INDEX idx_time_logs_job_task ON time_logs(job_task_id);", "CREATE INDEX idx_time_logs_work_center ON time_logs(work_center_id);", "CREATE INDEX idx_time_logs_log_start ON time_logs(log_start);"]}, {"name": "materials", "ddl": "CREATE TABLE materials (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n unit_of_measure TEXT NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP\n);", "indexes": ["CREATE INDEX idx_materials_name ON materials(name);"]}, {"name": "inventory_lots", "ddl": "CREATE TABLE inventory_lots (\n id INTEGER PRIMARY KEY,\n lot_number TEXT NOT NULL UNIQUE,\n material_id INTEGER NOT NULL,\n on_hand_quantity REAL NOT NULL,\n reserved_quantity REAL NOT NULL DEFAULT 0,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (material_id) REFERENCES materials(id) ON DELETE RESTRICT\n);", "indexes": ["CREATE INDEX idx_inventory_lots_material ON inventory_lots(material_id);", "CREATE INDEX idx_inventory_lots_lot_number ON inventory_lots(lot_number);"]}, {"name": "material_reservations", "ddl": "CREATE TABLE material_reservations (\n id INTEGER PRIMARY KEY,\n job_id INTEGER NOT NULL,\n inventory_lot_id INTEGER NOT NULL,\n quantity REAL NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE CASCADE,\n FOREIGN KEY (inventory_lot_id) REFERENCES inventory_lots(id) ON DELETE RESTRICT\n);", "indexes": ["CREATE INDEX idx_material_reservations_job ON material_reservations(job_id);", "CREATE INDEX idx_material_reservations_lot ON material_reservations(inventory_lot_id);"]}, {"name": "shipments", "ddl": "CREATE TABLE shipments (\n id INTEGER PRIMARY KEY,\n shipment_number TEXT NOT NULL UNIQUE,\n job_id INTEGER NOT NULL,\n customer_id INTEGER NOT NULL,\n delivery_status TEXT NOT NULL,\n shipped_at DATETIME,\n delivered_at DATETIME,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (job_id) REFERENCES jobs(id) ON DELETE RESTRICT,\n FOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE RESTRICT\n);", "indexes": ["CREATE INDEX idx_shipments_job ON shipments(job_id);", "CREATE INDEX idx_shipments_customer ON shipments(customer_id);", "CREATE INDEX idx_shipments_status ON shipments(delivery_status);"]}, {"name": "shipment_packages", "ddl": "CREATE TABLE shipment_packages (\n id INTEGER PRIMARY KEY,\n shipment_id INTEGER NOT NULL,\n package_number INTEGER NOT NULL,\n weight_kg REAL NOT NULL,\n tracking_number TEXT NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (shipment_id) REFERENCES shipments(id) ON DELETE CASCADE,\n UNIQUE (shipment_id, package_number),\n UNIQUE (tracking_number)\n);", "indexes": ["CREATE INDEX idx_shipment_packages_shipment ON shipment_packages(shipment_id);", "CREATE INDEX idx_shipment_packages_tracking ON shipment_packages(tracking_number);"]}]}, "db_path": "./outputs/databases/manufacturing_execution_system_1.db"}
 
 
components/awm/upstream/manufacturing_execution_system_1-gen_envs.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
components/awm/upstream/manufacturing_execution_system_1-gen_sample.jsonl DELETED
@@ -1 +0,0 @@
1
- {"scenario": "manufacturing_execution_system_1", "tables_count": 18, "inserts_count": 114, "sample_data": {"tables": [{"table_name": "users", "reasoning": "Users represent system operators or authenticated agents. Creating a primary user with id=1 and additional users allows time_logs and ownership associations for realistic operations. Although user_id is not referenced directly in other tables, having multiple realistic users supports broader testing and aligns with the requirement that user id=1 exists as the main actor.", "insert_statements": ["INSERT INTO users (id, username, email, full_name, created_at, updated_at) VALUES (1, 'planner_anna', 'anna.planner@example.com', 'Anna Planner', '2025-10-01 09:00:00', '2025-12-01 10:00:00');", "INSERT INTO users (id, username, email, full_name, created_at, updated_at) VALUES (2, 'op_jwilliams', 'jwilliams@example.com', 'James Williams', '2025-10-05 08:30:00', '2025-12-15 14:20:00');", "INSERT INTO users (id, username, email, full_name, created_at, updated_at) VALUES (3, 'op_mgarcia', 'mgarcia@example.com', 'Maria Garcia', '2025-11-01 07:45:00', '2025-12-20 16:10:00');", "INSERT INTO users (id, username, email, full_name, created_at, updated_at) VALUES (4, 'scheduler_bot', 'scheduler.bot@example.com', 'Scheduler Bot', '2025-12-01 12:00:00', '2025-12-25 12:00:00');"]}, {"table_name": "customers", "reasoning": "Customers are required for creating quotes, jobs, custom specs, and shipments. We create Acme Robotics LLC for the tasks plus additional customers to support searching, listing, and shipping variations. Data adheres to schema constraints including unique names and non-null billing_address.", "insert_statements": ["INSERT INTO customers (id, name, billing_address, contact_person, email, phone, created_at, updated_at) VALUES (1, 'Acme Robotics LLC', '1200 Industrial Way, Dayton, OH 45402', 'Maria Santos', 'm.santos@acmerobotics.com', '+1-937-555-0142', '2025-12-20 10:00:00', '2025-12-20 10:00:00');", "INSERT INTO customers (id, name, billing_address, contact_person, email, phone, created_at, updated_at) VALUES (2, 'Precision Automation Inc', '4550 Tech Park Dr, Columbus, OH 43215', 'Liam Chen', 'liam.chen@precisionauto.com', '+1-614-555-0101', '2025-11-15 09:30:00', '2025-12-10 11:45:00');", "INSERT INTO customers (id, name, billing_address, contact_person, email, phone, created_at, updated_at) VALUES (3, 'Greenfield Fabrication Co', '890 Foundry Rd, Cincinnati, OH 45202', 'Emily Davis', 'edavis@greenfieldfab.com', '+1-513-555-0199', '2025-10-05 14:15:00', '2025-12-05 16:00:00');", "INSERT INTO customers (id, name, billing_address, contact_person, email, phone, created_at, updated_at) VALUES (4, 'Summit Industrial Solutions', '2300 Summit Blvd, Akron, OH 44308', 'Robert King', 'rking@summitindustrial.com', '+1-330-555-0222', '2025-09-01 11:20:00', '2025-11-01 12:00:00');", "INSERT INTO customers (id, name, billing_address, contact_person, email, phone, created_at, updated_at) VALUES (5, 'Metro Machine Works', '101 Machine Way, Toledo, OH 43604', 'Olivia Perez', 'operez@metromachineworks.com', '+1-419-555-0333', '2025-07-18 13:40:00', '2025-12-01 09:05:00');"]}, {"table_name": "product_templates", "reasoning": "Product templates define configurable products used by custom_specs and standard_task_sequences. We add Steel Workbench Pro per the task and other templates for diversity. Names are unique as required, enabling agents to select templates and derive default task sequences.", "insert_statements": ["INSERT INTO product_templates (id, name, description, created_at, updated_at) VALUES (1, 'Steel Workbench Pro', 'Heavy-duty steel workbench with configurable size, color, and finish.', '2025-12-21 09:00:00', '2025-12-21 09:00:00');", "INSERT INTO product_templates (id, name, description, created_at, updated_at) VALUES (2, 'Aluminum Equipment Rack', 'Modular aluminum equipment rack for industrial control systems.', '2025-10-10 10:00:00', '2025-12-01 10:00:00');", "INSERT INTO product_templates (id, name, description, created_at, updated_at) VALUES (3, 'Stainless Storage Cabinet', 'Corrosion-resistant storage cabinet with adjustable shelves.', '2025-09-15 11:30:00', '2025-11-01 08:20:00');", "INSERT INTO product_templates (id, name, description, created_at, updated_at) VALUES (4, 'Robot Safety Guard Rail', 'Guard rail system for robotic work cells.', '2025-08-05 13:10:00', '2025-10-01 09:45:00');", "INSERT INTO product_templates (id, name, description, created_at, updated_at) VALUES (5, 'Custom Machine Base', 'Fabricated steel base for automated machinery.', '2025-07-22 15:00:00', '2025-09-20 15:30:00');"]}, {"table_name": "product_template_options", "reasoning": "Template options define available discrete configuration choices for each product template, like color or size. We create full option sets for Steel Workbench Pro and varied options for other templates. Unique constraints per template and option_name/option_value are respected.", "insert_statements": ["INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (1, 1, 'color', 'gray', '2025-12-21 09:05:00', '2025-12-21 09:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (2, 1, 'color', 'blue', '2025-12-21 09:05:00', '2025-12-21 09:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (3, 1, 'size', '4ft', '2025-12-21 09:05:00', '2025-12-21 09:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (4, 1, 'size', '6ft', '2025-12-21 09:05:00', '2025-12-21 09:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (5, 1, 'finish_type', 'powder_coat', '2025-12-21 09:05:00', '2025-12-21 09:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (6, 1, 'finish_type', 'galvanized', '2025-12-21 09:05:00', '2025-12-21 09:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (7, 2, 'height', '42U', '2025-10-10 10:05:00', '2025-10-10 10:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (8, 2, 'height', '24U', '2025-10-10 10:05:00', '2025-10-10 10:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (9, 2, 'finish', 'anodized', '2025-10-10 10:05:00', '2025-10-10 10:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (10, 3, 'door_type', 'swing', '2025-09-15 11:35:00', '2025-09-15 11:35:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (11, 3, 'door_type', 'sliding', '2025-09-15 11:35:00', '2025-09-15 11:35:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (12, 4, 'coating', 'safety_yellow', '2025-08-05 13:15:00', '2025-08-05 13:15:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (13, 4, 'coating', 'galvanized', '2025-08-05 13:15:00', '2025-08-05 13:15:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (14, 5, 'mounting_style', 'floor', '2025-07-22 15:05:00', '2025-07-22 15:05:00');", "INSERT INTO product_template_options (id, product_template_id, option_name, option_value, created_at, updated_at) VALUES (15, 5, 'mounting_style', 'frame', '2025-07-22 15:05:00', '2025-07-22 15:05:00');"]}, {"table_name": "standard_task_sequences", "reasoning": "Standard task sequences provide default operations and durations for each product template. We define the requested cutting\u2192welding\u2192grinding\u2192painting sequence for Steel Workbench Pro and additional sequences for other templates. This supports auto-creation of job_tasks from templates.", "insert_statements": ["INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (1, 1, 1, 'cutting', 1.5, '2025-12-21 09:10:00', '2025-12-21 09:10:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (2, 1, 2, 'welding', 2.0, '2025-12-21 09:10:00', '2025-12-21 09:10:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (3, 1, 3, 'grinding', 0.75, '2025-12-21 09:10:00', '2025-12-21 09:10:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (4, 1, 4, 'painting', 1.0, '2025-12-21 09:10:00', '2025-12-21 09:10:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (5, 2, 1, 'cutting', 1.0, '2025-10-10 10:10:00', '2025-10-10 10:10:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (6, 2, 2, 'drilling', 1.2, '2025-10-10 10:10:00', '2025-10-10 10:10:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (7, 2, 3, 'assembly', 1.5, '2025-10-10 10:10:00', '2025-10-10 10:10:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (8, 3, 1, 'cutting', 0.8, '2025-09-15 11:40:00', '2025-09-15 11:40:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (9, 3, 2, 'forming', 1.3, '2025-09-15 11:40:00', '2025-09-15 11:40:00');", "INSERT INTO standard_task_sequences (id, product_template_id, sequence_order, task_name, default_planned_duration_hours, created_at, updated_at) VALUES (10, 3, 3, 'welding', 1.7, '2025-09-15 11:40:00', '2025-09-15 11:40:00');"]}, {"table_name": "custom_specs", "reasoning": "Custom specs bind a customer to a product template with specific configuration. We create the requested spec for Acme Robotics LLC and others for variety. Foreign keys to customers and product_templates ensure integrity, enabling quoting and job creation based on these specs.", "insert_statements": ["INSERT INTO custom_specs (id, customer_id, product_template_id, notes, created_at, updated_at) VALUES (1, 1, 1, 'Blue 6ft workbench with powder coat finish for robotics cell.', '2025-12-22 08:00:00', '2025-12-22 08:00:00');", "INSERT INTO custom_specs (id, customer_id, product_template_id, notes, created_at, updated_at) VALUES (2, 2, 2, '42U anodized rack with reinforced base.', '2025-11-20 09:15:00', '2025-11-20 09:15:00');", "INSERT INTO custom_specs (id, customer_id, product_template_id, notes, created_at, updated_at) VALUES (3, 3, 3, 'Stainless cabinet for chemical storage, sliding doors.', '2025-10-10 10:20:00', '2025-10-10 10:20:00');", "INSERT INTO custom_specs (id, customer_id, product_template_id, notes, created_at, updated_at) VALUES (4, 1, 4, 'Guard rail around dual-robot cell.', '2025-11-05 13:00:00', '2025-11-05 13:00:00');", "INSERT INTO custom_specs (id, customer_id, product_template_id, notes, created_at, updated_at) VALUES (5, 4, 5, 'Machine base with integrated leveling feet.', '2025-09-25 14:30:00', '2025-09-25 14:30:00');"]}, {"table_name": "custom_spec_options", "reasoning": "Custom spec options store chosen values for configurable attributes per custom spec. We add explicit color, size, and finish_type for Acme\u2019s Steel Workbench Pro and other specs. Unique constraints per custom_spec_id and option_name are respected to avoid duplicates.", "insert_statements": ["INSERT INTO custom_spec_options (id, custom_spec_id, option_name, option_value, created_at, updated_at) VALUES (1, 1, 'color', 'blue', '2025-12-22 08:05:00', '2025-12-22 08:05:00');", "INSERT INTO custom_spec_options (id, custom_spec_id, option_name, option_value, created_at, updated_at) VALUES (2, 1, 'size', '6ft', '2025-12-22 08:05:00', '2025-12-22 08:05:00');", "INSERT INTO custom_spec_options (id, custom_spec_id, option_name, option_value, created_at, updated_at) VALUES (3, 1, 'finish_type', 'powder_coat', '2025-12-22 08:05:00', '2025-12-22 08:05:00');", "INSERT INTO custom_spec_options (id, custom_spec_id, option_name, option_value, created_at, updated_at) VALUES (4, 2, 'height', '42U', '2025-11-20 09:20:00', '2025-11-20 09:20:00');", "INSERT INTO custom_spec_options (id, custom_spec_id, option_name, option_value, created_at, updated_at) VALUES (5, 2, 'finish', 'anodized', '2025-11-20 09:20:00', '2025-11-20 09:20:00');", "INSERT INTO custom_spec_options (id, custom_spec_id, option_name, option_value, created_at, updated_at) VALUES (6, 3, 'door_type', 'sliding', '2025-10-10 10:25:00', '2025-10-10 10:25:00');", "INSERT INTO custom_spec_options (id, custom_spec_id, option_name, option_value, created_at, updated_at) VALUES (7, 4, 'coating', 'safety_yellow', '2025-11-05 13:05:00', '2025-11-05 13:05:00');", "INSERT INTO custom_spec_options (id, custom_spec_id, option_name, option_value, created_at, updated_at) VALUES (8, 5, 'mounting_style', 'floor', '2025-09-25 14:35:00', '2025-09-25 14:35:00');"]}, {"table_name": "custom_spec_numeric_params", "reasoning": "Numeric parameters store dimensional and tolerance data for each spec. We define length, width, height, and flatness_tolerance for Acme\u2019s workbench and additional metrics for other specs. Units are provided where appropriate, supporting engineering calculations and quoting.", "insert_statements": ["INSERT INTO custom_spec_numeric_params (id, custom_spec_id, param_name, param_value, unit, created_at, updated_at) VALUES (1, 1, 'length', 1830.0, 'mm', '2025-12-22 08:10:00', '2025-12-22 08:10:00');", "INSERT INTO custom_spec_numeric_params (id, custom_spec_id, param_name, param_value, unit, created_at, updated_at) VALUES (2, 1, 'width', 760.0, 'mm', '2025-12-22 08:10:00', '2025-12-22 08:10:00');", "INSERT INTO custom_spec_numeric_params (id, custom_spec_id, param_name, param_value, unit, created_at, updated_at) VALUES (3, 1, 'height', 900.0, 'mm', '2025-12-22 08:10:00', '2025-12-22 08:10:00');", "INSERT INTO custom_spec_numeric_params (id, custom_spec_id, param_name, param_value, unit, created_at, updated_at) VALUES (4, 1, 'flatness_tolerance', 0.5, 'mm', '2025-12-22 08:10:00', '2025-12-22 08:10:00');", "INSERT INTO custom_spec_numeric_params (id, custom_spec_id, param_name, param_value, unit, created_at, updated_at) VALUES (5, 2, 'depth', 800.0, 'mm', '2025-11-20 09:25:00', '2025-11-20 09:25:00');", "INSERT INTO custom_spec_numeric_params (id, custom_spec_id, param_name, param_value, unit, created_at, updated_at) VALUES (6, 3, 'height', 2000.0, 'mm', '2025-10-10 10:30:00', '2025-10-10 10:30:00');", "INSERT INTO custom_spec_numeric_params (id, custom_spec_id, param_name, param_value, unit, created_at, updated_at) VALUES (7, 4, 'rail_length', 6000.0, 'mm', '2025-11-05 13:10:00', '2025-11-05 13:10:00');", "INSERT INTO custom_spec_numeric_params (id, custom_spec_id, param_name, param_value, unit, created_at, updated_at) VALUES (8, 5, 'base_length', 2500.0, 'mm', '2025-09-25 14:40:00', '2025-09-25 14:40:00');"]}, {"table_name": "quotes", "reasoning": "Quotes link customers to estimated cost and time for custom specs, feeding job creation. We include the requested new quote for Acme\u2019s workbench, plus quote Q-2025-0147 in accepted status and several others with varied statuses, supporting conversion and listing workflows.", "insert_statements": ["INSERT INTO quotes (id, quote_number, customer_id, custom_spec_id, estimated_hours, material_cost, labor_rate, status, internal_note, created_at, updated_at) VALUES (1, 'Q-2025-0100', 2, 2, 18.0, 650.00, 70.00, 'draft', 'Initial rack concept.', '2025-11-21 10:00:00', '2025-11-22 11:00:00');", "INSERT INTO quotes (id, quote_number, customer_id, custom_spec_id, estimated_hours, material_cost, labor_rate, status, internal_note, created_at, updated_at) VALUES (2, 'Q-2025-0125', 3, 3, 22.5, 980.00, 62.00, 'sent', 'Stainless cabinet for chemical storage.', '2025-10-12 09:30:00', '2025-10-13 09:30:00');", "INSERT INTO quotes (id, quote_number, customer_id, custom_spec_id, estimated_hours, material_cost, labor_rate, status, internal_note, created_at, updated_at) VALUES (3, 'Q-2025-0140', 1, 4, 30.0, 1500.00, 65.00, 'rejected', 'Guard rail around dual-robot cell, price too high per customer.', '2025-11-06 10:15:00', '2025-11-20 10:15:00');", "INSERT INTO quotes (id, quote_number, customer_id, custom_spec_id, estimated_hours, material_cost, labor_rate, status, internal_note, created_at, updated_at) VALUES (4, 'Q-2025-0147', 1, 1, 16.0, 520.00, 65.00, 'accepted', 'Steel Workbench Pro for robotics line.', '2025-12-10 08:45:00', '2025-12-18 09:00:00');", "INSERT INTO quotes (id, quote_number, customer_id, custom_spec_id, estimated_hours, material_cost, labor_rate, status, internal_note, created_at, updated_at) VALUES (5, 'Q-2025-0155', 4, 5, 40.0, 2100.00, 68.00, 'accepted', 'Custom machine base with vibration damping.', '2025-09-27 13:00:00', '2025-10-02 13:00:00');", "INSERT INTO quotes (id, quote_number, customer_id, custom_spec_id, estimated_hours, material_cost, labor_rate, status, internal_note, created_at, updated_at) VALUES (6, 'Q-2025-0160', 1, 1, 12.0, 420.00, 65.00, 'sent', 'Rush order requested, target ship in 10 business days.', '2025-12-22 09:00:00', '2025-12-22 09:00:00');"]}, {"table_name": "jobs", "reasoning": "Jobs represent approved work tied to customers, quotes, and specs. We add job from accepted quote Q-2025-0147 with high priority and planned status, plus jobs J-2025-0332 and J-2025-0279 for tasks, inventory, and shipment operations, and additional jobs for capacity analysis.", "insert_statements": ["INSERT INTO jobs (id, job_number, customer_id, quote_id, custom_spec_id, priority, due_date, status, created_at, updated_at) VALUES (1, 'J-2025-0279', 1, 3, 4, 'medium', '2025-12-15', 'completed', '2025-11-25 08:00:00', '2025-12-16 17:00:00');", "INSERT INTO jobs (id, job_number, customer_id, quote_id, custom_spec_id, priority, due_date, status, created_at, updated_at) VALUES (2, 'J-2025-0332', 2, 1, 2, 'high', '2026-01-22', 'in_progress', '2025-12-28 09:00:00', '2025-12-30 10:00:00');", "INSERT INTO jobs (id, job_number, customer_id, quote_id, custom_spec_id, priority, due_date, status, created_at, updated_at) VALUES (3, 'J-2025-0340', 3, 2, 3, 'low', '2026-01-10', 'planned', '2025-12-20 10:30:00', '2025-12-20 10:30:00');", "INSERT INTO jobs (id, job_number, customer_id, quote_id, custom_spec_id, priority, due_date, status, created_at, updated_at) VALUES (4, 'J-2025-0350', 4, 5, 5, 'high', '2026-01-18', 'planned', '2025-12-21 11:00:00', '2025-12-21 11:00:00');", "INSERT INTO jobs (id, job_number, customer_id, quote_id, custom_spec_id, priority, due_date, status, created_at, updated_at) VALUES (5, 'J-2026-0005', 1, 4, 1, 'high', '2026-01-20', 'planned', '2025-12-22 10:00:00', '2025-12-22 10:00:00');", "INSERT INTO jobs (id, job_number, customer_id, quote_id, custom_spec_id, priority, due_date, status, created_at, updated_at) VALUES (6, 'J-2026-0006', 1, 6, 1, 'high', '2026-01-25', 'planned', '2025-12-23 09:15:00', '2025-12-23 09:15:00');"]}, {"table_name": "work_centers", "reasoning": "Work centers identify physical or logical production resources used in job_tasks and time_logs. We add Laser Cutter LC-01, Weld Cell WC-02, Paint Booth PB-01, and other centers for diverse scheduling and capacity utilization analysis, conforming to unique name constraint.", "insert_statements": ["INSERT INTO work_centers (id, name, description, created_at, updated_at) VALUES (1, 'Laser Cutter LC-01', 'Trumpf fiber laser cutting cell.', '2025-07-01 08:00:00', '2025-12-01 08:00:00');", "INSERT INTO work_centers (id, name, description, created_at, updated_at) VALUES (2, 'Weld Cell WC-02', 'Robotic MIG welding cell.', '2025-07-01 08:05:00', '2025-12-01 08:05:00');", "INSERT INTO work_centers (id, name, description, created_at, updated_at) VALUES (3, 'Paint Booth PB-01', 'Powder coating booth.', '2025-07-01 08:10:00', '2025-12-01 08:10:00');", "INSERT INTO work_centers (id, name, description, created_at, updated_at) VALUES (4, 'Grinding Station GS-01', 'Manual grinding station.', '2025-07-01 08:15:00', '2025-12-01 08:15:00');", "INSERT INTO work_centers (id, name, description, created_at, updated_at) VALUES (5, 'Assembly Cell AC-01', 'Bench assembly area.', '2025-07-01 08:20:00', '2025-12-01 08:20:00');"]}, {"table_name": "job_tasks", "reasoning": "Job tasks break jobs into sequenced operations at specific work centers, required for planning, execution, and time logging. We define tasks for job J-2025-0332 per instructions, create task JT-8793 for welding, and add multiple LC-01 tasks in January 2026 for utilization queries.", "insert_statements": ["INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (1, 'JT-8001', 2, 1, 'cutting', 1, 'intermediate', '2026-01-05 08:00:00', '2026-01-05 10:00:00', 2.0, NULL, NULL, '2025-12-28 09:10:00', '2025-12-28 09:10:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (2, 'JT-8002', 2, 2, 'welding', 2, 'advanced', '2026-01-05 11:00:00', '2026-01-05 14:00:00', 3.0, NULL, NULL, '2025-12-28 09:10:00', '2025-12-28 09:10:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (3, 'JT-8003', 2, 3, 'painting', 3, 'intermediate', '2026-01-06 09:00:00', '2026-01-06 11:00:00', 2.0, NULL, NULL, '2025-12-28 09:10:00', '2025-12-28 09:10:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (4, 'JT-8793', 2, 4, 'welding rework', 2, 'advanced', '2026-01-07 08:00:00', '2026-01-07 10:30:00', 2.5, NULL, NULL, '2025-12-29 08:00:00', '2025-12-29 08:00:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (5, 'JT-8100', 1, 1, 'cutting', 1, 'intermediate', '2025-12-05 08:00:00', '2025-12-05 10:00:00', 2.0, '2025-12-05 08:05:00', '2025-12-05 09:50:00', '2025-11-25 08:10:00', '2025-12-05 10:00:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (6, 'JT-8101', 1, 2, 'welding', 2, 'advanced', '2025-12-06 08:00:00', '2025-12-06 11:00:00', 3.0, '2025-12-06 08:10:00', '2025-12-06 11:05:00', '2025-11-25 08:10:00', '2025-12-06 11:10:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (7, 'JT-8200', 3, 1, 'cutting', 1, 'intermediate', '2026-01-03 07:00:00', '2026-01-03 09:00:00', 2.0, NULL, NULL, '2025-12-20 10:40:00', '2025-12-20 10:40:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (8, 'JT-8201', 4, 1, 'cutting', 1, 'intermediate', '2026-01-15 08:00:00', '2026-01-15 12:00:00', 4.0, NULL, NULL, '2025-12-21 11:10:00', '2025-12-21 11:10:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (9, 'JT-8202', 5, 1, 'cutting', 1, 'intermediate', '2026-01-20 13:00:00', '2026-01-20 16:00:00', 3.0, NULL, NULL, '2025-12-22 10:10:00', '2025-12-22 10:10:00');", "INSERT INTO job_tasks (id, task_code, job_id, sequence_order, task_name, work_center_id, requiring_skill_level, planned_start, planned_finish, planned_duration_hours, actual_start, actual_finish, created_at, updated_at) VALUES (10, 'JT-8203', 6, 1, 'cutting', 1, 'intermediate', '2026-02-01 09:00:00', '2026-02-01 11:00:00', 2.0, NULL, NULL, '2025-12-23 09:20:00', '2025-12-23 09:20:00');"]}, {"table_name": "time_logs", "reasoning": "Time logs capture actual work done on job_tasks at specific work centers, with operators, durations, and scrap. We add the requested log for operator op_jwilliams on JT-8793 and additional logs for various LC-01 tasks to enable capacity utilization and performance analysis.", "insert_statements": ["INSERT INTO time_logs (id, job_task_id, operator_username, work_center_id, log_start, actual_duration_hours, scrap_quantity, note, created_at, updated_at) VALUES (1, 4, 'op_jwilliams', 2, '2026-01-07 08:05:00', 2.4, 1, 'Rewelded one bracket due to misalignment found during in-process check', '2026-01-07 10:45:00', '2026-01-07 10:45:00');", "INSERT INTO time_logs (id, job_task_id, operator_username, work_center_id, log_start, actual_duration_hours, scrap_quantity, note, created_at, updated_at) VALUES (2, 1, 'op_mgarcia', 1, '2026-01-05 08:00:00', 1.8, 0, 'Cut parts per program WB-332.', '2026-01-05 10:00:00', '2026-01-05 10:00:00');", "INSERT INTO time_logs (id, job_task_id, operator_username, work_center_id, log_start, actual_duration_hours, scrap_quantity, note, created_at, updated_at) VALUES (3, 7, 'op_mgarcia', 1, '2026-01-03 07:05:00', 2.1, 0, 'Cut cabinet panels.', '2026-01-03 09:15:00', '2026-01-03 09:15:00');", "INSERT INTO time_logs (id, job_task_id, operator_username, work_center_id, log_start, actual_duration_hours, scrap_quantity, note, created_at, updated_at) VALUES (4, 8, 'op_jwilliams', 1, '2026-01-15 08:10:00', 3.9, 2, 'Extra skeleton parts cut due to nesting error.', '2026-01-15 12:10:00', '2026-01-15 12:10:00');", "INSERT INTO time_logs (id, job_task_id, operator_username, work_center_id, log_start, actual_duration_hours, scrap_quantity, note, created_at, updated_at) VALUES (5, 9, 'op_mgarcia', 1, '2026-01-20 13:05:00', 2.7, 0, 'Rush laser job for Acme workbench.', '2026-01-20 16:00:00', '2026-01-20 16:00:00');", "INSERT INTO time_logs (id, job_task_id, operator_username, work_center_id, log_start, actual_duration_hours, scrap_quantity, note, created_at, updated_at) VALUES (6, 5, 'op_mgarcia', 1, '2025-12-05 08:05:00', 1.6, 0, 'Cut parts for completed job.', '2025-12-05 09:55:00', '2025-12-05 09:55:00');"]}, {"table_name": "materials", "reasoning": "Materials represent inventory items that can be reserved for jobs. We create Cold Rolled Steel Sheet 2mm for the reservation task and several other materials to simulate a realistic inventory environment with different units of measure.", "insert_statements": ["INSERT INTO materials (id, name, unit_of_measure, created_at, updated_at) VALUES (1, 'Cold Rolled Steel Sheet 2mm', 'sheet', '2025-06-01 08:00:00', '2025-12-01 08:00:00');", "INSERT INTO materials (id, name, unit_of_measure, created_at, updated_at) VALUES (2, 'Hot Rolled Steel Plate 10mm', 'kg', '2025-06-01 08:05:00', '2025-12-01 08:05:00');", "INSERT INTO materials (id, name, unit_of_measure, created_at, updated_at) VALUES (3, 'Stainless Steel Sheet 1.5mm', 'sheet', '2025-06-01 08:10:00', '2025-12-01 08:10:00');", "INSERT INTO materials (id, name, unit_of_measure, created_at, updated_at) VALUES (4, 'Powder Coat Paint Blue', 'kg', '2025-06-01 08:15:00', '2025-12-01 08:15:00');", "INSERT INTO materials (id, name, unit_of_measure, created_at, updated_at) VALUES (5, 'Shielding Gas Mix 92/8', 'cylinder', '2025-06-01 08:20:00', '2025-12-01 08:20:00');"]}, {"table_name": "inventory_lots", "reasoning": "Inventory lots track on-hand and reserved quantities per material. We define LOT-CRS-2401 with sufficient quantity for the 150-unit reservation and multiple other lots to test different reservation and availability scenarios. Quantities comply with non-null constraints.", "insert_statements": ["INSERT INTO inventory_lots (id, lot_number, material_id, on_hand_quantity, reserved_quantity, created_at, updated_at) VALUES (1, 'LOT-CRS-2401', 1, 500.0, 0.0, '2025-12-15 09:00:00', '2025-12-15 09:00:00');", "INSERT INTO inventory_lots (id, lot_number, material_id, on_hand_quantity, reserved_quantity, created_at, updated_at) VALUES (2, 'LOT-CRS-2399', 1, 120.0, 20.0, '2025-11-10 09:00:00', '2025-12-10 09:00:00');", "INSERT INTO inventory_lots (id, lot_number, material_id, on_hand_quantity, reserved_quantity, created_at, updated_at) VALUES (3, 'LOT-HRS-2310', 2, 2000.0, 300.0, '2025-10-01 08:00:00', '2025-12-01 08:00:00');", "INSERT INTO inventory_lots (id, lot_number, material_id, on_hand_quantity, reserved_quantity, created_at, updated_at) VALUES (4, 'LOT-SSS-2402', 3, 150.0, 0.0, '2025-12-18 10:00:00', '2025-12-18 10:00:00');", "INSERT INTO inventory_lots (id, lot_number, material_id, on_hand_quantity, reserved_quantity, created_at, updated_at) VALUES (5, 'LOT-PCB-2401', 4, 80.0, 10.0, '2025-12-01 11:00:00', '2025-12-10 11:00:00');"]}, {"table_name": "material_reservations", "reasoning": "Material reservations link jobs to specific inventory lots and quantities. We reserve 150 units from LOT-CRS-2401 for job J-2025-0332 as requested, and create additional reservations to test reporting and constraints. Values observe foreign keys to jobs and inventory_lots.", "insert_statements": ["INSERT INTO material_reservations (id, job_id, inventory_lot_id, quantity, created_at, updated_at) VALUES (1, 2, 1, 150.0, '2025-12-29 09:30:00', '2025-12-29 09:30:00');", "INSERT INTO material_reservations (id, job_id, inventory_lot_id, quantity, created_at, updated_at) VALUES (2, 1, 2, 50.0, '2025-11-26 08:30:00', '2025-11-26 08:30:00');", "INSERT INTO material_reservations (id, job_id, inventory_lot_id, quantity, created_at, updated_at) VALUES (3, 3, 4, 40.0, '2025-12-21 09:00:00', '2025-12-21 09:00:00');", "INSERT INTO material_reservations (id, job_id, inventory_lot_id, quantity, created_at, updated_at) VALUES (4, 5, 1, 80.0, '2025-12-23 10:30:00', '2025-12-23 10:30:00');"]}, {"table_name": "shipments", "reasoning": "Shipments capture outbound deliveries of completed jobs to customers. We create a shipment for completed job J-2025-0279 to Acme Robotics LLC with status in_transit so job_status can be updated to shipped by the agent, plus extra shipments to support listing and filtering.", "insert_statements": ["INSERT INTO shipments (id, shipment_number, job_id, customer_id, delivery_status, shipped_at, delivered_at, created_at, updated_at) VALUES (1, 'SHP-2025-0200', 1, 1, 'in_transit', '2025-12-17 09:00:00', NULL, '2025-12-17 09:00:00', '2025-12-17 09:00:00');", "INSERT INTO shipments (id, shipment_number, job_id, customer_id, delivery_status, shipped_at, delivered_at, created_at, updated_at) VALUES (2, 'SHP-2025-0180', 3, 3, 'delivered', '2025-12-10 14:00:00', '2025-12-12 10:00:00', '2025-12-10 14:00:00', '2025-12-12 10:00:00');", "INSERT INTO shipments (id, shipment_number, job_id, customer_id, delivery_status, shipped_at, delivered_at, created_at, updated_at) VALUES (3, 'SHP-2025-0185', 4, 4, 'ready_to_ship', NULL, NULL, '2025-12-15 15:00:00', '2025-12-15 15:00:00');"]}, {"table_name": "shipment_packages", "reasoning": "Shipment packages store per-package weights and tracking numbers. For the Acme job shipment, we create two packages with specified weights and tracking numbers. Additional packages for other shipments provide variety. Unique constraints on tracking_number and (shipment_id, package_number) are maintained.", "insert_statements": ["INSERT INTO shipment_packages (id, shipment_id, package_number, weight_kg, tracking_number, created_at, updated_at) VALUES (1, 1, 1, 45.0, 'CBX123456US', '2025-12-17 09:05:00', '2025-12-17 09:05:00');", "INSERT INTO shipment_packages (id, shipment_id, package_number, weight_kg, tracking_number, created_at, updated_at) VALUES (2, 1, 2, 38.5, 'CBX123457US', '2025-12-17 09:05:00', '2025-12-17 09:05:00');", "INSERT INTO shipment_packages (id, shipment_id, package_number, weight_kg, tracking_number, created_at, updated_at) VALUES (3, 2, 1, 55.0, 'CBX123458US', '2025-12-10 14:05:00', '2025-12-10 14:05:00');", "INSERT INTO shipment_packages (id, shipment_id, package_number, weight_kg, tracking_number, created_at, updated_at) VALUES (4, 3, 1, 30.0, 'CBX123459US', '2025-12-15 15:05:00', '2025-12-15 15:05:00');"]}]}}
 
 
components/loui/.dockerignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ __pycache__
2
+ *.pyc
components/loui/Dockerfile ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ghcr.io/bochencs/openenv-pdbthink@sha256:93c21c8ccca55b7bb0af838eb42c64e6702dd9d97cd689357f5929ae72460f71
2
+ USER root
3
+ COPY runtime /opt/loui/runtime
4
+ COPY upstream /opt/loui/upstream
5
+ COPY tasks /opt/loui/tasks
6
+ COPY SOURCE.json config.json /opt/loui/
7
+ RUN chmod -R go-rwx /opt/loui && mkdir -p /var/lib/loui-exec && chmod 711 /var/lib/loui-exec
8
+ ENV PYTHONPATH=/opt/loui/runtime:/opt/loui/upstream/v3 PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 ENABLE_WEB_INTERFACE=false OPENENV_MODE=simulation GRADIO_ANALYTICS_ENABLED=false HF_HUB_OFFLINE=1
9
+ WORKDIR /opt/loui
10
+ EXPOSE 8000
11
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3).read()"]
12
+ CMD ["python", "-m", "loui.server"]
components/loui/README.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Original multi-module repair tasks
2
+
3
+ `incident-3` and `expression-3` reuse Python Repair Lab v3 at Hugging Face revision `f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad`. Original source and MIT license are in `upstream/`.
4
+
5
+ Use `op=call` with `read`, `write`, `test`, or `submit`; tool arguments are listed on reset. `op=finish` grades the current source. Reset defaults to the original seed 0. The 30-action limit and original mean over six verification groups are preserved.
6
+
7
+ The runtime uses the Arena-pinned OpenEnv SDK. Candidate code runs as UID 2000 with no network or child processes. Source, reference implementations, and grading state remain in the root supervisor.
components/loui/SOURCE.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "source_dataset": "Louistiti/openenv-python-repair",
3
+ "source_revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad",
4
+ "source_url": "https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad/v3",
5
+ "source_github_revision": "8762c34c465ab37304f2c967d5a01d55283f2531",
6
+ "license": "MIT",
7
+ "registered_tasks": [
8
+ "incident-3",
9
+ "expression-3"
10
+ ],
11
+ "default_seed": 0,
12
+ "files": {
13
+ "upstream/LICENSE": "a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6",
14
+ "upstream/v3/server.py": "67f546daef6e7902c12754cbbd883657e57d2cb21e109275af123c552cc93422",
15
+ "upstream/v3/execution.py": "578814be5152b9b00c7eeae387544a94db159c9e8e3456e5cb56b31b6a731e9a",
16
+ "upstream/v3/tasks.py": "71caf0175532025bf138398229d466f18e5e03365b48853efd92f61f6dae2d66",
17
+ "upstream/v3/README.md": "bf5da0c7b871459278ad174cfd3c4ba90de9fbe74d35decce007bed13535d32d",
18
+ "upstream/v3/tasks.jsonl": "9715cdabe6e67287399a3fe2bad435852510bf854982d2f6695b3d87db395c88",
19
+ "upstream/v3/hard_tasks.py": "f140fcf554e97b67afb14e961affc46c14320cb784fe1f7444585e77ceb89ea0"
20
+ }
21
+ }
components/loui/config.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "tasks": [
3
+ {
4
+ "task_id": "incident-3",
5
+ "split": "train",
6
+ "seed": 0,
7
+ "family": "incident",
8
+ "instruction_source": "upstream/v3/tasks.jsonl",
9
+ "instruction_sha256": "682c7db0f0911e85174652574349fbe957c1cc235a68d224c569e405d9674452",
10
+ "source_dataset": "Louistiti/openenv-python-repair",
11
+ "source_revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad",
12
+ "source_url": "https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad/v3",
13
+ "license": "MIT",
14
+ "grading": "Unchanged original mean of per-behavior-group pass fractions",
15
+ "default_empty_finish": "Original starter partial reward; not forced to zero",
16
+ "instruction_jsonl_row": 12,
17
+ "instruction_field": "prompt",
18
+ "original_instruction": "tasks/incident-3/instruction.md"
19
+ },
20
+ {
21
+ "task_id": "expression-3",
22
+ "split": "train",
23
+ "seed": 0,
24
+ "family": "expression",
25
+ "instruction_source": "upstream/v3/tasks.jsonl",
26
+ "instruction_sha256": "09ef2d8fc856ca3dc5662c279df705e9accc827f4472dc34758ffe769d116128",
27
+ "source_dataset": "Louistiti/openenv-python-repair",
28
+ "source_revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad",
29
+ "source_url": "https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad/v3",
30
+ "license": "MIT",
31
+ "grading": "Unchanged original mean of per-behavior-group pass fractions",
32
+ "default_empty_finish": "Original starter partial reward; not forced to zero",
33
+ "instruction_jsonl_row": 24,
34
+ "instruction_field": "prompt",
35
+ "original_instruction": "tasks/expression-3/instruction.md"
36
+ }
37
+ ],
38
+ "max_actions": 30,
39
+ "execution_cpu_seconds": 2,
40
+ "execution_wall_seconds": 3,
41
+ "execution_memory_mib": 256,
42
+ "upstream_files": [
43
+ "upstream/LICENSE",
44
+ "upstream/v3/README.md",
45
+ "upstream/v3/execution.py",
46
+ "upstream/v3/hard_tasks.py",
47
+ "upstream/v3/server.py",
48
+ "upstream/v3/tasks.jsonl",
49
+ "upstream/v3/tasks.py"
50
+ ],
51
+ "adapter_files": [
52
+ "runtime/common/__init__.py",
53
+ "runtime/common/contracts.py",
54
+ "runtime/common/models.py",
55
+ "runtime/loui/__init__.py",
56
+ "runtime/loui/child.py",
57
+ "runtime/loui/environment.py",
58
+ "runtime/loui/executor.py",
59
+ "runtime/loui/server.py"
60
+ ]
61
+ }
components/{mimo-code/source_bundle/runtime/code_runtime → loui/runtime/common}/__init__.py RENAMED
File without changes
components/{mimo-code/source_bundle → loui}/runtime/common/contracts.py RENAMED
File without changes
components/{mimo-code/source_bundle → loui}/runtime/common/models.py RENAMED
File without changes
components/{mimo-code/source_bundle/pristine-other/vendor/plaso/dfwinreg → loui/runtime/loui}/__init__.py RENAMED
File without changes
components/loui/runtime/loui/child.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import base64
2
+ import ctypes
3
+ import errno
4
+ import os
5
+ import resource
6
+ import sys
7
+
8
+
9
+ def restrict():
10
+ if sys.platform != 'linux' or os.geteuid() != 0:
11
+ raise RuntimeError('Linux root supervisor required')
12
+ libc = ctypes.CDLL(None, use_errno=True)
13
+ for option, value in [(38, 1), (47, 4), (8, 0)]:
14
+ if libc.prctl(option, value, 0, 0, 0):
15
+ raise OSError(ctypes.get_errno(), 'Process isolation failed')
16
+ os.setgroups([])
17
+ os.setresgid(2000, 2000, 2000)
18
+ os.setresuid(2000, 2000, 2000)
19
+ if libc.prctl(4, 0, 0, 0, 0):
20
+ raise OSError(ctypes.get_errno(), 'Process privacy failed')
21
+ resource.setrlimit(resource.RLIMIT_NPROC, (16, 16))
22
+ lib = ctypes.CDLL('libseccomp.so.2', use_errno=True)
23
+ lib.seccomp_init.argtypes = [ctypes.c_uint32]
24
+ lib.seccomp_init.restype = ctypes.c_void_p
25
+ lib.seccomp_syscall_resolve_name.argtypes = [ctypes.c_char_p]
26
+ lib.seccomp_syscall_resolve_name.restype = ctypes.c_int
27
+ lib.seccomp_rule_add.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_int, ctypes.c_uint]
28
+ lib.seccomp_rule_add.restype = ctypes.c_int
29
+ lib.seccomp_load.argtypes = [ctypes.c_void_p]
30
+ lib.seccomp_load.restype = ctypes.c_int
31
+ lib.seccomp_release.argtypes = [ctypes.c_void_p]
32
+ context = lib.seccomp_init(0x7FFF0000)
33
+ if not context:
34
+ raise RuntimeError('seccomp initialization failed')
35
+ blocked = ('socket', 'socketpair', 'connect', 'bind', 'listen', 'accept', 'accept4',
36
+ 'sendto', 'sendmsg', 'sendmmsg', 'recvfrom', 'recvmsg', 'recvmmsg',
37
+ 'io_uring_setup', 'io_uring_register', 'io_uring_enter',
38
+ 'fork', 'vfork', 'clone', 'clone3', 'ptrace', 'process_vm_readv',
39
+ 'process_vm_writev', 'kill', 'tkill', 'tgkill', 'pidfd_send_signal',
40
+ 'mount', 'umount2', 'unshare', 'setns')
41
+ try:
42
+ for name in blocked:
43
+ number = lib.seccomp_syscall_resolve_name(name.encode())
44
+ if number < 0:
45
+ raise RuntimeError('Unsupported syscall: ' + name)
46
+ rc = lib.seccomp_rule_add(context, 0x00050000 | errno.EPERM, number, 0)
47
+ if rc:
48
+ raise OSError(-rc, 'seccomp rule failed')
49
+ rc = lib.seccomp_load(context)
50
+ if rc:
51
+ raise OSError(-rc, 'seccomp activation failed')
52
+ finally:
53
+ lib.seccomp_release(context)
54
+ state = dict(line.split(':', 1) for line in open('/proc/self/status') if ':' in line)
55
+ if os.getresuid() != (2000, 2000, 2000) or int(state['CapEff'].strip(), 16):
56
+ raise RuntimeError('Learner identity verification failed')
57
+ if state['NoNewPrivs'].strip() != '1' or state['Seccomp'].strip() != '2':
58
+ raise RuntimeError('Learner isolation verification failed')
59
+
60
+
61
+ def main():
62
+ fd = int(sys.argv[1])
63
+ try:
64
+ runner = compile(base64.b64decode(sys.argv[2]), '<original-runner>', 'exec')
65
+ restrict()
66
+ except BaseException as error:
67
+ os.write(fd, ('error:' + str(error)).encode()[:2048])
68
+ raise
69
+ else:
70
+ os.write(fd, b'ready')
71
+ finally:
72
+ os.close(fd)
73
+ exec(runner, {'__name__': '__main__'})
74
+
75
+
76
+ if __name__ == '__main__':
77
+ main()
components/loui/runtime/loui/environment.py ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib
2
+ import importlib
3
+ import json
4
+ from pathlib import Path
5
+ from threading import RLock
6
+ from uuid import uuid4
7
+
8
+ from openenv.core.env_server.interfaces import Environment
9
+ from openenv.core.env_server.types import State, EnvironmentMetadata
10
+ from common.models import ArenaAction, ArenaObservation
11
+ from .executor import configure, InfrastructureError
12
+
13
+ ROOT = Path('/opt/loui')
14
+ SOURCE = json.loads((ROOT / 'SOURCE.json').read_text())
15
+ for relative, digest in SOURCE['files'].items():
16
+ if hashlib.sha256((ROOT / relative).read_bytes()).hexdigest() != digest:
17
+ raise InfrastructureError('Original source hash mismatch')
18
+ original_tasks = importlib.import_module('tasks')
19
+ original_execution = importlib.import_module('execution')
20
+ for module in [original_tasks, original_execution]:
21
+ if Path(module.__file__).parent != ROOT / 'upstream/v3':
22
+ raise InfrastructureError('Unexpected original module location')
23
+ configure(original_execution)
24
+ TASK_IDS = tuple(SOURCE['registered_tasks'])
25
+ MAX_STEPS = 30
26
+ TOOLS = [
27
+ {'name': 'read', 'arguments': {'path': 'observed module filename'}},
28
+ {'name': 'write', 'arguments': {'path': 'observed editable module filename', 'code': 'complete replacement source'}},
29
+ {'name': 'test', 'arguments': {}},
30
+ {'name': 'submit', 'arguments': {}},
31
+ ]
32
+
33
+
34
+ class LouiEnvironment(Environment):
35
+ SUPPORTS_CONCURRENT_SESSIONS = True
36
+
37
+ def __init__(self):
38
+ self.lock = RLock()
39
+ self.task = None
40
+ self.files = {}
41
+ self.count = 0
42
+ self.episode_id = None
43
+ self.terminal = None
44
+
45
+ def _observation(self, message, files=None, reward=0.0, done=False):
46
+ return ArenaObservation(task_id=self.task.task_id if self.task else '', message=message,
47
+ data={'files': files or {}, 'steps_left': max(0, MAX_STEPS-self.count)}, reward=reward, done=done)
48
+
49
+ def reset(self, *, task_id=None, seed=None, index=None, split='train', episode_id=None, **kwargs):
50
+ with self.lock:
51
+ if split != 'train':
52
+ raise ValueError('Unknown split')
53
+ if index is not None:
54
+ if type(index) is not int or not 0 <= index < len(TASK_IDS):
55
+ raise ValueError('Invalid task index')
56
+ if task_id is not None and task_id != TASK_IDS[index]:
57
+ raise ValueError('Task selection mismatch')
58
+ task_id = TASK_IDS[index]
59
+ task_id = task_id or TASK_IDS[0]
60
+ if task_id not in TASK_IDS or (seed is not None and type(seed) is not int):
61
+ raise ValueError('Invalid task or seed')
62
+ self.task = original_tasks.make_task(task_id, 0 if seed is None else seed)
63
+ self.files = dict(self.task.starter)
64
+ self.count = 0
65
+ self.episode_id = episode_id or uuid4().hex
66
+ self.terminal = None
67
+ note = 'Read with {"op":"call","tool":"read","arguments":{"path":"main.py"}}. Other tools: write, test, submit. Finish with {"op":"finish"}. '
68
+ value = self._observation(note+self.task.prompt+'\nPublic examples: '+json.dumps(self.task.visible), dict(self.files))
69
+ value.data['tools'] = TOOLS
70
+ value.data['available_ops'] = ['call', 'finish']
71
+ return value
72
+
73
+ def _finish(self):
74
+ if self.terminal is None:
75
+ result = original_execution.grade(self.files, self.task.hidden)
76
+ self.terminal = self._observation(json.dumps(result), reward=result['reward'], done=True)
77
+ return self.terminal
78
+
79
+ def step(self, action, timeout_s=None, **kwargs):
80
+ with self.lock:
81
+ action = action.action_payload() if isinstance(action, ArenaAction) else ArenaAction.model_validate(action).action_payload()
82
+ if self.task is None:
83
+ raise ValueError('Reset before stepping')
84
+ if self.terminal is not None:
85
+ return self.terminal
86
+ self.count += 1
87
+ if action['op'] == 'finish':
88
+ return self._finish()
89
+ message, files = '', {}
90
+ if action['op'] != 'call':
91
+ message = 'Shell execution is unavailable. Use read, write, test or submit.'
92
+ else:
93
+ tool, args = action['tool'], action['arguments']
94
+ if tool == 'submit':
95
+ if args:
96
+ message = 'submit takes no arguments.'
97
+ else:
98
+ return self._finish()
99
+ elif tool == 'read':
100
+ path = args.get('path')
101
+ if set(args) == {'path'} and isinstance(path, str) and path in self.files:
102
+ files[path] = self.files[path]
103
+ message = 'File contents.'
104
+ else:
105
+ message = 'Unknown file or invalid read arguments.'
106
+ elif tool == 'write':
107
+ path, code = args.get('path'), args.get('code')
108
+ if set(args) != {'path', 'code'} or not isinstance(path, str) or not isinstance(code, str) or len(code) > 16000:
109
+ message = 'Invalid write arguments.'
110
+ elif path not in self.files or path == 'settings.py':
111
+ message = 'Unknown or read-only file. Source unchanged.'
112
+ else:
113
+ candidate = dict(self.files, **{path: code})
114
+ try:
115
+ original_execution.validate(candidate)
116
+ self.files = candidate
117
+ message = 'Module replaced. Use test or submit.'
118
+ except (SyntaxError, ValueError, RecursionError) as error:
119
+ message = 'Rejected; source unchanged: '+str(error)[:180]
120
+ elif tool == 'test':
121
+ message = 'test takes no arguments.' if args else json.dumps(original_execution.grade(self.files, self.task.visible, feedback=True))
122
+ else:
123
+ message = 'Unknown tool. Use read, write, test or submit.'
124
+ if self.count >= MAX_STEPS:
125
+ return self._finish()
126
+ return self._observation(message, files)
127
+
128
+ @property
129
+ def state(self):
130
+ return State(episode_id=self.episode_id, step_count=self.count,
131
+ task_id=self.task.task_id if self.task else None, done=self.terminal is not None)
132
+
133
+ def close(self):
134
+ with self.lock:
135
+ self.task = None
136
+ self.files = {}
137
+ self.count = 0
138
+ self.terminal = None
139
+ self.episode_id = None
140
+
141
+ def get_metadata(self):
142
+ return EnvironmentMetadata(name='loui_repair', version='1.0.0', description='Original multi-module repair tasks.')
143
+
144
+ def list_splits(self):
145
+ return ['train']
146
+
147
+ def list_tasks(self, split):
148
+ if split != 'train':
149
+ raise ValueError('Unknown split')
150
+ return [{'id': name, 'index': i} for i, name in enumerate(TASK_IDS)]
151
+
152
+ def num_tasks(self, split):
153
+ return len(self.list_tasks(split))
154
+
155
+ def get_task(self, split, index):
156
+ return self.list_tasks(split)[index]
157
+
158
+ def get_task_range(self, split, start=None, stop=None):
159
+ return self.list_tasks(split)[start:stop]
components/loui/runtime/loui/executor.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import base64
2
+ import os
3
+ from pathlib import Path
4
+ import signal
5
+ import subprocess
6
+ import sys
7
+ import tempfile
8
+ from types import SimpleNamespace
9
+
10
+
11
+ class InfrastructureError(RuntimeError):
12
+ pass
13
+
14
+
15
+ def configure(module):
16
+ original_runner = module.RUNNER
17
+ root = Path('/var/lib/loui-exec')
18
+ root.mkdir(mode=0o711, parents=True, exist_ok=True)
19
+ os.chmod(root, 0o711)
20
+
21
+ def temporary_directory(*args, **kwargs):
22
+ return tempfile.TemporaryDirectory(*args, **{**kwargs, 'dir': str(root)})
23
+
24
+ def run(argv, *, input, text, stdout, stderr, timeout, cwd, env):
25
+ if argv != [sys.executable, '-I', '-S', '-c', original_runner]:
26
+ raise InfrastructureError('Unexpected verifier command')
27
+ if sys.platform != 'linux' or os.geteuid() != 0:
28
+ raise InfrastructureError('Linux root supervisor required')
29
+ work = Path(cwd)
30
+ if work.parent != root or work.is_symlink() or not work.is_dir():
31
+ raise InfrastructureError('Invalid execution directory')
32
+ os.chown(work, 2000, 2000)
33
+ os.chmod(work, 0o700)
34
+ read_fd, write_fd = os.pipe()
35
+ process = None
36
+ encoded = base64.b64encode(original_runner.encode()).decode()
37
+ command = [sys.executable, '-I', '-S', str(Path(__file__).with_name('child.py')), str(write_fd), encoded]
38
+ try:
39
+ process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=stdout, stderr=stderr,
40
+ text=text, cwd=cwd, env=env, pass_fds=(write_fd,), start_new_session=True)
41
+ os.close(write_fd)
42
+ write_fd = None
43
+ timed_out = None
44
+ try:
45
+ out, err = process.communicate(input, timeout=timeout)
46
+ except subprocess.TimeoutExpired as error:
47
+ timed_out = error
48
+ os.killpg(process.pid, signal.SIGKILL)
49
+ out, err = process.communicate()
50
+ status = os.read(read_fd, 2048)
51
+ if status != b'ready':
52
+ raise InfrastructureError('Learner isolation failed: ' + status.decode(errors='replace'))
53
+ if timed_out is not None:
54
+ raise timed_out
55
+ return subprocess.CompletedProcess(argv, process.returncode, out, err)
56
+ finally:
57
+ if write_fd is not None:
58
+ os.close(write_fd)
59
+ os.close(read_fd)
60
+ if process is not None and process.poll() is None:
61
+ os.killpg(process.pid, signal.SIGKILL)
62
+ process.wait()
63
+
64
+ module.subprocess = SimpleNamespace(run=run, DEVNULL=subprocess.DEVNULL,
65
+ TimeoutExpired=subprocess.TimeoutExpired)
66
+ module.tempfile = SimpleNamespace(TemporaryDirectory=temporary_directory)
components/{mimo-code/source_bundle/runtime/code_runtime → loui/runtime/loui}/server.py RENAMED
@@ -1,14 +1,14 @@
1
-
2
  from openenv.core.env_server.http_server import create_app
3
  from common.models import ArenaAction, ArenaObservation
4
- from .environment import NativeHarborEnvironment
5
 
6
- app=create_app(NativeHarborEnvironment,ArenaAction,ArenaObservation,env_name='native_code_harbor',max_concurrent_envs=1)
7
 
8
 
9
  def main():
10
  import uvicorn
11
- uvicorn.run(app,host='0.0.0.0',port=8000,log_level='warning')
12
 
13
 
14
- if __name__=='__main__':main()
 
 
 
1
  from openenv.core.env_server.http_server import create_app
2
  from common.models import ArenaAction, ArenaObservation
3
+ from .environment import LouiEnvironment
4
 
5
+ app = create_app(LouiEnvironment, ArenaAction, ArenaObservation, env_name='loui_repair', max_concurrent_envs=5)
6
 
7
 
8
  def main():
9
  import uvicorn
10
+ uvicorn.run(app, host='0.0.0.0', port=8000, log_level='warning')
11
 
12
 
13
+ if __name__ == '__main__':
14
+ main()
components/loui/tasks/expression-3/instruction.md ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ solve(text): text is a valid arithmetic expression of nonnegative integer literals, whitespace, parentheses, unary +/- and binary + - * / ^. Use exact rational arithmetic. Power is right-associative and binds MORE tightly than unary signs; multiplication/division are left-associative and bind more tightly than addition/subtraction. Exponents evaluate to nonnegative integers; no zero divisor occurs. Return the canonical fractions.Fraction string, integer if denominator=1, else numerator/denominator. Example -2^2 is -4, 2^3^2 is 512, 8/4/2 is 1. Input unchanged.
2
+ Runtime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.
components/loui/tasks/incident-3/instruction.md ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ solve(events): process events by (time, original index), preserving ties. Global event id deduplication keeps the first in that sorted order. Group failures by (user,ip). At each failure retain times in inclusive [time-WINDOW,time]. Alert [user,ip,time] only on a crossing from fewer than THRESHOLD failures to at least THRESHOLD. A success clears that pair only. Return alerts in processing order, without mutating events.
2
+ Runtime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.
components/loui/upstream/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Louis Grenard
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
components/loui/upstream/v3/README.md ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python Repair Lab v3
2
+
3
+ Status: implemented, locally verified and probed with real quantized Qwen. The owner approved proceeding to public image/source publication without further tuning; CI verifies the Linux container and anonymous pull before any submission. NOT full-precision calibrated or submitted to Arena. Invalid replies and budget limits still confound the difficulty probe. An official-template raw adapter resolved local tool-parser errors. No score improvement is claimed. The published v2 baseline is preserved at https://github.com/louistiti/openenv-python-repair .
4
+
5
+ ## What changed
6
+
7
+ 24 declared task IDs: eight algorithmic families, three defect counts (one, two or three). Each reset creates five Python modules, seeded constants and examples, and a seeded subset of defects in separate modules. This is eight repair families, not 1,200 unrelated algorithms. The 1,200 replays below are verification episodes, not model rollouts or a training dataset row-count claim.
8
+
9
+ Families: FIFO multi-account accounting; half-open weighted capacity scheduling; dependency-graph timing and invalidity; deduplicated incident correlation; calibrated sensor aggregation; exact quoted-CSV reconciliation; min-cost capacitated allocation with reassignment; rational expression parsing with unary signs and right-associative powers.
10
+
11
+ Actions: read, write, test, submit. Initial observation contains the workspace, specification and three public examples. Write replaces one observed module after validation; settings.py is read-only. Test shows only public-example feedback. Submit uses hidden edge/random checks and ends; the 30-action budget also forces terminal grading. Invalid/fenced/non-JSON model replies are handled by the rollout harness by submitting current source, as in the Arena finish-action mechanism.
12
+
13
+ Terminal reward is the mean of per-behavior-group pass rates, not the pass rate dominated by numerous random cases. Intermediate reward is zero. Exact type-aware recursive comparisons reject bool/int confusion, extra keys, nonfinite values and input mutation. Parent-side verifiers alone own expected outputs and reward. Candidate execution receives input arguments and source, not references, expected answers, verifier groups or rewards.
14
+
15
+ ## Local verification
16
+
17
+ Pinned OpenEnv SDK: 86a180ede21e044f7929b9a7783ad83aa67d83a3.
18
+
19
+ - 100 tests passed (environment, WebSocket/HTTP sessions, attack/resource checks, calibration-harness unit tests, and deterministic witnesses for every designed defect).
20
+ - 1,200 fresh episodes: 50 reset seeds (1000 through 1049) for every one of the 24 IDs. Every reference scored 1; every starter scored below 1.
21
+ - 2,400 single-defect ablations: every remaining defect was detected by hidden checks.
22
+ - Real network WebSocket replay of all 24 IDs at seed 1234 passed for reference and starter outcomes.
23
+ - Official live OpenEnv runtime validation: 6/6 checks passed. This is contract validation, not Arena admission or model evaluation.
24
+ - Real local Qwen probes: 12 completed primary episodes, plus 25 completed episodes out of a requested 32 across all eight families. One extra diagnostic episode was completed separately. A further official-template raw sweep completed 32/32 episodes with zero inference errors, 15 full rewards and seven mixed groups. Nine earlier inference-aborted attempts across runs were not scored as zero. See CALIBRATION.md for limits and replacement accounting. Mock transport tests do not count as model results.
25
+
26
+ Evidence: replay-results.json, live-replay-results.json, validation-runtime.json and test-results.txt. The raw replay progress is in replay-progress.jsonl.
27
+
28
+ ## Reproduce
29
+
30
+ From this directory, use the virtual environment one level above. For a fresh checkout or extracted draft, create it first (Python 3.11+ and Git required):
31
+
32
+ python3 -m venv ../.venv
33
+ ../.venv/bin/python -m pip install -r requirements-calibration.txt pytest
34
+
35
+ Then run:
36
+
37
+ ../.venv/bin/python -m pytest -q test_environment.py test_calibrate.py test_targeted.py test_calibrate_raw.py
38
+ ../.venv/bin/python replay.py --seeds 50 --start 1000
39
+ ../.venv/bin/uvicorn server:app --host 127.0.0.1 --port 8766
40
+ ../.venv/bin/openenv validate --url http://127.0.0.1:8766 --level runtime --json
41
+
42
+ Public Linux image: ghcr.io/louistiti/openenv-python-repair:v3. See https://github.com/louistiti/openenv-python-repair/releases/tag/v3 for container validation and anonymous pull reports once CI completes. The workflow tests all 24 IDs over a real WebSocket and checks the exact SDK schema. The proposed submission is submission-v3.json; its image tag is replaced by the verified immutable digest before owner review. Separate explicit owner approval is required before submission.
43
+
44
+ ## Qwen calibration gate
45
+
46
+ The owner updated Ollama to 0.40.2; qwen3.8:27b was successfully downloaded and tested using its nvfp4/MLX runner. No paid GPU/inference service was used or authorized. The chat API produced mixed rewards but also HTTP 500 EOF/XML tool-parser errors. The official-template raw adapter removed those errors: 32/32 episodes completed; seven groups were mixed. After excluding invalid endings, only workflow, incident, allocation and expression still showed reward variation, with some budget confounding. Frequent invalid JSON/prose still prevents a clean overall task-difficulty claim. See CALIBRATION.md. With Ollama listening locally, reproduce a probe using:
47
+
48
+ ollama pull qwen3.8:27b
49
+ ../.venv/bin/python calibrate_raw.py --tasks allocation-3 expression-3 incident-3 workflow-3 --seed 5001 --repeats 4
50
+
51
+ The harness uses untrained local Qwen, thinking off, one exact JSON action per response, no JSON-constrained decoding and four stochastic rollouts per task/reset group. Inspect full and partial reward spread, invalid-action rate, truncations and elapsed time. If every group is uniformly perfect or uniformly unsuccessful, change difficulty and rerun. Mixed rewards are a candidate GRPO signal, NOT evidence of an optimizer gradient or learning gain.
52
+
53
+ Local Ollama uses quantized weights, unlike Arena's full-precision model. Runtime/template details are recorded; completion budget counts generated model tokens plus an explicitly approximate observation-token estimate. Context uses Ollama's prompt counter. The per-reply generation cap is 1,600 tokens, with a 4,096-token approximate completion budget and 8,192-token context. Temperature is a configurable local choice, not asserted to match Arena. Inference errors are recorded as ungraded attempts, not reward zero; reports distinguish requested and completed episode counts. Results are a proxy, never an Arena score prediction. For strong evidence, follow this with an authorized full-precision Qwen3.8-27B preflight. Never spend the daily submission slot as a substitute for calibration.
54
+
55
+ ## Limits and originality
56
+
57
+ This is restricted Python, not a general Python sandbox. Only local modules and tightly exposed csv, io.StringIO and fractions.Fraction imports are available. No dynamic introspection, private attributes, filesystem, network or processes. A fresh isolated interpreter has CPU/wall/file/descriptor caps; Linux adds a 256 MiB address-space cap. Mac address-space limits are not applied. The container is the outer security boundary; more adversarial audit is needed before treating this as a secure arbitrary-code runner.
58
+
59
+ Templates still exist, and an effective learner could master all eight solution programs. Seeded data and interacting defects reduce simple single-line repetition but do not by themselves prove useful transfer to Arena's eight evaluation domains. Correctness testing and learning testing are separate gates. All code, tasks and oracles are original synthetic work; no personal data, credentials or private evaluation tasks are included. MIT license inherited from repository root.
components/loui/upstream/v3/execution.py ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Bounded restricted Python execution. Parent owns all expected answers and rewards.
2
+
3
+ Not a general sandbox. AST/builtin restrictions and a subprocess are defense in
4
+ depth; the container is the outer isolation boundary. Hidden tests, references
5
+ and grading state are never sent to the candidate interpreter.
6
+ """
7
+ import ast
8
+ import json
9
+ import math
10
+ import subprocess
11
+ import sys
12
+ import tempfile
13
+ from pathlib import Path
14
+
15
+ STDLIB = {'csv', 'io', 'fractions'}
16
+ EXPORTS = {'csv': {'DictReader', 'reader'}, 'io': {'StringIO'}, 'fractions': {'Fraction'}}
17
+ METHODS = set('append extend pop insert remove clear sort reverse count index get keys values items setdefault add discard union intersection difference split splitlines join strip lstrip rstrip replace startswith endswith lower upper casefold isdigit isalpha isalnum isspace copy fromkeys numerator denominator limit_denominator'.split()) | set().union(*EXPORTS.values())
18
+ MAX_SOURCE = 48000
19
+ RUNNER = r'''
20
+ import builtins, contextlib, importlib, io, json, resource, sys, types
21
+ resource.setrlimit(resource.RLIMIT_CPU, (2,2))
22
+ if sys.platform != 'darwin':
23
+ resource.setrlimit(resource.RLIMIT_AS,(256*1024*1024,256*1024*1024))
24
+ resource.setrlimit(resource.RLIMIT_FSIZE,(1048576,1048576))
25
+ resource.setrlimit(resource.RLIMIT_NOFILE,(16,16))
26
+ resource.setrlimit(resource.RLIMIT_CORE,(0,0))
27
+ payload=json.load(sys.stdin)
28
+ sources={p[:-3]:c for p,c in payload['files'].items()}
29
+ allowed={n:getattr(builtins,n) for n in 'abs all any bool dict enumerate filter float int isinstance len list map max min pow range reversed round set sorted str sum tuple zip Exception ValueError TypeError'.split()}
30
+ cache={}
31
+ loading=set()
32
+ def load(name,globals=None,locals=None,fromlist=(),level=0):
33
+ if level or '.' in name:
34
+ raise ImportError('only absolute top-level imports')
35
+ if name in ('csv','io','fractions'):
36
+ names={'csv':['DictReader','reader'],'io':['StringIO'],'fractions':['Fraction']}[name]
37
+ safe=types.ModuleType(name)
38
+ original=importlib.import_module(name)
39
+ for n in names:
40
+ setattr(safe,n,getattr(original,n))
41
+ return safe
42
+ if name not in sources:
43
+ raise ImportError(name)
44
+ if name in loading:
45
+ raise ImportError('circular local import')
46
+ if name not in cache:
47
+ loading.add(name)
48
+ module=types.ModuleType(name)
49
+ module.__dict__['__builtins__']=dict(allowed, __import__=load)
50
+ exec(sources[name],module.__dict__,module.__dict__)
51
+ cache[name]=module
52
+ loading.remove(name)
53
+ return cache[name]
54
+ results=[]
55
+ try:
56
+ with contextlib.redirect_stdout(io.StringIO()):
57
+ solve=load('main').solve
58
+ for args in payload['args']:
59
+ original=json.dumps(args,sort_keys=True,allow_nan=False)
60
+ try:
61
+ output=solve(*args)
62
+ encoded=json.dumps(output,allow_nan=False)
63
+ if len(encoded)>20000:
64
+ raise ValueError('output too large')
65
+ results.append({'output':json.loads(encoded),'mutated':original!=json.dumps(args,sort_keys=True,allow_nan=False)})
66
+ except BaseException as e:
67
+ results.append({'error':type(e).__name__})
68
+ except BaseException as e:
69
+ results=[{'error':type(e).__name__} for args in payload['args']]
70
+ print(json.dumps(results,allow_nan=False))
71
+ '''
72
+
73
+ def validate(files):
74
+ if 'main.py' not in files or sum(len(c) for c in files.values()) > MAX_SOURCE:
75
+ raise ValueError('Missing main.py or workspace too large')
76
+ locals_allowed = {p[:-3] for p in files}
77
+ for path, code in files.items():
78
+ if not path.endswith('.py') or not path[:-3].isidentifier() or path.startswith('_'):
79
+ raise ValueError('Only flat public Python module names')
80
+ tree = ast.parse(code)
81
+ if path == 'main.py' and not any(isinstance(n,ast.FunctionDef) and n.name=='solve' for n in tree.body):
82
+ raise ValueError('main.py must define solve')
83
+ for n in ast.walk(tree):
84
+ if isinstance(n,(ast.ClassDef,ast.AsyncFunctionDef,ast.Await,ast.With,ast.AsyncWith,ast.Global,ast.Nonlocal)):
85
+ raise ValueError('Unsupported control construct')
86
+ if isinstance(n,ast.Import):
87
+ for a in n.names:
88
+ if a.name not in locals_allowed | STDLIB or (a.asname or a.name).startswith('_'):
89
+ raise ValueError('Import unavailable')
90
+ if isinstance(n,ast.ImportFrom):
91
+ if n.level or n.module not in locals_allowed | STDLIB or any(a.name.startswith('_') or (a.asname or '').startswith('_') or a.name=='*' or (n.module in STDLIB and a.name not in EXPORTS[n.module]) for a in n.names):
92
+ raise ValueError('Import unavailable')
93
+ if isinstance(n,ast.Attribute) and n.attr not in METHODS:
94
+ raise ValueError('Private attributes and I/O unavailable')
95
+ if isinstance(n,ast.Name) and (n.id.startswith('_') or n.id in {'open','eval','exec','compile','globals','locals','vars','getattr','setattr','delattr','hasattr','type','input','print','breakpoint','help','dir','memoryview'}):
96
+ raise ValueError('Private/dynamic names and I/O unavailable')
97
+ if isinstance(n,(ast.FunctionDef,ast.arg)):
98
+ name=n.name if isinstance(n,ast.FunctionDef) else n.arg
99
+ if name.startswith('_') or (isinstance(n,ast.FunctionDef) and n.decorator_list):
100
+ raise ValueError('Private or decorated functions unavailable')
101
+ if isinstance(n,ast.ExceptHandler) and n.name and n.name.startswith('_'):
102
+ raise ValueError('Private exception alias unavailable')
103
+ return True
104
+
105
+ def equal(actual, expected):
106
+ if isinstance(actual,bool) or isinstance(expected,bool):
107
+ return type(actual) is type(expected) and actual==expected
108
+ if isinstance(actual,(int,float)) and isinstance(expected,(int,float)):
109
+ return math.isfinite(actual) and math.isclose(actual,expected,rel_tol=1e-10,abs_tol=1e-10)
110
+ if isinstance(actual,list) and isinstance(expected,list):
111
+ return len(actual)==len(expected) and all(equal(a,b) for a,b in zip(actual,expected))
112
+ if isinstance(actual,dict) and isinstance(expected,dict):
113
+ return actual.keys()==expected.keys() and all(equal(actual[k],expected[k]) for k in expected)
114
+ return type(actual) is type(expected) and actual==expected
115
+
116
+ def grade(files, cases, feedback=False):
117
+ total=len(cases)
118
+ outputs=[]
119
+ error=None
120
+ try:
121
+ validate(files)
122
+ # Bounded spool prevents untrusted output exhausting parent memory.
123
+ with tempfile.TemporaryDirectory(prefix='repair-v3-') as work:
124
+ output_path=Path(work)/'result'
125
+ with output_path.open('w+') as out:
126
+ process=subprocess.run([sys.executable,'-I','-S','-c',RUNNER],
127
+ input=json.dumps({'files':files,'args':[c['args'] for c in cases]}),
128
+ text=True,stdout=out,stderr=subprocess.DEVNULL,timeout=3,
129
+ cwd=work,env={'PATH':'/usr/bin:/bin'})
130
+ out.seek(0)
131
+ raw=out.read(1048577)
132
+ if process.returncode or len(raw)>1048576:
133
+ raise ValueError('execution/resource limit')
134
+ outputs=json.loads(raw)
135
+ if not isinstance(outputs,list) or len(outputs)!=total:
136
+ raise ValueError('invalid result protocol')
137
+ except (ValueError,SyntaxError,RecursionError,subprocess.TimeoutExpired) as e:
138
+ error=type(e).__name__+': '+str(e)[:150]
139
+ groups, failures, passed={},[],0
140
+ for i,c in enumerate(cases):
141
+ result=outputs[i] if i<len(outputs) else {'error':error or 'no output'}
142
+ ok=isinstance(result,dict) and 'output' in result and not result.get('mutated') and equal(result['output'],c['expected'])
143
+ passed+=int(ok)
144
+ tally=groups.setdefault(c['group'],[0,0]); tally[0]+=int(ok); tally[1]+=1
145
+ if feedback and not ok and len(failures)<3:
146
+ failures.append({'args':c['args'],'expected':c['expected'],'actual':result})
147
+ # Balance distinct behaviors instead of allowing random easy cases to swamp edge cases.
148
+ reward=sum(a/b for a,b in groups.values())/len(groups) if groups else 0.0
149
+ result={'passed':passed,'total':total,'reward':reward}
150
+ if feedback:
151
+ result['failures']=failures
152
+ if error:
153
+ result['error']=error
154
+ return result
components/loui/upstream/v3/hard_tasks.py ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Harder algorithmic repair families with independent small-instance oracles."""
2
+ import ast
3
+ from fractions import Fraction
4
+
5
+
6
+ def allocation_ref(workers,jobs,quotes):
7
+ cost={(w,j):c for w,j,c in quotes}
8
+ slots=[j for j,d in jobs for _ in range(d)]
9
+ remaining=dict(workers)
10
+ best=(0,0)
11
+ def search(i,filled,total):
12
+ nonlocal best
13
+ if i==len(slots):
14
+ if filled>best[0] or (filled==best[0] and total<best[1]):
15
+ best=(filled,total)
16
+ return
17
+ search(i+1,filled,total)
18
+ j=slots[i]
19
+ for w in remaining:
20
+ if remaining[w]>0 and (w,j) in cost:
21
+ remaining[w]-=1
22
+ search(i+1,filled+1,total+cost[w,j])
23
+ remaining[w]+=1
24
+ search(0,0,0)
25
+ return {'filled':best[0],'cost':best[1]}
26
+
27
+
28
+ def expression_ref(text):
29
+ # AST visitor is independent of the candidate's tokenizer/Pratt parser.
30
+ tree=ast.parse(text.strip().replace('^','**'),mode='eval')
31
+ def evaluate(n):
32
+ if isinstance(n,ast.Constant) and type(n.value) is int:
33
+ return Fraction(n.value)
34
+ if isinstance(n,ast.UnaryOp):
35
+ v=evaluate(n.operand)
36
+ return -v if isinstance(n.op,ast.USub) else v
37
+ a,b=evaluate(n.left),evaluate(n.right)
38
+ if isinstance(n.op,ast.Add): return a+b
39
+ if isinstance(n.op,ast.Sub): return a-b
40
+ if isinstance(n.op,ast.Mult): return a*b
41
+ if isinstance(n.op,ast.Div): return a/b
42
+ if isinstance(n.op,ast.Pow): return a**b
43
+ raise ValueError('operator')
44
+ return str(evaluate(tree.body))
45
+
46
+
47
+ HARD_SPECS={
48
+ 'allocation': (
49
+ 'solve(workers,jobs,quotes): workers=[[name,capacity],...], jobs=[[name,demand],...], quotes=[[worker,job,cost_per_unit],...] (unique pairs, nonnegative integer costs). Unquoted assignments are forbidden. Allocate integer units, never exceed a worker capacity or job demand. First maximize total filled demand, then minimize cost among all such allocations. Return exactly {filled:int,cost:int}. A greedy edge ordering is insufficient; reassignment may be necessary. Names in each list are unique. Empty and disconnected instances are valid; do not mutate inputs.',
50
+ {
51
+ 'network.py': "def edge(graph,a,b,cap,cost):\n graph[a].append([b,len(graph[b]),cap,cost])\n graph[b].append([a,len(graph[a])-1,0,-cost])\n",
52
+ 'paths.py': "def shortest(graph,source):\n n=len(graph)\n distance=[None]*n\n parent=[None]*n\n distance[source]=0\n for turn in range(n-1):\n changed=False\n for a in range(n):\n if distance[a] is not None:\n for idx,e in enumerate(graph[a]):\n b,rev,cap,cost=e\n if cap>0 and (distance[b] is None or distance[a]+cost<distance[b]):\n distance[b]=distance[a]+cost\n parent[b]=(a,idx)\n changed=True\n if not changed:\n break\n return distance,parent\n",
53
+ 'augment.py': "def send(graph,parent,source,sink):\n path=[]\n v=sink\n while v!=source:\n a,idx=parent[v]\n path.append((a,idx))\n v=a\n amount=min(graph[a][idx][2] for a,idx in path)\n for a,idx in path:\n b,rev,cap,cost=graph[a][idx]\n graph[a][idx][2]-=amount\n graph[b][rev][2]+=amount\n return amount\n",
54
+ 'main.py': "from network import edge\nfrom paths import shortest\nfrom augment import send\ndef solve(workers,jobs,quotes):\n wmap={name:i+1 for i,(name,c) in enumerate(workers)}\n jmap={name:len(workers)+i+1 for i,(name,d) in enumerate(jobs)}\n source,sink=0,len(workers)+len(jobs)+1\n graph=[[] for i in range(sink+1)]\n for name,c in workers:\n edge(graph,source,wmap[name],c,0)\n for name,d in jobs:\n edge(graph,jmap[name],sink,d,0)\n for w,j,c in quotes:\n edge(graph,wmap[w],jmap[j],sum(d for name,d in jobs),c)\n filled,total=0,0\n while True:\n distance,parent=shortest(graph,source)\n if distance[sink] is None:\n break\n amount=send(graph,parent,source,sink)\n filled+=amount\n total+=amount*distance[sink]\n return {'filled':filled,'cost':total}\n",
55
+ }, [('network.py','len(graph[a])-1,0,-cost','len(graph[a])-1,0,cost'),
56
+ ('paths.py','range(n-1)','range(1)'),
57
+ ('augment.py','amount=min(','amount=max(')]),
58
+ 'expression': (
59
+ 'solve(text): text is a valid arithmetic expression of nonnegative integer literals, whitespace, parentheses, unary +/- and binary + - * / ^. Use exact rational arithmetic. Power is right-associative and binds MORE tightly than unary signs; multiplication/division are left-associative and bind more tightly than addition/subtraction. Exponents evaluate to nonnegative integers; no zero divisor occurs. Return the canonical fractions.Fraction string, integer if denominator=1, else numerator/denominator. Example -2^2 is -4, 2^3^2 is 512, 8/4/2 is 1. Input unchanged.',
60
+ {
61
+ 'lex.py': "def tokens(text):\n out=[]\n i=0\n while i<len(text):\n c=text[i]\n if c.isspace():\n i+=1\n elif c.isdigit():\n j=i+1\n while j<len(text) and text[j].isdigit():\n j+=1\n out.append(text[i:j])\n i=j\n else:\n out.append(c)\n i+=1\n return out\n",
62
+ 'binding.py': "def powers(op):\n if op in ('+','-'): return (10,11)\n if op in ('*','/'): return (20,21)\n if op=='^': return (40,40)\n return (-1,-1)\n",
63
+ 'unary.py': "def precedence():\n return 30\n",
64
+ 'main.py': "from fractions import Fraction\nfrom lex import tokens\nfrom binding import powers\nfrom unary import precedence\ndef parse(ts,pos,minimum):\n token=ts[pos]\n if token in ('+','-'):\n value,pos=parse(ts,pos+1,precedence())\n if token=='-': value=-value\n elif token=='(':\n value,pos=parse(ts,pos+1,0)\n if ts[pos]!=')': raise ValueError('parenthesis')\n pos+=1\n else:\n value=Fraction(int(token))\n pos+=1\n while pos<len(ts):\n op=ts[pos]\n left,right=powers(op)\n if left<minimum: break\n other,pos=parse(ts,pos+1,right)\n if op=='+': value+=other\n elif op=='-': value-=other\n elif op=='*': value*=other\n elif op=='/': value/=other\n elif op=='^': value=value**other\n return value,pos\ndef solve(text):\n ts=tokens(text)\n value,pos=parse(ts,0,0)\n if pos!=len(ts): raise ValueError('trailing tokens')\n return str(value)\n",
65
+ }, [('lex.py','while j<len(text) and text[j].isdigit():','while False:'),
66
+ ('binding.py',"if op=='^': return (40,40)","if op=='^': return (40,41)"),
67
+ ('unary.py','return 30','return 50')]),
68
+ }
69
+
70
+
71
+ def hard_cases(family,rng):
72
+ out=[]
73
+ def add(group,*args):
74
+ out.append({'group':group,'args':list(args)})
75
+ if family=='allocation':
76
+ add('empty',[],[],[])
77
+ add('reroute',[['a',1],['b',1]],[['x',1],['y',1]],[['a','x',1],['a','y',2],['b','x',2],['b','y',100]])
78
+ add('bottleneck',[['a',4]],[['x',1]],[['a','x',3]])
79
+ add('shortfall',[['a',2]],[['x',1],['y',3]],[['a','x',2]])
80
+ add('reverse_order',[['b',1],['a',1]],[['y',1],['x',1]],[['a','x',1],['a','y',2],['b','x',2],['b','y',100]])
81
+ for i in range(30):
82
+ workers=[[f'w{j}',rng.randint(1,3)] for j in range(rng.randint(2,3))]
83
+ jobs=[[f'j{j}',rng.randint(1,2)] for j in range(rng.randint(2,3))]
84
+ quotes=[[w,j,rng.randint(0,20)] for w,c in workers for j,d in jobs if rng.random()<.8]
85
+ rng.shuffle(workers); rng.shuffle(jobs); rng.shuffle(quotes)
86
+ add('random',workers,jobs,quotes)
87
+ else:
88
+ add('literal',str(rng.randint(10,99)))
89
+ add('unary',f'-{rng.randint(2,5)}^2')
90
+ add('power','2^3^2')
91
+ add('rational','8/4/2 + 1/3')
92
+ add('parentheses','-(12 + 3) * (5 - 8)')
93
+ def expression(depth):
94
+ if depth==0: return str(rng.randint(1,20))
95
+ op=rng.choice(['+','-','*','/','^'])
96
+ a=expression(depth-1)
97
+ b=str(rng.randint(1,5)) if op=='/' else str(rng.randint(0,3)) if op=='^' else expression(depth-1)
98
+ value=f'({a} {op} {b})'
99
+ return '-'+value if rng.random()<.25 else value
100
+ for i in range(30): add('random',expression(rng.randint(1,3)))
101
+ return out
components/loui/upstream/v3/server.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Python Repair Lab v3: generated multi-file debugging, OpenEnv pinned SDK."""
2
+ import json
3
+ from typing import Literal
4
+ from uuid import uuid4
5
+
6
+ from openenv.core.env_server.http_server import create_app
7
+ from openenv.core.env_server.interfaces import Environment
8
+ from openenv.core.env_server.types import Action, Observation, State
9
+ from pydantic import Field
10
+
11
+ from tasks import TASK_IDS, make_task
12
+ from execution import grade, validate
13
+
14
+ MAX_STEPS = 30
15
+
16
+ class RepairAction(Action):
17
+ operation: Literal['read','write','test','submit'] = Field(description='read returns a workspace file; write replaces one module; test runs visible examples; submit grades hidden cases and ends.')
18
+ path: str = Field(default='',max_length=80,description='Observed flat Python filename for read/write. No paths, new files or changes to settings.py.')
19
+ code: str = Field(default='',max_length=16000,description='Full replacement module for write. Allowed: local imports, csv.DictReader/reader, io.StringIO, fractions.Fraction and ordinary builtins/methods. No private attributes, filesystem, network, process or dynamic execution.')
20
+
21
+ class RepairObservation(Observation):
22
+ task_id: str = ''
23
+ message: str = ''
24
+ files: dict[str,str] = Field(default_factory=dict)
25
+ steps_left: int = MAX_STEPS
26
+
27
+ class RepairEnvironment(Environment):
28
+ SUPPORTS_CONCURRENT_SESSIONS = True
29
+
30
+ def __init__(self):
31
+ self._state = State(episode_id=str(uuid4()),step_count=0)
32
+ self.task = None
33
+ self.files = {}
34
+ self.ended = False
35
+ self.last_reward = 0.0
36
+
37
+ @property
38
+ def state(self):
39
+ return self._state
40
+
41
+ def reset(self, seed=None, task_id=None, **kwargs):
42
+ seed = 0 if seed is None else seed
43
+ if task_id is None:
44
+ task_id = TASK_IDS[seed % len(TASK_IDS)]
45
+ self.task = make_task(task_id,seed)
46
+ self.files = dict(self.task.starter)
47
+ self.ended = False
48
+ self.last_reward = 0.0
49
+ self._state = State(episode_id=str(uuid4()),step_count=0)
50
+ return RepairObservation(task_id=task_id,message=self.task.prompt+'\nPublic examples: '+json.dumps(self.task.visible),files=dict(self.files),reward=0.0,done=False)
51
+
52
+ def step(self,action,**kwargs):
53
+ if self.task is None:
54
+ self.reset()
55
+ if self.ended:
56
+ return RepairObservation(task_id=self.task.task_id,message='Episode ended.',done=True,reward=self.last_reward,steps_left=0)
57
+ self._state.step_count += 1
58
+ message, files = '', {}
59
+ if action.operation == 'read':
60
+ if action.path in self.files:
61
+ files[action.path] = self.files[action.path]
62
+ message = 'File contents.'
63
+ else:
64
+ message = 'Unknown file.'
65
+ elif action.operation == 'write':
66
+ if action.path not in self.files or action.path=='settings.py':
67
+ message = 'Unknown or read-only file. Source unchanged.'
68
+ else:
69
+ candidate = dict(self.files, **{action.path:action.code})
70
+ try:
71
+ validate(candidate)
72
+ self.files = candidate
73
+ message = 'Module replaced. Use test or submit.'
74
+ except (SyntaxError,ValueError,RecursionError) as error:
75
+ message = 'Rejected; source unchanged: '+str(error)[:180]
76
+ elif action.operation == 'test':
77
+ message = json.dumps(grade(self.files,self.task.visible,feedback=True))
78
+ self.ended = action.operation=='submit' or self._state.step_count>=MAX_STEPS
79
+ if self.ended:
80
+ result = grade(self.files,self.task.hidden)
81
+ self.last_reward = result['reward']
82
+ message = json.dumps(result)
83
+ return RepairObservation(task_id=self.task.task_id,message=message,files=files,done=self.ended,reward=self.last_reward if self.ended else 0.0,steps_left=max(0,MAX_STEPS-self._state.step_count))
84
+
85
+ app = create_app(RepairEnvironment,RepairAction,RepairObservation,env_name='python_repair_lab_v3',max_concurrent_envs=5)
components/loui/upstream/v3/tasks.jsonl ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"task_id": "ledger-1", "family": "ledger", "defect_count": 1, "example_seed": 0, "prompt": "solve(events): FIFO accounting in input order. Each event has account, asset, side (buy/sell), qty (positive integer), price (integer cents). Separate lots by (account,asset). Sell only available units, do not create shorts. Deduct FEE cents per filled sold unit. Return pnl, unfilled (total requested units lacking stock), and sorted nonempty positions [account,asset,qty,cost_basis]. Do not mutate input.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"identity.py": "def key(e):\n return (e['account'], e['asset'])\n", "lots.py": "def consume(queue, qty):\n used = min(qty, sum(n for n, p in queue))\n remaining, cost = used, 0\n while remaining:\n n, p = queue[0]\n take = min(n, remaining)\n cost += take * p\n remaining -= take\n if take == n:\n queue.pop(0)\n else:\n queue[0] = (n - take, p)\n return used, cost\n", "charges.py": "from settings import FEE\ndef profit(qty, price, cost):\n return qty * price - FEE - cost\n", "main.py": "from identity import key\nfrom lots import consume\nfrom charges import profit\ndef solve(events):\n lots, pnl, unfilled = {}, 0, 0\n for e in events:\n k = key(e)\n q = lots.setdefault(k, [])\n if e['side'] == 'buy':\n q.append((e['qty'], e['price']))\n else:\n used, cost = consume(q, e['qty'])\n pnl += profit(used, e['price'], cost)\n unfilled += e['qty'] - used\n return {'pnl': pnl, 'unfilled': unfilled, 'positions': [[a, s, sum(n for n, p in q), sum(n*p for n,p in q)] for (a,s),q in sorted(lots.items()) if q]}\n", "settings.py": "FEE = 1\nLIMIT = 7\nWINDOW = 20\nTHRESHOLD = 3\nCALIBRATIONS = {'s0': [1, 0], 's1': [4, 1], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"pnl": 0, "unfilled": 0, "positions": []}}, {"group": "identity", "args": [[{"account": "a", "asset": "x", "side": "buy", "qty": 3, "price": 100}, {"account": "b", "asset": "x", "side": "sell", "qty": 2, "price": 150}]], "expected": {"pnl": 0, "unfilled": 2, "positions": [["a", "x", 3, 300]]}}, {"group": "random", "args": [[{"account": "a", "asset": "x", "side": "sell", "qty": 6, "price": 231}, {"account": "b", "asset": "z", "side": "buy", "qty": 5, "price": 186}, {"account": "b", "asset": "x", "side": "buy", "qty": 4, "price": 84}, {"account": "c", "asset": "z", "side": "buy", "qty": 4, "price": 232}, {"account": "b", "asset": "x", "side": "buy", "qty": 2, "price": 82}, {"account": "a", "asset": "x", "side": "sell", "qty": 5, "price": 171}, {"account": "c", "asset": "y", "side": "sell", "qty": 3, "price": 145}, {"account": "c", "asset": "x", "side": "sell", "qty": 2, "price": 196}, {"account": "b", "asset": "x", "side": "sell", "qty": 6, "price": 193}, {"account": "a", "asset": "z", "side": "sell", "qty": 5, "price": 146}, {"account": "a", "asset": "z", "side": "sell", "qty": 2, "price": 59}]], "expected": {"pnl": 652, "unfilled": 23, "positions": [["b", "z", 5, 930], ["c", "z", 4, 928]]}}], "selected_for_submission": false}
2
+ {"task_id": "ledger-2", "family": "ledger", "defect_count": 2, "example_seed": 0, "prompt": "solve(events): FIFO accounting in input order. Each event has account, asset, side (buy/sell), qty (positive integer), price (integer cents). Separate lots by (account,asset). Sell only available units, do not create shorts. Deduct FEE cents per filled sold unit. Return pnl, unfilled (total requested units lacking stock), and sorted nonempty positions [account,asset,qty,cost_basis]. Do not mutate input.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"identity.py": "def key(e):\n return (e['asset'], e['asset'])\n", "lots.py": "def consume(queue, qty):\n used = min(qty, sum(n for n, p in queue))\n remaining, cost = used, 0\n while remaining:\n n, p = queue[0]\n take = min(n, remaining)\n cost += take * p\n remaining -= take\n if take == n:\n queue.pop(0)\n else:\n queue[0] = (n - take, p)\n return used, cost\n", "charges.py": "from settings import FEE\ndef profit(qty, price, cost):\n return qty * price - FEE - cost\n", "main.py": "from identity import key\nfrom lots import consume\nfrom charges import profit\ndef solve(events):\n lots, pnl, unfilled = {}, 0, 0\n for e in events:\n k = key(e)\n q = lots.setdefault(k, [])\n if e['side'] == 'buy':\n q.append((e['qty'], e['price']))\n else:\n used, cost = consume(q, e['qty'])\n pnl += profit(used, e['price'], cost)\n unfilled += e['qty'] - used\n return {'pnl': pnl, 'unfilled': unfilled, 'positions': [[a, s, sum(n for n, p in q), sum(n*p for n,p in q)] for (a,s),q in sorted(lots.items()) if q]}\n", "settings.py": "FEE = 6\nLIMIT = 3\nWINDOW = 14\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 2], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"pnl": 0, "unfilled": 0, "positions": []}}, {"group": "identity", "args": [[{"account": "a", "asset": "x", "side": "buy", "qty": 3, "price": 100}, {"account": "b", "asset": "x", "side": "sell", "qty": 2, "price": 150}]], "expected": {"pnl": 0, "unfilled": 2, "positions": [["a", "x", 3, 300]]}}, {"group": "random", "args": [[{"account": "b", "asset": "x", "side": "sell", "qty": 6, "price": 40}, {"account": "b", "asset": "x", "side": "buy", "qty": 1, "price": 103}, {"account": "a", "asset": "z", "side": "sell", "qty": 1, "price": 78}, {"account": "a", "asset": "z", "side": "buy", "qty": 1, "price": 163}, {"account": "c", "asset": "x", "side": "sell", "qty": 4, "price": 29}, {"account": "b", "asset": "z", "side": "buy", "qty": 2, "price": 181}, {"account": "a", "asset": "x", "side": "buy", "qty": 6, "price": 48}, {"account": "b", "asset": "x", "side": "sell", "qty": 6, "price": 52}, {"account": "b", "asset": "y", "side": "sell", "qty": 1, "price": 98}, {"account": "c", "asset": "z", "side": "buy", "qty": 3, "price": 29}, {"account": "b", "asset": "y", "side": "buy", "qty": 6, "price": 64}, {"account": "b", "asset": "x", "side": "buy", "qty": 2, "price": 207}, {"account": "b", "asset": "x", "side": "buy", "qty": 3, "price": 216}, {"account": "b", "asset": "x", "side": "sell", "qty": 6, "price": 129}, {"account": "a", "asset": "x", "side": "sell", "qty": 1, "price": 167}, {"account": "b", "asset": "z", "side": "buy", "qty": 3, "price": 167}, {"account": "b", "asset": "z", "side": "sell", "qty": 5, "price": 126}, {"account": "c", "asset": "z", "side": "buy", "qty": 3, "price": 85}, {"account": "b", "asset": "x", "side": "buy", "qty": 3, "price": 73}, {"account": "a", "asset": "z", "side": "buy", "qty": 6, "price": 244}, {"account": "a", "asset": "z", "side": "buy", "qty": 6, "price": 78}, {"account": "a", "asset": "z", "side": "buy", "qty": 5, "price": 26}]], "expected": {"pnl": -654, "unfilled": 18, "positions": [["a", "x", 5, 240], ["a", "z", 18, 2225], ["b", "x", 3, 219], ["b", "y", 6, 384], ["c", "z", 6, 342]]}}], "selected_for_submission": false}
3
+ {"task_id": "ledger-3", "family": "ledger", "defect_count": 3, "example_seed": 0, "prompt": "solve(events): FIFO accounting in input order. Each event has account, asset, side (buy/sell), qty (positive integer), price (integer cents). Separate lots by (account,asset). Sell only available units, do not create shorts. Deduct FEE cents per filled sold unit. Return pnl, unfilled (total requested units lacking stock), and sorted nonempty positions [account,asset,qty,cost_basis]. Do not mutate input.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"identity.py": "def key(e):\n return (e['asset'], e['asset'])\n", "lots.py": "def consume(queue, qty):\n used = min(qty, sum(n for n, p in queue))\n remaining, cost = used, 0\n while remaining:\n n, p = queue[-1]\n take = min(n, remaining)\n cost += take * p\n remaining -= take\n if take == n:\n queue.pop(0)\n else:\n queue[-1] = (n - take, p)\n return used, cost\n", "charges.py": "from settings import FEE\ndef profit(qty, price, cost):\n return qty * price - FEE - cost\n", "main.py": "from identity import key\nfrom lots import consume\nfrom charges import profit\ndef solve(events):\n lots, pnl, unfilled = {}, 0, 0\n for e in events:\n k = key(e)\n q = lots.setdefault(k, [])\n if e['side'] == 'buy':\n q.append((e['qty'], e['price']))\n else:\n used, cost = consume(q, e['qty'])\n pnl += profit(used, e['price'], cost)\n unfilled += e['qty'] - used\n return {'pnl': pnl, 'unfilled': unfilled, 'positions': [[a, s, sum(n for n, p in q), sum(n*p for n,p in q)] for (a,s),q in sorted(lots.items()) if q]}\n", "settings.py": "FEE = 4\nLIMIT = 8\nWINDOW = 5\nTHRESHOLD = 4\nCALIBRATIONS = {'s0': [1, 0], 's1': [3, 1], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"pnl": 0, "unfilled": 0, "positions": []}}, {"group": "identity", "args": [[{"account": "a", "asset": "x", "side": "buy", "qty": 3, "price": 100}, {"account": "b", "asset": "x", "side": "sell", "qty": 2, "price": 150}]], "expected": {"pnl": 0, "unfilled": 2, "positions": [["a", "x", 3, 300]]}}, {"group": "random", "args": [[{"account": "b", "asset": "y", "side": "buy", "qty": 2, "price": 118}, {"account": "c", "asset": "z", "side": "buy", "qty": 2, "price": 212}, {"account": "b", "asset": "x", "side": "sell", "qty": 3, "price": 165}, {"account": "b", "asset": "x", "side": "buy", "qty": 5, "price": 158}, {"account": "b", "asset": "y", "side": "sell", "qty": 1, "price": 92}, {"account": "a", "asset": "x", "side": "buy", "qty": 3, "price": 187}]], "expected": {"pnl": -30, "unfilled": 3, "positions": [["a", "x", 3, 561], ["b", "x", 5, 790], ["b", "y", 1, 118], ["c", "z", 2, 424]]}}], "selected_for_submission": false}
4
+ {"task_id": "capacity-1", "family": "capacity", "defect_count": 1, "example_seed": 0, "prompt": "solve(bookings): each [start,end,weight] is a half-open integer-time weighted reservation. Ignore zero-length and nonpositive-weight entries. Return peak load, merged maximal overload intervals where load > LIMIT, and integral of max(load-LIMIT,0) over time as excess_area. Touching overload intervals must merge. Input unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"events.py": "def endpoints(bookings):\n delta = {}\n for a,b,w in bookings:\n if a < b and w > 0:\n delta[a] = delta.get(a, 0) + w\n delta[b] = delta.get(b, 0) - w\n return sorted(delta.items())\n", "rules.py": "from settings import LIMIT\ndef overloaded(load):\n return load > LIMIT\ndef excess(load):\n return max(0, load - LIMIT)\n", "merge.py": "def append_span(spans, a, b):\n if spans and spans[-1][1] > a:\n spans[-1][1] = b\n else:\n spans.append([a,b])\n", "main.py": "from events import endpoints\nfrom rules import overloaded, excess\nfrom merge import append_span\ndef solve(bookings):\n points = endpoints(bookings)\n load, peak, area, spans = 0, 0, 0, []\n for i in range(len(points)-1):\n a,delta = points[i]\n b = points[i+1][0]\n load += delta\n peak = max(peak, load)\n area += excess(load) * (b-a)\n if overloaded(load):\n append_span(spans, a, b)\n return {'peak': peak, 'overload': spans, 'excess_area': area}\n", "settings.py": "FEE = 4\nLIMIT = 6\nWINDOW = 5\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 3], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"peak": 0, "overload": [], "excess_area": 0}}, {"group": "half_open", "args": [[[0, 4, 6], [4, 7, 6]]], "expected": {"peak": 6, "overload": [], "excess_area": 0}}, {"group": "random", "args": [[[10, 19, 2], [12, 12, 6], [0, 7, 7], [12, 22, 7], [-2, 7, 6], [12, 13, 9], [10, 17, 2], [12, 13, 2], [10, 19, 0], [0, 1, 2], [-1, 9, 4], [7, 13, 8], [-2, 3, 7]]], "expected": {"peak": 30, "overload": [[-2, 22]], "excess_area": 197}}], "selected_for_submission": false}
5
+ {"task_id": "capacity-2", "family": "capacity", "defect_count": 2, "example_seed": 0, "prompt": "solve(bookings): each [start,end,weight] is a half-open integer-time weighted reservation. Ignore zero-length and nonpositive-weight entries. Return peak load, merged maximal overload intervals where load > LIMIT, and integral of max(load-LIMIT,0) over time as excess_area. Touching overload intervals must merge. Input unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"events.py": "def endpoints(bookings):\n delta = {}\n for a,b,w in bookings:\n if a < b and w > 0:\n delta[a] = delta.get(a, 0) + w\n delta[b] = delta.get(b, 0) - w\n return sorted(delta.items())\n", "rules.py": "from settings import LIMIT\ndef overloaded(load):\n return load >= LIMIT\ndef excess(load):\n return max(0, load - LIMIT)\n", "merge.py": "def append_span(spans, a, b):\n if spans and spans[-1][1] > a:\n spans[-1][1] = b\n else:\n spans.append([a,b])\n", "main.py": "from events import endpoints\nfrom rules import overloaded, excess\nfrom merge import append_span\ndef solve(bookings):\n points = endpoints(bookings)\n load, peak, area, spans = 0, 0, 0, []\n for i in range(len(points)-1):\n a,delta = points[i]\n b = points[i+1][0]\n load += delta\n peak = max(peak, load)\n area += excess(load) * (b-a)\n if overloaded(load):\n append_span(spans, a, b)\n return {'peak': peak, 'overload': spans, 'excess_area': area}\n", "settings.py": "FEE = 6\nLIMIT = 2\nWINDOW = 14\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 5], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"peak": 0, "overload": [], "excess_area": 0}}, {"group": "half_open", "args": [[[0, 4, 2], [4, 7, 2]]], "expected": {"peak": 2, "overload": [], "excess_area": 0}}, {"group": "random", "args": [[[14, 16, 4], [-4, -2, 4], [9, 9, 6], [10, 14, -1], [11, 17, 5], [-4, -2, 4], [9, 11, 5], [15, 25, 0], [7, 16, 1], [6, 7, 3], [9, 13, 3], [5, 11, 2], [8, 11, 4]]], "expected": {"peak": 15, "overload": [[-4, -2], [6, 17]], "excess_area": 84}}], "selected_for_submission": false}
6
+ {"task_id": "capacity-3", "family": "capacity", "defect_count": 3, "example_seed": 0, "prompt": "solve(bookings): each [start,end,weight] is a half-open integer-time weighted reservation. Ignore zero-length and nonpositive-weight entries. Return peak load, merged maximal overload intervals where load > LIMIT, and integral of max(load-LIMIT,0) over time as excess_area. Touching overload intervals must merge. Input unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"events.py": "def endpoints(bookings):\n delta = {}\n for a,b,w in bookings:\n if a < b and w > 0:\n delta[a] = delta.get(a, 0) + w\n delta[b] = delta.get(b, 0) + w\n return sorted(delta.items())\n", "rules.py": "from settings import LIMIT\ndef overloaded(load):\n return load >= LIMIT\ndef excess(load):\n return max(0, load - LIMIT)\n", "merge.py": "def append_span(spans, a, b):\n if spans and spans[-1][1] > a:\n spans[-1][1] = b\n else:\n spans.append([a,b])\n", "main.py": "from events import endpoints\nfrom rules import overloaded, excess\nfrom merge import append_span\ndef solve(bookings):\n points = endpoints(bookings)\n load, peak, area, spans = 0, 0, 0, []\n for i in range(len(points)-1):\n a,delta = points[i]\n b = points[i+1][0]\n load += delta\n peak = max(peak, load)\n area += excess(load) * (b-a)\n if overloaded(load):\n append_span(spans, a, b)\n return {'peak': peak, 'overload': spans, 'excess_area': area}\n", "settings.py": "FEE = 7\nLIMIT = 6\nWINDOW = 18\nTHRESHOLD = 4\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 1], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"peak": 0, "overload": [], "excess_area": 0}}, {"group": "half_open", "args": [[[0, 4, 6], [4, 7, 6]]], "expected": {"peak": 6, "overload": [], "excess_area": 0}}, {"group": "random", "args": [[[4, 5, 7], [6, 16, 4], [8, 13, 4], [5, 8, 9], [6, 9, 10]]], "expected": {"peak": 23, "overload": [[4, 13]], "excess_area": 58}}], "selected_for_submission": false}
7
+ {"task_id": "workflow-1", "family": "workflow", "defect_count": 1, "example_seed": 0, "prompt": "solve(jobs): jobs have unique id, duration>=0, release>=0, deadline, deps (job IDs). Unlimited parallel workers. Start each job at max(release, predecessor finish times), then add duration. Return status=ok, sorted finish pairs and IDs with finish strictly greater than deadline as late. Missing dependencies or any cycle make the whole graph invalid: status=invalid, finish=[], late=[]. Jobs are arbitrarily ordered; do not mutate them.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"graph.py": "def ready(job, pending, finished):\n return all(d not in pending for d in job['deps'])\n", "timing.py": "def end_time(job, finished):\n return max([job['release']] + [finished[d] for d in job['deps']]) + job['duration']\n", "report.py": "def report(jobs, finished):\n return {'status': 'ok', 'finish': [[n,finished[n]] for n in sorted(finished)], 'late': sorted(j['id'] for j in jobs if finished[j['id']] > j['deadline'])}\n", "main.py": "from graph import ready\nfrom timing import end_time\nfrom report import report\ndef solve(jobs):\n pending = {j['id']:j for j in jobs}\n finished = {}\n while pending:\n progress = False\n for name,job in list(pending.items()):\n if ready(job, pending, finished):\n finished[name] = end_time(job, finished)\n del pending[name]\n progress = True\n if not progress:\n return {'status':'invalid','finish':[],'late':[]}\n return report(jobs, finished)\n", "settings.py": "FEE = 7\nLIMIT = 5\nWINDOW = 14\nTHRESHOLD = 3\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 5], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"status": "ok", "finish": [], "late": []}}, {"group": "missing", "args": [[{"id": "a", "deps": ["absent"], "duration": 2, "release": 0, "deadline": 10}]], "expected": {"status": "invalid", "finish": [], "late": []}}, {"group": "random", "args": [[{"id": "n3", "deps": [], "duration": 6, "release": 8, "deadline": 13}, {"id": "n2", "deps": ["n1"], "duration": 4, "release": 3, "deadline": 20}, {"id": "n5", "deps": ["n0", "n2"], "duration": 4, "release": 4, "deadline": 19}, {"id": "n0", "deps": [], "duration": 2, "release": 0, "deadline": 20}, {"id": "n6", "deps": ["n5"], "duration": 6, "release": 5, "deadline": 2}, {"id": "n1", "deps": [], "duration": 5, "release": 9, "deadline": 17}, {"id": "n4", "deps": ["n2"], "duration": 4, "release": 5, "deadline": 20}]], "expected": {"status": "ok", "finish": [["n0", 2], ["n1", 14], ["n2", 18], ["n3", 14], ["n4", 22], ["n5", 22], ["n6", 28]], "late": ["n3", "n4", "n5", "n6"]}}], "selected_for_submission": true}
8
+ {"task_id": "workflow-2", "family": "workflow", "defect_count": 2, "example_seed": 0, "prompt": "solve(jobs): jobs have unique id, duration>=0, release>=0, deadline, deps (job IDs). Unlimited parallel workers. Start each job at max(release, predecessor finish times), then add duration. Return status=ok, sorted finish pairs and IDs with finish strictly greater than deadline as late. Missing dependencies or any cycle make the whole graph invalid: status=invalid, finish=[], late=[]. Jobs are arbitrarily ordered; do not mutate them.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"graph.py": "def ready(job, pending, finished):\n return all(d in finished for d in job['deps'])\n", "timing.py": "def end_time(job, finished):\n return job['release'] + sum(finished[d] for d in job['deps']) + job['duration']\n", "report.py": "def report(jobs, finished):\n return {'status': 'ok', 'finish': [[n,finished[n]] for n in sorted(finished)], 'late': sorted(j['id'] for j in jobs if finished[j['id']] >= j['deadline'])}\n", "main.py": "from graph import ready\nfrom timing import end_time\nfrom report import report\ndef solve(jobs):\n pending = {j['id']:j for j in jobs}\n finished = {}\n while pending:\n progress = False\n for name,job in list(pending.items()):\n if ready(job, pending, finished):\n finished[name] = end_time(job, finished)\n del pending[name]\n progress = True\n if not progress:\n return {'status':'invalid','finish':[],'late':[]}\n return report(jobs, finished)\n", "settings.py": "FEE = 4\nLIMIT = 3\nWINDOW = 9\nTHRESHOLD = 4\nCALIBRATIONS = {'s0': [1, 0], 's1': [4, 5], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"status": "ok", "finish": [], "late": []}}, {"group": "missing", "args": [[{"id": "a", "deps": ["absent"], "duration": 2, "release": 0, "deadline": 10}]], "expected": {"status": "invalid", "finish": [], "late": []}}, {"group": "random", "args": [[{"id": "n1", "deps": [], "duration": 3, "release": 1, "deadline": 22}, {"id": "n3", "deps": ["n0"], "duration": 6, "release": 6, "deadline": 11}, {"id": "n6", "deps": ["n0", "n4"], "duration": 0, "release": 7, "deadline": 11}, {"id": "n4", "deps": ["n0", "n1"], "duration": 5, "release": 7, "deadline": 23}, {"id": "n2", "deps": ["n0", "n1"], "duration": 3, "release": 1, "deadline": 25}, {"id": "n0", "deps": [], "duration": 3, "release": 7, "deadline": 9}, {"id": "n5", "deps": ["n0", "n1", "n4"], "duration": 2, "release": 0, "deadline": 5}]], "expected": {"status": "ok", "finish": [["n0", 10], ["n1", 4], ["n2", 13], ["n3", 16], ["n4", 15], ["n5", 17], ["n6", 15]], "late": ["n0", "n3", "n5", "n6"]}}], "selected_for_submission": true}
9
+ {"task_id": "workflow-3", "family": "workflow", "defect_count": 3, "example_seed": 0, "prompt": "solve(jobs): jobs have unique id, duration>=0, release>=0, deadline, deps (job IDs). Unlimited parallel workers. Start each job at max(release, predecessor finish times), then add duration. Return status=ok, sorted finish pairs and IDs with finish strictly greater than deadline as late. Missing dependencies or any cycle make the whole graph invalid: status=invalid, finish=[], late=[]. Jobs are arbitrarily ordered; do not mutate them.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"graph.py": "def ready(job, pending, finished):\n return all(d not in pending for d in job['deps'])\n", "timing.py": "def end_time(job, finished):\n return job['release'] + sum(finished[d] for d in job['deps']) + job['duration']\n", "report.py": "def report(jobs, finished):\n return {'status': 'ok', 'finish': [[n,finished[n]] for n in sorted(finished)], 'late': sorted(j['id'] for j in jobs if finished[j['id']] >= j['deadline'])}\n", "main.py": "from graph import ready\nfrom timing import end_time\nfrom report import report\ndef solve(jobs):\n pending = {j['id']:j for j in jobs}\n finished = {}\n while pending:\n progress = False\n for name,job in list(pending.items()):\n if ready(job, pending, finished):\n finished[name] = end_time(job, finished)\n del pending[name]\n progress = True\n if not progress:\n return {'status':'invalid','finish':[],'late':[]}\n return report(jobs, finished)\n", "settings.py": "FEE = 7\nLIMIT = 2\nWINDOW = 13\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 4], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": {"status": "ok", "finish": [], "late": []}}, {"group": "missing", "args": [[{"id": "a", "deps": ["absent"], "duration": 2, "release": 0, "deadline": 10}]], "expected": {"status": "invalid", "finish": [], "late": []}}, {"group": "random", "args": [[{"id": "n3", "deps": ["n1", "n2"], "duration": 6, "release": 4, "deadline": 18}, {"id": "n4", "deps": ["n1"], "duration": 4, "release": 8, "deadline": 18}, {"id": "n0", "deps": [], "duration": 3, "release": 3, "deadline": 11}, {"id": "n5", "deps": ["n0", "n1", "n4"], "duration": 0, "release": 9, "deadline": 16}, {"id": "n1", "deps": [], "duration": 1, "release": 3, "deadline": 17}, {"id": "n2", "deps": [], "duration": 4, "release": 6, "deadline": 20}]], "expected": {"status": "ok", "finish": [["n0", 6], ["n1", 4], ["n2", 10], ["n3", 16], ["n4", 12], ["n5", 12]], "late": []}}], "selected_for_submission": true}
10
+ {"task_id": "incident-1", "family": "incident", "defect_count": 1, "example_seed": 0, "prompt": "solve(events): process events by (time, original index), preserving ties. Global event id deduplication keeps the first in that sorted order. Group failures by (user,ip). At each failure retain times in inclusive [time-WINDOW,time]. Alert [user,ip,time] only on a crossing from fewer than THRESHOLD failures to at least THRESHOLD. A success clears that pair only. Return alerts in processing order, without mutating events.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"order.py": "def ordered(events):\n return sorted(enumerate(events), key=lambda x: (x[1]['time'], x[0]))\n", "window.py": "from settings import WINDOW\ndef trim(times, now):\n return [t for t in times if t > now - WINDOW]\n", "resetter.py": "def reset(history, key):\n history.pop(key, None)\n", "main.py": "from settings import THRESHOLD\nfrom order import ordered\nfrom window import trim\nfrom resetter import reset\ndef solve(events):\n history, seen, alerts = {}, set(), []\n for idx,e in ordered(events):\n if e['id'] in seen:\n continue\n seen.add(e['id'])\n k = (e['user'],e['ip'])\n if e['outcome'] == 'success':\n reset(history,k)\n else:\n prior = trim(history.get(k,[]),e['time'])\n history[k] = prior + [e['time']]\n if len(prior) < THRESHOLD <= len(prior)+1:\n alerts.append([e['user'],e['ip'],e['time']])\n return alerts\n", "settings.py": "FEE = 5\nLIMIT = 4\nWINDOW = 9\nTHRESHOLD = 3\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 1], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": []}, {"group": "boundary", "args": [[{"id": "0", "time": 0, "user": "u", "ip": "ip", "outcome": "failure"}, {"id": "1", "time": 9, "user": "u", "ip": "ip", "outcome": "failure"}, {"id": "2", "time": 9, "user": "u", "ip": "ip", "outcome": "failure"}]], "expected": [["u", "ip", 9]]}, {"group": "random", "args": [[{"id": "25", "time": 4, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "9", "time": 14, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "44", "time": 25, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "16", "time": 27, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "35", "time": 0, "user": "a", "ip": "ip2", "outcome": "success"}, {"id": "34", "time": 7, "user": "a", "ip": "ip2", "outcome": "success"}, {"id": "6", "time": 22, "user": "b", "ip": "ip2", "outcome": "success"}, {"id": "43", "time": 24, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "0", "time": 25, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "29", "time": 20, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "32", "time": 18, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "0", "time": 25, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "20", "time": 15, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "42", "time": 27, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "37", "time": 17, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "28", "time": 17, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "5", "time": 2, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "13", "time": 24, "user": "b", "ip": "ip1", "outcome": "success"}, {"id": "41", "time": 24, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "1", "time": 12, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "19", "time": 2, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "3", "time": 12, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "22", "time": 10, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "3", "time": 12, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "30", "time": 8, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "36", "time": 20, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "15", "time": 14, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "27", "time": 17, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "2", "time": 9, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "31", "time": 0, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "4", "time": 0, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "17", "time": 13, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "40", "time": 9, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "39", "time": 7, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "11", "time": 25, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "24", "time": 22, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "7", "time": 17, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "38", "time": 11, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "21", "time": 2, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "8", "time": 19, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "26", "time": 23, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "12", "time": 26, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "1", "time": 12, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "23", "time": 8, "user": "b", "ip": "ip2", "outcome": "success"}, {"id": "10", "time": 0, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "14", "time": 27, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "18", "time": 13, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "4", "time": 0, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "2", "time": 9, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "33", "time": 18, "user": "a", "ip": "ip1", "outcome": "failure"}]], "expected": [["b", "ip2", 2], ["a", "ip2", 11], ["b", "ip1", 13], ["a", "ip1", 17], ["b", "ip1", 18], ["b", "ip2", 25], ["a", "ip1", 27]]}], "selected_for_submission": true}
11
+ {"task_id": "incident-2", "family": "incident", "defect_count": 2, "example_seed": 0, "prompt": "solve(events): process events by (time, original index), preserving ties. Global event id deduplication keeps the first in that sorted order. Group failures by (user,ip). At each failure retain times in inclusive [time-WINDOW,time]. Alert [user,ip,time] only on a crossing from fewer than THRESHOLD failures to at least THRESHOLD. A success clears that pair only. Return alerts in processing order, without mutating events.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"order.py": "def ordered(events):\n return sorted(enumerate(events), key=lambda x: (x[1]['time'], -x[0]))\n", "window.py": "from settings import WINDOW\ndef trim(times, now):\n return [t for t in times if t >= now - WINDOW]\n", "resetter.py": "def reset(history, key):\n history.clear()\n", "main.py": "from settings import THRESHOLD\nfrom order import ordered\nfrom window import trim\nfrom resetter import reset\ndef solve(events):\n history, seen, alerts = {}, set(), []\n for idx,e in ordered(events):\n if e['id'] in seen:\n continue\n seen.add(e['id'])\n k = (e['user'],e['ip'])\n if e['outcome'] == 'success':\n reset(history,k)\n else:\n prior = trim(history.get(k,[]),e['time'])\n history[k] = prior + [e['time']]\n if len(prior) < THRESHOLD <= len(prior)+1:\n alerts.append([e['user'],e['ip'],e['time']])\n return alerts\n", "settings.py": "FEE = 5\nLIMIT = 2\nWINDOW = 10\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 3], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": []}, {"group": "boundary", "args": [[{"id": "0", "time": 0, "user": "u", "ip": "ip", "outcome": "failure"}, {"id": "1", "time": 10, "user": "u", "ip": "ip", "outcome": "failure"}]], "expected": [["u", "ip", 10]]}, {"group": "random", "args": [[{"id": "17", "time": 29, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "31", "time": 11, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "11", "time": 21, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "1", "time": 3, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "24", "time": 7, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "0", "time": 21, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "2", "time": 14, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "43", "time": 18, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "40", "time": 1, "user": "b", "ip": "ip2", "outcome": "success"}, {"id": "32", "time": 26, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "20", "time": 27, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "10", "time": 27, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "4", "time": 0, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "16", "time": 22, "user": "a", "ip": "ip2", "outcome": "success"}, {"id": "25", "time": 13, "user": "b", "ip": "ip1", "outcome": "success"}, {"id": "15", "time": 24, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "19", "time": 18, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "4", "time": 0, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "3", "time": 22, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "38", "time": 30, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "7", "time": 25, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "37", "time": 1, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "33", "time": 15, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "23", "time": 12, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "13", "time": 16, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "29", "time": 19, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "8", "time": 11, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "6", "time": 9, "user": "b", "ip": "ip2", "outcome": "success"}, {"id": "12", "time": 22, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "2", "time": 14, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "39", "time": 22, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "3", "time": 22, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "35", "time": 4, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "42", "time": 0, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "18", "time": 7, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "5", "time": 10, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "1", "time": 3, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "36", "time": 17, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "34", "time": 18, "user": "b", "ip": "ip1", "outcome": "success"}, {"id": "27", "time": 14, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "14", "time": 26, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "41", "time": 29, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "26", "time": 23, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "30", "time": 12, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "28", "time": 21, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "9", "time": 26, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "0", "time": 21, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "44", "time": 18, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "22", "time": 21, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "21", "time": 23, "user": "a", "ip": "ip2", "outcome": "failure"}]], "expected": [["b", "ip1", 0], ["b", "ip2", 4], ["a", "ip1", 7], ["b", "ip1", 12], ["b", "ip2", 12], ["a", "ip2", 17], ["b", "ip1", 18], ["a", "ip1", 21], ["a", "ip2", 22], ["b", "ip1", 29]]}], "selected_for_submission": true}
12
+ {"task_id": "incident-3", "family": "incident", "defect_count": 3, "example_seed": 0, "prompt": "solve(events): process events by (time, original index), preserving ties. Global event id deduplication keeps the first in that sorted order. Group failures by (user,ip). At each failure retain times in inclusive [time-WINDOW,time]. Alert [user,ip,time] only on a crossing from fewer than THRESHOLD failures to at least THRESHOLD. A success clears that pair only. Return alerts in processing order, without mutating events.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"order.py": "def ordered(events):\n return sorted(enumerate(events), key=lambda x: (x[1]['time'], -x[0]))\n", "window.py": "from settings import WINDOW\ndef trim(times, now):\n return [t for t in times if t > now - WINDOW]\n", "resetter.py": "def reset(history, key):\n history.clear()\n", "main.py": "from settings import THRESHOLD\nfrom order import ordered\nfrom window import trim\nfrom resetter import reset\ndef solve(events):\n history, seen, alerts = {}, set(), []\n for idx,e in ordered(events):\n if e['id'] in seen:\n continue\n seen.add(e['id'])\n k = (e['user'],e['ip'])\n if e['outcome'] == 'success':\n reset(history,k)\n else:\n prior = trim(history.get(k,[]),e['time'])\n history[k] = prior + [e['time']]\n if len(prior) < THRESHOLD <= len(prior)+1:\n alerts.append([e['user'],e['ip'],e['time']])\n return alerts\n", "settings.py": "FEE = 7\nLIMIT = 8\nWINDOW = 20\nTHRESHOLD = 3\nCALIBRATIONS = {'s0': [1, 0], 's1': [3, 4], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": []}, {"group": "boundary", "args": [[{"id": "0", "time": 0, "user": "u", "ip": "ip", "outcome": "failure"}, {"id": "1", "time": 20, "user": "u", "ip": "ip", "outcome": "failure"}, {"id": "2", "time": 20, "user": "u", "ip": "ip", "outcome": "failure"}]], "expected": [["u", "ip", 20]]}, {"group": "random", "args": [[{"id": "18", "time": 38, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "23", "time": 13, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "38", "time": 41, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "8", "time": 60, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "34", "time": 6, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "1", "time": 23, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "21", "time": 1, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "5", "time": 54, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "0", "time": 7, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "3", "time": 32, "user": "b", "ip": "ip1", "outcome": "success"}, {"id": "43", "time": 42, "user": "b", "ip": "ip2", "outcome": "success"}, {"id": "10", "time": 7, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "2", "time": 58, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "16", "time": 50, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "28", "time": 34, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "42", "time": 23, "user": "b", "ip": "ip2", "outcome": "success"}, {"id": "11", "time": 19, "user": "a", "ip": "ip1", "outcome": "success"}, {"id": "40", "time": 49, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "20", "time": 4, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "1", "time": 23, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "4", "time": 49, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "17", "time": 53, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "22", "time": 27, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "31", "time": 31, "user": "a", "ip": "ip1", "outcome": "success"}, {"id": "36", "time": 47, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "0", "time": 7, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "13", "time": 13, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "39", "time": 12, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "2", "time": 58, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "7", "time": 46, "user": "a", "ip": "ip1", "outcome": "success"}, {"id": "19", "time": 16, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "37", "time": 58, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "6", "time": 30, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "12", "time": 30, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "44", "time": 9, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "27", "time": 45, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "3", "time": 32, "user": "b", "ip": "ip1", "outcome": "success"}, {"id": "26", "time": 8, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "32", "time": 29, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "33", "time": 0, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "29", "time": 31, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "30", "time": 15, "user": "b", "ip": "ip1", "outcome": "success"}, {"id": "14", "time": 57, "user": "a", "ip": "ip2", "outcome": "failure"}, {"id": "35", "time": 36, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "4", "time": 49, "user": "a", "ip": "ip1", "outcome": "failure"}, {"id": "9", "time": 2, "user": "b", "ip": "ip2", "outcome": "failure"}, {"id": "24", "time": 23, "user": "b", "ip": "ip1", "outcome": "failure"}, {"id": "15", "time": 34, "user": "b", "ip": "ip2", "outcome": "success"}, {"id": "25", "time": 21, "user": "a", "ip": "ip2", "outcome": "success"}, {"id": "41", "time": 32, "user": "a", "ip": "ip2", "outcome": "failure"}]], "expected": [["b", "ip1", 4], ["b", "ip2", 13], ["b", "ip2", 23], ["a", "ip2", 45], ["a", "ip1", 50], ["a", "ip2", 57]]}], "selected_for_submission": true}
13
+ {"task_id": "sensor-1", "family": "sensor", "defect_count": 1, "example_seed": 0, "prompt": "solve(readings): readings have sensor, time, value (integer), valid (bool). Ignore invalid readings; for duplicate (sensor,time), keep the last valid occurrence in input order. Convert each retained value with CALIBRATIONS[sensor]=[gain,offset] as gain*value+offset BEFORE aggregation. Return sorted [time,median,alarm] rows; even-count median averages the middle two; alarm is median strictly > THRESHOLD. Inputs unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"dedup.py": "def latest(readings):\n kept = {}\n for r in readings:\n if r['valid']:\n kept.setdefault((r['sensor'],r['time']), r)\n return list(kept.values())\n", "convert.py": "from settings import CALIBRATIONS\ndef convert(r):\n gain,offset = CALIBRATIONS[r['sensor']]\n return gain*r['value']+offset\n", "stats.py": "def median(values):\n v = sorted(values)\n n = len(v)\n return v[n//2] if n%2 else (v[n//2-1]+v[n//2])/2\n", "main.py": "from settings import THRESHOLD\nfrom dedup import latest\nfrom convert import convert\nfrom stats import median\ndef solve(readings):\n groups = {}\n for r in latest(readings):\n groups.setdefault(r['time'],[]).append(convert(r))\n return [[t, median(v), median(v)>THRESHOLD] for t,v in sorted(groups.items())]\n", "settings.py": "FEE = 5\nLIMIT = 6\nWINDOW = 8\nTHRESHOLD = 3\nCALIBRATIONS = {'s0': [1, 0], 's1': [4, 5], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": []}, {"group": "dedup", "args": [[{"sensor": "s0", "time": 1, "value": 0, "valid": true}, {"sensor": "s0", "time": 1, "value": 9, "valid": true}, {"sensor": "s0", "time": 1, "value": 100, "valid": false}]], "expected": [[1, 9.0, true]]}, {"group": "random", "args": [[{"sensor": "s2", "time": 5, "value": 9, "valid": true}, {"sensor": "s2", "time": 4, "value": -3, "valid": true}, {"sensor": "s2", "time": 5, "value": -4, "valid": false}, {"sensor": "s2", "time": 5, "value": 2, "valid": false}, {"sensor": "s1", "time": 3, "value": 6, "valid": true}, {"sensor": "s1", "time": 1, "value": 9, "valid": true}, {"sensor": "s0", "time": 0, "value": -7, "valid": true}, {"sensor": "s0", "time": 6, "value": 7, "valid": true}, {"sensor": "s2", "time": 6, "value": -3, "valid": true}, {"sensor": "s0", "time": 4, "value": -9, "valid": false}, {"sensor": "s2", "time": 4, "value": -3, "valid": true}, {"sensor": "s2", "time": 2, "value": -7, "valid": false}, {"sensor": "s2", "time": 4, "value": -10, "valid": true}, {"sensor": "s0", "time": 2, "value": 2, "valid": false}, {"sensor": "s0", "time": 1, "value": 12, "valid": true}, {"sensor": "s1", "time": 6, "value": 6, "valid": false}, {"sensor": "s1", "time": 6, "value": 16, "valid": true}, {"sensor": "s2", "time": 5, "value": 16, "valid": true}, {"sensor": "s2", "time": 1, "value": 17, "valid": true}, {"sensor": "s1", "time": 3, "value": 10, "valid": true}, {"sensor": "s2", "time": 5, "value": -5, "valid": true}, {"sensor": "s2", "time": 0, "value": -7, "valid": true}, {"sensor": "s1", "time": 0, "value": 12, "valid": false}, {"sensor": "s1", "time": 6, "value": 6, "valid": true}, {"sensor": "s2", "time": 2, "value": 15, "valid": true}]], "expected": [[0, 1.5, false], [1, 12.0, true], [2, -12.0, false], [3, 45.0, true], [4, 13.0, true], [5, 8.0, true], [6, 7.0, true]]}], "selected_for_submission": false}
14
+ {"task_id": "sensor-2", "family": "sensor", "defect_count": 2, "example_seed": 0, "prompt": "solve(readings): readings have sensor, time, value (integer), valid (bool). Ignore invalid readings; for duplicate (sensor,time), keep the last valid occurrence in input order. Convert each retained value with CALIBRATIONS[sensor]=[gain,offset] as gain*value+offset BEFORE aggregation. Return sorted [time,median,alarm] rows; even-count median averages the middle two; alarm is median strictly > THRESHOLD. Inputs unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"dedup.py": "def latest(readings):\n kept = {}\n for r in readings:\n if r['valid']:\n kept.setdefault((r['sensor'],r['time']), r)\n return list(kept.values())\n", "convert.py": "from settings import CALIBRATIONS\ndef convert(r):\n gain,offset = CALIBRATIONS[r['sensor']]\n return gain*(r['value']+offset)\n", "stats.py": "def median(values):\n v = sorted(values)\n n = len(v)\n return v[n//2] if n%2 else (v[n//2-1]+v[n//2])/2\n", "main.py": "from settings import THRESHOLD\nfrom dedup import latest\nfrom convert import convert\nfrom stats import median\ndef solve(readings):\n groups = {}\n for r in latest(readings):\n groups.setdefault(r['time'],[]).append(convert(r))\n return [[t, median(v), median(v)>THRESHOLD] for t,v in sorted(groups.items())]\n", "settings.py": "FEE = 7\nLIMIT = 5\nWINDOW = 10\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [3, 4], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": []}, {"group": "dedup", "args": [[{"sensor": "s0", "time": 1, "value": 0, "valid": true}, {"sensor": "s0", "time": 1, "value": 9, "valid": true}, {"sensor": "s0", "time": 1, "value": 100, "valid": false}]], "expected": [[1, 9.0, true]]}, {"group": "random", "args": [[{"sensor": "s0", "time": 5, "value": 3, "valid": true}, {"sensor": "s0", "time": 5, "value": 20, "valid": true}, {"sensor": "s0", "time": 5, "value": 7, "valid": true}, {"sensor": "s0", "time": 5, "value": 17, "valid": false}, {"sensor": "s2", "time": 5, "value": 1, "valid": true}, {"sensor": "s0", "time": 0, "value": 3, "valid": true}, {"sensor": "s2", "time": 1, "value": 20, "valid": true}, {"sensor": "s2", "time": 1, "value": 12, "valid": true}, {"sensor": "s0", "time": 3, "value": 14, "valid": false}, {"sensor": "s1", "time": 3, "value": 19, "valid": false}, {"sensor": "s1", "time": 5, "value": 7, "valid": true}, {"sensor": "s1", "time": 2, "value": 1, "valid": true}, {"sensor": "s0", "time": 2, "value": 17, "valid": true}, {"sensor": "s2", "time": 5, "value": 5, "valid": true}, {"sensor": "s1", "time": 2, "value": -10, "valid": true}, {"sensor": "s2", "time": 5, "value": 9, "valid": false}, {"sensor": "s1", "time": 3, "value": -10, "valid": true}, {"sensor": "s2", "time": 6, "value": 16, "valid": false}, {"sensor": "s0", "time": 2, "value": 11, "valid": true}, {"sensor": "s2", "time": 2, "value": 16, "valid": true}, {"sensor": "s1", "time": 0, "value": -1, "valid": true}, {"sensor": "s1", "time": 6, "value": 14, "valid": false}, {"sensor": "s0", "time": 5, "value": -7, "valid": true}, {"sensor": "s0", "time": 1, "value": 18, "valid": true}, {"sensor": "s0", "time": 0, "value": 12, "valid": true}]], "expected": [[0, 6.5, true], [1, 4.5, true], [2, -13.0, false], [3, -26.0, false], [5, -2.0, false]]}], "selected_for_submission": false}
15
+ {"task_id": "sensor-3", "family": "sensor", "defect_count": 3, "example_seed": 0, "prompt": "solve(readings): readings have sensor, time, value (integer), valid (bool). Ignore invalid readings; for duplicate (sensor,time), keep the last valid occurrence in input order. Convert each retained value with CALIBRATIONS[sensor]=[gain,offset] as gain*value+offset BEFORE aggregation. Return sorted [time,median,alarm] rows; even-count median averages the middle two; alarm is median strictly > THRESHOLD. Inputs unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"dedup.py": "def latest(readings):\n kept = {}\n for r in readings:\n if r['valid']:\n kept.setdefault((r['sensor'],r['time']), r)\n return list(kept.values())\n", "convert.py": "from settings import CALIBRATIONS\ndef convert(r):\n gain,offset = CALIBRATIONS[r['sensor']]\n return gain*(r['value']+offset)\n", "stats.py": "def median(values):\n v = sorted(values)\n n = len(v)\n return v[n//2] if n%2 else v[n//2]\n", "main.py": "from settings import THRESHOLD\nfrom dedup import latest\nfrom convert import convert\nfrom stats import median\ndef solve(readings):\n groups = {}\n for r in latest(readings):\n groups.setdefault(r['time'],[]).append(convert(r))\n return [[t, median(v), median(v)>THRESHOLD] for t,v in sorted(groups.items())]\n", "settings.py": "FEE = 2\nLIMIT = 5\nWINDOW = 12\nTHRESHOLD = 4\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 2], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[]], "expected": []}, {"group": "dedup", "args": [[{"sensor": "s0", "time": 1, "value": 0, "valid": true}, {"sensor": "s0", "time": 1, "value": 9, "valid": true}, {"sensor": "s0", "time": 1, "value": 100, "valid": false}]], "expected": [[1, 9.0, true]]}, {"group": "random", "args": [[{"sensor": "s0", "time": 0, "value": 12, "valid": true}, {"sensor": "s0", "time": 4, "value": 19, "valid": true}, {"sensor": "s1", "time": 6, "value": 7, "valid": true}, {"sensor": "s1", "time": 0, "value": 10, "valid": true}, {"sensor": "s0", "time": 3, "value": -6, "valid": true}, {"sensor": "s0", "time": 6, "value": 12, "valid": true}, {"sensor": "s2", "time": 2, "value": -4, "valid": true}, {"sensor": "s1", "time": 4, "value": 12, "valid": true}, {"sensor": "s0", "time": 3, "value": -1, "valid": true}, {"sensor": "s2", "time": 4, "value": -6, "valid": true}, {"sensor": "s2", "time": 2, "value": 8, "valid": true}, {"sensor": "s2", "time": 0, "value": 15, "valid": true}, {"sensor": "s2", "time": 5, "value": 7, "valid": true}, {"sensor": "s2", "time": 5, "value": 1, "valid": true}, {"sensor": "s0", "time": 0, "value": -2, "valid": true}, {"sensor": "s1", "time": 1, "value": -4, "valid": true}, {"sensor": "s2", "time": 5, "value": 19, "valid": false}, {"sensor": "s1", "time": 1, "value": 5, "valid": true}, {"sensor": "s2", "time": 5, "value": 3, "valid": false}, {"sensor": "s2", "time": 4, "value": 10, "valid": true}, {"sensor": "s0", "time": 0, "value": 12, "valid": true}, {"sensor": "s2", "time": 5, "value": 20, "valid": false}, {"sensor": "s2", "time": 6, "value": 7, "valid": true}, {"sensor": "s0", "time": 5, "value": 7, "valid": true}, {"sensor": "s1", "time": 4, "value": 10, "valid": true}]], "expected": [[0, 12.0, true], [1, 12.0, true], [2, -5.0, false], [3, -1.0, false], [4, 19.0, true], [5, 4.5, true], [6, 12.0, true]]}], "selected_for_submission": false}
16
+ {"task_id": "reconcile-1", "family": "reconcile", "defect_count": 1, "example_seed": 0, "prompt": "solve(left,right): two CSV strings with header key,amount,kind. CSV quoting follows Python csv rules. Normalize keys using strip().casefold(). Amount is a finite decimal string, kind is debit or credit; credits negate the amount. Sum duplicates separately in each file using exact arithmetic. Return sorted [key,delta] for nonzero left-minus-right differences. delta MUST be canonical Fraction string (integer if denominator=1, otherwise numerator/denominator), not decimal or float.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"parse.py": "import csv\nimport io\ndef rows(text):\n return [dict(zip(['key','amount','kind'],line.split(','))) for line in text.splitlines()[1:]]\n", "keys.py": "def key(row):\n return row['key'].strip().casefold()\n", "amounts.py": "from fractions import Fraction\ndef amount(row):\n value = Fraction(row['amount'])\n return -value if row['kind']=='credit' else value\n", "main.py": "from fractions import Fraction\nfrom parse import rows\nfrom keys import key\nfrom amounts import amount\ndef totals(text):\n out = {}\n for row in rows(text):\n k = key(row)\n out[k] = out.get(k,Fraction(0)) + amount(row)\n return out\ndef solve(left,right):\n a,b = totals(left),totals(right)\n return [[k,str(a.get(k,Fraction(0))-b.get(k,Fraction(0)))] for k in sorted(set(a)|set(b)) if a.get(k,Fraction(0))!=b.get(k,Fraction(0))]\n", "settings.py": "FEE = 7\nLIMIT = 3\nWINDOW = 11\nTHRESHOLD = 3\nCALIBRATIONS = {'s0': [1, 0], 's1': [3, 1], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": ["key,amount,kind\r\n", "key,amount,kind\r\n"], "expected": []}, {"group": "quoting", "args": ["key,amount,kind\r\n\"a,b\",1.25,debit\r\n\"a\nline\",2,debit\r\n", "key,amount,kind\r\n"], "expected": [["a\nline", "2"], ["a,b", "5/4"]]}, {"group": "random", "args": ["key,amount,kind\r\nSTRASSE,6.83,debit\r\n\"a\nline\",5.81,debit\r\nALPHA,-4.68,debit\r\n\"a\nline\",0.06,credit\r\n\"a\nline\",-2.95,credit\r\n\"a,b\",-5.21,debit\r\n", "key,amount,kind\r\nStra\u00dfe,-9.89,credit\r\n Alpha ,-0.45,credit\r\n\"a\nline\",-6.68,credit\r\n\"a\nline\",-7.02,debit\r\n Alpha ,0.81,credit\r\n\"\"\"quote\"\"\",8.16,credit\r\n Alpha ,9.65,credit\r\nALPHA,5.93,debit\r\nALPHA,-4.00,credit\r\nStra\u00dfe,-7.02,credit\r\n"], "expected": [["\"quote\"", "204/25"], ["a\nline", "226/25"], ["a,b", "-521/100"], ["alpha", "-23/5"], ["strasse", "-252/25"]]}], "selected_for_submission": false}
17
+ {"task_id": "reconcile-2", "family": "reconcile", "defect_count": 2, "example_seed": 0, "prompt": "solve(left,right): two CSV strings with header key,amount,kind. CSV quoting follows Python csv rules. Normalize keys using strip().casefold(). Amount is a finite decimal string, kind is debit or credit; credits negate the amount. Sum duplicates separately in each file using exact arithmetic. Return sorted [key,delta] for nonzero left-minus-right differences. delta MUST be canonical Fraction string (integer if denominator=1, otherwise numerator/denominator), not decimal or float.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"parse.py": "import csv\nimport io\ndef rows(text):\n return [dict(zip(['key','amount','kind'],line.split(','))) for line in text.splitlines()[1:]]\n", "keys.py": "def key(row):\n return row['key'].strip().lower()\n", "amounts.py": "from fractions import Fraction\ndef amount(row):\n value = Fraction(row['amount'])\n return -value if row['kind']=='credit' else value\n", "main.py": "from fractions import Fraction\nfrom parse import rows\nfrom keys import key\nfrom amounts import amount\ndef totals(text):\n out = {}\n for row in rows(text):\n k = key(row)\n out[k] = out.get(k,Fraction(0)) + amount(row)\n return out\ndef solve(left,right):\n a,b = totals(left),totals(right)\n return [[k,str(a.get(k,Fraction(0))-b.get(k,Fraction(0)))] for k in sorted(set(a)|set(b)) if a.get(k,Fraction(0))!=b.get(k,Fraction(0))]\n", "settings.py": "FEE = 2\nLIMIT = 4\nWINDOW = 5\nTHRESHOLD = 4\nCALIBRATIONS = {'s0': [1, 0], 's1': [4, 5], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": ["key,amount,kind\r\n", "key,amount,kind\r\n"], "expected": []}, {"group": "quoting", "args": ["key,amount,kind\r\n\"a,b\",1.25,debit\r\n\"a\nline\",2,debit\r\n", "key,amount,kind\r\n"], "expected": [["a\nline", "2"], ["a,b", "5/4"]]}, {"group": "random", "args": ["key,amount,kind\r\n Alpha ,-7.11,debit\r\n\"\"\"quote\"\"\",6.93,credit\r\n\"a\nline\",-3.19,debit\r\n Alpha ,5.85,debit\r\nbeta,9.07,debit\r\nbeta,1.31,credit\r\n\"a\nline\",-5.20,credit\r\n", "key,amount,kind\r\n\"a\nline\",6.88,debit\r\n\"a\nline\",2.65,credit\r\n\"a\nline\",-0.52,debit\r\nALPHA,4.24,debit\r\nbeta,-2.87,debit\r\n\"a,b\",2.78,debit\r\nStra\u00dfe,5.56,credit\r\nStra\u00dfe,-5.02,debit\r\nbeta,-0.71,debit\r\nStra\u00dfe,1.96,credit\r\nStra\u00dfe,8.53,credit\r\nSTRASSE,-0.72,debit\r\nSTRASSE,9.35,credit\r\n"], "expected": [["\"quote\"", "-693/100"], ["a\nline", "-17/10"], ["a,b", "-139/50"], ["alpha", "-11/2"], ["beta", "567/50"], ["strasse", "1557/50"]]}], "selected_for_submission": false}
18
+ {"task_id": "reconcile-3", "family": "reconcile", "defect_count": 3, "example_seed": 0, "prompt": "solve(left,right): two CSV strings with header key,amount,kind. CSV quoting follows Python csv rules. Normalize keys using strip().casefold(). Amount is a finite decimal string, kind is debit or credit; credits negate the amount. Sum duplicates separately in each file using exact arithmetic. Return sorted [key,delta] for nonzero left-minus-right differences. delta MUST be canonical Fraction string (integer if denominator=1, otherwise numerator/denominator), not decimal or float.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"parse.py": "import csv\nimport io\ndef rows(text):\n return [dict(zip(['key','amount','kind'],line.split(','))) for line in text.splitlines()[1:]]\n", "keys.py": "def key(row):\n return row['key'].strip().lower()\n", "amounts.py": "from fractions import Fraction\ndef amount(row):\n value = Fraction(row['amount'])\n return value\n", "main.py": "from fractions import Fraction\nfrom parse import rows\nfrom keys import key\nfrom amounts import amount\ndef totals(text):\n out = {}\n for row in rows(text):\n k = key(row)\n out[k] = out.get(k,Fraction(0)) + amount(row)\n return out\ndef solve(left,right):\n a,b = totals(left),totals(right)\n return [[k,str(a.get(k,Fraction(0))-b.get(k,Fraction(0)))] for k in sorted(set(a)|set(b)) if a.get(k,Fraction(0))!=b.get(k,Fraction(0))]\n", "settings.py": "FEE = 7\nLIMIT = 3\nWINDOW = 12\nTHRESHOLD = 4\nCALIBRATIONS = {'s0': [1, 0], 's1': [4, 4], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": ["key,amount,kind\r\n", "key,amount,kind\r\n"], "expected": []}, {"group": "quoting", "args": ["key,amount,kind\r\n\"a,b\",1.25,debit\r\n\"a\nline\",2,debit\r\n", "key,amount,kind\r\n"], "expected": [["a\nline", "2"], ["a,b", "5/4"]]}, {"group": "random", "args": ["key,amount,kind\r\n\"a,b\",-4.76,debit\r\n\"\"\"quote\"\"\",2.42,debit\r\n\"\"\"quote\"\"\",-3.65,debit\r\nStra\u00dfe,-6.47,credit\r\n\"a,b\",-2.10,credit\r\n", "key,amount,kind\r\nbeta,2.74,debit\r\nStra\u00dfe,-2.07,credit\r\n\"\"\"quote\"\"\",3.24,debit\r\nbeta,6.67,debit\r\nbeta,-9.72,credit\r\n\"\"\"quote\"\"\",-0.18,debit\r\nStra\u00dfe,1.23,credit\r\nSTRASSE,-3.20,credit\r\n Alpha ,-1.67,debit\r\n Alpha ,-9.72,debit\r\nbeta,0.16,credit\r\n\"a,b\",1.03,debit\r\nStra\u00dfe,6.35,credit\r\n\"\"\"quote\"\"\",-2.23,credit\r\nALPHA,-2.26,credit\r\n"], "expected": [["\"quote\"", "-163/25"], ["a,b", "-369/100"], ["alpha", "913/100"], ["beta", "-1897/100"], ["strasse", "439/50"]]}], "selected_for_submission": false}
19
+ {"task_id": "allocation-1", "family": "allocation", "defect_count": 1, "example_seed": 0, "prompt": "solve(workers,jobs,quotes): workers=[[name,capacity],...], jobs=[[name,demand],...], quotes=[[worker,job,cost_per_unit],...] (unique pairs, nonnegative integer costs). Unquoted assignments are forbidden. Allocate integer units, never exceed a worker capacity or job demand. First maximize total filled demand, then minimize cost among all such allocations. Return exactly {filled:int,cost:int}. A greedy edge ordering is insufficient; reassignment may be necessary. Names in each list are unique. Empty and disconnected instances are valid; do not mutate inputs.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"network.py": "def edge(graph,a,b,cap,cost):\n graph[a].append([b,len(graph[b]),cap,cost])\n graph[b].append([a,len(graph[a])-1,0,-cost])\n", "paths.py": "def shortest(graph,source):\n n=len(graph)\n distance=[None]*n\n parent=[None]*n\n distance[source]=0\n for turn in range(n-1):\n changed=False\n for a in range(n):\n if distance[a] is not None:\n for idx,e in enumerate(graph[a]):\n b,rev,cap,cost=e\n if cap>0 and (distance[b] is None or distance[a]+cost<distance[b]):\n distance[b]=distance[a]+cost\n parent[b]=(a,idx)\n changed=True\n if not changed:\n break\n return distance,parent\n", "augment.py": "def send(graph,parent,source,sink):\n path=[]\n v=sink\n while v!=source:\n a,idx=parent[v]\n path.append((a,idx))\n v=a\n amount=max(graph[a][idx][2] for a,idx in path)\n for a,idx in path:\n b,rev,cap,cost=graph[a][idx]\n graph[a][idx][2]-=amount\n graph[b][rev][2]+=amount\n return amount\n", "main.py": "from network import edge\nfrom paths import shortest\nfrom augment import send\ndef solve(workers,jobs,quotes):\n wmap={name:i+1 for i,(name,c) in enumerate(workers)}\n jmap={name:len(workers)+i+1 for i,(name,d) in enumerate(jobs)}\n source,sink=0,len(workers)+len(jobs)+1\n graph=[[] for i in range(sink+1)]\n for name,c in workers:\n edge(graph,source,wmap[name],c,0)\n for name,d in jobs:\n edge(graph,jmap[name],sink,d,0)\n for w,j,c in quotes:\n edge(graph,wmap[w],jmap[j],sum(d for name,d in jobs),c)\n filled,total=0,0\n while True:\n distance,parent=shortest(graph,source)\n if distance[sink] is None:\n break\n amount=send(graph,parent,source,sink)\n filled+=amount\n total+=amount*distance[sink]\n return {'filled':filled,'cost':total}\n", "settings.py": "FEE = 3\nLIMIT = 3\nWINDOW = 13\nTHRESHOLD = 4\nCALIBRATIONS = {'s0': [1, 0], 's1': [3, 1], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[], [], []], "expected": {"filled": 0, "cost": 0}}, {"group": "reroute", "args": [[["a", 1], ["b", 1]], [["x", 1], ["y", 1]], [["a", "x", 1], ["a", "y", 2], ["b", "x", 2], ["b", "y", 100]]], "expected": {"filled": 2, "cost": 4}}, {"group": "random", "args": [[["w0", 2], ["w1", 3]], [["j0", 1], ["j1", 2], ["j2", 2]], [["w0", "j2", 16], ["w0", "j1", 3], ["w0", "j0", 17], ["w1", "j0", 17], ["w1", "j2", 7]]], "expected": {"filled": 5, "cost": 37}}], "selected_for_submission": true}
20
+ {"task_id": "allocation-2", "family": "allocation", "defect_count": 2, "example_seed": 0, "prompt": "solve(workers,jobs,quotes): workers=[[name,capacity],...], jobs=[[name,demand],...], quotes=[[worker,job,cost_per_unit],...] (unique pairs, nonnegative integer costs). Unquoted assignments are forbidden. Allocate integer units, never exceed a worker capacity or job demand. First maximize total filled demand, then minimize cost among all such allocations. Return exactly {filled:int,cost:int}. A greedy edge ordering is insufficient; reassignment may be necessary. Names in each list are unique. Empty and disconnected instances are valid; do not mutate inputs.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"network.py": "def edge(graph,a,b,cap,cost):\n graph[a].append([b,len(graph[b]),cap,cost])\n graph[b].append([a,len(graph[a])-1,0,-cost])\n", "paths.py": "def shortest(graph,source):\n n=len(graph)\n distance=[None]*n\n parent=[None]*n\n distance[source]=0\n for turn in range(1):\n changed=False\n for a in range(n):\n if distance[a] is not None:\n for idx,e in enumerate(graph[a]):\n b,rev,cap,cost=e\n if cap>0 and (distance[b] is None or distance[a]+cost<distance[b]):\n distance[b]=distance[a]+cost\n parent[b]=(a,idx)\n changed=True\n if not changed:\n break\n return distance,parent\n", "augment.py": "def send(graph,parent,source,sink):\n path=[]\n v=sink\n while v!=source:\n a,idx=parent[v]\n path.append((a,idx))\n v=a\n amount=max(graph[a][idx][2] for a,idx in path)\n for a,idx in path:\n b,rev,cap,cost=graph[a][idx]\n graph[a][idx][2]-=amount\n graph[b][rev][2]+=amount\n return amount\n", "main.py": "from network import edge\nfrom paths import shortest\nfrom augment import send\ndef solve(workers,jobs,quotes):\n wmap={name:i+1 for i,(name,c) in enumerate(workers)}\n jmap={name:len(workers)+i+1 for i,(name,d) in enumerate(jobs)}\n source,sink=0,len(workers)+len(jobs)+1\n graph=[[] for i in range(sink+1)]\n for name,c in workers:\n edge(graph,source,wmap[name],c,0)\n for name,d in jobs:\n edge(graph,jmap[name],sink,d,0)\n for w,j,c in quotes:\n edge(graph,wmap[w],jmap[j],sum(d for name,d in jobs),c)\n filled,total=0,0\n while True:\n distance,parent=shortest(graph,source)\n if distance[sink] is None:\n break\n amount=send(graph,parent,source,sink)\n filled+=amount\n total+=amount*distance[sink]\n return {'filled':filled,'cost':total}\n", "settings.py": "FEE = 7\nLIMIT = 4\nWINDOW = 9\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [4, 3], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[], [], []], "expected": {"filled": 0, "cost": 0}}, {"group": "reroute", "args": [[["a", 1], ["b", 1]], [["x", 1], ["y", 1]], [["a", "x", 1], ["a", "y", 2], ["b", "x", 2], ["b", "y", 100]]], "expected": {"filled": 2, "cost": 4}}, {"group": "random", "args": [[["w0", 3], ["w2", 2], ["w1", 2]], [["j1", 1], ["j0", 2]], [["w0", "j1", 4], ["w0", "j0", 1], ["w1", "j0", 0], ["w2", "j1", 6], ["w1", "j1", 12], ["w2", "j0", 11]]], "expected": {"filled": 3, "cost": 4}}], "selected_for_submission": true}
21
+ {"task_id": "allocation-3", "family": "allocation", "defect_count": 3, "example_seed": 0, "prompt": "solve(workers,jobs,quotes): workers=[[name,capacity],...], jobs=[[name,demand],...], quotes=[[worker,job,cost_per_unit],...] (unique pairs, nonnegative integer costs). Unquoted assignments are forbidden. Allocate integer units, never exceed a worker capacity or job demand. First maximize total filled demand, then minimize cost among all such allocations. Return exactly {filled:int,cost:int}. A greedy edge ordering is insufficient; reassignment may be necessary. Names in each list are unique. Empty and disconnected instances are valid; do not mutate inputs.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"network.py": "def edge(graph,a,b,cap,cost):\n graph[a].append([b,len(graph[b]),cap,cost])\n graph[b].append([a,len(graph[a])-1,0,cost])\n", "paths.py": "def shortest(graph,source):\n n=len(graph)\n distance=[None]*n\n parent=[None]*n\n distance[source]=0\n for turn in range(1):\n changed=False\n for a in range(n):\n if distance[a] is not None:\n for idx,e in enumerate(graph[a]):\n b,rev,cap,cost=e\n if cap>0 and (distance[b] is None or distance[a]+cost<distance[b]):\n distance[b]=distance[a]+cost\n parent[b]=(a,idx)\n changed=True\n if not changed:\n break\n return distance,parent\n", "augment.py": "def send(graph,parent,source,sink):\n path=[]\n v=sink\n while v!=source:\n a,idx=parent[v]\n path.append((a,idx))\n v=a\n amount=max(graph[a][idx][2] for a,idx in path)\n for a,idx in path:\n b,rev,cap,cost=graph[a][idx]\n graph[a][idx][2]-=amount\n graph[b][rev][2]+=amount\n return amount\n", "main.py": "from network import edge\nfrom paths import shortest\nfrom augment import send\ndef solve(workers,jobs,quotes):\n wmap={name:i+1 for i,(name,c) in enumerate(workers)}\n jmap={name:len(workers)+i+1 for i,(name,d) in enumerate(jobs)}\n source,sink=0,len(workers)+len(jobs)+1\n graph=[[] for i in range(sink+1)]\n for name,c in workers:\n edge(graph,source,wmap[name],c,0)\n for name,d in jobs:\n edge(graph,jmap[name],sink,d,0)\n for w,j,c in quotes:\n edge(graph,wmap[w],jmap[j],sum(d for name,d in jobs),c)\n filled,total=0,0\n while True:\n distance,parent=shortest(graph,source)\n if distance[sink] is None:\n break\n amount=send(graph,parent,source,sink)\n filled+=amount\n total+=amount*distance[sink]\n return {'filled':filled,'cost':total}\n", "settings.py": "FEE = 1\nLIMIT = 4\nWINDOW = 8\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 3], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "empty", "args": [[], [], []], "expected": {"filled": 0, "cost": 0}}, {"group": "reroute", "args": [[["a", 1], ["b", 1]], [["x", 1], ["y", 1]], [["a", "x", 1], ["a", "y", 2], ["b", "x", 2], ["b", "y", 100]]], "expected": {"filled": 2, "cost": 4}}, {"group": "random", "args": [[["w1", 3], ["w0", 2]], [["j1", 1], ["j2", 2], ["j0", 1]], [["w1", "j0", 20], ["w0", "j1", 6], ["w0", "j2", 16], ["w1", "j1", 15], ["w1", "j2", 6]]], "expected": {"filled": 4, "cost": 38}}], "selected_for_submission": true}
22
+ {"task_id": "expression-1", "family": "expression", "defect_count": 1, "example_seed": 0, "prompt": "solve(text): text is a valid arithmetic expression of nonnegative integer literals, whitespace, parentheses, unary +/- and binary + - * / ^. Use exact rational arithmetic. Power is right-associative and binds MORE tightly than unary signs; multiplication/division are left-associative and bind more tightly than addition/subtraction. Exponents evaluate to nonnegative integers; no zero divisor occurs. Return the canonical fractions.Fraction string, integer if denominator=1, else numerator/denominator. Example -2^2 is -4, 2^3^2 is 512, 8/4/2 is 1. Input unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"lex.py": "def tokens(text):\n out=[]\n i=0\n while i<len(text):\n c=text[i]\n if c.isspace():\n i+=1\n elif c.isdigit():\n j=i+1\n while False:\n j+=1\n out.append(text[i:j])\n i=j\n else:\n out.append(c)\n i+=1\n return out\n", "binding.py": "def powers(op):\n if op in ('+','-'): return (10,11)\n if op in ('*','/'): return (20,21)\n if op=='^': return (40,40)\n return (-1,-1)\n", "unary.py": "def precedence():\n return 30\n", "main.py": "from fractions import Fraction\nfrom lex import tokens\nfrom binding import powers\nfrom unary import precedence\ndef parse(ts,pos,minimum):\n token=ts[pos]\n if token in ('+','-'):\n value,pos=parse(ts,pos+1,precedence())\n if token=='-': value=-value\n elif token=='(':\n value,pos=parse(ts,pos+1,0)\n if ts[pos]!=')': raise ValueError('parenthesis')\n pos+=1\n else:\n value=Fraction(int(token))\n pos+=1\n while pos<len(ts):\n op=ts[pos]\n left,right=powers(op)\n if left<minimum: break\n other,pos=parse(ts,pos+1,right)\n if op=='+': value+=other\n elif op=='-': value-=other\n elif op=='*': value*=other\n elif op=='/': value/=other\n elif op=='^': value=value**other\n return value,pos\ndef solve(text):\n ts=tokens(text)\n value,pos=parse(ts,0,0)\n if pos!=len(ts): raise ValueError('trailing tokens')\n return str(value)\n", "settings.py": "FEE = 1\nLIMIT = 7\nWINDOW = 14\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [3, 5], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "literal", "args": ["30"], "expected": "30"}, {"group": "unary", "args": ["-2^2"], "expected": "-4"}, {"group": "random", "args": ["(((10 - 1) - (7 * 19)) - -((1 - 4) * (6 * 5)))"], "expected": "-214"}], "selected_for_submission": true}
23
+ {"task_id": "expression-2", "family": "expression", "defect_count": 2, "example_seed": 0, "prompt": "solve(text): text is a valid arithmetic expression of nonnegative integer literals, whitespace, parentheses, unary +/- and binary + - * / ^. Use exact rational arithmetic. Power is right-associative and binds MORE tightly than unary signs; multiplication/division are left-associative and bind more tightly than addition/subtraction. Exponents evaluate to nonnegative integers; no zero divisor occurs. Return the canonical fractions.Fraction string, integer if denominator=1, else numerator/denominator. Example -2^2 is -4, 2^3^2 is 512, 8/4/2 is 1. Input unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"lex.py": "def tokens(text):\n out=[]\n i=0\n while i<len(text):\n c=text[i]\n if c.isspace():\n i+=1\n elif c.isdigit():\n j=i+1\n while False:\n j+=1\n out.append(text[i:j])\n i=j\n else:\n out.append(c)\n i+=1\n return out\n", "binding.py": "def powers(op):\n if op in ('+','-'): return (10,11)\n if op in ('*','/'): return (20,21)\n if op=='^': return (40,40)\n return (-1,-1)\n", "unary.py": "def precedence():\n return 50\n", "main.py": "from fractions import Fraction\nfrom lex import tokens\nfrom binding import powers\nfrom unary import precedence\ndef parse(ts,pos,minimum):\n token=ts[pos]\n if token in ('+','-'):\n value,pos=parse(ts,pos+1,precedence())\n if token=='-': value=-value\n elif token=='(':\n value,pos=parse(ts,pos+1,0)\n if ts[pos]!=')': raise ValueError('parenthesis')\n pos+=1\n else:\n value=Fraction(int(token))\n pos+=1\n while pos<len(ts):\n op=ts[pos]\n left,right=powers(op)\n if left<minimum: break\n other,pos=parse(ts,pos+1,right)\n if op=='+': value+=other\n elif op=='-': value-=other\n elif op=='*': value*=other\n elif op=='/': value/=other\n elif op=='^': value=value**other\n return value,pos\ndef solve(text):\n ts=tokens(text)\n value,pos=parse(ts,0,0)\n if pos!=len(ts): raise ValueError('trailing tokens')\n return str(value)\n", "settings.py": "FEE = 5\nLIMIT = 3\nWINDOW = 12\nTHRESHOLD = 2\nCALIBRATIONS = {'s0': [1, 0], 's1': [2, 1], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "literal", "args": ["70"], "expected": "70"}, {"group": "unary", "args": ["-3^2"], "expected": "-9"}, {"group": "random", "args": ["(((13 - 20) + (2 + 16)) ^ 0)"], "expected": "1"}], "selected_for_submission": true}
24
+ {"task_id": "expression-3", "family": "expression", "defect_count": 3, "example_seed": 0, "prompt": "solve(text): text is a valid arithmetic expression of nonnegative integer literals, whitespace, parentheses, unary +/- and binary + - * / ^. Use exact rational arithmetic. Power is right-associative and binds MORE tightly than unary signs; multiplication/division are left-associative and bind more tightly than addition/subtraction. Exponents evaluate to nonnegative integers; no zero divisor occurs. Return the canonical fractions.Fraction string, integer if denominator=1, else numerator/denominator. Example -2^2 is -4, 2^3^2 is 512, 8/4/2 is 1. Input unchanged.\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.", "starter": {"lex.py": "def tokens(text):\n out=[]\n i=0\n while i<len(text):\n c=text[i]\n if c.isspace():\n i+=1\n elif c.isdigit():\n j=i+1\n while False:\n j+=1\n out.append(text[i:j])\n i=j\n else:\n out.append(c)\n i+=1\n return out\n", "binding.py": "def powers(op):\n if op in ('+','-'): return (10,11)\n if op in ('*','/'): return (20,21)\n if op=='^': return (40,41)\n return (-1,-1)\n", "unary.py": "def precedence():\n return 50\n", "main.py": "from fractions import Fraction\nfrom lex import tokens\nfrom binding import powers\nfrom unary import precedence\ndef parse(ts,pos,minimum):\n token=ts[pos]\n if token in ('+','-'):\n value,pos=parse(ts,pos+1,precedence())\n if token=='-': value=-value\n elif token=='(':\n value,pos=parse(ts,pos+1,0)\n if ts[pos]!=')': raise ValueError('parenthesis')\n pos+=1\n else:\n value=Fraction(int(token))\n pos+=1\n while pos<len(ts):\n op=ts[pos]\n left,right=powers(op)\n if left<minimum: break\n other,pos=parse(ts,pos+1,right)\n if op=='+': value+=other\n elif op=='-': value-=other\n elif op=='*': value*=other\n elif op=='/': value/=other\n elif op=='^': value=value**other\n return value,pos\ndef solve(text):\n ts=tokens(text)\n value,pos=parse(ts,0,0)\n if pos!=len(ts): raise ValueError('trailing tokens')\n return str(value)\n", "settings.py": "FEE = 2\nLIMIT = 7\nWINDOW = 8\nTHRESHOLD = 3\nCALIBRATIONS = {'s0': [1, 0], 's1': [4, 2], 's2': [-1, 3]}\n"}, "public_examples": [{"group": "literal", "args": ["91"], "expected": "91"}, {"group": "unary", "args": ["-2^2"], "expected": "-4"}, {"group": "random", "args": ["((14 + 4) ^ 2)"], "expected": "324"}], "selected_for_submission": true}
components/loui/upstream/v3/tasks.py ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Original seeded multi-module repair tasks; references never enter candidate execution."""
2
+ import copy
3
+ import csv
4
+ import io
5
+ import random
6
+ from dataclasses import dataclass
7
+ from fractions import Fraction
8
+ from hard_tasks import HARD_SPECS, allocation_ref, expression_ref, hard_cases
9
+
10
+ FAMILIES = ('ledger', 'capacity', 'workflow', 'incident', 'sensor', 'reconcile', 'allocation', 'expression')
11
+ TASK_IDS = tuple(f'{f}-{level}' for f in FAMILIES for level in (1, 2, 3))
12
+
13
+ @dataclass
14
+ class Task:
15
+ task_id: str
16
+ seed: int
17
+ prompt: str
18
+ starter: dict
19
+ solution: dict
20
+ visible: list
21
+ hidden: list
22
+ mutations: list
23
+
24
+ def ledger_ref(events, fee):
25
+ lots, pnl, missing = {}, 0, 0
26
+ for e in events:
27
+ key = (e['account'], e['asset'])
28
+ queue = lots.setdefault(key, [])
29
+ if e['side'] == 'buy':
30
+ queue.extend([e['price']] * e['qty'])
31
+ else:
32
+ amount = min(e['qty'], len(queue))
33
+ pnl += sum(e['price'] - p - fee for p in queue[:amount])
34
+ del queue[:amount]
35
+ missing += e['qty'] - amount
36
+ return {'pnl': pnl, 'unfilled': missing, 'positions': [
37
+ [a, s, len(q), sum(q)] for (a, s), q in sorted(lots.items()) if q]}
38
+
39
+ def capacity_ref(bookings, limit):
40
+ # Independent interval scan, not the submitted endpoint sweep.
41
+ boundaries = sorted({x for a, b, weight in bookings for x in (a, b) if a < b and weight > 0})
42
+ segments, peak, area = [], 0, 0
43
+ for a, b in zip(boundaries, boundaries[1:]):
44
+ load = sum(w for s, e, w in bookings if s <= a < e and w > 0)
45
+ peak = max(peak, load)
46
+ area += max(0, load - limit) * (b - a)
47
+ if load > limit:
48
+ if segments and segments[-1][1] == a:
49
+ segments[-1][1] = b
50
+ else:
51
+ segments.append([a, b])
52
+ return {'peak': peak, 'overload': segments, 'excess_area': area}
53
+
54
+ def workflow_ref(jobs):
55
+ lookup = {j['id']: j for j in jobs}
56
+ finish, visiting = {}, set()
57
+ def visit(name):
58
+ if name not in lookup or name in visiting:
59
+ raise ValueError('invalid dependencies')
60
+ if name not in finish:
61
+ visiting.add(name)
62
+ j = lookup[name]
63
+ finish[name] = j['duration'] + max([j['release']] + [visit(d) for d in j['deps']])
64
+ visiting.remove(name)
65
+ return finish[name]
66
+ try:
67
+ for j in jobs:
68
+ visit(j['id'])
69
+ return {'status': 'ok', 'finish': [[n, finish[n]] for n in sorted(finish)],
70
+ 'late': sorted(j['id'] for j in jobs if finish[j['id']] > j['deadline'])}
71
+ except ValueError:
72
+ return {'status': 'invalid', 'finish': [], 'late': []}
73
+
74
+ def incident_ref(events, window, threshold):
75
+ ordered = sorted(enumerate(events), key=lambda x: (x[1]['time'], x[0]))
76
+ history, seen, alerts = {}, set(), []
77
+ for _, e in ordered:
78
+ if e['id'] in seen:
79
+ continue
80
+ seen.add(e['id'])
81
+ key = (e['user'], e['ip'])
82
+ if e['outcome'] == 'success':
83
+ history.pop(key, None)
84
+ continue
85
+ prior = [t for t in history.get(key, []) if e['time'] - window <= t]
86
+ history[key] = prior + [e['time']]
87
+ if len(prior) < threshold <= len(prior) + 1:
88
+ alerts.append([e['user'], e['ip'], e['time']])
89
+ return alerts
90
+
91
+ def sensor_ref(readings, calibrations, threshold):
92
+ converted = {}
93
+ for r in readings:
94
+ if r['valid']:
95
+ gain, offset = calibrations[r['sensor']]
96
+ converted[(r['sensor'], r['time'])] = gain * r['value'] + offset
97
+ groups = {}
98
+ for (_, time), value in converted.items():
99
+ groups.setdefault(time, []).append(value)
100
+ result = []
101
+ for time, values in sorted(groups.items()):
102
+ ordered = sorted(values)
103
+ n = len(ordered)
104
+ mid = Fraction(ordered[n // 2]) if n % 2 else Fraction(ordered[n//2-1] + ordered[n//2], 2)
105
+ result.append([time, float(mid), mid > threshold])
106
+ return result
107
+
108
+ def reconcile_ref(left, right):
109
+ totals = [{}, {}]
110
+ for side, text in enumerate((left, right)):
111
+ for row in csv.DictReader(io.StringIO(text)):
112
+ key = row['key'].strip().casefold()
113
+ value = Fraction(row['amount'])
114
+ if row['kind'] == 'credit':
115
+ value = -value
116
+ totals[side][key] = totals[side].get(key, Fraction(0)) + value
117
+ return [[key, str(totals[0].get(key, Fraction(0)) - totals[1].get(key, Fraction(0)))]
118
+ for key in sorted(totals[0].keys() | totals[1].keys())
119
+ if totals[0].get(key, Fraction(0)) != totals[1].get(key, Fraction(0))]
120
+
121
+ REFERENCES = dict(zip(FAMILIES, (ledger_ref, capacity_ref, workflow_ref, incident_ref, sensor_ref, reconcile_ref)))
122
+
123
+ # Each defect is in a distinct module and has a targeted verifier group.
124
+ SPECS = {
125
+ 'ledger': (
126
+ 'solve(events): FIFO accounting in input order. Each event has account, asset, side (buy/sell), qty (positive integer), price (integer cents). Separate lots by (account,asset). Sell only available units, do not create shorts. Deduct FEE cents per filled sold unit. Return pnl, unfilled (total requested units lacking stock), and sorted nonempty positions [account,asset,qty,cost_basis]. Do not mutate input.',
127
+ {
128
+ 'identity.py': "def key(e):\n return (e['account'], e['asset'])\n",
129
+ 'lots.py': "def consume(queue, qty):\n used = min(qty, sum(n for n, p in queue))\n remaining, cost = used, 0\n while remaining:\n n, p = queue[0]\n take = min(n, remaining)\n cost += take * p\n remaining -= take\n if take == n:\n queue.pop(0)\n else:\n queue[0] = (n - take, p)\n return used, cost\n",
130
+ 'charges.py': "from settings import FEE\ndef profit(qty, price, cost):\n return qty * (price - FEE) - cost\n",
131
+ 'main.py': "from identity import key\nfrom lots import consume\nfrom charges import profit\ndef solve(events):\n lots, pnl, unfilled = {}, 0, 0\n for e in events:\n k = key(e)\n q = lots.setdefault(k, [])\n if e['side'] == 'buy':\n q.append((e['qty'], e['price']))\n else:\n used, cost = consume(q, e['qty'])\n pnl += profit(used, e['price'], cost)\n unfilled += e['qty'] - used\n return {'pnl': pnl, 'unfilled': unfilled, 'positions': [[a, s, sum(n for n, p in q), sum(n*p for n,p in q)] for (a,s),q in sorted(lots.items()) if q]}\n",
132
+ }, [('identity.py', "(e['account'], e['asset'])", "(e['asset'], e['asset'])"),
133
+ ('lots.py', 'queue[0]', 'queue[-1]'),
134
+ ('charges.py', 'qty * (price - FEE) - cost', 'qty * price - FEE - cost')]),
135
+ 'capacity': (
136
+ 'solve(bookings): each [start,end,weight] is a half-open integer-time weighted reservation. Ignore zero-length and nonpositive-weight entries. Return peak load, merged maximal overload intervals where load > LIMIT, and integral of max(load-LIMIT,0) over time as excess_area. Touching overload intervals must merge. Input unchanged.',
137
+ {
138
+ 'events.py': "def endpoints(bookings):\n delta = {}\n for a,b,w in bookings:\n if a < b and w > 0:\n delta[a] = delta.get(a, 0) + w\n delta[b] = delta.get(b, 0) - w\n return sorted(delta.items())\n",
139
+ 'rules.py': "from settings import LIMIT\ndef overloaded(load):\n return load > LIMIT\ndef excess(load):\n return max(0, load - LIMIT)\n",
140
+ 'merge.py': "def append_span(spans, a, b):\n if spans and spans[-1][1] == a:\n spans[-1][1] = b\n else:\n spans.append([a,b])\n",
141
+ 'main.py': "from events import endpoints\nfrom rules import overloaded, excess\nfrom merge import append_span\ndef solve(bookings):\n points = endpoints(bookings)\n load, peak, area, spans = 0, 0, 0, []\n for i in range(len(points)-1):\n a,delta = points[i]\n b = points[i+1][0]\n load += delta\n peak = max(peak, load)\n area += excess(load) * (b-a)\n if overloaded(load):\n append_span(spans, a, b)\n return {'peak': peak, 'overload': spans, 'excess_area': area}\n",
142
+ }, [('events.py', 'delta.get(b, 0) - w', 'delta.get(b, 0) + w'),
143
+ ('rules.py', 'load > LIMIT', 'load >= LIMIT'),
144
+ ('merge.py', 'spans[-1][1] == a', 'spans[-1][1] > a')]),
145
+ 'workflow': (
146
+ 'solve(jobs): jobs have unique id, duration>=0, release>=0, deadline, deps (job IDs). Unlimited parallel workers. Start each job at max(release, predecessor finish times), then add duration. Return status=ok, sorted finish pairs and IDs with finish strictly greater than deadline as late. Missing dependencies or any cycle make the whole graph invalid: status=invalid, finish=[], late=[]. Jobs are arbitrarily ordered; do not mutate them.',
147
+ {
148
+ 'graph.py': "def ready(job, pending, finished):\n return all(d in finished for d in job['deps'])\n",
149
+ 'timing.py': "def end_time(job, finished):\n return max([job['release']] + [finished[d] for d in job['deps']]) + job['duration']\n",
150
+ 'report.py': "def report(jobs, finished):\n return {'status': 'ok', 'finish': [[n,finished[n]] for n in sorted(finished)], 'late': sorted(j['id'] for j in jobs if finished[j['id']] > j['deadline'])}\n",
151
+ 'main.py': "from graph import ready\nfrom timing import end_time\nfrom report import report\ndef solve(jobs):\n pending = {j['id']:j for j in jobs}\n finished = {}\n while pending:\n progress = False\n for name,job in list(pending.items()):\n if ready(job, pending, finished):\n finished[name] = end_time(job, finished)\n del pending[name]\n progress = True\n if not progress:\n return {'status':'invalid','finish':[],'late':[]}\n return report(jobs, finished)\n",
152
+ }, [('graph.py', "all(d in finished for d in job['deps'])", "all(d not in pending for d in job['deps'])"),
153
+ ('timing.py', "max([job['release']] + [finished[d] for d in job['deps']])", "job['release'] + sum(finished[d] for d in job['deps'])"),
154
+ ('report.py', "> j['deadline']", ">= j['deadline']")]),
155
+ 'incident': (
156
+ 'solve(events): process events by (time, original index), preserving ties. Global event id deduplication keeps the first in that sorted order. Group failures by (user,ip). At each failure retain times in inclusive [time-WINDOW,time]. Alert [user,ip,time] only on a crossing from fewer than THRESHOLD failures to at least THRESHOLD. A success clears that pair only. Return alerts in processing order, without mutating events.',
157
+ {
158
+ 'order.py': "def ordered(events):\n return sorted(enumerate(events), key=lambda x: (x[1]['time'], x[0]))\n",
159
+ 'window.py': "from settings import WINDOW\ndef trim(times, now):\n return [t for t in times if t >= now - WINDOW]\n",
160
+ 'resetter.py': "def reset(history, key):\n history.pop(key, None)\n",
161
+ 'main.py': "from settings import THRESHOLD\nfrom order import ordered\nfrom window import trim\nfrom resetter import reset\ndef solve(events):\n history, seen, alerts = {}, set(), []\n for idx,e in ordered(events):\n if e['id'] in seen:\n continue\n seen.add(e['id'])\n k = (e['user'],e['ip'])\n if e['outcome'] == 'success':\n reset(history,k)\n else:\n prior = trim(history.get(k,[]),e['time'])\n history[k] = prior + [e['time']]\n if len(prior) < THRESHOLD <= len(prior)+1:\n alerts.append([e['user'],e['ip'],e['time']])\n return alerts\n",
162
+ }, [('order.py', "(x[1]['time'], x[0])", "(x[1]['time'], -x[0])"),
163
+ ('window.py', 't >= now - WINDOW', 't > now - WINDOW'),
164
+ ('resetter.py', 'history.pop(key, None)', 'history.clear()')]),
165
+ 'sensor': (
166
+ 'solve(readings): readings have sensor, time, value (integer), valid (bool). Ignore invalid readings; for duplicate (sensor,time), keep the last valid occurrence in input order. Convert each retained value with CALIBRATIONS[sensor]=[gain,offset] as gain*value+offset BEFORE aggregation. Return sorted [time,median,alarm] rows; even-count median averages the middle two; alarm is median strictly > THRESHOLD. Inputs unchanged.',
167
+ {
168
+ 'dedup.py': "def latest(readings):\n kept = {}\n for r in readings:\n if r['valid']:\n kept[(r['sensor'],r['time'])] = r\n return list(kept.values())\n",
169
+ 'convert.py': "from settings import CALIBRATIONS\ndef convert(r):\n gain,offset = CALIBRATIONS[r['sensor']]\n return gain*r['value']+offset\n",
170
+ 'stats.py': "def median(values):\n v = sorted(values)\n n = len(v)\n return v[n//2] if n%2 else (v[n//2-1]+v[n//2])/2\n",
171
+ 'main.py': "from settings import THRESHOLD\nfrom dedup import latest\nfrom convert import convert\nfrom stats import median\ndef solve(readings):\n groups = {}\n for r in latest(readings):\n groups.setdefault(r['time'],[]).append(convert(r))\n return [[t, median(v), median(v)>THRESHOLD] for t,v in sorted(groups.items())]\n",
172
+ }, [('dedup.py', "kept[(r['sensor'],r['time'])] = r", "kept.setdefault((r['sensor'],r['time']), r)"),
173
+ ('convert.py', "gain*r['value']+offset", "gain*(r['value']+offset)"),
174
+ ('stats.py', '(v[n//2-1]+v[n//2])/2', 'v[n//2]')]),
175
+ 'reconcile': (
176
+ 'solve(left,right): two CSV strings with header key,amount,kind. CSV quoting follows Python csv rules. Normalize keys using strip().casefold(). Amount is a finite decimal string, kind is debit or credit; credits negate the amount. Sum duplicates separately in each file using exact arithmetic. Return sorted [key,delta] for nonzero left-minus-right differences. delta MUST be canonical Fraction string (integer if denominator=1, otherwise numerator/denominator), not decimal or float.',
177
+ {
178
+ 'parse.py': "import csv\nimport io\ndef rows(text):\n return list(csv.DictReader(io.StringIO(text)))\n",
179
+ 'keys.py': "def key(row):\n return row['key'].strip().casefold()\n",
180
+ 'amounts.py': "from fractions import Fraction\ndef amount(row):\n value = Fraction(row['amount'])\n return -value if row['kind']=='credit' else value\n",
181
+ 'main.py': "from fractions import Fraction\nfrom parse import rows\nfrom keys import key\nfrom amounts import amount\ndef totals(text):\n out = {}\n for row in rows(text):\n k = key(row)\n out[k] = out.get(k,Fraction(0)) + amount(row)\n return out\ndef solve(left,right):\n a,b = totals(left),totals(right)\n return [[k,str(a.get(k,Fraction(0))-b.get(k,Fraction(0)))] for k in sorted(set(a)|set(b)) if a.get(k,Fraction(0))!=b.get(k,Fraction(0))]\n",
182
+ }, [('parse.py', 'list(csv.DictReader(io.StringIO(text)))', "[dict(zip(['key','amount','kind'],line.split(','))) for line in text.splitlines()[1:]]"),
183
+ ('keys.py', ".strip().casefold()", ".strip().lower()"),
184
+ ('amounts.py', "-value if row['kind']=='credit' else value", 'value')]),
185
+ }
186
+
187
+ def csv_text(rows):
188
+ f = io.StringIO()
189
+ w = csv.writer(f)
190
+ w.writerow(['key','amount','kind'])
191
+ w.writerows(rows)
192
+ return f.getvalue()
193
+
194
+ def cases(family, rng, config):
195
+ """Targeted edge groups plus compositional random tests; no private benchmark data."""
196
+ out = []
197
+ def add(group, *args):
198
+ out.append({'group': group, 'args': list(args)})
199
+ if family == 'ledger':
200
+ def event(a, s, side, n, p):
201
+ return dict(account=a,asset=s,side=side,qty=n,price=p)
202
+ add('empty', [])
203
+ add('identity', [event('a','x','buy',3,100),event('b','x','sell',2,150)])
204
+ add('fifo', [event('a','x','buy',2,10),event('a','x','buy',3,30),event('a','x','sell',3,45)])
205
+ add('fee', [event('a','x','buy',4,7),event('a','x','sell',4,12)])
206
+ add('shortfall', [event('a','x','buy',1,10),event('a','x','sell',5,30)])
207
+ for i in range(30):
208
+ add('random', [event(rng.choice('abc'),rng.choice('xyz'),rng.choice(['buy','sell']),rng.randint(1,6),rng.randint(1,250)) for _ in range(rng.randint(4,30))])
209
+ elif family == 'capacity':
210
+ limit = config['LIMIT']
211
+ add('empty', [])
212
+ add('half_open', [[0,4,limit],[4,7,limit]])
213
+ add('strict', [[0,5,limit]])
214
+ add('merge', [[0,3,limit+1],[3,6,limit+2]])
215
+ add('ignore', [[0,0,99],[1,5,0],[2,8,-3]])
216
+ for i in range(30):
217
+ values=[]
218
+ for j in range(rng.randint(2,15)):
219
+ a = rng.randint(-5,15)
220
+ values.append([a,a+rng.randint(0,10),rng.randint(-1,limit+4)])
221
+ add('random', values)
222
+ elif family == 'workflow':
223
+ def job(n, deps, duration=2, release=0, deadline=10):
224
+ return dict(id=n,deps=deps,duration=duration,release=release,deadline=deadline)
225
+ add('empty', [])
226
+ add('missing', [job('a',['absent'])])
227
+ add('cycle', [job('a',['b']),job('b',['a'])])
228
+ add('join', [job('c',['a','b'],3,4),job('b',[],5,2),job('a',[],2,1)])
229
+ add('deadline', [job('a',[],5,0,5)])
230
+ for i in range(30):
231
+ rows=[]
232
+ for j in range(rng.randint(3,12)):
233
+ rows.append(job(f'n{j}',[f'n{k}' for k in range(j) if rng.random()<.35],rng.randint(0,6),rng.randint(0,9),rng.randint(2,25)))
234
+ if i%7==0:
235
+ rows[0]['deps'] = [rows[-1]['id']]
236
+ rows[-1]['deps'].append(rows[0]['id'])
237
+ rng.shuffle(rows)
238
+ add('random', rows)
239
+ elif family == 'incident':
240
+ window, threshold = config['WINDOW'], config['THRESHOLD']
241
+ def event(i,t,u='u',ip='ip',outcome='failure'):
242
+ return dict(id=str(i),time=t,user=u,ip=ip,outcome=outcome)
243
+ add('empty', [])
244
+ add('boundary', [event(i,0 if i==0 else window) for i in range(threshold)])
245
+ add('ties', [event('s',0,outcome='success')]+[event(i,0) for i in range(threshold)]+[event(f'later{i}',1) for i in range(threshold)])
246
+ add('reset_scope', [event(i,0,'a') for i in range(threshold-1)]+[event('s',1,'b',outcome='success'),event('last',2,'a')])
247
+ add('dedup', [event('dup',0)]*threshold)
248
+ for i in range(30):
249
+ rows=[event(j,rng.randint(0,window*3),rng.choice('ab'),rng.choice(['ip1','ip2']),rng.choice(['failure']*5+['success'])) for j in range(45)]
250
+ rows.extend(copy.deepcopy(rows[:5]))
251
+ rng.shuffle(rows)
252
+ add('random', rows)
253
+ elif family == 'sensor':
254
+ names=list(config['CALIBRATIONS'])
255
+ def reading(s,t,v,valid=True):
256
+ return dict(sensor=s,time=t,value=v,valid=valid)
257
+ add('empty', [])
258
+ add('dedup', [reading(names[0],1,0),reading(names[0],1,9),reading(names[0],1,100,False)])
259
+ add('convert', [reading(names[1],2,3)])
260
+ add('median', [reading(names[0],3,0),reading(names[1],3,10)])
261
+ add('invalid', [reading(names[0],4,5,False)])
262
+ for i in range(30):
263
+ add('random', [reading(rng.choice(names),rng.randint(0,6),rng.randint(-10,20),rng.random()>.2) for _ in range(25)])
264
+ else:
265
+ add('empty', csv_text([]),csv_text([]))
266
+ add('quoting',csv_text([('a,b','1.25','debit'),('a\nline','2','debit')]),csv_text([]))
267
+ add('unicode',csv_text([(' Straße ','3','debit')]),csv_text([('STRASSE','3','debit')]))
268
+ add('sign',csv_text([('x','0.1','credit'),('x','0.2','debit')]),csv_text([('x','0.1','debit')]))
269
+ add('exact',csv_text([('x','0.1','debit'),('x','0.2','debit')]),csv_text([('x','0.3','debit')]))
270
+ keys = [' Alpha ','ALPHA','beta','Straße','STRASSE','a,b','a\nline','"quote"']
271
+ for i in range(30):
272
+ pair=[]
273
+ for side in range(2):
274
+ pair.append(csv_text([(rng.choice(keys),f'{rng.randint(-1000,1000)/100:.2f}',rng.choice(['debit','credit'])) for _ in range(rng.randint(1,20))]))
275
+ add('random',*pair)
276
+ return out
277
+
278
+ def make_task(task_id, seed=0):
279
+ if task_id not in TASK_IDS:
280
+ raise ValueError('Unknown task_id')
281
+ family, level_text = task_id.rsplit('-',1)
282
+ level = int(level_text)
283
+ rng = random.Random(f'v3/{task_id}/{seed}')
284
+ config = {'FEE':rng.randint(1,7), 'LIMIT':rng.randint(2,8), 'WINDOW':rng.randint(5,20),
285
+ 'THRESHOLD':rng.randint(2,4), 'CALIBRATIONS':{'s0':[1,0],'s1':[rng.randint(2,4),rng.randint(1,5)],'s2':[-1,3]}}
286
+ instruction, modules, defects = (HARD_SPECS if family in HARD_SPECS else SPECS)[family]
287
+ solution = dict(modules)
288
+ # Rotating subsets avoid a fixed easy starter for the lower levels.
289
+ chosen = rng.sample(defects,level)
290
+ starter = dict(solution)
291
+ for path, before, after in chosen:
292
+ assert before in starter[path], (family,path,before)
293
+ starter[path] = starter[path].replace(before,after)
294
+ settings = '\n'.join(f'{k} = {v!r}' for k,v in config.items())+'\n'
295
+ starter['settings.py'] = solution['settings.py'] = settings
296
+ all_cases = hard_cases(family,rng) if family in HARD_SPECS else cases(family,rng,config)
297
+ if family=='ledger': extra=[config['FEE']]
298
+ elif family=='capacity': extra=[config['LIMIT']]
299
+ elif family=='incident': extra=[config['WINDOW'],config['THRESHOLD']]
300
+ elif family=='sensor': extra=[config['CALIBRATIONS'],config['THRESHOLD']]
301
+ else: extra=[]
302
+ for c in all_cases:
303
+ reference = {'allocation':allocation_ref,'expression':expression_ref}.get(family) or REFERENCES[family]
304
+ c['expected'] = reference(*copy.deepcopy(c['args']),*extra)
305
+ visible = [copy.deepcopy(all_cases[i]) for i in (0,1,len(all_cases)-1)]
306
+ # Disjoint random held-outs; edge groups may share semantic shapes, not random payloads.
307
+ hidden = all_cases[:-1]
308
+ prompt = instruction + '\nRuntime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed.'
309
+ return Task(task_id,seed,prompt,starter,solution,visible,hidden,[p for p,_,_ in chosen])
components/math/ADAPTATIONS.txt CHANGED
@@ -1,3 +1,2 @@
1
- Interface: exec and finish. Working directory: /workdir. Input: instance.json. Output: answer.json.
2
- Reset restores the original task input; finish invokes the original checker. Registered tasks and alternatives are listed in the root REGISTRATION.json.
3
- Episode transport: a persistent WebSocket connection at /ws. HTTP reset and step are stateless SDK probes.
 
1
+ Actions: exec and finish. Workspace: /workdir. Input: instance.json. Output: answer.json. Persistent episode transport: /ws.
2
+ Reset restores the task input; finish invokes the original checker.
 
components/math/Dockerfile ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ FROM ghcr.io/bochencs/openenv-math@sha256:a68a875afe093fd2ca29c1d5f8a4465bba39da60262faddd4548e684befc161f
2
+ USER root
3
+ COPY config.json /opt/native-shell/config.json
4
+ COPY runtime/native_shell/backend.py /opt/native-shell/runtime/native_shell/backend.py
5
+ RUN rm -rf /opt/native-shell/tasks/construct-mc-ramsey-l4-s0 /opt/native-shell/tasks/construct-rlve-round-robin-scores-l3-s0 /opt/native-shell/tasks/construct-mc-social-golfers-l4-s0 && chmod 600 /opt/native-shell/config.json
components/math/FILE_ALLOWLIST.json DELETED
@@ -1,603 +0,0 @@
1
- {
2
- "component": "math",
3
- "files": [
4
- {
5
- "path": "ADAPTATIONS.txt",
6
- "sha256": "67afb4d3cf0def4023ec8a5320476a19e813d48fc4772a043e2ae991817928e3",
7
- "bytes": 360,
8
- "role": "adapter_documentation",
9
- "parent_sha256": "15c3c4f106c052941f16970b3981ae9c9a7bbe4c913430bcac10edbc14e73151"
10
- },
11
- {
12
- "path": "NOTICE.txt",
13
- "sha256": "73b544ecebc5d10e34e72f187bfdccf8ad66c9df4c37b03eeca7323a12401248",
14
- "bytes": 703,
15
- "role": "license_and_attribution"
16
- },
17
- {
18
- "path": "SDK_DEPENDENCIES.json",
19
- "sha256": "a037cf3ce617aa3e0216bf5e0677d229679bfffdd30dba9057b58bb413c39732",
20
- "bytes": 25904,
21
- "role": "dependency_manifest"
22
- },
23
- {
24
- "path": "SOURCE.json",
25
- "sha256": "a91ceb6c6b39e532fbef753034f1979d2364672d9bb6a45395c946dd8208befd",
26
- "bytes": 1081,
27
- "role": "metadata"
28
- },
29
- {
30
- "path": "TASKS.json",
31
- "sha256": "fe67677e50ff773b044feb9122e26a4dbb1dc647a5c88ba9db0adf952167104a",
32
- "bytes": 3905,
33
- "role": "metadata",
34
- "parent_sha256": "55358840bcbda8eb1efed14464392594a96390c781ff914756eea0acfbe36137"
35
- },
36
- {
37
- "path": "config.json",
38
- "sha256": "190f2c6c257c0cbc4cb6bfa2efe8e5fdca221b1c18b39aa70331781f2be79afa",
39
- "bytes": 5968,
40
- "role": "runtime_registry"
41
- },
42
- {
43
- "path": "licenses/MathConstraint-LICENSE",
44
- "sha256": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94",
45
- "bytes": 18656,
46
- "role": "license_and_attribution",
47
- "source": {
48
- "repo": "vireshpati/Math-Constraint",
49
- "source_url": "https://github.com/vireshpati/Math-Constraint/blob/main/LICENSE",
50
- "git_blob_sha": "4ea99c213c5c0c005ae4e80df8e52169d06896ec",
51
- "license": {
52
- "key": "cc-by-4.0",
53
- "name": "Creative Commons Attribution 4.0 International",
54
- "spdx_id": "CC-BY-4.0",
55
- "url": "https://api.github.com/licenses/cc-by-4.0",
56
- "node_id": "MDc6TGljZW5zZTI1"
57
- },
58
- "sha256": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94",
59
- "retrieval_scope": "license text only; not a claim about the original generator revision"
60
- }
61
- },
62
- {
63
- "path": "licenses/RLVE-LICENSE",
64
- "sha256": "10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e",
65
- "bytes": 1069,
66
- "role": "license_and_attribution",
67
- "source": {
68
- "repo": "Zhiyuan-Zeng/RLVE",
69
- "source_url": "https://github.com/Zhiyuan-Zeng/RLVE/blob/main/LICENSE",
70
- "git_blob_sha": "5677eb6d02ee26cd27b6dce1cbfaa9676b1a2382",
71
- "license": {
72
- "key": "mit",
73
- "name": "MIT License",
74
- "spdx_id": "MIT",
75
- "url": "https://api.github.com/licenses/mit",
76
- "node_id": "MDc6TGljZW5zZTEz"
77
- },
78
- "sha256": "10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e",
79
- "retrieval_scope": "license text only; not a claim about the original generator revision"
80
- }
81
- },
82
- {
83
- "path": "licenses/UPSTREAM_COLLECTION_LICENSES.md",
84
- "sha256": "200b2ce93f2a5b9671165f9aea3cc4d89db995352c1e1e3db6d418262b058516",
85
- "bytes": 462,
86
- "role": "license_and_attribution"
87
- },
88
- {
89
- "path": "runtime/common/__init__.py",
90
- "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
91
- "bytes": 1,
92
- "role": "execution_adapter",
93
- "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
94
- },
95
- {
96
- "path": "runtime/common/contracts.py",
97
- "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1",
98
- "bytes": 1015,
99
- "role": "execution_adapter",
100
- "parent_sha256": "2df4ab6636056806069216ee52576ac979255cb895b49b0c72c3686f3d9c5ae2"
101
- },
102
- {
103
- "path": "runtime/common/http_routes.py",
104
- "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e",
105
- "bytes": 2380,
106
- "role": "execution_adapter",
107
- "parent_sha256": "2876ad9a5d35eeb0e1ebb40346e5d230d8326ac8280ec260459798cf7a4eee18"
108
- },
109
- {
110
- "path": "runtime/common/models.py",
111
- "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a",
112
- "bytes": 1815,
113
- "role": "execution_adapter",
114
- "parent_sha256": "9fa259555127367477c21ca27f0ee6ac4a49e5f5744ecd91bf23a3ea1d0ab07d"
115
- },
116
- {
117
- "path": "runtime/native_shell/__init__.py",
118
- "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
119
- "bytes": 1,
120
- "role": "execution_adapter",
121
- "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
122
- },
123
- {
124
- "path": "runtime/native_shell/actor_launcher.py",
125
- "sha256": "80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3",
126
- "bytes": 5012,
127
- "role": "execution_adapter",
128
- "parent_sha256": "254abfeedc1d69cf228f923b5b43452d820c8ba5889fd8595e322e19efc7a896"
129
- },
130
- {
131
- "path": "runtime/native_shell/backend.py",
132
- "sha256": "0b2d9a50ee5d97721a7ca24b728687a9bab474b33e788524118625ebc346ad0e",
133
- "bytes": 13327,
134
- "role": "execution_adapter",
135
- "parent_sha256": "6cc693d7a384d6d76b8c99bfb6af2e5188c03aac81671cfec3414733fb98089a"
136
- },
137
- {
138
- "path": "runtime/native_shell/environment.py",
139
- "sha256": "cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53",
140
- "bytes": 1616,
141
- "role": "execution_adapter",
142
- "parent_sha256": "1c1ded0928c4757a87696f818cf9004a29e55f992495ffa0aacde9112dad7fea"
143
- },
144
- {
145
- "path": "runtime/native_shell/guard.py",
146
- "sha256": "31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e",
147
- "bytes": 12337,
148
- "role": "execution_adapter",
149
- "parent_sha256": "4217040e7b055f57c6faef5aaa2a481757eda9856afb5a8816098b65fe788ef1"
150
- },
151
- {
152
- "path": "runtime/native_shell/launch_service.py",
153
- "sha256": "db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b",
154
- "bytes": 2383,
155
- "role": "execution_adapter",
156
- "parent_sha256": "c698c3b27e551f9986bf9e5aac9d337bf2e662058f5ba05d0882aaf2008ff98a"
157
- },
158
- {
159
- "path": "runtime/native_shell/process_scope.py",
160
- "sha256": "1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e",
161
- "bytes": 8298,
162
- "role": "execution_adapter"
163
- },
164
- {
165
- "path": "runtime/native_shell/server.py",
166
- "sha256": "c8bb079f359fe4ac6c1764cbf47fdcfaa3f3caee35ff6c41e845bee3e965d454",
167
- "bytes": 414,
168
- "role": "execution_adapter",
169
- "parent_sha256": "3a0de8fbd07613f323cbd1e42e4345f0268f7a21bc4326622c8e22f4d318f30e"
170
- },
171
- {
172
- "path": "runtime/native_shell/verifier_launcher.py",
173
- "sha256": "6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465",
174
- "bytes": 962,
175
- "role": "execution_adapter",
176
- "parent_sha256": "aa03260a2bcc91c9e23fd32dda0d75d1979ee7f4f64e87ea635f6bcd6048b075"
177
- },
178
- {
179
- "path": "runtime/native_shell/wire_client.py",
180
- "sha256": "b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af",
181
- "bytes": 5721,
182
- "role": "execution_adapter",
183
- "parent_sha256": "b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f"
184
- },
185
- {
186
- "path": "upstream/construct-mc-costas-array-l3-s0/environment/Dockerfile",
187
- "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
188
- "bytes": 389,
189
- "role": "original_task_source",
190
- "source": {
191
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
192
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
193
- "path": "tasks/construct-mc-costas-array-l3-s0/environment/Dockerfile",
194
- "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
195
- "byte_identical": true
196
- }
197
- },
198
- {
199
- "path": "upstream/construct-mc-costas-array-l3-s0/environment/instance.json",
200
- "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5",
201
- "bytes": 98,
202
- "role": "original_task_source",
203
- "source": {
204
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
205
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
206
- "path": "tasks/construct-mc-costas-array-l3-s0/environment/instance.json",
207
- "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5",
208
- "byte_identical": true
209
- }
210
- },
211
- {
212
- "path": "upstream/construct-mc-costas-array-l3-s0/instruction.md",
213
- "sha256": "88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9",
214
- "bytes": 723,
215
- "role": "original_task_source",
216
- "source": {
217
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
218
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
219
- "path": "tasks/construct-mc-costas-array-l3-s0/instruction.md",
220
- "sha256": "88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9",
221
- "byte_identical": true
222
- }
223
- },
224
- {
225
- "path": "upstream/construct-mc-costas-array-l3-s0/task.toml",
226
- "sha256": "b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32",
227
- "bytes": 694,
228
- "role": "original_task_source",
229
- "source": {
230
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
231
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
232
- "path": "tasks/construct-mc-costas-array-l3-s0/task.toml",
233
- "sha256": "b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32",
234
- "byte_identical": true
235
- }
236
- },
237
- {
238
- "path": "upstream/construct-mc-costas-array-l3-s0/tests/check.py",
239
- "sha256": "3c0290e35201f077926099989cd0e82c10bf091cb33c572cacc02bca075debdb",
240
- "bytes": 809,
241
- "role": "original_task_source",
242
- "source": {
243
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
244
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
245
- "path": "tasks/construct-mc-costas-array-l3-s0/tests/check.py",
246
- "sha256": "3c0290e35201f077926099989cd0e82c10bf091cb33c572cacc02bca075debdb",
247
- "byte_identical": true
248
- }
249
- },
250
- {
251
- "path": "upstream/construct-mc-costas-array-l3-s0/tests/instance.json",
252
- "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5",
253
- "bytes": 98,
254
- "role": "original_task_source",
255
- "source": {
256
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
257
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
258
- "path": "tasks/construct-mc-costas-array-l3-s0/tests/instance.json",
259
- "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5",
260
- "byte_identical": true
261
- }
262
- },
263
- {
264
- "path": "upstream/construct-mc-costas-array-l3-s0/tests/run.py",
265
- "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
266
- "bytes": 4652,
267
- "role": "original_task_source",
268
- "source": {
269
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
270
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
271
- "path": "tasks/construct-mc-costas-array-l3-s0/tests/run.py",
272
- "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
273
- "byte_identical": true
274
- }
275
- },
276
- {
277
- "path": "upstream/construct-mc-costas-array-l3-s0/tests/test.sh",
278
- "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
279
- "bytes": 391,
280
- "role": "original_task_source",
281
- "source": {
282
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
283
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
284
- "path": "tasks/construct-mc-costas-array-l3-s0/tests/test.sh",
285
- "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
286
- "byte_identical": true
287
- }
288
- },
289
- {
290
- "path": "upstream/construct-mc-ramsey-l4-s0/environment/Dockerfile",
291
- "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
292
- "bytes": 389,
293
- "role": "original_task_source",
294
- "source": {
295
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
296
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
297
- "path": "tasks/construct-mc-ramsey-l4-s0/environment/Dockerfile",
298
- "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
299
- "byte_identical": true
300
- }
301
- },
302
- {
303
- "path": "upstream/construct-mc-ramsey-l4-s0/environment/instance.json",
304
- "sha256": "9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92",
305
- "bytes": 84,
306
- "role": "original_task_source",
307
- "source": {
308
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
309
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
310
- "path": "tasks/construct-mc-ramsey-l4-s0/environment/instance.json",
311
- "sha256": "9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92",
312
- "byte_identical": true
313
- }
314
- },
315
- {
316
- "path": "upstream/construct-mc-ramsey-l4-s0/instruction.md",
317
- "sha256": "dacf1d28faa912ac766cb9a8859b9a2d08940d2c52a9f8460c85ce0595a16c81",
318
- "bytes": 599,
319
- "role": "original_task_source",
320
- "source": {
321
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
322
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
323
- "path": "tasks/construct-mc-ramsey-l4-s0/instruction.md",
324
- "sha256": "dacf1d28faa912ac766cb9a8859b9a2d08940d2c52a9f8460c85ce0595a16c81",
325
- "byte_identical": true
326
- }
327
- },
328
- {
329
- "path": "upstream/construct-mc-ramsey-l4-s0/task.toml",
330
- "sha256": "d2ea623dfdf1ab4864399d4231f17b7c6800cc73e1ad9d1c583816d149dca377",
331
- "bytes": 672,
332
- "role": "original_task_source",
333
- "source": {
334
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
335
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
336
- "path": "tasks/construct-mc-ramsey-l4-s0/task.toml",
337
- "sha256": "d2ea623dfdf1ab4864399d4231f17b7c6800cc73e1ad9d1c583816d149dca377",
338
- "byte_identical": true
339
- }
340
- },
341
- {
342
- "path": "upstream/construct-mc-ramsey-l4-s0/tests/check.py",
343
- "sha256": "923f9e1258610a3cc3d5c2984b1855ed7341af13bc7592ff42aed0e0f91fc74d",
344
- "bytes": 1220,
345
- "role": "original_task_source",
346
- "source": {
347
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
348
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
349
- "path": "tasks/construct-mc-ramsey-l4-s0/tests/check.py",
350
- "sha256": "923f9e1258610a3cc3d5c2984b1855ed7341af13bc7592ff42aed0e0f91fc74d",
351
- "byte_identical": true
352
- }
353
- },
354
- {
355
- "path": "upstream/construct-mc-ramsey-l4-s0/tests/instance.json",
356
- "sha256": "9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92",
357
- "bytes": 84,
358
- "role": "original_task_source",
359
- "source": {
360
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
361
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
362
- "path": "tasks/construct-mc-ramsey-l4-s0/tests/instance.json",
363
- "sha256": "9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92",
364
- "byte_identical": true
365
- }
366
- },
367
- {
368
- "path": "upstream/construct-mc-ramsey-l4-s0/tests/run.py",
369
- "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
370
- "bytes": 4652,
371
- "role": "original_task_source",
372
- "source": {
373
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
374
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
375
- "path": "tasks/construct-mc-ramsey-l4-s0/tests/run.py",
376
- "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
377
- "byte_identical": true
378
- }
379
- },
380
- {
381
- "path": "upstream/construct-mc-ramsey-l4-s0/tests/test.sh",
382
- "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
383
- "bytes": 391,
384
- "role": "original_task_source",
385
- "source": {
386
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
387
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
388
- "path": "tasks/construct-mc-ramsey-l4-s0/tests/test.sh",
389
- "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
390
- "byte_identical": true
391
- }
392
- },
393
- {
394
- "path": "upstream/construct-mc-social-golfers-l4-s0/environment/Dockerfile",
395
- "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
396
- "bytes": 389,
397
- "role": "original_task_source",
398
- "source": {
399
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
400
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
401
- "path": "tasks/construct-mc-social-golfers-l4-s0/environment/Dockerfile",
402
- "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
403
- "byte_identical": true
404
- }
405
- },
406
- {
407
- "path": "upstream/construct-mc-social-golfers-l4-s0/environment/instance.json",
408
- "sha256": "cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73",
409
- "bytes": 100,
410
- "role": "original_task_source",
411
- "source": {
412
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
413
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
414
- "path": "tasks/construct-mc-social-golfers-l4-s0/environment/instance.json",
415
- "sha256": "cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73",
416
- "byte_identical": true
417
- }
418
- },
419
- {
420
- "path": "upstream/construct-mc-social-golfers-l4-s0/instruction.md",
421
- "sha256": "a638ef887b79167571086549b8d9438447d07b800772aac868b3e9a2e6899cd2",
422
- "bytes": 560,
423
- "role": "original_task_source",
424
- "source": {
425
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
426
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
427
- "path": "tasks/construct-mc-social-golfers-l4-s0/instruction.md",
428
- "sha256": "a638ef887b79167571086549b8d9438447d07b800772aac868b3e9a2e6899cd2",
429
- "byte_identical": true
430
- }
431
- },
432
- {
433
- "path": "upstream/construct-mc-social-golfers-l4-s0/task.toml",
434
- "sha256": "fb08db6bba18360321c1ac959d0af5f655435579d5cb88864d924897254c7546",
435
- "bytes": 705,
436
- "role": "original_task_source",
437
- "source": {
438
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
439
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
440
- "path": "tasks/construct-mc-social-golfers-l4-s0/task.toml",
441
- "sha256": "fb08db6bba18360321c1ac959d0af5f655435579d5cb88864d924897254c7546",
442
- "byte_identical": true
443
- }
444
- },
445
- {
446
- "path": "upstream/construct-mc-social-golfers-l4-s0/tests/check.py",
447
- "sha256": "9514518058e308fc2ae0ec0b8ce8a50993d5dfa09708ac9c3609e1edbbae126a",
448
- "bytes": 1132,
449
- "role": "original_task_source",
450
- "source": {
451
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
452
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
453
- "path": "tasks/construct-mc-social-golfers-l4-s0/tests/check.py",
454
- "sha256": "9514518058e308fc2ae0ec0b8ce8a50993d5dfa09708ac9c3609e1edbbae126a",
455
- "byte_identical": true
456
- }
457
- },
458
- {
459
- "path": "upstream/construct-mc-social-golfers-l4-s0/tests/instance.json",
460
- "sha256": "cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73",
461
- "bytes": 100,
462
- "role": "original_task_source",
463
- "source": {
464
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
465
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
466
- "path": "tasks/construct-mc-social-golfers-l4-s0/tests/instance.json",
467
- "sha256": "cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73",
468
- "byte_identical": true
469
- }
470
- },
471
- {
472
- "path": "upstream/construct-mc-social-golfers-l4-s0/tests/run.py",
473
- "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
474
- "bytes": 4652,
475
- "role": "original_task_source",
476
- "source": {
477
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
478
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
479
- "path": "tasks/construct-mc-social-golfers-l4-s0/tests/run.py",
480
- "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
481
- "byte_identical": true
482
- }
483
- },
484
- {
485
- "path": "upstream/construct-mc-social-golfers-l4-s0/tests/test.sh",
486
- "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
487
- "bytes": 391,
488
- "role": "original_task_source",
489
- "source": {
490
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
491
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
492
- "path": "tasks/construct-mc-social-golfers-l4-s0/tests/test.sh",
493
- "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
494
- "byte_identical": true
495
- }
496
- },
497
- {
498
- "path": "upstream/construct-rlve-round-robin-scores-l3-s0/environment/Dockerfile",
499
- "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
500
- "bytes": 389,
501
- "role": "original_task_source",
502
- "source": {
503
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
504
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
505
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0/environment/Dockerfile",
506
- "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
507
- "byte_identical": true
508
- }
509
- },
510
- {
511
- "path": "upstream/construct-rlve-round-robin-scores-l3-s0/environment/instance.json",
512
- "sha256": "b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a",
513
- "bytes": 99,
514
- "role": "original_task_source",
515
- "source": {
516
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
517
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
518
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0/environment/instance.json",
519
- "sha256": "b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a",
520
- "byte_identical": true
521
- }
522
- },
523
- {
524
- "path": "upstream/construct-rlve-round-robin-scores-l3-s0/instruction.md",
525
- "sha256": "db8d002ee820a699d6b7b819cb88ed583990529649255af446c22c98889ad370",
526
- "bytes": 579,
527
- "role": "original_task_source",
528
- "source": {
529
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
530
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
531
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0/instruction.md",
532
- "sha256": "db8d002ee820a699d6b7b819cb88ed583990529649255af446c22c98889ad370",
533
- "byte_identical": true
534
- }
535
- },
536
- {
537
- "path": "upstream/construct-rlve-round-robin-scores-l3-s0/task.toml",
538
- "sha256": "d42f4225ae8850e6abe3e1b612b0da6f2e896322a3e9e00e6addb988a8f8332a",
539
- "bytes": 741,
540
- "role": "original_task_source",
541
- "source": {
542
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
543
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
544
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0/task.toml",
545
- "sha256": "d42f4225ae8850e6abe3e1b612b0da6f2e896322a3e9e00e6addb988a8f8332a",
546
- "byte_identical": true
547
- }
548
- },
549
- {
550
- "path": "upstream/construct-rlve-round-robin-scores-l3-s0/tests/check.py",
551
- "sha256": "930cd10836482427303a497cfa896934ccdc24116879eaa4c5d32a572d01353c",
552
- "bytes": 820,
553
- "role": "original_task_source",
554
- "source": {
555
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
556
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
557
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0/tests/check.py",
558
- "sha256": "930cd10836482427303a497cfa896934ccdc24116879eaa4c5d32a572d01353c",
559
- "byte_identical": true
560
- }
561
- },
562
- {
563
- "path": "upstream/construct-rlve-round-robin-scores-l3-s0/tests/instance.json",
564
- "sha256": "b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a",
565
- "bytes": 99,
566
- "role": "original_task_source",
567
- "source": {
568
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
569
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
570
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0/tests/instance.json",
571
- "sha256": "b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a",
572
- "byte_identical": true
573
- }
574
- },
575
- {
576
- "path": "upstream/construct-rlve-round-robin-scores-l3-s0/tests/run.py",
577
- "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
578
- "bytes": 4652,
579
- "role": "original_task_source",
580
- "source": {
581
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
582
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
583
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0/tests/run.py",
584
- "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
585
- "byte_identical": true
586
- }
587
- },
588
- {
589
- "path": "upstream/construct-rlve-round-robin-scores-l3-s0/tests/test.sh",
590
- "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
591
- "bytes": 391,
592
- "role": "original_task_source",
593
- "source": {
594
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
595
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
596
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0/tests/test.sh",
597
- "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
598
- "byte_identical": true
599
- }
600
- }
601
- ],
602
- "current_image_manifest_digest": "sha256:f34456686c33c9b4cb56b854231ac18bb54abcd295e7cb3cad5b7f41d04a810c"
603
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
components/math/MANIFEST.json DELETED
@@ -1,58 +0,0 @@
1
- {
2
- "SOURCE.json": "a91ceb6c6b39e532fbef753034f1979d2364672d9bb6a45395c946dd8208befd",
3
- "config.json": "190f2c6c257c0cbc4cb6bfa2efe8e5fdca221b1c18b39aa70331781f2be79afa",
4
- "NOTICE.txt": "73b544ecebc5d10e34e72f187bfdccf8ad66c9df4c37b03eeca7323a12401248",
5
- "SDK_DEPENDENCIES.json": "a037cf3ce617aa3e0216bf5e0677d229679bfffdd30dba9057b58bb413c39732",
6
- "TASKS.json": "fe67677e50ff773b044feb9122e26a4dbb1dc647a5c88ba9db0adf952167104a",
7
- "ADAPTATIONS.txt": "67afb4d3cf0def4023ec8a5320476a19e813d48fc4772a043e2ae991817928e3",
8
- "FILE_ALLOWLIST.json": "f447268ed179fc7f665bc58d47fafa01816a052aed273b9a6175876e9eddf241",
9
- "licenses/RLVE-LICENSE": "10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e",
10
- "licenses/MathConstraint-LICENSE": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94",
11
- "licenses/UPSTREAM_COLLECTION_LICENSES.md": "200b2ce93f2a5b9671165f9aea3cc4d89db995352c1e1e3db6d418262b058516",
12
- "upstream/construct-rlve-round-robin-scores-l3-s0/instruction.md": "db8d002ee820a699d6b7b819cb88ed583990529649255af446c22c98889ad370",
13
- "upstream/construct-rlve-round-robin-scores-l3-s0/task.toml": "d42f4225ae8850e6abe3e1b612b0da6f2e896322a3e9e00e6addb988a8f8332a",
14
- "upstream/construct-mc-costas-array-l3-s0/instruction.md": "88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9",
15
- "upstream/construct-mc-costas-array-l3-s0/task.toml": "b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32",
16
- "upstream/construct-mc-social-golfers-l4-s0/instruction.md": "a638ef887b79167571086549b8d9438447d07b800772aac868b3e9a2e6899cd2",
17
- "upstream/construct-mc-social-golfers-l4-s0/task.toml": "fb08db6bba18360321c1ac959d0af5f655435579d5cb88864d924897254c7546",
18
- "upstream/construct-mc-ramsey-l4-s0/instruction.md": "dacf1d28faa912ac766cb9a8859b9a2d08940d2c52a9f8460c85ce0595a16c81",
19
- "upstream/construct-mc-ramsey-l4-s0/task.toml": "d2ea623dfdf1ab4864399d4231f17b7c6800cc73e1ad9d1c583816d149dca377",
20
- "upstream/construct-mc-ramsey-l4-s0/tests/run.py": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
21
- "upstream/construct-mc-ramsey-l4-s0/tests/check.py": "923f9e1258610a3cc3d5c2984b1855ed7341af13bc7592ff42aed0e0f91fc74d",
22
- "upstream/construct-mc-ramsey-l4-s0/tests/instance.json": "9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92",
23
- "upstream/construct-mc-ramsey-l4-s0/tests/test.sh": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
24
- "upstream/construct-mc-ramsey-l4-s0/environment/Dockerfile": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
25
- "upstream/construct-mc-ramsey-l4-s0/environment/instance.json": "9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92",
26
- "upstream/construct-mc-social-golfers-l4-s0/tests/run.py": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
27
- "upstream/construct-mc-social-golfers-l4-s0/tests/check.py": "9514518058e308fc2ae0ec0b8ce8a50993d5dfa09708ac9c3609e1edbbae126a",
28
- "upstream/construct-mc-social-golfers-l4-s0/tests/instance.json": "cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73",
29
- "upstream/construct-mc-social-golfers-l4-s0/tests/test.sh": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
30
- "upstream/construct-mc-social-golfers-l4-s0/environment/Dockerfile": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
31
- "upstream/construct-mc-social-golfers-l4-s0/environment/instance.json": "cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73",
32
- "upstream/construct-mc-costas-array-l3-s0/tests/run.py": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
33
- "upstream/construct-mc-costas-array-l3-s0/tests/check.py": "3c0290e35201f077926099989cd0e82c10bf091cb33c572cacc02bca075debdb",
34
- "upstream/construct-mc-costas-array-l3-s0/tests/instance.json": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5",
35
- "upstream/construct-mc-costas-array-l3-s0/tests/test.sh": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
36
- "upstream/construct-mc-costas-array-l3-s0/environment/Dockerfile": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
37
- "upstream/construct-mc-costas-array-l3-s0/environment/instance.json": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5",
38
- "upstream/construct-rlve-round-robin-scores-l3-s0/tests/run.py": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
39
- "upstream/construct-rlve-round-robin-scores-l3-s0/tests/check.py": "930cd10836482427303a497cfa896934ccdc24116879eaa4c5d32a572d01353c",
40
- "upstream/construct-rlve-round-robin-scores-l3-s0/tests/instance.json": "b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a",
41
- "upstream/construct-rlve-round-robin-scores-l3-s0/tests/test.sh": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
42
- "upstream/construct-rlve-round-robin-scores-l3-s0/environment/Dockerfile": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c",
43
- "upstream/construct-rlve-round-robin-scores-l3-s0/environment/instance.json": "b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a",
44
- "runtime/native_shell/server.py": "c8bb079f359fe4ac6c1764cbf47fdcfaa3f3caee35ff6c41e845bee3e965d454",
45
- "runtime/native_shell/backend.py": "0b2d9a50ee5d97721a7ca24b728687a9bab474b33e788524118625ebc346ad0e",
46
- "runtime/native_shell/launch_service.py": "db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b",
47
- "runtime/native_shell/wire_client.py": "b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af",
48
- "runtime/native_shell/__init__.py": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
49
- "runtime/native_shell/verifier_launcher.py": "6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465",
50
- "runtime/native_shell/environment.py": "cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53",
51
- "runtime/native_shell/guard.py": "31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e",
52
- "runtime/native_shell/actor_launcher.py": "80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3",
53
- "runtime/common/models.py": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a",
54
- "runtime/common/__init__.py": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b",
55
- "runtime/common/http_routes.py": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e",
56
- "runtime/common/contracts.py": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1",
57
- "runtime/native_shell/process_scope.py": "1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e"
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
components/math/NOTICE.txt CHANGED
@@ -1,5 +1,3 @@
1
- Original mathematical construction tasks.
2
- Published by amphora; see SOURCE.json for the immutable dataset revision.
3
- Costas array, Ramsey edge colouring and social golfers originate in MathConstraint by Viresh Pati and contributors, https://github.com/vireshpati/Math-Constraint, CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/legalcode).
4
- Tournament score realisation originates in RLVE-Gym by Zhiyuan Zeng and contributors, https://github.com/Zhiyuan-Zeng/RLVE, MIT. Original copyright notices are preserved in licenses/.
5
- The Harbor publisher adapted upstream checkers; we preserve that published version byte for byte. Our adaptation is limited to the OpenEnv interface and isolated execution.
 
1
+ Costas array task published by amphora; immutable revision in SOURCE.json.
2
+ Original source: MathConstraint by Viresh Pati and contributors, https://github.com/vireshpati/Math-Constraint. License: CC BY 4.0.
3
+ The original prompt, instance and checker are preserved. OpenEnv transport and isolated execution are local adaptations.
 
 
components/math/SOURCE.json CHANGED
@@ -7,22 +7,14 @@
7
  "task_id": "construct-mc-costas-array-l3-s0",
8
  "source": "MathConstraint",
9
  "license": "CC-BY-4.0"
10
- },
11
- {
12
- "task_id": "construct-mc-ramsey-l4-s0",
13
- "source": "MathConstraint",
14
- "license": "CC-BY-4.0"
15
- },
16
- {
17
- "task_id": "construct-rlve-round-robin-scores-l3-s0",
18
- "source": "RLVE-Gym/round_robin",
19
- "license": "MIT"
20
- },
21
- {
22
- "task_id": "construct-mc-social-golfers-l4-s0",
23
- "source": "MathConstraint",
24
- "license": "CC-BY-4.0"
25
  }
26
  ],
27
- "adaptation": "Original prompts, instances and checker files unchanged. Shared OpenEnv action/observation and isolated shell execution added. Original task workspace and no-network policy preserved. Upstream solution scripts omitted from runtime and this source component."
28
- }
 
 
 
 
 
 
 
 
7
  "task_id": "construct-mc-costas-array-l3-s0",
8
  "source": "MathConstraint",
9
  "license": "CC-BY-4.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
  ],
12
+ "adaptation": "Original prompts, instances and checker files unchanged. Shared OpenEnv action/observation and isolated shell execution added. Original task workspace and no-network policy preserved. Upstream solution scripts omitted from runtime and this source component.",
13
+ "inventory": "../../SOURCE_LOCK.json",
14
+ "execution_limits": {
15
+ "commands": 64,
16
+ "command_timeout_seconds": 90,
17
+ "verifier_timeout_cap_seconds": 90,
18
+ "finish_after_command_budget": "separate_request"
19
+ }
20
+ }
components/math/TASKS.json CHANGED
@@ -2,7 +2,6 @@
2
  "tasks": [
3
  {
4
  "task_id": "construct-mc-costas-array-l3-s0",
5
- "selection": "primary_candidate",
6
  "interface": {
7
  "operations": [
8
  "exec",
@@ -11,13 +10,16 @@
11
  "workspace": "/workdir",
12
  "input": "/workdir/instance.json",
13
  "output": "/workdir/answer.json",
14
- "network": false
 
15
  },
16
  "resources": {
17
  "cpus": 2,
18
  "memory_mb": 4096,
19
  "agent_timeout_sec": 900.0,
20
- "verifier_timeout_sec": 300.0
 
 
21
  },
22
  "source": {
23
  "repo": "amphora/MathConstructOptimize-Envs-harbor",
@@ -26,94 +28,14 @@
26
  "original_family": "MathConstraint/costas_array",
27
  "license": "CC-BY-4.0"
28
  },
29
- "model_evidence": "Old exact-task API records available, differing profiles; no new official wire performance claim."
30
- },
31
- {
32
- "task_id": "construct-mc-ramsey-l4-s0",
33
- "selection": "primary_candidate",
34
- "interface": {
35
- "operations": [
36
- "exec",
37
- "finish"
38
- ],
39
- "workspace": "/workdir",
40
- "input": "/workdir/instance.json",
41
- "output": "/workdir/answer.json",
42
- "network": false
43
- },
44
- "resources": {
45
  "cpus": 2,
46
  "memory_mb": 4096,
47
  "agent_timeout_sec": 900.0,
48
  "verifier_timeout_sec": 300.0
49
- },
50
- "source": {
51
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
52
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
53
- "path": "tasks/construct-mc-ramsey-l4-s0",
54
- "original_family": "MathConstraint/ramsey",
55
- "license": "CC-BY-4.0"
56
- },
57
- "model_evidence": "No valid target-model calibration for this exact task; original-checker and actual wire CPU controls only."
58
- },
59
- {
60
- "task_id": "construct-rlve-round-robin-scores-l3-s0",
61
- "selection": "available_not_selected",
62
- "interface": {
63
- "operations": [
64
- "exec",
65
- "finish"
66
- ],
67
- "workspace": "/workdir",
68
- "input": "/workdir/instance.json",
69
- "output": "/workdir/answer.json",
70
- "network": false
71
- },
72
- "resources": {
73
- "cpus": 2,
74
- "memory_mb": 4096,
75
- "agent_timeout_sec": 900.0,
76
- "verifier_timeout_sec": 300.0
77
- },
78
- "source": {
79
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
80
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
81
- "path": "tasks/construct-rlve-round-robin-scores-l3-s0",
82
- "original_family": "RLVE-Gym/round_robin",
83
- "license": "MIT"
84
- },
85
- "model_evidence": "No valid target-model calibration for this exact task; original-checker and actual wire CPU controls only."
86
- },
87
- {
88
- "task_id": "construct-mc-social-golfers-l4-s0",
89
- "selection": "primary_candidate",
90
- "interface": {
91
- "operations": [
92
- "exec",
93
- "finish"
94
- ],
95
- "workspace": "/workdir",
96
- "input": "/workdir/instance.json",
97
- "output": "/workdir/answer.json",
98
- "network": false
99
- },
100
- "resources": {
101
- "cpus": 2,
102
- "memory_mb": 4096,
103
- "agent_timeout_sec": 900.0,
104
- "verifier_timeout_sec": 300.0
105
- },
106
- "source": {
107
- "repo": "amphora/MathConstructOptimize-Envs-harbor",
108
- "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7",
109
- "path": "tasks/construct-mc-social-golfers-l4-s0",
110
- "original_family": "MathConstraint/social_golfers",
111
- "license": "CC-BY-4.0"
112
- },
113
- "model_evidence": "No valid target-model calibration for this exact task; original-checker and actual wire CPU controls only."
114
  }
115
  ],
116
  "schema_sha256": "10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4",
117
- "image_task_count": 4,
118
- "selection_is_not_automatically_all_available_tasks": true
119
  }
 
2
  "tasks": [
3
  {
4
  "task_id": "construct-mc-costas-array-l3-s0",
 
5
  "interface": {
6
  "operations": [
7
  "exec",
 
10
  "workspace": "/workdir",
11
  "input": "/workdir/instance.json",
12
  "output": "/workdir/answer.json",
13
+ "network": false,
14
+ "finish_after_command_budget": "separate_request"
15
  },
16
  "resources": {
17
  "cpus": 2,
18
  "memory_mb": 4096,
19
  "agent_timeout_sec": 900.0,
20
+ "verifier_timeout_sec": 90,
21
+ "command_timeout_sec": 90,
22
+ "max_commands": 64
23
  },
24
  "source": {
25
  "repo": "amphora/MathConstructOptimize-Envs-harbor",
 
28
  "original_family": "MathConstraint/costas_array",
29
  "license": "CC-BY-4.0"
30
  },
31
+ "original_limits": {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  "cpus": 2,
33
  "memory_mb": 4096,
34
  "agent_timeout_sec": 900.0,
35
  "verifier_timeout_sec": 300.0
36
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
  ],
39
  "schema_sha256": "10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4",
40
+ "image_task_count": 1
 
41
  }
components/math/config.json CHANGED
@@ -34,111 +34,6 @@
34
  "pristine_sha256": {
35
  "instance.json": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5"
36
  }
37
- },
38
- {
39
- "id": "construct-mc-ramsey-l4-s0",
40
- "source": "/opt/native-shell/tasks/construct-mc-ramsey-l4-s0/source",
41
- "pristine_workspace": "/opt/native-shell/tasks/construct-mc-ramsey-l4-s0/pristine",
42
- "workspace": "/workdir",
43
- "inputs": [
44
- "/workdir/instance.json"
45
- ],
46
- "outputs": [
47
- "/workdir/answer.json"
48
- ],
49
- "editable": [],
50
- "grading_mode": "file-output",
51
- "grader": {
52
- "kind": "original-shell",
53
- "script": "test.sh",
54
- "executes_learner_code": false
55
- },
56
- "python": "/usr/local/bin/python3",
57
- "cpus": 2,
58
- "memory_mb": 4096,
59
- "agent_timeout_sec": 900.0,
60
- "verifier_timeout_sec": 300.0,
61
- "source_sha256": {
62
- "task.toml": "d2ea623dfdf1ab4864399d4231f17b7c6800cc73e1ad9d1c583816d149dca377",
63
- "instruction.md": "dacf1d28faa912ac766cb9a8859b9a2d08940d2c52a9f8460c85ce0595a16c81",
64
- "tests/run.py": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
65
- "tests/check.py": "923f9e1258610a3cc3d5c2984b1855ed7341af13bc7592ff42aed0e0f91fc74d",
66
- "tests/test.sh": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
67
- "tests/instance.json": "9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92"
68
- },
69
- "pristine_sha256": {
70
- "instance.json": "9c2fb12f3e08390c54d4ec516860f404fee82ff0c9d1fdc952364965b6307b92"
71
- }
72
- },
73
- {
74
- "id": "construct-rlve-round-robin-scores-l3-s0",
75
- "source": "/opt/native-shell/tasks/construct-rlve-round-robin-scores-l3-s0/source",
76
- "pristine_workspace": "/opt/native-shell/tasks/construct-rlve-round-robin-scores-l3-s0/pristine",
77
- "workspace": "/workdir",
78
- "inputs": [
79
- "/workdir/instance.json"
80
- ],
81
- "outputs": [
82
- "/workdir/answer.json"
83
- ],
84
- "editable": [],
85
- "grading_mode": "file-output",
86
- "grader": {
87
- "kind": "original-shell",
88
- "script": "test.sh",
89
- "executes_learner_code": false
90
- },
91
- "python": "/usr/local/bin/python3",
92
- "cpus": 2,
93
- "memory_mb": 4096,
94
- "agent_timeout_sec": 900.0,
95
- "verifier_timeout_sec": 300.0,
96
- "source_sha256": {
97
- "task.toml": "d42f4225ae8850e6abe3e1b612b0da6f2e896322a3e9e00e6addb988a8f8332a",
98
- "instruction.md": "db8d002ee820a699d6b7b819cb88ed583990529649255af446c22c98889ad370",
99
- "tests/run.py": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
100
- "tests/check.py": "930cd10836482427303a497cfa896934ccdc24116879eaa4c5d32a572d01353c",
101
- "tests/test.sh": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
102
- "tests/instance.json": "b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a"
103
- },
104
- "pristine_sha256": {
105
- "instance.json": "b8c26f77936e8e23c97ff9488800c364a5c1b8663a93d508500dcde958a4721a"
106
- }
107
- },
108
- {
109
- "id": "construct-mc-social-golfers-l4-s0",
110
- "source": "/opt/native-shell/tasks/construct-mc-social-golfers-l4-s0/source",
111
- "pristine_workspace": "/opt/native-shell/tasks/construct-mc-social-golfers-l4-s0/pristine",
112
- "workspace": "/workdir",
113
- "inputs": [
114
- "/workdir/instance.json"
115
- ],
116
- "outputs": [
117
- "/workdir/answer.json"
118
- ],
119
- "editable": [],
120
- "grading_mode": "file-output",
121
- "grader": {
122
- "kind": "original-shell",
123
- "script": "test.sh",
124
- "executes_learner_code": false
125
- },
126
- "python": "/usr/local/bin/python3",
127
- "cpus": 2,
128
- "memory_mb": 4096,
129
- "agent_timeout_sec": 900.0,
130
- "verifier_timeout_sec": 300.0,
131
- "source_sha256": {
132
- "task.toml": "fb08db6bba18360321c1ac959d0af5f655435579d5cb88864d924897254c7546",
133
- "instruction.md": "a638ef887b79167571086549b8d9438447d07b800772aac868b3e9a2e6899cd2",
134
- "tests/run.py": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73",
135
- "tests/check.py": "9514518058e308fc2ae0ec0b8ce8a50993d5dfa09708ac9c3609e1edbbae126a",
136
- "tests/test.sh": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e",
137
- "tests/instance.json": "cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73"
138
- },
139
- "pristine_sha256": {
140
- "instance.json": "cb27969d6fe8e38fac137b603f5e86da8b5f66023bc8288c6476e1b8881bfe73"
141
- }
142
  }
143
  ],
144
  "private_root": "/opt/native-shell/private",
 
34
  "pristine_sha256": {
35
  "instance.json": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5"
36
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
  ],
39
  "private_root": "/opt/native-shell/private",