diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..a2537b7a9d8af8655ea5a99f6f528ca4d08e8bc8 --- /dev/null +++ b/NOTICE @@ -0,0 +1,4 @@ +Copyright 2026 Syntensor + +This release contains task data, prompts, graders, and reference solutions from Symbolic Life. +Underlying simulators are not included. Third-party dependencies retain their respective licenses. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..63fda0faa85482bddafc9491fe5dd5098bdc8e29 --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +--- +license: apache-2.0 +pretty_name: Physim Reasoning Tasks +language: +- en +size_categories: +- n<1K +task_categories: +- other +tags: +- reinforcement-learning +- agent-evaluation +- harbor +- biology +- physiology +- simulation +configs: +- config_name: default + data_files: + - split: test + path: task_catalog.jsonl +--- + +# Physim Reasoning Tasks + +Ten whole-body physiology tasks. Each task combines interventions across organ systems and asks an agent to predict five downstream changes relative to a matched simulated control. + +The task catalog, model comparison, and project overview are available at [symbolic.life/tasks](https://symbolic.life/tasks). + +## Contents + +- `tasks/`: runnable Harbor tasks, each with an instruction, container environment, verifier, and reference solution. +- `task_catalog.jsonl`: browsable task descriptions and prompts. +- `download/`: the exact task archive served on symbolic.life. +- `benchmark-results.json`: completed six-model benchmark results. + +## Run + +Install Docker and [uv](https://docs.astral.sh/uv/), then run from this repository’s directory: + +```bash +uv run --with harbor==0.23.0 python run_verified.py run --path ./tasks --agent oracle +``` + +To evaluate an agent, configure its provider credentials in your own environment and run: + +```bash +uv run --with harbor==0.23.0 python run_verified.py run --path ./tasks --agent terminus-2 --model PROVIDER/MODEL --ak reasoning_effort=high +``` + +The supplied launcher uses the tested Harbor version and mounts each task’s verifier separately and read-only. Keep `tests/` and `solution/` outside the evaluated agent’s environment. + +## Scoring + +The answer gives increase, decrease, or unchanged for each of five outputs. The task prompt specifies the comparison and unchanged threshold. Output accuracy is the fraction of correct directions; whole-task success requires all five directions to be correct. + +## Results + +Each of the six models completed three attempts per task. The model identifiers and reasoning settings are recorded in `benchmark-results.json`. All recorded scores were independently regraded against the released task files. + +| Model | Correct outputs | Output accuracy | Fully correct attempts | +|---|---:|---:|---:| +| Claude Opus 5 | 73/150 | 48.7% | 0/30 | +| GPT-6 Astra | 69/150 | 46.0% | 0/30 | +| Nemotron 3 Ultra | 68/150 | 45.3% | 0/30 | +| Grok 4.6 | 66/150 | 44.0% | 0/30 | +| Gemini 3.8 Flash | 63/150 | 42.0% | 0/30 | +| Grok 4.7 | 60/150 | 40.0% | 0/30 | + +## Data source + +Reference answers are frozen outputs of a physiological simulation. They are model predictions, rather than measured human outcomes. Running and grading the released tasks does not require access to the simulator or a GPU. + +## License + +The task data, prompts, and included code are released under the [Apache License 2.0](LICENSE). diff --git a/SHA256SUMS b/SHA256SUMS new file mode 100644 index 0000000000000000000000000000000000000000..3843ef8b874260767a641a1c97b7a684eb280340 --- /dev/null +++ b/SHA256SUMS @@ -0,0 +1,98 @@ +cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE +0e80ed7dd436a1d14d3e4ec3d3681cba09929048685fbc36891a89d0157d4ad1 NOTICE +192b5694cbd8b2e0b6905c18ca21df6fea3590eb61287710d422842b47ff8bc0 README.md +8750d52ee493ba69a375b71b1368387463bdcb4cc18887c9f755d60279be29f2 benchmark-results.json +3634fe04c230a333a178688198acae4e5849fe9eb13592c44c33e4c373d24f6c download/physim-10-tasks.zip +0bdf87b86e4cb06e0e47ca6d5e38d59d4155a3d43e595d5b983a8dfe4bc23d72 requirements.txt +18270627b778ea6e57689a1400011dbf6c37166a686d845a99f04a16ad177f55 run_verified.py +5ad98c1493d642688e9ced1b2325aba158f70852a507fb01082540aa02878e50 task_catalog.jsonl +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/meat-bro/environment/Dockerfile +a5abedb570cd5c667a8b84fc4866aceacdf90772f492c1e3fc0df67a5bc3a912 tasks/meat-bro/instruction.md +d9e23f7b68fb6a27ea8b2d67dca4a23e7f25c3d59fc0b7ca1aa6417594a330e8 tasks/meat-bro/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/meat-bro/solution/solve.sh +874406af167e870f180a897894c6a71fa31f62e5119505bdd0a72b095aa1c0ac tasks/meat-bro/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/meat-bro/tests/Dockerfile +52894413473b5232d7e56201da982a02c9e22f94438b8601ef6b0593d6a33248 tasks/meat-bro/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/meat-bro/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/meat-bro/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-02/environment/Dockerfile +2c7c0ef3baa3dee0e7f5627e9966aa48789e96e90d3c414c0a5c5b081dd33f5c tasks/scenario-02/instruction.md +25d4b4c8a35aa98bf87725f85f6ea33df7012d3f9c094670beb9e2ea2243aee0 tasks/scenario-02/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-02/solution/solve.sh +31b645327234f7352d1a17a2652f6506081fdec3d52763d654fd563375c1bb18 tasks/scenario-02/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-02/tests/Dockerfile +44a811e335bf026f77d59f6ae05c8585bef5b0ded309b3f478aeb92e84d99e1c tasks/scenario-02/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-02/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-02/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-03/environment/Dockerfile +f1f334c3c9e7997ef42ddf18f5a7c16c675eaa04d112817a9d32cc85fd8984b7 tasks/scenario-03/instruction.md +c6c2c8c37e767341c1b1d61d8e9bc717ec06e0ca6af7f42896ddff6758c537fa tasks/scenario-03/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-03/solution/solve.sh +0d17612be8c0e6fe52fb562ab15f10c4c02ad8c0d98e477512221f6cdaa8933a tasks/scenario-03/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-03/tests/Dockerfile +1d95b9822e8c02d2181f39ab8d5ef385232e0ebfc52b03d9d252110dea5a8ff7 tasks/scenario-03/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-03/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-03/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-07/environment/Dockerfile +7b19b3d86537d37ba92b513539242593a66f5cdbd29e8c5e93a9a02e53b53c30 tasks/scenario-07/instruction.md +96e44c75bb08c9e6f4f756d330cd592d2c621bdfa42ca16eaecad9a9a00963c6 tasks/scenario-07/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-07/solution/solve.sh +1174741cd5dc633546e4fb5736e7c4023fa240f6134a9ca8411058159c16ee97 tasks/scenario-07/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-07/tests/Dockerfile +666569042e8764a121feddb28338e44192856f74872e0479cdd25732c4b60a39 tasks/scenario-07/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-07/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-07/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-09/environment/Dockerfile +43c285b5ceb4ff118692d2dd9e953608fe72ec5655a01fe421555eb16b1e2ac2 tasks/scenario-09/instruction.md +4a28f95799c70459004ba2457972792ac421105daa1f47a329e4f0b6cc76293c tasks/scenario-09/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-09/solution/solve.sh +40d62d3b2a4e3df1a604e1561f8a65f5d211e321e00f0e7f098f2ce46981f81c tasks/scenario-09/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-09/tests/Dockerfile +af9a54fa811f06492f85affaa365159af6bfc56140f254db0e0602b89f126a8a tasks/scenario-09/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-09/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-09/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-11/environment/Dockerfile +b6bc354a3b4208a0d36491cc5cc2c731a6c4f6208d03484a1291ea767f339d1e tasks/scenario-11/instruction.md +db7fb506d6dae356bdf153fb34a9e2fda69c42d6a69befb4784cf5f0ec549ac1 tasks/scenario-11/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-11/solution/solve.sh +cc5a42c3a01cafb06a22f898526675fb6a847809089143b7c270cac2d6a42f54 tasks/scenario-11/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-11/tests/Dockerfile +834e34d1beab6742288f0a8f8900044d0492e5f173f529e6a613a103432c590c tasks/scenario-11/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-11/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-11/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-12/environment/Dockerfile +a5314be83706fb36dc3c63e1800ff6c309f8715ba8bfa15c7327a2390540948c tasks/scenario-12/instruction.md +afa95ae4992c1b5b6328a2eccbef375271ec87d9ca44017ed6741a882e67908c tasks/scenario-12/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-12/solution/solve.sh +d3a421a4b5e8a5d66c547444e83d47b8c710f2e63d6b9b96f4f2c73fc8dcd6f7 tasks/scenario-12/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-12/tests/Dockerfile +ea65885aa197e5106f3477bee89ceb5ba04f2171b60d731bea7ab4b58386aaa7 tasks/scenario-12/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-12/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-12/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-13/environment/Dockerfile +df941c13891ebb3563e7882482bf0eba20029df6bfdd03bf169d9901b88f68e9 tasks/scenario-13/instruction.md +260ea672a2419b41b02641ee562d7f3c145f4cf338882860c0c4953a4dcb29ea tasks/scenario-13/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-13/solution/solve.sh +bd8a38e3abc8488bdd51db88201ba5fc876f78bb56af9911f75570b089236bdc tasks/scenario-13/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-13/tests/Dockerfile +010abd3765c7d0429ae03dd31747669de46c1cc006e96eae06a3f2f72e756c74 tasks/scenario-13/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-13/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-13/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-16/environment/Dockerfile +32842b6c479f5b08b2e67723e54f97a4c2bfcaebf0fcc2b888050d393931e5b8 tasks/scenario-16/instruction.md +8bc13fa41b973e9d6d24dbf169cf572de75dba1cb95a17f355c4063fabba348a tasks/scenario-16/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-16/solution/solve.sh +b5f4f712845ec699cc13d26402495d60f6ab9aa7ebff052e90f2b39c47a199a1 tasks/scenario-16/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-16/tests/Dockerfile +bba5bdec850cbc323024518787a8877186b5bfadd8806d1f02a093e3a5940a39 tasks/scenario-16/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-16/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-16/tests/test.sh +4bd52933a1e611ca108b7048f8e20c3582ccda693fb75502223163e435628c82 tasks/scenario-17/environment/Dockerfile +837a7b75100408d864878d62ccbd8543b9984425985ce13bf42b437601aee26b tasks/scenario-17/instruction.md +7057381df4f210b9471ef6ae0f855129d8f8c4488c2e5050f29fba88ff58e9ba tasks/scenario-17/solution/answer.json +3c58be9d343213bfe1dd8d2938bbc258eca3e897e0bd23abde262981fc911301 tasks/scenario-17/solution/solve.sh +2bfed242e42bd0fba0c66b8726e5c0cdfb4f1697ea016ee90a3289133369b234 tasks/scenario-17/task.toml +36e60881dc8ae65568927fefe0ac84d20db8f8bc46847b4786b9e49fbf8d8104 tasks/scenario-17/tests/Dockerfile +e879c4b6bec854f90c1f5c43c3c24d314f924cafb44a16de4e9fd3230e81b5f9 tasks/scenario-17/tests/answer_key.json +f0d3a647b2ecfdc0a323b950a708537fa400ae618c3522890a73acaac7936b8d tasks/scenario-17/tests/grade.py +aced7598c78540143de6a7a078c01cb8e118ced4cbb75a93069f5ab4bc5024ad tasks/scenario-17/tests/test.sh diff --git a/benchmark-results.json b/benchmark-results.json new file mode 100644 index 0000000000000000000000000000000000000000..31f64445977805e0bea6ec224a4d62d89c0c6f81 --- /dev/null +++ b/benchmark-results.json @@ -0,0 +1,506 @@ +{ + "version": "physim-ten-tasks-20260928", + "task_count": 10, + "attempts_per_task": 3, + "total_attempts": 180, + "models": [ + { + "id": "anthropic/claude-opus-5", + "label": "Claude Opus 5", + "attempts": 30, + "endpoint_correct": 73, + "endpoint_predictions": 150, + "endpoint_accuracy": 0.4866666666666667, + "all_correct": 0, + "whole_task_success": 0.0, + "reasoning_effort": "high", + "per_task": [ + { + "id": "meat-bro", + "title": "Meat Bro", + "attempts": 3, + "endpoint_correct": 9, + "all_correct": 0 + }, + { + "id": "scenario-02", + "title": "Summit Air Scrubber", + "attempts": 3, + "endpoint_correct": 12, + "all_correct": 0 + }, + { + "id": "scenario-03", + "title": "Rescue Basket", + "attempts": 3, + "endpoint_correct": 10, + "all_correct": 0 + }, + { + "id": "scenario-07", + "title": "Heart with a Shortcut", + "attempts": 3, + "endpoint_correct": 10, + "all_correct": 0 + }, + { + "id": "scenario-09", + "title": "Robot Paramedic", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-11", + "title": "Shunt Shutdown", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-12", + "title": "Oxygen-Loop Fault", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-13", + "title": "Centrifuge Saline Bag", + "attempts": 3, + "endpoint_correct": 9, + "all_correct": 0 + }, + { + "id": "scenario-16", + "title": "Sealed Ambulance", + "attempts": 3, + "endpoint_correct": 2, + "all_correct": 0 + }, + { + "id": "scenario-17", + "title": "Cold Transfer", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + } + ] + }, + { + "id": "openai/gpt-6-astra", + "label": "GPT-6 Astra", + "attempts": 30, + "endpoint_correct": 69, + "endpoint_predictions": 150, + "endpoint_accuracy": 0.46, + "all_correct": 0, + "whole_task_success": 0.0, + "reasoning_effort": "max", + "per_task": [ + { + "id": "meat-bro", + "title": "Meat Bro", + "attempts": 3, + "endpoint_correct": 5, + "all_correct": 0 + }, + { + "id": "scenario-02", + "title": "Summit Air Scrubber", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-03", + "title": "Rescue Basket", + "attempts": 3, + "endpoint_correct": 8, + "all_correct": 0 + }, + { + "id": "scenario-07", + "title": "Heart with a Shortcut", + "attempts": 3, + "endpoint_correct": 9, + "all_correct": 0 + }, + { + "id": "scenario-09", + "title": "Robot Paramedic", + "attempts": 3, + "endpoint_correct": 8, + "all_correct": 0 + }, + { + "id": "scenario-11", + "title": "Shunt Shutdown", + "attempts": 3, + "endpoint_correct": 10, + "all_correct": 0 + }, + { + "id": "scenario-12", + "title": "Oxygen-Loop Fault", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-13", + "title": "Centrifuge Saline Bag", + "attempts": 3, + "endpoint_correct": 5, + "all_correct": 0 + }, + { + "id": "scenario-16", + "title": "Sealed Ambulance", + "attempts": 3, + "endpoint_correct": 5, + "all_correct": 0 + }, + { + "id": "scenario-17", + "title": "Cold Transfer", + "attempts": 3, + "endpoint_correct": 10, + "all_correct": 0 + } + ] + }, + { + "id": "nvidia/nemotron-3-ultra-550b-a55b", + "label": "Nemotron 3 Ultra", + "attempts": 30, + "endpoint_correct": 68, + "endpoint_predictions": 150, + "endpoint_accuracy": 0.4533333333333333, + "all_correct": 0, + "whole_task_success": 0.0, + "reasoning_effort": "high", + "per_task": [ + { + "id": "meat-bro", + "title": "Meat Bro", + "attempts": 3, + "endpoint_correct": 5, + "all_correct": 0 + }, + { + "id": "scenario-02", + "title": "Summit Air Scrubber", + "attempts": 3, + "endpoint_correct": 12, + "all_correct": 0 + }, + { + "id": "scenario-03", + "title": "Rescue Basket", + "attempts": 3, + "endpoint_correct": 9, + "all_correct": 0 + }, + { + "id": "scenario-07", + "title": "Heart with a Shortcut", + "attempts": 3, + "endpoint_correct": 9, + "all_correct": 0 + }, + { + "id": "scenario-09", + "title": "Robot Paramedic", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-11", + "title": "Shunt Shutdown", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-12", + "title": "Oxygen-Loop Fault", + "attempts": 3, + "endpoint_correct": 5, + "all_correct": 0 + }, + { + "id": "scenario-13", + "title": "Centrifuge Saline Bag", + "attempts": 3, + "endpoint_correct": 10, + "all_correct": 0 + }, + { + "id": "scenario-16", + "title": "Sealed Ambulance", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-17", + "title": "Cold Transfer", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + } + ] + }, + { + "id": "x-ai/grok-4.6", + "label": "Grok 4.6", + "attempts": 30, + "endpoint_correct": 66, + "endpoint_predictions": 150, + "endpoint_accuracy": 0.44, + "all_correct": 0, + "whole_task_success": 0.0, + "reasoning_effort": "high", + "per_task": [ + { + "id": "meat-bro", + "title": "Meat Bro", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-02", + "title": "Summit Air Scrubber", + "attempts": 3, + "endpoint_correct": 12, + "all_correct": 0 + }, + { + "id": "scenario-03", + "title": "Rescue Basket", + "attempts": 3, + "endpoint_correct": 9, + "all_correct": 0 + }, + { + "id": "scenario-07", + "title": "Heart with a Shortcut", + "attempts": 3, + "endpoint_correct": 7, + "all_correct": 0 + }, + { + "id": "scenario-09", + "title": "Robot Paramedic", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-11", + "title": "Shunt Shutdown", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-12", + "title": "Oxygen-Loop Fault", + "attempts": 3, + "endpoint_correct": 5, + "all_correct": 0 + }, + { + "id": "scenario-13", + "title": "Centrifuge Saline Bag", + "attempts": 3, + "endpoint_correct": 9, + "all_correct": 0 + }, + { + "id": "scenario-16", + "title": "Sealed Ambulance", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-17", + "title": "Cold Transfer", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + } + ] + }, + { + "id": "google/gemini-3.8-flash", + "label": "Gemini 3.8 Flash", + "attempts": 30, + "endpoint_correct": 63, + "endpoint_predictions": 150, + "endpoint_accuracy": 0.42, + "all_correct": 0, + "whole_task_success": 0.0, + "reasoning_effort": "high", + "per_task": [ + { + "id": "meat-bro", + "title": "Meat Bro", + "attempts": 3, + "endpoint_correct": 9, + "all_correct": 0 + }, + { + "id": "scenario-02", + "title": "Summit Air Scrubber", + "attempts": 3, + "endpoint_correct": 12, + "all_correct": 0 + }, + { + "id": "scenario-03", + "title": "Rescue Basket", + "attempts": 3, + "endpoint_correct": 8, + "all_correct": 0 + }, + { + "id": "scenario-07", + "title": "Heart with a Shortcut", + "attempts": 3, + "endpoint_correct": 7, + "all_correct": 0 + }, + { + "id": "scenario-09", + "title": "Robot Paramedic", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-11", + "title": "Shunt Shutdown", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-12", + "title": "Oxygen-Loop Fault", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-13", + "title": "Centrifuge Saline Bag", + "attempts": 3, + "endpoint_correct": 7, + "all_correct": 0 + }, + { + "id": "scenario-16", + "title": "Sealed Ambulance", + "attempts": 3, + "endpoint_correct": 1, + "all_correct": 0 + }, + { + "id": "scenario-17", + "title": "Cold Transfer", + "attempts": 3, + "endpoint_correct": 7, + "all_correct": 0 + } + ] + }, + { + "id": "x-ai/grok-4.7", + "label": "Grok 4.7", + "attempts": 30, + "endpoint_correct": 60, + "endpoint_predictions": 150, + "endpoint_accuracy": 0.4, + "all_correct": 0, + "whole_task_success": 0.0, + "reasoning_effort": "high", + "per_task": [ + { + "id": "meat-bro", + "title": "Meat Bro", + "attempts": 3, + "endpoint_correct": 7, + "all_correct": 0 + }, + { + "id": "scenario-02", + "title": "Summit Air Scrubber", + "attempts": 3, + "endpoint_correct": 10, + "all_correct": 0 + }, + { + "id": "scenario-03", + "title": "Rescue Basket", + "attempts": 3, + "endpoint_correct": 10, + "all_correct": 0 + }, + { + "id": "scenario-07", + "title": "Heart with a Shortcut", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-09", + "title": "Robot Paramedic", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-11", + "title": "Shunt Shutdown", + "attempts": 3, + "endpoint_correct": 4, + "all_correct": 0 + }, + { + "id": "scenario-12", + "title": "Oxygen-Loop Fault", + "attempts": 3, + "endpoint_correct": 5, + "all_correct": 0 + }, + { + "id": "scenario-13", + "title": "Centrifuge Saline Bag", + "attempts": 3, + "endpoint_correct": 6, + "all_correct": 0 + }, + { + "id": "scenario-16", + "title": "Sealed Ambulance", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + }, + { + "id": "scenario-17", + "title": "Cold Transfer", + "attempts": 3, + "endpoint_correct": 3, + "all_correct": 0 + } + ] + } + ] +} diff --git a/download/physim-10-tasks.zip b/download/physim-10-tasks.zip new file mode 100644 index 0000000000000000000000000000000000000000..2eab6a8fa0b8ed0f03285499b3e101ae71f59c6e --- /dev/null +++ b/download/physim-10-tasks.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3634fe04c230a333a178688198acae4e5849fe9eb13592c44c33e4c373d24f6c +size 46958 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..b0cb93c642fad4cf4ad392000ff845d72e485e16 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +harbor==0.23.0 diff --git a/run_verified.py b/run_verified.py new file mode 100644 index 0000000000000000000000000000000000000000..4adaffe64452e25ea83e30938e565fec37611a63 --- /dev/null +++ b/run_verified.py @@ -0,0 +1,84 @@ +"""Run Harbor with each task's verifier mounted separately and read-only.""" +from harbor.trial.trial import Trial, ServiceVolumeConfig +from harbor.cli.main import app +from harbor.agents.terminus_2.terminus_2 import Terminus2 +from harbor.models.trajectories import Step +from contextvars import ContextVar +from datetime import datetime, timezone +import json +import litellm + +original_mounts = Trial._verifier_env_mounts + + +def verified_mounts(self, env_config): + mounts = original_mounts(self, env_config) + mounts.append(ServiceVolumeConfig(type='bind', + source=str(self.task.paths.tests_dir.resolve()), + target='/tests', read_only=True)) + return mounts + + +Trial._verifier_env_mounts = verified_mounts + +# Preserve and terminate provider refusals, rather than repeatedly asking the +# same blocked prompt until the eight-hour timeout. No prompts are rewritten, +# no fallback model is selected, and no model answer is synthesized. +last_refusal = ContextVar('last_refusal', default=None) +original_completion = litellm.acompletion +original_interaction = Terminus2._handle_llm_interaction +original_loop = Terminus2._run_agent_loop + + +class ProviderRefusal(Exception): + pass + + +async def completion_with_refusal_record(*args, **kwargs): + last_refusal.set(None) + response = await original_completion(*args, **kwargs) + choice = response['choices'][0] + message = choice['message'] + if choice.get('finish_reason') == 'content_filter': + last_refusal.set(dict(model=response.get('model'), id=response.get('id'), + finish_reason='content_filter', + refusal=message.get('refusal'), + content=message.get('content') or '', + observed_at=datetime.now(timezone.utc).isoformat())) + return response + + +async def interaction_with_refusal_record(self, *args, **kwargs): + result = await original_interaction(self, *args, **kwargs) + refusal = last_refusal.get() + if refusal: + model = refusal['model'] or self._model_name.removeprefix('openrouter/') + self._last_response_model_name = model + self._trajectory_steps.append(Step(step_id=len(self._trajectory_steps) + 1, + timestamp=refusal['observed_at'], source='agent', + model_name=model, message=refusal['content'], + extra={'provider_refusal': refusal})) + (self.logs_dir / 'provider-refusal.json').write_text(json.dumps(refusal, indent=2) + '\n') + raise ProviderRefusal('Provider returned content_filter; no replacement answer generated') + return result + + +async def loop_with_refusal_stop(self, *args, **kwargs): + try: + return await original_loop(self, *args, **kwargs) + except ProviderRefusal: + # Normal task completion lets the unchanged separate grader score the + # actual artifact (normally no answer, hence zero). + return None + + +litellm.acompletion = completion_with_refusal_record +Terminus2._handle_llm_interaction = interaction_with_refusal_record +Terminus2._run_agent_loop = loop_with_refusal_stop + +if __name__ == '__main__': + # Hub downloads may omit executable bits; the verifier mount is read-only. + from pathlib import Path + for script in (Path(__file__).resolve().parent / 'tasks').rglob('*.sh'): + script.chmod(script.stat().st_mode | 0o111) + app() diff --git a/task_catalog.jsonl b/task_catalog.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..f6ba55a0a36ba51eab6513aea9adab4528dee2c7 --- /dev/null +++ b/task_catalog.jsonl @@ -0,0 +1,10 @@ +{"task_id": "meat-bro", "title": "Meat Bro", "description": "Predict the combined effects of pressure, hormone changes, arterial stiffness, and liver impairment.", "instruction": "# Meat Bro under pressure\n\nAn adult male, nicknamed Meat Bro, is obese and has 50% more skeletal muscle\nthan the reference adult male. He eats a normal diet. Both subjects have the\nsame body composition, diet and 24-hour preparation before comparison time zero.\n\nApply these changes together to the intervention subject at time zero:\n\n1. Raise ambient pressure to 2.0 atmospheres absolute while he breathes ordinary\n air containing 21% oxygen. Hold ambient pressure at 2.0 atm for the hour.\n2. Set initial plasma testosterone to 1,000 ng/dL and begin a constant\n testosterone infusion of 11.5929392148 nmol/min.\n3. Set initial epinephrine to five times its pre-intervention concentration and\n begin a constant epinephrine infusion of 1505.45345539 ng/min.\n4. Reduce initial systemic arterial compliance to two-thirds of its reference\n value. No arterial-pressure clamp is applied.\n5. Reduce the liver structural-function factor from 1.0 to 0.1 and hepatic\n thrombopoietin-production capacity to 10% of its reference value.\n\nContinue both infusions throughout the 60-minute comparison. The matched control\nstarts from the identical prepared state and receives none of these five changes.\n\nAt 60 minutes, predict each listed quantity in the intervention subject relative\nto the matched control at that same time.\n\n| Output ID | Quantity | Unit | Unchanged band |\n|---|---|---|---|\n| `pancreatic_flow` | Total pancreatic blood flow | mL/min | 1% of the absolute matched-control value |\n| `cerebral_flow` | Cerebral blood flow | mL/min | 1% of the absolute matched-control value |\n| `aldosterone` | Plasma aldosterone concentration | ng/dL | 1% of the absolute matched-control value |\n| `glucose` | Plasma glucose concentration | mg/dL | 1% of the absolute matched-control value |\n| `thyroid_secretion` | Thyroid hormone secretion rate, combined T4/T3 pool | amount/min | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below\nthe stated band is unchanged.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly\none object per output ID. Each object must contain `id`, `direction`, and a\nnonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/meat-bro", "scored_outputs": 5} +{"task_id": "scenario-02", "title": "Summit Air Scrubber", "description": "Predict the combined effects of altitude, exercise, and altered breathing gas.", "instruction": "# Scenario 02\n\nAn adult male begins awake,\nresting and lying down at sea level in still air at 72°F (22.22°C), 30% relative\nhumidity, wearing normal clothing.\n\n- At 0.1 min, the intervention subject sits and moves to an altitude of 1,000 m.\n- At 5.1 min, altitude becomes 2,000 m; at 10.1 min, it becomes 3,000 m.\n- At 15.1 min, while remaining at 3,000 m, he starts cycling at 75 W and\n 50 revolutions/min, with mechanical efficiency set to 30%. Ambient temperature\n becomes 10°C. He switches to a supplied breathing mixture containing 20.9%\n oxygen, 1.0% carbon dioxide, 0.5381882920494379% water vapor and\n 77.56181170795055% nitrogen. No carbon monoxide or anesthetic gas is supplied.\n Gas is delivered at ambient pressure. These settings continue through 35.1 min.\n\n\nThe matched control starts from the identical state and sits at 0.1 min. It\nremains resting at sea level in 72°F (22.22°C), 30% humidity and breathes ordinary\nambient air throughout; the supplied-gas connection stays off. Clothing and\nstill-air conditions are shared.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_01` | Plasma albumin concentration | 35.1 | 1% of the absolute matched-control value |\n| `output_02` | Total plasma protein concentration | 35.1 | 1% of the absolute matched-control value |\n| `output_03` | Minute ventilation at body conditions | 35.1 | 1% of the absolute matched-control value |\n| `output_04` | Plasma flow through the pancreatic beta-cell compartment | 35.1 | 1% of the absolute matched-control value |\n| `output_05` | Net capillary immunoglobulin G transport rate | 35.1 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-02", "scored_outputs": 5} +{"task_id": "scenario-03", "title": "Rescue Basket", "description": "Predict responses to blood loss, cold, and head-up tilt.", "instruction": "# Scenario 03\n\nAn adult male begins awake,\nresting and lying down at sea level in still air at 72°F (22.22°C), 30% relative\nhumidity, wearing normal clothing.\n\n- From 0.1 to 5.1 min, the intervention subject loses whole blood at a fixed\n 80 mL/min, totaling 400 mL. Bleeding is then stopped. No replacement fluid is given.\n- At 10.1 min, he is secured in a tilt frame at 60° above horizontal. Ambient\n temperature becomes 10°C. He remains at rest under these conditions.\n\n\nThe matched control starts from the identical state and has no blood loss.\nAt 10.1 min it enters the same secured-frame mode at 0° above horizontal and\nremains at 72°F (22.22°C). Humidity, still air and clothing are shared.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_03` | Chloride concentration in urine from the right kidney | 20.1 | 1% of the absolute matched-control value |\n| `output_04` | Total protein concentration in middle-torso lymph | 20.1 | 1% of the absolute matched-control value |\n| `output_13` | Left ventricular end-diastolic blood volume | 20.1 | 1% of the absolute matched-control value |\n| `output_15` | Bicarbonate concentration in urine from the left kidney | 20.1 | 1% of the absolute matched-control value |\n| `output_16` | Sulfate concentration in final urine | 20.1 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-03", "scored_outputs": 5} +{"task_id": "scenario-07", "title": "Heart with a Shortcut", "description": "Predict exercise and recovery responses with weakened heart function and a vascular shunt.", "instruction": "# Scenario 07\n\nAn adult male has a shared\n120-minute preparation before comparison time zero:\n\n- Both ventricular basic-contractility settings are set to 0.70 times their\n reference values and remain at that setting throughout.\n- During the first 30 min, whole blood is removed at 40 mL/min while an equal\n 40 mL/min of plasma with 0% red-cell volume fraction is infused. A total of\n 1,200 mL is exchanged; both flows then stop.\n- The base conductance setting of an arteriovenous fistula is 20 mL/min/mmHg\n for the first 30 min, 50 mL/min/mmHg for the next 30 min and 100 mL/min/mmHg\n for the final 60 min. It stays at 100 mL/min/mmHg during the comparison.\n\nAt comparison time zero, both subjects are at rest with no further blood\nwithdrawal, transfusion or intravenous fluid. At 5 min, the intervention subject\nstarts cycling at 40 W and 50 revolutions/min, with mechanical efficiency set\nto 30%. At 35 min, cycling stops. The matched control starts from the identical\nprepared state and remains at rest. The fistula and ventricular settings are\nshared and unchanged.\n\nBoth subjects retain the lying posture setting throughout preparation and\ncomparison. Cycling is performed without changing that posture.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. Measurements at 35 minutes are taken immediately before cycling stops.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_01` | Skeletal-muscle oxygen consumption rate | 60 | 1% of the absolute matched-control value |\n| `output_02` | Oxygen content of blood leaving adipose tissue | 60 | 1% of the absolute matched-control value |\n| `output_03` | Cardiac output | 35 | 1% of the absolute matched-control value |\n| `output_04` | Ammonium concentration in urine from the right kidney | 60 | 1% of the absolute matched-control value |\n| `output_05` | Total glomerular filtration rate | 35 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-07", "scored_outputs": 5} +{"task_id": "scenario-09", "title": "Robot Paramedic", "description": "Predict responses to saline and mechanical ventilation after blood loss with impaired kidney function.", "instruction": "# Scenario 09\n\nAn adult male has a shared\n150-minute preparation before comparison time zero:\n\n- At the beginning of preparation, each kidney's filtering-nephron percentage\n is set to 50%, with total nephron counts unchanged. This setting is retained.\n- After 120 min, whole blood is removed at 50 mL/min for 15 min, totaling 750 mL.\n Bleeding then stops, followed by 15 min without replacement fluid.\n\nAt 5 min after comparison time zero, the intervention subject receives 0.9%\nsaline containing 154 mmol/L sodium chloride at 50 mL/min. At the same time,\nfixed ventilation is switched on at 12 breaths/min with a 500 mL tidal volume.\nThe saline stops at 35 min after a total of 1,500 mL. The fixed rate and tidal volume continue\nthrough the end of the 60-minute comparison.\n\nThe matched control starts from the identical prepared state, receives no\nreplacement fluid and continues spontaneous breathing. Bleeding remains off\nand the renal settings are shared.\n\nBoth subjects retain the lying posture setting throughout preparation and\ncomparison.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. Measurements at 35 minutes are taken immediately before the saline infusion stops.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_01` | Endogenous estradiol appearance rate | 60 | 1% of the absolute matched-control value |\n| `output_02` | Calcium delivery rate leaving the distal nephron segments of both kidneys | 60 | 1% of the absolute matched-control value |\n| `output_03` | Cerebral blood flow | 35 | 1% of the absolute matched-control value |\n| `output_04` | Extracellular potassium concentration | 35 | 1% of the absolute matched-control value |\n| `output_05` | Ammonium concentration in urine from the right kidney | 60 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-09", "scored_outputs": 5} +{"task_id": "scenario-11", "title": "Shunt Shutdown", "description": "Predict the effects of closing a vascular shunt while changing adrenergic signaling and oxygen supply.", "instruction": "# Scenario 11\n\nAn adult male undergoes a shared 120-minute preparation. Both ventricular basic-contractility settings are 0.70 times their reference values. During the first 30 minutes, whole blood is removed at 40 mL/min and replaced with the same volume of plasma containing no red cells, totaling 1,200 mL exchanged. The base conductance setting of an arteriovenous fistula is 20 mL/min/mmHg for the first 30 minutes, 50 for the next 30, and 100 for the final 60 minutes. Both subjects remain lying down and at rest.\n\nAt comparison time zero, the intervention subject's fistula base-conductance setting is reduced from 100 to zero. The gain on beta-1 adrenergic signaling driven by circulating catecholamines is reduced to 50% of reference, and the subject begins breathing dry 60% oxygen and 40% nitrogen at ambient pressure. These settings are held for 60 minutes, with no further blood withdrawal, transfusion, exercise or intravenous fluid.\n\nThe matched control starts from the identical prepared state, keeps the fistula setting at 100, retains the reference gain on circulating beta-1 adrenergic signaling and continues breathing ordinary ambient air. Both retain the 0.70 ventricular settings and lying posture.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_01` | Total protein concentration in upper-torso interstitial fluid | 60 | 1% of the absolute matched-control value |\n| `output_02` | Glycerol amount in the circulating pool | 60 | 1% of the absolute matched-control value |\n| `output_03` | Thyroid hormone secretion rate, combined T4/T3 | 60 | 1% of the absolute matched-control value |\n| `output_04` | Epinephrine amount in its circulating pool | 60 | 1% of the absolute matched-control value |\n| `output_05` | Circulating estradiol concentration | 60 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-11", "scored_outputs": 5} +{"task_id": "scenario-12", "title": "Oxygen-Loop Fault", "description": "Predict hormonal and metabolic responses to mechanical ventilation with elevated oxygen and carbon dioxide.", "instruction": "# The Oxygen-Loop Fault\n\nAn adult man at rest lies supine at sea level. For one hour, a breathing circuit supplies dry gas containing 60% oxygen, 1% carbon dioxide and 39% nitrogen. Mechanical ventilation delivers 8 breaths per minute with a tidal volume of 700 mL. Room temperature is 22.2 °C. Compare with the same man remaining supine and breathing room air spontaneously for the same hour.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_01` | Vasopressin secretion rate | 60 | 1% of the absolute matched-control value |\n| `output_02` | Hepatic fatty-acid synthesis rate | 60 | 1% of the absolute matched-control value |\n| `output_03` | Circulating epinephrine concentration | 60 | 1% of the absolute matched-control value |\n| `output_04` | Thyroid hormone secretion rate (combined T4/T3 pool) | 60 | 1% of the absolute matched-control value |\n| `output_05` | Systemic venous pressure | 60 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-12", "scored_outputs": 5} +{"task_id": "scenario-13", "title": "Centrifuge Saline Bag", "description": "Predict the combined effects of increased gravity, head-up tilt, supplemental oxygen, and saline.", "instruction": "# The Centrifuge Saline Bag\n\nAn adult man at rest spends one hour restrained at 55 degrees head-up in a centrifuge producing an effective gravity of 1.5 g. He breathes dry 40% oxygen and 60% nitrogen at sea-level pressure and receives 500 mL of 0.9% saline evenly over the hour. Room temperature is 22.2 °C. Compare with the same man remaining supine at 1 g, breathing room air and receiving no infusion.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_02` | Fatty-acid release rate from lipid stores | 60 | 1% of the absolute matched-control value |\n| `output_08` | Middle-torso interstitial albumin concentration | 60 | 1% of the absolute matched-control value |\n| `output_10` | Endogenous dehydroepiandrosterone production rate | 60 | 1% of the absolute matched-control value |\n| `output_12` | Total amount of CO₂ in alveolar gas | 60 | 1% of the absolute matched-control value |\n| `output_13` | Circulating glycerol concentration | 60 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-13", "scored_outputs": 5} +{"task_id": "scenario-16", "title": "Sealed Ambulance", "description": "Predict responses to concentrated saline and altered ventilation after blood loss with impaired kidney function.", "instruction": "# The Sealed Ambulance\n\nAn adult man has half the usual number of filtering nephrons in each kidney. After two hours in this state, he loses 750 mL of whole blood evenly over 15 minutes and rests for 15 minutes after bleeding stops. He then spends one hour supine breathing dry 40% oxygen, 1% carbon dioxide and 59% nitrogen at sea-level pressure, with mechanical ventilation at 12 breaths per minute and 400 mL tidal volume. During that hour he receives 500 mL of saline evenly at a constant rate, containing 345 mmol/L sodium and 345 mmol/L chloride. Compare with a matched man after the same kidney impairment and blood loss who remains supine at sea-level pressure, breathes room air spontaneously, and receives no infusion.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_01` | Portal venous fatty-acid concentration | 60 | 1% of the absolute matched-control value |\n| `output_02` | Albumin amount in upper-torso interstitial fluid | 60 | 1% of the absolute matched-control value |\n| `output_03` | Hepatic venous blood flow | 60 | 1% of the absolute matched-control value |\n| `output_04` | Amount of vasopressin in the undamaged readily releasable stores | 60 | 1% of the absolute matched-control value |\n| `output_05` | Glucagon concentration in pancreatic alpha-cell effluent | 60 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-16", "scored_outputs": 5} +{"task_id": "scenario-17", "title": "Cold Transfer", "description": "Predict the combined effects of cooling, head-up tilt, and supplemental oxygen.", "instruction": "# The Cold Transfer\n\nAn adult man at rest starts supine in a 22.2 °C room, breathing ordinary air at sea-level pressure. At time zero, he is moved into a 15 °C room, restrained at 45 degrees head-up, and supplied dry 60% oxygen and 40% nitrogen. He remains under those conditions for one hour, without exercise, bleeding, transfusion or intravenous fluid. Compare with the same man remaining supine at 22.2 °C and breathing room air for that hour.\n\nPredict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero.\n\n| Output ID | Quantity | Time (min) | Unchanged band |\n|---|---|---:|---|\n| `output_01` | Plasma renin activity | 60 | 1% of the absolute matched-control value |\n| `output_02` | Skin tissue oxygen partial pressure | 60 | 1% of the absolute matched-control value |\n| `output_03` | Oxygen content of blood leaving the liver | 60 | 1% of the absolute matched-control value |\n| `output_04` | Thyroid hormone secretion rate (combined T4/T3 pool) | 60 | 1% of the absolute matched-control value |\n| `output_05` | Blood oxygen content in the left renal tubular vascular compartment | 60 | 1% of the absolute matched-control value |\n\nUse `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control.\n\nWrite `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review.\n\nProduce the answer file before finishing.\n", "task_path": "tasks/scenario-17", "scored_outputs": 5} diff --git a/tasks/meat-bro/environment/Dockerfile b/tasks/meat-bro/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/meat-bro/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/meat-bro/instruction.md b/tasks/meat-bro/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..83a9012c99a16d06d81d17ea01c7b3f7ccb52186 --- /dev/null +++ b/tasks/meat-bro/instruction.md @@ -0,0 +1,41 @@ +# Meat Bro under pressure + +An adult male, nicknamed Meat Bro, is obese and has 50% more skeletal muscle +than the reference adult male. He eats a normal diet. Both subjects have the +same body composition, diet and 24-hour preparation before comparison time zero. + +Apply these changes together to the intervention subject at time zero: + +1. Raise ambient pressure to 2.0 atmospheres absolute while he breathes ordinary + air containing 21% oxygen. Hold ambient pressure at 2.0 atm for the hour. +2. Set initial plasma testosterone to 1,000 ng/dL and begin a constant + testosterone infusion of 11.5929392148 nmol/min. +3. Set initial epinephrine to five times its pre-intervention concentration and + begin a constant epinephrine infusion of 1505.45345539 ng/min. +4. Reduce initial systemic arterial compliance to two-thirds of its reference + value. No arterial-pressure clamp is applied. +5. Reduce the liver structural-function factor from 1.0 to 0.1 and hepatic + thrombopoietin-production capacity to 10% of its reference value. + +Continue both infusions throughout the 60-minute comparison. The matched control +starts from the identical prepared state and receives none of these five changes. + +At 60 minutes, predict each listed quantity in the intervention subject relative +to the matched control at that same time. + +| Output ID | Quantity | Unit | Unchanged band | +|---|---|---|---| +| `pancreatic_flow` | Total pancreatic blood flow | mL/min | 1% of the absolute matched-control value | +| `cerebral_flow` | Cerebral blood flow | mL/min | 1% of the absolute matched-control value | +| `aldosterone` | Plasma aldosterone concentration | ng/dL | 1% of the absolute matched-control value | +| `glucose` | Plasma glucose concentration | mg/dL | 1% of the absolute matched-control value | +| `thyroid_secretion` | Thyroid hormone secretion rate, combined T4/T3 pool | amount/min | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below +the stated band is unchanged. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly +one object per output ID. Each object must contain `id`, `direction`, and a +nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/meat-bro/solution/answer.json b/tasks/meat-bro/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..bd17fec67c465dfffe7c0edc7efa0d80f59c5675 --- /dev/null +++ b/tasks/meat-bro/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "pancreatic_flow", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "cerebral_flow", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "aldosterone", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "glucose", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "thyroid_secretion", + "direction": "decrease", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/meat-bro/solution/solve.sh b/tasks/meat-bro/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/meat-bro/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/meat-bro/task.toml b/tasks/meat-bro/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8f38e7f53dd4b655d7cdac4e41c5623ef5ef2d4b --- /dev/null +++ b/tasks/meat-bro/task.toml @@ -0,0 +1,22 @@ +schema_version = "1.4" + +[task] +name = "symbolic/meat-bro" +version = "0.1.0" +description = "Predict 5 interacting whole-body physiological responses using general tools." +keywords = ["physiology", "systems-reasoning", "nonlinear-interactions"] + +[agent] +timeout_sec = 28800.0 + +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" + +[environment] +build_timeout_sec = 600.0 +cpus = 4 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/meat-bro/tests/Dockerfile b/tasks/meat-bro/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/meat-bro/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/meat-bro/tests/answer_key.json b/tasks/meat-bro/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..36edb54aac3b504bd8cd8612fe63e7ea39fc671f --- /dev/null +++ b/tasks/meat-bro/tests/answer_key.json @@ -0,0 +1,51 @@ +{ + "schema": "symbolic.physim-direction-key.v1", + "relative_deadband": 0.01, + "endpoints": [ + { + "id": "pancreatic_flow", + "label": "total pancreatic blood flow", + "unit": "mL/min", + "source_name": "Pancreas-Flow.TotalFlow", + "control": 81.38067621071116, + "treatment": 65.34178691445167, + "direction": "decrease" + }, + { + "id": "cerebral_flow", + "label": "cerebral blood flow", + "unit": "mL/min", + "source_name": "Brain-Flow.BloodFlow", + "control": 897.9234989824389, + "treatment": 944.9677027089708, + "direction": "increase" + }, + { + "id": "aldosterone", + "label": "plasma aldosterone concentration", + "unit": "ng/dL", + "source_name": "AldoPool.[Aldo(nG/dL)]", + "control": 18.861320882917713, + "treatment": 30.539492698757225, + "direction": "increase" + }, + { + "id": "glucose", + "label": "plasma glucose concentration", + "unit": "mg/dL", + "source_name": "GlucosePool.[Glucose(mG/dL)]", + "control": 96.2409995039251, + "treatment": 105.79726885932288, + "direction": "increase" + }, + { + "id": "thyroid_secretion", + "label": "thyroid hormone secretion rate (combined T4/T3 pool)", + "unit": "model amount/min", + "source_name": "ThyroidSecretion.Rate", + "control": 0.11891525791564994, + "treatment": 0.09736222879053294, + "direction": "decrease" + } + ] +} diff --git a/tasks/meat-bro/tests/grade.py b/tasks/meat-bro/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/meat-bro/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/meat-bro/tests/test.sh b/tasks/meat-bro/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/meat-bro/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-02/environment/Dockerfile b/tasks/scenario-02/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-02/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-02/instruction.md b/tasks/scenario-02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..fee2e70290c7f3076dddd2cde6c01b0af0efd3f9 --- /dev/null +++ b/tasks/scenario-02/instruction.md @@ -0,0 +1,36 @@ +# Scenario 02 + +An adult male begins awake, +resting and lying down at sea level in still air at 72°F (22.22°C), 30% relative +humidity, wearing normal clothing. + +- At 0.1 min, the intervention subject sits and moves to an altitude of 1,000 m. +- At 5.1 min, altitude becomes 2,000 m; at 10.1 min, it becomes 3,000 m. +- At 15.1 min, while remaining at 3,000 m, he starts cycling at 75 W and + 50 revolutions/min, with mechanical efficiency set to 30%. Ambient temperature + becomes 10°C. He switches to a supplied breathing mixture containing 20.9% + oxygen, 1.0% carbon dioxide, 0.5381882920494379% water vapor and + 77.56181170795055% nitrogen. No carbon monoxide or anesthetic gas is supplied. + Gas is delivered at ambient pressure. These settings continue through 35.1 min. + + +The matched control starts from the identical state and sits at 0.1 min. It +remains resting at sea level in 72°F (22.22°C), 30% humidity and breathes ordinary +ambient air throughout; the supplied-gas connection stays off. Clothing and +still-air conditions are shared. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_01` | Plasma albumin concentration | 35.1 | 1% of the absolute matched-control value | +| `output_02` | Total plasma protein concentration | 35.1 | 1% of the absolute matched-control value | +| `output_03` | Minute ventilation at body conditions | 35.1 | 1% of the absolute matched-control value | +| `output_04` | Plasma flow through the pancreatic beta-cell compartment | 35.1 | 1% of the absolute matched-control value | +| `output_05` | Net capillary immunoglobulin G transport rate | 35.1 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-02/solution/answer.json b/tasks/scenario-02/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..d620e37f2924de85b85db35be21afb856d79f366 --- /dev/null +++ b/tasks/scenario-02/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_01", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_02", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_03", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_04", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_05", + "direction": "increase", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-02/solution/solve.sh b/tasks/scenario-02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-02/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-02/task.toml b/tasks/scenario-02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8ce6870c4fc9ca281c1fa258566da229af20ed56 --- /dev/null +++ b/tasks/scenario-02/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-empirical/scenario-2-v3" +version = "5.3.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-02/tests/Dockerfile b/tasks/scenario-02/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-02/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-02/tests/answer_key.json b/tasks/scenario-02/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..d5f5b85af335d2f9094688d90d2d572cd7863938 --- /dev/null +++ b/tasks/scenario-02/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_01", + "direction": "increase" + }, + { + "id": "output_02", + "direction": "increase" + }, + { + "id": "output_03", + "direction": "increase" + }, + { + "id": "output_04", + "direction": "increase" + }, + { + "id": "output_05", + "direction": "increase" + } + ] +} diff --git a/tasks/scenario-02/tests/grade.py b/tasks/scenario-02/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-02/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-02/tests/test.sh b/tasks/scenario-02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-02/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-03/environment/Dockerfile b/tasks/scenario-03/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-03/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-03/instruction.md b/tasks/scenario-03/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..3b61bc83360bcb2068fa576edbfafe7199620eb1 --- /dev/null +++ b/tasks/scenario-03/instruction.md @@ -0,0 +1,31 @@ +# Scenario 03 + +An adult male begins awake, +resting and lying down at sea level in still air at 72°F (22.22°C), 30% relative +humidity, wearing normal clothing. + +- From 0.1 to 5.1 min, the intervention subject loses whole blood at a fixed + 80 mL/min, totaling 400 mL. Bleeding is then stopped. No replacement fluid is given. +- At 10.1 min, he is secured in a tilt frame at 60° above horizontal. Ambient + temperature becomes 10°C. He remains at rest under these conditions. + + +The matched control starts from the identical state and has no blood loss. +At 10.1 min it enters the same secured-frame mode at 0° above horizontal and +remains at 72°F (22.22°C). Humidity, still air and clothing are shared. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_03` | Chloride concentration in urine from the right kidney | 20.1 | 1% of the absolute matched-control value | +| `output_04` | Total protein concentration in middle-torso lymph | 20.1 | 1% of the absolute matched-control value | +| `output_13` | Left ventricular end-diastolic blood volume | 20.1 | 1% of the absolute matched-control value | +| `output_15` | Bicarbonate concentration in urine from the left kidney | 20.1 | 1% of the absolute matched-control value | +| `output_16` | Sulfate concentration in final urine | 20.1 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-03/solution/answer.json b/tasks/scenario-03/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..40d9f0d54e744a971513e7aa8949f86a39fa6eea --- /dev/null +++ b/tasks/scenario-03/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_16", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_13", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_03", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_15", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_04", + "direction": "increase", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-03/solution/solve.sh b/tasks/scenario-03/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-03/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-03/task.toml b/tasks/scenario-03/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b22ad54dcbf2508013c85d8755f7ce62b245b93d --- /dev/null +++ b/tasks/scenario-03/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-empirical/scenario-3" +version = "5.0.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-03/tests/Dockerfile b/tasks/scenario-03/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-03/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-03/tests/answer_key.json b/tasks/scenario-03/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..350efc11882ac890e257b2e23b82857bdb677905 --- /dev/null +++ b/tasks/scenario-03/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_16", + "direction": "increase" + }, + { + "id": "output_13", + "direction": "decrease" + }, + { + "id": "output_03", + "direction": "increase" + }, + { + "id": "output_15", + "direction": "increase" + }, + { + "id": "output_04", + "direction": "increase" + } + ] +} diff --git a/tasks/scenario-03/tests/grade.py b/tasks/scenario-03/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-03/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-03/tests/test.sh b/tasks/scenario-03/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-03/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-07/environment/Dockerfile b/tasks/scenario-07/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-07/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-07/instruction.md b/tasks/scenario-07/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..112742b7c197ba7d9698186413b9a091660847c8 --- /dev/null +++ b/tasks/scenario-07/instruction.md @@ -0,0 +1,39 @@ +# Scenario 07 + +An adult male has a shared +120-minute preparation before comparison time zero: + +- Both ventricular basic-contractility settings are set to 0.70 times their + reference values and remain at that setting throughout. +- During the first 30 min, whole blood is removed at 40 mL/min while an equal + 40 mL/min of plasma with 0% red-cell volume fraction is infused. A total of + 1,200 mL is exchanged; both flows then stop. +- The base conductance setting of an arteriovenous fistula is 20 mL/min/mmHg + for the first 30 min, 50 mL/min/mmHg for the next 30 min and 100 mL/min/mmHg + for the final 60 min. It stays at 100 mL/min/mmHg during the comparison. + +At comparison time zero, both subjects are at rest with no further blood +withdrawal, transfusion or intravenous fluid. At 5 min, the intervention subject +starts cycling at 40 W and 50 revolutions/min, with mechanical efficiency set +to 30%. At 35 min, cycling stops. The matched control starts from the identical +prepared state and remains at rest. The fistula and ventricular settings are +shared and unchanged. + +Both subjects retain the lying posture setting throughout preparation and +comparison. Cycling is performed without changing that posture. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. Measurements at 35 minutes are taken immediately before cycling stops. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_01` | Skeletal-muscle oxygen consumption rate | 60 | 1% of the absolute matched-control value | +| `output_02` | Oxygen content of blood leaving adipose tissue | 60 | 1% of the absolute matched-control value | +| `output_03` | Cardiac output | 35 | 1% of the absolute matched-control value | +| `output_04` | Ammonium concentration in urine from the right kidney | 60 | 1% of the absolute matched-control value | +| `output_05` | Total glomerular filtration rate | 35 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-07/solution/answer.json b/tasks/scenario-07/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..9e0c16ad6a3f3e628e20a41370891ea3b69b2e3c --- /dev/null +++ b/tasks/scenario-07/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_01", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_02", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_03", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_04", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_05", + "direction": "decrease", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-07/solution/solve.sh b/tasks/scenario-07/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-07/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-07/task.toml b/tasks/scenario-07/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f9b6c93cb7e1c1c99752f36b5b6fedaba8646ffb --- /dev/null +++ b/tasks/scenario-07/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-empirical/scenario-7-v2" +version = "5.2.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-07/tests/Dockerfile b/tasks/scenario-07/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-07/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-07/tests/answer_key.json b/tasks/scenario-07/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..338cc6f39e1a370c1a43a85f34d561baac5211ba --- /dev/null +++ b/tasks/scenario-07/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_01", + "direction": "increase" + }, + { + "id": "output_02", + "direction": "increase" + }, + { + "id": "output_03", + "direction": "increase" + }, + { + "id": "output_04", + "direction": "decrease" + }, + { + "id": "output_05", + "direction": "decrease" + } + ] +} diff --git a/tasks/scenario-07/tests/grade.py b/tasks/scenario-07/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-07/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-07/tests/test.sh b/tasks/scenario-07/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-07/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-09/environment/Dockerfile b/tasks/scenario-09/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-09/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-09/instruction.md b/tasks/scenario-09/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..97a2fbc9a4dc05809a3d445d8cf9fdf4034b58ca --- /dev/null +++ b/tasks/scenario-09/instruction.md @@ -0,0 +1,38 @@ +# Scenario 09 + +An adult male has a shared +150-minute preparation before comparison time zero: + +- At the beginning of preparation, each kidney's filtering-nephron percentage + is set to 50%, with total nephron counts unchanged. This setting is retained. +- After 120 min, whole blood is removed at 50 mL/min for 15 min, totaling 750 mL. + Bleeding then stops, followed by 15 min without replacement fluid. + +At 5 min after comparison time zero, the intervention subject receives 0.9% +saline containing 154 mmol/L sodium chloride at 50 mL/min. At the same time, +fixed ventilation is switched on at 12 breaths/min with a 500 mL tidal volume. +The saline stops at 35 min after a total of 1,500 mL. The fixed rate and tidal volume continue +through the end of the 60-minute comparison. + +The matched control starts from the identical prepared state, receives no +replacement fluid and continues spontaneous breathing. Bleeding remains off +and the renal settings are shared. + +Both subjects retain the lying posture setting throughout preparation and +comparison. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. Measurements at 35 minutes are taken immediately before the saline infusion stops. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_01` | Endogenous estradiol appearance rate | 60 | 1% of the absolute matched-control value | +| `output_02` | Calcium delivery rate leaving the distal nephron segments of both kidneys | 60 | 1% of the absolute matched-control value | +| `output_03` | Cerebral blood flow | 35 | 1% of the absolute matched-control value | +| `output_04` | Extracellular potassium concentration | 35 | 1% of the absolute matched-control value | +| `output_05` | Ammonium concentration in urine from the right kidney | 60 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-09/solution/answer.json b/tasks/scenario-09/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..419991595a8878765a32586d79f6532748356a6f --- /dev/null +++ b/tasks/scenario-09/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_01", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_02", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_03", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_04", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_05", + "direction": "increase", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-09/solution/solve.sh b/tasks/scenario-09/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-09/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-09/task.toml b/tasks/scenario-09/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a06ca46d5431b78d284bd26e005ad50581197c53 --- /dev/null +++ b/tasks/scenario-09/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-empirical/scenario-9" +version = "5.1.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-09/tests/Dockerfile b/tasks/scenario-09/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-09/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-09/tests/answer_key.json b/tasks/scenario-09/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..8910f46396770c6d7097f9feeb136197da5a4c54 --- /dev/null +++ b/tasks/scenario-09/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_01", + "direction": "decrease" + }, + { + "id": "output_02", + "direction": "decrease" + }, + { + "id": "output_03", + "direction": "increase" + }, + { + "id": "output_04", + "direction": "decrease" + }, + { + "id": "output_05", + "direction": "increase" + } + ] +} diff --git a/tasks/scenario-09/tests/grade.py b/tasks/scenario-09/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-09/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-09/tests/test.sh b/tasks/scenario-09/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-09/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-11/environment/Dockerfile b/tasks/scenario-11/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-11/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-11/instruction.md b/tasks/scenario-11/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..738a902aa29c5df83a05fc97c6984aa82bf1375c --- /dev/null +++ b/tasks/scenario-11/instruction.md @@ -0,0 +1,23 @@ +# Scenario 11 + +An adult male undergoes a shared 120-minute preparation. Both ventricular basic-contractility settings are 0.70 times their reference values. During the first 30 minutes, whole blood is removed at 40 mL/min and replaced with the same volume of plasma containing no red cells, totaling 1,200 mL exchanged. The base conductance setting of an arteriovenous fistula is 20 mL/min/mmHg for the first 30 minutes, 50 for the next 30, and 100 for the final 60 minutes. Both subjects remain lying down and at rest. + +At comparison time zero, the intervention subject's fistula base-conductance setting is reduced from 100 to zero. The gain on beta-1 adrenergic signaling driven by circulating catecholamines is reduced to 50% of reference, and the subject begins breathing dry 60% oxygen and 40% nitrogen at ambient pressure. These settings are held for 60 minutes, with no further blood withdrawal, transfusion, exercise or intravenous fluid. + +The matched control starts from the identical prepared state, keeps the fistula setting at 100, retains the reference gain on circulating beta-1 adrenergic signaling and continues breathing ordinary ambient air. Both retain the 0.70 ventricular settings and lying posture. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_01` | Total protein concentration in upper-torso interstitial fluid | 60 | 1% of the absolute matched-control value | +| `output_02` | Glycerol amount in the circulating pool | 60 | 1% of the absolute matched-control value | +| `output_03` | Thyroid hormone secretion rate, combined T4/T3 | 60 | 1% of the absolute matched-control value | +| `output_04` | Epinephrine amount in its circulating pool | 60 | 1% of the absolute matched-control value | +| `output_05` | Circulating estradiol concentration | 60 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-11/solution/answer.json b/tasks/scenario-11/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..3209e61526bd9e87cea5bf93a01b20af070d352d --- /dev/null +++ b/tasks/scenario-11/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_01", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_02", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_03", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_04", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_05", + "direction": "decrease", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-11/solution/solve.sh b/tasks/scenario-11/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-11/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-11/task.toml b/tasks/scenario-11/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a8a20ef93ac06ffb4310f562707f095777783217 --- /dev/null +++ b/tasks/scenario-11/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-empirical/scenario-11-v2" +version = "5.2.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-11/tests/Dockerfile b/tasks/scenario-11/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-11/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-11/tests/answer_key.json b/tasks/scenario-11/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..22ee52558490d7ae4d77aced654e6b82da728489 --- /dev/null +++ b/tasks/scenario-11/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_01", + "direction": "decrease" + }, + { + "id": "output_02", + "direction": "increase" + }, + { + "id": "output_03", + "direction": "decrease" + }, + { + "id": "output_04", + "direction": "decrease" + }, + { + "id": "output_05", + "direction": "decrease" + } + ] +} diff --git a/tasks/scenario-11/tests/grade.py b/tasks/scenario-11/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-11/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-11/tests/test.sh b/tasks/scenario-11/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-11/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-12/environment/Dockerfile b/tasks/scenario-12/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-12/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-12/instruction.md b/tasks/scenario-12/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..782dd5ade175ebce32314c0a09e4d2d986f8d478 --- /dev/null +++ b/tasks/scenario-12/instruction.md @@ -0,0 +1,19 @@ +# The Oxygen-Loop Fault + +An adult man at rest lies supine at sea level. For one hour, a breathing circuit supplies dry gas containing 60% oxygen, 1% carbon dioxide and 39% nitrogen. Mechanical ventilation delivers 8 breaths per minute with a tidal volume of 700 mL. Room temperature is 22.2 °C. Compare with the same man remaining supine and breathing room air spontaneously for the same hour. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_01` | Vasopressin secretion rate | 60 | 1% of the absolute matched-control value | +| `output_02` | Hepatic fatty-acid synthesis rate | 60 | 1% of the absolute matched-control value | +| `output_03` | Circulating epinephrine concentration | 60 | 1% of the absolute matched-control value | +| `output_04` | Thyroid hormone secretion rate (combined T4/T3 pool) | 60 | 1% of the absolute matched-control value | +| `output_05` | Systemic venous pressure | 60 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-12/solution/answer.json b/tasks/scenario-12/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..591a0f375f1698b0fb5032a7dab12f6c0b3bd454 --- /dev/null +++ b/tasks/scenario-12/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_01", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_02", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_03", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_04", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_05", + "direction": "increase", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-12/solution/solve.sh b/tasks/scenario-12/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-12/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-12/task.toml b/tasks/scenario-12/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c317b5d5736989314c63a243affd59ab1158795d --- /dev/null +++ b/tasks/scenario-12/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-shipped/scenario-12" +version = "6.0.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-12/tests/Dockerfile b/tasks/scenario-12/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-12/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-12/tests/answer_key.json b/tasks/scenario-12/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..95bfebe5d8242bbb91a03e495948f9d3e9bf46a8 --- /dev/null +++ b/tasks/scenario-12/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_01", + "direction": "decrease" + }, + { + "id": "output_02", + "direction": "increase" + }, + { + "id": "output_03", + "direction": "increase" + }, + { + "id": "output_04", + "direction": "decrease" + }, + { + "id": "output_05", + "direction": "increase" + } + ] +} diff --git a/tasks/scenario-12/tests/grade.py b/tasks/scenario-12/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-12/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-12/tests/test.sh b/tasks/scenario-12/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-12/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-13/environment/Dockerfile b/tasks/scenario-13/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-13/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-13/instruction.md b/tasks/scenario-13/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c38511b015478042d1cf3e232f58e9f09836afd7 --- /dev/null +++ b/tasks/scenario-13/instruction.md @@ -0,0 +1,19 @@ +# The Centrifuge Saline Bag + +An adult man at rest spends one hour restrained at 55 degrees head-up in a centrifuge producing an effective gravity of 1.5 g. He breathes dry 40% oxygen and 60% nitrogen at sea-level pressure and receives 500 mL of 0.9% saline evenly over the hour. Room temperature is 22.2 °C. Compare with the same man remaining supine at 1 g, breathing room air and receiving no infusion. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_02` | Fatty-acid release rate from lipid stores | 60 | 1% of the absolute matched-control value | +| `output_08` | Middle-torso interstitial albumin concentration | 60 | 1% of the absolute matched-control value | +| `output_10` | Endogenous dehydroepiandrosterone production rate | 60 | 1% of the absolute matched-control value | +| `output_12` | Total amount of CO₂ in alveolar gas | 60 | 1% of the absolute matched-control value | +| `output_13` | Circulating glycerol concentration | 60 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-13/solution/answer.json b/tasks/scenario-13/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..4727c24052ffb17ffa2e00d8473a01d63fa9317d --- /dev/null +++ b/tasks/scenario-13/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_02", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_08", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_10", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_12", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_13", + "direction": "increase", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-13/solution/solve.sh b/tasks/scenario-13/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-13/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-13/task.toml b/tasks/scenario-13/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..84281d1dee6394f029b03c3513a897798e0bde82 --- /dev/null +++ b/tasks/scenario-13/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-empirical/scenario-13" +version = "5.0.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-13/tests/Dockerfile b/tasks/scenario-13/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-13/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-13/tests/answer_key.json b/tasks/scenario-13/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..ff0a524ddb6f185d9e6c842fc743830bb72de65a --- /dev/null +++ b/tasks/scenario-13/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_02", + "direction": "increase" + }, + { + "id": "output_08", + "direction": "increase" + }, + { + "id": "output_10", + "direction": "increase" + }, + { + "id": "output_12", + "direction": "decrease" + }, + { + "id": "output_13", + "direction": "increase" + } + ] +} diff --git a/tasks/scenario-13/tests/grade.py b/tasks/scenario-13/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-13/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-13/tests/test.sh b/tasks/scenario-13/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-13/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-16/environment/Dockerfile b/tasks/scenario-16/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-16/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-16/instruction.md b/tasks/scenario-16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..6e58312d2e76ad6e2d04981f66c9b8bf2a022b96 --- /dev/null +++ b/tasks/scenario-16/instruction.md @@ -0,0 +1,19 @@ +# The Sealed Ambulance + +An adult man has half the usual number of filtering nephrons in each kidney. After two hours in this state, he loses 750 mL of whole blood evenly over 15 minutes and rests for 15 minutes after bleeding stops. He then spends one hour supine breathing dry 40% oxygen, 1% carbon dioxide and 59% nitrogen at sea-level pressure, with mechanical ventilation at 12 breaths per minute and 400 mL tidal volume. During that hour he receives 500 mL of saline evenly at a constant rate, containing 345 mmol/L sodium and 345 mmol/L chloride. Compare with a matched man after the same kidney impairment and blood loss who remains supine at sea-level pressure, breathes room air spontaneously, and receives no infusion. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_01` | Portal venous fatty-acid concentration | 60 | 1% of the absolute matched-control value | +| `output_02` | Albumin amount in upper-torso interstitial fluid | 60 | 1% of the absolute matched-control value | +| `output_03` | Hepatic venous blood flow | 60 | 1% of the absolute matched-control value | +| `output_04` | Amount of vasopressin in the undamaged readily releasable stores | 60 | 1% of the absolute matched-control value | +| `output_05` | Glucagon concentration in pancreatic alpha-cell effluent | 60 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-16/solution/answer.json b/tasks/scenario-16/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..286f1a24e0321138fdff940c2a502de948947fe6 --- /dev/null +++ b/tasks/scenario-16/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_01", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_02", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_03", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_04", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_05", + "direction": "increase", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-16/solution/solve.sh b/tasks/scenario-16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-16/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-16/task.toml b/tasks/scenario-16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..64ec63987deeda821ffe559857a4ab4364191502 --- /dev/null +++ b/tasks/scenario-16/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-shipped/scenario-16" +version = "6.0.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-16/tests/Dockerfile b/tasks/scenario-16/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-16/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-16/tests/answer_key.json b/tasks/scenario-16/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..15d3cc089dcc782bd5bbf98faa7f22a954ee583d --- /dev/null +++ b/tasks/scenario-16/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_01", + "direction": "increase" + }, + { + "id": "output_02", + "direction": "decrease" + }, + { + "id": "output_03", + "direction": "decrease" + }, + { + "id": "output_04", + "direction": "increase" + }, + { + "id": "output_05", + "direction": "increase" + } + ] +} diff --git a/tasks/scenario-16/tests/grade.py b/tasks/scenario-16/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-16/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-16/tests/test.sh b/tasks/scenario-16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-16/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py diff --git a/tasks/scenario-17/environment/Dockerfile b/tasks/scenario-17/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3a38098aa4a6578daf919a8809f80b4e6f47c761 --- /dev/null +++ b/tasks/scenario-17/environment/Dockerfile @@ -0,0 +1,4 @@ +FROM python:3.12-slim-bookworm +RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates jq git tmux procps && rm -rf /var/lib/apt/lists/* +WORKDIR /app +RUN mkdir -p /logs/artifacts diff --git a/tasks/scenario-17/instruction.md b/tasks/scenario-17/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..0b11e1107a2b5e215178f13501a2fb4a643675ca --- /dev/null +++ b/tasks/scenario-17/instruction.md @@ -0,0 +1,19 @@ +# The Cold Transfer + +An adult man at rest starts supine in a 22.2 °C room, breathing ordinary air at sea-level pressure. At time zero, he is moved into a 15 °C room, restrained at 45 degrees head-up, and supplied dry 60% oxygen and 40% nitrogen. He remains under those conditions for one hour, without exercise, bleeding, transfusion or intravenous fluid. Compare with the same man remaining supine at 22.2 °C and breathing room air for that hour. + +Predict each listed quantity in the intervention subject relative to the matched control at the stated time. Times are minutes after comparison time zero. + +| Output ID | Quantity | Time (min) | Unchanged band | +|---|---|---:|---| +| `output_01` | Plasma renin activity | 60 | 1% of the absolute matched-control value | +| `output_02` | Skin tissue oxygen partial pressure | 60 | 1% of the absolute matched-control value | +| `output_03` | Oxygen content of blood leaving the liver | 60 | 1% of the absolute matched-control value | +| `output_04` | Thyroid hormone secretion rate (combined T4/T3 pool) | 60 | 1% of the absolute matched-control value | +| `output_05` | Blood oxygen content in the left renal tubular vascular compartment | 60 | 1% of the absolute matched-control value | + +Use `increase`, `decrease`, or `unchanged`. An absolute difference at or below the stated band is unchanged. Relative bands use the contemporaneous control. + +Write `/logs/artifacts/answer.json` with a `predictions` array containing exactly one object per output ID. Each object must contain `id`, `direction`, and a nonempty `explanation`. Directions are scored; explanations are saved for review. + +Produce the answer file before finishing. diff --git a/tasks/scenario-17/solution/answer.json b/tasks/scenario-17/solution/answer.json new file mode 100644 index 0000000000000000000000000000000000000000..888a8dc159b2fdb7a46fa3c19d57ed4f7178f7e8 --- /dev/null +++ b/tasks/scenario-17/solution/answer.json @@ -0,0 +1,29 @@ +{ + "predictions": [ + { + "id": "output_01", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_02", + "direction": "increase", + "explanation": "Reference answer." + }, + { + "id": "output_03", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_04", + "direction": "decrease", + "explanation": "Reference answer." + }, + { + "id": "output_05", + "direction": "decrease", + "explanation": "Reference answer." + } + ] +} diff --git a/tasks/scenario-17/solution/solve.sh b/tasks/scenario-17/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c5c3a75a6871fc8c8f81c23dcf0e905e60543bd7 --- /dev/null +++ b/tasks/scenario-17/solution/solve.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /logs/artifacts +cp /solution/answer.json /logs/artifacts/answer.json diff --git a/tasks/scenario-17/task.toml b/tasks/scenario-17/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..08437ce185d13484059f870b802c44fba928cf0b --- /dev/null +++ b/tasks/scenario-17/task.toml @@ -0,0 +1,19 @@ +schema_version = "1.4" +[task] +name = "wholebody-empirical/scenario-17" +version = "5.1.0" +description = "Predict the specified physiological outputs from the scenario inputs." +keywords = ["physiology", "systems-reasoning"] +[agent] +timeout_sec = 28800.0 +[verifier] +timeout_sec = 60.0 +environment_mode = "separate" +network_mode = "no-network" +[environment] +build_timeout_sec = 600.0 +cpus = 4 +gpus = 0 +memory_mb = 2048 +storage_mb = 4096 +network_mode = "public" diff --git a/tasks/scenario-17/tests/Dockerfile b/tasks/scenario-17/tests/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78d98640a56e3e909f7bf98e9ed232d4e87a69d2 --- /dev/null +++ b/tasks/scenario-17/tests/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.12-slim-bookworm +COPY . /tests/ diff --git a/tasks/scenario-17/tests/answer_key.json b/tasks/scenario-17/tests/answer_key.json new file mode 100644 index 0000000000000000000000000000000000000000..4e2335fff4add6917a256c5d95a666bcf3a55151 --- /dev/null +++ b/tasks/scenario-17/tests/answer_key.json @@ -0,0 +1,25 @@ +{ + "schema": "wholebody.frozen-direction-key.v1", + "endpoints": [ + { + "id": "output_01", + "direction": "increase" + }, + { + "id": "output_02", + "direction": "increase" + }, + { + "id": "output_03", + "direction": "decrease" + }, + { + "id": "output_04", + "direction": "decrease" + }, + { + "id": "output_05", + "direction": "decrease" + } + ] +} diff --git a/tasks/scenario-17/tests/grade.py b/tasks/scenario-17/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..17dae169d24a17624bf7ab29a9344dc06760d672 --- /dev/null +++ b/tasks/scenario-17/tests/grade.py @@ -0,0 +1,42 @@ +"""Run only in Harbor's separate verifier; never execute submission code.""" +import json +from pathlib import Path + +def grade(answer, key): + wanted={item['id']:item['direction'] for item in key['endpoints']} + try: + if not isinstance(answer,dict) or set(answer)!={'predictions'}:raise ValueError('Expected predictions object') + rows=answer['predictions'] + if not isinstance(rows,list) or len(rows)!=len(wanted):raise ValueError('Wrong endpoint count') + found={} + for row in rows: + if not isinstance(row,dict) or set(row)!={'id','direction','explanation'}:raise ValueError('Invalid prediction fields') + name=row['id'] + if not isinstance(name,str) or name not in wanted or name in found:raise ValueError('Unknown or duplicate endpoint') + if row['direction'] not in ('increase','decrease','unchanged'):raise ValueError('Invalid direction') + if not isinstance(row['explanation'],str) or not row['explanation'].strip():raise ValueError('Explanation required') + found[name]=row['direction'] + scores={name:int(found[name]==truth) for name,truth in wanted.items()} + return {'accuracy':sum(scores.values())/len(scores),'all_correct':int(all(scores.values()))}, {'valid_submission':True,'correct':scores} + except (KeyError,TypeError,ValueError) as error: + return {'accuracy':0.0,'all_correct':0}, {'valid_submission':False,'error':str(error)} + +if __name__=='__main__': + key=json.loads((Path(__file__).parent/'answer_key.json').read_text()) + output=Path('/logs/verifier');output.mkdir(parents=True,exist_ok=True) + try: + path=Path('/logs/artifacts/answer.json') + if path.is_symlink() or path.stat().st_size>65536:raise ValueError('Submission must be a regular JSON file under 64 KiB') + def pairs(items): + result={} + for k,v in items: + if k in result:raise ValueError('Duplicate JSON key') + result[k]=v + return result + answer=json.loads(path.read_text(),object_pairs_hook=pairs) + reward,details=grade(answer,key) + except (OSError,ValueError) as error: + reward,details={'accuracy':0.0,'all_correct':0},{'valid_submission':False,'error':str(error)} + (output/'reward.json').write_text(json.dumps(reward)+'\n') + (output/'details.json').write_text(json.dumps(details)+'\n') + print(json.dumps(reward)) diff --git a/tasks/scenario-17/tests/test.sh b/tasks/scenario-17/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eb5c653115cce0246b22d86caca96dd3beb249a7 --- /dev/null +++ b/tasks/scenario-17/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -euo pipefail +python3 /tests/grade.py