diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt deleted file mode 100644 index 4ea99c213c5c0c005ae4e80df8e52169d06896ec..0000000000000000000000000000000000000000 --- a/LICENSES/CC-BY-4.0.txt +++ /dev/null @@ -1,395 +0,0 @@ -Attribution 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution 4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution 4.0 International Public License ("Public License"). To the -extent this Public License may be interpreted as a contract, You are -granted the Licensed Rights in consideration of Your acceptance of -these terms and conditions, and the Licensor grants You such rights in -consideration of benefits the Licensor receives from making the -Licensed Material available under these terms and conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - d. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - e. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - f. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - g. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - h. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - i. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - j. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - k. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - 4. If You Share Adapted Material You produce, the Adapter's - License You apply must not prevent recipients of the Adapted - Material from complying with this Public License. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material; and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/LICENSES/MIT-Python-Repair.txt b/LICENSES/MIT-Python-Repair.txt deleted file mode 100644 index 37ba887dd8e311c975b6492ac43d6e4736527aa7..0000000000000000000000000000000000000000 --- a/LICENSES/MIT-Python-Repair.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Louis Grenard - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSES/MIT-adapters.txt b/LICENSES/MIT-adapters.txt deleted file mode 100644 index 580dd0f4d393e66f6124283a3766f4f3ec4b99e8..0000000000000000000000000000000000000000 --- a/LICENSES/MIT-adapters.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Complete Work contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSES/ODC-BY-1.0.txt b/LICENSES/ODC-BY-1.0.txt deleted file mode 100644 index a12f30e302933f0f2db88e7ce93186a34b9535fd..0000000000000000000000000000000000000000 --- a/LICENSES/ODC-BY-1.0.txt +++ /dev/null @@ -1,428 +0,0 @@ -# ODC Attribution License (ODC-By) - -### Preamble - -The Open Data Commons Attribution License is a license agreement -intended to allow users to freely share, modify, and use this Database -subject only to the attribution requirements set out in Section 4. - -Databases can contain a wide variety of types of content (images, -audiovisual material, and sounds all in the same database, for example), -and so this license only governs the rights over the Database, and not -the contents of the Database individually. Licensors may therefore wish -to use this license together with another license for the contents. - -Sometimes the contents of a database, or the database itself, can be -covered by other rights not addressed here (such as private contracts, -trademark over the name, or privacy rights / data protection rights -over information in the contents), and so you are advised that you may -have to consult other documents or clear other rights before doing -activities not covered by this License. - ------- - -The Licensor (as defined below) - -and - -You (as defined below) - -agree as follows: - -### 1.0 Definitions of Capitalised Words - -"Collective Database" - Means this Database in unmodified form as part -of a collection of independent databases in themselves that together are -assembled into a collective whole. A work that constitutes a Collective -Database will not be considered a Derivative Database. - -"Convey" - As a verb, means Using the Database, a Derivative Database, -or the Database as part of a Collective Database in any way that enables -a Person to make or receive copies of the Database or a Derivative -Database. Conveying does not include interaction with a user through a -computer network, or creating and Using a Produced Work, where no -transfer of a copy of the Database or a Derivative Database occurs. - -"Contents" - The contents of this Database, which includes the -information, independent works, or other material collected into the -Database. For example, the contents of the Database could be factual -data or works such as images, audiovisual material, text, or sounds. - -"Database" - A collection of material (the Contents) arranged in a -systematic or methodical way and individually accessible by electronic -or other means offered under the terms of this License. - -"Database Directive" - Means Directive 96/9/EC of the European -Parliament and of the Council of 11 March 1996 on the legal protection -of databases, as amended or succeeded. - -"Database Right" - Means rights resulting from the Chapter III ("sui -generis") rights in the Database Directive (as amended and as transposed -by member states), which includes the Extraction and Re-utilisation of -the whole or a Substantial part of the Contents, as well as any similar -rights available in the relevant jurisdiction under Section 10.4. - -"Derivative Database" - Means a database based upon the Database, and -includes any translation, adaptation, arrangement, modification, or any -other alteration of the Database or of a Substantial part of the -Contents. This includes, but is not limited to, Extracting or -Re-utilising the whole or a Substantial part of the Contents in a new -Database. - -"Extraction" - Means the permanent or temporary transfer of all or a -Substantial part of the Contents to another medium by any means or in -any form. - -"License" - Means this license agreement and is both a license of rights -such as copyright and Database Rights and an agreement in contract. - -"Licensor" - Means the Person that offers the Database under the terms -of this License. - -"Person" - Means a natural or legal person or a body of persons -corporate or incorporate. - -"Produced Work" - a work (such as an image, audiovisual material, text, -or sounds) resulting from using the whole or a Substantial part of the -Contents (via a search or other query) from this Database, a Derivative -Database, or this Database as part of a Collective Database. - -"Publicly" - means to Persons other than You or under Your control by -either more than 50% ownership or by the power to direct their -activities (such as contracting with an independent consultant). - -"Re-utilisation" - means any form of making available to the public all -or a Substantial part of the Contents by the distribution of copies, by -renting, by online or other forms of transmission. - -"Substantial" - Means substantial in terms of quantity or quality or a -combination of both. The repeated and systematic Extraction or -Re-utilisation of insubstantial parts of the Contents may amount to the -Extraction or Re-utilisation of a Substantial part of the Contents. - -"Use" - As a verb, means doing any act that is restricted by copyright -or Database Rights whether in the original medium or any other; and -includes without limitation distributing, copying, publicly performing, -publicly displaying, and preparing derivative works of the Database, as -well as modifying the Database as may be technically necessary to use it -in a different mode or format. - -"You" - Means a Person exercising rights under this License who has not -previously violated the terms of this License with respect to the -Database, or who has received express permission from the Licensor to -exercise rights under this License despite a previous violation. - -Words in the singular include the plural and vice versa. - -### 2.0 What this License covers - -2.1. Legal effect of this document. This License is: - - a. A license of applicable copyright and neighbouring rights; - - b. A license of the Database Right; and - - c. An agreement in contract between You and the Licensor. - -2.2 Legal rights covered. This License covers the legal rights in the -Database, including: - - a. Copyright. Any copyright or neighbouring rights in the Database. - The copyright licensed includes any individual elements of the - Database, but does not cover the copyright over the Contents - independent of this Database. See Section 2.4 for details. Copyright - law varies between jurisdictions, but is likely to cover: the Database - model or schema, which is the structure, arrangement, and organisation - of the Database, and can also include the Database tables and table - indexes; the data entry and output sheets; and the Field names of - Contents stored in the Database; - - b. Database Rights. Database Rights only extend to the Extraction and - Re-utilisation of the whole or a Substantial part of the Contents. - Database Rights can apply even when there is no copyright over the - Database. Database Rights can also apply when the Contents are removed - from the Database and are selected and arranged in a way that would - not infringe any applicable copyright; and - - c. Contract. This is an agreement between You and the Licensor for - access to the Database. In return you agree to certain conditions of - use on this access as outlined in this License. - -2.3 Rights not covered. - - a. This License does not apply to computer programs used in the making - or operation of the Database; - - b. This License does not cover any patents over the Contents or the - Database; and - - c. This License does not cover any trademarks associated with the - Database. - -2.4 Relationship to Contents in the Database. The individual items of -the Contents contained in this Database may be covered by other rights, -including copyright, patent, data protection, privacy, or personality -rights, and this License does not cover any rights (other than Database -Rights or in contract) in individual Contents contained in the Database. -For example, if used on a Database of images (the Contents), this -License would not apply to copyright over individual images, which could -have their own separate licenses, or one single license covering all of -the rights over the images. - -### 3.0 Rights granted - -3.1 Subject to the terms and conditions of this License, the Licensor -grants to You a worldwide, royalty-free, non-exclusive, terminable (but -only under Section 9) license to Use the Database for the duration of -any applicable copyright and Database Rights. These rights explicitly -include commercial use, and do not exclude any field of endeavour. To -the extent possible in the relevant jurisdiction, these rights may be -exercised in all media and formats whether now known or created in the -future. - -The rights granted cover, for example: - - a. Extraction and Re-utilisation of the whole or a Substantial part of - the Contents; - - b. Creation of Derivative Databases; - - c. Creation of Collective Databases; - - d. Creation of temporary or permanent reproductions by any means and - in any form, in whole or in part, including of any Derivative - Databases or as a part of Collective Databases; and - - e. Distribution, communication, display, lending, making available, or - performance to the public by any means and in any form, in whole or in - part, including of any Derivative Database or as a part of Collective - Databases. - -3.2 Compulsory license schemes. For the avoidance of doubt: - - a. Non-waivable compulsory license schemes. In those jurisdictions in - which the right to collect royalties through any statutory or - compulsory licensing scheme cannot be waived, the Licensor reserves - the exclusive right to collect such royalties for any exercise by You - of the rights granted under this License; - - b. Waivable compulsory license schemes. In those jurisdictions in - which the right to collect royalties through any statutory or - compulsory licensing scheme can be waived, the Licensor waives the - exclusive right to collect such royalties for any exercise by You of - the rights granted under this License; and, - - c. Voluntary license schemes. The Licensor waives the right to collect - royalties, whether individually or, in the event that the Licensor is - a member of a collecting society that administers voluntary licensing - schemes, via that society, from any exercise by You of the rights - granted under this License. - -3.3 The right to release the Database under different terms, or to stop -distributing or making available the Database, is reserved. Note that -this Database may be multiple-licensed, and so You may have the choice -of using alternative licenses for this Database. Subject to Section -10.4, all other rights not expressly granted by Licensor are reserved. - -### 4.0 Conditions of Use - -4.1 The rights granted in Section 3 above are expressly made subject to -Your complying with the following conditions of use. These are important -conditions of this License, and if You fail to follow them, You will be -in material breach of its terms. - -4.2 Notices. If You Publicly Convey this Database, any Derivative -Database, or the Database as part of a Collective Database, then You -must: - - a. Do so only under the terms of this License; - - b. Include a copy of this License or its Uniform Resource Identifier (URI) - with the Database or Derivative Database, including both in the - Database or Derivative Database and in any relevant documentation; - - c. Keep intact any copyright or Database Right notices and notices - that refer to this License; and - - d. If it is not possible to put the required notices in a particular - file due to its structure, then You must include the notices in a - location (such as a relevant directory) where users would be likely to - look for it. - -4.3 Notice for using output (Contents). Creating and Using a Produced -Work does not require the notice in Section 4.2. However, if you -Publicly Use a Produced Work, You must include a notice associated with -the Produced Work reasonably calculated to make any Person that uses, -views, accesses, interacts with, or is otherwise exposed to the Produced -Work aware that Content was obtained from the Database, Derivative -Database, or the Database as part of a Collective Database, and that it -is available under this License. - - a. Example notice. The following text will satisfy notice under - Section 4.3: - - Contains information from DATABASE NAME which is made available - under the ODC Attribution License. - -DATABASE NAME should be replaced with the name of the Database and a -hyperlink to the location of the Database. "ODC Attribution License" -should contain a hyperlink to the URI of the text of this License. If -hyperlinks are not possible, You should include the plain text of the -required URI's with the above notice. - -4.4 Licensing of others. You may not sublicense the Database. Each time -You communicate the Database, the whole or Substantial part of the -Contents, or any Derivative Database to anyone else in any way, the -Licensor offers to the recipient a license to the Database on the same -terms and conditions as this License. You are not responsible for -enforcing compliance by third parties with this License, but You may -enforce any rights that You have over a Derivative Database. You are -solely responsible for any modifications of a Derivative Database made -by You or another Person at Your direction. You may not impose any -further restrictions on the exercise of the rights granted or affirmed -under this License. - -### 5.0 Moral rights - -5.1 Moral rights. This section covers moral rights, including any rights -to be identified as the author of the Database or to object to treatment -that would otherwise prejudice the author's honour and reputation, or -any other derogatory treatment: - - a. For jurisdictions allowing waiver of moral rights, Licensor waives - all moral rights that Licensor may have in the Database to the fullest - extent possible by the law of the relevant jurisdiction under Section - 10.4; - - b. If waiver of moral rights under Section 5.1 a in the relevant - jurisdiction is not possible, Licensor agrees not to assert any moral - rights over the Database and waives all claims in moral rights to the - fullest extent possible by the law of the relevant jurisdiction under - Section 10.4; and - - c. For jurisdictions not allowing waiver or an agreement not to assert - moral rights under Section 5.1 a and b, the author may retain their - moral rights over certain aspects of the Database. - -Please note that some jurisdictions do not allow for the waiver of moral -rights, and so moral rights may still subsist over the Database in some -jurisdictions. - -### 6.0 Fair dealing, Database exceptions, and other rights not affected - -6.1 This License does not affect any rights that You or anyone else may -independently have under any applicable law to make any use of this -Database, including without limitation: - - a. Exceptions to the Database Right including: Extraction of Contents - from non-electronic Databases for private purposes, Extraction for - purposes of illustration for teaching or scientific research, and - Extraction or Re-utilisation for public security or an administrative - or judicial procedure. - - b. Fair dealing, fair use, or any other legally recognised limitation - or exception to infringement of copyright or other applicable laws. - -6.2 This License does not affect any rights of lawful users to Extract -and Re-utilise insubstantial parts of the Contents, evaluated -quantitatively or qualitatively, for any purposes whatsoever, including -creating a Derivative Database (subject to other rights over the -Contents, see Section 2.4). The repeated and systematic Extraction or -Re-utilisation of insubstantial parts of the Contents may however amount -to the Extraction or Re-utilisation of a Substantial part of the -Contents. - -### 7.0 Warranties and Disclaimer - -7.1 The Database is licensed by the Licensor "as is" and without any -warranty of any kind, either express, implied, or arising by statute, -custom, course of dealing, or trade usage. Licensor specifically -disclaims any and all implied warranties or conditions of title, -non-infringement, accuracy or completeness, the presence or absence of -errors, fitness for a particular purpose, merchantability, or otherwise. -Some jurisdictions do not allow the exclusion of implied warranties, so -this exclusion may not apply to You. - -### 8.0 Limitation of liability - -8.1 Subject to any liability that may not be excluded or limited by law, -the Licensor is not liable for, and expressly excludes, all liability -for loss or damage however and whenever caused to anyone by any use -under this License, whether by You or by anyone else, and whether caused -by any fault on the part of the Licensor or not. This exclusion of -liability includes, but is not limited to, any special, incidental, -consequential, punitive, or exemplary damages such as loss of revenue, -data, anticipated profits, and lost business. This exclusion applies -even if the Licensor has been advised of the possibility of such -damages. - -8.2 If liability may not be excluded by law, it is limited to actual and -direct financial loss to the extent it is caused by proved negligence on -the part of the Licensor. - -### 9.0 Termination of Your rights under this License - -9.1 Any breach by You of the terms and conditions of this License -automatically terminates this License with immediate effect and without -notice to You. For the avoidance of doubt, Persons who have received the -Database, the whole or a Substantial part of the Contents, Derivative -Databases, or the Database as part of a Collective Database from You -under this License will not have their licenses terminated provided -their use is in full compliance with this License or a license granted -under Section 4.8 of this License. Sections 1, 2, 7, 8, 9 and 10 will -survive any termination of this License. - -9.2 If You are not in breach of the terms of this License, the Licensor -will not terminate Your rights under it. - -9.3 Unless terminated under Section 9.1, this License is granted to You -for the duration of applicable rights in the Database. - -9.4 Reinstatement of rights. If you cease any breach of the terms and -conditions of this License, then your full rights under this License -will be reinstated: - - a. Provisionally and subject to permanent termination until the 60th - day after cessation of breach; - - b. Permanently on the 60th day after cessation of breach unless - otherwise reasonably notified by the Licensor; or - - c. Permanently if reasonably notified by the Licensor of the - violation, this is the first time You have received notice of - violation of this License from the Licensor, and You cure the - violation prior to 30 days after your receipt of the notice. - -9.5 Notwithstanding the above, Licensor reserves the right to release -the Database under different license terms or to stop distributing or -making available the Database. Releasing the Database under different -license terms or stopping the distribution of the Database will not -withdraw this License (or any other license that has been, or is -required to be, granted under the terms of this License), and this -License will continue in full force and effect unless terminated as -stated above. - -### 10.0 General - -10.1 If any provision of this License is held to be invalid or -unenforceable, that must not affect the validity or enforceability of -the remainder of the terms and conditions of this License and each -remaining provision of this License shall be valid and enforced to the -fullest extent permitted by law. - -10.2 This License is the entire agreement between the parties with -respect to the rights granted here over the Database. It replaces any -earlier understandings, agreements or representations with respect to -the Database. - -10.3 If You are in breach of the terms of this License, You will not be -entitled to rely on the terms of this License or to complain of any -breach by the Licensor. - -10.4 Choice of law. This License takes effect in and will be governed by -the laws of the relevant jurisdiction in which the License terms are -sought to be enforced. If the standard suite of rights granted under -applicable copyright law and Database Rights in the relevant -jurisdiction includes additional rights not granted under this License, -these additional rights are granted in this License in order to meet the -terms of this License. diff --git a/LICENSES/README.txt b/LICENSES/README.txt index a51f4a4aab144c81a845f21f3bdac7a79ebca60c..d3a02dc0355275905041b70bca4976b8ccc74357 100644 --- a/LICENSES/README.txt +++ b/LICENSES/README.txt @@ -1,10 +1,5 @@ -Each upstream component retains its own license and attribution. - -PDBThink original tasks and checkers: Open Athena, Apache-2.0. The upstream source identifies the coordinates as wwPDB CC0 material. See Apache-2.0-PDBThink.txt and components/pdbthink/licenses/. -TMax original task data: Ai2, ODC-BY 1.0. TMax-NOTICE.txt and the original author citations are retained. The upstream card also specifies research and educational use, the Ai2 Responsible Use Guidelines, and upstream terms for generated content. Those source requirements continue to apply. See ODC-BY-1.0.txt. -MathConstruct Costas: Viresh Pati and contributors, CC BY 4.0, obtained through amphora's pinned Harbor revision. See components/math/licenses/, NOTICE.txt, and SOURCE.json. -Python repair tasks: Louistiti, MIT. Original tasks, generators and scoring code are preserved in components/loui/upstream/. -AgentWorldModel: Zhaoyang Wang, Canwen Xu, Boyi Liu, Yite Wang, Siwei Han, Zhewei Yao, Huaxiu Yao, and Yuxiong He, CC BY 4.0. See CC-BY-4.0.txt, components/awm/NOTICE, and LICENSE_SCOPE.json. -The project's existing MIT license applies to the new adapters and packaging documentation only. It does not replace or alter any upstream license. - -OpenEnv SDK commit: 86a180ede21e044f7929b9a7783ad83aa67d83a3. The operating systems, Python, and third-party libraries retain their respective licenses. Original distribution notices remain in the images. Dependency records support reproduction and do not relicense those dependencies. +Terminal Desk: Apache-2.0, components/dnakhla/LICENSE and NOTICE. +MetaHarness: MIT, components/metaharness/LICENSE and NOTICE. +Python Repair Lab: MIT, components/loui/upstream/LICENSE and component attribution. +Audit Trail: Apache-2.0, components/audit/upstream/LICENSE and NOTICE. +Each component retains its original task and grader sources. diff --git a/LICENSES/TMax-NOTICE.txt b/LICENSES/TMax-NOTICE.txt deleted file mode 100644 index 564377a82931da3dd695d7220ea6fae14f950dff..0000000000000000000000000000000000000000 --- a/LICENSES/TMax-NOTICE.txt +++ /dev/null @@ -1,6 +0,0 @@ -Contains information from allenai/TMax-15K (https://huggingface.co/datasets/allenai/TMax-15K), declared under the Open Data Commons Attribution License: https://opendatacommons.org/licenses/by/1-0/ . -Harbor task conversion: TMaxxx/TMax-15K-Harbor, revision 48a77eb0b017606c643ed905f96db41672914798. -The six selected tasks retain their original instructions, scoring assertions and fixed input assets. The OpenEnv adapter changes execution and transport and protects original inputs and private checkers. -The original dataset card also states research/education use, Ai2 Responsible Use Guidelines and applicable upstream terms for generated content; retain those statements with the component source notices. -See components/tmax/SOURCE.json and licenses/ for the original Ai2 revision and full source attribution. -OpenEnv SDK revision: 86a180ede21e044f7929b9a7783ad83aa67d83a3. Ubuntu, CPython and installed packages retain their upstream notices and licenses in the runtime image. diff --git a/MANIFEST.json b/MANIFEST.json index d04b856a5a3ab6bbbbc7e318e6ef633bc32e95ea..a19b48fbadc79a156394125ab7fe3ba24ceb8ec4 100644 --- a/MANIFEST.json +++ b/MANIFEST.json @@ -1,874 +1,528 @@ { - "format": "multidomain-file-manifest-v1", - "selected_task_count": 11, "files": { - ".gitattributes": { - "sha256": "24641eca9bbd24aa8a02bda3cd37dcfb8445345df9b7b4997116ffd62746201e", - "bytes": 2710 - }, - "LICENSE": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "bytes": 0 - }, - "LICENSES/Apache-2.0-PDBThink.txt": { - "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", - "bytes": 11357 - }, - "LICENSES/CC-BY-4.0.txt": { - "sha256": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94", - "bytes": 18656 - }, - "LICENSES/MIT-Python-Repair.txt": { - "sha256": "a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6", - "bytes": 1070 - }, - "LICENSES/MIT-adapters.txt": { - "sha256": "c9d5f2c24789a4ee7502fd1426c6a2090ba766b24f20d0ef663d3b149b7466d3", - "bytes": 1083 - }, - "LICENSES/ODC-BY-1.0.txt": { - "sha256": "11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b", - "bytes": 19977 - }, "LICENSES/README.txt": { - "sha256": "ff16b8cf78343a7a32fbcb321a9ca9b1d3507bb320d2435b92577eba750e93ce", - "bytes": 1500 - }, - "LICENSES/TMax-NOTICE.txt": { - "sha256": "85da239bb4104a67e515dca538d1a4b345eed77c5d460fe76625bae905b431ed", - "bytes": 982 + "bytes": 343, + "sha256": "e50227e76c5f0c86594f7fd55d13414bc1615800f93e01f4d4a3d3dd869533d5" }, "README.md": { - "sha256": "11cfaddb6a6a011f4233b7217642bc2c1f2441e4be6749e175848d96912d78d0", - "bytes": 1965 - }, - "REGISTRATION.json": { - "sha256": "1bcb19ab0927ecf8e0aeb7a11fff5fca73cf62387ecf56ac358ac294a09a7d36", - "bytes": 524 + "bytes": 1698, + "sha256": "9b0b7c94692144732a7e73d09b8875feb4734276e42b46656615e07ac99c8142" }, "SOURCE_LOCK.json": { - "sha256": "4c6adc57279eb141e7c438621424616064194ad4421b74cc876a7414be7b23aa", - "bytes": 126377 - }, - "components/awm/ADAPTATIONS.txt": { - "sha256": "9338fe69c7472bfb396c70489e4edf64d6a30cf696da9a4579d30c743414c529", - "bytes": 444 - }, - "components/awm/Dockerfile": { - "sha256": "c2b8e74a2b134a9efcbc78332d6688b4d44c0e9039f64b0e664f281824886060", - "bytes": 323 - }, - "components/awm/LICENSE_SCOPE.json": { - "sha256": "1ea6a4d0c80da30d5f658364aaef2664cf09f32da0bce23c448e1fc1e4c4a7a6", - "bytes": 908 - }, - "components/awm/NOTICE": { - "sha256": "1aeed83147ee7f0ef0e0ab8bf92ab49404b86a135436bd32772e4e89e007b702", - "bytes": 642 - }, - "components/awm/SOURCE_CREDITS.json": { - "sha256": "ae057f0e66d0e924e81f553e729148cd98161bf070283928ef4fb658e9cf3546", - "bytes": 469 - }, - "components/awm/TASKS.json": { - "sha256": "9696c2ccb89108c6d7edaa0fec84092ae3251ef049e5d43252341c29f03ce88e", - "bytes": 1480 - }, - "components/awm/awm-requirements.lock": { - "sha256": "65d41089191536d5940648213b09924ba93e55d92df0080634e16d13615fd1ac", - "bytes": 4276 - }, - "components/awm/config.json": { - "sha256": "679c2e8e5ca63963ab80b2e89a14df5204fb0b70dad25714efb1f0b89cad8424", - "bytes": 542 - }, - "components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json": { - "sha256": "3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58", - "bytes": 657 - }, - "components/awm/private/tasks/awm-accounting-1-invoice/initial.db": { - "sha256": "8ad2959536e44caba47bcbeca9018e47e7157783194d19b429aa8f22a60f4771", - "bytes": 331776 - }, - "components/awm/private/tasks/awm-accounting-1-invoice/original_api.py": { - "sha256": "57362b907a2d454bbd29b95dfebb7d84207ce9d7e22533eaf54853ee4fb84990", - "bytes": 87054 - }, - "components/awm/private/tasks/awm-accounting-1-invoice/original_verifier.py": { - "sha256": "3cd0d63022caa900e32bda0b0d3ae5c9948ce3c195b77ba1906c7ddebea9c58b", - "bytes": 5951 - }, - "components/awm/requirements.lock": { - "sha256": "0078892ae5870080b3417677926bc64f4f87ba9e8110ff400f18954e361455fc", - "bytes": 10799 - }, - "components/awm/runtime/awm/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1 - }, - "components/awm/runtime/awm/adapter.py": { - "sha256": "887e81b7aab249861166099b3b4f0778f9041324640b904140d1b055d5a0bff1", - "bytes": 5277 - }, - "components/awm/runtime/awm/launch_service.py": { - "sha256": "0638af1cd1c6a311ee85109143ec6a59646a5f3d41c4b30312526dec561da33d", - "bytes": 2413 - }, - "components/awm/runtime/awm/openenv_app.py": { - "sha256": "f47b0cc104a7a962fc932c4d3f3bb8bfcf1524dec049b9c2c33161924038b94e", - "bytes": 3995 - }, - "components/awm/runtime/awm/server.py": { - "sha256": "484c7caeaa301b91f468a9e55a251a6b529c6f9d0f2e4951c9602071c40ebcea", - "bytes": 820 - }, - "components/awm/runtime/awm/wire_client.py": { - "sha256": "b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f", - "bytes": 4987 - }, - "components/awm/runtime/awm/worker.py": { - "sha256": "b02f482ee9e55df0998b9fcc839a6172cbd1daf40701082062fa49416b31d6e0", - "bytes": 6514 - }, - "components/awm/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1 - }, - "components/awm/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015 - }, - "components/awm/runtime/common/http_routes.py": { - "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e", - "bytes": 2380 - }, - "components/awm/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815 - }, - "components/awm/upstream/README.md": { - "sha256": "12a0f7eb70edfb5e6fb02f9904c3e06daea24eab392ff4d6cef229ce18237810", - "bytes": 3917 - }, - "components/awm/upstream/accounting_1-gen_db.jsonl": { - "sha256": "1cd23311c95c9919621b226c99dcab54faf815300c72cd542a394a5e69463a6e", - "bytes": 13948 - }, - "components/awm/upstream/accounting_1-gen_envs.jsonl": { - "sha256": "99f1883338fa6f4827cb9c6c4c9cf9222c28a2a9842202cbe524921921de3ae3", - "bytes": 90440 - }, - "components/awm/upstream/accounting_1-gen_sample.jsonl": { - "sha256": "28cf8d5611b0d63b9e17d0e991e328c2970cfef5595c08d084f2b1bad7a441fd", - "bytes": 32317 - }, - "components/loui/.dockerignore": { - "sha256": "05cc6ae53cfd6129f1d7010aa874c6cf0a6019b1adfeff3f4fab27f2d04f43ca", - "bytes": 18 - }, - "components/loui/Dockerfile": { - "sha256": "0b1054575ac49a8a80a9777e67280b41549b7ff6da909301b0fa8d87c1d8833d", - "bytes": 801 - }, - "components/loui/README.md": { - "sha256": "6321514f0aac58cdcd022b38f1be9c499d70b1f82a57a45a6878d816a4bcf293", - "bytes": 672 - }, - "components/loui/SOURCE.json": { - "sha256": "77ce88ca01b6eaad2babc63f0bc078674597336451275db2d72e282bf84b2592", - "bytes": 1133 - }, - "components/loui/config.json": { - "sha256": "93e90e21198aa146280df24300947b36561b3c41fb51494f0bf5c2b793fc7330", - "bytes": 2363 - }, - "components/loui/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1 - }, - "components/loui/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015 - }, - "components/loui/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815 - }, - "components/loui/runtime/loui/__init__.py": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "bytes": 0 - }, - "components/loui/runtime/loui/child.py": { - "sha256": "c4774351bdbd8a044cd20bcd7111ac4db7403feccb9444acf663e71140b27888", - "bytes": 3172 - }, - "components/loui/runtime/loui/environment.py": { - "sha256": "edd467b474dc0982c9b6c91a9f0150432fa8b9a5c6b62c8187bc9cc9f440a22a", - "bytes": 7292 - }, - "components/loui/runtime/loui/executor.py": { - "sha256": "7c70a736ee8c5afbb3b5cf3e8113242e4dbb9efc3abe3a2027948474121d59f8", - "bytes": 2741 - }, - "components/loui/runtime/loui/server.py": { - "sha256": "c3ae4e00495724083e73085bd4dccdf3493094ef2e14c0bb017f6502d264244b", - "bytes": 411 - }, - "components/loui/tasks/expression-3/instruction.md": { - "sha256": "09ef2d8fc856ca3dc5662c279df705e9accc827f4472dc34758ffe769d116128", - "bytes": 955 - }, - "components/loui/tasks/incident-3/instruction.md": { - "sha256": "682c7db0f0911e85174652574349fbe957c1cc235a68d224c569e405d9674452", - "bytes": 812 - }, - "components/loui/upstream/LICENSE": { - "sha256": "a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6", - "bytes": 1070 - }, - "components/loui/upstream/v3/README.md": { - "sha256": "bf5da0c7b871459278ad174cfd3c4ba90de9fbe74d35decce007bed13535d32d", - "bytes": 7857 - }, - "components/loui/upstream/v3/execution.py": { - "sha256": "578814be5152b9b00c7eeae387544a94db159c9e8e3456e5cb56b31b6a731e9a", - "bytes": 8431 - }, - "components/loui/upstream/v3/hard_tasks.py": { - "sha256": "f140fcf554e97b67afb14e961affc46c14320cb784fe1f7444585e77ceb89ea0", - "bytes": 8476 - }, - "components/loui/upstream/v3/server.py": { - "sha256": "67f546daef6e7902c12754cbbd883657e57d2cb21e109275af123c552cc93422", - "bytes": 4068 - }, - "components/loui/upstream/v3/tasks.jsonl": { - "sha256": "9715cdabe6e67287399a3fe2bad435852510bf854982d2f6695b3d87db395c88", - "bytes": 87084 - }, - "components/loui/upstream/v3/tasks.py": { - "sha256": "71caf0175532025bf138398229d466f18e5e03365b48853efd92f61f6dae2d66", - "bytes": 22139 - }, - "components/math/ADAPTATIONS.txt": { - "sha256": "83af5f0a6ae61c968b666a5d1854020a8ee8cf174562ca9d59afc397f46444ae", - "bytes": 193 - }, - "components/math/Dockerfile": { - "sha256": "f6f0505f720c1b8bb8202cbdc8c5d16f270646dc006b47fdbc1d8852f757c848", - "bytes": 477 - }, - "components/math/NOTICE.txt": { - "sha256": "a4650234425608cbdb194ace7ba22812b4c14c1609a8a7808c2997bf92cdd2c7", - "bytes": 328 - }, - "components/math/SDK_DEPENDENCIES.json": { - "sha256": "a037cf3ce617aa3e0216bf5e0677d229679bfffdd30dba9057b58bb413c39732", - "bytes": 25904 - }, - "components/math/SOURCE.json": { - "sha256": "4d29eba8369ddbcbeab51dabe14f411512b1117b3787f59c1d406938f0b927ac", - "bytes": 913 - }, - "components/math/TASKS.json": { - "sha256": "5b232f75ae416ebe7094f0c85010ac6cb41dfecfd601aa7b5ed51712e75dc29a", - "bytes": 1164 - }, - "components/math/config.json": { - "sha256": "a0707b688bdabc7c7634d41bcd9031b6639896a2fc4b04ec6a06c2ac11dfb68c", - "bytes": 1600 - }, - "components/math/licenses/MathConstraint-LICENSE": { - "sha256": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94", - "bytes": 18656 - }, - "components/math/licenses/RLVE-LICENSE": { - "sha256": "10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e", - "bytes": 1069 - }, - "components/math/licenses/UPSTREAM_COLLECTION_LICENSES.md": { - "sha256": "200b2ce93f2a5b9671165f9aea3cc4d89db995352c1e1e3db6d418262b058516", - "bytes": 462 - }, - "components/math/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1 - }, - "components/math/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015 - }, - "components/math/runtime/common/http_routes.py": { - "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e", - "bytes": 2380 - }, - "components/math/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815 - }, - "components/math/runtime/native_shell/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1 - }, - "components/math/runtime/native_shell/actor_launcher.py": { - "sha256": "80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3", - "bytes": 5012 + "bytes": 1979, + "sha256": "8a55fa76364ae1cd88b1a1da39137400a318c40df4f1ff2941616c51cf5c4f17" }, - "components/math/runtime/native_shell/backend.py": { - "sha256": "34dba81df98422b07004d85a922d7db1246532a9d24b0be7eb103b89e0894e4e", - "bytes": 13575 + "components/audit/Dockerfile": { + "bytes": 751, + "sha256": "7c94b391b9d5738860b9270f471e27a99e17255f473b96f7bd1bf46a1d0c82da" }, - "components/math/runtime/native_shell/environment.py": { - "sha256": "cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53", - "bytes": 1616 + "components/audit/NOTICE": { + "bytes": 226, + "sha256": "5d85c4ca9560bf6be77c0389e21719d726ff9442c7bc73e37a40d79c021eec47" }, - "components/math/runtime/native_shell/guard.py": { - "sha256": "31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e", - "bytes": 12337 + "components/audit/README.md": { + "bytes": 194, + "sha256": "eea2ab8b6a11c6f41afce2488eeaa6d87a6c30f752cb60e76104c83ee02ab074" }, - "components/math/runtime/native_shell/launch_service.py": { - "sha256": "db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b", - "bytes": 2383 + "components/audit/SOURCE.json": { + "bytes": 1388, + "sha256": "0b0eafe25ffa560829dafcdd3ade2625043d5eaa03d725d153f40e6cacc15397" }, - "components/math/runtime/native_shell/process_scope.py": { - "sha256": "1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e", - "bytes": 8298 + "components/audit/config.json": { + "bytes": 2342, + "sha256": "6da4b8c7351046b8bfdb7e1ffe47dd6f40401c008497f2e8245673f356ab142d" }, - "components/math/runtime/native_shell/server.py": { - "sha256": "c8bb079f359fe4ac6c1764cbf47fdcfaa3f3caee35ff6c41e845bee3e965d454", - "bytes": 414 + "components/audit/runtime/audit/__init__.py": { + "bytes": 0, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, - "components/math/runtime/native_shell/verifier_launcher.py": { - "sha256": "6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465", - "bytes": 962 + "components/audit/runtime/audit/environment.py": { + "bytes": 5603, + "sha256": "3ff3233f5b306f1ce9f1db748820711148d5e0cbd663e8691f4163d6b9548d03" }, - "components/math/runtime/native_shell/wire_client.py": { - "sha256": "b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af", - "bytes": 5721 + "components/audit/runtime/audit/server.py": { + "bytes": 413, + "sha256": "dc79acae9a5d8abc4c816377745390421d50f317b5b307a76e64634b886ab8b6" }, - "components/math/upstream/construct-mc-costas-array-l3-s0/environment/Dockerfile": { - "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c", - "bytes": 389 + "components/audit/runtime/common/__init__.py": { + "bytes": 1, + "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" }, - "components/math/upstream/construct-mc-costas-array-l3-s0/environment/instance.json": { - "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5", - "bytes": 98 + "components/audit/runtime/common/contracts.py": { + "bytes": 1015, + "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1" }, - "components/math/upstream/construct-mc-costas-array-l3-s0/instruction.md": { - "sha256": "88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9", - "bytes": 723 + "components/audit/runtime/common/models.py": { + "bytes": 1941, + "sha256": "6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd" }, - "components/math/upstream/construct-mc-costas-array-l3-s0/task.toml": { - "sha256": "b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32", - "bytes": 694 + "components/audit/tasks/auth-05/instruction.md": { + "bytes": 377, + "sha256": "e58b70774d5f729ae49c59cb82c019972e889b7353dabe1d6b9eefc085993119" }, - "components/math/upstream/construct-mc-costas-array-l3-s0/tests/check.py": { - "sha256": "3c0290e35201f077926099989cd0e82c10bf091cb33c572cacc02bca075debdb", - "bytes": 809 + "components/audit/tasks/ledger-01/instruction.md": { + "bytes": 401, + "sha256": "141f54a8f1dc40c48f5a691cb2cdc9b15e8f3c029c7c3d500b8f8a054e82152b" }, - "components/math/upstream/construct-mc-costas-array-l3-s0/tests/instance.json": { - "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5", - "bytes": 98 + "components/audit/upstream/LICENSE": { + "bytes": 11358, + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" }, - "components/math/upstream/construct-mc-costas-array-l3-s0/tests/run.py": { - "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73", - "bytes": 4652 + "components/audit/upstream/audit_trail/__init__.py": { + "bytes": 199, + "sha256": "638536fc5897e3dd2aea2ce4671bf321e45d6de0ece20bc857ea38126f058dc8" }, - "components/math/upstream/construct-mc-costas-array-l3-s0/tests/test.sh": { - "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e", - "bytes": 391 + "components/audit/upstream/audit_trail/models.py": { + "bytes": 1106, + "sha256": "5156b42a8bebe5bf119a654f8e081eea0c7614f32933b2fd262c078b66e54276" }, - "components/pdbthink/DEPENDENCIES.json": { - "sha256": "b0cbd2dbfe130357ab86c48b3f0ee1acca985828022542d97f1f9d77e147f261", - "bytes": 46444 + "components/audit/upstream/audit_trail/server/__init__.py": { + "bytes": 185, + "sha256": "c27b096b1833ae60a6dff6108164d107cd5ecd50524a38ba22dd695733011aeb" }, - "components/pdbthink/Dockerfile": { - "sha256": "a059eac1b72cef773aee8d849c48f0b090e5d87802cfdf8ae3e8456595ba4e87", - "bytes": 338 + "components/audit/upstream/audit_trail/server/audit_trail_environment.py": { + "bytes": 3957, + "sha256": "5428cf74f5d6a6ea75e67ad2eb061d96ed391bff146c01ece422b984273d1125" }, - "components/pdbthink/config.json": { - "sha256": "6329e8c6c33a5f04e11dbdcba6f43bb7dba10439d969a97b28901d7681ece8b6", - "bytes": 1295 + "components/audit/upstream/audit_trail/tasks.py": { + "bytes": 14059, + "sha256": "c2f1193259d9c0dfecc2645bcc7ba36b01d336cad2aa5cc3c7ed358f9aa27b2a" }, - "components/pdbthink/licenses/DEPENDENCIES.json": { - "sha256": "7c98afbca1961f056579b344a5552c574582c6c19926578a748519fdd99496d7", - "bytes": 54492 + "components/audit/upstream/dataset/README.md": { + "bytes": 2214, + "sha256": "d70f12d0207ac89da7804330af5a207e1784e6603b565b73e40d786de75364b0" }, - "components/pdbthink/licenses/LICENSE-PDBTHINK": { - "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", - "bytes": 11357 + "components/audit/upstream/dataset/tasks.jsonl": { + "bytes": 2104, + "sha256": "dcb67aca547276783eb5f0da148ebcbd55d69d13cbb6dd437e0108ae971be1e8" }, - "components/pdbthink/licenses/SOURCE.json": { - "sha256": "b799de2e9e91ea8ee515bca1fee21cef759b73938cf952e629c8fb9543cc6638", - "bytes": 796 + "components/dnakhla/.dockerignore": { + "bytes": 49, + "sha256": "c04a2771c0665225047882b2da49d452e20d7cc9bc0ea024a48f1cd31411c504" }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/public_task.json": { - "sha256": "7d267c32438351a4d92533f6e9960da36a1e39c768ad56988904029cb90da0c5", - "bytes": 9092 + "components/dnakhla/Dockerfile": { + "bytes": 409, + "sha256": "a2464ca6190e49c967ccb0b521c8190dba35d94b9b2208e31562161f20f535b8" }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py": { - "sha256": "8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f", - "bytes": 2383 + "components/dnakhla/LICENSE": { + "bytes": 11358, + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30" }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py": { - "sha256": "72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c", - "bytes": 15164 + "components/dnakhla/NOTICE": { + "bytes": 351, + "sha256": "c306489df6e0c1049ff449d672d81e2aa5a78c66665c97b1b4448584be62f8f3" }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py": { - "sha256": "8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34", - "bytes": 6699 + "components/dnakhla/README.md": { + "bytes": 429, + "sha256": "f06b54055f7f780cd3bdf94dc3a5fb7d5e8e48f083a29727261fcf51e8f5d209" }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json": { - "sha256": "4ed8e4260bc71b5a863888cd3fa2c7bca6210fc5138f96fd2207462c348318b7", - "bytes": 253 + "components/dnakhla/SOURCE_MANIFEST.json": { + "bytes": 6280, + "sha256": "6c0c97d7de7fa1381099f380cd5554d584ed7581e50b0dc2d43d15cd6ae5c1de" }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh": { - "sha256": "bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7", - "bytes": 42 + "components/dnakhla/runtime/common/__init__.py": { + "bytes": 1, + "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml": { - "sha256": "628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4", - "bytes": 160 + "components/dnakhla/runtime/common/contracts.py": { + "bytes": 1015, + "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1" }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py": { - "sha256": "91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c", - "bytes": 1558 + "components/dnakhla/runtime/common/models.py": { + "bytes": 1941, + "sha256": "6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd" }, - "components/pdbthink/requirements.lock": { - "sha256": "0078892ae5870080b3417677926bc64f4f87ba9e8110ff400f18954e361455fc", - "bytes": 10799 + "components/dnakhla/runtime/dnakhla_compat/__init__.py": { + "bytes": 80, + "sha256": "adb5e5e6b8d1c5f4d2ff5bbfd4b66038c3d52e4ae50b0d3430c56a196d5ae5c3" }, - "components/pdbthink/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1 + "components/dnakhla/runtime/dnakhla_compat/environment.py": { + "bytes": 6952, + "sha256": "eaa4d0c0f293f3d53630eda1ad71921a8c1308b1ae375be3041bd3d0afc41369" }, - "components/pdbthink/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015 + "components/dnakhla/runtime/dnakhla_compat/server.py": { + "bytes": 460, + "sha256": "d64b7539b8cc9f5dcc170dcd0c4c48e6673da923ce0f22b754c7859770032bd8" }, - "components/pdbthink/runtime/common/http_routes.py": { - "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e", - "bytes": 2380 + "components/dnakhla/upstream/openenv.yaml": { + "bytes": 626, + "sha256": "8c68fdfde651ec70155ec1a8d4b15f5c14cdd1f9d98197fc5037b49d6dc74524" }, - "components/pdbthink/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815 + "components/dnakhla/upstream/terminal_desk/__init__.py": { + "bytes": 0, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, - "components/pdbthink/runtime/pdbthink/__init__.py": { - "sha256": "9f56e761d79bfdb34304a012586cb04d16b435ef6130091a97702e559260a2f2", - "bytes": 5 + "components/dnakhla/upstream/terminal_desk/core/__init__.py": { + "bytes": 0, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, - "components/pdbthink/runtime/pdbthink/adapter.py": { - "sha256": "1683d5e2fab016801207ecdde6cbd4d3730ed8c4ca22aafd0f3bf651dce0faf1", - "bytes": 6708 + "components/dnakhla/upstream/terminal_desk/core/grading.py": { + "bytes": 16512, + "sha256": "8606129c5aa3f99cc540a7c8269b65e9bb6c42e81bca36085c16963a0cccd2bd" }, - "components/pdbthink/runtime/pdbthink/launch_service.py": { - "sha256": "cc89f1e687da1a71af567ac450fd761da0e5d4fe56901695de304aabd81c59bd", - "bytes": 2443 + "components/dnakhla/upstream/terminal_desk/core/shell.py": { + "bytes": 5014, + "sha256": "59b4b07b0d59e01792c8dbbf7877555e2da2346ddf5d2c17df3bbd4e17cb847f" }, - "components/pdbthink/runtime/pdbthink/openenv_app.py": { - "sha256": "7ab1b3b05068cd5b0f20497062a8da5fd905c45e8eee295cb8f2fc5c7aca6577", - "bytes": 4033 + "components/dnakhla/upstream/terminal_desk/families/__init__.py": { + "bytes": 966, + "sha256": "2ca3d4eda1fb04a84a236fbb43b71d13d46ea68109f545e036842211be3e3958" }, - "components/pdbthink/runtime/pdbthink/server.py": { - "sha256": "76012b37d916b4044c6fe1da4e7accdf9faa2216f50c73d5b87cd12b7f1d70cf", - "bytes": 840 + "components/dnakhla/upstream/terminal_desk/families/base.py": { + "bytes": 2632, + "sha256": "d76cab459096d3748d2c4198753853d85418de61f64436cf4772b89345fdcf17" }, - "components/pdbthink/runtime/pdbthink/transport.py": { - "sha256": "b1f6f82ff9e113aedd742a8f4b0c18c545020677503765ee913c31e20964b96f", - "bytes": 6739 + "components/dnakhla/upstream/terminal_desk/families/finance.py": { + "bytes": 9887, + "sha256": "312a26e2d48ac10a07716384d3059a697f75f16e5b37fcabb8c07fcac3397f6f" }, - "components/pdbthink/runtime/pdbthink/wire_client.py": { - "sha256": "b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f", - "bytes": 4987 + "components/dnakhla/upstream/terminal_desk/families/finance3.py": { + "bytes": 23433, + "sha256": "a4839540c7a54198ea8e480248428e9ca65bdaf45adea5ae9f81cad71cbb1311" }, - "components/tmax/DEPENDENCIES.json": { - "sha256": "58d031f7955f7f774733189b8297a1db7f515bb206c26ac50fad68f580848974", - "bytes": 166362 + "components/dnakhla/upstream/terminal_desk/families/industrial.py": { + "bytes": 8865, + "sha256": "9140985ca44b1bcfc78b853f44496b7a9b77288284675f3656898de5be70d6aa" }, - "components/tmax/Dockerfile": { - "sha256": "7c4a25fee86ff7295519547dac7f594103c7137ec746423dd452c076a920cbb4", - "bytes": 251 + "components/dnakhla/upstream/terminal_desk/families/industrial3.py": { + "bytes": 23945, + "sha256": "48e914996b67accb09350a6714a5cea4a6191c0a05ac12a8f3045309f961c49c" }, - "components/tmax/LICENSE_SCOPE.json": { - "sha256": "9ae187d852f4cd6974fc9c65fba942df4e5586d73ddb3c48916a09376a3d36ac", - "bytes": 1360 + "components/dnakhla/upstream/terminal_desk/families/mathematics.py": { + "bytes": 6946, + "sha256": "552855819cbe4983529b864279c915bc56f8d68d850a3f221d84864066c0e2a5" }, - "components/tmax/NOTICE.txt": { - "sha256": "f30eb64313c2645348ca3d965c40c9a466eb3754f3302206e44133d19bc87d6a", - "bytes": 2235 + "components/dnakhla/upstream/terminal_desk/families/mathematics3.py": { + "bytes": 24030, + "sha256": "9dc54710cd826aadbe5de55d9093959e38c59dc59ae080e40d379cc4db1987c1" }, - "components/tmax/SOURCE.json": { - "sha256": "e0e598c0fc7ac71b15ee4668ad88f11b9e1084d62610d0535038d5a034d1c946", - "bytes": 3548 + "components/dnakhla/upstream/terminal_desk/families/media.py": { + "bytes": 7444, + "sha256": "52523502e6c679e34bd2dbeb46c3f539ba53ae2d4e1033adafca7ce859bc4de8" }, - "components/tmax/TASKS.json": { - "sha256": "7b4d7c93c6f7477c2962ee8ae8746bfe941991de3b940400013a15d1bba87536", - "bytes": 18980 + "components/dnakhla/upstream/terminal_desk/families/media3.py": { + "bytes": 27612, + "sha256": "9c91cfbde8ad60da034c15ba3418e21ae5891a12ce3932ecaf8035fcd6eef4bd" }, - "components/tmax/config.json": { - "sha256": "e2aff0a5d12d5f45d675854f26b6b5164bfac7fe1cf4193dab4ce879021bae64", - "bytes": 9223 + "components/dnakhla/upstream/terminal_desk/families/office.py": { + "bytes": 10356, + "sha256": "11f76ce7d62e18b535278b487f798703fd6f2bef04dd7ffaefae2c95bcba1102" }, - "components/tmax/licenses/ODC-BY-1.0.txt": { - "sha256": "11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b", - "bytes": 19977 + "components/dnakhla/upstream/terminal_desk/families/office3.py": { + "bytes": 25496, + "sha256": "1926c4a6e600cabb4cd35fab9528b4e4d55ef4adc1623b7229ac356ef28c987b" }, - "components/tmax/licenses/TMAX_DATASET_README.md": { - "sha256": "0e66e8816b8f2b4a17d37ec7abc5b8ca5708bae9d71d2c5323d8666d7e7ffa1d", - "bytes": 1830 + "components/dnakhla/upstream/terminal_desk/families/science.py": { + "bytes": 10159, + "sha256": "836ab819a2231700a4bff2929a4579034c45a637992e883ddfbdb0c1f711446a" }, - "components/tmax/requirements.lock": { - "sha256": "836618cb7e01e236878d367272157e4be6a31d538bf8b9f8cc9ed630aac04482", - "bytes": 10667 + "components/dnakhla/upstream/terminal_desk/families/science3.py": { + "bytes": 23969, + "sha256": "59477a1f9d38dbe5607f6432b4f8538342eec93faeed09bb6c9cb1402980c9a1" }, - "components/tmax/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1 + "components/dnakhla/upstream/terminal_desk/families/security.py": { + "bytes": 10341, + "sha256": "1228db896b6ce796ccf1f133e2f2ba9aaa9d54b745d5ffaf4b584a63a6aab2bd" }, - "components/tmax/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015 + "components/dnakhla/upstream/terminal_desk/families/security3.py": { + "bytes": 27080, + "sha256": "6f5ec9c2dfe9aad81ba382d4f6ffdb7f64493d92cd7fe5d653134ef0dac107af" }, - "components/tmax/runtime/common/http_routes.py": { - "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e", - "bytes": 2380 + "components/dnakhla/upstream/terminal_desk/families/software.py": { + "bytes": 16430, + "sha256": "4bca03797d701fe33f567729baa9a4fb2cef59cf220d0b79a941cc3817f8ba3a" }, - "components/tmax/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815 + "components/dnakhla/upstream/terminal_desk/families/software3.py": { + "bytes": 31784, + "sha256": "d526ae88ca53ef22dbc1e578055fc27ebb491c184474e662736b8be9523086a7" }, - "components/tmax/runtime/native_shell/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1 + "components/dnakhla/upstream/terminal_desk/models.py": { + "bytes": 1750, + "sha256": "f31264b0909878c6f2d4d18a270c7d92bc895052150c56e5ac3e6b38d4ceebb4" }, - "components/tmax/runtime/native_shell/actor_launcher.py": { - "sha256": "80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3", - "bytes": 5012 + "components/dnakhla/upstream/terminal_desk/oracles/__init__.py": { + "bytes": 1728, + "sha256": "04e4b102444b5db19507a46814820d78ad1e9782f963e5764f8f4adfe4d366a3" }, - "components/tmax/runtime/native_shell/backend.py": { - "sha256": "4b71d8cd0f017716e6df6cc64ee268a725be5fb6e363034bae2f9c8b0184b0ba", - "bytes": 13951 + "components/dnakhla/upstream/terminal_desk/oracles/fin3_invoice_fraud.py": { + "bytes": 1162, + "sha256": "975ff8045d42b2f483924e368e304c451bca894ddb4ba593d9dd3aea1c505329" }, - "components/tmax/runtime/native_shell/environment.py": { - "sha256": "cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53", - "bytes": 1616 + "components/dnakhla/upstream/terminal_desk/oracles/fin3_loan_schedule.py": { + "bytes": 1752, + "sha256": "b0a32266ec725f5a4f76d8b40a27fc52759f679d74e4dfe5c7885a1b19a36711" }, - "components/tmax/runtime/native_shell/guard.py": { - "sha256": "31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e", - "bytes": 12337 + "components/dnakhla/upstream/terminal_desk/oracles/fin3_portfolio_value.py": { + "bytes": 1729, + "sha256": "152a3516b9ec6811121747ea875fc1a73cb768ba6a98e05c2bee91325e4f7247" }, - "components/tmax/runtime/native_shell/launch_service.py": { - "sha256": "db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b", - "bytes": 2383 + "components/dnakhla/upstream/terminal_desk/oracles/ind3_service_due.py": { + "bytes": 1819, + "sha256": "47914a6e1a5bde126ce301bc11d4dc95b11cb0910ac0208a4c78596d7e65e30e" }, - "components/tmax/runtime/native_shell/process_scope.py": { - "sha256": "1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e", - "bytes": 8298 + "components/dnakhla/upstream/terminal_desk/oracles/ind3_stl_mass.py": { + "bytes": 1562, + "sha256": "53e6adc26768256ce6665bda20c4b04ad87602e24eb31b074c25dc8fbbc00653" }, - "components/tmax/runtime/native_shell/server.py": { - "sha256": "c8bb079f359fe4ac6c1764cbf47fdcfaa3f3caee35ff6c41e845bee3e965d454", - "bytes": 414 + "components/dnakhla/upstream/terminal_desk/oracles/ind3_tank_balance.py": { + "bytes": 1573, + "sha256": "c1049fdb6b4f11f0b5e0194b41e84b525d5a340213c2c94f5f99ffd6c2b75a42" }, - "components/tmax/runtime/native_shell/verifier_launcher.py": { - "sha256": "6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465", - "bytes": 962 + "components/dnakhla/upstream/terminal_desk/oracles/math3_count_items.py": { + "bytes": 1005, + "sha256": "0fd62812cd9ef1d5be6d6ae9fa2fa047eb6bb0a4508ccb5a5369373aefbf8dd3" }, - "components/tmax/runtime/native_shell/wire_client.py": { - "sha256": "b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af", - "bytes": 5721 + "components/dnakhla/upstream/terminal_desk/oracles/math3_exam_slots.py": { + "bytes": 1770, + "sha256": "03908ec43159f4a66678f37fb0366389608eeeba41361758d966c96eea50dc3f" }, - "components/tmax/tasks/task_000056_f726766b/source/external/app/vibration_data.wav": { - "sha256": "eab8396a1b533f70468039f8ac1b5fe9927faf4ded578172ec932ef7bf2af22a", - "bytes": 40058 + "components/dnakhla/upstream/terminal_desk/oracles/math3_route_plan.py": { + "bytes": 1686, + "sha256": "c2bb32b08a3705a4be56ff8c4e3af94d64441c9a7432f5dcec4dce0b378ee465" }, - "components/tmax/tasks/task_000056_f726766b/source/instruction.md": { - "sha256": "714f780883970365cfffe408e2c76e75f499005f87551fc84b55d79368e77197", - "bytes": 1851 + "components/dnakhla/upstream/terminal_desk/oracles/med3_silence_report.py": { + "bytes": 1602, + "sha256": "554e36455da66fd258e6ad2c39e80acbc3856237fee4608ce57b494f23c3d16d" }, - "components/tmax/tasks/task_000056_f726766b/source/task.toml": { - "sha256": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0", - "bytes": 981 + "components/dnakhla/upstream/terminal_desk/oracles/med3_sprite_count.py": { + "bytes": 1517, + "sha256": "8f0a1169d6e5b10c4981b53a22e957c4befad44d95e5d250cf53734105a40256" }, - "components/tmax/tasks/task_000056_f726766b/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290 + "components/dnakhla/upstream/terminal_desk/oracles/med3_subtitle_retime.py": { + "bytes": 1494, + "sha256": "72f448ba58ac9ee6082692dec88ddb6f279ae69bdb99d39b30d1acce12c19bfe" }, - "components/tmax/tasks/task_000056_f726766b/source/tests/test_final_state.py": { - "sha256": "327c5346a779a44e27ef0cbd9f107e863d599fc6e47f95f248eaec03c15117c4", - "bytes": 2866 + "components/dnakhla/upstream/terminal_desk/oracles/off3_ar_recon.py": { + "bytes": 1454, + "sha256": "b5320a71696443f1b04c0c5e02e35d0baee67a175a912bff86e32df7c2acb357" }, - "components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/find_threshold.sh": { - "sha256": "a6c4cf2043d8642babb9b546096b3f559a375b59d54a43efebd57e9728466184", - "bytes": 720 + "components/dnakhla/upstream/terminal_desk/oracles/off3_meeting_slot.py": { + "bytes": 1711, + "sha256": "6eef5e15337e5029c8e0b3353adee791ea9ebe73c6d79e47d84d6b7294cb5a38" }, - "components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/process.sh": { - "sha256": "4631f1f805e6b826a796502ed5d94e676b3061cf448f2f9225116395aa3bb13b", - "bytes": 500 + "components/dnakhla/upstream/terminal_desk/oracles/off3_pdf_xlsx_diff.py": { + "bytes": 1301, + "sha256": "82b5c15f02a03615699429a2342dbad4b8985aab76d82fa8a8b96f7fbebc544f" }, - "components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/serialize.sh": { - "sha256": "f3ae2df41978712dbffe58665a9582e3d0951f211c5cca5ece9f536225d28ba8", - "bytes": 303 + "components/dnakhla/upstream/terminal_desk/oracles/sci3_kinetics_fit.py": { + "bytes": 1527, + "sha256": "1ebc19667bf1963c83a47bd4905e99e0c32c3ce249b63ae2d7b39fcffa1b1bb7" }, - "components/tmax/tasks/task_000260_7b7cc286/source/external/app/video.mp4": { - "sha256": "3c04251fe92c30d29ac4d887608f4385176e3bda932594437f82b08a5b348938", - "bytes": 7671 + "components/dnakhla/upstream/terminal_desk/oracles/sci3_lightcurve_period.py": { + "bytes": 1540, + "sha256": "a983fb3c03ba15bc0591ab32ce41ddb99f2f38329e273f3f5da20f775d6bd8ab" }, - "components/tmax/tasks/task_000260_7b7cc286/source/instruction.md": { - "sha256": "79c9fd4e4d41524db109d90b0415a4f0a2b9d24bf690fa8d7340ce3cb5ce0975", - "bytes": 2015 + "components/dnakhla/upstream/terminal_desk/oracles/sci3_stoich_batch.py": { + "bytes": 1747, + "sha256": "56a84763e746f034571dc50a71f3716f340e4f8d9dee823eb3c9b209f471f48a" }, - "components/tmax/tasks/task_000260_7b7cc286/source/task.toml": { - "sha256": "d36c49060b4ddbca3b13a5aa98cf5b195c07bff725b91107f58a087ec4325423", - "bytes": 961 + "components/dnakhla/upstream/terminal_desk/oracles/sec3_auth_triage.py": { + "bytes": 1443, + "sha256": "c5fb5f697e8cfdb6008fcd59d6c3095a509d9a488dc28d7b99da4f4fe128b8a6" }, - "components/tmax/tasks/task_000260_7b7cc286/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290 + "components/dnakhla/upstream/terminal_desk/oracles/sec3_exfil_flows.py": { + "bytes": 1425, + "sha256": "5a4cc8a38f0554be4b287e2592bd26553db2f3ee6b5c10339d641246a7a6af90" }, - "components/tmax/tasks/task_000260_7b7cc286/source/tests/test_final_state.py": { - "sha256": "aae204101d5c024a0b5cbda42fa686e7d2928fd9be3ad55fd14314b2502182a5", - "bytes": 2007 + "components/dnakhla/upstream/terminal_desk/oracles/sec3_fw_verdicts.py": { + "bytes": 1668, + "sha256": "b91c7389813445d55edbdaadec60aa4c5d0b6c5ead6fdfca5268e425f512820f" }, - "components/tmax/tasks/task_000663_dff2c340/pristine/backup_catalog.db": { - "sha256": "170911a153d00eb0f037ca56a2cbd10d4aa2b7a418e25a0f1df58b1c77589788", - "bytes": 12288 + "components/dnakhla/upstream/terminal_desk/oracles/sw3_dep_lock.py": { + "bytes": 1715, + "sha256": "6b46601bc7e4bdc42c62242344aa431a34e7a6d1a8c7201e77315c66c6a4ae09" }, - "components/tmax/tasks/task_000663_dff2c340/source/instruction.md": { - "sha256": "feae25374139b4b1d8ec9759d553c591841d9330a071217f46a2e464bd32bbd7", - "bytes": 1841 + "components/dnakhla/upstream/terminal_desk/oracles/sw3_fix_module.py": { + "bytes": 1831, + "sha256": "43eee7f24a02ca3f0d3b12db5a44c132a931fc8dba10f9c1d4028d7fa5775bf4" }, - "components/tmax/tasks/task_000663_dff2c340/source/task.toml": { - "sha256": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a", - "bytes": 852 + "components/dnakhla/upstream/terminal_desk/oracles/sw3_rate_limit.py": { + "bytes": 1553, + "sha256": "4f1f187ae42f47faecc85d84e1f0341c848b03eb2bba1bf538927e2e62758314" }, - "components/tmax/tasks/task_000663_dff2c340/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290 + "components/dnakhla/upstream/terminal_desk/server/__init__.py": { + "bytes": 0, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, - "components/tmax/tasks/task_000663_dff2c340/source/tests/test_final_state.py": { - "sha256": "7a273b9bf8bc61eeec1b8dda674b5f6ba5356abbfd923b413b09d2584c1ef72f", - "bytes": 3341 + "components/dnakhla/upstream/terminal_desk/server/app.py": { + "bytes": 802, + "sha256": "6bf7658ec8ad07dda230a01fd893091a9b87df18ebf6af25af6c35965ed01fd8" }, - "components/tmax/tasks/task_005684_3c8594a3/pristine/compliance_audit.db": { - "sha256": "9fe1c89ee823f133d35dea66840ecb7f87d599487524b7aa1d6371e8f664058e", - "bytes": 20480 + "components/dnakhla/upstream/terminal_desk/server/environment.py": { + "bytes": 8350, + "sha256": "8e92f991e14098a0858490fe5beb43ca9b0ee2cfbddb36e73ecf987ba3922902" }, - "components/tmax/tasks/task_005684_3c8594a3/source/instruction.md": { - "sha256": "f4eee4e0643fcfb7399df10e1947ec9dbda28c74bacf307167f443506268f583", - "bytes": 1801 + "components/loui/.dockerignore": { + "bytes": 18, + "sha256": "05cc6ae53cfd6129f1d7010aa874c6cf0a6019b1adfeff3f4fab27f2d04f43ca" }, - "components/tmax/tasks/task_005684_3c8594a3/source/task.toml": { - "sha256": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2", - "bytes": 850 + "components/loui/Dockerfile": { + "bytes": 320, + "sha256": "225304d22825c251c46ab771cabdb176edce0efe249789c528573e8bc42c904d" }, - "components/tmax/tasks/task_005684_3c8594a3/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290 + "components/loui/README.md": { + "bytes": 486, + "sha256": "0ab8e0b3aa9790d6aa7d273727bf5ccd2fc0c49d57a4075eeb6022b93c55693f" }, - "components/tmax/tasks/task_005684_3c8594a3/source/tests/test_final_state.py": { - "sha256": "495630c7ede4e75ef5644c1ee5b69f04969a4059ef094787c19a3014734d3cf2", - "bytes": 4306 + "components/loui/SOURCE.json": { + "bytes": 1115, + "sha256": "4da7db21c634d28a954e5f83145d7f6b2de7a5b1ab62ac193f815e6684ab1406" }, - "components/tmax/tasks/task_008667_2151f271/pristine/data/financial.db": { - "sha256": "d6b5039ee32f3a43069245984c8fe5a9689028a9aac06e26a64017c54bd11976", - "bytes": 20480 + "components/loui/config.json": { + "bytes": 1509, + "sha256": "bfad19ee80d40545950d8e47c7772d548d5b26f3e7873f1ff18d1ceeed04d5ee" }, - "components/tmax/tasks/task_008667_2151f271/pristine/data/transactions.jsonl": { - "sha256": "629b28471809f802c58831d100315b83012c0066df3b265a2d379a19e61a2262", - "bytes": 937 + "components/loui/runtime/common/__init__.py": { + "bytes": 1, + "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" }, - "components/tmax/tasks/task_008667_2151f271/source/instruction.md": { - "sha256": "50d1d10121dfa3b565842fd10f2589ceb91b4459126787af7793cec9cc0d06b1", - "bytes": 2436 + "components/loui/runtime/common/contracts.py": { + "bytes": 1015, + "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1" }, - "components/tmax/tasks/task_008667_2151f271/source/task.toml": { - "sha256": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897", - "bytes": 967 + "components/loui/runtime/common/models.py": { + "bytes": 1941, + "sha256": "6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd" }, - "components/tmax/tasks/task_008667_2151f271/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290 + "components/loui/runtime/loui/__init__.py": { + "bytes": 0, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, - "components/tmax/tasks/task_008667_2151f271/source/tests/test_final_state.py": { - "sha256": "cb73fd0ab1765768ebfecc50054ba13c143cc51be201127515eb495904ddf9e6", - "bytes": 3674 + "components/loui/runtime/loui/child.py": { + "bytes": 3172, + "sha256": "c4774351bdbd8a044cd20bcd7111ac4db7403feccb9444acf663e71140b27888" }, - "components/tmax/tasks/task_008998_ae4cbe72/pristine/robot_dump.log.gz": { - "sha256": "909d2e964c0831d8af91b722b4424ed829c261d6b7db1a95180d8a809527ddaf", - "bytes": 261 + "components/loui/runtime/loui/environment.py": { + "bytes": 7292, + "sha256": "edd467b474dc0982c9b6c91a9f0150432fa8b9a5c6b62c8187bc9cc9f440a22a" }, - "components/tmax/tasks/task_008998_ae4cbe72/source/instruction.md": { - "sha256": "f81f86b07681931baabdba313cc4e988c01bff7a1f1d83349dfa939cdaa20669", - "bytes": 1919 + "components/loui/runtime/loui/executor.py": { + "bytes": 4126, + "sha256": "eb1bb1ea6b9747c0541e592d6f39b3c543bc8e5f760dbdda4ead54eaea44cd8e" }, - "components/tmax/tasks/task_008998_ae4cbe72/source/task.toml": { - "sha256": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9", - "bytes": 823 + "components/loui/runtime/loui/server.py": { + "bytes": 411, + "sha256": "c3ae4e00495724083e73085bd4dccdf3493094ef2e14c0bb017f6502d264244b" }, - "components/tmax/tasks/task_008998_ae4cbe72/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290 + "components/loui/tasks/expression-3/instruction.md": { + "bytes": 955, + "sha256": "09ef2d8fc856ca3dc5662c279df705e9accc827f4472dc34758ffe769d116128" }, - "components/tmax/tasks/task_008998_ae4cbe72/source/tests/test_final_state.py": { - "sha256": "e03b84ca0519367e5f86b7b3a3231afa5209b1971431497699200099035f5014", - "bytes": 2893 + "components/loui/upstream/LICENSE": { + "bytes": 1070, + "sha256": "a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6" }, - "components/tmax/upstream/task_000056_f726766b/environment/Dockerfile": { - "sha256": "c44d259c4421b16dc5f0bc3912cdd800f6c25746ea31bede5060c9605b225025", - "bytes": 521 + "components/loui/upstream/v3/README.md": { + "bytes": 7857, + "sha256": "bf5da0c7b871459278ad174cfd3c4ba90de9fbe74d35decce007bed13535d32d" }, - "components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.label.txt": { - "sha256": "fc9e91cc78e1817d80b4ba8c2dc9a638d0c57959825ee34f5e3d7688ad80dfb9", - "bytes": 3 + "components/loui/upstream/v3/execution.py": { + "bytes": 8431, + "sha256": "578814be5152b9b00c7eeae387544a94db159c9e8e3456e5cb56b31b6a731e9a" }, - "components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.wav": { - "sha256": "f55a8eec263c9be975b2adccdda6a07c680109b851a89f55779f14076aaa30d5", - "bytes": 16044 + "components/loui/upstream/v3/hard_tasks.py": { + "bytes": 8476, + "sha256": "f140fcf554e97b67afb14e961affc46c14320cb784fe1f7444585e77ceb89ea0" }, - "components/tmax/upstream/task_000056_f726766b/environment/base_install.sh": { - "sha256": "0e71b3e06fcf8cc6f9d95ba2e9664dfbba7786949a0e21b810ada563ae27a637", - "bytes": 2849 + "components/loui/upstream/v3/server.py": { + "bytes": 4068, + "sha256": "67f546daef6e7902c12754cbbd883657e57d2cb21e109275af123c552cc93422" }, - "components/tmax/upstream/task_000056_f726766b/environment/post_install.sh": { - "sha256": "70d52288d5c9a7d23bbd63fb086a7f886961a1335632cc6efb892572d197563b", - "bytes": 940 + "components/loui/upstream/v3/tasks.jsonl": { + "bytes": 87084, + "sha256": "9715cdabe6e67287399a3fe2bad435852510bf854982d2f6695b3d87db395c88" }, - "components/tmax/upstream/task_000056_f726766b/task.toml": { - "sha256": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0", - "bytes": 981 + "components/loui/upstream/v3/tasks.py": { + "bytes": 22139, + "sha256": "71caf0175532025bf138398229d466f18e5e03365b48853efd92f61f6dae2d66" }, - "components/tmax/upstream/task_000260_7b7cc286/environment/Dockerfile": { - "sha256": "98f66d958e8ee701c0579095c2e65254a63194845b894a45db2a6180a46a3193", - "bytes": 521 + "components/metaharness/.dockerignore": { + "bytes": 184, + "sha256": "54805fba51273053c3dd388970db3b31aae4de8e5998f1c05e735c18e242857f" }, - "components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.label.txt": { - "sha256": "4a44dc15364204a80fe80e9039455cc1608281820fe2b24f1e5233ade6af1dd5", - "bytes": 2 + "components/metaharness/Dockerfile": { + "bytes": 395, + "sha256": "1bfc7ebdbe65d93c93fa3122a2efb3e3cf8f6c138113fb6be9d09e5bfe2061ba" }, - "components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.mp4": { - "sha256": "bf759113108b136ec3b5fa507d035c1e66ac243b52da09fa07ab58566ee27f58", - "bytes": 3342 + "components/metaharness/LICENSE": { + "bytes": 1080, + "sha256": "09ed6717912f408da29e15b55170cd56c9658218a540b7c72e70909b9101274c" }, - "components/tmax/upstream/task_000260_7b7cc286/environment/base_install.sh": { - "sha256": "0e71b3e06fcf8cc6f9d95ba2e9664dfbba7786949a0e21b810ada563ae27a637", - "bytes": 2849 + "components/metaharness/NOTICE": { + "bytes": 628, + "sha256": "605977e7d6dcc2b1eda0dfc6501d2b1d5c64c129ff84e793a9a983919530e1ed" }, - "components/tmax/upstream/task_000260_7b7cc286/environment/post_install.sh": { - "sha256": "ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03", - "bytes": 2093 + "components/metaharness/README.md": { + "bytes": 666, + "sha256": "99e6a092e24b941b4ac79a57eeb593beff579f199d3994f73aa7e538f98398d9" }, - "components/tmax/upstream/task_000260_7b7cc286/task.toml": { - "sha256": "483c9171d3e67bec029d9b88cee24d554fa9310a61ec47940312be5f2951bc30", - "bytes": 954 + "components/metaharness/SOURCE.json": { + "bytes": 3078, + "sha256": "6bea52680ab6b140300653d1c98c356dbd0bc9c8da4bab722b21071baa7ec4a9" }, - "components/tmax/upstream/task_000663_dff2c340/environment/Dockerfile": { - "sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "bytes": 154 + "components/metaharness/TASKS.json": { + "bytes": 586, + "sha256": "3f122a94c8aecb947b4f95bc2a8d67980ec9a9bc2b7adeea3b1c5e08c3504e06" }, - "components/tmax/upstream/task_000663_dff2c340/environment/post_install.sh": { - "sha256": "a449c18295cee8a3e7ed0c958fe219cbed2d2a8e7fdad924f2679444b3377b94", - "bytes": 1661 + "components/metaharness/runtime/common/__init__.py": { + "bytes": 1, + "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" }, - "components/tmax/upstream/task_000663_dff2c340/task.toml": { - "sha256": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a", - "bytes": 852 + "components/metaharness/runtime/common/contracts.py": { + "bytes": 1015, + "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1" }, - "components/tmax/upstream/task_005684_3c8594a3/environment/Dockerfile": { - "sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "bytes": 154 + "components/metaharness/runtime/common/models.py": { + "bytes": 1941, + "sha256": "6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd" }, - "components/tmax/upstream/task_005684_3c8594a3/environment/post_install.sh": { - "sha256": "b431517fec535c62b42b517f9212cbb1e9cf80bdf883a55c02bfba08f0d4c404", - "bytes": 2072 + "components/metaharness/runtime/shared_adapter.py": { + "bytes": 5550, + "sha256": "485aa11684c1ca537e3f439ceb3e2bcdfb8848e1012ada02cb5783ae3deeb02d" }, - "components/tmax/upstream/task_005684_3c8594a3/task.toml": { - "sha256": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2", - "bytes": 850 + "components/metaharness/upstream/Dockerfile": { + "bytes": 797, + "sha256": "ceddb0dfe82b01ae91859db2215fa697381064801f0eb0a4d96dd6d0473bd25e" }, - "components/tmax/upstream/task_008667_2151f271/environment/Dockerfile": { - "sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "bytes": 154 + "components/metaharness/upstream/README.md": { + "bytes": 13521, + "sha256": "8802e5b5d1796dc9d15647705598971ec4be2e7b53e6b30556440a5ebb89d069" }, - "components/tmax/upstream/task_008667_2151f271/environment/post_install.sh": { - "sha256": "3a777366c4b998e6368627f4775a73cea29fdbdc9991daedfb13244153c17841", - "bytes": 2459 + "components/metaharness/upstream/arena_env/__init__.py": { + "bytes": 58, + "sha256": "d0cca47bd35b44e121fb394856996d9f2271c29528b73d5b6160ab63f47f9a0f" }, - "components/tmax/upstream/task_008667_2151f271/task.toml": { - "sha256": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897", - "bytes": 967 + "components/metaharness/upstream/arena_env/app.py": { + "bytes": 252, + "sha256": "62815cb244cb4404379dc28e897503994bef49a8e4f4b5721dace574a8865c63" }, - "components/tmax/upstream/task_008998_ae4cbe72/environment/Dockerfile": { - "sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "bytes": 154 + "components/metaharness/upstream/arena_env/environment.py": { + "bytes": 4280, + "sha256": "d6882e2c9dabf1ee0fde75df0acdef85670598da633ce523cf54038fd40562a9" }, - "components/tmax/upstream/task_008998_ae4cbe72/environment/post_install.sh": { - "sha256": "26dfa63d063430c2370144b8e30c1f905dde4e2722403c1e8131a5a84e2d5e69", - "bytes": 723 + "components/metaharness/upstream/arena_env/tasks.py": { + "bytes": 44343, + "sha256": "94e29b6d884302f57e9440591cca5c07350cc4eb47d9e4e9f7a27689c519b781" }, - "components/tmax/upstream/task_008998_ae4cbe72/task.toml": { - "sha256": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9", - "bytes": 823 + "components/metaharness/upstream/requirements.lock": { + "bytes": 2008, + "sha256": "3fbed6fc6af3931cdacd290353a02ba1740222974c91a022145ec4e6a5f3a347" }, - "prepare_source_tree.py": { - "sha256": "abea24b268b08f72897859e527fe90c89c08d2afab7305cf52d4255f2feeb897", - "bytes": 1352 + "components/metaharness/upstream/tasks.selected.jsonl": { + "bytes": 564203, + "sha256": "bb488a65100922227f9e7e8288beced72577c44cec8c2aa7a54be446d6ce9606" }, "schema.json": { - "sha256": "10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4", - "bytes": 1911 + "bytes": 1911, + "sha256": "10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4" }, "tasks.jsonl": { - "sha256": "c732c9b64fa1482028dc6fb2c0839496275e3250914df6e94e3dd6788cb04d43", - "bytes": 8921 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile": { - "sha256": "66b564f58a409177999eda6eea1e5c8009d88c6d72faffa1bac7c497b800a460", - "bytes": 144 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md": { - "sha256": "21dc586748f23a8630118831399e1c40d62443444d454bf6f5e7f60ba334b06f", - "bytes": 8121 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/prompt.json": { - "sha256": "97d07b9814fff65f7cd78bf968d4854aa2aa75e8535ceb574b35a93dbf087db0", - "bytes": 8269 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/task.toml": { - "sha256": "45af241c0dc3ed0b71fff4db4b2f334760bc387aaff0a74a6dc9543cce2effe1", - "bytes": 561 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py": { - "sha256": "8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f", - "bytes": 2383 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py": { - "sha256": "72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c", - "bytes": 15164 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py": { - "sha256": "8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34", - "bytes": 6699 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json": { - "sha256": "4ed8e4260bc71b5a863888cd3fa2c7bca6210fc5138f96fd2207462c348318b7", - "bytes": 253 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh": { - "sha256": "bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7", - "bytes": 42 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml": { - "sha256": "628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4", - "bytes": 160 - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py": { - "sha256": "91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c", - "bytes": 1558 + "bytes": 11261, + "sha256": "8bd6a842e43e36b3200d5b536d66ba3c66635c9ce4fe1ca812b561e25fc84182" }, "validate_dataset.py": { - "sha256": "0a92b0131b3b069468a5c0e32016a4f76b3f11395531a223b9a131175c2ae274", - "bytes": 10561 + "bytes": 1260, + "sha256": "59c642280ff82be024351b29b654a8f7b1eea9e101fc0579c79a3e258e2f2c29" } } } diff --git a/README.md b/README.md index b6de6ffa107bae146e5f878c49e2db6f71d8aa3a..0c10eda9c9d2d33c7fd3d405f963b2b03448a86e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ size_categories: - n<1K tags: - openenv -- harbor - multi-domain configs: - config_name: default @@ -19,27 +18,21 @@ configs: path: tasks.jsonl --- -Eleven original training tasks served by five OpenEnv images. +Thirteen original tasks for file workflows, structured reasoning, log auditing and expression repair, served by four OpenEnv images. -| Task type | Count | Source | +| Source | Tasks | Content | |---|---:|---| -| Python repair | 2 | Louistiti/openenv-python-repair | -| Structured data workflows | 3 | TMax | -| Business API workflow | 1 | AgentWorldModel | -| Manufacturing log processing | 1 | TMax | -| Video analysis | 1 | TMax | -| Physical parameter identification | 1 | TMax | -| Mathematical constraint construction | 1 | MathConstruct | -| Protein geometry | 1 | PDBThink | +| Terminal Desk | 5 | Reconciliation, meeting scheduling, PDF/spreadsheet comparison and kinetics fitting | +| MetaHarness | 5 | Contact reconciliation, media timelines, security triage, graph routes and calibration | +| Audit Trail | 2 | Authentication and transaction logs | +| Python Repair Lab | 1 | Expression parsing and evaluation | -`tasks.jsonl` records task IDs, original instructions and pinned sources. Each ID selects one original task. Reset restores its workspace or database; the Python repair tasks use the original seeded generator, with seed 0 by default. Original graders determine rewards. Python repair uses the original mean of behavior-group pass fractions; the other tasks use binary rewards. +Original generators and graders are retained. Terminal Desk generates a fresh instance at reset. MetaHarness uses an explicit seed when supplied and otherwise generates a random instance. Audit Trail restores its fixed original logs. Python Repair uses the original seed behavior, with default seed 0. -`components/` contains runtime adapters, task inputs, original graders and dependency records. `upstream/` preserves the selected Harbor materials. All images serve `schema.json` through one persistent WebSocket connection at `/ws`. Shell tasks use `exec` and `finish`; Python repair and business workflows use `call` and `finish`; protein geometry uses `submit_answer` through `call`. +All images expose `schema.json`. Use `op=exec`, `op=call` with a tool listed at reset, or `op=finish`. Each component preserves its original available tools and action limits. -`REGISTRATION.json` records the 11 available task IDs. `SOURCE_LOCK.json` records provenance; `MANIFEST.json` and `SHA256SUMS` cover package files. Licenses and attribution are in `LICENSES/README.txt` and the component notices. - -Validate a downloaded dataset and restore required empty source directories: +`tasks.jsonl` records the registered tasks and pinned sources. `components/` contains original materials and runtime adapters. `SOURCE_LOCK.json`, `MANIFEST.json` and `SHA256SUMS` record provenance and file hashes. Attribution and licenses are in `LICENSES/README.txt` and the component notices. ```sh -python3 -B prepare_source_tree.py +python3 -B validate_dataset.py ``` diff --git a/REGISTRATION.json b/REGISTRATION.json deleted file mode 100644 index 7c6079fe281eca8b0ee9725090feac4cb5d72a96..0000000000000000000000000000000000000000 --- a/REGISTRATION.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "selected_count": 11, - "selected_task_ids": [ - "awm-accounting-1-invoice", - "incident-3", - "task_008667_2151f271", - "construct-mc-costas-array-l3-s0", - "task_000260_7b7cc286", - "task_000663_dff2c340", - "pdbthink-s09-7ba4aa076b6bb5633953", - "expression-3", - "task_000056_f726766b", - "task_005684_3c8594a3", - "task_008998_ae4cbe72" - ], - "skill_family_count": 8, - "unregistered_available_tasks": { - "math": [], - "tmax": [], - "awm": [], - "pdbthink": [], - "loui": [] - } -} diff --git a/SHA256SUMS b/SHA256SUMS index 36d08f7fd65983069f59ee1ceb589cc78bf2a0e0..6a3d95b2e7a09445dfacd85f04d85ef2f3d6171e 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -1,59 +1,105 @@ -24641eca9bbd24aa8a02bda3cd37dcfb8445345df9b7b4997116ffd62746201e .gitattributes -e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 LICENSE -c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSES/Apache-2.0-PDBThink.txt -9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94 LICENSES/CC-BY-4.0.txt -a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6 LICENSES/MIT-Python-Repair.txt -c9d5f2c24789a4ee7502fd1426c6a2090ba766b24f20d0ef663d3b149b7466d3 LICENSES/MIT-adapters.txt -11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b LICENSES/ODC-BY-1.0.txt -ff16b8cf78343a7a32fbcb321a9ca9b1d3507bb320d2435b92577eba750e93ce LICENSES/README.txt -85da239bb4104a67e515dca538d1a4b345eed77c5d460fe76625bae905b431ed LICENSES/TMax-NOTICE.txt -7b862fd6aedfdf16a100c140f256175f666f670be7a8741bb27e95a972234a43 MANIFEST.json -11cfaddb6a6a011f4233b7217642bc2c1f2441e4be6749e175848d96912d78d0 README.md -1bcb19ab0927ecf8e0aeb7a11fff5fca73cf62387ecf56ac358ac294a09a7d36 REGISTRATION.json -4c6adc57279eb141e7c438621424616064194ad4421b74cc876a7414be7b23aa SOURCE_LOCK.json -9338fe69c7472bfb396c70489e4edf64d6a30cf696da9a4579d30c743414c529 components/awm/ADAPTATIONS.txt -c2b8e74a2b134a9efcbc78332d6688b4d44c0e9039f64b0e664f281824886060 components/awm/Dockerfile -1ea6a4d0c80da30d5f658364aaef2664cf09f32da0bce23c448e1fc1e4c4a7a6 components/awm/LICENSE_SCOPE.json -1aeed83147ee7f0ef0e0ab8bf92ab49404b86a135436bd32772e4e89e007b702 components/awm/NOTICE -ae057f0e66d0e924e81f553e729148cd98161bf070283928ef4fb658e9cf3546 components/awm/SOURCE_CREDITS.json -9696c2ccb89108c6d7edaa0fec84092ae3251ef049e5d43252341c29f03ce88e components/awm/TASKS.json -65d41089191536d5940648213b09924ba93e55d92df0080634e16d13615fd1ac components/awm/awm-requirements.lock -679c2e8e5ca63963ab80b2e89a14df5204fb0b70dad25714efb1f0b89cad8424 components/awm/config.json -3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58 components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json -8ad2959536e44caba47bcbeca9018e47e7157783194d19b429aa8f22a60f4771 components/awm/private/tasks/awm-accounting-1-invoice/initial.db -57362b907a2d454bbd29b95dfebb7d84207ce9d7e22533eaf54853ee4fb84990 components/awm/private/tasks/awm-accounting-1-invoice/original_api.py -3cd0d63022caa900e32bda0b0d3ae5c9948ce3c195b77ba1906c7ddebea9c58b components/awm/private/tasks/awm-accounting-1-invoice/original_verifier.py -0078892ae5870080b3417677926bc64f4f87ba9e8110ff400f18954e361455fc components/awm/requirements.lock -01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/awm/runtime/awm/__init__.py -887e81b7aab249861166099b3b4f0778f9041324640b904140d1b055d5a0bff1 components/awm/runtime/awm/adapter.py -0638af1cd1c6a311ee85109143ec6a59646a5f3d41c4b30312526dec561da33d components/awm/runtime/awm/launch_service.py -f47b0cc104a7a962fc932c4d3f3bb8bfcf1524dec049b9c2c33161924038b94e components/awm/runtime/awm/openenv_app.py -484c7caeaa301b91f468a9e55a251a6b529c6f9d0f2e4951c9602071c40ebcea components/awm/runtime/awm/server.py -b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f components/awm/runtime/awm/wire_client.py -b02f482ee9e55df0998b9fcc839a6172cbd1daf40701082062fa49416b31d6e0 components/awm/runtime/awm/worker.py -01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/awm/runtime/common/__init__.py -b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/awm/runtime/common/contracts.py -7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e components/awm/runtime/common/http_routes.py -26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/awm/runtime/common/models.py -12a0f7eb70edfb5e6fb02f9904c3e06daea24eab392ff4d6cef229ce18237810 components/awm/upstream/README.md -1cd23311c95c9919621b226c99dcab54faf815300c72cd542a394a5e69463a6e components/awm/upstream/accounting_1-gen_db.jsonl -99f1883338fa6f4827cb9c6c4c9cf9222c28a2a9842202cbe524921921de3ae3 components/awm/upstream/accounting_1-gen_envs.jsonl -28cf8d5611b0d63b9e17d0e991e328c2970cfef5595c08d084f2b1bad7a441fd components/awm/upstream/accounting_1-gen_sample.jsonl +e50227e76c5f0c86594f7fd55d13414bc1615800f93e01f4d4a3d3dd869533d5 LICENSES/README.txt +9b0b7c94692144732a7e73d09b8875feb4734276e42b46656615e07ac99c8142 README.md +8a55fa76364ae1cd88b1a1da39137400a318c40df4f1ff2941616c51cf5c4f17 SOURCE_LOCK.json +7c94b391b9d5738860b9270f471e27a99e17255f473b96f7bd1bf46a1d0c82da components/audit/Dockerfile +5d85c4ca9560bf6be77c0389e21719d726ff9442c7bc73e37a40d79c021eec47 components/audit/NOTICE +eea2ab8b6a11c6f41afce2488eeaa6d87a6c30f752cb60e76104c83ee02ab074 components/audit/README.md +0b0eafe25ffa560829dafcdd3ade2625043d5eaa03d725d153f40e6cacc15397 components/audit/SOURCE.json +6da4b8c7351046b8bfdb7e1ffe47dd6f40401c008497f2e8245673f356ab142d components/audit/config.json +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/audit/runtime/audit/__init__.py +3ff3233f5b306f1ce9f1db748820711148d5e0cbd663e8691f4163d6b9548d03 components/audit/runtime/audit/environment.py +dc79acae9a5d8abc4c816377745390421d50f317b5b307a76e64634b886ab8b6 components/audit/runtime/audit/server.py +01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/audit/runtime/common/__init__.py +b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/audit/runtime/common/contracts.py +6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd components/audit/runtime/common/models.py +e58b70774d5f729ae49c59cb82c019972e889b7353dabe1d6b9eefc085993119 components/audit/tasks/auth-05/instruction.md +141f54a8f1dc40c48f5a691cb2cdc9b15e8f3c029c7c3d500b8f8a054e82152b components/audit/tasks/ledger-01/instruction.md +cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 components/audit/upstream/LICENSE +638536fc5897e3dd2aea2ce4671bf321e45d6de0ece20bc857ea38126f058dc8 components/audit/upstream/audit_trail/__init__.py +5156b42a8bebe5bf119a654f8e081eea0c7614f32933b2fd262c078b66e54276 components/audit/upstream/audit_trail/models.py +c27b096b1833ae60a6dff6108164d107cd5ecd50524a38ba22dd695733011aeb components/audit/upstream/audit_trail/server/__init__.py +5428cf74f5d6a6ea75e67ad2eb061d96ed391bff146c01ece422b984273d1125 components/audit/upstream/audit_trail/server/audit_trail_environment.py +c2f1193259d9c0dfecc2645bcc7ba36b01d336cad2aa5cc3c7ed358f9aa27b2a components/audit/upstream/audit_trail/tasks.py +d70f12d0207ac89da7804330af5a207e1784e6603b565b73e40d786de75364b0 components/audit/upstream/dataset/README.md +dcb67aca547276783eb5f0da148ebcbd55d69d13cbb6dd437e0108ae971be1e8 components/audit/upstream/dataset/tasks.jsonl +c04a2771c0665225047882b2da49d452e20d7cc9bc0ea024a48f1cd31411c504 components/dnakhla/.dockerignore +a2464ca6190e49c967ccb0b521c8190dba35d94b9b2208e31562161f20f535b8 components/dnakhla/Dockerfile +cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 components/dnakhla/LICENSE +c306489df6e0c1049ff449d672d81e2aa5a78c66665c97b1b4448584be62f8f3 components/dnakhla/NOTICE +f06b54055f7f780cd3bdf94dc3a5fb7d5e8e48f083a29727261fcf51e8f5d209 components/dnakhla/README.md +6c0c97d7de7fa1381099f380cd5554d584ed7581e50b0dc2d43d15cd6ae5c1de components/dnakhla/SOURCE_MANIFEST.json +01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/dnakhla/runtime/common/__init__.py +b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/dnakhla/runtime/common/contracts.py +6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd components/dnakhla/runtime/common/models.py +adb5e5e6b8d1c5f4d2ff5bbfd4b66038c3d52e4ae50b0d3430c56a196d5ae5c3 components/dnakhla/runtime/dnakhla_compat/__init__.py +eaa4d0c0f293f3d53630eda1ad71921a8c1308b1ae375be3041bd3d0afc41369 components/dnakhla/runtime/dnakhla_compat/environment.py +d64b7539b8cc9f5dcc170dcd0c4c48e6673da923ce0f22b754c7859770032bd8 components/dnakhla/runtime/dnakhla_compat/server.py +8c68fdfde651ec70155ec1a8d4b15f5c14cdd1f9d98197fc5037b49d6dc74524 components/dnakhla/upstream/openenv.yaml +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/dnakhla/upstream/terminal_desk/__init__.py +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/dnakhla/upstream/terminal_desk/core/__init__.py +8606129c5aa3f99cc540a7c8269b65e9bb6c42e81bca36085c16963a0cccd2bd components/dnakhla/upstream/terminal_desk/core/grading.py +59b4b07b0d59e01792c8dbbf7877555e2da2346ddf5d2c17df3bbd4e17cb847f components/dnakhla/upstream/terminal_desk/core/shell.py +2ca3d4eda1fb04a84a236fbb43b71d13d46ea68109f545e036842211be3e3958 components/dnakhla/upstream/terminal_desk/families/__init__.py +d76cab459096d3748d2c4198753853d85418de61f64436cf4772b89345fdcf17 components/dnakhla/upstream/terminal_desk/families/base.py +312a26e2d48ac10a07716384d3059a697f75f16e5b37fcabb8c07fcac3397f6f components/dnakhla/upstream/terminal_desk/families/finance.py +a4839540c7a54198ea8e480248428e9ca65bdaf45adea5ae9f81cad71cbb1311 components/dnakhla/upstream/terminal_desk/families/finance3.py +9140985ca44b1bcfc78b853f44496b7a9b77288284675f3656898de5be70d6aa components/dnakhla/upstream/terminal_desk/families/industrial.py +48e914996b67accb09350a6714a5cea4a6191c0a05ac12a8f3045309f961c49c components/dnakhla/upstream/terminal_desk/families/industrial3.py +552855819cbe4983529b864279c915bc56f8d68d850a3f221d84864066c0e2a5 components/dnakhla/upstream/terminal_desk/families/mathematics.py +9dc54710cd826aadbe5de55d9093959e38c59dc59ae080e40d379cc4db1987c1 components/dnakhla/upstream/terminal_desk/families/mathematics3.py +52523502e6c679e34bd2dbeb46c3f539ba53ae2d4e1033adafca7ce859bc4de8 components/dnakhla/upstream/terminal_desk/families/media.py +9c91cfbde8ad60da034c15ba3418e21ae5891a12ce3932ecaf8035fcd6eef4bd components/dnakhla/upstream/terminal_desk/families/media3.py +11f76ce7d62e18b535278b487f798703fd6f2bef04dd7ffaefae2c95bcba1102 components/dnakhla/upstream/terminal_desk/families/office.py +1926c4a6e600cabb4cd35fab9528b4e4d55ef4adc1623b7229ac356ef28c987b components/dnakhla/upstream/terminal_desk/families/office3.py +836ab819a2231700a4bff2929a4579034c45a637992e883ddfbdb0c1f711446a components/dnakhla/upstream/terminal_desk/families/science.py +59477a1f9d38dbe5607f6432b4f8538342eec93faeed09bb6c9cb1402980c9a1 components/dnakhla/upstream/terminal_desk/families/science3.py +1228db896b6ce796ccf1f133e2f2ba9aaa9d54b745d5ffaf4b584a63a6aab2bd components/dnakhla/upstream/terminal_desk/families/security.py +6f5ec9c2dfe9aad81ba382d4f6ffdb7f64493d92cd7fe5d653134ef0dac107af components/dnakhla/upstream/terminal_desk/families/security3.py +4bca03797d701fe33f567729baa9a4fb2cef59cf220d0b79a941cc3817f8ba3a components/dnakhla/upstream/terminal_desk/families/software.py +d526ae88ca53ef22dbc1e578055fc27ebb491c184474e662736b8be9523086a7 components/dnakhla/upstream/terminal_desk/families/software3.py +f31264b0909878c6f2d4d18a270c7d92bc895052150c56e5ac3e6b38d4ceebb4 components/dnakhla/upstream/terminal_desk/models.py +04e4b102444b5db19507a46814820d78ad1e9782f963e5764f8f4adfe4d366a3 components/dnakhla/upstream/terminal_desk/oracles/__init__.py +975ff8045d42b2f483924e368e304c451bca894ddb4ba593d9dd3aea1c505329 components/dnakhla/upstream/terminal_desk/oracles/fin3_invoice_fraud.py +b0a32266ec725f5a4f76d8b40a27fc52759f679d74e4dfe5c7885a1b19a36711 components/dnakhla/upstream/terminal_desk/oracles/fin3_loan_schedule.py +152a3516b9ec6811121747ea875fc1a73cb768ba6a98e05c2bee91325e4f7247 components/dnakhla/upstream/terminal_desk/oracles/fin3_portfolio_value.py +47914a6e1a5bde126ce301bc11d4dc95b11cb0910ac0208a4c78596d7e65e30e components/dnakhla/upstream/terminal_desk/oracles/ind3_service_due.py +53e6adc26768256ce6665bda20c4b04ad87602e24eb31b074c25dc8fbbc00653 components/dnakhla/upstream/terminal_desk/oracles/ind3_stl_mass.py +c1049fdb6b4f11f0b5e0194b41e84b525d5a340213c2c94f5f99ffd6c2b75a42 components/dnakhla/upstream/terminal_desk/oracles/ind3_tank_balance.py +0fd62812cd9ef1d5be6d6ae9fa2fa047eb6bb0a4508ccb5a5369373aefbf8dd3 components/dnakhla/upstream/terminal_desk/oracles/math3_count_items.py +03908ec43159f4a66678f37fb0366389608eeeba41361758d966c96eea50dc3f components/dnakhla/upstream/terminal_desk/oracles/math3_exam_slots.py +c2bb32b08a3705a4be56ff8c4e3af94d64441c9a7432f5dcec4dce0b378ee465 components/dnakhla/upstream/terminal_desk/oracles/math3_route_plan.py +554e36455da66fd258e6ad2c39e80acbc3856237fee4608ce57b494f23c3d16d components/dnakhla/upstream/terminal_desk/oracles/med3_silence_report.py +8f0a1169d6e5b10c4981b53a22e957c4befad44d95e5d250cf53734105a40256 components/dnakhla/upstream/terminal_desk/oracles/med3_sprite_count.py +72f448ba58ac9ee6082692dec88ddb6f279ae69bdb99d39b30d1acce12c19bfe components/dnakhla/upstream/terminal_desk/oracles/med3_subtitle_retime.py +b5320a71696443f1b04c0c5e02e35d0baee67a175a912bff86e32df7c2acb357 components/dnakhla/upstream/terminal_desk/oracles/off3_ar_recon.py +6eef5e15337e5029c8e0b3353adee791ea9ebe73c6d79e47d84d6b7294cb5a38 components/dnakhla/upstream/terminal_desk/oracles/off3_meeting_slot.py +82b5c15f02a03615699429a2342dbad4b8985aab76d82fa8a8b96f7fbebc544f components/dnakhla/upstream/terminal_desk/oracles/off3_pdf_xlsx_diff.py +1ebc19667bf1963c83a47bd4905e99e0c32c3ce249b63ae2d7b39fcffa1b1bb7 components/dnakhla/upstream/terminal_desk/oracles/sci3_kinetics_fit.py +a983fb3c03ba15bc0591ab32ce41ddb99f2f38329e273f3f5da20f775d6bd8ab components/dnakhla/upstream/terminal_desk/oracles/sci3_lightcurve_period.py +56a84763e746f034571dc50a71f3716f340e4f8d9dee823eb3c9b209f471f48a components/dnakhla/upstream/terminal_desk/oracles/sci3_stoich_batch.py +c5fb5f697e8cfdb6008fcd59d6c3095a509d9a488dc28d7b99da4f4fe128b8a6 components/dnakhla/upstream/terminal_desk/oracles/sec3_auth_triage.py +5a4cc8a38f0554be4b287e2592bd26553db2f3ee6b5c10339d641246a7a6af90 components/dnakhla/upstream/terminal_desk/oracles/sec3_exfil_flows.py +b91c7389813445d55edbdaadec60aa4c5d0b6c5ead6fdfca5268e425f512820f components/dnakhla/upstream/terminal_desk/oracles/sec3_fw_verdicts.py +6b46601bc7e4bdc42c62242344aa431a34e7a6d1a8c7201e77315c66c6a4ae09 components/dnakhla/upstream/terminal_desk/oracles/sw3_dep_lock.py +43eee7f24a02ca3f0d3b12db5a44c132a931fc8dba10f9c1d4028d7fa5775bf4 components/dnakhla/upstream/terminal_desk/oracles/sw3_fix_module.py +4f1f187ae42f47faecc85d84e1f0341c848b03eb2bba1bf538927e2e62758314 components/dnakhla/upstream/terminal_desk/oracles/sw3_rate_limit.py +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/dnakhla/upstream/terminal_desk/server/__init__.py +6bf7658ec8ad07dda230a01fd893091a9b87df18ebf6af25af6c35965ed01fd8 components/dnakhla/upstream/terminal_desk/server/app.py +8e92f991e14098a0858490fe5beb43ca9b0ee2cfbddb36e73ecf987ba3922902 components/dnakhla/upstream/terminal_desk/server/environment.py 05cc6ae53cfd6129f1d7010aa874c6cf0a6019b1adfeff3f4fab27f2d04f43ca components/loui/.dockerignore -0b1054575ac49a8a80a9777e67280b41549b7ff6da909301b0fa8d87c1d8833d components/loui/Dockerfile -6321514f0aac58cdcd022b38f1be9c499d70b1f82a57a45a6878d816a4bcf293 components/loui/README.md -77ce88ca01b6eaad2babc63f0bc078674597336451275db2d72e282bf84b2592 components/loui/SOURCE.json -93e90e21198aa146280df24300947b36561b3c41fb51494f0bf5c2b793fc7330 components/loui/config.json +225304d22825c251c46ab771cabdb176edce0efe249789c528573e8bc42c904d components/loui/Dockerfile +0ab8e0b3aa9790d6aa7d273727bf5ccd2fc0c49d57a4075eeb6022b93c55693f components/loui/README.md +4da7db21c634d28a954e5f83145d7f6b2de7a5b1ab62ac193f815e6684ab1406 components/loui/SOURCE.json +bfad19ee80d40545950d8e47c7772d548d5b26f3e7873f1ff18d1ceeed04d5ee components/loui/config.json 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/loui/runtime/common/__init__.py b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/loui/runtime/common/contracts.py -26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/loui/runtime/common/models.py +6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd components/loui/runtime/common/models.py e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 components/loui/runtime/loui/__init__.py c4774351bdbd8a044cd20bcd7111ac4db7403feccb9444acf663e71140b27888 components/loui/runtime/loui/child.py edd467b474dc0982c9b6c91a9f0150432fa8b9a5c6b62c8187bc9cc9f440a22a components/loui/runtime/loui/environment.py -7c70a736ee8c5afbb3b5cf3e8113242e4dbb9efc3abe3a2027948474121d59f8 components/loui/runtime/loui/executor.py +eb1bb1ea6b9747c0541e592d6f39b3c543bc8e5f760dbdda4ead54eaea44cd8e components/loui/runtime/loui/executor.py c3ae4e00495724083e73085bd4dccdf3493094ef2e14c0bb017f6502d264244b components/loui/runtime/loui/server.py 09ef2d8fc856ca3dc5662c279df705e9accc827f4472dc34758ffe769d116128 components/loui/tasks/expression-3/instruction.md -682c7db0f0911e85174652574349fbe957c1cc235a68d224c569e405d9674452 components/loui/tasks/incident-3/instruction.md a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6 components/loui/upstream/LICENSE bf5da0c7b871459278ad174cfd3c4ba90de9fbe74d35decce007bed13535d32d components/loui/upstream/v3/README.md 578814be5152b9b00c7eeae387544a94db159c9e8e3456e5cb56b31b6a731e9a components/loui/upstream/v3/execution.py @@ -61,158 +107,25 @@ f140fcf554e97b67afb14e961affc46c14320cb784fe1f7444585e77ceb89ea0 components/lou 67f546daef6e7902c12754cbbd883657e57d2cb21e109275af123c552cc93422 components/loui/upstream/v3/server.py 9715cdabe6e67287399a3fe2bad435852510bf854982d2f6695b3d87db395c88 components/loui/upstream/v3/tasks.jsonl 71caf0175532025bf138398229d466f18e5e03365b48853efd92f61f6dae2d66 components/loui/upstream/v3/tasks.py -83af5f0a6ae61c968b666a5d1854020a8ee8cf174562ca9d59afc397f46444ae components/math/ADAPTATIONS.txt -f6f0505f720c1b8bb8202cbdc8c5d16f270646dc006b47fdbc1d8852f757c848 components/math/Dockerfile -a4650234425608cbdb194ace7ba22812b4c14c1609a8a7808c2997bf92cdd2c7 components/math/NOTICE.txt -a037cf3ce617aa3e0216bf5e0677d229679bfffdd30dba9057b58bb413c39732 components/math/SDK_DEPENDENCIES.json -4d29eba8369ddbcbeab51dabe14f411512b1117b3787f59c1d406938f0b927ac components/math/SOURCE.json -5b232f75ae416ebe7094f0c85010ac6cb41dfecfd601aa7b5ed51712e75dc29a components/math/TASKS.json -a0707b688bdabc7c7634d41bcd9031b6639896a2fc4b04ec6a06c2ac11dfb68c components/math/config.json -9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94 components/math/licenses/MathConstraint-LICENSE -10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e components/math/licenses/RLVE-LICENSE -200b2ce93f2a5b9671165f9aea3cc4d89db995352c1e1e3db6d418262b058516 components/math/licenses/UPSTREAM_COLLECTION_LICENSES.md -01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/math/runtime/common/__init__.py -b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/math/runtime/common/contracts.py -7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e components/math/runtime/common/http_routes.py -26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/math/runtime/common/models.py -01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/math/runtime/native_shell/__init__.py -80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3 components/math/runtime/native_shell/actor_launcher.py -34dba81df98422b07004d85a922d7db1246532a9d24b0be7eb103b89e0894e4e components/math/runtime/native_shell/backend.py -cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53 components/math/runtime/native_shell/environment.py -31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e components/math/runtime/native_shell/guard.py -db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b components/math/runtime/native_shell/launch_service.py -1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e components/math/runtime/native_shell/process_scope.py -c8bb079f359fe4ac6c1764cbf47fdcfaa3f3caee35ff6c41e845bee3e965d454 components/math/runtime/native_shell/server.py -6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465 components/math/runtime/native_shell/verifier_launcher.py -b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af components/math/runtime/native_shell/wire_client.py -56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c components/math/upstream/construct-mc-costas-array-l3-s0/environment/Dockerfile -15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5 components/math/upstream/construct-mc-costas-array-l3-s0/environment/instance.json -88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9 components/math/upstream/construct-mc-costas-array-l3-s0/instruction.md -b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32 components/math/upstream/construct-mc-costas-array-l3-s0/task.toml -3c0290e35201f077926099989cd0e82c10bf091cb33c572cacc02bca075debdb components/math/upstream/construct-mc-costas-array-l3-s0/tests/check.py -15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5 components/math/upstream/construct-mc-costas-array-l3-s0/tests/instance.json -d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73 components/math/upstream/construct-mc-costas-array-l3-s0/tests/run.py -a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e components/math/upstream/construct-mc-costas-array-l3-s0/tests/test.sh -b0cbd2dbfe130357ab86c48b3f0ee1acca985828022542d97f1f9d77e147f261 components/pdbthink/DEPENDENCIES.json -a059eac1b72cef773aee8d849c48f0b090e5d87802cfdf8ae3e8456595ba4e87 components/pdbthink/Dockerfile -6329e8c6c33a5f04e11dbdcba6f43bb7dba10439d969a97b28901d7681ece8b6 components/pdbthink/config.json -7c98afbca1961f056579b344a5552c574582c6c19926578a748519fdd99496d7 components/pdbthink/licenses/DEPENDENCIES.json -c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 components/pdbthink/licenses/LICENSE-PDBTHINK -b799de2e9e91ea8ee515bca1fee21cef759b73938cf952e629c8fb9543cc6638 components/pdbthink/licenses/SOURCE.json -7d267c32438351a4d92533f6e9960da36a1e39c768ad56988904029cb90da0c5 components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/public_task.json -8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py -72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py -8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34 components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py -4ed8e4260bc71b5a863888cd3fa2c7bca6210fc5138f96fd2207462c348318b7 components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json -bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh -628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4 components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml -91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py -0078892ae5870080b3417677926bc64f4f87ba9e8110ff400f18954e361455fc components/pdbthink/requirements.lock -01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/pdbthink/runtime/common/__init__.py -b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/pdbthink/runtime/common/contracts.py -7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e components/pdbthink/runtime/common/http_routes.py -26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/pdbthink/runtime/common/models.py -9f56e761d79bfdb34304a012586cb04d16b435ef6130091a97702e559260a2f2 components/pdbthink/runtime/pdbthink/__init__.py -1683d5e2fab016801207ecdde6cbd4d3730ed8c4ca22aafd0f3bf651dce0faf1 components/pdbthink/runtime/pdbthink/adapter.py -cc89f1e687da1a71af567ac450fd761da0e5d4fe56901695de304aabd81c59bd components/pdbthink/runtime/pdbthink/launch_service.py -7ab1b3b05068cd5b0f20497062a8da5fd905c45e8eee295cb8f2fc5c7aca6577 components/pdbthink/runtime/pdbthink/openenv_app.py -76012b37d916b4044c6fe1da4e7accdf9faa2216f50c73d5b87cd12b7f1d70cf components/pdbthink/runtime/pdbthink/server.py -b1f6f82ff9e113aedd742a8f4b0c18c545020677503765ee913c31e20964b96f components/pdbthink/runtime/pdbthink/transport.py -b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f components/pdbthink/runtime/pdbthink/wire_client.py -58d031f7955f7f774733189b8297a1db7f515bb206c26ac50fad68f580848974 components/tmax/DEPENDENCIES.json -7c4a25fee86ff7295519547dac7f594103c7137ec746423dd452c076a920cbb4 components/tmax/Dockerfile -9ae187d852f4cd6974fc9c65fba942df4e5586d73ddb3c48916a09376a3d36ac components/tmax/LICENSE_SCOPE.json -f30eb64313c2645348ca3d965c40c9a466eb3754f3302206e44133d19bc87d6a components/tmax/NOTICE.txt -e0e598c0fc7ac71b15ee4668ad88f11b9e1084d62610d0535038d5a034d1c946 components/tmax/SOURCE.json -7b4d7c93c6f7477c2962ee8ae8746bfe941991de3b940400013a15d1bba87536 components/tmax/TASKS.json -e2aff0a5d12d5f45d675854f26b6b5164bfac7fe1cf4193dab4ce879021bae64 components/tmax/config.json -11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b components/tmax/licenses/ODC-BY-1.0.txt -0e66e8816b8f2b4a17d37ec7abc5b8ca5708bae9d71d2c5323d8666d7e7ffa1d components/tmax/licenses/TMAX_DATASET_README.md -836618cb7e01e236878d367272157e4be6a31d538bf8b9f8cc9ed630aac04482 components/tmax/requirements.lock -01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/tmax/runtime/common/__init__.py -b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/tmax/runtime/common/contracts.py -7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e components/tmax/runtime/common/http_routes.py -26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a components/tmax/runtime/common/models.py -01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/tmax/runtime/native_shell/__init__.py -80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3 components/tmax/runtime/native_shell/actor_launcher.py -4b71d8cd0f017716e6df6cc64ee268a725be5fb6e363034bae2f9c8b0184b0ba components/tmax/runtime/native_shell/backend.py -cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53 components/tmax/runtime/native_shell/environment.py -31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e components/tmax/runtime/native_shell/guard.py -db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b components/tmax/runtime/native_shell/launch_service.py -1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e components/tmax/runtime/native_shell/process_scope.py -c8bb079f359fe4ac6c1764cbf47fdcfaa3f3caee35ff6c41e845bee3e965d454 components/tmax/runtime/native_shell/server.py -6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465 components/tmax/runtime/native_shell/verifier_launcher.py -b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af components/tmax/runtime/native_shell/wire_client.py -eab8396a1b533f70468039f8ac1b5fe9927faf4ded578172ec932ef7bf2af22a components/tmax/tasks/task_000056_f726766b/source/external/app/vibration_data.wav -714f780883970365cfffe408e2c76e75f499005f87551fc84b55d79368e77197 components/tmax/tasks/task_000056_f726766b/source/instruction.md -e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0 components/tmax/tasks/task_000056_f726766b/source/task.toml -3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e components/tmax/tasks/task_000056_f726766b/source/tests/test.sh -327c5346a779a44e27ef0cbd9f107e863d599fc6e47f95f248eaec03c15117c4 components/tmax/tasks/task_000056_f726766b/source/tests/test_final_state.py -a6c4cf2043d8642babb9b546096b3f559a375b59d54a43efebd57e9728466184 components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/find_threshold.sh -4631f1f805e6b826a796502ed5d94e676b3061cf448f2f9225116395aa3bb13b components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/process.sh -f3ae2df41978712dbffe58665a9582e3d0951f211c5cca5ece9f536225d28ba8 components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/serialize.sh -3c04251fe92c30d29ac4d887608f4385176e3bda932594437f82b08a5b348938 components/tmax/tasks/task_000260_7b7cc286/source/external/app/video.mp4 -79c9fd4e4d41524db109d90b0415a4f0a2b9d24bf690fa8d7340ce3cb5ce0975 components/tmax/tasks/task_000260_7b7cc286/source/instruction.md -d36c49060b4ddbca3b13a5aa98cf5b195c07bff725b91107f58a087ec4325423 components/tmax/tasks/task_000260_7b7cc286/source/task.toml -3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e components/tmax/tasks/task_000260_7b7cc286/source/tests/test.sh -aae204101d5c024a0b5cbda42fa686e7d2928fd9be3ad55fd14314b2502182a5 components/tmax/tasks/task_000260_7b7cc286/source/tests/test_final_state.py -170911a153d00eb0f037ca56a2cbd10d4aa2b7a418e25a0f1df58b1c77589788 components/tmax/tasks/task_000663_dff2c340/pristine/backup_catalog.db -feae25374139b4b1d8ec9759d553c591841d9330a071217f46a2e464bd32bbd7 components/tmax/tasks/task_000663_dff2c340/source/instruction.md -85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a components/tmax/tasks/task_000663_dff2c340/source/task.toml -3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e components/tmax/tasks/task_000663_dff2c340/source/tests/test.sh -7a273b9bf8bc61eeec1b8dda674b5f6ba5356abbfd923b413b09d2584c1ef72f components/tmax/tasks/task_000663_dff2c340/source/tests/test_final_state.py -9fe1c89ee823f133d35dea66840ecb7f87d599487524b7aa1d6371e8f664058e components/tmax/tasks/task_005684_3c8594a3/pristine/compliance_audit.db -f4eee4e0643fcfb7399df10e1947ec9dbda28c74bacf307167f443506268f583 components/tmax/tasks/task_005684_3c8594a3/source/instruction.md -5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2 components/tmax/tasks/task_005684_3c8594a3/source/task.toml -3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e components/tmax/tasks/task_005684_3c8594a3/source/tests/test.sh -495630c7ede4e75ef5644c1ee5b69f04969a4059ef094787c19a3014734d3cf2 components/tmax/tasks/task_005684_3c8594a3/source/tests/test_final_state.py -d6b5039ee32f3a43069245984c8fe5a9689028a9aac06e26a64017c54bd11976 components/tmax/tasks/task_008667_2151f271/pristine/data/financial.db -629b28471809f802c58831d100315b83012c0066df3b265a2d379a19e61a2262 components/tmax/tasks/task_008667_2151f271/pristine/data/transactions.jsonl -50d1d10121dfa3b565842fd10f2589ceb91b4459126787af7793cec9cc0d06b1 components/tmax/tasks/task_008667_2151f271/source/instruction.md -d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897 components/tmax/tasks/task_008667_2151f271/source/task.toml -3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e components/tmax/tasks/task_008667_2151f271/source/tests/test.sh -cb73fd0ab1765768ebfecc50054ba13c143cc51be201127515eb495904ddf9e6 components/tmax/tasks/task_008667_2151f271/source/tests/test_final_state.py -909d2e964c0831d8af91b722b4424ed829c261d6b7db1a95180d8a809527ddaf components/tmax/tasks/task_008998_ae4cbe72/pristine/robot_dump.log.gz -f81f86b07681931baabdba313cc4e988c01bff7a1f1d83349dfa939cdaa20669 components/tmax/tasks/task_008998_ae4cbe72/source/instruction.md -c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9 components/tmax/tasks/task_008998_ae4cbe72/source/task.toml -3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e components/tmax/tasks/task_008998_ae4cbe72/source/tests/test.sh -e03b84ca0519367e5f86b7b3a3231afa5209b1971431497699200099035f5014 components/tmax/tasks/task_008998_ae4cbe72/source/tests/test_final_state.py -c44d259c4421b16dc5f0bc3912cdd800f6c25746ea31bede5060c9605b225025 components/tmax/upstream/task_000056_f726766b/environment/Dockerfile -fc9e91cc78e1817d80b4ba8c2dc9a638d0c57959825ee34f5e3d7688ad80dfb9 components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.label.txt -f55a8eec263c9be975b2adccdda6a07c680109b851a89f55779f14076aaa30d5 components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.wav -0e71b3e06fcf8cc6f9d95ba2e9664dfbba7786949a0e21b810ada563ae27a637 components/tmax/upstream/task_000056_f726766b/environment/base_install.sh -70d52288d5c9a7d23bbd63fb086a7f886961a1335632cc6efb892572d197563b components/tmax/upstream/task_000056_f726766b/environment/post_install.sh -e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0 components/tmax/upstream/task_000056_f726766b/task.toml -98f66d958e8ee701c0579095c2e65254a63194845b894a45db2a6180a46a3193 components/tmax/upstream/task_000260_7b7cc286/environment/Dockerfile -4a44dc15364204a80fe80e9039455cc1608281820fe2b24f1e5233ade6af1dd5 components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.label.txt -bf759113108b136ec3b5fa507d035c1e66ac243b52da09fa07ab58566ee27f58 components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.mp4 -0e71b3e06fcf8cc6f9d95ba2e9664dfbba7786949a0e21b810ada563ae27a637 components/tmax/upstream/task_000260_7b7cc286/environment/base_install.sh -ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03 components/tmax/upstream/task_000260_7b7cc286/environment/post_install.sh -483c9171d3e67bec029d9b88cee24d554fa9310a61ec47940312be5f2951bc30 components/tmax/upstream/task_000260_7b7cc286/task.toml -ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535 components/tmax/upstream/task_000663_dff2c340/environment/Dockerfile -a449c18295cee8a3e7ed0c958fe219cbed2d2a8e7fdad924f2679444b3377b94 components/tmax/upstream/task_000663_dff2c340/environment/post_install.sh -85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a components/tmax/upstream/task_000663_dff2c340/task.toml -ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535 components/tmax/upstream/task_005684_3c8594a3/environment/Dockerfile -b431517fec535c62b42b517f9212cbb1e9cf80bdf883a55c02bfba08f0d4c404 components/tmax/upstream/task_005684_3c8594a3/environment/post_install.sh -5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2 components/tmax/upstream/task_005684_3c8594a3/task.toml -ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535 components/tmax/upstream/task_008667_2151f271/environment/Dockerfile -3a777366c4b998e6368627f4775a73cea29fdbdc9991daedfb13244153c17841 components/tmax/upstream/task_008667_2151f271/environment/post_install.sh -d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897 components/tmax/upstream/task_008667_2151f271/task.toml -ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535 components/tmax/upstream/task_008998_ae4cbe72/environment/Dockerfile -26dfa63d063430c2370144b8e30c1f905dde4e2722403c1e8131a5a84e2d5e69 components/tmax/upstream/task_008998_ae4cbe72/environment/post_install.sh -c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9 components/tmax/upstream/task_008998_ae4cbe72/task.toml -abea24b268b08f72897859e527fe90c89c08d2afab7305cf52d4255f2feeb897 prepare_source_tree.py +54805fba51273053c3dd388970db3b31aae4de8e5998f1c05e735c18e242857f components/metaharness/.dockerignore +1bfc7ebdbe65d93c93fa3122a2efb3e3cf8f6c138113fb6be9d09e5bfe2061ba components/metaharness/Dockerfile +09ed6717912f408da29e15b55170cd56c9658218a540b7c72e70909b9101274c components/metaharness/LICENSE +605977e7d6dcc2b1eda0dfc6501d2b1d5c64c129ff84e793a9a983919530e1ed components/metaharness/NOTICE +99e6a092e24b941b4ac79a57eeb593beff579f199d3994f73aa7e538f98398d9 components/metaharness/README.md +6bea52680ab6b140300653d1c98c356dbd0bc9c8da4bab722b21071baa7ec4a9 components/metaharness/SOURCE.json +3f122a94c8aecb947b4f95bc2a8d67980ec9a9bc2b7adeea3b1c5e08c3504e06 components/metaharness/TASKS.json +01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b components/metaharness/runtime/common/__init__.py +b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1 components/metaharness/runtime/common/contracts.py +6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd components/metaharness/runtime/common/models.py +485aa11684c1ca537e3f439ceb3e2bcdfb8848e1012ada02cb5783ae3deeb02d components/metaharness/runtime/shared_adapter.py +ceddb0dfe82b01ae91859db2215fa697381064801f0eb0a4d96dd6d0473bd25e components/metaharness/upstream/Dockerfile +8802e5b5d1796dc9d15647705598971ec4be2e7b53e6b30556440a5ebb89d069 components/metaharness/upstream/README.md +d0cca47bd35b44e121fb394856996d9f2271c29528b73d5b6160ab63f47f9a0f components/metaharness/upstream/arena_env/__init__.py +62815cb244cb4404379dc28e897503994bef49a8e4f4b5721dace574a8865c63 components/metaharness/upstream/arena_env/app.py +d6882e2c9dabf1ee0fde75df0acdef85670598da633ce523cf54038fd40562a9 components/metaharness/upstream/arena_env/environment.py +94e29b6d884302f57e9440591cca5c07350cc4eb47d9e4e9f7a27689c519b781 components/metaharness/upstream/arena_env/tasks.py +3fbed6fc6af3931cdacd290353a02ba1740222974c91a022145ec4e6a5f3a347 components/metaharness/upstream/requirements.lock +bb488a65100922227f9e7e8288beced72577c44cec8c2aa7a54be446d6ce9606 components/metaharness/upstream/tasks.selected.jsonl 10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4 schema.json -c732c9b64fa1482028dc6fb2c0839496275e3250914df6e94e3dd6788cb04d43 tasks.jsonl -66b564f58a409177999eda6eea1e5c8009d88c6d72faffa1bac7c497b800a460 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile -21dc586748f23a8630118831399e1c40d62443444d454bf6f5e7f60ba334b06f upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md -97d07b9814fff65f7cd78bf968d4854aa2aa75e8535ceb574b35a93dbf087db0 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/prompt.json -45af241c0dc3ed0b71fff4db4b2f334760bc387aaff0a74a6dc9543cce2effe1 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/task.toml -8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py -72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py -8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py -4ed8e4260bc71b5a863888cd3fa2c7bca6210fc5138f96fd2207462c348318b7 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json -bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh -628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4 upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml -91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py -0a92b0131b3b069468a5c0e32016a4f76b3f11395531a223b9a131175c2ae274 validate_dataset.py +8bd6a842e43e36b3200d5b536d66ba3c66635c9ce4fe1ca812b561e25fc84182 tasks.jsonl +59c642280ff82be024351b29b654a8f7b1eea9e101fc0579c79a3e258e2f2c29 validate_dataset.py diff --git a/SOURCE_LOCK.json b/SOURCE_LOCK.json index 1d603da166893564b531b10a0bd4fb024cdef4a0..4d97c4041a7759bd05a5abe9edeae723e723e0c0 100644 --- a/SOURCE_LOCK.json +++ b/SOURCE_LOCK.json @@ -1,2585 +1,41 @@ { - "format": "multidomain-source-lock-v2", - "source_revisions": { - "math": { - "repository": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "url": "https://huggingface.co/datasets/amphora/MathConstructOptimize-Envs-harbor/tree/66cd5c87d51113c76faaef1b05397f1a6282a0f7" - }, - "tmax": { - "repository": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "url": "https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798", - "original_dataset": { - "id": "allenai/TMax-15K", - "revision": "e3ded940596cc611c9815684ba51a7e8ee0cffc9", - "authors": "Allen Institute for AI (Ai2); Hamish Ivison, Junjie Oscar Yin, Rulin Shao, Teng Xiao, Nathan Lambert, Hannaneh Hajishirzi", - "url": "https://huggingface.co/datasets/allenai/TMax-15K/tree/e3ded940596cc611c9815684ba51a7e8ee0cffc9", - "declared_license": "ODC-BY-1.0", - "license_text": "licenses/ODC-BY-1.0.txt", - "dataset_readme": "licenses/TMAX_DATASET_README.md", - "dataset_readme_sha256": "0e66e8816b8f2b4a17d37ec7abc5b8ca5708bae9d71d2c5323d8666d7e7ffa1d", - "upstream_notice": "The original dataset README states research and educational use in accordance with Ai2 Responsible Use Guidelines, and that included Gemini 3.1 Pro outputs are subject to Google Terms of Service." - } - }, - "awm": { - "repository": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "url": "https://huggingface.co/datasets/Snowflake/AgentWorldModel-1K/tree/dde80a0283fe781bdc51656bce57063dc5650213" - }, - "pdbthink": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "url": "https://huggingface.co/datasets/open-athena/pdbthink-coordinate-tasks/tree/3734406cb97b1702844319f9a5d860cbbf8fe660" + "components": { + "dnakhla": { + "repository": "dnakhla/terminal-desk", + "revision": "08fab0beb50b665b42f0ac73840f03140f4ad1c9", + "license": "Apache-2.0", + "source_file": "SOURCE_MANIFEST.json", + "instance_policy": "Original random generation at reset; client seed does not select the instance.", + "reward": "Original artifact grader: all required checks must pass.", + "record_sha256": "6c0c97d7de7fa1381099f380cd5554d584ed7581e50b0dc2d43d15cd6ae5c1de" + }, + "metaharness": { + "repository": "ruv/metaharness-arena-tasks", + "revision": "c359366240115bfb24d2edae807c8e52ed5b39f0", + "code_revision": "4657e5b82e124917b01d79ee5e9de41badb48fda", + "license": "MIT", + "source_file": "SOURCE.json", + "instance_policy": "Original explicit seed or original random generation when seed is absent.", + "reward": "Original component scoring, capped below full credit for incomplete answers.", + "record_sha256": "6bea52680ab6b140300653d1c98c356dbd0bc9c8da4bab722b21071baa7ec4a9" + }, + "audit": { + "repository": "NoeFlandre/audit-trail", + "revision": "f821596324c2d3f29130ebc7054a22c6bd5559d4", + "license": "Apache-2.0", + "source_file": "SOURCE.json", + "instance_policy": "Original fixed task seed and log; client seed does not alter the instance.", + "reward": "Original normalized exact answer: 0 or 1.", + "record_sha256": "0b0eafe25ffa560829dafcdd3ade2625043d5eaa03d725d153f40e6cacc15397" }, "loui": { "repository": "Louistiti/openenv-python-repair", "revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "url": "https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad/v3", - "github_revision": "8762c34c465ab37304f2c967d5a01d55283f2531" - } - }, - "reviewed_records": [ - { - "id": "mimo-code/COMPONENT_MANIFEST.json", - "sha256": "18647d4755104e269272e630575a03f38c3b0c619508ca899e5bbaa6347f9cf2", - "scope": "Reviewed component file hashes; record retained by assembler outside distributable dataset." - }, - { - "id": "awm/ALLOWLIST.json", - "sha256": "3717619363578e543a793f0fbb4147a6190f3f7c14cdbe26695b2e768d92d0ee", - "scope": "Reviewed component file hashes; record retained by assembler outside distributable dataset." - }, - { - "id": "math/FILE_ALLOWLIST.json", - "sha256": "f6e0c00a922d52a38cc1ac79aa0ebc83db27f6dafce7e8919168853cf3dd035e", - "scope": "Reviewed component file hashes; record retained by assembler outside distributable dataset." - }, - { - "id": "pdbthink/PDB_COMPONENT_SOURCE.json", - "sha256": "462e07513666a3fdf210344cc35a69638d18da2ee19b8f860686157869516636", - "scope": "Reviewed component file hashes; record retained by assembler outside distributable dataset." - }, - { - "id": "pdbthink/v2-MANIFEST.json", - "sha256": "4275ccf9cd830e8f225cff8814a08448edd6a87b211c0d7bbef849f5bee0ea74", - "scope": "Previously frozen original PDB source and retained license texts." - }, - { - "id": "tmax/FILE_ALLOWLIST.json", - "sha256": "eb812e240c1ed5d50c28efdcc4b172ade8574571e4fc0cbb01837b6e0bdf13cf", - "scope": "Frozen 80-file component review; exact Harbor archive members and materialized setup outputs are separately identified." - }, - { - "id": "presentation-cleanup-20261011", - "sha256": "7613df9c6ce9960d094ee8128071985c0ab1e9ee125d43c24b33a06bb4184a46", - "scope": "Project adapter comments and packaging text only." - }, - { - "id": "english-documentation-20261011", - "sha256": "bd112e671c83f0c37ac24791b7cd3c18a8f14d8a65287106af3931bab44d63e9", - "scope": "English project documentation and task index descriptions" - }, - { - "id": "openenv-runtime-compatibility-20261012", - "sha256": "7f3648c4b58e756b16a74efcb5eb1fc2d9ed481b77417c0fd1136f96c35c96e2", - "scope": "Native SDK sessions, scoped process cleanup, platform temporary files, and execution error classification" - }, - { - "id": "training-runtime-repair-20261013", - "sha256": "ef2a2d727deb04564171d8153f88a7e34af6efe04936f260330dcf5c6bbb0948", - "scope": "Shell command response margin and accounting SQLAlchemy session lifetime." - }, - { - "id": "multidomain-v4-adapters", - "sha256": "fdb8dcf0c9998f7a2e405249b44203a4b667bb7b2be876d1486e726e68998292" - }, - { - "id": "loui-pinned-originals", - "sha256": "77ce88ca01b6eaad2babc63f0bc078674597336451275db2d72e282bf84b2592" - } - ], - "runtime_registries": { - "math": { - "path": "components/math/config.json", - "tasks_pointer": "/tasks", - "id_field": "id", - "instruction_sha256_pointer": "/source_sha256/instruction.md" - }, - "tmax": { - "path": "components/tmax/config.json", - "tasks_pointer": "/tasks", - "id_field": "id", - "instruction_sha256_pointer": "/source_sha256/instruction.md" - }, - "awm": { - "path": "components/awm/config.json", - "tasks_pointer": "/tasks", - "id_field": "task_id" - }, - "pdbthink": { - "path": "components/pdbthink/config.json", - "tasks_pointer": "/tasks", - "id_field": "task_id", - "instruction_sha256_pointer": "/original_instruction_sha256" - }, - "loui": { - "path": "components/loui/config.json", - "tasks_pointer": "/tasks", - "id_field": "task_id", - "instruction_sha256_pointer": "/instruction_sha256" - } - }, - "instruction_fields": { - "components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json#/task": { - "sha256": "a08b48d978d8a70cfea5c6e871d079622fc99ac8438fb38d6d6816bdfa399c99", - "source_record": "gen_tasks.jsonl#scenario=accounting_1;tasks[1]", - "repository": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "encoding": "UTF-8 of decoded JSON string, without an added newline", - "reviewed_record": "awm/ALLOWLIST.json" - } - }, - "selected_task_ids": [ - "awm-accounting-1-invoice", - "incident-3", - "task_008667_2151f271", - "construct-mc-costas-array-l3-s0", - "task_000260_7b7cc286", - "task_000663_dff2c340", - "pdbthink-s09-7ba4aa076b6bb5633953", - "expression-3", - "task_000056_f726766b", - "task_005684_3c8594a3", - "task_008998_ae4cbe72" - ], - "schema_sha256": "10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4", - "required_directories": [ - { - "path": "components/tmax/tasks/task_000056_f726766b/pristine", - "role": "frozen_pristine_workspace_root", - "empty": true, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_000056_f726766b/source", - "role": "frozen_task_source_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_000260_7b7cc286/pristine", - "role": "frozen_pristine_workspace_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_000260_7b7cc286/source", - "role": "frozen_task_source_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_000663_dff2c340/pristine", - "role": "frozen_pristine_workspace_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_000663_dff2c340/source", - "role": "frozen_task_source_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_005684_3c8594a3/pristine", - "role": "frozen_pristine_workspace_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_005684_3c8594a3/source", - "role": "frozen_task_source_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_008667_2151f271/pristine", - "role": "frozen_pristine_workspace_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_008667_2151f271/source", - "role": "frozen_task_source_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_008998_ae4cbe72/pristine", - "role": "frozen_pristine_workspace_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - }, - { - "path": "components/tmax/tasks/task_008998_ae4cbe72/source", - "role": "frozen_task_source_root", - "empty": false, - "reviewed_record": "tmax/FILE_ALLOWLIST.json" - } - ], - "files": { - "LICENSES/Apache-2.0-PDBThink.txt": { - "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", - "bytes": 11357, - "role": "upstream_license", - "reviewed_record": "pdbthink/v2-MANIFEST.json", - "source": { - "source": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "upstream_path": "LICENSE", - "byte_identical_to_input": true - } - }, - "LICENSES/CC-BY-4.0.txt": { - "sha256": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94", - "bytes": 18656, - "role": "upstream_license_copy", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "vireshpati/Math-Constraint", - "source_url": "https://github.com/vireshpati/Math-Constraint/blob/main/LICENSE", - "git_blob_sha": "4ea99c213c5c0c005ae4e80df8e52169d06896ec", - "license": { - "key": "cc-by-4.0", - "name": "Creative Commons Attribution 4.0 International", - "spdx_id": "CC-BY-4.0", - "url": "https://api.github.com/licenses/cc-by-4.0", - "node_id": "MDc6TGljZW5zZTI1" - }, - "sha256": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94", - "retrieval_scope": "license text only; not a claim about the original generator revision" - } - }, - "LICENSES/MIT-Python-Repair.txt": { - "sha256": "a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6", - "bytes": 1070, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "LICENSES/MIT-adapters.txt": { - "sha256": "c9d5f2c24789a4ee7502fd1426c6a2090ba766b24f20d0ef663d3b149b7466d3", - "bytes": 1083, - "role": "adapter_license", - "reviewed_record": "pdbthink/v2-MANIFEST.json", - "source": { - "source": "existing project license", - "revision": null, - "upstream_path": "LICENSE", - "byte_identical_to_input": true - } - }, - "LICENSES/ODC-BY-1.0.txt": { - "sha256": "11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b", - "bytes": 19977, - "role": "upstream_license", - "reviewed_record": "pdbthink/v2-MANIFEST.json", - "source": { - "source": "Open Data Commons", - "revision": "1.0", - "upstream_path": "https://opendatacommons.org/licenses/by/1-0/", - "byte_identical_to_input": true - } - }, - "LICENSES/README.txt": { - "sha256": "ff16b8cf78343a7a32fbcb321a9ca9b1d3507bb320d2435b92577eba750e93ce", - "bytes": 1500, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "LICENSES/TMax-NOTICE.txt": { - "sha256": "85da239bb4104a67e515dca538d1a4b345eed77c5d460fe76625bae905b431ed", - "bytes": 982, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/awm/ADAPTATIONS.txt": { - "sha256": "9338fe69c7472bfb396c70489e4edf64d6a30cf696da9a4579d30c743414c529", - "bytes": 444, - "role": "packaging_metadata", - "reviewed_record": "training-runtime-repair-20261013", - "parent_sha256": "726ee5400f83d3b47a4c0fae60e9a085a590c7a9abc8e6d2b910037d89f253ac" - }, - "components/awm/Dockerfile": { - "sha256": "c2b8e74a2b134a9efcbc78332d6688b4d44c0e9039f64b0e664f281824886060", - "bytes": 323, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "1c26892b11e285d319e7ebc65f6cb275d38e5a4e5b581f9d022b026d72a3a3db" - }, - "components/awm/LICENSE_SCOPE.json": { - "sha256": "1ea6a4d0c80da30d5f658364aaef2664cf09f32da0bce23c448e1fc1e4c4a7a6", - "bytes": 908, - "role": "packaging_metadata", - "reviewed_record": "awm/ALLOWLIST.json" - }, - "components/awm/NOTICE": { - "sha256": "1aeed83147ee7f0ef0e0ab8bf92ab49404b86a135436bd32772e4e89e007b702", - "bytes": 642, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "4d91952ef79d73182302464db3d190b0427ac04754eb6b7f5b1e8ad739c0bb1c" - }, - "components/awm/SOURCE_CREDITS.json": { - "sha256": "ae057f0e66d0e924e81f553e729148cd98161bf070283928ef4fb658e9cf3546", - "bytes": 469, - "role": "packaging_metadata", - "reviewed_record": "awm/ALLOWLIST.json" - }, - "components/awm/TASKS.json": { - "sha256": "9696c2ccb89108c6d7edaa0fec84092ae3251ef049e5d43252341c29f03ce88e", - "bytes": 1480, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "4d97456d2794c1f347c47f3c32733294d83778165d99b923bae4ebeec15261b2" - }, - "components/awm/awm-requirements.lock": { - "sha256": "65d41089191536d5940648213b09924ba93e55d92df0080634e16d13615fd1ac", - "bytes": 4276, - "role": "dependency_lock", - "reviewed_record": "awm/ALLOWLIST.json" - }, - "components/awm/config.json": { - "sha256": "679c2e8e5ca63963ab80b2e89a14df5204fb0b70dad25714efb1f0b89cad8424", - "bytes": 542, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "1639f6ced0ae83cb1f87bb2737578602c1d410b2974ca2a889302e6a186b29fa" - }, - "components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json": { - "sha256": "3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58", - "bytes": 657, - "role": "derived_source_metadata", - "reviewed_record": "awm/ALLOWLIST.json", - "source": { - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "path": null, - "byte_equal_source_sha256": null - } - }, - "components/awm/private/tasks/awm-accounting-1-invoice/initial.db": { - "sha256": "8ad2959536e44caba47bcbeca9018e47e7157783194d19b429aa8f22a60f4771", - "bytes": 331776, - "role": "materialized_original_seed", - "reviewed_record": "awm/ALLOWLIST.json", - "source": { - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "path": null, - "byte_equal_source_sha256": null - } - }, - "components/awm/private/tasks/awm-accounting-1-invoice/original_api.py": { - "sha256": "57362b907a2d454bbd29b95dfebb7d84207ce9d7e22533eaf54853ee4fb84990", - "bytes": 87054, - "role": "original_task_api", - "reviewed_record": "awm/ALLOWLIST.json", - "source": { - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "path": "gen_envs.jsonl#scenario=accounting_1;full_code", - "byte_equal_source_sha256": "57362b907a2d454bbd29b95dfebb7d84207ce9d7e22533eaf54853ee4fb84990" - } - }, - "components/awm/private/tasks/awm-accounting-1-invoice/original_verifier.py": { - "sha256": "3cd0d63022caa900e32bda0b0d3ae5c9948ce3c195b77ba1906c7ddebea9c58b", - "bytes": 5951, - "role": "original_task_verifier", - "reviewed_record": "awm/ALLOWLIST.json", - "source": { - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "path": "gen_verifier.pure_code.jsonl#scenario=accounting_1;task_idx=1;verification.code", - "byte_equal_source_sha256": "3cd0d63022caa900e32bda0b0d3ae5c9948ce3c195b77ba1906c7ddebea9c58b" - } - }, - "components/awm/requirements.lock": { - "sha256": "0078892ae5870080b3417677926bc64f4f87ba9e8110ff400f18954e361455fc", - "bytes": 10799, - "role": "dependency_lock", - "reviewed_record": "awm/ALLOWLIST.json" - }, - "components/awm/runtime/awm/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - }, - "components/awm/runtime/awm/adapter.py": { - "sha256": "887e81b7aab249861166099b3b4f0778f9041324640b904140d1b055d5a0bff1", - "bytes": 5277, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "98218136805b95d2cc5e98e190ef79e6d0a9c2950d8f61844b4672d4e2dac651" - }, - "components/awm/runtime/awm/launch_service.py": { - "sha256": "0638af1cd1c6a311ee85109143ec6a59646a5f3d41c4b30312526dec561da33d", - "bytes": 2413, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "3bf920b5a2f90723a5cf29501970d3b4ddc802061ff2d1a6570728125ff19ea2" - }, - "components/awm/runtime/awm/openenv_app.py": { - "sha256": "f47b0cc104a7a962fc932c4d3f3bb8bfcf1524dec049b9c2c33161924038b94e", - "bytes": 3995, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "2e393513d340950dab1317c4ba54934526f499599436e658062894fdfa51851f" - }, - "components/awm/runtime/awm/server.py": { - "sha256": "484c7caeaa301b91f468a9e55a251a6b529c6f9d0f2e4951c9602071c40ebcea", - "bytes": 820, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "4a7b8f1300e5957cb359c04eb7f0badab59c22e9119642f2eac6e02cf1e51356" - }, - "components/awm/runtime/awm/wire_client.py": { - "sha256": "b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f", - "bytes": 4987, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "8b05bffad6831c34e38e26926aa121845dc7e4150a6620ef1df690191a84e0d1" - }, - "components/awm/runtime/awm/worker.py": { - "sha256": "b02f482ee9e55df0998b9fcc839a6172cbd1daf40701082062fa49416b31d6e0", - "bytes": 6514, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "081a6126e3d351e22e564c02f0d79522f4228994c3ff57f7074d968142fd4b1d" - }, - "components/awm/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - }, - "components/awm/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "2df4ab6636056806069216ee52576ac979255cb895b49b0c72c3686f3d9c5ae2" - }, - "components/awm/runtime/common/http_routes.py": { - "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e", - "bytes": 2380, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "2876ad9a5d35eeb0e1ebb40346e5d230d8326ac8280ec260459798cf7a4eee18" - }, - "components/awm/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815, - "role": "local_transport_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "9fa259555127367477c21ca27f0ee6ac4a49e5f5744ecd91bf23a3ea1d0ab07d" - }, - "components/awm/upstream/README.md": { - "sha256": "12a0f7eb70edfb5e6fb02f9904c3e06daea24eab392ff4d6cef229ce18237810", - "bytes": 3917, - "role": "original_upstream_metadata_or_row", - "reviewed_record": "awm/ALLOWLIST.json", - "source": { - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "path": "README.md", - "byte_equal_source_sha256": "12a0f7eb70edfb5e6fb02f9904c3e06daea24eab392ff4d6cef229ce18237810", - "note": "For .jsonl this is the exact saved selected row plus trailing newline, not the entire remote file hash." - } - }, - "components/awm/upstream/accounting_1-gen_db.jsonl": { - "sha256": "1cd23311c95c9919621b226c99dcab54faf815300c72cd542a394a5e69463a6e", - "bytes": 13948, - "role": "original_upstream_metadata_or_row", - "reviewed_record": "awm/ALLOWLIST.json", - "source": { - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "path": "gen_db.jsonl", - "byte_equal_source_sha256": "1cd23311c95c9919621b226c99dcab54faf815300c72cd542a394a5e69463a6e", - "note": "For .jsonl this is the exact saved selected row plus trailing newline, not the entire remote file hash." - } - }, - "components/awm/upstream/accounting_1-gen_envs.jsonl": { - "sha256": "99f1883338fa6f4827cb9c6c4c9cf9222c28a2a9842202cbe524921921de3ae3", - "bytes": 90440, - "role": "original_upstream_metadata_or_row", - "reviewed_record": "awm/ALLOWLIST.json", - "source": { - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "path": "gen_envs.jsonl", - "byte_equal_source_sha256": "99f1883338fa6f4827cb9c6c4c9cf9222c28a2a9842202cbe524921921de3ae3", - "note": "For .jsonl this is the exact saved selected row plus trailing newline, not the entire remote file hash." - } - }, - "components/awm/upstream/accounting_1-gen_sample.jsonl": { - "sha256": "28cf8d5611b0d63b9e17d0e991e328c2970cfef5595c08d084f2b1bad7a441fd", - "bytes": 32317, - "role": "original_upstream_metadata_or_row", - "reviewed_record": "awm/ALLOWLIST.json", - "source": { - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "path": "gen_sample.jsonl", - "byte_equal_source_sha256": "28cf8d5611b0d63b9e17d0e991e328c2970cfef5595c08d084f2b1bad7a441fd", - "note": "For .jsonl this is the exact saved selected row plus trailing newline, not the entire remote file hash." - } - }, - "components/loui/.dockerignore": { - "sha256": "05cc6ae53cfd6129f1d7010aa874c6cf0a6019b1adfeff3f4fab27f2d04f43ca", - "bytes": 18, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/Dockerfile": { - "sha256": "0b1054575ac49a8a80a9777e67280b41549b7ff6da909301b0fa8d87c1d8833d", - "bytes": 801, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/README.md": { - "sha256": "6321514f0aac58cdcd022b38f1be9c499d70b1f82a57a45a6878d816a4bcf293", - "bytes": 672, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/SOURCE.json": { - "sha256": "77ce88ca01b6eaad2babc63f0bc078674597336451275db2d72e282bf84b2592", - "bytes": 1133, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/config.json": { - "sha256": "93e90e21198aa146280df24300947b36561b3c41fb51494f0bf5c2b793fc7330", - "bytes": 2363, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/runtime/loui/__init__.py": { - "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "bytes": 0, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/runtime/loui/child.py": { - "sha256": "c4774351bdbd8a044cd20bcd7111ac4db7403feccb9444acf663e71140b27888", - "bytes": 3172, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/runtime/loui/environment.py": { - "sha256": "edd467b474dc0982c9b6c91a9f0150432fa8b9a5c6b62c8187bc9cc9f440a22a", - "bytes": 7292, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/runtime/loui/executor.py": { - "sha256": "7c70a736ee8c5afbb3b5cf3e8113242e4dbb9efc3abe3a2027948474121d59f8", - "bytes": 2741, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/runtime/loui/server.py": { - "sha256": "c3ae4e00495724083e73085bd4dccdf3493094ef2e14c0bb017f6502d264244b", - "bytes": 411, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/tasks/expression-3/instruction.md": { - "sha256": "09ef2d8fc856ca3dc5662c279df705e9accc827f4472dc34758ffe769d116128", - "bytes": 955, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/tasks/incident-3/instruction.md": { - "sha256": "682c7db0f0911e85174652574349fbe957c1cc235a68d224c569e405d9674452", - "bytes": 812, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/loui/upstream/LICENSE": { - "sha256": "a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6", - "bytes": 1070, - "role": "original_upstream", - "reviewed_record": "loui-pinned-originals", - "source": { - "repository": "Louistiti/openenv-python-repair", - "revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "path": "LICENSE", - "sha256": "a5958627f5ebeaf73b280a5b983d86d79c2144c988d761ea7769158788a90de6" - } - }, - "components/loui/upstream/v3/README.md": { - "sha256": "bf5da0c7b871459278ad174cfd3c4ba90de9fbe74d35decce007bed13535d32d", - "bytes": 7857, - "role": "original_upstream", - "reviewed_record": "loui-pinned-originals", - "source": { - "repository": "Louistiti/openenv-python-repair", - "revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "path": "v3/README.md", - "sha256": "bf5da0c7b871459278ad174cfd3c4ba90de9fbe74d35decce007bed13535d32d" - } - }, - "components/loui/upstream/v3/execution.py": { - "sha256": "578814be5152b9b00c7eeae387544a94db159c9e8e3456e5cb56b31b6a731e9a", - "bytes": 8431, - "role": "original_upstream", - "reviewed_record": "loui-pinned-originals", - "source": { - "repository": "Louistiti/openenv-python-repair", - "revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "path": "v3/execution.py", - "sha256": "578814be5152b9b00c7eeae387544a94db159c9e8e3456e5cb56b31b6a731e9a" - } - }, - "components/loui/upstream/v3/hard_tasks.py": { - "sha256": "f140fcf554e97b67afb14e961affc46c14320cb784fe1f7444585e77ceb89ea0", - "bytes": 8476, - "role": "original_upstream", - "reviewed_record": "loui-pinned-originals", - "source": { - "repository": "Louistiti/openenv-python-repair", - "revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "path": "v3/hard_tasks.py", - "sha256": "f140fcf554e97b67afb14e961affc46c14320cb784fe1f7444585e77ceb89ea0" - } - }, - "components/loui/upstream/v3/server.py": { - "sha256": "67f546daef6e7902c12754cbbd883657e57d2cb21e109275af123c552cc93422", - "bytes": 4068, - "role": "original_upstream", - "reviewed_record": "loui-pinned-originals", - "source": { - "repository": "Louistiti/openenv-python-repair", - "revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "path": "v3/server.py", - "sha256": "67f546daef6e7902c12754cbbd883657e57d2cb21e109275af123c552cc93422" - } - }, - "components/loui/upstream/v3/tasks.jsonl": { - "sha256": "9715cdabe6e67287399a3fe2bad435852510bf854982d2f6695b3d87db395c88", - "bytes": 87084, - "role": "original_upstream", - "reviewed_record": "loui-pinned-originals", - "source": { - "repository": "Louistiti/openenv-python-repair", - "revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "path": "v3/tasks.jsonl", - "sha256": "9715cdabe6e67287399a3fe2bad435852510bf854982d2f6695b3d87db395c88" - } - }, - "components/loui/upstream/v3/tasks.py": { - "sha256": "71caf0175532025bf138398229d466f18e5e03365b48853efd92f61f6dae2d66", - "bytes": 22139, - "role": "original_upstream", - "reviewed_record": "loui-pinned-originals", - "source": { - "repository": "Louistiti/openenv-python-repair", - "revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "path": "v3/tasks.py", - "sha256": "71caf0175532025bf138398229d466f18e5e03365b48853efd92f61f6dae2d66" - } - }, - "components/math/ADAPTATIONS.txt": { - "sha256": "83af5f0a6ae61c968b666a5d1854020a8ee8cf174562ca9d59afc397f46444ae", - "bytes": 193, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "67afb4d3cf0def4023ec8a5320476a19e813d48fc4772a043e2ae991817928e3" - }, - "components/math/Dockerfile": { - "sha256": "f6f0505f720c1b8bb8202cbdc8c5d16f270646dc006b47fdbc1d8852f757c848", - "bytes": 477, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/math/NOTICE.txt": { - "sha256": "a4650234425608cbdb194ace7ba22812b4c14c1609a8a7808c2997bf92cdd2c7", - "bytes": 328, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "73b544ecebc5d10e34e72f187bfdccf8ad66c9df4c37b03eeca7323a12401248" - }, - "components/math/SDK_DEPENDENCIES.json": { - "sha256": "a037cf3ce617aa3e0216bf5e0677d229679bfffdd30dba9057b58bb413c39732", - "bytes": 25904, - "role": "dependency_manifest", - "reviewed_record": "math/FILE_ALLOWLIST.json" - }, - "components/math/SOURCE.json": { - "sha256": "4d29eba8369ddbcbeab51dabe14f411512b1117b3787f59c1d406938f0b927ac", - "bytes": 913, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "a91ceb6c6b39e532fbef753034f1979d2364672d9bb6a45395c946dd8208befd" - }, - "components/math/TASKS.json": { - "sha256": "5b232f75ae416ebe7094f0c85010ac6cb41dfecfd601aa7b5ed51712e75dc29a", - "bytes": 1164, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "fe67677e50ff773b044feb9122e26a4dbb1dc647a5c88ba9db0adf952167104a" - }, - "components/math/config.json": { - "sha256": "a0707b688bdabc7c7634d41bcd9031b6639896a2fc4b04ec6a06c2ac11dfb68c", - "bytes": 1600, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "ef82018da2f904b091c0c306fc4c574b90eca0f6e488a9c66f747be2681064c5" - }, - "components/math/licenses/MathConstraint-LICENSE": { - "sha256": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94", - "bytes": 18656, - "role": "license_and_attribution", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "vireshpati/Math-Constraint", - "source_url": "https://github.com/vireshpati/Math-Constraint/blob/main/LICENSE", - "git_blob_sha": "4ea99c213c5c0c005ae4e80df8e52169d06896ec", - "license": { - "key": "cc-by-4.0", - "name": "Creative Commons Attribution 4.0 International", - "spdx_id": "CC-BY-4.0", - "url": "https://api.github.com/licenses/cc-by-4.0", - "node_id": "MDc6TGljZW5zZTI1" - }, - "sha256": "9e5f1b3c610b9c2da5c313bf81d577a7d1acec686bdb0384edefa6df0f90cd94", - "retrieval_scope": "license text only; not a claim about the original generator revision" - } - }, - "components/math/licenses/RLVE-LICENSE": { - "sha256": "10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e", - "bytes": 1069, - "role": "license_and_attribution", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "Zhiyuan-Zeng/RLVE", - "source_url": "https://github.com/Zhiyuan-Zeng/RLVE/blob/main/LICENSE", - "git_blob_sha": "5677eb6d02ee26cd27b6dce1cbfaa9676b1a2382", - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "sha256": "10afac3400d1abccc7ec2322e07563a3e495c13ac39d3865564aa2e2423b398e", - "retrieval_scope": "license text only; not a claim about the original generator revision" - } - }, - "components/math/licenses/UPSTREAM_COLLECTION_LICENSES.md": { - "sha256": "200b2ce93f2a5b9671165f9aea3cc4d89db995352c1e1e3db6d418262b058516", - "bytes": 462, - "role": "license_and_attribution", - "reviewed_record": "math/FILE_ALLOWLIST.json" - }, - "components/math/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - }, - "components/math/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "2df4ab6636056806069216ee52576ac979255cb895b49b0c72c3686f3d9c5ae2" - }, - "components/math/runtime/common/http_routes.py": { - "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e", - "bytes": 2380, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "2876ad9a5d35eeb0e1ebb40346e5d230d8326ac8280ec260459798cf7a4eee18" - }, - "components/math/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "9fa259555127367477c21ca27f0ee6ac4a49e5f5744ecd91bf23a3ea1d0ab07d" - }, - "components/math/runtime/native_shell/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - }, - "components/math/runtime/native_shell/actor_launcher.py": { - "sha256": "80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3", - "bytes": 5012, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "254abfeedc1d69cf228f923b5b43452d820c8ba5889fd8595e322e19efc7a896" - }, - "components/math/runtime/native_shell/backend.py": { - "sha256": "34dba81df98422b07004d85a922d7db1246532a9d24b0be7eb103b89e0894e4e", - "bytes": 13575, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "0b2d9a50ee5d97721a7ca24b728687a9bab474b33e788524118625ebc346ad0e" - }, - "components/math/runtime/native_shell/environment.py": { - "sha256": "cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53", - "bytes": 1616, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "1c1ded0928c4757a87696f818cf9004a29e55f992495ffa0aacde9112dad7fea" - }, - "components/math/runtime/native_shell/guard.py": { - "sha256": "31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e", - "bytes": 12337, - "role": "execution_adapter", - "reviewed_record": "openenv-runtime-compatibility-20261012", - "parent_sha256": "4217040e7b055f57c6faef5aaa2a481757eda9856afb5a8816098b65fe788ef1" - }, - "components/math/runtime/native_shell/launch_service.py": { - "sha256": "db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b", - "bytes": 2383, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "c698c3b27e551f9986bf9e5aac9d337bf2e662058f5ba05d0882aaf2008ff98a" - }, - "components/math/runtime/native_shell/process_scope.py": { - "sha256": "1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e", - "bytes": 8298, - "role": "execution_adapter", - "reviewed_record": "openenv-runtime-compatibility-20261012" - }, - "components/math/runtime/native_shell/server.py": { - "sha256": "c8bb079f359fe4ac6c1764cbf47fdcfaa3f3caee35ff6c41e845bee3e965d454", - "bytes": 414, - "role": "execution_adapter", - "reviewed_record": "openenv-runtime-compatibility-20261012", - "parent_sha256": "3a0de8fbd07613f323cbd1e42e4345f0268f7a21bc4326622c8e22f4d318f30e" - }, - "components/math/runtime/native_shell/verifier_launcher.py": { - "sha256": "6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465", - "bytes": 962, - "role": "execution_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "aa03260a2bcc91c9e23fd32dda0d75d1979ee7f4f64e87ea635f6bcd6048b075" - }, - "components/math/runtime/native_shell/wire_client.py": { - "sha256": "b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af", - "bytes": 5721, - "role": "execution_adapter", - "reviewed_record": "openenv-runtime-compatibility-20261012", - "parent_sha256": "b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f" - }, - "components/math/upstream/construct-mc-costas-array-l3-s0/environment/Dockerfile": { - "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c", - "bytes": 389, - "role": "original_task_source", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0/environment/Dockerfile", - "sha256": "56b0b880643a6915bad1e66b9d127578e69853f00a5e198ddfdf3d72a490fa1c", - "byte_identical": true - } - }, - "components/math/upstream/construct-mc-costas-array-l3-s0/environment/instance.json": { - "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5", - "bytes": 98, - "role": "original_task_source", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0/environment/instance.json", - "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5", - "byte_identical": true - } - }, - "components/math/upstream/construct-mc-costas-array-l3-s0/instruction.md": { - "sha256": "88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9", - "bytes": 723, - "role": "original_task_source", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0/instruction.md", - "sha256": "88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9", - "byte_identical": true - } - }, - "components/math/upstream/construct-mc-costas-array-l3-s0/task.toml": { - "sha256": "b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32", - "bytes": 694, - "role": "original_task_source", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0/task.toml", - "sha256": "b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32", - "byte_identical": true - } - }, - "components/math/upstream/construct-mc-costas-array-l3-s0/tests/check.py": { - "sha256": "3c0290e35201f077926099989cd0e82c10bf091cb33c572cacc02bca075debdb", - "bytes": 809, - "role": "original_task_source", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0/tests/check.py", - "sha256": "3c0290e35201f077926099989cd0e82c10bf091cb33c572cacc02bca075debdb", - "byte_identical": true - } - }, - "components/math/upstream/construct-mc-costas-array-l3-s0/tests/instance.json": { - "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5", - "bytes": 98, - "role": "original_task_source", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0/tests/instance.json", - "sha256": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5", - "byte_identical": true - } - }, - "components/math/upstream/construct-mc-costas-array-l3-s0/tests/run.py": { - "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73", - "bytes": 4652, - "role": "original_task_source", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0/tests/run.py", - "sha256": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73", - "byte_identical": true - } - }, - "components/math/upstream/construct-mc-costas-array-l3-s0/tests/test.sh": { - "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e", - "bytes": 391, - "role": "original_task_source", - "reviewed_record": "math/FILE_ALLOWLIST.json", - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0/tests/test.sh", - "sha256": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e", - "byte_identical": true - } - }, - "components/pdbthink/DEPENDENCIES.json": { - "sha256": "b0cbd2dbfe130357ab86c48b3f0ee1acca985828022542d97f1f9d77e147f261", - "bytes": 46444, - "role": "dependency", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json" - }, - "components/pdbthink/Dockerfile": { - "sha256": "a059eac1b72cef773aee8d849c48f0b090e5d87802cfdf8ae3e8456595ba4e87", - "bytes": 338, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "0c2bd4c86b8d834a907605e71d8dc3763513da29cf07c324eb718c8818b1ec45" - }, - "components/pdbthink/config.json": { - "sha256": "6329e8c6c33a5f04e11dbdcba6f43bb7dba10439d969a97b28901d7681ece8b6", - "bytes": 1295, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "4ac5bc8faf3c53e689d3e1857e81c904da28c239dacc10e69c6f6bee67ba687a" - }, - "components/pdbthink/licenses/DEPENDENCIES.json": { - "sha256": "7c98afbca1961f056579b344a5552c574582c6c19926578a748519fdd99496d7", - "bytes": 54492, - "role": "license", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json" - }, - "components/pdbthink/licenses/LICENSE-PDBTHINK": { - "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", - "bytes": 11357, - "role": "license", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json" - }, - "components/pdbthink/licenses/SOURCE.json": { - "sha256": "b799de2e9e91ea8ee515bca1fee21cef759b73938cf952e629c8fb9543cc6638", - "bytes": 796, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "ce75bb41edfeadb6dbe07aa8a8feacc4ed326c27695327ab56a45d80f38045cc" - }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/public_task.json": { - "sha256": "7d267c32438351a4d92533f6e9960da36a1e39c768ad56988904029cb90da0c5", - "bytes": 9092, - "role": "delivery_adaptation", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json" - }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py": { - "sha256": "8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f", - "bytes": 2383, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py", - "sha256": "8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f", - "kind": "original_file_preserved_from_v2" - } - }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py": { - "sha256": "72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c", - "bytes": 15164, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py", - "sha256": "72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c", - "kind": "original_file_preserved_from_v2" - } - }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py": { - "sha256": "8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34", - "bytes": 6699, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py", - "sha256": "8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34", - "kind": "original_file_preserved_from_v2" - } - }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json": { - "sha256": "4ed8e4260bc71b5a863888cd3fa2c7bca6210fc5138f96fd2207462c348318b7", - "bytes": 253, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json", - "sha256": "4ed8e4260bc71b5a863888cd3fa2c7bca6210fc5138f96fd2207462c348318b7", - "kind": "original_file_preserved_from_v2" - } - }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh": { - "sha256": "bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7", - "bytes": 42, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh", - "sha256": "bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7", - "kind": "original_file_preserved_from_v2" - } - }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml": { - "sha256": "628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4", - "bytes": 160, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml", - "sha256": "628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4", - "kind": "original_file_preserved_from_v2" - } - }, - "components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py": { - "sha256": "91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c", - "bytes": 1558, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py", - "sha256": "91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c", - "kind": "original_file_preserved_from_v2" - } - }, - "components/pdbthink/requirements.lock": { - "sha256": "0078892ae5870080b3417677926bc64f4f87ba9e8110ff400f18954e361455fc", - "bytes": 10799, - "role": "dependency", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json" - }, - "components/pdbthink/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - }, - "components/pdbthink/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "2df4ab6636056806069216ee52576ac979255cb895b49b0c72c3686f3d9c5ae2" - }, - "components/pdbthink/runtime/common/http_routes.py": { - "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e", - "bytes": 2380, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "2876ad9a5d35eeb0e1ebb40346e5d230d8326ac8280ec260459798cf7a4eee18" - }, - "components/pdbthink/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "9fa259555127367477c21ca27f0ee6ac4a49e5f5744ecd91bf23a3ea1d0ab07d" - }, - "components/pdbthink/runtime/pdbthink/__init__.py": { - "sha256": "9f56e761d79bfdb34304a012586cb04d16b435ef6130091a97702e559260a2f2", - "bytes": 5, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "b087f3335e8ab666acb3a90f3130a6fa8a2908103c9755a0d4bf3a63294751e3" - }, - "components/pdbthink/runtime/pdbthink/adapter.py": { - "sha256": "1683d5e2fab016801207ecdde6cbd4d3730ed8c4ca22aafd0f3bf651dce0faf1", - "bytes": 6708, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "c37048ce62affd08e5220c9cef70970fab56c1db26d4b9c02a09a9d9131995db" - }, - "components/pdbthink/runtime/pdbthink/launch_service.py": { - "sha256": "cc89f1e687da1a71af567ac450fd761da0e5d4fe56901695de304aabd81c59bd", - "bytes": 2443, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "e8ad96b3bd3fd243743ed5a52748c0217a8327c59fd62c2d1c08aac9a4929832" - }, - "components/pdbthink/runtime/pdbthink/openenv_app.py": { - "sha256": "7ab1b3b05068cd5b0f20497062a8da5fd905c45e8eee295cb8f2fc5c7aca6577", - "bytes": 4033, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "6274d7617e0689139f4a3538c0513ab624da0b26814fdef2aa4596b29b510850" - }, - "components/pdbthink/runtime/pdbthink/server.py": { - "sha256": "76012b37d916b4044c6fe1da4e7accdf9faa2216f50c73d5b87cd12b7f1d70cf", - "bytes": 840, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "a8f6e6a197f60b369918362a4b0527eb063102b89cfff345e68af155da210e23" - }, - "components/pdbthink/runtime/pdbthink/transport.py": { - "sha256": "b1f6f82ff9e113aedd742a8f4b0c18c545020677503765ee913c31e20964b96f", - "bytes": 6739, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "d6564315dcc78f4be7a96fe213ab86db994207fae047b92d9b918f7b5b73b668" - }, - "components/pdbthink/runtime/pdbthink/wire_client.py": { - "sha256": "b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f", - "bytes": 4987, - "role": "adapter", - "reviewed_record": "presentation-cleanup-20261011", - "parent_sha256": "8b05bffad6831c34e38e26926aa121845dc7e4150a6620ef1df690191a84e0d1" - }, - "components/tmax/DEPENDENCIES.json": { - "sha256": "58d031f7955f7f774733189b8297a1db7f515bb206c26ac50fad68f580848974", - "bytes": 166362, - "role": "installed_dependency_inventory", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "kind": "installed_metadata_from_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - } - }, - "components/tmax/Dockerfile": { - "sha256": "7c4a25fee86ff7295519547dac7f594103c7137ec746423dd452c076a920cbb4", - "bytes": 251, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters" - }, - "components/tmax/LICENSE_SCOPE.json": { - "sha256": "9ae187d852f4cd6974fc9c65fba942df4e5586d73ddb3c48916a09376a3d36ac", - "bytes": 1360, - "role": "license_and_attribution", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only" - }, - "components/tmax/NOTICE.txt": { - "sha256": "f30eb64313c2645348ca3d965c40c9a466eb3754f3302206e44133d19bc87d6a", - "bytes": 2235, - "role": "license_and_attribution", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only" - }, - "components/tmax/SOURCE.json": { - "sha256": "e0e598c0fc7ac71b15ee4668ad88f11b9e1084d62610d0535038d5a034d1c946", - "bytes": 3548, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "8228f41f6ed3488d787e85f78ec8d9358ff8d5d515c6ec537ab0eb06537048d1" - }, - "components/tmax/TASKS.json": { - "sha256": "7b4d7c93c6f7477c2962ee8ae8746bfe941991de3b940400013a15d1bba87536", - "bytes": 18980, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "9296f353c436adf1f5019adb05854fec1bb4601f8201a3f5763bf3b4116399e5" - }, - "components/tmax/config.json": { - "sha256": "e2aff0a5d12d5f45d675854f26b6b5164bfac7fe1cf4193dab4ce879021bae64", - "bytes": 9223, - "role": "local_runtime_configuration", - "reviewed_record": "training-runtime-repair-20261013", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - } - }, - "components/tmax/licenses/ODC-BY-1.0.txt": { - "sha256": "11a6d83734845ad09d809667aa219857a5b985b28c258a2eebf5677668a6bd3b", - "bytes": 19977, - "role": "license_and_attribution", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "kind": "license_text", - "license_id": "ODC-BY-1.0" - } - }, - "components/tmax/licenses/TMAX_DATASET_README.md": { - "sha256": "0e66e8816b8f2b4a17d37ec7abc5b8ca5708bae9d71d2c5323d8666d7e7ffa1d", - "bytes": 1830, - "role": "license_and_attribution", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "allenai/TMax-15K", - "revision": "e3ded940596cc611c9815684ba51a7e8ee0cffc9", - "path": "README.md", - "kind": "exact_saved_dataset_readme", - "sha256": "0e66e8816b8f2b4a17d37ec7abc5b8ca5708bae9d71d2c5323d8666d7e7ffa1d" - } - }, - "components/tmax/requirements.lock": { - "sha256": "836618cb7e01e236878d367272157e4be6a31d538bf8b9f8cc9ed630aac04482", - "bytes": 10667, - "role": "sdk_dependency_hash_lock", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "kind": "frozen_rootfs_file", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - } - }, - "components/tmax/runtime/common/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - }, - "components/tmax/runtime/common/contracts.py": { - "sha256": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", - "bytes": 1015, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "2df4ab6636056806069216ee52576ac979255cb895b49b0c72c3686f3d9c5ae2" - }, - "components/tmax/runtime/common/http_routes.py": { - "sha256": "7263c04e9175faf66501ed9b2ac2f9a637557a8b1966d839fb9944eb01abac0e", - "bytes": 2380, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "2876ad9a5d35eeb0e1ebb40346e5d230d8326ac8280ec260459798cf7a4eee18" - }, - "components/tmax/runtime/common/models.py": { - "sha256": "26e7a67537ce7ae34909b724243c37242b9c8055cbfe0c717179dac74347786a", - "bytes": 1815, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "9fa259555127367477c21ca27f0ee6ac4a49e5f5744ecd91bf23a3ea1d0ab07d" - }, - "components/tmax/runtime/native_shell/__init__.py": { - "sha256": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", - "bytes": 1, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - }, - "components/tmax/runtime/native_shell/actor_launcher.py": { - "sha256": "80eb3b90287840668e72040dc55ba115bfc3f4251a25cb2b94af0ed3759dd6b3", - "bytes": 5012, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "254abfeedc1d69cf228f923b5b43452d820c8ba5889fd8595e322e19efc7a896" - }, - "components/tmax/runtime/native_shell/backend.py": { - "sha256": "4b71d8cd0f017716e6df6cc64ee268a725be5fb6e363034bae2f9c8b0184b0ba", - "bytes": 13951, - "role": "adapter_or_metadata", - "reviewed_record": "multidomain-v4-adapters", - "parent_sha256": "dadbc516c1d4d5ea64dda08dffd9be3f00f159abe62967a032473f6e79c85d9c" - }, - "components/tmax/runtime/native_shell/environment.py": { - "sha256": "cfe9ed6c11b9da324f5e752ffbf1d8ca5c074120f6067dd01d99590e568adf53", - "bytes": 1616, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "1c1ded0928c4757a87696f818cf9004a29e55f992495ffa0aacde9112dad7fea" - }, - "components/tmax/runtime/native_shell/guard.py": { - "sha256": "31adf40fa408c39a70fd78882f10b472b8bae1a55efae89192f956001e6a423e", - "bytes": 12337, - "role": "local_runtime_adapter", - "reviewed_record": "openenv-runtime-compatibility-20261012", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "4217040e7b055f57c6faef5aaa2a481757eda9856afb5a8816098b65fe788ef1" - }, - "components/tmax/runtime/native_shell/launch_service.py": { - "sha256": "db4dc3e27abe2dc45cc29b534882975aa9ea8e5b8ebedb67c943fad83810805b", - "bytes": 2383, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "c698c3b27e551f9986bf9e5aac9d337bf2e662058f5ba05d0882aaf2008ff98a" - }, - "components/tmax/runtime/native_shell/process_scope.py": { - "sha256": "1401916b276c6a19805b8bf405d11ffb014794c59a1eda55a91fa2edf06a0e7e", - "bytes": 8298, - "role": "execution_adapter", - "reviewed_record": "openenv-runtime-compatibility-20261012" - }, - "components/tmax/runtime/native_shell/server.py": { - "sha256": "c8bb079f359fe4ac6c1764cbf47fdcfaa3f3caee35ff6c41e845bee3e965d454", - "bytes": 414, - "role": "local_runtime_adapter", - "reviewed_record": "openenv-runtime-compatibility-20261012", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "3a0de8fbd07613f323cbd1e42e4345f0268f7a21bc4326622c8e22f4d318f30e" - }, - "components/tmax/runtime/native_shell/verifier_launcher.py": { - "sha256": "6934b8fa5117549cb5ba30a1e6ebbd00df2bf4191ba10765473d05a3fd346465", - "bytes": 962, - "role": "local_runtime_adapter", - "reviewed_record": "presentation-cleanup-20261011", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "aa03260a2bcc91c9e23fd32dda0d75d1979ee7f4f64e87ea635f6bcd6048b075" - }, - "components/tmax/runtime/native_shell/wire_client.py": { - "sha256": "b8b67cfcd0115be0bcd984543e962adebe2528dc2cd18324e032d155563220af", - "bytes": 5721, - "role": "local_runtime_adapter", - "reviewed_record": "openenv-runtime-compatibility-20261012", - "component_scope": "frozen_image_application", - "source": { - "kind": "local_adaptation_in_frozen_rootfs", - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687" - }, - "parent_sha256": "b5267c0f1cc015a68154affade8d89f6b6a01e9e4cc47a2dbdb74020e108ab5f" - }, - "components/tmax/tasks/task_000056_f726766b/source/external/app/vibration_data.wav": { - "sha256": "eab8396a1b533f70468039f8ac1b5fe9927faf4ded578172ec932ef7bf2af22a", - "bytes": 40058, - "role": "original_materialized_immutable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_000056_f726766b/environment/post_install.sh", - "generator_sha256": "70d52288d5c9a7d23bbd63fb086a7f886961a1335632cc6efb892572d197563b", - "container_path": "/app/vibration_data.wav", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_000056_f726766b/source/instruction.md": { - "sha256": "714f780883970365cfffe408e2c76e75f499005f87551fc84b55d79368e77197", - "bytes": 1851, - "role": "original_instruction", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/instruction.md", - "upstream_sha256": "714f780883970365cfffe408e2c76e75f499005f87551fc84b55d79368e77197", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000056_f726766b/source/task.toml": { - "sha256": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0", - "bytes": 981, - "role": "runtime_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/task.toml", - "upstream_sha256": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000056_f726766b/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/tests/test.sh", - "upstream_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000056_f726766b/source/tests/test_final_state.py": { - "sha256": "327c5346a779a44e27ef0cbd9f107e863d599fc6e47f95f248eaec03c15117c4", - "bytes": 2866, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/tests/test_final_state.py", - "upstream_sha256": "327c5346a779a44e27ef0cbd9f107e863d599fc6e47f95f248eaec03c15117c4", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/find_threshold.sh": { - "sha256": "a6c4cf2043d8642babb9b546096b3f559a375b59d54a43efebd57e9728466184", - "bytes": 720, - "role": "original_materialized_editable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_000260_7b7cc286/environment/post_install.sh", - "generator_sha256": "ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03", - "container_path": "/home/user/pipeline/find_threshold.sh", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/process.sh": { - "sha256": "4631f1f805e6b826a796502ed5d94e676b3061cf448f2f9225116395aa3bb13b", - "bytes": 500, - "role": "original_materialized_editable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_000260_7b7cc286/environment/post_install.sh", - "generator_sha256": "ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03", - "container_path": "/home/user/pipeline/process.sh", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/serialize.sh": { - "sha256": "f3ae2df41978712dbffe58665a9582e3d0951f211c5cca5ece9f536225d28ba8", - "bytes": 303, - "role": "original_materialized_editable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_000260_7b7cc286/environment/post_install.sh", - "generator_sha256": "ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03", - "container_path": "/home/user/pipeline/serialize.sh", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_000260_7b7cc286/source/external/app/video.mp4": { - "sha256": "3c04251fe92c30d29ac4d887608f4385176e3bda932594437f82b08a5b348938", - "bytes": 7671, - "role": "original_materialized_immutable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_000260_7b7cc286/environment/post_install.sh", - "generator_sha256": "ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03", - "container_path": "/app/video.mp4", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_000260_7b7cc286/source/instruction.md": { - "sha256": "79c9fd4e4d41524db109d90b0415a4f0a2b9d24bf690fa8d7340ce3cb5ce0975", - "bytes": 2015, - "role": "original_instruction", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/instruction.md", - "upstream_sha256": "79c9fd4e4d41524db109d90b0415a4f0a2b9d24bf690fa8d7340ce3cb5ce0975", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000260_7b7cc286/source/task.toml": { - "sha256": "d36c49060b4ddbca3b13a5aa98cf5b195c07bff725b91107f58a087ec4325423", - "bytes": 961, - "role": "runtime_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "adapted_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/task.toml", - "upstream_sha256": "483c9171d3e67bec029d9b88cee24d554fa9310a61ec47940312be5f2951bc30", - "byte_equal": false, - "change": "Existing offline network setting and appended terminal newline; original task.toml retained under upstream/." - } - }, - "components/tmax/tasks/task_000260_7b7cc286/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/tests/test.sh", - "upstream_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000260_7b7cc286/source/tests/test_final_state.py": { - "sha256": "aae204101d5c024a0b5cbda42fa686e7d2928fd9be3ad55fd14314b2502182a5", - "bytes": 2007, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/tests/test_final_state.py", - "upstream_sha256": "aae204101d5c024a0b5cbda42fa686e7d2928fd9be3ad55fd14314b2502182a5", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000663_dff2c340/pristine/backup_catalog.db": { - "sha256": "170911a153d00eb0f037ca56a2cbd10d4aa2b7a418e25a0f1df58b1c77589788", - "bytes": 12288, - "role": "original_materialized_immutable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_000663_dff2c340/environment/post_install.sh", - "generator_sha256": "a449c18295cee8a3e7ed0c958fe219cbed2d2a8e7fdad924f2679444b3377b94", - "container_path": "/home/user/backup_catalog.db", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_000663_dff2c340/source/instruction.md": { - "sha256": "feae25374139b4b1d8ec9759d553c591841d9330a071217f46a2e464bd32bbd7", - "bytes": 1841, - "role": "original_instruction", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000663_dff2c340/instruction.md", - "upstream_sha256": "feae25374139b4b1d8ec9759d553c591841d9330a071217f46a2e464bd32bbd7", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000663_dff2c340/source/task.toml": { - "sha256": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a", - "bytes": 852, - "role": "runtime_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000663_dff2c340/task.toml", - "upstream_sha256": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000663_dff2c340/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000663_dff2c340/tests/test.sh", - "upstream_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "byte_equal": true - } - }, - "components/tmax/tasks/task_000663_dff2c340/source/tests/test_final_state.py": { - "sha256": "7a273b9bf8bc61eeec1b8dda674b5f6ba5356abbfd923b413b09d2584c1ef72f", - "bytes": 3341, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000663_dff2c340/tests/test_final_state.py", - "upstream_sha256": "7a273b9bf8bc61eeec1b8dda674b5f6ba5356abbfd923b413b09d2584c1ef72f", - "byte_equal": true - } - }, - "components/tmax/tasks/task_005684_3c8594a3/pristine/compliance_audit.db": { - "sha256": "9fe1c89ee823f133d35dea66840ecb7f87d599487524b7aa1d6371e8f664058e", - "bytes": 20480, - "role": "original_materialized_immutable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_005684_3c8594a3/environment/post_install.sh", - "generator_sha256": "b431517fec535c62b42b517f9212cbb1e9cf80bdf883a55c02bfba08f0d4c404", - "container_path": "/home/user/compliance_audit.db", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_005684_3c8594a3/source/instruction.md": { - "sha256": "f4eee4e0643fcfb7399df10e1947ec9dbda28c74bacf307167f443506268f583", - "bytes": 1801, - "role": "original_instruction", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_005684_3c8594a3/instruction.md", - "upstream_sha256": "f4eee4e0643fcfb7399df10e1947ec9dbda28c74bacf307167f443506268f583", - "byte_equal": true - } - }, - "components/tmax/tasks/task_005684_3c8594a3/source/task.toml": { - "sha256": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2", - "bytes": 850, - "role": "runtime_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_005684_3c8594a3/task.toml", - "upstream_sha256": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2", - "byte_equal": true - } - }, - "components/tmax/tasks/task_005684_3c8594a3/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_005684_3c8594a3/tests/test.sh", - "upstream_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "byte_equal": true - } - }, - "components/tmax/tasks/task_005684_3c8594a3/source/tests/test_final_state.py": { - "sha256": "495630c7ede4e75ef5644c1ee5b69f04969a4059ef094787c19a3014734d3cf2", - "bytes": 4306, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_005684_3c8594a3/tests/test_final_state.py", - "upstream_sha256": "495630c7ede4e75ef5644c1ee5b69f04969a4059ef094787c19a3014734d3cf2", - "byte_equal": true - } - }, - "components/tmax/tasks/task_008667_2151f271/pristine/data/financial.db": { - "sha256": "d6b5039ee32f3a43069245984c8fe5a9689028a9aac06e26a64017c54bd11976", - "bytes": 20480, - "role": "original_materialized_immutable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_008667_2151f271/environment/post_install.sh", - "generator_sha256": "3a777366c4b998e6368627f4775a73cea29fdbdc9991daedfb13244153c17841", - "container_path": "/home/user/data/financial.db", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_008667_2151f271/pristine/data/transactions.jsonl": { - "sha256": "629b28471809f802c58831d100315b83012c0066df3b265a2d379a19e61a2262", - "bytes": 937, - "role": "original_materialized_immutable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_008667_2151f271/environment/post_install.sh", - "generator_sha256": "3a777366c4b998e6368627f4775a73cea29fdbdc9991daedfb13244153c17841", - "container_path": "/home/user/data/transactions.jsonl", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_008667_2151f271/source/instruction.md": { - "sha256": "50d1d10121dfa3b565842fd10f2589ceb91b4459126787af7793cec9cc0d06b1", - "bytes": 2436, - "role": "original_instruction", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008667_2151f271/instruction.md", - "upstream_sha256": "50d1d10121dfa3b565842fd10f2589ceb91b4459126787af7793cec9cc0d06b1", - "byte_equal": true - } - }, - "components/tmax/tasks/task_008667_2151f271/source/task.toml": { - "sha256": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897", - "bytes": 967, - "role": "runtime_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008667_2151f271/task.toml", - "upstream_sha256": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897", - "byte_equal": true - } - }, - "components/tmax/tasks/task_008667_2151f271/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008667_2151f271/tests/test.sh", - "upstream_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "byte_equal": true - } - }, - "components/tmax/tasks/task_008667_2151f271/source/tests/test_final_state.py": { - "sha256": "cb73fd0ab1765768ebfecc50054ba13c143cc51be201127515eb495904ddf9e6", - "bytes": 3674, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008667_2151f271/tests/test_final_state.py", - "upstream_sha256": "cb73fd0ab1765768ebfecc50054ba13c143cc51be201127515eb495904ddf9e6", - "byte_equal": true - } - }, - "components/tmax/tasks/task_008998_ae4cbe72/pristine/robot_dump.log.gz": { - "sha256": "909d2e964c0831d8af91b722b4424ed829c261d6b7db1a95180d8a809527ddaf", - "bytes": 261, - "role": "original_materialized_immutable_input", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "materialized_original_setup_output", - "generator_archive_path": "tasks.zip!/task_008998_ae4cbe72/environment/post_install.sh", - "generator_sha256": "26dfa63d063430c2370144b8e30c1f905dde4e2722403c1e8131a5a84e2d5e69", - "container_path": "/home/user/robot_dump.log.gz", - "direct_archive_member": false - } - }, - "components/tmax/tasks/task_008998_ae4cbe72/source/instruction.md": { - "sha256": "f81f86b07681931baabdba313cc4e988c01bff7a1f1d83349dfa939cdaa20669", - "bytes": 1919, - "role": "original_instruction", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008998_ae4cbe72/instruction.md", - "upstream_sha256": "f81f86b07681931baabdba313cc4e988c01bff7a1f1d83349dfa939cdaa20669", - "byte_equal": true - } - }, - "components/tmax/tasks/task_008998_ae4cbe72/source/task.toml": { - "sha256": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9", - "bytes": 823, - "role": "runtime_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008998_ae4cbe72/task.toml", - "upstream_sha256": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9", - "byte_equal": true - } - }, - "components/tmax/tasks/task_008998_ae4cbe72/source/tests/test.sh": { - "sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "bytes": 290, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008998_ae4cbe72/tests/test.sh", - "upstream_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "byte_equal": true - } - }, - "components/tmax/tasks/task_008998_ae4cbe72/source/tests/test_final_state.py": { - "sha256": "e03b84ca0519367e5f86b7b3a3231afa5209b1971431497699200099035f5014", - "bytes": 2893, - "role": "original_checker", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "frozen_image_application", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008998_ae4cbe72/tests/test_final_state.py", - "upstream_sha256": "e03b84ca0519367e5f86b7b3a3231afa5209b1971431497699200099035f5014", - "byte_equal": true - } - }, - "components/tmax/upstream/task_000056_f726766b/environment/Dockerfile": { - "sha256": "c44d259c4421b16dc5f0bc3912cdd800f6c25746ea31bede5060c9605b225025", - "bytes": 521, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/environment/Dockerfile", - "byte_equal": true, - "upstream_sha256": "c44d259c4421b16dc5f0bc3912cdd800f6c25746ea31bede5060c9605b225025", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.label.txt": { - "sha256": "fc9e91cc78e1817d80b4ba8c2dc9a638d0c57959825ee34f5e3d7688ad80dfb9", - "bytes": 3, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.label.txt", - "byte_equal": true, - "upstream_sha256": "fc9e91cc78e1817d80b4ba8c2dc9a638d0c57959825ee34f5e3d7688ad80dfb9", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.wav": { - "sha256": "f55a8eec263c9be975b2adccdda6a07c680109b851a89f55779f14076aaa30d5", - "bytes": 16044, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.wav", - "byte_equal": true, - "upstream_sha256": "f55a8eec263c9be975b2adccdda6a07c680109b851a89f55779f14076aaa30d5", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000056_f726766b/environment/base_install.sh": { - "sha256": "0e71b3e06fcf8cc6f9d95ba2e9664dfbba7786949a0e21b810ada563ae27a637", - "bytes": 2849, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/environment/base_install.sh", - "byte_equal": true, - "upstream_sha256": "0e71b3e06fcf8cc6f9d95ba2e9664dfbba7786949a0e21b810ada563ae27a637", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000056_f726766b/environment/post_install.sh": { - "sha256": "70d52288d5c9a7d23bbd63fb086a7f886961a1335632cc6efb892572d197563b", - "bytes": 940, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/environment/post_install.sh", - "byte_equal": true, - "upstream_sha256": "70d52288d5c9a7d23bbd63fb086a7f886961a1335632cc6efb892572d197563b", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000056_f726766b/task.toml": { - "sha256": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0", - "bytes": 981, - "role": "upstream_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000056_f726766b/task.toml", - "byte_equal": true, - "upstream_sha256": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000260_7b7cc286/environment/Dockerfile": { - "sha256": "98f66d958e8ee701c0579095c2e65254a63194845b894a45db2a6180a46a3193", - "bytes": 521, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/environment/Dockerfile", - "byte_equal": true, - "upstream_sha256": "98f66d958e8ee701c0579095c2e65254a63194845b894a45db2a6180a46a3193", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.label.txt": { - "sha256": "4a44dc15364204a80fe80e9039455cc1608281820fe2b24f1e5233ade6af1dd5", - "bytes": 2, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.label.txt", - "byte_equal": true, - "upstream_sha256": "4a44dc15364204a80fe80e9039455cc1608281820fe2b24f1e5233ade6af1dd5", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.mp4": { - "sha256": "bf759113108b136ec3b5fa507d035c1e66ac243b52da09fa07ab58566ee27f58", - "bytes": 3342, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.mp4", - "byte_equal": true, - "upstream_sha256": "bf759113108b136ec3b5fa507d035c1e66ac243b52da09fa07ab58566ee27f58", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000260_7b7cc286/environment/base_install.sh": { - "sha256": "0e71b3e06fcf8cc6f9d95ba2e9664dfbba7786949a0e21b810ada563ae27a637", - "bytes": 2849, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/environment/base_install.sh", - "byte_equal": true, - "upstream_sha256": "0e71b3e06fcf8cc6f9d95ba2e9664dfbba7786949a0e21b810ada563ae27a637", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000260_7b7cc286/environment/post_install.sh": { - "sha256": "ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03", - "bytes": 2093, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/environment/post_install.sh", - "byte_equal": true, - "upstream_sha256": "ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000260_7b7cc286/task.toml": { - "sha256": "483c9171d3e67bec029d9b88cee24d554fa9310a61ec47940312be5f2951bc30", - "bytes": 954, - "role": "upstream_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000260_7b7cc286/task.toml", - "byte_equal": true, - "upstream_sha256": "483c9171d3e67bec029d9b88cee24d554fa9310a61ec47940312be5f2951bc30", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000663_dff2c340/environment/Dockerfile": { - "sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "bytes": 154, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000663_dff2c340/environment/Dockerfile", - "byte_equal": true, - "upstream_sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000663_dff2c340/environment/post_install.sh": { - "sha256": "a449c18295cee8a3e7ed0c958fe219cbed2d2a8e7fdad924f2679444b3377b94", - "bytes": 1661, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000663_dff2c340/environment/post_install.sh", - "byte_equal": true, - "upstream_sha256": "a449c18295cee8a3e7ed0c958fe219cbed2d2a8e7fdad924f2679444b3377b94", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_000663_dff2c340/task.toml": { - "sha256": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a", - "bytes": 852, - "role": "upstream_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_000663_dff2c340/task.toml", - "byte_equal": true, - "upstream_sha256": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_005684_3c8594a3/environment/Dockerfile": { - "sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "bytes": 154, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_005684_3c8594a3/environment/Dockerfile", - "byte_equal": true, - "upstream_sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_005684_3c8594a3/environment/post_install.sh": { - "sha256": "b431517fec535c62b42b517f9212cbb1e9cf80bdf883a55c02bfba08f0d4c404", - "bytes": 2072, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_005684_3c8594a3/environment/post_install.sh", - "byte_equal": true, - "upstream_sha256": "b431517fec535c62b42b517f9212cbb1e9cf80bdf883a55c02bfba08f0d4c404", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_005684_3c8594a3/task.toml": { - "sha256": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2", - "bytes": 850, - "role": "upstream_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_005684_3c8594a3/task.toml", - "byte_equal": true, - "upstream_sha256": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_008667_2151f271/environment/Dockerfile": { - "sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "bytes": 154, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008667_2151f271/environment/Dockerfile", - "byte_equal": true, - "upstream_sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_008667_2151f271/environment/post_install.sh": { - "sha256": "3a777366c4b998e6368627f4775a73cea29fdbdc9991daedfb13244153c17841", - "bytes": 2459, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008667_2151f271/environment/post_install.sh", - "byte_equal": true, - "upstream_sha256": "3a777366c4b998e6368627f4775a73cea29fdbdc9991daedfb13244153c17841", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_008667_2151f271/task.toml": { - "sha256": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897", - "bytes": 967, - "role": "upstream_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008667_2151f271/task.toml", - "byte_equal": true, - "upstream_sha256": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_008998_ae4cbe72/environment/Dockerfile": { - "sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "bytes": 154, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008998_ae4cbe72/environment/Dockerfile", - "byte_equal": true, - "upstream_sha256": "ac07540077f0810363eb57110b6cefeae93df6271c1cc6121d2d62cdc13a9535", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_008998_ae4cbe72/environment/post_install.sh": { - "sha256": "26dfa63d063430c2370144b8e30c1f905dde4e2722403c1e8131a5a84e2d5e69", - "bytes": 723, - "role": "upstream_environment_reference", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008998_ae4cbe72/environment/post_install.sh", - "byte_equal": true, - "upstream_sha256": "26dfa63d063430c2370144b8e30c1f905dde4e2722403c1e8131a5a84e2d5e69", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "components/tmax/upstream/task_008998_ae4cbe72/task.toml": { - "sha256": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9", - "bytes": 823, - "role": "upstream_task_metadata", - "reviewed_record": "tmax/FILE_ALLOWLIST.json", - "component_scope": "source_package_only", - "source": { - "dataset": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "kind": "exact_archive_member", - "archive_path": "tasks.zip!/task_008998_ae4cbe72/task.toml", - "byte_equal": true, - "upstream_sha256": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9", - "hash_record_note": "Copied from reviewed allowlist file entry, whose exact_archive_member/byte_equal provenance applies to this same SHA-256." - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile": { - "sha256": "66b564f58a409177999eda6eea1e5c8009d88c6d72faffa1bac7c497b800a460", - "bytes": 144, - "role": "original_source", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile", - "sha256": "66b564f58a409177999eda6eea1e5c8009d88c6d72faffa1bac7c497b800a460", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md": { - "sha256": "21dc586748f23a8630118831399e1c40d62443444d454bf6f5e7f60ba334b06f", - "bytes": 8121, - "role": "original_source", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/instruction.md", - "sha256": "21dc586748f23a8630118831399e1c40d62443444d454bf6f5e7f60ba334b06f", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/prompt.json": { - "sha256": "97d07b9814fff65f7cd78bf968d4854aa2aa75e8535ceb574b35a93dbf087db0", - "bytes": 8269, - "role": "original_source", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/prompt.json", - "sha256": "97d07b9814fff65f7cd78bf968d4854aa2aa75e8535ceb574b35a93dbf087db0", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/task.toml": { - "sha256": "45af241c0dc3ed0b71fff4db4b2f334760bc387aaff0a74a6dc9543cce2effe1", - "bytes": 561, - "role": "original_source", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/task.toml", - "sha256": "45af241c0dc3ed0b71fff4db4b2f334760bc387aaff0a74a6dc9543cce2effe1", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py": { - "sha256": "8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f", - "bytes": 2383, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py", - "sha256": "8f8067d6fbd793412dd078f35617d367999a644cf040ef4996dfd96c2b2e936f", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py": { - "sha256": "72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c", - "bytes": 15164, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py", - "sha256": "72035a296ec599f0e4743141a76f8dc908be5ac6a7fd500d36fcbb29b8b3687c", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py": { - "sha256": "8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34", - "bytes": 6699, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py", - "sha256": "8046af2d8ca0e74d40ca60624ea3c678b81fa3b76b634818fd96757282f12c34", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json": { - "sha256": "4ed8e4260bc71b5a863888cd3fa2c7bca6210fc5138f96fd2207462c348318b7", - "bytes": 253, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json", - "sha256": "4ed8e4260bc71b5a863888cd3fa2c7bca6210fc5138f96fd2207462c348318b7", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh": { - "sha256": "bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7", - "bytes": 42, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh", - "sha256": "bf3f533beddf0e9db369e092e297d2905013f2aedad52919cb1db76ed7a566f7", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml": { - "sha256": "628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4", - "bytes": 160, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml", - "sha256": "628bca2d87aa70d0176cb3a79879c64bbfb07fc53dd094fd3060173b24a76ef4", - "kind": "original_file_preserved_from_v2" - } - }, - "upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py": { - "sha256": "91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c", - "bytes": 1558, - "role": "original_checker", - "reviewed_record": "pdbthink/PDB_COMPONENT_SOURCE.json", - "source": { - "repository": "open-athena/pdbthink-coordinate-tasks", - "revision": "3734406cb97b1702844319f9a5d860cbbf8fe660", - "path": "pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py", - "sha256": "91441587561c00649cec98159d22f64d11b01fff459601cce79579737f0fa37c", - "kind": "original_file_preserved_from_v2" - } + "license": "MIT", + "source_file": "SOURCE.json", + "instance_policy": "Original generator with default seed 0 and original explicit seed behavior.", + "reward": "Original mean of pass fractions across behavior groups.", + "record_sha256": "4da7db21c634d28a954e5f83145d7f6b2de7a5b1ab62ac193f815e6684ab1406" } } } diff --git a/components/audit/Dockerfile b/components/audit/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7acbc41340d5b5f15177e7d250c3e739aef2b6fc --- /dev/null +++ b/components/audit/Dockerfile @@ -0,0 +1,12 @@ +FROM ghcr.io/bochencs/openenv-pdbthink@sha256:cf4c1c22bc9656adb95815c560e8261c83c7658b036edde59b20eace0af3248a +USER root +COPY runtime /opt/audit/runtime +COPY upstream /opt/audit/upstream +COPY tasks /opt/audit/tasks +COPY SOURCE.json config.json NOTICE /opt/audit/ +RUN chmod -R go-rwx /opt/audit +ENV PYTHONPATH=/opt/audit/runtime:/opt/audit/upstream PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 ENABLE_WEB_INTERFACE=false OPENENV_MODE=simulation GRADIO_ANALYTICS_ENABLED=false HF_HUB_OFFLINE=1 +WORKDIR /opt/audit +EXPOSE 8000 +HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3).read()"] +CMD ["python", "-m", "audit.server"] diff --git a/components/audit/NOTICE b/components/audit/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..08386109066024bcf3bbab93eee265a7741b5ba1 --- /dev/null +++ b/components/audit/NOTICE @@ -0,0 +1,3 @@ +Audit Trail by Noe Flandre, Apache-2.0. +Source: https://github.com/NoeFlandre/openenv-arena/tree/e6b007ff234bd48449fa5ea045c083f30550389d +Adaptations: shared OpenEnv schema, per-session module isolation and task registration. diff --git a/components/audit/README.md b/components/audit/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a0da62d9beab12521ba698743d849777527dfb92 --- /dev/null +++ b/components/audit/README.md @@ -0,0 +1 @@ +Two original Audit Trail tasks: auth-05 and ledger-01. The original fixed logs, ten-action limit and exact-answer grader are preserved. Shared actions map grep and answer to the original tools. diff --git a/components/audit/SOURCE.json b/components/audit/SOURCE.json new file mode 100644 index 0000000000000000000000000000000000000000..0ac9fa93d13ea4491f3273f26de6b3acd828c33d --- /dev/null +++ b/components/audit/SOURCE.json @@ -0,0 +1,22 @@ +{ + "source_dataset": "NoeFlandre/audit-trail", + "source_revision": "f821596324c2d3f29130ebc7054a22c6bd5559d4", + "source_url": "https://huggingface.co/datasets/NoeFlandre/audit-trail/tree/f821596324c2d3f29130ebc7054a22c6bd5559d4", + "source_github_revision": "e6b007ff234bd48449fa5ea045c083f30550389d", + "source_github_url": "https://github.com/NoeFlandre/openenv-arena/tree/e6b007ff234bd48449fa5ea045c083f30550389d", + "license": "Apache-2.0", + "registered_tasks": [ + "auth-05", + "ledger-01" + ], + "files": { + "upstream/LICENSE": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30", + "upstream/audit_trail/__init__.py": "638536fc5897e3dd2aea2ce4671bf321e45d6de0ece20bc857ea38126f058dc8", + "upstream/audit_trail/models.py": "5156b42a8bebe5bf119a654f8e081eea0c7614f32933b2fd262c078b66e54276", + "upstream/audit_trail/tasks.py": "c2f1193259d9c0dfecc2645bcc7ba36b01d336cad2aa5cc3c7ed358f9aa27b2a", + "upstream/audit_trail/server/__init__.py": "c27b096b1833ae60a6dff6108164d107cd5ecd50524a38ba22dd695733011aeb", + "upstream/audit_trail/server/audit_trail_environment.py": "5428cf74f5d6a6ea75e67ad2eb061d96ed391bff146c01ece422b984273d1125", + "upstream/dataset/README.md": "d70f12d0207ac89da7804330af5a207e1784e6603b565b73e40d786de75364b0", + "upstream/dataset/tasks.jsonl": "dcb67aca547276783eb5f0da148ebcbd55d69d13cbb6dd437e0108ae971be1e8" + } +} diff --git a/components/audit/config.json b/components/audit/config.json new file mode 100644 index 0000000000000000000000000000000000000000..6059ac96b77c8b49eb21fcd4af4a19e613db2cc0 --- /dev/null +++ b/components/audit/config.json @@ -0,0 +1,44 @@ +{ + "tasks": [ + { + "task_id": "auth-05", + "split": "train", + "seed": 2005, + "accepted_seed": 2005, + "family": "auth", + "level": 5, + "source_dataset": "NoeFlandre/audit-trail", + "source_revision": "f821596324c2d3f29130ebc7054a22c6bd5559d4", + "source_url": "https://huggingface.co/datasets/NoeFlandre/audit-trail/tree/f821596324c2d3f29130ebc7054a22c6bd5559d4", + "source_github_revision": "e6b007ff234bd48449fa5ea045c083f30550389d", + "license": "Apache-2.0", + "original_instruction": "tasks/auth-05/instruction.md", + "instruction_sha256": "e58b70774d5f729ae49c59cb82c019972e889b7353dabe1d6b9eefc085993119", + "question_sha256": "c53c4bfeb41ddba2094a9d513304f1f20f200d8235843f75484ddb960f58abd5", + "log_sha256": "d2c23a77aea2e5049297bb14ed21fb7bc6a18712d1cf100836cca5e0b776d587", + "grading": "Original exact answer, case-insensitive; correct 1, otherwise 0", + "rendered_question_sha256": "260bc6fa5e59ccc1c5a1f590775ebe1e246b9da8e63662c637d25ebe643634b2", + "rendered_protocol": "Original PROTOCOL suffix replaced with shared call/finish schema; preceding question is unchanged" + }, + { + "task_id": "ledger-01", + "split": "train", + "seed": 2011, + "accepted_seed": 2011, + "family": "ledger", + "level": 1, + "source_dataset": "NoeFlandre/audit-trail", + "source_revision": "f821596324c2d3f29130ebc7054a22c6bd5559d4", + "source_url": "https://huggingface.co/datasets/NoeFlandre/audit-trail/tree/f821596324c2d3f29130ebc7054a22c6bd5559d4", + "source_github_revision": "e6b007ff234bd48449fa5ea045c083f30550389d", + "license": "Apache-2.0", + "original_instruction": "tasks/ledger-01/instruction.md", + "instruction_sha256": "141f54a8f1dc40c48f5a691cb2cdc9b15e8f3c029c7c3d500b8f8a054e82152b", + "question_sha256": "c131345800dedf98dd94e8deafa961a802a37a8d5226ae0820c75c1c5388a74e", + "log_sha256": "1560ae70923c515859a8eebb7daf21487e643c0771d93d708eeb86d402819f89", + "grading": "Original exact answer, case-insensitive; correct 1, otherwise 0", + "rendered_question_sha256": "afcc6d9e5baca3e5756678d0f5603761515e64c3c54876608d810ab08e0507b1", + "rendered_protocol": "Original PROTOCOL suffix replaced with shared call/finish schema; preceding question is unchanged" + } + ] +} diff --git a/components/audit/runtime/audit/__init__.py b/components/audit/runtime/audit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/components/audit/runtime/audit/environment.py b/components/audit/runtime/audit/environment.py new file mode 100644 index 0000000000000000000000000000000000000000..3c76742c2c319d7cfd6f653b3625ed7455754164 --- /dev/null +++ b/components/audit/runtime/audit/environment.py @@ -0,0 +1,128 @@ +import hashlib +import importlib.util +import json +import sys +from pathlib import Path +from threading import RLock +from uuid import uuid4 + +from openenv.core.env_server.interfaces import Environment +from openenv.core.env_server.types import EnvironmentMetadata, State +from common.models import ArenaAction, ArenaObservation + +ROOT = Path('/opt/audit') +SOURCE = json.loads((ROOT / 'SOURCE.json').read_text()) +for relative, digest in SOURCE['files'].items(): + if hashlib.sha256((ROOT / relative).read_bytes()).hexdigest() != digest: + raise RuntimeError('Original source hash mismatch') +from audit_trail.models import AuditTrailAction +from audit_trail.tasks import PROTOCOL + +TASK_IDS = tuple(SOURCE['registered_tasks']) +ACTION_MAPPING = ('Use {"op":"call","tool":"grep","arguments":{"text":""}} to search the log, ' + 'or {"op":"call","tool":"answer","arguments":{"value":""}} to answer. ' + 'The requested answer-only value belongs in arguments.value. Return the complete action JSON. ' + 'Use {"op":"finish"} to end without an answer. There are 10 actions including the answer.') + + +def render_question(question): + if not question.endswith(PROTOCOL) or question.count(PROTOCOL) != 1: + raise RuntimeError('Original protocol suffix changed') + return question[:-len(PROTOCOL)] + ACTION_MAPPING + + +class AuditEnvironment(Environment): + SUPPORTS_CONCURRENT_SESSIONS = True + + def __init__(self): + self.lock = RLock() + self.module_name = 'audit_trail.server._session_' + uuid4().hex + path = ROOT / 'upstream/audit_trail/server/audit_trail_environment.py' + spec = importlib.util.spec_from_file_location(self.module_name, path) + self.original = importlib.util.module_from_spec(spec) + sys.modules[self.module_name] = self.original + try: + spec.loader.exec_module(self.original) + self.env = self.original.AuditTrailEnvironment() + except BaseException: + sys.modules.pop(self.module_name, None) + raise + self.task_id = None + self.terminal = None + + def _translate(self, observation): + message = render_question(observation.question) if observation.question else observation.output + if message == 'send exactly one of grep or answer': + message = 'Use call with tool grep and arguments.text, or tool answer and arguments.value.' + result = ArenaObservation(task_id=observation.task_id, message=message, + data={'steps_left': observation.steps_left}, reward=observation.reward, done=observation.done) + if observation.done: + self.terminal = result + return result + + def reset(self, *, task_id=None, seed=None, index=None, split='train', episode_id=None, **kwargs): + with self.lock: + if split != 'train': + raise ValueError('Unknown split') + if index is not None: + if type(index) is not int or not 0 <= index < len(TASK_IDS): + raise ValueError('Invalid task index') + if task_id is not None and task_id != TASK_IDS[index]: + raise ValueError('Task selection mismatch') + task_id = TASK_IDS[index] + task_id = task_id or TASK_IDS[0] + if task_id not in TASK_IDS or (seed is not None and type(seed) is not int): + raise ValueError('Invalid task or seed') + self.task_id = task_id + self.terminal = None + return self._translate(self.env.reset(task_id=task_id, seed=seed, episode_id=episode_id)) + + def step(self, action, timeout_s=None, **kwargs): + with self.lock: + if self.task_id is None: + raise ValueError('Reset before stepping') + if self.terminal is not None: + return self.terminal + value = action.action_payload() if isinstance(action, ArenaAction) else ArenaAction.model_validate(action).action_payload() + mapped = {} + if value['op'] == 'finish': + mapped = {'answer': ''} + elif value['op'] == 'call': + tool, args = value['tool'], value['arguments'] + if tool == 'grep' and set(args) == {'text'} and isinstance(args['text'], str) and len(args['text']) <= 200: + mapped = {'grep': args['text']} + elif tool == 'answer' and set(args) == {'value'} and isinstance(args['value'], str) and len(args['value']) <= 64: + mapped = {'answer': args['value']} + return self._translate(self.env.step(AuditTrailAction(**mapped), timeout_s=timeout_s)) + + @property + def state(self): + with self.lock: + return self.env.state + + def close(self): + with self.lock: + self.original._episode = None + self.task_id = None + self.terminal = None + sys.modules.pop(self.module_name, None) + + def get_metadata(self): + return EnvironmentMetadata(name='audit_trail', version='1.0.0', description='Original fixed-seed log audit tasks.') + + def list_splits(self): + return ['train'] + + def list_tasks(self, split): + if split != 'train': + raise ValueError('Unknown split') + return [{'id': name, 'index': i} for i, name in enumerate(TASK_IDS)] + + def num_tasks(self, split): + return len(self.list_tasks(split)) + + def get_task(self, split, index): + return self.list_tasks(split)[index] + + def get_task_range(self, split, start=None, stop=None): + return self.list_tasks(split)[start:stop] diff --git a/components/audit/runtime/audit/server.py b/components/audit/runtime/audit/server.py new file mode 100644 index 0000000000000000000000000000000000000000..446442528eb84fab47b7aefb31ed0a892e919e13 --- /dev/null +++ b/components/audit/runtime/audit/server.py @@ -0,0 +1,14 @@ +from openenv.core.env_server.http_server import create_app +from common.models import ArenaAction, ArenaObservation +from .environment import AuditEnvironment + +app = create_app(AuditEnvironment, ArenaAction, ArenaObservation, env_name='audit_trail', max_concurrent_envs=5) + + +def main(): + import uvicorn + uvicorn.run(app, host='0.0.0.0', port=8000, log_level='warning') + + +if __name__ == '__main__': + main() diff --git a/components/awm/runtime/awm/__init__.py b/components/audit/runtime/common/__init__.py similarity index 100% rename from components/awm/runtime/awm/__init__.py rename to components/audit/runtime/common/__init__.py diff --git a/components/awm/runtime/common/contracts.py b/components/audit/runtime/common/contracts.py similarity index 100% rename from components/awm/runtime/common/contracts.py rename to components/audit/runtime/common/contracts.py diff --git a/components/math/runtime/common/models.py b/components/audit/runtime/common/models.py similarity index 87% rename from components/math/runtime/common/models.py rename to components/audit/runtime/common/models.py index b862e2d3259ab1c55bbb46e6423587b742dbcc51..4d7bfa208b39f5e19d3e358c6d23c0f59041efad 100644 --- a/components/math/runtime/common/models.py +++ b/components/audit/runtime/common/models.py @@ -5,6 +5,7 @@ from typing import Any, Literal import jsonschema from openenv.core.env_server.types import Action, Observation from pydantic import ConfigDict, Field, model_serializer, model_validator +from pydantic_core import PydanticCustomError from .contracts import ACTION_SCHEMA @@ -22,7 +23,7 @@ class ArenaAction(Action): return value def finite(item): if isinstance(item,float) and not math.isfinite(item): - raise ValueError('Non-finite JSON number') + raise PydanticCustomError('finite_number', 'Non-finite JSON number') if isinstance(item,dict): for part in item.values():finite(part) elif isinstance(item,list): @@ -31,7 +32,7 @@ class ArenaAction(Action): try: jsonschema.Draft202012Validator(ACTION_SCHEMA).validate(value) except jsonschema.ValidationError as exc: - raise ValueError(exc.message) from exc + raise PydanticCustomError('action_contract', '{message}', {'message': exc.message}) from exc return value @classmethod diff --git a/components/audit/tasks/auth-05/instruction.md b/components/audit/tasks/auth-05/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..7478c9c2a8bf586e6f3bb1c6bff8b811fb0f79ec --- /dev/null +++ b/components/audit/tasks/auth-05/instruction.md @@ -0,0 +1 @@ +Some source IPs tried to log in between 12:00 and 13:00. Consider only successful logins (result=ok) that came after at least 6 failed logins (result=fail) from the same source IP. Which user name is on the earliest such successful login? Answer with the user name only. Reply {"grep": ""} to search the log (up to 10 matching lines), or {"answer": ""} to finish. diff --git a/components/audit/tasks/ledger-01/instruction.md b/components/audit/tasks/ledger-01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..eae52292486e67f3fe5225b9a6aeb87d8f149830 --- /dev/null +++ b/components/audit/tasks/ledger-01/instruction.md @@ -0,0 +1 @@ +A duplicate charge is a debit that has an earlier debit with the same acct and the same amount, from 1 to 90 seconds before it, where that earlier debit has no reversal line anywhere in the log whose ref is its txn id. Which txn id is the earliest duplicate charge? Answer with the txn id only. Reply {"grep": ""} to search the log (up to 10 matching lines), or {"answer": ""} to finish. diff --git a/LICENSES/Apache-2.0-PDBThink.txt b/components/audit/upstream/LICENSE similarity index 99% rename from LICENSES/Apache-2.0-PDBThink.txt rename to components/audit/upstream/LICENSE index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..d645695673349e3947e8e5ae42332d0ac3164cd7 100644 --- a/LICENSES/Apache-2.0-PDBThink.txt +++ b/components/audit/upstream/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/components/audit/upstream/audit_trail/__init__.py b/components/audit/upstream/audit_trail/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f8aa5e1738266a2d3c93f1d9f636cfb08faeba80 --- /dev/null +++ b/components/audit/upstream/audit_trail/__init__.py @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 + +"""Audit Trail Environment.""" + +from .models import AuditTrailAction, AuditTrailObservation + +__all__ = [ + "AuditTrailAction", + "AuditTrailObservation", +] diff --git a/components/audit/upstream/audit_trail/models.py b/components/audit/upstream/audit_trail/models.py new file mode 100644 index 0000000000000000000000000000000000000000..e33d8ad4b7fedeee2e7f8a4ec20b7ede26fe2b87 --- /dev/null +++ b/components/audit/upstream/audit_trail/models.py @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: Apache-2.0 + +""" +Actions and observations for the Audit Trail environment. +""" + +from openenv.core.env_server.types import Action, Observation +from pydantic import Field + + +class AuditTrailAction(Action): + """Search the log or answer. Send exactly one of the two fields.""" + + grep: str | None = Field( + default=None, + max_length=200, + description="Return up to 10 log lines containing this text (case-insensitive). " + "An empty string returns the first 10 lines.", + ) + answer: str | None = Field( + default=None, + max_length=64, + description="The value the question asks for. Ends the episode.", + ) + + +class AuditTrailObservation(Observation): + """What the agent sees after each action.""" + + task_id: str = Field(default="", description="Task being played") + question: str = Field(default="", description="The question. Sent once, at reset.") + output: str = Field(default="", description="Result of the last action") + steps_left: int = Field(default=0, description="Actions left before the episode ends") diff --git a/components/audit/upstream/audit_trail/server/__init__.py b/components/audit/upstream/audit_trail/server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d3754d08de113f28b8bd3311d4e59f4cb77a08a3 --- /dev/null +++ b/components/audit/upstream/audit_trail/server/__init__.py @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 + +"""Audit Trail environment server components.""" + +from .audit_trail_environment import AuditTrailEnvironment + +__all__ = ["AuditTrailEnvironment"] diff --git a/components/audit/upstream/audit_trail/server/audit_trail_environment.py b/components/audit/upstream/audit_trail/server/audit_trail_environment.py new file mode 100644 index 0000000000000000000000000000000000000000..1150bdfa5cb96a1f823ed23c9076628a2253602f --- /dev/null +++ b/components/audit/upstream/audit_trail/server/audit_trail_environment.py @@ -0,0 +1,111 @@ +# SPDX-License-Identifier: Apache-2.0 + +""" +Audit Trail environment. + +Each task is one log from a fixed seed, in one of three families: auth logs +(cybersecurity), ledger (finance) and sensor readings (natural science). The +question states a rule. The agent searches the log with ``grep`` and ends the +episode with ``answer``. Reward is 1.0 for the right value and 0.0 otherwise. +""" + +from uuid import uuid4 + +from openenv.core.env_server.interfaces import Environment +from openenv.core.env_server.types import State + +from ..models import AuditTrailAction, AuditTrailObservation +from ..tasks import TASKS, build + +MAX_STEPS = 10 +MAX_MATCHES = 10 + +# Shared by all instances. The HTTP server builds a new instance per request, +# so the episode must live outside the instance. The arena runs one episode +# per sandbox at a time. +_episode: dict | None = None + + +class AuditTrailEnvironment(Environment): + """Answer a question about one log by searching it with grep.""" + + SUPPORTS_CONCURRENT_SESSIONS: bool = False + + def reset( + self, + seed: int | None = None, + episode_id: str | None = None, + task_id: str | None = None, + **kwargs, + ) -> AuditTrailObservation: + global _episode + task_id = task_id or next(iter(TASKS)) + if task_id not in TASKS: + raise ValueError(f"unknown task_id {task_id!r}") + + built = build(task_id) + _episode = { + "episode_id": episode_id or str(uuid4()), + "task_id": task_id, + "lines": built.lines, + "question": built.question, + "answer": built.answer, + "steps": 0, + "done": False, + "reward": 0.0, + } + return self._observation(output="", done=False, reward=0.0) + + def step( + self, + action: AuditTrailAction, + timeout_s: float | None = None, + **kwargs, + ) -> AuditTrailObservation: # type: ignore[override] + ep = self._require_episode() + if ep["done"]: + return self._observation(output="the episode is over", done=True, reward=ep["reward"]) + + ep["steps"] += 1 + if action.answer is not None and action.grep is None: + correct = action.answer.strip().lower() == ep["answer"] + return self._finish(1.0 if correct else 0.0, "correct" if correct else "wrong") + if action.grep is not None and action.answer is None: + needle = action.grep.lower() + matches = [line for line in ep["lines"] if needle in line.lower()] + output = "\n".join(matches[:MAX_MATCHES]) or "no matching lines" + if len(matches) > MAX_MATCHES: + output += f"\n({len(matches)} matches, first {MAX_MATCHES} shown)" + else: + output = "send exactly one of grep or answer" + + if ep["steps"] >= MAX_STEPS: + return self._finish(0.0, output + "\nno steps left") + return self._observation(output=output, done=False, reward=0.0) + + @property + def state(self) -> State: + ep = _episode or {} + return State(episode_id=ep.get("episode_id"), step_count=ep.get("steps", 0)) + + def _require_episode(self) -> dict: + if _episode is None: + raise RuntimeError("call reset() before step()") + return _episode + + def _finish(self, reward: float, output: str) -> AuditTrailObservation: + ep = self._require_episode() + ep["done"] = True + ep["reward"] = reward + return self._observation(output=output, done=True, reward=reward) + + def _observation(self, output: str, done: bool, reward: float) -> AuditTrailObservation: + ep = self._require_episode() + return AuditTrailObservation( + task_id=ep["task_id"], + question=ep["question"] if ep["steps"] == 0 else "", + output=output, + steps_left=max(0, MAX_STEPS - ep["steps"]), + done=done, + reward=reward, + ) diff --git a/components/audit/upstream/audit_trail/tasks.py b/components/audit/upstream/audit_trail/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..b67e50c44b22301874257f3e26d53f9c54f1581e --- /dev/null +++ b/components/audit/upstream/audit_trail/tasks.py @@ -0,0 +1,381 @@ +# SPDX-License-Identifier: Apache-2.0 + +""" +Tasks for the Audit Trail environment. + +Three families of logs: authentication (cybersecurity), ledger (finance) and +sensor readings (natural science). Each task builds one log from its seed. The +question states a rule, and the answer follows from that rule. The answer is +computed from the log when the task is built. No answer is stored. + +Levels 0-2 are easy, 3-5 medium and 6-7 hard. Harder levels have longer logs, +more decoys and a larger threshold, so one grep shows less of the answer. +""" + +import random +from collections.abc import Callable +from dataclasses import dataclass + +FAMILIES = ("auth", "ledger", "sensor") +TASKS_PER_FAMILY = 8 + +# A generator rejects a seed when its log does not meet the family's checks. It then tries +# seed + ATTEMPT_STEP, and so on up to MAX_ATTEMPTS. The accepted seed is recorded in the task. +MAX_ATTEMPTS = 50 +ATTEMPT_STEP = 100 + +PROTOCOL = ( + 'Reply {"grep": ""} to search the log (up to 10 matching lines), ' + 'or {"answer": ""} to finish.' +) + + +@dataclass(frozen=True) +class Task: + task_id: str + family: str + level: int + seed: int + + +@dataclass(frozen=True) +class Built: + lines: list[str] + answer: str + question: str + seed: int + + +def _task_table() -> dict[str, Task]: + table: dict[str, Task] = {} + for family_index, family in enumerate(FAMILIES): + for level in range(TASKS_PER_FAMILY): + task_id = f"{family}-{level:02d}" + table[task_id] = Task(task_id, family, level, 2000 + 10 * family_index + level) + return table + + +TASKS = _task_table() + + +def _tier(level: int) -> int: + return 0 if level < 3 else 1 if level < 6 else 2 + + +def _clock(seconds: int) -> str: + hours, rest = divmod(seconds, 3600) + minutes, secs = divmod(rest, 60) + return f"{hours:02d}:{minutes:02d}:{secs:02d}" + + +def _claim(used: set[int], second: int) -> int: + """Return the first second at or after ``second`` that no other line uses.""" + while second in used: + second += 1 + used.add(second) + return second + + +def _ask(body: str, reply: str) -> str: + return f"{body} Answer with {reply} only. {PROTOCOL}" + + +# ---------------------------------------------------------------- auth + + +AUTH_USERS = ["alice", "bob", "carol", "dave", "erin", "frank", "grace", "heidi", "ivan", "judy"] +AUTH_START = 12 * 3600 +AUTH_END = 13 * 3600 - 1 +AUTH_LINES = (42, 52, 62) +AUTH_NEAR_MISSES = (1, 2, 3) +AUTH_FAIL_ONLY = (1, 1, 2) +AUTH_LEGIT_SOURCES = 4 + + +def _make_auth(level: int, rng: random.Random) -> Built | None: + """One source has k failures and then a success. Near misses have k-1 failures, fail-only + sources have no success, and legitimate sources have fewer than k failures in total.""" + tier = _tier(level) + k = 5 + level // 3 + near, fail_only = AUTH_NEAR_MISSES[tier], AUTH_FAIL_ONLY[tier] + used: set[int] = set() + octets = rng.sample(range(1, 200), 1 + near + fail_only + AUTH_LEGIT_SOURCES) + ips = [f"10.0.{octet}.{rng.randint(100, 199)}" for octet in octets] + target, near_ips = ips[0], ips[1 : 1 + near] + fail_ips = ips[1 + near : 1 + near + fail_only] + legit_ips = ips[1 + near + fail_only :] + + events: list[tuple[int, str, str, str]] = [] + answer_user = rng.choice(AUTH_USERS) + + def when(low: int, high: int) -> int: + return _claim(used, rng.randrange(low, high)) + + def run_of_fails(source: str, count: int) -> list[int]: + times = sorted(when(AUTH_START, AUTH_END - 900) for _ in range(count)) + events.extend((t, rng.choice(AUTH_USERS), source, "fail") for t in times) + return times + + fails = run_of_fails(target, k) + events.append((_claim(used, fails[-1] + rng.randint(30, 300)), answer_user, target, "ok")) + + for source in near_ips: + fails = run_of_fails(source, k - 1) + events.append( + (_claim(used, fails[-1] + rng.randint(30, 300)), rng.choice(AUTH_USERS), source, "ok") + ) + + for source in fail_ips: + run_of_fails(source, k + 3) + + for source in legit_ips: + run_of_fails(source, rng.randint(0, min(k - 1, 2))) + + target_lines = AUTH_LINES[tier] + rng.randint(0, 4) + while len(events) < target_lines: + source = rng.choice(legit_ips) + events.append((when(AUTH_START, AUTH_END), rng.choice(AUTH_USERS), source, "ok")) + + # The rule: an ok line counts when its source has at least k fail lines before it. + qualifying: dict[str, list[tuple[int, str]]] = {} + seen_fails: dict[str, int] = {} + for second, name, source, result in sorted(events): + if result == "fail": + seen_fails[source] = seen_fails.get(source, 0) + 1 + elif seen_fails.get(source, 0) >= k: + qualifying.setdefault(source, []).append((second, name)) + if set(qualifying) != {target}: + return None + answer = min(qualifying[target])[1] + + lines = [ + f"{_clock(second)} auth user={name} src={source} result={result}" + for second, name, source, result in sorted(events) + ] + question = _ask( + "Some source IPs tried to log in between 12:00 and 13:00. Consider only successful logins " + f"(result=ok) that came after at least {k} failed logins (result=fail) from the same " + "source IP. Which user name is on the earliest such successful login?", + "the user name", + ) + return Built(lines, answer, question, 0) + + +# ---------------------------------------------------------------- ledger + + +LEDGER_START = 10 * 3600 +LEDGER_END = 11 * 3600 - 1 +LEDGER_WINDOW = 90 +LEDGER_LINES = (38, 48, 58) +LEDGER_DUPLICATES = (1, 2, 2) + + +@dataclass(frozen=True) +class Txn: + second: int + txn: str + acct: str + kind: str + amount: str + ref: str + + +def _ledger_duplicates(txns: list[Txn]) -> list[Txn]: + """Each debit that has an earlier debit with the same account and amount, 1 to 90 s before, + where that earlier debit has no reversal line whose ref is its txn id.""" + reversed_refs = {t.ref for t in txns if t.kind == "reversal"} + debits = [t for t in txns if t.kind == "debit"] + duplicates = [] + for later in debits: + for earlier in debits: + gap = later.second - earlier.second + if ( + earlier.acct == later.acct + and earlier.amount == later.amount + and 1 <= gap <= LEDGER_WINDOW + and earlier.txn not in reversed_refs + ): + duplicates.append(later) + break + return duplicates + + +def _make_ledger(level: int, rng: random.Random) -> Built | None: + tier = _tier(level) + used: set[int] = set() + ids = iter(rng.sample(range(1000, 10000), 200)) + accts = [f"A-{n}" for n in rng.sample(range(10, 100), 60)] + cents = iter(rng.sample(range(1000, 50000), 200)) + + def amount() -> str: + value = next(cents) + return f"{value // 100}.{value % 100:02d}" + + def txn_id() -> str: + return f"T{next(ids)}" + + def at(low: int, high: int) -> int: + return _claim(used, rng.randrange(low, high)) + + txns: list[Txn] = [] + + # True duplicates: a debit repeated within the window, never reversed. + for index in range(LEDGER_DUPLICATES[tier]): + account, value = accts[index], amount() + first = at(LEDGER_START, LEDGER_END - 900) + txns.append(Txn(first, txn_id(), account, "debit", value, "-")) + dup = _claim(used, first + rng.randint(1, LEDGER_WINDOW)) + txns.append(Txn(dup, txn_id(), account, "debit", value, "-")) + + decoy_base = 3 + LEDGER_DUPLICATES[tier] + for index in range(1 + tier): + other, third, fourth = ( + accts[decoy_base + 3 * index], + accts[decoy_base + 1 + 3 * index], + accts[decoy_base + 2 + 3 * index], + ) + + # Same amount on another account, within the window: not a duplicate. + same_amount = amount() + t1 = at(LEDGER_START, LEDGER_END - 900) + txns.append(Txn(t1, txn_id(), other, "debit", same_amount, "-")) + t2 = _claim(used, t1 + rng.randint(1, LEDGER_WINDOW)) + txns.append(Txn(t2, txn_id(), third, "debit", same_amount, "-")) + + # Same account and amount, but more than the window apart: not a duplicate. + far_amount = amount() + t3 = at(LEDGER_START, LEDGER_END - 1800) + txns.append(Txn(t3, txn_id(), other, "debit", far_amount, "-")) + t4 = _claim(used, t3 + rng.randint(120, 900)) + txns.append(Txn(t4, txn_id(), other, "debit", far_amount, "-")) + + # Same account and amount within the window, but the earlier debit was reversed. + reversed_amount = amount() + t5 = at(LEDGER_START, LEDGER_END - 1800) + reversed_id = txn_id() + txns.append(Txn(t5, reversed_id, third, "debit", reversed_amount, "-")) + t6 = _claim(used, t5 + rng.randint(1, LEDGER_WINDOW)) + txns.append(Txn(t6, txn_id(), third, "debit", reversed_amount, "-")) + t7 = _claim(used, t6 + rng.randint(1, 300)) + txns.append(Txn(t7, txn_id(), third, "reversal", reversed_amount, reversed_id)) + + # A credit with the same amount as an earlier debit, within the window: not a duplicate. + credit_amount = amount() + t8 = at(LEDGER_START, LEDGER_END - 900) + txns.append(Txn(t8, txn_id(), fourth, "debit", credit_amount, "-")) + t9 = _claim(used, t8 + rng.randint(1, LEDGER_WINDOW)) + txns.append(Txn(t9, txn_id(), fourth, "credit", credit_amount, "-")) + + while len(txns) < LEDGER_LINES[tier] + rng.randint(0, 4): + kind = rng.choice(["debit", "debit", "credit"]) + txns.append( + Txn(at(LEDGER_START, LEDGER_END), txn_id(), rng.choice(accts[40:]), kind, amount(), "-") + ) + + duplicates = _ledger_duplicates(txns) + if len(duplicates) != LEDGER_DUPLICATES[tier]: + return None + earliest = min(duplicates, key=lambda t: t.second) + txns.sort(key=lambda t: t.second) + lines = [ + f"{_clock(t.second)} txn={t.txn} acct={t.acct} type={t.kind} amount={t.amount} ref={t.ref}" + for t in txns + ] + question = _ask( + "A duplicate charge is a debit that has an earlier debit with the same acct and the same " + f"amount, from 1 to {LEDGER_WINDOW} seconds before it, where that earlier debit has no " + "reversal line anywhere in the log whose ref is its txn id. Which txn id is the earliest " + "duplicate charge?", + "the txn id", + ) + return Built(lines, earliest.txn.lower(), question, 0) + + +# ---------------------------------------------------------------- sensor + + +STATIONS = ["delta", "harbor", "lake", "mesa", "pine", "quarry", "ridge", "summit"] +SENSOR_STATIONS = (3, 5, 6) +SENSOR_READINGS = (15, 11, 9) +SENSOR_LAST_MINUTE = 6 * 60 + 50 # each station ends near 06:50, after the alert +HEAT_START = 6 * 3600 +THRESHOLD = 300 # tenths of a degree C, so 30.0 C is exact + + +def _make_sensor(level: int, rng: random.Random) -> Built | None: + """Stations report every 10 minutes at their own offset, so no two readings share a minute. + The answer is the station with the earliest onset (first reading from 06:00 at 30.0 C or more) + whose next reading is also 30.0 C or more. Seeds are rejected unless the answer is hidden + from a plain grep for hot readings.""" + tier = _tier(level) + names = rng.sample(STATIONS, SENSOR_STATIONS[tier]) + offsets = rng.sample(range(10), len(names)) + count = SENSOR_READINGS[tier] + first_minute = SENSOR_LAST_MINUTE - 10 * (count - 1) + readings: list[tuple[int, str, int]] = [] + for name, offset in zip(names, offsets, strict=True): + temp = rng.randint(270, 300) + for index in range(count): + temp = min(max(temp + rng.randint(-25, 25), 240), 340) + minute = first_minute + 10 * index + offset + readings.append((minute * 60, name, temp)) + readings.sort() + + hot = [r for r in readings if r[2] >= THRESHOLD] + if len(hot) < 12 or sum(1 for r in hot if r[0] < HEAT_START) < 5: + return None + + best: tuple[int, str] | None = None + for name in names: + series = [(second, temp) for second, station, temp in readings if station == name] + onset = next( + ( + i + for i, (second, temp) in enumerate(series) + if second >= HEAT_START and temp >= THRESHOLD + ), + None, + ) + if onset is None or onset + 1 >= len(series) or series[onset + 1][1] < THRESHOLD: + continue + if best is None or series[onset][0] < best[0]: + best = (series[onset][0], name) + if best is None: + return None + # Six hot readings come before the answer, so it is not among the first hot readings in the log. + if sum(1 for r in hot if r[0] < best[0]) < 6: + return None + + lines = [ + f"{_clock(second)[:5]} station={station} temp_c={temp // 10}.{temp % 10}" + for second, station, temp in readings + ] + question = _ask( + "A heat alert started at 06:00. For each station, take its first reading at or after " + "06:00 that is 30.0 C or more. Keep the stations whose next reading after that reading " + "is also 30.0 C or more. Which kept station has the earliest such reading?", + "the station name", + ) + return Built(lines, best[1], question, 0) + + +# ---------------------------------------------------------------- public + + +_MAKERS: dict[str, Callable[[int, random.Random], Built | None]] = { + "auth": _make_auth, + "ledger": _make_ledger, + "sensor": _make_sensor, +} + + +def build(task_id: str) -> Built: + """Build the log, the answer, the question and the accepted seed for one task.""" + task = TASKS[task_id] + for attempt in range(MAX_ATTEMPTS): + seed = task.seed + ATTEMPT_STEP * attempt + built = _MAKERS[task.family](task.level, random.Random(seed)) + if built is not None: + return Built(built.lines, built.answer, built.question, seed) + raise ValueError(f"no accepted log for {task_id} within {MAX_ATTEMPTS} seeds") diff --git a/components/audit/upstream/dataset/README.md b/components/audit/upstream/dataset/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2b0749f2318454d413c96bde6882375b3d75ad32 --- /dev/null +++ b/components/audit/upstream/dataset/README.md @@ -0,0 +1,57 @@ +--- +license: apache-2.0 +language: + - en +pretty_name: Audit Trail tasks +tags: + - openenv + - log-analysis + - cybersecurity + - finance + - reinforcement-learning +size_categories: + - n<1K +--- + +# Audit Trail tasks + +This dataset lists the tasks of the Audit Trail OpenEnv environment. The environment code is in the [GitHub repository](https://github.com/NoeFlandre/openenv-arena). + +## What the environment teaches + +The agent gets one log and a question. The question states a rule. The agent searches the log with `grep` and gives one answer. The rule has two steps: find the right lines, then compare them. The logs come from three families: + +| Family | Domain | Rule | +| --- | --- | --- | +| `auth` | Cybersecurity | The earliest successful login from a source IP that had at least K failed logins before it. Answer: the user name. | +| `ledger` | Finance | The earliest debit that repeats an earlier debit with the same account and amount, 1 to 90 seconds before it, where the earlier debit was never reversed. Answer: the txn id. | +| `sensor` | Natural science | Among stations whose first reading at or after 06:00 of 30.0 C or more is followed by another reading of 30.0 C or more, the station with the earliest such reading. Answer: the station name. | + +Each task has a level from 0 to 7. Levels 0 to 2 are easy, 3 to 5 medium and 6 to 7 hard. Harder levels have longer logs, more decoys and a higher K. + +## Files + +| File | Contents | +| --- | --- | +| `tasks.jsonl` | One task for each line: `task_id`, `split`, `family`, `level` and the accepted `seed`. | + +The dataset does not contain the logs. The server builds each log from its seed, so the same seed always gives the same log and answer. If a seed does not give a log that passes the checks, the server tries the seed plus 100, then plus 200, and so on. The accepted seed is in `tasks.jsonl`. + +## Reward + +- `1.0`: the answer is correct. Case does not matter. +- `0.0`: the answer is wrong, or the agent uses all 10 steps. + +## Splits + +All 24 tasks are in the `train` split. + +## Limits + +- The logs are synthetic. They do not come from a real system. +- A grep returns at most 10 matching lines. +- Each episode has 10 steps. + +## License + +Apache License 2.0. diff --git a/components/audit/upstream/dataset/tasks.jsonl b/components/audit/upstream/dataset/tasks.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..a81e015c95d95adcfdb90638c08a9b18beb62f69 --- /dev/null +++ b/components/audit/upstream/dataset/tasks.jsonl @@ -0,0 +1,24 @@ +{"task_id": "auth-00", "split": "train", "family": "auth", "level": 0, "seed": 2000} +{"task_id": "auth-01", "split": "train", "family": "auth", "level": 1, "seed": 2001} +{"task_id": "auth-02", "split": "train", "family": "auth", "level": 2, "seed": 2002} +{"task_id": "auth-03", "split": "train", "family": "auth", "level": 3, "seed": 2003} +{"task_id": "auth-04", "split": "train", "family": "auth", "level": 4, "seed": 2004} +{"task_id": "auth-05", "split": "train", "family": "auth", "level": 5, "seed": 2005} +{"task_id": "auth-06", "split": "train", "family": "auth", "level": 6, "seed": 2006} +{"task_id": "auth-07", "split": "train", "family": "auth", "level": 7, "seed": 2007} +{"task_id": "ledger-00", "split": "train", "family": "ledger", "level": 0, "seed": 2010} +{"task_id": "ledger-01", "split": "train", "family": "ledger", "level": 1, "seed": 2011} +{"task_id": "ledger-02", "split": "train", "family": "ledger", "level": 2, "seed": 2012} +{"task_id": "ledger-03", "split": "train", "family": "ledger", "level": 3, "seed": 2013} +{"task_id": "ledger-04", "split": "train", "family": "ledger", "level": 4, "seed": 2014} +{"task_id": "ledger-05", "split": "train", "family": "ledger", "level": 5, "seed": 2015} +{"task_id": "ledger-06", "split": "train", "family": "ledger", "level": 6, "seed": 2016} +{"task_id": "ledger-07", "split": "train", "family": "ledger", "level": 7, "seed": 2017} +{"task_id": "sensor-00", "split": "train", "family": "sensor", "level": 0, "seed": 2320} +{"task_id": "sensor-01", "split": "train", "family": "sensor", "level": 1, "seed": 2021} +{"task_id": "sensor-02", "split": "train", "family": "sensor", "level": 2, "seed": 2022} +{"task_id": "sensor-03", "split": "train", "family": "sensor", "level": 3, "seed": 2023} +{"task_id": "sensor-04", "split": "train", "family": "sensor", "level": 4, "seed": 2024} +{"task_id": "sensor-05", "split": "train", "family": "sensor", "level": 5, "seed": 2125} +{"task_id": "sensor-06", "split": "train", "family": "sensor", "level": 6, "seed": 2126} +{"task_id": "sensor-07", "split": "train", "family": "sensor", "level": 7, "seed": 2027} diff --git a/components/awm/ADAPTATIONS.txt b/components/awm/ADAPTATIONS.txt deleted file mode 100644 index b11245ed184c941d156d0639525073171e8c195f..0000000000000000000000000000000000000000 --- a/components/awm/ADAPTATIONS.txt +++ /dev/null @@ -1,4 +0,0 @@ -Interface: call and finish using the original FastApiMCP business tools. -Reset copies the original seed database; finish runs the original state checker. -The accounting adapter retains committed SQLAlchemy attributes for response serialization after session closure. -Each episode has a 600-second limit. FastApiMCP 0.4.0 and the OpenEnv SDK use separate Python environments. Dependency versions are recorded in the two requirements.lock files. diff --git a/components/awm/Dockerfile b/components/awm/Dockerfile deleted file mode 100644 index 9d59f0a7b5a8ec888befb1bd87343a97a6122777..0000000000000000000000000000000000000000 --- a/components/awm/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ghcr.io/bochencs/openenv-awm@sha256:ca13dd484ed50f5f72e1de652ab55ac25dd7550ee1558f553a3d6eae5a07cb95 -USER root -COPY config.json /opt/awm/config.json -COPY runtime/awm/adapter.py runtime/awm/worker.py /opt/awm/runtime/awm/ -RUN rm -rf /opt/awm/private/tasks/awm-manufacturing-1-schedule && chmod 600 /opt/awm/config.json diff --git a/components/awm/LICENSE_SCOPE.json b/components/awm/LICENSE_SCOPE.json deleted file mode 100644 index 1fda4aca153866bc9f4e15bcbde51796f619c4cd..0000000000000000000000000000000000000000 --- a/components/awm/LICENSE_SCOPE.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "component": "awm", - "upstream": { - "scope": "Original AWM request text, generated API source, schema/sample rows and pure-code verifiers", - "license": "CC-BY-4.0", - "notice": "NOTICE", - "source_credit": "SOURCE_CREDITS.json", - "materialized_seed": "Frozen database generated from the original schema/sample SQL; not an upstream binary file." - }, - "adapter": { - "scope": "Local transport/packaging adaptations in awm/runtime and configuration metadata", - "note": "Local adaptation; not attributed as upstream AWM source." - }, - "dependencies": { - "scope": "Installed third-party libraries and official OpenEnv SDK", - "note": "Keep respective installed package licenses; these are not relicensed under dataset licenses. Dependency names, versions and wheel hashes are in lock files.", - "lock_files": [ - "requirements.lock", - "awm-requirements.lock" - ] - } -} diff --git a/components/awm/NOTICE b/components/awm/NOTICE deleted file mode 100644 index 1f34913c9114c5a956b672deca2bf89606922121..0000000000000000000000000000000000000000 --- a/components/awm/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -This image adapts one unchanged original train task from AgentWorldModel-1K. -Authors: Zhaoyang Wang, Canwen Xu, Boyi Liu, Yite Wang, Siwei Han, Zhewei Yao, Huaxiu Yao, Yuxiong He. -Dataset: https://huggingface.co/datasets/Snowflake/AgentWorldModel-1K/tree/dde80a0283fe781bdc51656bce57063dc5650213 -License: Creative Commons Attribution 4.0 International (CC BY 4.0). -License terms: https://creativecommons.org/licenses/by/4.0/ -Changes: shared OpenEnv transport, fixed task selection, isolated per-episode database, original FastApiMCP 0.4.0 worker environment. Original task requests, API source, seed data and pure-code graders are unchanged. diff --git a/components/awm/SOURCE_CREDITS.json b/components/awm/SOURCE_CREDITS.json deleted file mode 100644 index 0cc1c0e22c40e8d24f704b37682c7a999835161f..0000000000000000000000000000000000000000 --- a/components/awm/SOURCE_CREDITS.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "url": "https://huggingface.co/datasets/Snowflake/AgentWorldModel-1K/tree/dde80a0283fe781bdc51656bce57063dc5650213", - "license": "CC-BY-4.0", - "authors": "Zhaoyang Wang, Canwen Xu, Boyi Liu, Yite Wang, Siwei Han, Zhewei Yao, Huaxiu Yao, Yuxiong He", - "paper": "https://arxiv.org/abs/2602.10090", - "code": "https://github.com/Snowflake-Labs/agent-world-model" -} diff --git a/components/awm/TASKS.json b/components/awm/TASKS.json deleted file mode 100644 index 68694b621de6c9cba0c5cb375e72bace321948fa..0000000000000000000000000000000000000000 --- a/components/awm/TASKS.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "task_id": "awm-accounting-1-invoice", - "source_repo": "Snowflake/AgentWorldModel-1K", - "source_revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "source_record": "gen_tasks.jsonl#scenario=accounting_1;tasks[1]", - "source_instruction_sha256": "a08b48d978d8a70cfea5c6e871d079622fc99ac8438fb38d6d6816bdfa399c99", - "original_limits": null, - "adapter_limits": { - "episode_seconds": 600, - "cpus": 1, - "memory_mb": 2048, - "max_context_length": 32768, - "max_completion_tokens": 32768 - }, - "interface": { - "schema_sha256": "10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4", - "ops": [ - "call", - "finish" - ], - "business_tools": "Unchanged original FastApiMCP 0.4.0 operation names and argument schemas", - "shell": false, - "reset": "Fixed task_id, fresh original seed copy, no random task substitution", - "reward": "0 or 1 from original pure-code state verifier at finish; terminal immutable" - }, - "tool_count": 27, - "original_files_sha256": { - "original_api.py": "57362b907a2d454bbd29b95dfebb7d84207ce9d7e22533eaf54853ee4fb84990", - "original_verifier.py": "3cd0d63022caa900e32bda0b0d3ae5c9948ce3c195b77ba1906c7ddebea9c58b", - "initial.db": "8ad2959536e44caba47bcbeca9018e47e7157783194d19b429aa8f22a60f4771", - "SOURCE.json": "3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58" - }, - "license": "CC-BY-4.0" - } -] diff --git a/components/awm/awm-requirements.lock b/components/awm/awm-requirements.lock deleted file mode 100644 index 5468ff83c6db5b83f04c1272dfdd8045e5940e30..0000000000000000000000000000000000000000 --- a/components/awm/awm-requirements.lock +++ /dev/null @@ -1,44 +0,0 @@ -annotated-doc==0.0.5 --hash=sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101 -annotated-types==0.8.0 --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 -anyio==4.15.1 --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101 -attrs==26.1.0 --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 -certifi==2026.7.22 --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775 -cffi==2.1.1 --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf -charset-normalizer==3.5.2 --hash=sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649 -click==8.5.0 --hash=sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360 -cryptography==50.0.2 --hash=sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2 -fastapi==0.115.12 --hash=sha256:e94613d6c05e27be7ffebdd6ea5f388112e5e430c8f7d6494a9d1d88d43e814d -fastapi-mcp==0.4.0 --hash=sha256:d4a3fe7966af24d44e4b412720561c95eb12bed999a4443a88221834b3b15aec -greenlet==3.2.5 --hash=sha256:45fcea7b697b91290b36eafc12fff479aca6ba6500d98ef6f34d5634c7119cbe -h11==0.16.0 --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 -httpcore==1.0.9 --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55 -httpx==0.28.1 --hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad -httpx-sse==0.4.3 --hash=sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc -idna==3.20 --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c -jsonschema==4.26.0 --hash=sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce -jsonschema-specifications==2025.9.1 --hash=sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe -markdown-it-py==4.2.0 --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a -mcp==1.26.0 --hash=sha256:904a21c33c25aa98ddbeb47273033c435e595bbacfdb177f4bd87f6dceebe1ca -mdurl==0.1.2 --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 -pycparser==3.11 --hash=sha256:51d5a8ba2be0bbe440b99d2112604c95bbbc3c2748a64260186c541e1729cd80 -pydantic==2.12.5 --hash=sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d -pydantic_core==2.41.5 --hash=sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c -pydantic-settings==2.15.0 --hash=sha256:0ba092c291c94baceb5eff768aa0d56400a457585bc0175925a5a5510303da42 -Pygments==2.21.0 --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 -PyJWT==2.15.1 --hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193 -python-dotenv==1.2.4 --hash=sha256:42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc -python-multipart==0.0.32 --hash=sha256:ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23 -referencing==0.37.0 --hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231 -requests==2.34.2 --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 -rich==15.0.0 --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb -rpds-py==2026.9.1 --hash=sha256:addeda51556dac7c1a2f14cda62db8b621cd12afba3091d03a96c72932387eab -shellingham==1.5.4 --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 -SQLAlchemy==2.0.41 --hash=sha256:6145afea51ff0af7f2564a05fa95eb46f542919e6523729663a5d285ecb3cf5e -sse-starlette==3.0.3 --hash=sha256:af5bf5a6f3933df1d9c7f8539633dc8444ca6a97ab2e2a7cd3b6e431ac03a431 -starlette==0.46.2 --hash=sha256:595633ce89f8ffa71a015caed34a5b2dc1c0cdb3f0f1fbd1e69339cf2abeec35 -tomli==2.5.0 --hash=sha256:6cf74416bdc94ae458b14e37286c1073081850ac8459a00d0c5efef5d44294c6 -typer==0.27.3 --hash=sha256:e50022f28b82a86313e54501317a1db64bf8f8d036ff8cfe5ca7e47675454aff -typing_extensions==4.16.0 --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 -typing-inspection==0.4.4 --hash=sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147 -urllib3==2.8.0 --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 -uvicorn==0.54.0 --hash=sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf diff --git a/components/awm/config.json b/components/awm/config.json deleted file mode 100644 index 1a14378320f1cd1499571523e96f968b1d4a6400..0000000000000000000000000000000000000000 --- a/components/awm/config.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "tasks": [ - { - "task_id": "awm-accounting-1-invoice", - "split": "train", - "original_sha256": { - "original_api.py": "57362b907a2d454bbd29b95dfebb7d84207ce9d7e22533eaf54853ee4fb84990", - "original_verifier.py": "3cd0d63022caa900e32bda0b0d3ae5c9948ce3c195b77ba1906c7ddebea9c58b", - "initial.db": "8ad2959536e44caba47bcbeca9018e47e7157783194d19b429aa8f22a60f4771", - "SOURCE.json": "3a1cc59eece46232d3ebb39df3cbfedd0625ab85bcf5e1d6cb090ea6ecec0e58" - }, - "timeout_seconds": 600 - } - ] -} diff --git a/components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json b/components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json deleted file mode 100644 index 427479f654af805d8b07096d2e36a59e5ca3a5b6..0000000000000000000000000000000000000000 --- a/components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "repo": "Snowflake/AgentWorldModel-1K", - "revision": "dde80a0283fe781bdc51656bce57063dc5650213", - "scenario": "accounting_1", - "task_idx": 1, - "task": "Create an invoice for customer 'Acme Design Studio' dated 2025-01-05 with due_date 2025-02-04 containing two line_items ('Logo redesign' quantity 1 unit_price 1200 with no discount and 'Brand guideline document' quantity 1 unit_price 800 with a 10% discount), assign it to department 'Design', and mark its tax_category as 'Standard Sales Tax 8.5%'.", - "task_id": "awm-accounting-1-invoice", - "license": "CC-BY-4.0", - "split": "train", - "original_format": "FastAPI through FastApiMCP 0.4.0" -} diff --git a/components/awm/private/tasks/awm-accounting-1-invoice/initial.db b/components/awm/private/tasks/awm-accounting-1-invoice/initial.db deleted file mode 100644 index a72da2cfbb5d89f256ea864e1671fb383ec02d51..0000000000000000000000000000000000000000 --- a/components/awm/private/tasks/awm-accounting-1-invoice/initial.db +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8ad2959536e44caba47bcbeca9018e47e7157783194d19b429aa8f22a60f4771 -size 331776 diff --git a/components/awm/private/tasks/awm-accounting-1-invoice/original_api.py b/components/awm/private/tasks/awm-accounting-1-invoice/original_api.py deleted file mode 100644 index 19187d21c055fd8aebb6156490266776a14a7faa..0000000000000000000000000000000000000000 --- a/components/awm/private/tasks/awm-accounting-1-invoice/original_api.py +++ /dev/null @@ -1,1767 +0,0 @@ -from fastapi import FastAPI, Query, Path, Body -from pydantic import BaseModel, Field, ConfigDict -from typing import Optional, List, Dict -from datetime import datetime, date -import os -from sqlalchemy import ( - create_engine, - Column, - Integer, - String, - DateTime, - Date, - Float, - Text, - ForeignKey, - CheckConstraint, - Index, -) -from sqlalchemy.orm import declarative_base, relationship, sessionmaker - -database_url = os.getenv("DATABASE_PATH", "sqlite:///outputs/databases/zenledger_small_business_accounting_suite.db") -engine = create_engine(database_url, future=True) -SessionLocal = sessionmaker(bind=engine, autoflush=False, autocommit=False, future=True) -Base = declarative_base() - -class User(Base): - __tablename__ = "users" - id = Column(Integer, primary_key=True) - username = Column(Text, unique=True, nullable=False) - email = Column(Text, unique=True, nullable=False) - full_name = Column(Text) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class Department(Base): - __tablename__ = "departments" - id = Column(Integer, primary_key=True) - name = Column(Text, unique=True, nullable=False) - description = Column(Text) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class TaxCategory(Base): - __tablename__ = "tax_categories" - id = Column(Integer, primary_key=True) - name = Column(Text, unique=True, nullable=False) - description = Column(Text) - rate = Column(Float, nullable=False) - is_compound = Column(Integer, nullable=False, default=0) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class PaymentTerm(Base): - __tablename__ = "payment_terms" - id = Column(Integer, primary_key=True) - name = Column(Text, unique=True, nullable=False) - days = Column(Integer, nullable=False) - description = Column(Text) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class Customer(Base): - __tablename__ = "customers" - id = Column(Integer, primary_key=True) - name = Column(Text, unique=True, nullable=False) - billing_email = Column(Text) - payment_terms_id = Column(Integer, ForeignKey("payment_terms.id")) - default_tax_category_id = Column(Integer, ForeignKey("tax_categories.id")) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class Account(Base): - __tablename__ = "accounts" - id = Column(Integer, primary_key=True) - name = Column(Text, unique=True, nullable=False) - code = Column(Text) - type = Column(Text, nullable=False) - sub_type = Column(Text) - is_active = Column(Integer, nullable=False, default=1) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class Vendor(Base): - __tablename__ = "vendors" - id = Column(Integer, primary_key=True) - name = Column(Text, unique=True, nullable=False) - contact_email = Column(Text) - payment_terms_id = Column(Integer, ForeignKey("payment_terms.id")) - default_expense_category_id = Column(Integer, ForeignKey("accounts.id")) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class BankAccount(Base): - __tablename__ = "bank_accounts" - id = Column(Integer, primary_key=True) - name = Column(Text, unique=True, nullable=False) - institution_name = Column(Text) - account_number_masked = Column(Text) - account_id = Column(Integer, ForeignKey("accounts.id"), nullable=False) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class Invoice(Base): - __tablename__ = "invoices" - id = Column(Integer, primary_key=True) - invoice_number = Column(Text, unique=True, nullable=False) - customer_id = Column(Integer, ForeignKey("customers.id"), nullable=False) - department_id = Column(Integer, ForeignKey("departments.id")) - tax_category_id = Column(Integer, ForeignKey("tax_categories.id")) - invoice_date = Column(Date, nullable=False) - due_date = Column(Date, nullable=False) - currency = Column(Text, nullable=False, default="USD") - status = Column(Text, nullable=False) - subtotal = Column(Float, nullable=False, default=0.0) - tax_amount = Column(Float, nullable=False, default=0.0) - total = Column(Float, nullable=False, default=0.0) - balance_due = Column(Float, nullable=False, default=0.0) - payment_terms_id = Column(Integer, ForeignKey("payment_terms.id")) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class InvoiceLineItem(Base): - __tablename__ = "invoice_line_items" - id = Column(Integer, primary_key=True) - invoice_id = Column(Integer, ForeignKey("invoices.id", ondelete="CASCADE"), nullable=False) - description = Column(Text, nullable=False) - quantity = Column(Float, nullable=False) - unit_price = Column(Float, nullable=False) - discount_percent = Column(Float, nullable=False, default=0.0) - line_subtotal = Column(Float, nullable=False, default=0.0) - tax_amount = Column(Float, nullable=False, default=0.0) - total = Column(Float, nullable=False, default=0.0) - revenue_account_id = Column(Integer, ForeignKey("accounts.id")) - department_id = Column(Integer, ForeignKey("departments.id")) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class Payment(Base): - __tablename__ = "payments" - id = Column(Integer, primary_key=True) - customer_id = Column(Integer, ForeignKey("customers.id"), nullable=False) - payment_date = Column(Date, nullable=False) - settlement_date = Column(Date) - amount = Column(Float, nullable=False) - currency = Column(Text, nullable=False, default="USD") - method = Column(Text, nullable=False) - reference = Column(Text) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class PaymentApplication(Base): - __tablename__ = "payment_applications" - id = Column(Integer, primary_key=True) - payment_id = Column(Integer, ForeignKey("payments.id", ondelete="CASCADE"), nullable=False) - invoice_id = Column(Integer, ForeignKey("invoices.id", ondelete="CASCADE"), nullable=False) - amount = Column(Float, nullable=False) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class Bill(Base): - __tablename__ = "bills" - id = Column(Integer, primary_key=True) - bill_number = Column(Text) - vendor_id = Column(Integer, ForeignKey("vendors.id"), nullable=False) - bill_date = Column(Date, nullable=False) - due_date = Column(Date) - currency = Column(Text, nullable=False, default="USD") - amount = Column(Float, nullable=False) - description = Column(Text) - department_id = Column(Integer, ForeignKey("departments.id")) - reimbursement_status = Column(Text, nullable=False) - payment_terms_id = Column(Integer, ForeignKey("payment_terms.id")) - status = Column(Text, nullable=False, default="open") - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class RecurringExpense(Base): - __tablename__ = "recurring_expenses" - id = Column(Integer, primary_key=True) - name = Column(Text, nullable=False) - vendor_id = Column(Integer, ForeignKey("vendors.id")) - amount = Column(Float, nullable=False) - expense_account_id = Column(Integer, ForeignKey("accounts.id"), nullable=False) - department_id = Column(Integer, ForeignKey("departments.id")) - frequency = Column(Text, nullable=False) - next_run_date = Column(Date, nullable=False) - end_date = Column(Date) - is_active = Column(Integer, nullable=False, default=1) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class BankTransaction(Base): - __tablename__ = "bank_transactions" - id = Column(Integer, primary_key=True) - bank_account_id = Column(Integer, ForeignKey("bank_accounts.id"), nullable=False) - transaction_date = Column(Date, nullable=False) - posted_date = Column(Date) - description = Column(Text, nullable=False) - amount = Column(Float, nullable=False) - external_id = Column(Text) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class JournalEntry(Base): - __tablename__ = "journal_entries" - id = Column(Integer, primary_key=True) - entry_date = Column(Date, nullable=False) - description = Column(Text) - department_id = Column(Integer, ForeignKey("departments.id")) - source = Column(Text) - source_id = Column(Integer) - created_by_user_id = Column(Integer, ForeignKey("users.id")) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class JournalEntryLine(Base): - __tablename__ = "journal_entry_lines" - id = Column(Integer, primary_key=True) - journal_entry_id = Column(Integer, ForeignKey("journal_entries.id", ondelete="CASCADE"), nullable=False) - account_id = Column(Integer, ForeignKey("accounts.id"), nullable=False) - department_id = Column(Integer, ForeignKey("departments.id")) - description = Column(Text) - debit = Column(Float, nullable=False, default=0.0) - credit = Column(Float, nullable=False, default=0.0) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class BankTransactionJournalLink(Base): - __tablename__ = "bank_transaction_journal_links" - id = Column(Integer, primary_key=True) - bank_transaction_id = Column(Integer, ForeignKey("bank_transactions.id", ondelete="CASCADE"), nullable=False) - journal_entry_id = Column(Integer, ForeignKey("journal_entries.id", ondelete="CASCADE"), nullable=False) - created_at = Column(DateTime, default=datetime.utcnow) - -class RecurringInvoice(Base): - __tablename__ = "recurring_invoices" - id = Column(Integer, primary_key=True) - customer_id = Column(Integer, ForeignKey("customers.id"), nullable=False) - name = Column(Text, nullable=False) - description = Column(Text) - quantity = Column(Float, nullable=False) - unit_price = Column(Float, nullable=False) - discount_percent = Column(Float, nullable=False, default=0.0) - frequency = Column(Text, nullable=False) - next_run_date = Column(Date, nullable=False) - end_date = Column(Date) - payment_terms_id = Column(Integer, ForeignKey("payment_terms.id")) - tax_category_id = Column(Integer, ForeignKey("tax_categories.id")) - department_id = Column(Integer, ForeignKey("departments.id")) - currency = Column(Text, nullable=False, default="USD") - is_active = Column(Integer, nullable=False, default=1) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -class AccountingPeriod(Base): - __tablename__ = "accounting_periods" - id = Column(Integer, primary_key=True) - start_date = Column(Date, nullable=False) - end_date = Column(Date, nullable=False) - close_date = Column(Date) - is_locked = Column(Integer, nullable=False, default=0) - created_at = Column(DateTime, default=datetime.utcnow) - updated_at = Column(DateTime) - -Index("idx_users_email", User.email) -Index("idx_departments_name", Department.name, unique=True) -Index("idx_tax_categories_name", TaxCategory.name, unique=True) -Index("idx_payment_terms_name", PaymentTerm.name, unique=True) -Index("idx_customers_name", Customer.name, unique=True) -Index("idx_customers_payment_terms_id", Customer.payment_terms_id) -Index("idx_customers_tax_category_id", Customer.default_tax_category_id) -Index("idx_vendors_name", Vendor.name, unique=True) -Index("idx_vendors_payment_terms_id", Vendor.payment_terms_id) -Index("idx_vendors_expense_category_id", Vendor.default_expense_category_id) -Index("idx_accounts_name", Account.name, unique=True) -Index("idx_accounts_type", Account.type) -Index("idx_bank_accounts_name", BankAccount.name, unique=True) -Index("idx_bank_accounts_account_id", BankAccount.account_id) -Index("idx_invoices_invoice_number", Invoice.invoice_number, unique=True) -Index("idx_invoices_customer_id", Invoice.customer_id) -Index("idx_invoices_department_id", Invoice.department_id) -Index("idx_invoices_tax_category_id", Invoice.tax_category_id) -Index("idx_invoices_invoice_date", Invoice.invoice_date) -Index("idx_invoice_line_items_invoice_id", InvoiceLineItem.invoice_id) -Index("idx_invoice_line_items_department_id", InvoiceLineItem.department_id) -Index("idx_payments_customer_id", Payment.customer_id) -Index("idx_payments_payment_date", Payment.payment_date) -Index("idx_payment_applications_payment_id", PaymentApplication.payment_id) -Index("idx_payment_applications_invoice_id", PaymentApplication.invoice_id) -Index("idx_bills_vendor_id", Bill.vendor_id) -Index("idx_bills_department_id", Bill.department_id) -Index("idx_bills_bill_date", Bill.bill_date) -Index("idx_recurring_expenses_vendor_id", RecurringExpense.vendor_id) -Index("idx_recurring_expenses_next_run_date", RecurringExpense.next_run_date) -Index("idx_recurring_expenses_department_id", RecurringExpense.department_id) -Index("idx_bank_transactions_account_id", BankTransaction.bank_account_id) -Index("idx_bank_transactions_date", BankTransaction.transaction_date) -Index("idx_journal_entries_entry_date", JournalEntry.entry_date) -Index("idx_journal_entries_department_id", JournalEntry.department_id) -Index("idx_journal_entry_lines_entry_id", JournalEntryLine.journal_entry_id) -Index("idx_journal_entry_lines_account_id", JournalEntryLine.account_id) -Index("idx_journal_entry_lines_department_id", JournalEntryLine.department_id) -Index("idx_bt_journal_links_bt_id", BankTransactionJournalLink.bank_transaction_id) -Index("idx_bt_journal_links_je_id", BankTransactionJournalLink.journal_entry_id) -Index("idx_recurring_invoices_customer_id", RecurringInvoice.customer_id) -Index("idx_recurring_invoices_next_run_date", RecurringInvoice.next_run_date) -Index("idx_recurring_invoices_department_id", RecurringInvoice.department_id) -Index("idx_accounting_periods_start_end", AccountingPeriod.start_date, AccountingPeriod.end_date) -Index("idx_accounting_periods_is_locked", AccountingPeriod.is_locked) - -Base.metadata.create_all(engine) - -app = FastAPI(title="ZenLedger Small Business Accounting Suite API", version="1.0.0") - -class CustomerCreateRequest(BaseModel): - name: str = Field(..., description="Customer legal or display name (must be unique)", example="Acme Design Studio") - billing_email: Optional[str] = Field(None, description="Primary billing email address for invoices", example="billing@acmedesign.com") - payment_terms_id: Optional[int] = Field(None, description="ID of payment_terms row to use as default terms", example=2) - default_tax_category_id: Optional[int] = Field(None, description="ID of tax_categories row used as default customer tax", example=1) - -class CustomerResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Unique customer identifier", example=10) - name: str = Field(..., description="Customer name", example="Acme Design Studio") - billing_email: Optional[str] = Field(None, description="Customer billing email", example="billing@acmedesign.com") - payment_terms_id: Optional[int] = Field(None, description="Linked payment_terms.id or null", example=3) - default_tax_category_id: Optional[int] = Field(None, description="Linked tax_categories.id or null", example=1) - created_at: Optional[datetime] = Field(None, description="Timestamp when customer was created (ISO 8601)", example="2025-01-04T10:15:23Z") - updated_at: Optional[datetime] = Field(None, description="Timestamp for last update or null", example=None) - -class CustomersListResponse(BaseModel): - customers: List[CustomerResponse] = Field(..., description="List of customers", example=[]) - -class PaymentTermResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Payment terms ID", example=3) - name: str = Field(..., description="Name of payment terms", example="Net 30") - days: int = Field(..., description="Number of days from invoice date to due date", example=30) - description: Optional[str] = Field(None, description="Optional description", example="Payment due 30 days from invoice date") - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2024-01-01T00:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example=None) - -class PaymentTermsListResponse(BaseModel): - payment_terms: List[PaymentTermResponse] = Field(..., description="List of payment terms", example=[]) - -class TaxCategoryResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Tax category ID", example=1) - name: str = Field(..., description="Tax category name", example="Standard Sales Tax 8.5%") - description: Optional[str] = Field(None, description="Optional description of when this tax applies", example="Standard local sales tax") - rate: float = Field(..., description="Tax rate as decimal (e.g., 0.085 for 8.5%)", example=0.085) - is_compound: bool = Field(..., description="True if tax is compounded with other taxes", example=False) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2024-01-01T00:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example=None) - -class TaxCategoriesListResponse(BaseModel): - tax_categories: List[TaxCategoryResponse] = Field(..., description="List of tax categories", example=[]) - -class DepartmentResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Department ID", example=2) - name: str = Field(..., description="Department name", example="Design") - description: Optional[str] = Field(None, description="Optional department description", example="Design and creative services") - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2024-01-01T00:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example=None) - -class DepartmentsListResponse(BaseModel): - departments: List[DepartmentResponse] = Field(..., description="List of departments", example=[]) - -class AccountResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Account ID", example=50) - name: str = Field(..., description="Account name", example="Software Subscriptions") - code: Optional[str] = Field(None, description="Optional account code", example="6100") - type: str = Field(..., description="High-level account type", example="expense") - sub_type: Optional[str] = Field(None, description="Optional subtype classification", example="Operating Expense") - is_active: bool = Field(..., description="Whether account can be posted to", example=True) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2024-01-01T00:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example=None) - -class AccountsListResponse(BaseModel): - accounts: List[AccountResponse] = Field(..., description="List of accounts", example=[]) - -class BankAccountResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Bank account ID", example=1) - name: str = Field(..., description="Display name for the bank account", example="Chase Business Checking ****1023") - institution_name: Optional[str] = Field(None, description="Financial institution name", example="Chase") - account_number_masked: Optional[str] = Field(None, description="Masked bank account number", example="****1023") - account_id: int = Field(..., description="Linked GL account ID", example=101) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2024-01-01T00:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example=None) - -class BankAccountsListResponse(BaseModel): - bank_accounts: List[BankAccountResponse] = Field(..., description="List of bank accounts", example=[]) - -class InvoiceCreateRequest(BaseModel): - invoice_number: str = Field(..., description="Unique invoice number", example="INV-2025-001") - customer_id: int = Field(..., description="Customer ID that this invoice belongs to", example=10) - invoice_date: str = Field(..., description="Invoice date in ISO format YYYY-MM-DD", example="2025-01-05") - due_date: str = Field(..., description="Due date in ISO format YYYY-MM-DD", example="2025-02-04") - department_id: Optional[int] = Field(None, description="Department responsible for this invoice", example=2) - tax_category_id: Optional[int] = Field(None, description="Tax category applied at invoice level", example=1) - payment_terms_id: Optional[int] = Field(None, description="Payment terms to apply; defaults to customer terms if omitted", example=3) - currency: Optional[str] = Field("USD", description="Currency code, defaults to USD", example="USD") - status: Optional[str] = Field("draft", description="Initial status (draft or open)", example="open") - -class InvoiceResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Invoice ID", example=1001) - invoice_number: str = Field(..., description="Unique invoice number", example="INV-2025-001") - customer_id: int = Field(..., description="Linked customer ID", example=10) - department_id: Optional[int] = Field(None, description="Linked department ID", example=2) - tax_category_id: Optional[int] = Field(None, description="Linked tax category ID", example=1) - invoice_date: date = Field(..., description="Invoice date", example="2025-01-05") - due_date: date = Field(..., description="Due date", example="2025-02-04") - currency: str = Field(..., description="Currency code", example="USD") - status: str = Field(..., description="Invoice status", example="open") - subtotal: float = Field(..., description="Sum of line_subtotals before tax", example=2000.0) - tax_amount: float = Field(..., description="Total tax applied to invoice", example=170.0) - total: float = Field(..., description="Invoice total including tax", example=2170.0) - balance_due: float = Field(..., description="Remaining balance due on invoice", example=2170.0) - payment_terms_id: Optional[int] = Field(None, description="Linked payment_terms ID", example=3) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-05T09:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class InvoiceLineItemCreateRequest(BaseModel): - invoice_id: int = Field(..., description="ID of the invoice this line belongs to", example=1001) - description: str = Field(..., description="Description of the product or service", example="Logo redesign") - quantity: float = Field(..., description="Quantity of units sold", example=1.0) - unit_price: float = Field(..., description="Price per unit", example=1200.0) - discount_percent: Optional[float] = Field(0.0, description="Discount percentage applied to this line", example=10.0) - revenue_account_id: Optional[int] = Field(None, description="Revenue account to credit for this line", example=400) - department_id: Optional[int] = Field(None, description="Department for this line; overrides invoice department", example=2) - -class InvoiceLineItemResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Invoice line item ID", example=5001) - invoice_id: int = Field(..., description="Parent invoice ID", example=1001) - description: str = Field(..., description="Line item description", example="Logo redesign") - quantity: float = Field(..., description="Quantity", example=1.0) - unit_price: float = Field(..., description="Unit price", example=1200.0) - discount_percent: float = Field(..., description="Discount percent", example=0.0) - line_subtotal: float = Field(..., description="Subtotal before tax for this line", example=1200.0) - tax_amount: float = Field(..., description="Tax for this line", example=102.0) - total: float = Field(..., description="Total including tax for this line", example=1302.0) - revenue_account_id: Optional[int] = Field(None, description="Linked revenue account ID", example=400) - department_id: Optional[int] = Field(None, description="Linked department ID", example=2) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-05T09:10:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class InvoiceRecalculateTotalsResponse(BaseModel): - invoice_id: int = Field(..., description="Invoice ID", example=1001) - subtotal: float = Field(..., description="Updated subtotal", example=2000.0) - tax_amount: float = Field(..., description="Updated tax amount", example=170.0) - total: float = Field(..., description="Updated total", example=2170.0) - balance_due: float = Field(..., description="Updated balance due after payments", example=1270.0) - -class InvoicesListItemResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Invoice ID", example=1001) - invoice_number: str = Field(..., description="Invoice number", example="INV-2025-001") - customer_id: int = Field(..., description="Customer ID", example=10) - invoice_date: date = Field(..., description="Invoice date", example="2025-01-05") - due_date: date = Field(..., description="Due date", example="2025-02-04") - status: str = Field(..., description="Invoice status", example="open") - subtotal: float = Field(..., description="Subtotal amount", example=2000.0) - tax_amount: float = Field(..., description="Tax amount", example=170.0) - total: float = Field(..., description="Total invoice amount", example=2170.0) - balance_due: float = Field(..., description="Outstanding balance", example=1270.0) - department_id: Optional[int] = Field(None, description="Linked department ID", example=2) - tax_category_id: Optional[int] = Field(None, description="Linked tax category ID", example=1) - payment_terms_id: Optional[int] = Field(None, description="Linked payment terms ID", example=3) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-05T09:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Last update timestamp", example="2025-01-10T10:00:00Z") - -class InvoicesListResponse(BaseModel): - invoices: List[InvoicesListItemResponse] = Field(..., description="List of invoices", example=[]) - -class PaymentCreateRequest(BaseModel): - customer_id: int = Field(..., description="Customer who made the payment", example=10) - payment_date: str = Field(..., description="Date payment was received (YYYY-MM-DD)", example="2025-01-10") - settlement_date: Optional[str] = Field(None, description="Date payment settled in bank (YYYY-MM-DD)", example="2025-01-10") - amount: float = Field(..., description="Gross payment amount", example=900.0) - currency: Optional[str] = Field("USD", description="Currency code (defaults to USD)", example="USD") - method: str = Field(..., description="Payment method description", example="Credit Card") - reference: Optional[str] = Field(None, description="External reference or transaction ID", example="STRIPE-12345") - -class PaymentResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Payment ID", example=2001) - customer_id: int = Field(..., description="Customer ID", example=10) - payment_date: date = Field(..., description="Payment date", example="2025-01-10") - settlement_date: Optional[date] = Field(None, description="Settlement date", example="2025-01-10") - amount: float = Field(..., description="Payment amount", example=900.0) - currency: str = Field(..., description="Payment currency", example="USD") - method: str = Field(..., description="Payment method", example="Credit Card") - reference: Optional[str] = Field(None, description="External reference ID", example="STRIPE-12345") - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-10T12:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class PaymentApplicationCreateRequest(BaseModel): - payment_id: int = Field(..., description="Payment to allocate", example=2001) - invoice_id: int = Field(..., description="Invoice receiving this payment portion", example=1001) - amount: float = Field(..., description="Amount applied from payment to invoice", example=900.0) - -class PaymentApplicationResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Payment application ID", example=3001) - payment_id: int = Field(..., description="Linked payment ID", example=2001) - invoice_id: int = Field(..., description="Linked invoice ID", example=1001) - amount: float = Field(..., description="Amount applied", example=900.0) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-10T12:05:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class VendorCreateRequest(BaseModel): - name: str = Field(..., description="Vendor legal or display name", example="PixelPrint Supplies") - contact_email: Optional[str] = Field(None, description="Vendor accounts payable contact email", example="accounts@pixelprint.com") - payment_terms_id: Optional[int] = Field(None, description="Default payment terms for this vendor", example=2) - default_expense_category_id: Optional[int] = Field(None, description="Default expense account for purchases from this vendor", example=60) - -class VendorResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Vendor ID", example=20) - name: str = Field(..., description="Vendor name", example="PixelPrint Supplies") - contact_email: Optional[str] = Field(None, description="Vendor email", example="accounts@pixelprint.com") - payment_terms_id: Optional[int] = Field(None, description="Linked payment_terms ID", example=2) - default_expense_category_id: Optional[int] = Field(None, description="Linked default expense account ID", example=60) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-03T08:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class VendorsListResponse(BaseModel): - vendors: List[VendorResponse] = Field(..., description="List of vendors", example=[]) - -class BillCreateRequest(BaseModel): - bill_number: Optional[str] = Field(None, description="Vendor-provided bill or invoice number", example="BILL-2025-001") - vendor_id: int = Field(..., description="Vendor this bill is from", example=20) - bill_date: str = Field(..., description="Date on the vendor bill (YYYY-MM-DD)", example="2025-01-03") - due_date: Optional[str] = Field(None, description="Due date if known (YYYY-MM-DD)", example="2025-01-18") - currency: Optional[str] = Field("USD", description="Bill currency code", example="USD") - amount: float = Field(..., description="Total bill amount", example=325.5) - description: Optional[str] = Field(None, description="Description of the bill or purpose", example="Printer ink and paper") - department_id: Optional[int] = Field(None, description="Department to expense this bill to", example=3) - reimbursement_status: str = Field(..., description="Reimbursement status (Not Reimbursable, Reimbursable, Reimbursed)", example="Not Reimbursable") - payment_terms_id: Optional[int] = Field(None, description="Payment terms used for due_date calculation", example=1) - status: Optional[str] = Field("open", description="Bill status (open, paid, void)", example="open") - -class BillResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Bill ID", example=7001) - bill_number: Optional[str] = Field(None, description="Vendor bill number", example="BILL-2025-001") - vendor_id: int = Field(..., description="Vendor ID", example=20) - bill_date: date = Field(..., description="Bill date", example="2025-01-03") - due_date: Optional[date] = Field(None, description="Due date", example="2025-01-18") - currency: str = Field(..., description="Currency code", example="USD") - amount: float = Field(..., description="Bill amount", example=325.5) - description: Optional[str] = Field(None, description="Bill description", example="Printer ink and paper") - department_id: Optional[int] = Field(None, description="Department ID", example=3) - reimbursement_status: str = Field(..., description="Reimbursement status", example="Not Reimbursable") - payment_terms_id: Optional[int] = Field(None, description="Payment terms ID", example=1) - status: str = Field(..., description="Bill status", example="open") - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-03T09:30:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class RecurringExpenseCreateRequest(BaseModel): - name: str = Field(..., description="Name of the recurring expense", example="Monthly Co-working Space Rent") - vendor_id: Optional[int] = Field(None, description="Vendor providing the recurring service", example=30) - amount: float = Field(..., description="Recurring amount for each run", example=650.0) - expense_account_id: int = Field(..., description="Expense account ID to debit", example=80) - department_id: Optional[int] = Field(None, description="Department that bears this recurring expense", example=4) - frequency: str = Field(..., description="Run frequency (daily, weekly, monthly, quarterly, yearly)", example="monthly") - next_run_date: str = Field(..., description="Next date the template should generate an expense (YYYY-MM-DD)", example="2025-02-01") - end_date: Optional[str] = Field(None, description="Date after which no more runs occur", example="2025-12-01") - is_active: Optional[bool] = Field(True, description="Whether this template is active", example=True) - -class RecurringExpenseResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Recurring expense template ID", example=9001) - name: str = Field(..., description="Template name", example="Monthly Co-working Space Rent") - vendor_id: Optional[int] = Field(None, description="Vendor ID", example=30) - amount: float = Field(..., description="Recurring amount", example=650.0) - expense_account_id: int = Field(..., description="Expense account ID", example=80) - department_id: Optional[int] = Field(None, description="Department ID", example=4) - frequency: str = Field(..., description="Frequency", example="monthly") - next_run_date: date = Field(..., description="Next run date", example="2025-02-01") - end_date: Optional[date] = Field(None, description="End date", example="2025-12-01") - is_active: bool = Field(..., description="Whether template is active", example=True) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-15T09:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class BankTransactionItemRequest(BaseModel): - transaction_date: str = Field(..., description="Transaction date (YYYY-MM-DD)", example="2025-01-01") - posted_date: Optional[str] = Field(None, description="Posted date (YYYY-MM-DD)", example="2025-01-02") - description: str = Field(..., description="Bank description", example="Client payment ACME") - amount: float = Field(..., description="Transaction amount (positive or negative)", example=1500.0) - external_id: Optional[str] = Field(None, description="External bank transaction identifier", example="txn_001") - -class BankTransactionsBatchImportRequest(BaseModel): - bank_account_id: int = Field(..., description="Bank account ID these transactions belong to", example=1) - transactions: List[BankTransactionItemRequest] = Field(..., description="Array of bank transactions to import", example=[]) - -class BankTransactionResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Bank transaction ID", example=6001) - bank_account_id: int = Field(..., description="Bank account ID", example=1) - transaction_date: date = Field(..., description="Transaction date", example="2025-01-01") - posted_date: Optional[date] = Field(None, description="Posted date", example="2025-01-02") - description: str = Field(..., description="Transaction description", example="Client payment ACME") - amount: float = Field(..., description="Transaction amount", example=1500.0) - external_id: Optional[str] = Field(None, description="External transaction ID", example="txn_001") - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-07T10:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class BankTransactionsBatchImportResponse(BaseModel): - bank_transactions: List[BankTransactionResponse] = Field(..., description="Imported bank transactions", example=[]) - -class BankTransactionsListResponse(BaseModel): - bank_transactions: List[BankTransactionResponse] = Field(..., description="List of bank transactions", example=[]) - -class JournalEntryCreateRequest(BaseModel): - entry_date: str = Field(..., description="Date of the journal entry (YYYY-MM-DD)", example="2024-12-31") - description: Optional[str] = Field(None, description="Narrative description of the entry", example="Year-end accrual for expenses") - department_id: Optional[int] = Field(None, description="Department that this entry belongs to", example=4) - source: Optional[str] = Field(None, description="System source of this entry", example="manual") - source_id: Optional[int] = Field(None, description="External source ID if applicable", example=None) - -class JournalEntryResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Journal entry ID", example=8001) - entry_date: date = Field(..., description="Entry date", example="2024-12-31") - description: Optional[str] = Field(None, description="Entry description", example="Year-end accrual for expenses") - department_id: Optional[int] = Field(None, description="Department ID", example=4) - source: Optional[str] = Field(None, description="Source system", example="manual") - source_id: Optional[int] = Field(None, description="Source record ID", example=None) - created_by_user_id: Optional[int] = Field(None, description="User who created the entry (always 1)", example=1) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2024-12-31T23:50:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class JournalEntryLineCreateRequest(BaseModel): - journal_entry_id: int = Field(..., description="Parent journal entry ID", example=8001) - account_id: int = Field(..., description="Account to debit or credit", example=50) - department_id: Optional[int] = Field(None, description="Department for this line if different from header", example=4) - description: Optional[str] = Field(None, description="Line-specific description", example="Accrual for December software expenses") - debit: Optional[float] = Field(0.0, description="Debit amount (0 if this is a credit line)", example=300.0) - credit: Optional[float] = Field(0.0, description="Credit amount (0 if this is a debit line)", example=0.0) - -class JournalEntryLineResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Journal entry line ID", example=8101) - journal_entry_id: int = Field(..., description="Parent journal entry ID", example=8001) - account_id: int = Field(..., description="Account ID", example=50) - department_id: Optional[int] = Field(None, description="Department ID", example=4) - description: Optional[str] = Field(None, description="Line description", example="Accrual for December software expenses") - debit: float = Field(..., description="Debit amount", example=300.0) - credit: float = Field(..., description="Credit amount", example=0.0) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2024-12-31T23:51:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class BankTransactionJournalLinkCreateRequest(BaseModel): - bank_transaction_id: int = Field(..., description="Bank transaction ID being reconciled", example=6001) - journal_entry_id: int = Field(..., description="Journal entry ID representing the accounting for this transaction", example=8005) - -class BankTransactionJournalLinkResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Link ID", example=90001) - bank_transaction_id: int = Field(..., description="Bank transaction ID", example=6001) - journal_entry_id: int = Field(..., description="Journal entry ID", example=8005) - created_at: Optional[datetime] = Field(None, description="Link creation timestamp", example="2025-01-07T11:00:00Z") - -class RecurringInvoiceCreateRequest(BaseModel): - customer_id: int = Field(..., description="Customer who will receive recurring invoices", example=15) - name: str = Field(..., description="Name of the recurring invoice template", example="Monthly SEO Retainer") - description: Optional[str] = Field(None, description="Description of the service or product", example="Monthly SEO services retainer") - quantity: float = Field(..., description="Quantity per recurring invoice", example=1.0) - unit_price: float = Field(..., description="Unit price per run", example=1500.0) - discount_percent: Optional[float] = Field(0.0, description="Discount percent per run", example=0.0) - frequency: str = Field(..., description="Frequency (daily, weekly, monthly, quarterly, yearly)", example="monthly") - next_run_date: str = Field(..., description="Date of next invoice generation (YYYY-MM-DD)", example="2025-02-01") - end_date: Optional[str] = Field(None, description="Final date for invoice generation", example="2025-07-01") - payment_terms_id: Optional[int] = Field(None, description="Payment terms applied to generated invoices", example=4) - tax_category_id: Optional[int] = Field(None, description="Tax category for generated invoices", example=5) - department_id: Optional[int] = Field(None, description="Department for generated invoices", example=2) - currency: Optional[str] = Field("USD", description="Currency for generated invoices", example="USD") - is_active: Optional[bool] = Field(True, description="Whether this recurring schedule is active", example=True) - -class RecurringInvoiceResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Recurring invoice template ID", example=9501) - customer_id: int = Field(..., description="Customer ID", example=15) - name: str = Field(..., description="Template name", example="Monthly SEO Retainer") - description: Optional[str] = Field(None, description="Template description", example="Monthly SEO services retainer") - quantity: float = Field(..., description="Quantity per invoice", example=1.0) - unit_price: float = Field(..., description="Unit price", example=1500.0) - discount_percent: float = Field(..., description="Discount percent", example=0.0) - frequency: str = Field(..., description="Frequency", example="monthly") - next_run_date: date = Field(..., description="Next run date", example="2025-02-01") - end_date: Optional[date] = Field(None, description="End date", example="2025-07-01") - payment_terms_id: Optional[int] = Field(None, description="Payment terms ID", example=4) - tax_category_id: Optional[int] = Field(None, description="Tax category ID", example=5) - department_id: Optional[int] = Field(None, description="Department ID", example=2) - currency: str = Field(..., description="Currency", example="USD") - is_active: bool = Field(..., description="Whether template is active", example=True) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2025-01-20T09:00:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class AccountingPeriodCreateRequest(BaseModel): - start_date: str = Field(..., description="Start date of the period (YYYY-MM-DD)", example="2024-01-01") - end_date: str = Field(..., description="End date of the period (YYYY-MM-DD)", example="2024-12-31") - close_date: Optional[str] = Field(None, description="Date when the period was closed", example="2024-12-31") - is_locked: Optional[bool] = Field(False, description="Whether the period is locked against changes", example=True) - -class AccountingPeriodUpdateRequest(BaseModel): - close_date: Optional[str] = Field(None, description="New close date or null to clear", example="2024-12-31") - is_locked: Optional[bool] = Field(None, description="Set true to lock or false to unlock", example=True) - -class AccountingPeriodResponse(BaseModel): - model_config = ConfigDict(from_attributes=True) - id: int = Field(..., description="Accounting period ID", example=10001) - start_date: date = Field(..., description="Start date", example="2024-01-01") - end_date: date = Field(..., description="End date", example="2024-12-31") - close_date: Optional[date] = Field(None, description="Close date or null", example="2024-12-31") - is_locked: bool = Field(..., description="Locked flag", example=True) - created_at: Optional[datetime] = Field(None, description="Creation timestamp", example="2024-12-31T23:55:00Z") - updated_at: Optional[datetime] = Field(None, description="Update timestamp", example=None) - -class ProfitAndLossReportResponse(BaseModel): - start_date: str = Field(..., description="Report start date", example="2025-01-01") - end_date: str = Field(..., description="Report end date", example="2025-01-31") - department_id: Optional[int] = Field(None, description="Department filter or null if not filtered", example=2) - total_revenue: float = Field(..., description="Sum of income account balances for the period", example=5000.0) - total_expenses: float = Field(..., description="Sum of expense account balances for the period", example=3000.0) - net_profit: float = Field(..., description="total_revenue - total_expenses", example=2000.0) - detail: Dict[str, List[Dict[str, Optional[float]]]] = Field(..., description="Optional breakdown of accounts", example={"income_accounts": [], "expense_accounts": []}) - -@app.post( - "/api/customers", - response_model=CustomerResponse, - summary="Create a new customer", - description="Create a customer with optional payment terms and tax category.", - tags=["customers"], - operation_id="create_customer", -) -async def create_customer_endpoint(body: CustomerCreateRequest = Body(...)) -> CustomerResponse: - session = SessionLocal() - customer = Customer( - name=body.name, - billing_email=body.billing_email, - payment_terms_id=body.payment_terms_id, - default_tax_category_id=body.default_tax_category_id, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(customer) - session.commit() - session.refresh(customer) - session.close() - return CustomerResponse( - id=customer.id, - name=customer.name, - billing_email=customer.billing_email, - payment_terms_id=customer.payment_terms_id, - default_tax_category_id=customer.default_tax_category_id, - created_at=customer.created_at, - updated_at=customer.updated_at, - ) - -@app.get( - "/api/customers", - response_model=CustomersListResponse, - summary="List customers with optional filters", - description="Retrieve customers filtered by name or billing email.", - tags=["customers"], - operation_id="list_customers", -) -async def list_customers_endpoint( - name: Optional[str] = Query(None, description="Filter by exact or partial customer name", example="Acme"), - billing_email: Optional[str] = Query(None, description="Filter customers by billing_email exact match", example="billing@acmedesign.com"), - limit: Optional[int] = Query(50, description="Maximum number of records to return", example=50), - offset: Optional[int] = Query(0, description="Number of records to skip for pagination", example=0), -) -> CustomersListResponse: - session = SessionLocal() - query = session.query(Customer) - if name is not None: - query = query.filter(Customer.name.contains(name)) - if billing_email is not None: - query = query.filter(Customer.billing_email == billing_email) - customers = query.offset(offset).limit(limit).all() - session.close() - return CustomersListResponse(customers=customers) - -@app.get( - "/api/customers/{customer_id}", - response_model=CustomerResponse, - summary="Get a single customer by ID", - description="Fetch one customer by ID to inspect billing settings.", - tags=["customers"], - operation_id="get_customer", -) -async def get_customer_endpoint( - customer_id: int = Path(..., description="Customer ID to retrieve", example=10) -) -> CustomerResponse: - session = SessionLocal() - customer = session.query(Customer).filter(Customer.id == customer_id).first() - session.close() - if customer is None: - return CustomerResponse( - id=0, - name="", - billing_email=None, - payment_terms_id=None, - default_tax_category_id=None, - created_at=None, - updated_at=None, - ) - return CustomerResponse( - id=customer.id, - name=customer.name, - billing_email=customer.billing_email, - payment_terms_id=customer.payment_terms_id, - default_tax_category_id=customer.default_tax_category_id, - created_at=customer.created_at, - updated_at=customer.updated_at, - ) - -@app.get( - "/api/payment_terms", - response_model=PaymentTermsListResponse, - summary="List payment terms", - description="Retrieve payment_terms records optionally filtered by name.", - tags=["payment_terms"], - operation_id="list_payment_terms", -) -async def list_payment_terms_endpoint( - name: Optional[str] = Query(None, description="Filter terms by name", example="Net 30") -) -> PaymentTermsListResponse: - session = SessionLocal() - query = session.query(PaymentTerm) - if name is not None: - query = query.filter(PaymentTerm.name.contains(name)) - payment_terms = query.all() - session.close() - return PaymentTermsListResponse(payment_terms=payment_terms) - -@app.get( - "/api/tax_categories", - response_model=TaxCategoriesListResponse, - summary="List tax categories", - description="Retrieve available tax_categories optionally filtered by name.", - tags=["tax_categories"], - operation_id="list_tax_categories", -) -async def list_tax_categories_endpoint( - name: Optional[str] = Query(None, description="Filter tax categories by exact or partial name", example="Standard Sales Tax 8.5%") -) -> TaxCategoriesListResponse: - session = SessionLocal() - query = session.query(TaxCategory) - if name is not None: - query = query.filter(TaxCategory.name.contains(name)) - rows = query.all() - tax_categories: List[TaxCategoryResponse] = [] - for r in rows: - tax_categories.append( - TaxCategoryResponse( - id=r.id, - name=r.name, - description=r.description, - rate=r.rate, - is_compound=bool(r.is_compound), - created_at=r.created_at, - updated_at=r.updated_at, - ) - ) - session.close() - return TaxCategoriesListResponse(tax_categories=tax_categories) - -@app.get( - "/api/departments", - response_model=DepartmentsListResponse, - summary="List departments", - description="Retrieve departments to map human-readable names to IDs.", - tags=["departments"], - operation_id="list_departments", -) -async def list_departments_endpoint( - name: Optional[str] = Query(None, description="Filter departments by name", example="Design") -) -> DepartmentsListResponse: - session = SessionLocal() - query = session.query(Department) - if name is not None: - query = query.filter(Department.name.contains(name)) - departments = query.all() - session.close() - return DepartmentsListResponse(departments=departments) - -@app.get( - "/api/accounts", - response_model=AccountsListResponse, - summary="List chart of accounts", - description="Retrieve accounts filtered by type or name.", - tags=["accounts"], - operation_id="list_accounts", -) -async def list_accounts_endpoint( - type: Optional[str] = Query(None, description="Filter accounts by type (asset, liability, equity, income, expense, contra)", example="expense"), - name: Optional[str] = Query(None, description="Filter accounts by name", example="Software Subscriptions"), -) -> AccountsListResponse: - session = SessionLocal() - query = session.query(Account) - if type is not None: - query = query.filter(Account.type == type) - if name is not None: - query = query.filter(Account.name.contains(name)) - rows = query.all() - accounts_list: List[AccountResponse] = [] - for a in rows: - accounts_list.append( - AccountResponse( - id=a.id, - name=a.name, - code=a.code, - type=a.type, - sub_type=a.sub_type, - is_active=bool(a.is_active), - created_at=a.created_at, - updated_at=a.updated_at, - ) - ) - session.close() - return AccountsListResponse(accounts=accounts_list) - -@app.get( - "/api/bank_accounts", - response_model=BankAccountsListResponse, - summary="List bank accounts", - description="Retrieve bank_accounts to find IDs for bank transactions.", - tags=["bank_accounts"], - operation_id="list_bank_accounts", -) -async def list_bank_accounts_endpoint( - name: Optional[str] = Query(None, description="Filter bank accounts by name", example="Chase Business Checking ****1023") -) -> BankAccountsListResponse: - session = SessionLocal() - query = session.query(BankAccount) - if name is not None: - query = query.filter(BankAccount.name.contains(name)) - bank_accounts = query.all() - session.close() - return BankAccountsListResponse(bank_accounts=bank_accounts) - -@app.post( - "/api/invoices", - response_model=InvoiceResponse, - summary="Create a new invoice header", - description="Create an invoice record without line items.", - tags=["invoices"], - operation_id="create_invoice", -) -async def create_invoice_endpoint(body: InvoiceCreateRequest = Body(...)) -> InvoiceResponse: - session = SessionLocal() - invoice = Invoice( - invoice_number=body.invoice_number, - customer_id=body.customer_id, - department_id=body.department_id, - tax_category_id=body.tax_category_id, - invoice_date=date.fromisoformat(body.invoice_date), - due_date=date.fromisoformat(body.due_date), - currency=body.currency if body.currency is not None else "USD", - status=body.status if body.status is not None else "draft", - subtotal=0.0, - tax_amount=0.0, - total=0.0, - balance_due=0.0, - payment_terms_id=body.payment_terms_id, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(invoice) - session.commit() - session.refresh(invoice) - session.close() - return InvoiceResponse( - id=invoice.id, - invoice_number=invoice.invoice_number, - customer_id=invoice.customer_id, - department_id=invoice.department_id, - tax_category_id=invoice.tax_category_id, - invoice_date=invoice.invoice_date, - due_date=invoice.due_date, - currency=invoice.currency, - status=invoice.status, - subtotal=invoice.subtotal, - tax_amount=invoice.tax_amount, - total=invoice.total, - balance_due=invoice.balance_due, - payment_terms_id=invoice.payment_terms_id, - created_at=invoice.created_at, - updated_at=invoice.updated_at, - ) - -@app.post( - "/api/invoice_line_items", - response_model=InvoiceLineItemResponse, - summary="Add a line item to an invoice", - description="Create an invoice line and update invoice totals.", - tags=["invoices", "invoice_line_items"], - operation_id="create_invoice_line_item", -) -async def create_invoice_line_item_endpoint( - body: InvoiceLineItemCreateRequest = Body(...) -) -> InvoiceLineItemResponse: - session = SessionLocal() - invoice = session.query(Invoice).filter(Invoice.id == body.invoice_id).first() - tax_rate = 0.0 - if invoice is not None and invoice.tax_category_id is not None: - tax_cat = session.query(TaxCategory).filter(TaxCategory.id == invoice.tax_category_id).first() - if tax_cat is not None: - tax_rate = tax_cat.rate - discount_percent = body.discount_percent if body.discount_percent is not None else 0.0 - gross = body.quantity * body.unit_price - discount_amount = gross * (discount_percent / 100.0) - line_subtotal = gross - discount_amount - tax_amount = line_subtotal * tax_rate - total = line_subtotal + tax_amount - item = InvoiceLineItem( - invoice_id=body.invoice_id, - description=body.description, - quantity=body.quantity, - unit_price=body.unit_price, - discount_percent=discount_percent, - line_subtotal=line_subtotal, - tax_amount=tax_amount, - total=total, - revenue_account_id=body.revenue_account_id, - department_id=body.department_id if body.department_id is not None else (invoice.department_id if invoice is not None else None), - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(item) - if invoice is not None: - subtotal_sum = session.query(InvoiceLineItem).filter(InvoiceLineItem.invoice_id == invoice.id).all() - subtotal_value = 0.0 - tax_value = 0.0 - total_value = 0.0 - for li in subtotal_sum: - subtotal_value += li.line_subtotal - tax_value += li.tax_amount - total_value += li.total - subtotal_value += line_subtotal - tax_value += tax_amount - total_value += total - invoice.subtotal = subtotal_value - invoice.tax_amount = tax_value - invoice.total = total_value - payments = session.query(PaymentApplication).filter(PaymentApplication.invoice_id == invoice.id).all() - paid_amount = 0.0 - for p in payments: - paid_amount += p.amount - invoice.balance_due = invoice.total - paid_amount - invoice.updated_at = datetime.utcnow() - session.commit() - session.refresh(item) - session.close() - return InvoiceLineItemResponse( - id=item.id, - invoice_id=item.invoice_id, - description=item.description, - quantity=item.quantity, - unit_price=item.unit_price, - discount_percent=item.discount_percent, - line_subtotal=item.line_subtotal, - tax_amount=item.tax_amount, - total=item.total, - revenue_account_id=item.revenue_account_id, - department_id=item.department_id, - created_at=item.created_at, - updated_at=item.updated_at, - ) - -@app.post( - "/api/invoices/{invoice_id}/recalculate_totals", - response_model=InvoiceRecalculateTotalsResponse, - summary="Recalculate invoice totals", - description="Recompute totals from line items and applied payments.", - tags=["invoices"], - operation_id="recalculate_invoice_totals", -) -async def recalculate_invoice_totals_endpoint( - invoice_id: int = Path(..., description="Invoice ID whose totals should be recalculated", example=1001) -) -> InvoiceRecalculateTotalsResponse: - session = SessionLocal() - invoice = session.query(Invoice).filter(Invoice.id == invoice_id).first() - if invoice is None: - session.close() - return InvoiceRecalculateTotalsResponse(invoice_id=0, subtotal=0.0, tax_amount=0.0, total=0.0, balance_due=0.0) - lines = session.query(InvoiceLineItem).filter(InvoiceLineItem.invoice_id == invoice_id).all() - subtotal = 0.0 - tax_amount = 0.0 - total = 0.0 - for li in lines: - subtotal += li.line_subtotal - tax_amount += li.tax_amount - total += li.total - payments = session.query(PaymentApplication).filter(PaymentApplication.invoice_id == invoice_id).all() - paid_amount = 0.0 - for pa in payments: - paid_amount += pa.amount - invoice.subtotal = subtotal - invoice.tax_amount = tax_amount - invoice.total = total - invoice.balance_due = total - paid_amount - invoice.updated_at = datetime.utcnow() - session.commit() - session.close() - return InvoiceRecalculateTotalsResponse( - invoice_id=invoice_id, - subtotal=subtotal, - tax_amount=tax_amount, - total=total, - balance_due=invoice.balance_due, - ) - -@app.get( - "/api/invoices", - response_model=InvoicesListResponse, - summary="List invoices with filters", - description="Retrieve invoices filtered by number, customer, status, or dates.", - tags=["invoices"], - operation_id="list_invoices", -) -async def list_invoices_endpoint( - invoice_number: Optional[str] = Query(None, description="Filter by invoice_number", example="INV-2025-001"), - customer_id: Optional[int] = Query(None, description="Filter invoices for a given customer ID", example=10), - status: Optional[str] = Query(None, description="Filter by invoice status (draft, open, paid, void)", example="open"), - from_date: Optional[str] = Query(None, description="Filter by minimum invoice_date (YYYY-MM-DD)", example="2025-01-01"), - to_date: Optional[str] = Query(None, description="Filter by maximum invoice_date (YYYY-MM-DD)", example="2025-01-31"), - limit: Optional[int] = Query(50, description="Max number of invoices to return", example=50), - offset: Optional[int] = Query(0, description="Number of invoices to skip", example=0), -) -> InvoicesListResponse: - session = SessionLocal() - query = session.query(Invoice) - if invoice_number is not None: - query = query.filter(Invoice.invoice_number == invoice_number) - if customer_id is not None: - query = query.filter(Invoice.customer_id == customer_id) - if status is not None: - query = query.filter(Invoice.status == status) - if from_date is not None: - query = query.filter(Invoice.invoice_date >= date.fromisoformat(from_date)) - if to_date is not None: - query = query.filter(Invoice.invoice_date <= date.fromisoformat(to_date)) - invoices = query.offset(offset).limit(limit).all() - session.close() - return InvoicesListResponse(invoices=invoices) - -@app.post( - "/api/payments", - response_model=PaymentResponse, - summary="Record a customer payment", - description="Create a payment row for a customer without allocations.", - tags=["payments"], - operation_id="create_payment", -) -async def create_payment_endpoint(body: PaymentCreateRequest = Body(...)) -> PaymentResponse: - session = SessionLocal() - payment = Payment( - customer_id=body.customer_id, - payment_date=date.fromisoformat(body.payment_date), - settlement_date=date.fromisoformat(body.settlement_date) if body.settlement_date is not None else None, - amount=body.amount, - currency=body.currency if body.currency is not None else "USD", - method=body.method, - reference=body.reference, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(payment) - session.commit() - session.refresh(payment) - session.close() - return PaymentResponse( - id=payment.id, - customer_id=payment.customer_id, - payment_date=payment.payment_date, - settlement_date=payment.settlement_date, - amount=payment.amount, - currency=payment.currency, - method=payment.method, - reference=payment.reference, - created_at=payment.created_at, - updated_at=payment.updated_at, - ) - -@app.post( - "/api/payment_applications", - response_model=PaymentApplicationResponse, - summary="Apply a payment to an invoice", - description="Allocate part or all of a payment amount to a specific invoice.", - tags=["payments", "payment_applications"], - operation_id="create_payment_application", -) -async def create_payment_application_endpoint( - body: PaymentApplicationCreateRequest = Body(...) -) -> PaymentApplicationResponse: - session = SessionLocal() - payment_app = PaymentApplication( - payment_id=body.payment_id, - invoice_id=body.invoice_id, - amount=body.amount, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(payment_app) - invoice = session.query(Invoice).filter(Invoice.id == body.invoice_id).first() - if invoice is not None: - payments = session.query(PaymentApplication).filter(PaymentApplication.invoice_id == body.invoice_id).all() - total_applied = 0.0 - for p in payments: - total_applied += p.amount - total_applied += body.amount - invoice.balance_due = invoice.total - total_applied - if invoice.balance_due <= 0: - invoice.status = "paid" - invoice.updated_at = datetime.utcnow() - session.commit() - session.refresh(payment_app) - session.close() - return PaymentApplicationResponse( - id=payment_app.id, - payment_id=payment_app.payment_id, - invoice_id=payment_app.invoice_id, - amount=payment_app.amount, - created_at=payment_app.created_at, - updated_at=payment_app.updated_at, - ) - -@app.post( - "/api/vendors", - response_model=VendorResponse, - summary="Create a new vendor", - description="Create a vendor with default payment terms and expense category.", - tags=["vendors"], - operation_id="create_vendor", -) -async def create_vendor_endpoint(body: VendorCreateRequest = Body(...)) -> VendorResponse: - session = SessionLocal() - vendor = Vendor( - name=body.name, - contact_email=body.contact_email, - payment_terms_id=body.payment_terms_id, - default_expense_category_id=body.default_expense_category_id, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(vendor) - session.commit() - session.refresh(vendor) - session.close() - return VendorResponse( - id=vendor.id, - name=vendor.name, - contact_email=vendor.contact_email, - payment_terms_id=vendor.payment_terms_id, - default_expense_category_id=vendor.default_expense_category_id, - created_at=vendor.created_at, - updated_at=vendor.updated_at, - ) - -@app.get( - "/api/vendors", - response_model=VendorsListResponse, - summary="List vendors", - description="Retrieve vendors to find IDs when creating bills.", - tags=["vendors"], - operation_id="list_vendors", -) -async def list_vendors_endpoint( - name: Optional[str] = Query(None, description="Filter vendors by name", example="PixelPrint") -) -> VendorsListResponse: - session = SessionLocal() - query = session.query(Vendor) - if name is not None: - query = query.filter(Vendor.name.contains(name)) - vendors = query.all() - session.close() - return VendorsListResponse(vendors=vendors) - -@app.post( - "/api/bills", - response_model=BillResponse, - summary="Create a bill", - description="Create a bills row for vendor expenses.", - tags=["bills"], - operation_id="create_bill", -) -async def create_bill_endpoint(body: BillCreateRequest = Body(...)) -> BillResponse: - session = SessionLocal() - bill = Bill( - bill_number=body.bill_number, - vendor_id=body.vendor_id, - bill_date=date.fromisoformat(body.bill_date), - due_date=date.fromisoformat(body.due_date) if body.due_date is not None else None, - currency=body.currency if body.currency is not None else "USD", - amount=body.amount, - description=body.description, - department_id=body.department_id, - reimbursement_status=body.reimbursement_status, - payment_terms_id=body.payment_terms_id, - status=body.status if body.status is not None else "open", - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(bill) - session.commit() - session.refresh(bill) - session.close() - return BillResponse( - id=bill.id, - bill_number=bill.bill_number, - vendor_id=bill.vendor_id, - bill_date=bill.bill_date, - due_date=bill.due_date, - currency=bill.currency, - amount=bill.amount, - description=bill.description, - department_id=bill.department_id, - reimbursement_status=bill.reimbursement_status, - payment_terms_id=bill.payment_terms_id, - status=bill.status, - created_at=bill.created_at, - updated_at=bill.updated_at, - ) - -@app.post( - "/api/recurring_expenses", - response_model=RecurringExpenseResponse, - summary="Create a recurring expense template", - description="Create recurring_expenses templates such as monthly rent.", - tags=["recurring_expenses"], - operation_id="create_recurring_expense", -) -async def create_recurring_expense_endpoint( - body: RecurringExpenseCreateRequest = Body(...) -) -> RecurringExpenseResponse: - session = SessionLocal() - recurring = RecurringExpense( - name=body.name, - vendor_id=body.vendor_id, - amount=body.amount, - expense_account_id=body.expense_account_id, - department_id=body.department_id, - frequency=body.frequency, - next_run_date=date.fromisoformat(body.next_run_date), - end_date=date.fromisoformat(body.end_date) if body.end_date is not None else None, - is_active=1 if (body.is_active if body.is_active is not None else True) else 0, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(recurring) - session.commit() - session.refresh(recurring) - session.close() - return RecurringExpenseResponse( - id=recurring.id, - name=recurring.name, - vendor_id=recurring.vendor_id, - amount=recurring.amount, - expense_account_id=recurring.expense_account_id, - department_id=recurring.department_id, - frequency=recurring.frequency, - next_run_date=recurring.next_run_date, - end_date=recurring.end_date, - is_active=bool(recurring.is_active), - created_at=recurring.created_at, - updated_at=recurring.updated_at, - ) - -@app.post( - "/api/bank_transactions/batch_import", - response_model=BankTransactionsBatchImportResponse, - summary="Import a batch of bank transactions", - description="Insert multiple bank_transactions for a bank account in one call.", - tags=["bank_transactions"], - operation_id="batch_import_bank_transactions", -) -async def batch_import_bank_transactions_endpoint( - body: BankTransactionsBatchImportRequest = Body(...) -) -> BankTransactionsBatchImportResponse: - session = SessionLocal() - created_items: List[BankTransactionResponse] = [] - for t in body.transactions: - bt = BankTransaction( - bank_account_id=body.bank_account_id, - transaction_date=date.fromisoformat(t.transaction_date), - posted_date=date.fromisoformat(t.posted_date) if t.posted_date is not None else None, - description=t.description, - amount=t.amount, - external_id=t.external_id, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(bt) - session.commit() - session.refresh(bt) - created_items.append( - BankTransactionResponse( - id=bt.id, - bank_account_id=bt.bank_account_id, - transaction_date=bt.transaction_date, - posted_date=bt.posted_date, - description=bt.description, - amount=bt.amount, - external_id=bt.external_id, - created_at=bt.created_at, - updated_at=bt.updated_at, - ) - ) - session.close() - return BankTransactionsBatchImportResponse(bank_transactions=created_items) - -@app.get( - "/api/bank_transactions", - response_model=BankTransactionsListResponse, - summary="List bank transactions", - description="Retrieve bank_transactions for a bank account filtered by date.", - tags=["bank_transactions"], - operation_id="list_bank_transactions", -) -async def list_bank_transactions_endpoint( - bank_account_id: int = Query(..., description="Bank account ID to filter transactions", example=1), - from_date: Optional[str] = Query(None, description="Minimum transaction_date (YYYY-MM-DD)", example="2025-01-01"), - to_date: Optional[str] = Query(None, description="Maximum transaction_date (YYYY-MM-DD)", example="2025-01-07"), - limit: Optional[int] = Query(100, description="Maximum number of records", example=100), - offset: Optional[int] = Query(0, description="Records to skip", example=0), -) -> BankTransactionsListResponse: - session = SessionLocal() - query = session.query(BankTransaction).filter(BankTransaction.bank_account_id == bank_account_id) - if from_date is not None: - query = query.filter(BankTransaction.transaction_date >= date.fromisoformat(from_date)) - if to_date is not None: - query = query.filter(BankTransaction.transaction_date <= date.fromisoformat(to_date)) - transactions = query.offset(offset).limit(limit).all() - session.close() - return BankTransactionsListResponse(bank_transactions=transactions) - -@app.post( - "/api/journal_entries", - response_model=JournalEntryResponse, - summary="Create a journal entry header", - description="Create a journal_entries header with entry_date and description.", - tags=["journal_entries"], - operation_id="create_journal_entry", -) -async def create_journal_entry_endpoint( - body: JournalEntryCreateRequest = Body(...) -) -> JournalEntryResponse: - session = SessionLocal() - entry = JournalEntry( - entry_date=date.fromisoformat(body.entry_date), - description=body.description, - department_id=body.department_id, - source=body.source, - source_id=body.source_id, - created_by_user_id=1, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(entry) - session.commit() - session.refresh(entry) - session.close() - return JournalEntryResponse( - id=entry.id, - entry_date=entry.entry_date, - description=entry.description, - department_id=entry.department_id, - source=entry.source, - source_id=entry.source_id, - created_by_user_id=entry.created_by_user_id, - created_at=entry.created_at, - updated_at=entry.updated_at, - ) - -@app.post( - "/api/journal_entry_lines", - response_model=JournalEntryLineResponse, - summary="Add a line to a journal entry", - description="Create a journal_entry_lines row for an account with debit or credit.", - tags=["journal_entries", "journal_entry_lines"], - operation_id="create_journal_entry_line", -) -async def create_journal_entry_line_endpoint( - body: JournalEntryLineCreateRequest = Body(...) -) -> JournalEntryLineResponse: - session = SessionLocal() - debit_value = body.debit if body.debit is not None else 0.0 - credit_value = body.credit if body.credit is not None else 0.0 - line = JournalEntryLine( - journal_entry_id=body.journal_entry_id, - account_id=body.account_id, - department_id=body.department_id, - description=body.description, - debit=debit_value, - credit=credit_value, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(line) - session.commit() - session.refresh(line) - session.close() - return JournalEntryLineResponse( - id=line.id, - journal_entry_id=line.journal_entry_id, - account_id=line.account_id, - department_id=line.department_id, - description=line.description, - debit=line.debit, - credit=line.credit, - created_at=line.created_at, - updated_at=line.updated_at, - ) - -@app.post( - "/api/bank_transaction_journal_links", - response_model=BankTransactionJournalLinkResponse, - summary="Link a bank transaction to a journal entry", - description="Create a bank_transaction_journal_links row to connect bank_transactions with journal_entries.", - tags=["bank_transactions", "journal_entries"], - operation_id="create_bank_transaction_journal_link", -) -async def create_bank_transaction_journal_link_endpoint( - body: BankTransactionJournalLinkCreateRequest = Body(...) -) -> BankTransactionJournalLinkResponse: - session = SessionLocal() - link = BankTransactionJournalLink( - bank_transaction_id=body.bank_transaction_id, - journal_entry_id=body.journal_entry_id, - created_at=datetime.utcnow(), - ) - session.add(link) - session.commit() - session.refresh(link) - session.close() - return BankTransactionJournalLinkResponse( - id=link.id, - bank_transaction_id=link.bank_transaction_id, - journal_entry_id=link.journal_entry_id, - created_at=link.created_at, - ) - -@app.post( - "/api/recurring_invoices", - response_model=RecurringInvoiceResponse, - summary="Create a recurring invoice schedule", - description="Create a recurring_invoices template specifying settings.", - tags=["recurring_invoices"], - operation_id="create_recurring_invoice", -) -async def create_recurring_invoice_endpoint( - body: RecurringInvoiceCreateRequest = Body(...) -) -> RecurringInvoiceResponse: - session = SessionLocal() - recurring = RecurringInvoice( - customer_id=body.customer_id, - name=body.name, - description=body.description, - quantity=body.quantity, - unit_price=body.unit_price, - discount_percent=body.discount_percent if body.discount_percent is not None else 0.0, - frequency=body.frequency, - next_run_date=date.fromisoformat(body.next_run_date), - end_date=date.fromisoformat(body.end_date) if body.end_date is not None else None, - payment_terms_id=body.payment_terms_id, - tax_category_id=body.tax_category_id, - department_id=body.department_id, - currency=body.currency if body.currency is not None else "USD", - is_active=1 if (body.is_active if body.is_active is not None else True) else 0, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(recurring) - session.commit() - session.refresh(recurring) - session.close() - return RecurringInvoiceResponse( - id=recurring.id, - customer_id=recurring.customer_id, - name=recurring.name, - description=recurring.description, - quantity=recurring.quantity, - unit_price=recurring.unit_price, - discount_percent=recurring.discount_percent, - frequency=recurring.frequency, - next_run_date=recurring.next_run_date, - end_date=recurring.end_date, - payment_terms_id=recurring.payment_terms_id, - tax_category_id=recurring.tax_category_id, - department_id=recurring.department_id, - currency=recurring.currency, - is_active=bool(recurring.is_active), - created_at=recurring.created_at, - updated_at=recurring.updated_at, - ) - -@app.post( - "/api/accounting_periods", - response_model=AccountingPeriodResponse, - summary="Create an accounting period", - description="Create an accounting_periods row representing a fiscal period.", - tags=["accounting_periods"], - operation_id="create_accounting_period", -) -async def create_accounting_period_endpoint( - body: AccountingPeriodCreateRequest = Body(...) -) -> AccountingPeriodResponse: - session = SessionLocal() - period = AccountingPeriod( - start_date=date.fromisoformat(body.start_date), - end_date=date.fromisoformat(body.end_date), - close_date=date.fromisoformat(body.close_date) if body.close_date is not None else None, - is_locked=1 if (body.is_locked if body.is_locked is not None else False) else 0, - created_at=datetime.utcnow(), - updated_at=None, - ) - session.add(period) - session.commit() - session.refresh(period) - session.close() - return AccountingPeriodResponse( - id=period.id, - start_date=period.start_date, - end_date=period.end_date, - close_date=period.close_date, - is_locked=bool(period.is_locked), - created_at=period.created_at, - updated_at=period.updated_at, - ) - -@app.patch( - "/api/accounting_periods/{period_id}", - response_model=AccountingPeriodResponse, - summary="Update an accounting period lock status", - description="Update close_date and is_locked for an accounting period.", - tags=["accounting_periods"], - operation_id="update_accounting_period_lock", -) -async def update_accounting_period_lock_endpoint( - period_id: int = Path(..., description="Accounting period ID to update", example=10001), - body: AccountingPeriodUpdateRequest = Body(...), -) -> AccountingPeriodResponse: - session = SessionLocal() - period = session.query(AccountingPeriod).filter(AccountingPeriod.id == period_id).first() - if period is None: - session.close() - return AccountingPeriodResponse( - id=0, - start_date=date.fromisoformat("1970-01-01"), - end_date=date.fromisoformat("1970-01-01"), - close_date=None, - is_locked=False, - created_at=None, - updated_at=None, - ) - if body.close_date is not None: - period.close_date = date.fromisoformat(body.close_date) - if body.close_date is None and body.close_date is not ...: - if body.close_date is None: - period.close_date = None - if body.is_locked is not None: - period.is_locked = 1 if body.is_locked else 0 - period.updated_at = datetime.utcnow() - session.commit() - session.refresh(period) - session.close() - return AccountingPeriodResponse( - id=period.id, - start_date=period.start_date, - end_date=period.end_date, - close_date=period.close_date, - is_locked=bool(period.is_locked), - created_at=period.created_at, - updated_at=period.updated_at, - ) - -@app.get( - "/api/reports/profit_and_loss", - response_model=ProfitAndLossReportResponse, - summary="Generate a profit and loss report", - description="Compute revenue, expenses, and net profit for a date range.", - tags=["reports"], - operation_id="generate_profit_and_loss", -) -async def generate_profit_and_loss_endpoint( - start_date: str = Query(..., description="Start date for the report (YYYY-MM-DD)", example="2025-01-01"), - end_date: str = Query(..., description="End date for the report (YYYY-MM-DD)", example="2025-01-31"), - department_id: Optional[int] = Query(None, description="Optional department filter to restrict results", example=2), -) -> ProfitAndLossReportResponse: - session = SessionLocal() - start = date.fromisoformat(start_date) - end = date.fromisoformat(end_date) - entries_query = session.query(JournalEntry).filter( - JournalEntry.entry_date >= start, JournalEntry.entry_date <= end - ) - if department_id is not None: - entries_query = entries_query.filter(JournalEntry.department_id == department_id) - entries = entries_query.all() - entry_ids = [e.id for e in entries] - lines_query = session.query(JournalEntryLine).filter(JournalEntryLine.journal_entry_id.in_(entry_ids)) if entry_ids else session.query(JournalEntryLine).filter(JournalEntryLine.id == -1) - if department_id is not None: - lines_query = lines_query.filter( - (JournalEntryLine.department_id == department_id) | (JournalEntryLine.department_id.is_(None)) - ) - lines = lines_query.all() - account_ids = list({l.account_id for l in lines}) - accounts = {} - if account_ids: - account_rows = session.query(Account).filter(Account.id.in_(account_ids)).all() - for a in account_rows: - accounts[a.id] = a - total_revenue = 0.0 - total_expenses = 0.0 - income_details: List[Dict[str, Optional[float]]] = [] - expense_details: List[Dict[str, Optional[float]]] = [] - income_map: Dict[int, float] = {} - expense_map: Dict[int, float] = {} - for l in lines: - a = accounts.get(l.account_id) - if a is None: - continue - net_amount = l.debit - l.credit - if a.type == "income": - amount = -net_amount - total_revenue += amount - income_map[a.id] = income_map.get(a.id, 0.0) + amount - if a.type == "expense": - amount = net_amount - total_expenses += amount - expense_map[a.id] = expense_map.get(a.id, 0.0) + amount - for aid, amt in income_map.items(): - a = accounts.get(aid) - if a is not None: - income_details.append({"account_id": float(a.id), "account_name": a.name, "amount": amt}) - for aid, amt in expense_map.items(): - a = accounts.get(aid) - if a is not None: - expense_details.append({"account_id": float(a.id), "account_name": a.name, "amount": amt}) - net_profit = total_revenue - total_expenses - session.close() - detail = { - "income_accounts": income_details, - "expense_accounts": expense_details, - } - return ProfitAndLossReportResponse( - start_date=start_date, - end_date=end_date, - department_id=department_id, - total_revenue=total_revenue, - total_expenses=total_expenses, - net_profit=net_profit, - detail=detail, - ) - -if __name__ == "__main__": - import uvicorn, os - host = os.getenv("HOST", "127.0.0.1") - port = int(os.getenv("PORT", "8000")) - uvicorn.run(app, host=host, port=port) \ No newline at end of file diff --git a/components/awm/private/tasks/awm-accounting-1-invoice/original_verifier.py b/components/awm/private/tasks/awm-accounting-1-invoice/original_verifier.py deleted file mode 100644 index 019e2d68315d01b634129aa3499b6125cad3c817..0000000000000000000000000000000000000000 --- a/components/awm/private/tasks/awm-accounting-1-invoice/original_verifier.py +++ /dev/null @@ -1,145 +0,0 @@ -def verify_task_completion(initial_db_path: str, final_db_path: str, final_answer: str | None = None) -> dict: - import sqlite3 - - def safe_query(db_path: str, query: str, params: tuple = ()) -> list: - try: - conn = sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) - cursor = conn.cursor() - cursor.execute(query, params) - results = cursor.fetchall() - conn.close() - return results - except Exception: - return [] - - # Get customer_id for 'Acme Design Studio' - customer_query = "SELECT id FROM customers WHERE name = 'Acme Design Studio'" - customer_result = safe_query(final_db_path, customer_query) - if not customer_result: - return {"result": "others"} - customer_id = customer_result[0][0] - - # Get department_id for 'Design' - dept_query = "SELECT id FROM departments WHERE name = 'Design'" - dept_result = safe_query(final_db_path, dept_query) - if not dept_result: - return {"result": "others"} - dept_id = dept_result[0][0] - - # Get tax_category_id for 'Standard Sales Tax 8.5%' - tax_query = "SELECT id, rate FROM tax_categories WHERE name = 'Standard Sales Tax 8.5%'" - tax_result = safe_query(final_db_path, tax_query) - if not tax_result: - return {"result": "others"} - tax_category_id = tax_result[0][0] - tax_rate = tax_result[0][1] - - # Find invoices in initial state for this customer with these dates - initial_invoice_query = """SELECT id FROM invoices - WHERE customer_id = ? AND invoice_date = '2025-01-05' AND due_date = '2025-02-04' - AND department_id = ? AND tax_category_id = ?""" - initial_invoices = safe_query(initial_db_path, initial_invoice_query, - (customer_id, dept_id, tax_category_id)) - - # Find invoices in final state for this customer with these dates - final_invoice_query = """SELECT id, subtotal, tax_amount, total FROM invoices - WHERE customer_id = ? AND invoice_date = '2025-01-05' AND due_date = '2025-02-04' - AND department_id = ? AND tax_category_id = ?""" - final_invoices = safe_query(final_db_path, final_invoice_query, - (customer_id, dept_id, tax_category_id)) - - # Check if a new invoice was created - if len(final_invoices) <= len(initial_invoices): - return {"result": "others"} - - # Find the newly created invoice(s) - initial_invoice_ids = set(inv[0] for inv in initial_invoices) - new_invoices = [inv for inv in final_invoices if inv[0] not in initial_invoice_ids] - - if not new_invoices: - return {"result": "others"} - - # Check each new invoice to find one that matches our requirements - for invoice in new_invoices: - invoice_id = invoice[0] - invoice_subtotal = invoice[1] - invoice_tax = invoice[2] - invoice_total = invoice[3] - - # Get line items for this invoice - line_items_query = """SELECT description, quantity, unit_price, discount_percent, - line_subtotal, tax_amount, total, department_id - FROM invoice_line_items WHERE invoice_id = ? ORDER BY id""" - line_items = safe_query(final_db_path, line_items_query, (invoice_id,)) - - # Must have exactly 2 line items - if len(line_items) != 2: - continue - - # Check first line item: 'Logo redesign' - item1 = line_items[0] - if item1[0] != 'Logo redesign': - continue - if abs(item1[1] - 1.0) > 0.001: # quantity - continue - if abs(item1[2] - 1200.0) > 0.001: # unit_price - continue - if abs(item1[3] - 0.0) > 0.001: # discount_percent - continue - if item1[7] != dept_id: # department_id - continue - - # Calculate expected values for item1 - expected_subtotal1 = 1200.0 * 1.0 * (1 - 0.0 / 100.0) - expected_tax1 = expected_subtotal1 * tax_rate - expected_total1 = expected_subtotal1 + expected_tax1 - - if abs(item1[4] - expected_subtotal1) > 0.01: # line_subtotal - continue - if abs(item1[5] - expected_tax1) > 0.01: # tax_amount - continue - if abs(item1[6] - expected_total1) > 0.01: # total - continue - - # Check second line item: 'Brand guideline document' - item2 = line_items[1] - if item2[0] != 'Brand guideline document': - continue - if abs(item2[1] - 1.0) > 0.001: # quantity - continue - if abs(item2[2] - 800.0) > 0.001: # unit_price - continue - if abs(item2[3] - 10.0) > 0.001: # discount_percent - continue - if item2[7] != dept_id: # department_id - continue - - # Calculate expected values for item2 - expected_subtotal2 = 800.0 * 1.0 * (1 - 10.0 / 100.0) - expected_tax2 = expected_subtotal2 * tax_rate - expected_total2 = expected_subtotal2 + expected_tax2 - - if abs(item2[4] - expected_subtotal2) > 0.01: # line_subtotal - continue - if abs(item2[5] - expected_tax2) > 0.01: # tax_amount - continue - if abs(item2[6] - expected_total2) > 0.01: # total - continue - - # Verify invoice totals match sum of line items - total_subtotal = expected_subtotal1 + expected_subtotal2 - total_tax = expected_tax1 + expected_tax2 - total_amount = expected_total1 + expected_total2 - - if abs(invoice_subtotal - total_subtotal) > 0.01: - continue - if abs(invoice_tax - total_tax) > 0.01: - continue - if abs(invoice_total - total_amount) > 0.01: - continue - - # All checks passed for this invoice - return {"result": "complete"} - - # No invoice matched all requirements - return {"result": "others"} \ No newline at end of file diff --git a/components/awm/requirements.lock b/components/awm/requirements.lock deleted file mode 100644 index 543936bbbe0a1b14059cdfb3aeae89aeac00fb4b..0000000000000000000000000000000000000000 --- a/components/awm/requirements.lock +++ /dev/null @@ -1,112 +0,0 @@ -# Linux/amd64 CPython 3.12 wheel lock. Offline inputs: vendor/build-manifest.json. -# OpenEnv source commit: 86a180ede21e044f7929b9a7783ad83aa67d83a3. -aiofile==3.12.3 --hash=sha256:5c1bcc9e929c50834608e8cc1a4cc1d7503eb60c15a535b779fd39e2f372c017 -annotated-doc==0.0.5 --hash=sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101 -annotated-types==0.8.0 --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 -anyio==4.15.1 --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101 -attrs==26.1.0 --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 -Authlib==1.8.0 --hash=sha256:88aebbd9af6757e14e912d5dc007ae1dc1f3e27e3b2152ce7c552ee2c3b3c121 -beartype==0.22.9 --hash=sha256:d16c9bbc61ea14637596c5f6fbff2ee99cbe3573e46a716401734ef50c3060c2 -brotli==1.2.0 --hash=sha256:072e7624b1fc4d601036ab3f4f27942ef772887e876beff0301d261210bca97f -cachetools==7.2.1 --hash=sha256:63aa53dfe7473c10cccdd5a01dedf76ef2c4b73a58840d9396e7d0752cbdac3b -caio==0.12.9 --hash=sha256:bf12d4f014b2a33e642ed7905b5787656ede2fc24be21f7c086826ff0d32cec3 -certifi==2026.7.22 --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775 -cffi==2.1.1 --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf -charset-normalizer==3.5.2 --hash=sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649 -click==8.5.0 --hash=sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360 -cryptography==50.0.2 --hash=sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856 -cyclopts==5.2.0 --hash=sha256:5da2a5d65164e03008621fc4795946b88a722b881398b5dfa58afa6218342cff -dnspython==2.9.0 --hash=sha256:9a4aedb833c3c1b49214d04d44d3032ab7a9135f7c1d29a549b4ff78fd82fda9 -docstring_parser==0.18.0 --hash=sha256:b3fcbed555c47d8479be0796ef7e19c2670d428d72e96da63f3a40122860374b -email-validator==2.3.0 --hash=sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4 -exceptiongroup==1.3.1 --hash=sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598 -fastapi==0.143.0 --hash=sha256:3e9395fd35276425b61b516a31fdd7c77fe2af83e41b4da22e30696fb1304c5d -fastmcp==3.4.8 --hash=sha256:ab4e8abe6c9d50b110f367e8c29f82b90c1478ac9180be61af10354f84f0ad8c -fastmcp-slim==3.4.8 --hash=sha256:e72c6b74e90c5dcdc8f58087fbdf213636d8b5d339384a498de1c5df6fc037a7 -filelock==4.1.0 --hash=sha256:2ce9818e3e2d8f284c1a964414447ef148d42a5fd5e2a477a7118e574b293ec1 -fsspec==2026.9.0 --hash=sha256:8dd6e646e99ea382bd85f97a45e6b526a442d79423a7dc673f1e2756d05fcb5f -gradio==6.30.0 --hash=sha256:aae3aa81ec9f44e55781b498ad2ba12b117aa512e8d2bb0ef3e52af7f2ee6305 -gradio_client==2.7.2 --hash=sha256:12c9d2d940df28eb8dce58eef61f5e808265ad87bbbca53704d1330aa701e5e2 -griffelib==2.3.2 --hash=sha256:8e710afededd5607f95bf3c8ccc175ee306e7084459faf27b9f9f44ef2a7a274 -groovy==0.1.2 --hash=sha256:7f7975bab18c729a257a8b1ae9dcd70b7cafb1720481beae47719af57c35fa64 -h11==0.16.0 --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 -hf-gradio==0.4.1 --hash=sha256:76b8cb8be6abe62d74c1ad2d35b42f0629db89aa9e1a8d033cecfe7c856eeab3 -hf-xet==1.7.0 --hash=sha256:2814a6e999d13464c4d679b788cc5d784eb5a4edfc638a31f10e9a11ab531ef8 -httpcore==1.0.9 --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55 -httpcore2==2.13.1 --hash=sha256:e1e05d4f25f7d7d496bfb96748f6f4b67657b03da069b3a68c36069f3db73d0a -httpx==0.28.1 --hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad -httpx-sse==0.4.3 --hash=sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc -httpx2==2.13.1 --hash=sha256:6dff50fabc270ee5fd25d845d0b078ed20564579744d6d962850975996d2f9a4 -huggingface_hub==2.2.0 --hash=sha256:1667f145dc56dc210d60966069397df9ecfca9607a5d43db88b308c89dae56b3 -idna==3.20 --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c -iniconfig==2.3.1 --hash=sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7 -jaraco.classes==3.4.0 --hash=sha256:f662826b6bed8cace05e7ff873ce0f9283b5c924470fe664fff1c2f00f581790 -jaraco.context==6.1.2 --hash=sha256:bf8150b79a2d5d91ae48629d8b427a8f7ba0e1097dd6202a9059f29a36379535 -jaraco.functools==4.6.0 --hash=sha256:99e3dc0060c5cbe8fcd1cdb36258e2a65ca40f1566b2033b12abb1bb44dd3c30 -jeepney==0.9.0 --hash=sha256:97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683 -Jinja2==3.1.6 --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 -jiter==0.17.0 --hash=sha256:8c21265b251d99bbb40080d178a8953e35601d3a1564e05c4de4c0d2ca616797 -joserfc==1.7.5 --hash=sha256:add2c2c84e8373b084d526a8b53daba5d7a513a118cd2dcd9fc9f979d0922159 -jsonref==1.1.0 --hash=sha256:590dc7773df6c21cbf948b5dac07a72a251db28b0238ceecce0a2abfa8ec30a9 -jsonschema==4.26.0 --hash=sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce -jsonschema-path==0.5.0 --hash=sha256:2790a070bc7abb08ea3dbe4d340ece4efadf639223001f020c7503229ba068e2 -jsonschema-specifications==2025.9.1 --hash=sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe -keyring==25.7.0 --hash=sha256:be4a0b195f149690c166e850609a477c532ddbfbaed96a404d4e43f8d5e2689f -markdown-it-py==4.2.0 --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a -MarkupSafe==3.0.4 --hash=sha256:8e124f974786f831d6043728e38296969d3579db8896fe004682f5758e613581 -mcp==1.30.0 --hash=sha256:666edb5009503e1047c9d60346a756f94b261f05cc2625f23d41c728ffc484d0 -mdurl==0.1.2 --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 -more-itertools==11.1.0 --hash=sha256:4b65538ae22f6fed0ce4874efd317463a7489796a0939fa66824dd542125a192 -numpy==2.5.3 --hash=sha256:b7e18c623bb5c95acb3b3328861272816ba199fb531921c5d6d0b675f1fde9e3 -openai==3.28.0 --hash=sha256:1ea40a084ffe2f9f16fd3bea6e870f757853b536b18d8e737c518ef849a2920c -openapi-pydantic==0.6.0 --hash=sha256:8bd6d548a250da37db96f461bcd52b3468e8834ad7d6db14b00a6b2ebbd163a3 -openenv==0.6.1.dev0 --hash=sha256:93a5781b64e2f174f17fff40a558d43745a7f4e48a8b247363da4f27906be53a -opentelemetry-api==1.45.1 --hash=sha256:b31553efa588ae44bc306f863c785c5333a9ecc091248c6ee68b4b6c87fdedfb -orjson==3.13.0 --hash=sha256:bceadfd314bd238f584fc229a4bbaf0e573597e7a026dec5429fbf29fd66c641 -packaging==26.3 --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c -pandas==3.0.6 --hash=sha256:0704044b676496b8350e023b09f174a26772456c974a2b11c36bebb558c9490d -pathable==0.6.0 --hash=sha256:82c4ca6c98c502ad12e0d4e9779b6210afee93c38990988c8c5d1b49bdcdf566 -pillow==12.3.0 --hash=sha256:78cb2c6865a35ab8ff8b75fd122f6033b92a62c82801110e48ddd6c936a45d91 -platformdirs==4.12.4 --hash=sha256:78bfb9db2a8471ed7eebe3c3c932da413911042994e699b384fbb4493fa872d7 -pluggy==1.6.0 --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 -py-key-value-aio==0.4.6 --hash=sha256:820b30c7959fc738ea3d00160cdb10cd258f51e38737b2add530defeea1ded77 -pycparser==3.11 --hash=sha256:51d5a8ba2be0bbe440b99d2112604c95bbbc3c2748a64260186c541e1729cd80 -pydantic==2.14.0 --hash=sha256:15fab1bea6f1dc5003b54fc2ecab230c1fd1dbade2acd4addc52d81e32416d4b -pydantic-settings==2.15.0 --hash=sha256:0ba092c291c94baceb5eff768aa0d56400a457585bc0175925a5a5510303da42 -pydantic_core==2.50.0 --hash=sha256:f187030fc3d62c668feb0f09e92852e0eb414d7fcefc4748f2e67d245aade37e -pydub==0.25.1 --hash=sha256:65617e33033874b59d87db603aa1ed450633288aefead953b30bded59cb599a6 -Pygments==2.21.0 --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 -PyJWT==2.15.1 --hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193 -pyperclip==1.11.0 --hash=sha256:299403e9ff44581cb9ba2ffeed69c7aa96a008622ad0c46cb575ca75b5b84273 -pytest==9.1.1 --hash=sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c -python-dateutil==2.9.0.post0 --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 -python-dotenv==1.2.4 --hash=sha256:42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc -python-multipart==0.0.32 --hash=sha256:ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23 -pytz==2026.5 --hash=sha256:e658af3757f9e26a9d25dd2aff38335acd92bc9104f890a894b2c1ba28311b03 -PyYAML==6.0.3 --hash=sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc -referencing==0.37.0 --hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231 -requests==2.34.2 --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 -rich==15.0.0 --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb -rich-rst==2.2.0 --hash=sha256:1ea1c43813dc4a8d86475fce27ffb74e0ada3d4656c9f8130ba2a59868055fe9 -rpds-py==2026.9.1 --hash=sha256:addeda51556dac7c1a2f14cda62db8b621cd12afba3091d03a96c72932387eab -safehttpx==0.1.7 --hash=sha256:c4f4a162db6993464d7ca3d7cc4af0ffc6515a606dfd220b9f82c6945d869cde -SecretStorage==3.5.0 --hash=sha256:0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137 -semantic-version==2.10.0 --hash=sha256:de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177 -shellingham==1.5.4 --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 -six==1.17.0 --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 -sniffio==1.3.1 --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 -sse-starlette==3.5.0 --hash=sha256:3e6e1070df3f0f5d9cea81496de92dbb72f6721871d99748ece67441dd8b7997 -starlette==1.7.0 --hash=sha256:67f8e99895493dd2911a03f11314af6ceebeae4e704bb9f43dfc6a9db151c93e -tomli==2.5.0 --hash=sha256:6cf74416bdc94ae458b14e37286c1073081850ac8459a00d0c5efef5d44294c6 -tomli_w==1.2.0 --hash=sha256:188306098d013b691fcadc011abd66727d3c414c571bb01b1a174ba8c983cf90 -tomlkit==0.14.0 --hash=sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680 -tqdm==4.70.1 --hash=sha256:c293e525e6fef9c20e8728fd4612df02a0aa31bb5fe91ecd93e123b1b7bffa73 -truststore==0.10.4 --hash=sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981 -typer==0.27.3 --hash=sha256:e50022f28b82a86313e54501317a1db64bf8f8d036ff8cfe5ca7e47675454aff -typing-inspection==0.4.4 --hash=sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147 -typing_extensions==4.16.0 --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 -uncalled-for==0.4.1 --hash=sha256:b611b38879d9fe5088297e7bb28f2ddd12d2d73dad933d93da107fb63eb4058e -urllib3==2.8.0 --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 -uvicorn==0.54.0 --hash=sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf -watchfiles==1.3.0 --hash=sha256:b5768b49e426fd5b550b012c866db347cdf15c398ef98dc557b6e6b72fa74cd1 -websockets==17.2 --hash=sha256:6627b913b8586b1c06db9516b31dd0dfbc621de3bb9312616d92a7e44f268a5b diff --git a/components/awm/runtime/awm/adapter.py b/components/awm/runtime/awm/adapter.py deleted file mode 100644 index c2344dbba4340264a51cf0841fa88e7ac33ce34f..0000000000000000000000000000000000000000 --- a/components/awm/runtime/awm/adapter.py +++ /dev/null @@ -1,92 +0,0 @@ - -import base64 -from functools import wraps -import hashlib -import json -import math -import os -from pathlib import Path -import subprocess -import tempfile -from threading import RLock -import time - -import jsonschema -from common.contracts import ACTION_SCHEMA, observation_payload - - -def serialized(method): - @wraps(method) - def invoke(self,*args,**kwargs): - with self._lock:return method(self,*args,**kwargs) - return invoke - - -class AWMAdapter: - def __init__(self, task_entries, runtime_parent): - self._lock=RLock();self.registry=dict(task_entries);self.runtime_parent=Path(runtime_parent) - self.runtime_parent.mkdir(parents=True,exist_ok=True) - for name,entry in self.registry.items(): - if entry['task_id']!=name or entry['split']!='train':raise ValueError('Invalid registry') - for relative,digest in entry['original_sha256'].items(): - p=Path(entry['directory'])/relative - if p.is_symlink() or hashlib.sha256(p.read_bytes()).hexdigest()!=digest:raise ValueError('Original source integrity mismatch') - self.temporary=None;self.task_id=None;self.done=False;self.reward=None;self.tool_calls=0;self.started=None - - def _worker(self, operation, payload=None): - if self.temporary is None:raise ValueError('reset is required') - request=base64.b64encode(json.dumps(payload or {},allow_nan=False).encode()).decode() - args=['/opt/awm-venv/bin/python','-I','-B','/opt/awm/runtime/awm/worker.py',str(self.registry[self.task_id]['directory']),str(Path(self.temporary.name)/'state'),operation,request] - env={'PATH':'/opt/awm-venv/bin:/usr/local/bin:/usr/bin:/bin','HOME':'/nonexistent','LANG':'C.UTF-8','LC_ALL':'C.UTF-8','PYTHONDONTWRITEBYTECODE':'1'} - try:r=subprocess.run(args,env=env,capture_output=True,text=True,timeout=60) - except (OSError,subprocess.TimeoutExpired) as exc:raise RuntimeError('Original AWM worker did not complete') from exc - if r.returncode: - - (Path(self.temporary.name)/'worker-error.log').write_text(r.stderr[-24000:]) - raise RuntimeError('Original AWM worker failed; inspect its private log') - if len(r.stdout)>4*1024*1024:raise RuntimeError('Original AWM worker response is too large') - return json.loads(r.stdout) - - @serialized - def reset(self, task_id=None): - if task_id is None and len(self.registry)==1:task_id=next(iter(self.registry)) - if task_id not in self.registry:raise ValueError('Unknown task id') - self.close();self.task_id=task_id;self.temporary=tempfile.TemporaryDirectory(prefix='awm-',dir=self.runtime_parent) - self.done=False;self.reward=None;self.tool_calls=0 - value=self._worker('reset');self.started=time.monotonic() - return observation_payload(task_id,value['instructions'],{'available_ops':['call','finish'],'tools':value['tools'],'situation':value['situation'],'original_format':value['original_format'],'delivery':'Return one JSON action per step. Use the listed business tools through op=call; finish when the requested business state is complete.'},reward=0.0,done=False) - - def _terminal(self): - if self.reward is None: - value=self._worker('finish');reward=value['reward'] - if type(reward) not in (int,float) or not math.isfinite(reward) or reward not in (0,1):raise RuntimeError('Invalid original AWM reward') - self.reward=float(reward) - self.done=True - return observation_payload(self.task_id,'The business workflow episode has ended.',{'tool_calls':self.tool_calls},reward=self.reward,done=True) - - @serialized - def step(self, action): - if self.temporary is None:raise ValueError('reset is required') - if hasattr(action,'action_payload'):action=action.action_payload() - jsonschema.validate(action,ACTION_SCHEMA) - if self.done:return self._terminal() - if action['op']=='finish':return self._terminal() - if time.monotonic()-self.started>=self.registry[self.task_id]['timeout_seconds']: - return observation_payload(self.task_id,'Episode time limit reached. Send {"op":"finish"}.',{'finish_required':True,'tool_calls':self.tool_calls},reward=0.0,done=False) - if action['op']=='exec': - return observation_payload(self.task_id,'Shell execution is unavailable. Use a listed business tool.',{'is_error':True,'tool_calls':self.tool_calls},reward=0.0,done=False) - value=self._worker('call',{'name':action['tool'],'arguments':action['arguments']});self.tool_calls=value['tool_calls'] - data={'is_error':value['is_error'],'tool_calls':self.tool_calls} - if time.monotonic()-self.started>=self.registry[self.task_id]['timeout_seconds']: - data['finish_required']=True - return observation_payload(self.task_id,value['content'],data,reward=0.0,done=False) - - @property - @serialized - def state(self): - return {'task_id':self.task_id,'initialized':self.temporary is not None,'done':self.done,'tool_calls':self.tool_calls} - - @serialized - def close(self): - if self.temporary is not None:self.temporary.cleanup() - self.temporary=None;self.task_id=None;self.done=False;self.reward=None;self.tool_calls=0;self.started=None diff --git a/components/awm/runtime/awm/launch_service.py b/components/awm/runtime/awm/launch_service.py deleted file mode 100644 index 01d35a651ea1a96b81b0d93194f6594a7c788e70..0000000000000000000000000000000000000000 --- a/components/awm/runtime/awm/launch_service.py +++ /dev/null @@ -1,52 +0,0 @@ - -import argparse -import json -import os -from pathlib import Path -import subprocess -import time -import urllib.request - - -class RejectRedirects(urllib.request.HTTPRedirectHandler): - def redirect_request(self,*args,**kwargs): - raise RuntimeError('Redirects are forbidden for the local readiness probe') - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('--python',default='/usr/local/bin/python') - parser.add_argument('--config',default='/opt/awm/config.json') - args=parser.parse_args() - if os.geteuid()!=0:raise PermissionError('Only the trusted supervisor may launch this service') - if args.config!='/opt/awm/config.json':raise ValueError('This prototype uses its fixed image registry') - opener=urllib.request.build_opener(urllib.request.ProxyHandler({}),RejectRedirects()) - url='http://127.0.0.1:8000/metadata' - def ready(): - try: - with opener.open(url,timeout=2) as response: - return json.load(response).get('name')=='awm_original' - except Exception:return False - if ready(): - print(json.dumps({'status':'already_running','base_url':'http://127.0.0.1:8000'}));return - private=Path('/opt/awm/private');private.mkdir(parents=True,exist_ok=True);private.chmod(0o700) - log=private/'service.log' - env={'PATH':'/usr/local/bin:/usr/bin:/bin','HOME':'/root','LANG':'C.UTF-8','LC_ALL':'C.UTF-8', - 'PYTHONPATH':'/opt/awm/runtime','PYTHONDONTWRITEBYTECODE':'1','PYTHONUNBUFFERED':'1', - 'ARENA_DEDICATED_CONTAINER':'1','ENABLE_WEB_INTERFACE':'false', - 'OPENENV_MODE':'simulation','GRADIO_ANALYTICS_ENABLED':'false','HF_HUB_OFFLINE':'1'} - with log.open('w') as stream: - process=subprocess.Popen([args.python,'-m','awm.server'],env=env,stdin=subprocess.DEVNULL, - stdout=stream,stderr=subprocess.STDOUT,start_new_session=True) - (private/'service.pid').write_text(str(process.pid)+'\n') - deadline=time.monotonic()+90 - while time.monotonic()2*1024*1024:raise WireProtocolError('SDK response exceeds the transport limit') - return validate_envelope(loads(raw)) - - def reset(self,**kwargs): - return self._post('/reset',kwargs) - - def step(self,action): - return self._post('/step',{'action':action}) - - def finish(self): - return validate_envelope(self.step({'op':'finish'}),require_done=True) - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('operation',choices=['reset','step','finish']) - parser.add_argument('--payload-base64') - parser.add_argument('--url',default='http://127.0.0.1:8000') - parser.add_argument('--timeout',type=float,default=330) - args=parser.parse_args() - payload={} if args.payload_base64 is None else loads(base64.b64decode(args.payload_base64,validate=True)) - if not isinstance(payload,dict):raise WireProtocolError('Payload must be a JSON object') - client=WireClient(args.url,args.timeout) - if args.operation=='reset':result=client.reset(**payload) - elif args.operation=='step':result=client.step(payload) - else: - if payload:raise WireProtocolError('Finish has no payload') - result=client.finish() - print(json.dumps(result,ensure_ascii=False,allow_nan=False,separators=(',',':'))) - - -if __name__=='__main__': - try:main() - except Exception as exc: - print(type(exc).__name__+': '+str(exc),file=sys.stderr) - raise SystemExit(1) diff --git a/components/awm/runtime/awm/worker.py b/components/awm/runtime/awm/worker.py deleted file mode 100644 index c7e02ac519a8d24ebaab46afbbe28e480c3c1731..0000000000000000000000000000000000000000 --- a/components/awm/runtime/awm/worker.py +++ /dev/null @@ -1,149 +0,0 @@ - -import asyncio -import base64 -import importlib.util -import json -import os -from pathlib import Path -import re -import shutil -import sqlite3 -import sys -import traceback -import warnings - -warnings.filterwarnings('ignore', category=DeprecationWarning) -ROOT=Path('/opt/awm') -PRIVATE=ROOT/'private' -STATE=Path('/var/lib/awm') - - -class AWMInfrastructureError(RuntimeError): - - def __init__(self, kind): - self.kind=kind - super().__init__('AWM infrastructure failure: '+kind) - - -def load(name, path): - spec=importlib.util.spec_from_file_location(name,path) - module=importlib.util.module_from_spec(spec);spec.loader.exec_module(module);return module - - -class Controller: - def __init__(self, private=PRIVATE, state=STATE): - self.private=Path(private);self.state=Path(state) - self.state.mkdir(parents=True,exist_ok=True) - self.initial=self.private/'initial.db';self.final=self.state/'final.db' - self.meta_path=self.state/'episode.json' - self.source=json.loads((self.private/'SOURCE.json').read_text()) - self.api=None;self.mcp=None - - def metadata(self): - return json.loads(self.meta_path.read_text()) - - def save(self, value): - tmp=self.meta_path.with_suffix('.tmp');tmp.write_text(json.dumps(value));tmp.replace(self.meta_path) - - def runtime(self): - if self.api is None: - os.environ['DATABASE_PATH']='sqlite:///'+str(self.final) - self.api=load('original_business_api',self.private/'original_api.py') - if self.source['task_id']=='awm-accounting-1-invoice': - self.api.SessionLocal.configure(expire_on_commit=False) - from fastapi_mcp import FastApiMCP - self.mcp=FastApiMCP(self.api.app) - return self.api,self.mcp - - async def close(self): - if self.mcp is not None: - await self.mcp._http_client.aclose() - if self.api is not None: - self.api.engine.dispose() - - def reset(self): - shutil.copy2(self.initial,self.final) - self.save({'done':False,'tool_calls':0}) - _,mcp=self.runtime() - tools=[{'name':t.name,'description':t.description or '', - 'inputSchema':t.inputSchema} for t in mcp.tools] - return {'instructions':self.source['task'], - 'situation':'You have already logged in, and your user id is 1 if required for the MCP tool.', - 'tools':tools,'task_id':self.source['task_id'],'source_split':'training release', - 'original_format':'FastAPI exposed through FastApiMCP 0.4.0', - 'done':False} - - async def call(self, name, arguments): - meta=self.metadata() - if meta['done']: - return {'content':'Episode is finalized.','done':True,'is_error':True, - 'tool_calls':meta['tool_calls']} - api,mcp=self.runtime() - meta['tool_calls']+=1;self.save(meta) - schemas={t.name:t.inputSchema for t in mcp.tools} - if name not in schemas: - return {'content':f'Error: Unknown tool: {name}','done':False,'is_error':True, - 'tool_calls':meta['tool_calls']} - - import httpx - import jsonschema - from sqlalchemy.exc import DataError, IntegrityError - try: - jsonschema.validate(arguments,schemas[name]) - async with httpx.AsyncClient(transport=httpx.ASGITransport(app=api.app), - base_url='http://localhost',trust_env=False) as client: - contents=await mcp._execute_api_tool(client=client,tool_name=name, - arguments=arguments,operation_map=mcp.operation_map,http_request_info=None) - text='\n'.join(c.text for c in contents if hasattr(c,'text')) - return {'content':text,'done':False,'is_error':False,'tool_calls':meta['tool_calls']} - except (jsonschema.ValidationError, DataError, IntegrityError) as exc: - - - return {'content':'Error: '+str(exc),'done':False,'is_error':True, - 'error_kind':'business_argument_error','tool_calls':meta['tool_calls']} - except Exception as exc: - frames=traceback.extract_tb(exc.__traceback__) - invalid_date=isinstance(exc,ValueError) and any( - (frame.name=='_strptime' and frame.filename.endswith('/_strptime.py')) - or (frame.filename.endswith('/original_api.py') - and '.fromisoformat(' in (frame.line or '')) - for frame in frames) - if invalid_date: - return {'content':'Error: '+str(exc),'done':False,'is_error':True, - 'error_kind':'business_date_error','tool_calls':meta['tool_calls']} - match=re.match(r'^Error calling '+re.escape(name)+r'\. Status code: (\d{3})\. Response:',str(exc)) - if match and 400<=int(match.group(1))<500: - return {'content':'Error: '+str(exc),'done':False,'is_error':True, - 'error_kind':'business_http_'+match.group(1),'tool_calls':meta['tool_calls']} - kind='api_http_'+match.group(1) if match else type(exc).__name__ - raise AWMInfrastructureError(kind) from exc - - def finalize(self): - meta=self.metadata();meta['done']=True;self.save(meta) - return {'content':'Episode finalized.','done':True,'tool_calls':meta['tool_calls']} - - def verify(self): - original=load('original_task_verifier',self.private/'original_verifier.py') - result=original.verify_task_completion(str(self.initial),str(self.final),None) - return {'reward':float(result.get('result')=='complete'),'original_result':result, - 'task_id':self.source['task_id'],'tool_calls':self.metadata()['tool_calls']} - - - -async def main(): - controller=Controller(private=sys.argv[1],state=sys.argv[2]);operation=sys.argv[3] - request=json.loads(base64.b64decode(sys.argv[4])) if len(sys.argv)>4 else {} - if operation=='reset':result=controller.reset() - elif operation=='call':result=await controller.call(request['name'],request['arguments']) - elif operation=='finish': - controller.finalize() - result=controller.verify() - elif operation=='finalize':result=controller.finalize() - elif operation=='verify': - result=controller.verify() - else:raise ValueError('Unknown trusted controller operation') - await controller.close() - print(json.dumps(result,ensure_ascii=False,allow_nan=False)) - - -if __name__=='__main__':asyncio.run(main()) diff --git a/components/awm/runtime/common/http_routes.py b/components/awm/runtime/common/http_routes.py deleted file mode 100644 index a3ab94f85fc92d044895d022d16d4659be018d8b..0000000000000000000000000000000000000000 --- a/components/awm/runtime/common/http_routes.py +++ /dev/null @@ -1,64 +0,0 @@ - -from threading import RLock -from contextlib import asynccontextmanager -from copy import deepcopy -from fastapi import HTTPException -from pydantic import ValidationError -from starlette.concurrency import run_in_threadpool -from openenv.core.env_server.serialization import serialize_observation -from openenv.core.env_server.types import ResetRequest,ResetResponse,StepRequest,StepResponse -from .models import ArenaAction - - -def install_persistent_http_routes(app,env,conflict_error=None): - lock=RLock() - app.router.routes=[route for route in app.router.routes if getattr(route,'path',None) not in {'/reset','/step','/state'}] - - def reset_sync(request): - with lock: - return ResetResponse(**serialize_observation(env.reset(**request.model_dump(exclude_unset=True)))) - - def step_sync(request): - with lock: - action=ArenaAction.model_validate(request.action) - return StepResponse(**serialize_observation(env.step(action,timeout_s=request.timeout_s))) - - def state_sync(): - with lock: - value=env.state - return value.model_copy(deep=True) if hasattr(value,'model_copy') else deepcopy(value) - - @app.post('/reset',response_model=ResetResponse) - async def reset(request:ResetRequest): - try:return await run_in_threadpool(reset_sync,request) - except (ValueError,IndexError) as exc:raise HTTPException(status_code=400,detail=str(exc)) from exc - except Exception as exc: - if conflict_error is not None and isinstance(exc,conflict_error): - raise HTTPException(status_code=409,detail=str(exc)) from exc - raise - - @app.post('/step',response_model=StepResponse) - async def step(request:StepRequest): - try:return await run_in_threadpool(step_sync,request) - except (ValueError,ValidationError) as exc:raise HTTPException(status_code=422,detail=str(exc)) from exc - - @app.get('/state') - async def state(): - return await run_in_threadpool(state_sync) - - def shutdown(): - with lock:env.close() - - - - - original_lifespan=app.router.lifespan_context - - @asynccontextmanager - async def lifespan(application): - async with original_lifespan(application) as state: - try:yield state - finally:await run_in_threadpool(shutdown) - - app.router.lifespan_context=lifespan - return lock diff --git a/components/awm/upstream/README.md b/components/awm/upstream/README.md deleted file mode 100644 index 023df63ad4e6cc41d0765094261c76c1c908d1d4..0000000000000000000000000000000000000000 --- a/components/awm/upstream/README.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -license: "cc-by-4.0" -language: -- en -tags: -- agent -- tool-use -- reinforcement-learning -- mcp -- synthetic -pretty_name: "agent-world-model" -viewer: false ---- - -

AgentWorldModel-1K

- -

Agent World Model: Infinity Synthetic Environments for Agentic Reinforcement Learning

- -

- Zhaoyang Wang1, - Canwen Xu2, - Boyi Liu2, - Yite Wang2, - Siwei Han1,
- Zhewei Yao2, - Huaxiu Yao1, - Yuxiong He2 -

-

- 1UNC-Chapel Hill   2Snowflake AI Research   -

- - - -# Overview - -**AgentWorldModel-1K** contains 1,000 fully synthetic, executable, SQL database-backed tool-use environments exposed via a unified MCP (Model Context Protocol) interface, designed for large-scale multi-turn agentic reinforcement learning. - -Each environment is synthesized through the **Agent World Model (AWM)** pipeline: - -1. **Scenario** — A high-level description (e.g., "an online shopping platform") -2. **Tasks** — 10 user tasks per scenario that serve as functional requirements -3. **Database** — SQLite database schema and sample data as the state backend -4. **Interface** — Python interface layer (FastAPI + MCP) as the action/observation space -5. **Verification** — Verification code that inspects database state changes for reward signals - -For the full synthesis pipeline, please visit [https://github.com/Snowflake-Labs/agent-world-model](https://github.com/Snowflake-Labs/agent-world-model). - -# Resources -Related resources are also available, please check: - -| Resource | Link | -|----------|------| -| 📄 Paper | [📄 arxiv.org/abs/2602.10090](https://arxiv.org/abs/2602.10090) | -| 💻 Code | [💻 Snowflake-Labs/agent-world-model](https://github.com/Snowflake-Labs/agent-world-model) | -| 📦 AgentWorldModel-1K | [🤗 Snowflake/AgentWorldModel-1K](https://huggingface.co/datasets/Snowflake/AgentWorldModel-1K) | -| 🤖 Arctic-AWM-4B | [🤗 Snowflake/Arctic-AWM-4B](https://huggingface.co/Snowflake/Arctic-AWM-4B) | -| 🤖 Arctic-AWM-8B | [🤗 Snowflake/Arctic-AWM-8B](https://huggingface.co/Snowflake/Arctic-AWM-8B) | -| 🤖 Arctic-AWM-14B | [🤗 Snowflake/Arctic-AWM-14B](https://huggingface.co/Snowflake/Arctic-AWM-14B) | - - -# Dataset Files - -| File | #Entries | Description | -|------|----------|-------------| -| `gen_scenario.jsonl` | 1,000 | Synthesized scenario descriptions | -| `gen_tasks.jsonl` | 1,000 | 10 user tasks per scenario | -| `gen_db.jsonl` | 1,000 | Database schema definitions for each scenario | -| `gen_sample.jsonl` | 1,000 | Sample data to populate the initial database state | -| `gen_spec.jsonl` | 1,000 | API specifications for each scenario's interface | -| `gen_envs.jsonl` | 1,000 | MCP environment code (FastAPI + MCP server) | -| `gen_verifier.jsonl` | 10K | Verification code for code-augmented LLM-as-a-Judge | -| `gen_verifier.pure_code.jsonl` | 10K | Verification code for purely code-based Judge | - -# Citation - -If you find this resource useful, please kindly cite: - -```bibtex -@article{wang2026agentworldmodelinfinity, - title={Agent World Model: Infinity Synthetic Environments for Agentic Reinforcement Learning}, - author={Zhaoyang Wang and Canwen Xu and Boyi Liu and Yite Wang and Siwei Han and Zhewei Yao and Huaxiu Yao and Yuxiong He}, - year={2026}, - eprint={2602.10090}, - archivePrefix={arXiv}, - primaryClass={cs.AI}, - url={https://arxiv.org/abs/2602.10090}, -} -``` diff --git a/components/awm/upstream/accounting_1-gen_db.jsonl b/components/awm/upstream/accounting_1-gen_db.jsonl deleted file mode 100644 index 9bd90ff23d72eab13b2342b578624ff33415b15e..0000000000000000000000000000000000000000 --- a/components/awm/upstream/accounting_1-gen_db.jsonl +++ /dev/null @@ -1 +0,0 @@ -{"scenario": "accounting_1", "db_schema": {"tables": [{"name": "users", "ddl": "CREATE TABLE users (\n id INTEGER PRIMARY KEY,\n username TEXT UNIQUE NOT NULL,\n email TEXT UNIQUE NOT NULL,\n full_name TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME\n);", "indexes": ["CREATE INDEX idx_users_email ON users(email);"]}, {"name": "departments", "ddl": "CREATE TABLE departments (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n description TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME\n);", "indexes": ["CREATE UNIQUE INDEX idx_departments_name ON departments(name);"]}, {"name": "tax_categories", "ddl": "CREATE TABLE tax_categories (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n description TEXT,\n rate REAL NOT NULL CHECK(rate >= 0),\n is_compound INTEGER NOT NULL DEFAULT 0 CHECK(is_compound IN (0,1)),\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME\n);", "indexes": ["CREATE UNIQUE INDEX idx_tax_categories_name ON tax_categories(name);"]}, {"name": "payment_terms", "ddl": "CREATE TABLE payment_terms (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n days INTEGER NOT NULL CHECK(days >= 0),\n description TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME\n);", "indexes": ["CREATE UNIQUE INDEX idx_payment_terms_name ON payment_terms(name);"]}, {"name": "customers", "ddl": "CREATE TABLE customers (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n billing_email TEXT,\n payment_terms_id INTEGER,\n default_tax_category_id INTEGER,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (payment_terms_id) REFERENCES payment_terms(id),\n FOREIGN KEY (default_tax_category_id) REFERENCES tax_categories(id)\n);", "indexes": ["CREATE UNIQUE INDEX idx_customers_name ON customers(name);", "CREATE INDEX idx_customers_payment_terms_id ON customers(payment_terms_id);", "CREATE INDEX idx_customers_tax_category_id ON customers(default_tax_category_id);"]}, {"name": "vendors", "ddl": "CREATE TABLE vendors (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n contact_email TEXT,\n payment_terms_id INTEGER,\n default_expense_category_id INTEGER,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (payment_terms_id) REFERENCES payment_terms(id),\n FOREIGN KEY (default_expense_category_id) REFERENCES accounts(id)\n);", "indexes": ["CREATE UNIQUE INDEX idx_vendors_name ON vendors(name);", "CREATE INDEX idx_vendors_payment_terms_id ON vendors(payment_terms_id);", "CREATE INDEX idx_vendors_expense_category_id ON vendors(default_expense_category_id);"]}, {"name": "accounts", "ddl": "CREATE TABLE accounts (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n code TEXT,\n type TEXT NOT NULL CHECK(type IN ('asset','liability','equity','income','expense','contra')), \n sub_type TEXT,\n is_active INTEGER NOT NULL DEFAULT 1 CHECK(is_active IN (0,1)),\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME\n);", "indexes": ["CREATE UNIQUE INDEX idx_accounts_name ON accounts(name);", "CREATE INDEX idx_accounts_type ON accounts(type);"]}, {"name": "bank_accounts", "ddl": "CREATE TABLE bank_accounts (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL UNIQUE,\n institution_name TEXT,\n account_number_masked TEXT,\n account_id INTEGER NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n);", "indexes": ["CREATE UNIQUE INDEX idx_bank_accounts_name ON bank_accounts(name);", "CREATE INDEX idx_bank_accounts_account_id ON bank_accounts(account_id);"]}, {"name": "invoices", "ddl": "CREATE TABLE invoices (\n id INTEGER PRIMARY KEY,\n invoice_number TEXT NOT NULL UNIQUE,\n customer_id INTEGER NOT NULL,\n department_id INTEGER,\n tax_category_id INTEGER,\n invoice_date DATE NOT NULL,\n due_date DATE NOT NULL,\n currency TEXT NOT NULL DEFAULT 'USD',\n status TEXT NOT NULL CHECK(status IN ('draft','open','paid','void')), \n subtotal REAL NOT NULL DEFAULT 0 CHECK(subtotal >= 0),\n tax_amount REAL NOT NULL DEFAULT 0 CHECK(tax_amount >= 0),\n total REAL NOT NULL DEFAULT 0 CHECK(total >= 0),\n balance_due REAL NOT NULL DEFAULT 0,\n payment_terms_id INTEGER,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (department_id) REFERENCES departments(id),\n FOREIGN KEY (tax_category_id) REFERENCES tax_categories(id),\n FOREIGN KEY (payment_terms_id) REFERENCES payment_terms(id)\n);", "indexes": ["CREATE UNIQUE INDEX idx_invoices_invoice_number ON invoices(invoice_number);", "CREATE INDEX idx_invoices_customer_id ON invoices(customer_id);", "CREATE INDEX idx_invoices_department_id ON invoices(department_id);", "CREATE INDEX idx_invoices_tax_category_id ON invoices(tax_category_id);", "CREATE INDEX idx_invoices_invoice_date ON invoices(invoice_date);"]}, {"name": "invoice_line_items", "ddl": "CREATE TABLE invoice_line_items (\n id INTEGER PRIMARY KEY,\n invoice_id INTEGER NOT NULL,\n description TEXT NOT NULL,\n quantity REAL NOT NULL CHECK(quantity > 0),\n unit_price REAL NOT NULL CHECK(unit_price >= 0),\n discount_percent REAL NOT NULL DEFAULT 0 CHECK(discount_percent >= 0 AND discount_percent <= 100),\n line_subtotal REAL NOT NULL DEFAULT 0 CHECK(line_subtotal >= 0),\n tax_amount REAL NOT NULL DEFAULT 0 CHECK(tax_amount >= 0),\n total REAL NOT NULL DEFAULT 0 CHECK(total >= 0),\n revenue_account_id INTEGER,\n department_id INTEGER,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (invoice_id) REFERENCES invoices(id) ON DELETE CASCADE,\n FOREIGN KEY (revenue_account_id) REFERENCES accounts(id),\n FOREIGN KEY (department_id) REFERENCES departments(id)\n);", "indexes": ["CREATE INDEX idx_invoice_line_items_invoice_id ON invoice_line_items(invoice_id);", "CREATE INDEX idx_invoice_line_items_department_id ON invoice_line_items(department_id);"]}, {"name": "payments", "ddl": "CREATE TABLE payments (\n id INTEGER PRIMARY KEY,\n customer_id INTEGER NOT NULL,\n payment_date DATE NOT NULL,\n settlement_date DATE,\n amount REAL NOT NULL CHECK(amount > 0),\n currency TEXT NOT NULL DEFAULT 'USD',\n method TEXT NOT NULL,\n reference TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n);", "indexes": ["CREATE INDEX idx_payments_customer_id ON payments(customer_id);", "CREATE INDEX idx_payments_payment_date ON payments(payment_date);"]}, {"name": "payment_applications", "ddl": "CREATE TABLE payment_applications (\n id INTEGER PRIMARY KEY,\n payment_id INTEGER NOT NULL,\n invoice_id INTEGER NOT NULL,\n amount REAL NOT NULL CHECK(amount > 0),\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (payment_id) REFERENCES payments(id) ON DELETE CASCADE,\n FOREIGN KEY (invoice_id) REFERENCES invoices(id) ON DELETE CASCADE\n);", "indexes": ["CREATE INDEX idx_payment_applications_payment_id ON payment_applications(payment_id);", "CREATE INDEX idx_payment_applications_invoice_id ON payment_applications(invoice_id);"]}, {"name": "bills", "ddl": "CREATE TABLE bills (\n id INTEGER PRIMARY KEY,\n bill_number TEXT,\n vendor_id INTEGER NOT NULL,\n bill_date DATE NOT NULL,\n due_date DATE,\n currency TEXT NOT NULL DEFAULT 'USD',\n amount REAL NOT NULL CHECK(amount >= 0),\n description TEXT,\n department_id INTEGER,\n reimbursement_status TEXT NOT NULL CHECK(reimbursement_status IN ('Not Reimbursable','Reimbursable','Reimbursed')),\n payment_terms_id INTEGER,\n status TEXT NOT NULL DEFAULT 'open' CHECK(status IN ('open','paid','void')),\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (vendor_id) REFERENCES vendors(id),\n FOREIGN KEY (department_id) REFERENCES departments(id),\n FOREIGN KEY (payment_terms_id) REFERENCES payment_terms(id)\n);", "indexes": ["CREATE INDEX idx_bills_vendor_id ON bills(vendor_id);", "CREATE INDEX idx_bills_department_id ON bills(department_id);", "CREATE INDEX idx_bills_bill_date ON bills(bill_date);"]}, {"name": "recurring_expenses", "ddl": "CREATE TABLE recurring_expenses (\n id INTEGER PRIMARY KEY,\n name TEXT NOT NULL,\n vendor_id INTEGER,\n amount REAL NOT NULL CHECK(amount >= 0),\n expense_account_id INTEGER NOT NULL,\n department_id INTEGER,\n frequency TEXT NOT NULL CHECK(frequency IN ('daily','weekly','monthly','quarterly','yearly')),\n next_run_date DATE NOT NULL,\n end_date DATE,\n is_active INTEGER NOT NULL DEFAULT 1 CHECK(is_active IN (0,1)),\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (vendor_id) REFERENCES vendors(id),\n FOREIGN KEY (expense_account_id) REFERENCES accounts(id),\n FOREIGN KEY (department_id) REFERENCES departments(id)\n);", "indexes": ["CREATE INDEX idx_recurring_expenses_vendor_id ON recurring_expenses(vendor_id);", "CREATE INDEX idx_recurring_expenses_next_run_date ON recurring_expenses(next_run_date);", "CREATE INDEX idx_recurring_expenses_department_id ON recurring_expenses(department_id);"]}, {"name": "bank_transactions", "ddl": "CREATE TABLE bank_transactions (\n id INTEGER PRIMARY KEY,\n bank_account_id INTEGER NOT NULL,\n transaction_date DATE NOT NULL,\n posted_date DATE,\n description TEXT NOT NULL,\n amount REAL NOT NULL,\n external_id TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (bank_account_id) REFERENCES bank_accounts(id)\n);", "indexes": ["CREATE INDEX idx_bank_transactions_account_id ON bank_transactions(bank_account_id);", "CREATE INDEX idx_bank_transactions_date ON bank_transactions(transaction_date);"]}, {"name": "journal_entries", "ddl": "CREATE TABLE journal_entries (\n id INTEGER PRIMARY KEY,\n entry_date DATE NOT NULL,\n description TEXT,\n department_id INTEGER,\n source TEXT,\n source_id INTEGER,\n created_by_user_id INTEGER,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (department_id) REFERENCES departments(id),\n FOREIGN KEY (created_by_user_id) REFERENCES users(id)\n);", "indexes": ["CREATE INDEX idx_journal_entries_entry_date ON journal_entries(entry_date);", "CREATE INDEX idx_journal_entries_department_id ON journal_entries(department_id);"]}, {"name": "journal_entry_lines", "ddl": "CREATE TABLE journal_entry_lines (\n id INTEGER PRIMARY KEY,\n journal_entry_id INTEGER NOT NULL,\n account_id INTEGER NOT NULL,\n department_id INTEGER,\n description TEXT,\n debit REAL NOT NULL DEFAULT 0 CHECK(debit >= 0),\n credit REAL NOT NULL DEFAULT 0 CHECK(credit >= 0),\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (journal_entry_id) REFERENCES journal_entries(id) ON DELETE CASCADE,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (department_id) REFERENCES departments(id)\n);", "indexes": ["CREATE INDEX idx_journal_entry_lines_entry_id ON journal_entry_lines(journal_entry_id);", "CREATE INDEX idx_journal_entry_lines_account_id ON journal_entry_lines(account_id);", "CREATE INDEX idx_journal_entry_lines_department_id ON journal_entry_lines(department_id);"]}, {"name": "bank_transaction_journal_links", "ddl": "CREATE TABLE bank_transaction_journal_links (\n id INTEGER PRIMARY KEY,\n bank_transaction_id INTEGER NOT NULL,\n journal_entry_id INTEGER NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY (bank_transaction_id) REFERENCES bank_transactions(id) ON DELETE CASCADE,\n FOREIGN KEY (journal_entry_id) REFERENCES journal_entries(id) ON DELETE CASCADE\n);", "indexes": ["CREATE INDEX idx_bt_journal_links_bt_id ON bank_transaction_journal_links(bank_transaction_id);", "CREATE INDEX idx_bt_journal_links_je_id ON bank_transaction_journal_links(journal_entry_id);"]}, {"name": "recurring_invoices", "ddl": "CREATE TABLE recurring_invoices (\n id INTEGER PRIMARY KEY,\n customer_id INTEGER NOT NULL,\n name TEXT NOT NULL,\n description TEXT,\n quantity REAL NOT NULL CHECK(quantity > 0),\n unit_price REAL NOT NULL CHECK(unit_price >= 0),\n discount_percent REAL NOT NULL DEFAULT 0 CHECK(discount_percent >= 0 AND discount_percent <= 100),\n frequency TEXT NOT NULL CHECK(frequency IN ('daily','weekly','monthly','quarterly','yearly')),\n next_run_date DATE NOT NULL,\n end_date DATE,\n payment_terms_id INTEGER,\n tax_category_id INTEGER,\n department_id INTEGER,\n currency TEXT NOT NULL DEFAULT 'USD',\n is_active INTEGER NOT NULL DEFAULT 1 CHECK(is_active IN (0,1)),\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (payment_terms_id) REFERENCES payment_terms(id),\n FOREIGN KEY (tax_category_id) REFERENCES tax_categories(id),\n FOREIGN KEY (department_id) REFERENCES departments(id)\n);", "indexes": ["CREATE INDEX idx_recurring_invoices_customer_id ON recurring_invoices(customer_id);", "CREATE INDEX idx_recurring_invoices_next_run_date ON recurring_invoices(next_run_date);", "CREATE INDEX idx_recurring_invoices_department_id ON recurring_invoices(department_id);"]}, {"name": "accounting_periods", "ddl": "CREATE TABLE accounting_periods (\n id INTEGER PRIMARY KEY,\n start_date DATE NOT NULL,\n end_date DATE NOT NULL,\n close_date DATE,\n is_locked INTEGER NOT NULL DEFAULT 0 CHECK(is_locked IN (0,1)),\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME,\n CHECK (start_date <= end_date)\n);", "indexes": ["CREATE INDEX idx_accounting_periods_start_end ON accounting_periods(start_date, end_date);", "CREATE INDEX idx_accounting_periods_is_locked ON accounting_periods(is_locked);"]}]}, "db_path": "./outputs/databases/accounting_1.db"} diff --git a/components/awm/upstream/accounting_1-gen_envs.jsonl b/components/awm/upstream/accounting_1-gen_envs.jsonl deleted file mode 100644 index 6d56e0a719a85ee8de01e7efb038cb8ac1ef899f..0000000000000000000000000000000000000000 --- a/components/awm/upstream/accounting_1-gen_envs.jsonl +++ /dev/null @@ -1 +0,0 @@ -{"scenario": "accounting_1", "db_path": "./outputs/databases/accounting_1.db", "full_code": "from fastapi import FastAPI, Query, Path, Body\nfrom pydantic import BaseModel, Field, ConfigDict\nfrom typing import Optional, List, Dict\nfrom datetime import datetime, date\nimport os\nfrom sqlalchemy import (\n create_engine,\n Column,\n Integer,\n String,\n DateTime,\n Date,\n Float,\n Text,\n ForeignKey,\n CheckConstraint,\n Index,\n)\nfrom sqlalchemy.orm import declarative_base, relationship, sessionmaker\n\ndatabase_url = os.getenv(\"DATABASE_PATH\", \"sqlite:///outputs/databases/zenledger_small_business_accounting_suite.db\")\nengine = create_engine(database_url, future=True)\nSessionLocal = sessionmaker(bind=engine, autoflush=False, autocommit=False, future=True)\nBase = declarative_base()\n\nclass User(Base):\n __tablename__ = \"users\"\n id = Column(Integer, primary_key=True)\n username = Column(Text, unique=True, nullable=False)\n email = Column(Text, unique=True, nullable=False)\n full_name = Column(Text)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass Department(Base):\n __tablename__ = \"departments\"\n id = Column(Integer, primary_key=True)\n name = Column(Text, unique=True, nullable=False)\n description = Column(Text)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass TaxCategory(Base):\n __tablename__ = \"tax_categories\"\n id = Column(Integer, primary_key=True)\n name = Column(Text, unique=True, nullable=False)\n description = Column(Text)\n rate = Column(Float, nullable=False)\n is_compound = Column(Integer, nullable=False, default=0)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass PaymentTerm(Base):\n __tablename__ = \"payment_terms\"\n id = Column(Integer, primary_key=True)\n name = Column(Text, unique=True, nullable=False)\n days = Column(Integer, nullable=False)\n description = Column(Text)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass Customer(Base):\n __tablename__ = \"customers\"\n id = Column(Integer, primary_key=True)\n name = Column(Text, unique=True, nullable=False)\n billing_email = Column(Text)\n payment_terms_id = Column(Integer, ForeignKey(\"payment_terms.id\"))\n default_tax_category_id = Column(Integer, ForeignKey(\"tax_categories.id\"))\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass Account(Base):\n __tablename__ = \"accounts\"\n id = Column(Integer, primary_key=True)\n name = Column(Text, unique=True, nullable=False)\n code = Column(Text)\n type = Column(Text, nullable=False)\n sub_type = Column(Text)\n is_active = Column(Integer, nullable=False, default=1)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass Vendor(Base):\n __tablename__ = \"vendors\"\n id = Column(Integer, primary_key=True)\n name = Column(Text, unique=True, nullable=False)\n contact_email = Column(Text)\n payment_terms_id = Column(Integer, ForeignKey(\"payment_terms.id\"))\n default_expense_category_id = Column(Integer, ForeignKey(\"accounts.id\"))\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass BankAccount(Base):\n __tablename__ = \"bank_accounts\"\n id = Column(Integer, primary_key=True)\n name = Column(Text, unique=True, nullable=False)\n institution_name = Column(Text)\n account_number_masked = Column(Text)\n account_id = Column(Integer, ForeignKey(\"accounts.id\"), nullable=False)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass Invoice(Base):\n __tablename__ = \"invoices\"\n id = Column(Integer, primary_key=True)\n invoice_number = Column(Text, unique=True, nullable=False)\n customer_id = Column(Integer, ForeignKey(\"customers.id\"), nullable=False)\n department_id = Column(Integer, ForeignKey(\"departments.id\"))\n tax_category_id = Column(Integer, ForeignKey(\"tax_categories.id\"))\n invoice_date = Column(Date, nullable=False)\n due_date = Column(Date, nullable=False)\n currency = Column(Text, nullable=False, default=\"USD\")\n status = Column(Text, nullable=False)\n subtotal = Column(Float, nullable=False, default=0.0)\n tax_amount = Column(Float, nullable=False, default=0.0)\n total = Column(Float, nullable=False, default=0.0)\n balance_due = Column(Float, nullable=False, default=0.0)\n payment_terms_id = Column(Integer, ForeignKey(\"payment_terms.id\"))\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass InvoiceLineItem(Base):\n __tablename__ = \"invoice_line_items\"\n id = Column(Integer, primary_key=True)\n invoice_id = Column(Integer, ForeignKey(\"invoices.id\", ondelete=\"CASCADE\"), nullable=False)\n description = Column(Text, nullable=False)\n quantity = Column(Float, nullable=False)\n unit_price = Column(Float, nullable=False)\n discount_percent = Column(Float, nullable=False, default=0.0)\n line_subtotal = Column(Float, nullable=False, default=0.0)\n tax_amount = Column(Float, nullable=False, default=0.0)\n total = Column(Float, nullable=False, default=0.0)\n revenue_account_id = Column(Integer, ForeignKey(\"accounts.id\"))\n department_id = Column(Integer, ForeignKey(\"departments.id\"))\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass Payment(Base):\n __tablename__ = \"payments\"\n id = Column(Integer, primary_key=True)\n customer_id = Column(Integer, ForeignKey(\"customers.id\"), nullable=False)\n payment_date = Column(Date, nullable=False)\n settlement_date = Column(Date)\n amount = Column(Float, nullable=False)\n currency = Column(Text, nullable=False, default=\"USD\")\n method = Column(Text, nullable=False)\n reference = Column(Text)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass PaymentApplication(Base):\n __tablename__ = \"payment_applications\"\n id = Column(Integer, primary_key=True)\n payment_id = Column(Integer, ForeignKey(\"payments.id\", ondelete=\"CASCADE\"), nullable=False)\n invoice_id = Column(Integer, ForeignKey(\"invoices.id\", ondelete=\"CASCADE\"), nullable=False)\n amount = Column(Float, nullable=False)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass Bill(Base):\n __tablename__ = \"bills\"\n id = Column(Integer, primary_key=True)\n bill_number = Column(Text)\n vendor_id = Column(Integer, ForeignKey(\"vendors.id\"), nullable=False)\n bill_date = Column(Date, nullable=False)\n due_date = Column(Date)\n currency = Column(Text, nullable=False, default=\"USD\")\n amount = Column(Float, nullable=False)\n description = Column(Text)\n department_id = Column(Integer, ForeignKey(\"departments.id\"))\n reimbursement_status = Column(Text, nullable=False)\n payment_terms_id = Column(Integer, ForeignKey(\"payment_terms.id\"))\n status = Column(Text, nullable=False, default=\"open\")\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass RecurringExpense(Base):\n __tablename__ = \"recurring_expenses\"\n id = Column(Integer, primary_key=True)\n name = Column(Text, nullable=False)\n vendor_id = Column(Integer, ForeignKey(\"vendors.id\"))\n amount = Column(Float, nullable=False)\n expense_account_id = Column(Integer, ForeignKey(\"accounts.id\"), nullable=False)\n department_id = Column(Integer, ForeignKey(\"departments.id\"))\n frequency = Column(Text, nullable=False)\n next_run_date = Column(Date, nullable=False)\n end_date = Column(Date)\n is_active = Column(Integer, nullable=False, default=1)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass BankTransaction(Base):\n __tablename__ = \"bank_transactions\"\n id = Column(Integer, primary_key=True)\n bank_account_id = Column(Integer, ForeignKey(\"bank_accounts.id\"), nullable=False)\n transaction_date = Column(Date, nullable=False)\n posted_date = Column(Date)\n description = Column(Text, nullable=False)\n amount = Column(Float, nullable=False)\n external_id = Column(Text)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass JournalEntry(Base):\n __tablename__ = \"journal_entries\"\n id = Column(Integer, primary_key=True)\n entry_date = Column(Date, nullable=False)\n description = Column(Text)\n department_id = Column(Integer, ForeignKey(\"departments.id\"))\n source = Column(Text)\n source_id = Column(Integer)\n created_by_user_id = Column(Integer, ForeignKey(\"users.id\"))\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass JournalEntryLine(Base):\n __tablename__ = \"journal_entry_lines\"\n id = Column(Integer, primary_key=True)\n journal_entry_id = Column(Integer, ForeignKey(\"journal_entries.id\", ondelete=\"CASCADE\"), nullable=False)\n account_id = Column(Integer, ForeignKey(\"accounts.id\"), nullable=False)\n department_id = Column(Integer, ForeignKey(\"departments.id\"))\n description = Column(Text)\n debit = Column(Float, nullable=False, default=0.0)\n credit = Column(Float, nullable=False, default=0.0)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass BankTransactionJournalLink(Base):\n __tablename__ = \"bank_transaction_journal_links\"\n id = Column(Integer, primary_key=True)\n bank_transaction_id = Column(Integer, ForeignKey(\"bank_transactions.id\", ondelete=\"CASCADE\"), nullable=False)\n journal_entry_id = Column(Integer, ForeignKey(\"journal_entries.id\", ondelete=\"CASCADE\"), nullable=False)\n created_at = Column(DateTime, default=datetime.utcnow)\n\nclass RecurringInvoice(Base):\n __tablename__ = \"recurring_invoices\"\n id = Column(Integer, primary_key=True)\n customer_id = Column(Integer, ForeignKey(\"customers.id\"), nullable=False)\n name = Column(Text, nullable=False)\n description = Column(Text)\n quantity = Column(Float, nullable=False)\n unit_price = Column(Float, nullable=False)\n discount_percent = Column(Float, nullable=False, default=0.0)\n frequency = Column(Text, nullable=False)\n next_run_date = Column(Date, nullable=False)\n end_date = Column(Date)\n payment_terms_id = Column(Integer, ForeignKey(\"payment_terms.id\"))\n tax_category_id = Column(Integer, ForeignKey(\"tax_categories.id\"))\n department_id = Column(Integer, ForeignKey(\"departments.id\"))\n currency = Column(Text, nullable=False, default=\"USD\")\n is_active = Column(Integer, nullable=False, default=1)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nclass AccountingPeriod(Base):\n __tablename__ = \"accounting_periods\"\n id = Column(Integer, primary_key=True)\n start_date = Column(Date, nullable=False)\n end_date = Column(Date, nullable=False)\n close_date = Column(Date)\n is_locked = Column(Integer, nullable=False, default=0)\n created_at = Column(DateTime, default=datetime.utcnow)\n updated_at = Column(DateTime)\n\nIndex(\"idx_users_email\", User.email)\nIndex(\"idx_departments_name\", Department.name, unique=True)\nIndex(\"idx_tax_categories_name\", TaxCategory.name, unique=True)\nIndex(\"idx_payment_terms_name\", PaymentTerm.name, unique=True)\nIndex(\"idx_customers_name\", Customer.name, unique=True)\nIndex(\"idx_customers_payment_terms_id\", Customer.payment_terms_id)\nIndex(\"idx_customers_tax_category_id\", Customer.default_tax_category_id)\nIndex(\"idx_vendors_name\", Vendor.name, unique=True)\nIndex(\"idx_vendors_payment_terms_id\", Vendor.payment_terms_id)\nIndex(\"idx_vendors_expense_category_id\", Vendor.default_expense_category_id)\nIndex(\"idx_accounts_name\", Account.name, unique=True)\nIndex(\"idx_accounts_type\", Account.type)\nIndex(\"idx_bank_accounts_name\", BankAccount.name, unique=True)\nIndex(\"idx_bank_accounts_account_id\", BankAccount.account_id)\nIndex(\"idx_invoices_invoice_number\", Invoice.invoice_number, unique=True)\nIndex(\"idx_invoices_customer_id\", Invoice.customer_id)\nIndex(\"idx_invoices_department_id\", Invoice.department_id)\nIndex(\"idx_invoices_tax_category_id\", Invoice.tax_category_id)\nIndex(\"idx_invoices_invoice_date\", Invoice.invoice_date)\nIndex(\"idx_invoice_line_items_invoice_id\", InvoiceLineItem.invoice_id)\nIndex(\"idx_invoice_line_items_department_id\", InvoiceLineItem.department_id)\nIndex(\"idx_payments_customer_id\", Payment.customer_id)\nIndex(\"idx_payments_payment_date\", Payment.payment_date)\nIndex(\"idx_payment_applications_payment_id\", PaymentApplication.payment_id)\nIndex(\"idx_payment_applications_invoice_id\", PaymentApplication.invoice_id)\nIndex(\"idx_bills_vendor_id\", Bill.vendor_id)\nIndex(\"idx_bills_department_id\", Bill.department_id)\nIndex(\"idx_bills_bill_date\", Bill.bill_date)\nIndex(\"idx_recurring_expenses_vendor_id\", RecurringExpense.vendor_id)\nIndex(\"idx_recurring_expenses_next_run_date\", RecurringExpense.next_run_date)\nIndex(\"idx_recurring_expenses_department_id\", RecurringExpense.department_id)\nIndex(\"idx_bank_transactions_account_id\", BankTransaction.bank_account_id)\nIndex(\"idx_bank_transactions_date\", BankTransaction.transaction_date)\nIndex(\"idx_journal_entries_entry_date\", JournalEntry.entry_date)\nIndex(\"idx_journal_entries_department_id\", JournalEntry.department_id)\nIndex(\"idx_journal_entry_lines_entry_id\", JournalEntryLine.journal_entry_id)\nIndex(\"idx_journal_entry_lines_account_id\", JournalEntryLine.account_id)\nIndex(\"idx_journal_entry_lines_department_id\", JournalEntryLine.department_id)\nIndex(\"idx_bt_journal_links_bt_id\", BankTransactionJournalLink.bank_transaction_id)\nIndex(\"idx_bt_journal_links_je_id\", BankTransactionJournalLink.journal_entry_id)\nIndex(\"idx_recurring_invoices_customer_id\", RecurringInvoice.customer_id)\nIndex(\"idx_recurring_invoices_next_run_date\", RecurringInvoice.next_run_date)\nIndex(\"idx_recurring_invoices_department_id\", RecurringInvoice.department_id)\nIndex(\"idx_accounting_periods_start_end\", AccountingPeriod.start_date, AccountingPeriod.end_date)\nIndex(\"idx_accounting_periods_is_locked\", AccountingPeriod.is_locked)\n\nBase.metadata.create_all(engine)\n\napp = FastAPI(title=\"ZenLedger Small Business Accounting Suite API\", version=\"1.0.0\")\n\nclass CustomerCreateRequest(BaseModel):\n name: str = Field(..., description=\"Customer legal or display name (must be unique)\", example=\"Acme Design Studio\")\n billing_email: Optional[str] = Field(None, description=\"Primary billing email address for invoices\", example=\"billing@acmedesign.com\")\n payment_terms_id: Optional[int] = Field(None, description=\"ID of payment_terms row to use as default terms\", example=2)\n default_tax_category_id: Optional[int] = Field(None, description=\"ID of tax_categories row used as default customer tax\", example=1)\n\nclass CustomerResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Unique customer identifier\", example=10)\n name: str = Field(..., description=\"Customer name\", example=\"Acme Design Studio\")\n billing_email: Optional[str] = Field(None, description=\"Customer billing email\", example=\"billing@acmedesign.com\")\n payment_terms_id: Optional[int] = Field(None, description=\"Linked payment_terms.id or null\", example=3)\n default_tax_category_id: Optional[int] = Field(None, description=\"Linked tax_categories.id or null\", example=1)\n created_at: Optional[datetime] = Field(None, description=\"Timestamp when customer was created (ISO 8601)\", example=\"2025-01-04T10:15:23Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Timestamp for last update or null\", example=None)\n\nclass CustomersListResponse(BaseModel):\n customers: List[CustomerResponse] = Field(..., description=\"List of customers\", example=[])\n\nclass PaymentTermResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Payment terms ID\", example=3)\n name: str = Field(..., description=\"Name of payment terms\", example=\"Net 30\")\n days: int = Field(..., description=\"Number of days from invoice date to due date\", example=30)\n description: Optional[str] = Field(None, description=\"Optional description\", example=\"Payment due 30 days from invoice date\")\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2024-01-01T00:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Last update timestamp\", example=None)\n\nclass PaymentTermsListResponse(BaseModel):\n payment_terms: List[PaymentTermResponse] = Field(..., description=\"List of payment terms\", example=[])\n\nclass TaxCategoryResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Tax category ID\", example=1)\n name: str = Field(..., description=\"Tax category name\", example=\"Standard Sales Tax 8.5%\")\n description: Optional[str] = Field(None, description=\"Optional description of when this tax applies\", example=\"Standard local sales tax\")\n rate: float = Field(..., description=\"Tax rate as decimal (e.g., 0.085 for 8.5%)\", example=0.085)\n is_compound: bool = Field(..., description=\"True if tax is compounded with other taxes\", example=False)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2024-01-01T00:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Last update timestamp\", example=None)\n\nclass TaxCategoriesListResponse(BaseModel):\n tax_categories: List[TaxCategoryResponse] = Field(..., description=\"List of tax categories\", example=[])\n\nclass DepartmentResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Department ID\", example=2)\n name: str = Field(..., description=\"Department name\", example=\"Design\")\n description: Optional[str] = Field(None, description=\"Optional department description\", example=\"Design and creative services\")\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2024-01-01T00:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Last update timestamp\", example=None)\n\nclass DepartmentsListResponse(BaseModel):\n departments: List[DepartmentResponse] = Field(..., description=\"List of departments\", example=[])\n\nclass AccountResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Account ID\", example=50)\n name: str = Field(..., description=\"Account name\", example=\"Software Subscriptions\")\n code: Optional[str] = Field(None, description=\"Optional account code\", example=\"6100\")\n type: str = Field(..., description=\"High-level account type\", example=\"expense\")\n sub_type: Optional[str] = Field(None, description=\"Optional subtype classification\", example=\"Operating Expense\")\n is_active: bool = Field(..., description=\"Whether account can be posted to\", example=True)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2024-01-01T00:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Last update timestamp\", example=None)\n\nclass AccountsListResponse(BaseModel):\n accounts: List[AccountResponse] = Field(..., description=\"List of accounts\", example=[])\n\nclass BankAccountResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Bank account ID\", example=1)\n name: str = Field(..., description=\"Display name for the bank account\", example=\"Chase Business Checking ****1023\")\n institution_name: Optional[str] = Field(None, description=\"Financial institution name\", example=\"Chase\")\n account_number_masked: Optional[str] = Field(None, description=\"Masked bank account number\", example=\"****1023\")\n account_id: int = Field(..., description=\"Linked GL account ID\", example=101)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2024-01-01T00:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Last update timestamp\", example=None)\n\nclass BankAccountsListResponse(BaseModel):\n bank_accounts: List[BankAccountResponse] = Field(..., description=\"List of bank accounts\", example=[])\n\nclass InvoiceCreateRequest(BaseModel):\n invoice_number: str = Field(..., description=\"Unique invoice number\", example=\"INV-2025-001\")\n customer_id: int = Field(..., description=\"Customer ID that this invoice belongs to\", example=10)\n invoice_date: str = Field(..., description=\"Invoice date in ISO format YYYY-MM-DD\", example=\"2025-01-05\")\n due_date: str = Field(..., description=\"Due date in ISO format YYYY-MM-DD\", example=\"2025-02-04\")\n department_id: Optional[int] = Field(None, description=\"Department responsible for this invoice\", example=2)\n tax_category_id: Optional[int] = Field(None, description=\"Tax category applied at invoice level\", example=1)\n payment_terms_id: Optional[int] = Field(None, description=\"Payment terms to apply; defaults to customer terms if omitted\", example=3)\n currency: Optional[str] = Field(\"USD\", description=\"Currency code, defaults to USD\", example=\"USD\")\n status: Optional[str] = Field(\"draft\", description=\"Initial status (draft or open)\", example=\"open\")\n\nclass InvoiceResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Invoice ID\", example=1001)\n invoice_number: str = Field(..., description=\"Unique invoice number\", example=\"INV-2025-001\")\n customer_id: int = Field(..., description=\"Linked customer ID\", example=10)\n department_id: Optional[int] = Field(None, description=\"Linked department ID\", example=2)\n tax_category_id: Optional[int] = Field(None, description=\"Linked tax category ID\", example=1)\n invoice_date: date = Field(..., description=\"Invoice date\", example=\"2025-01-05\")\n due_date: date = Field(..., description=\"Due date\", example=\"2025-02-04\")\n currency: str = Field(..., description=\"Currency code\", example=\"USD\")\n status: str = Field(..., description=\"Invoice status\", example=\"open\")\n subtotal: float = Field(..., description=\"Sum of line_subtotals before tax\", example=2000.0)\n tax_amount: float = Field(..., description=\"Total tax applied to invoice\", example=170.0)\n total: float = Field(..., description=\"Invoice total including tax\", example=2170.0)\n balance_due: float = Field(..., description=\"Remaining balance due on invoice\", example=2170.0)\n payment_terms_id: Optional[int] = Field(None, description=\"Linked payment_terms ID\", example=3)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-05T09:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass InvoiceLineItemCreateRequest(BaseModel):\n invoice_id: int = Field(..., description=\"ID of the invoice this line belongs to\", example=1001)\n description: str = Field(..., description=\"Description of the product or service\", example=\"Logo redesign\")\n quantity: float = Field(..., description=\"Quantity of units sold\", example=1.0)\n unit_price: float = Field(..., description=\"Price per unit\", example=1200.0)\n discount_percent: Optional[float] = Field(0.0, description=\"Discount percentage applied to this line\", example=10.0)\n revenue_account_id: Optional[int] = Field(None, description=\"Revenue account to credit for this line\", example=400)\n department_id: Optional[int] = Field(None, description=\"Department for this line; overrides invoice department\", example=2)\n\nclass InvoiceLineItemResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Invoice line item ID\", example=5001)\n invoice_id: int = Field(..., description=\"Parent invoice ID\", example=1001)\n description: str = Field(..., description=\"Line item description\", example=\"Logo redesign\")\n quantity: float = Field(..., description=\"Quantity\", example=1.0)\n unit_price: float = Field(..., description=\"Unit price\", example=1200.0)\n discount_percent: float = Field(..., description=\"Discount percent\", example=0.0)\n line_subtotal: float = Field(..., description=\"Subtotal before tax for this line\", example=1200.0)\n tax_amount: float = Field(..., description=\"Tax for this line\", example=102.0)\n total: float = Field(..., description=\"Total including tax for this line\", example=1302.0)\n revenue_account_id: Optional[int] = Field(None, description=\"Linked revenue account ID\", example=400)\n department_id: Optional[int] = Field(None, description=\"Linked department ID\", example=2)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-05T09:10:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass InvoiceRecalculateTotalsResponse(BaseModel):\n invoice_id: int = Field(..., description=\"Invoice ID\", example=1001)\n subtotal: float = Field(..., description=\"Updated subtotal\", example=2000.0)\n tax_amount: float = Field(..., description=\"Updated tax amount\", example=170.0)\n total: float = Field(..., description=\"Updated total\", example=2170.0)\n balance_due: float = Field(..., description=\"Updated balance due after payments\", example=1270.0)\n\nclass InvoicesListItemResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Invoice ID\", example=1001)\n invoice_number: str = Field(..., description=\"Invoice number\", example=\"INV-2025-001\")\n customer_id: int = Field(..., description=\"Customer ID\", example=10)\n invoice_date: date = Field(..., description=\"Invoice date\", example=\"2025-01-05\")\n due_date: date = Field(..., description=\"Due date\", example=\"2025-02-04\")\n status: str = Field(..., description=\"Invoice status\", example=\"open\")\n subtotal: float = Field(..., description=\"Subtotal amount\", example=2000.0)\n tax_amount: float = Field(..., description=\"Tax amount\", example=170.0)\n total: float = Field(..., description=\"Total invoice amount\", example=2170.0)\n balance_due: float = Field(..., description=\"Outstanding balance\", example=1270.0)\n department_id: Optional[int] = Field(None, description=\"Linked department ID\", example=2)\n tax_category_id: Optional[int] = Field(None, description=\"Linked tax category ID\", example=1)\n payment_terms_id: Optional[int] = Field(None, description=\"Linked payment terms ID\", example=3)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-05T09:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Last update timestamp\", example=\"2025-01-10T10:00:00Z\")\n\nclass InvoicesListResponse(BaseModel):\n invoices: List[InvoicesListItemResponse] = Field(..., description=\"List of invoices\", example=[])\n\nclass PaymentCreateRequest(BaseModel):\n customer_id: int = Field(..., description=\"Customer who made the payment\", example=10)\n payment_date: str = Field(..., description=\"Date payment was received (YYYY-MM-DD)\", example=\"2025-01-10\")\n settlement_date: Optional[str] = Field(None, description=\"Date payment settled in bank (YYYY-MM-DD)\", example=\"2025-01-10\")\n amount: float = Field(..., description=\"Gross payment amount\", example=900.0)\n currency: Optional[str] = Field(\"USD\", description=\"Currency code (defaults to USD)\", example=\"USD\")\n method: str = Field(..., description=\"Payment method description\", example=\"Credit Card\")\n reference: Optional[str] = Field(None, description=\"External reference or transaction ID\", example=\"STRIPE-12345\")\n\nclass PaymentResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Payment ID\", example=2001)\n customer_id: int = Field(..., description=\"Customer ID\", example=10)\n payment_date: date = Field(..., description=\"Payment date\", example=\"2025-01-10\")\n settlement_date: Optional[date] = Field(None, description=\"Settlement date\", example=\"2025-01-10\")\n amount: float = Field(..., description=\"Payment amount\", example=900.0)\n currency: str = Field(..., description=\"Payment currency\", example=\"USD\")\n method: str = Field(..., description=\"Payment method\", example=\"Credit Card\")\n reference: Optional[str] = Field(None, description=\"External reference ID\", example=\"STRIPE-12345\")\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-10T12:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass PaymentApplicationCreateRequest(BaseModel):\n payment_id: int = Field(..., description=\"Payment to allocate\", example=2001)\n invoice_id: int = Field(..., description=\"Invoice receiving this payment portion\", example=1001)\n amount: float = Field(..., description=\"Amount applied from payment to invoice\", example=900.0)\n\nclass PaymentApplicationResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Payment application ID\", example=3001)\n payment_id: int = Field(..., description=\"Linked payment ID\", example=2001)\n invoice_id: int = Field(..., description=\"Linked invoice ID\", example=1001)\n amount: float = Field(..., description=\"Amount applied\", example=900.0)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-10T12:05:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass VendorCreateRequest(BaseModel):\n name: str = Field(..., description=\"Vendor legal or display name\", example=\"PixelPrint Supplies\")\n contact_email: Optional[str] = Field(None, description=\"Vendor accounts payable contact email\", example=\"accounts@pixelprint.com\")\n payment_terms_id: Optional[int] = Field(None, description=\"Default payment terms for this vendor\", example=2)\n default_expense_category_id: Optional[int] = Field(None, description=\"Default expense account for purchases from this vendor\", example=60)\n\nclass VendorResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Vendor ID\", example=20)\n name: str = Field(..., description=\"Vendor name\", example=\"PixelPrint Supplies\")\n contact_email: Optional[str] = Field(None, description=\"Vendor email\", example=\"accounts@pixelprint.com\")\n payment_terms_id: Optional[int] = Field(None, description=\"Linked payment_terms ID\", example=2)\n default_expense_category_id: Optional[int] = Field(None, description=\"Linked default expense account ID\", example=60)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-03T08:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass VendorsListResponse(BaseModel):\n vendors: List[VendorResponse] = Field(..., description=\"List of vendors\", example=[])\n\nclass BillCreateRequest(BaseModel):\n bill_number: Optional[str] = Field(None, description=\"Vendor-provided bill or invoice number\", example=\"BILL-2025-001\")\n vendor_id: int = Field(..., description=\"Vendor this bill is from\", example=20)\n bill_date: str = Field(..., description=\"Date on the vendor bill (YYYY-MM-DD)\", example=\"2025-01-03\")\n due_date: Optional[str] = Field(None, description=\"Due date if known (YYYY-MM-DD)\", example=\"2025-01-18\")\n currency: Optional[str] = Field(\"USD\", description=\"Bill currency code\", example=\"USD\")\n amount: float = Field(..., description=\"Total bill amount\", example=325.5)\n description: Optional[str] = Field(None, description=\"Description of the bill or purpose\", example=\"Printer ink and paper\")\n department_id: Optional[int] = Field(None, description=\"Department to expense this bill to\", example=3)\n reimbursement_status: str = Field(..., description=\"Reimbursement status (Not Reimbursable, Reimbursable, Reimbursed)\", example=\"Not Reimbursable\")\n payment_terms_id: Optional[int] = Field(None, description=\"Payment terms used for due_date calculation\", example=1)\n status: Optional[str] = Field(\"open\", description=\"Bill status (open, paid, void)\", example=\"open\")\n\nclass BillResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Bill ID\", example=7001)\n bill_number: Optional[str] = Field(None, description=\"Vendor bill number\", example=\"BILL-2025-001\")\n vendor_id: int = Field(..., description=\"Vendor ID\", example=20)\n bill_date: date = Field(..., description=\"Bill date\", example=\"2025-01-03\")\n due_date: Optional[date] = Field(None, description=\"Due date\", example=\"2025-01-18\")\n currency: str = Field(..., description=\"Currency code\", example=\"USD\")\n amount: float = Field(..., description=\"Bill amount\", example=325.5)\n description: Optional[str] = Field(None, description=\"Bill description\", example=\"Printer ink and paper\")\n department_id: Optional[int] = Field(None, description=\"Department ID\", example=3)\n reimbursement_status: str = Field(..., description=\"Reimbursement status\", example=\"Not Reimbursable\")\n payment_terms_id: Optional[int] = Field(None, description=\"Payment terms ID\", example=1)\n status: str = Field(..., description=\"Bill status\", example=\"open\")\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-03T09:30:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass RecurringExpenseCreateRequest(BaseModel):\n name: str = Field(..., description=\"Name of the recurring expense\", example=\"Monthly Co-working Space Rent\")\n vendor_id: Optional[int] = Field(None, description=\"Vendor providing the recurring service\", example=30)\n amount: float = Field(..., description=\"Recurring amount for each run\", example=650.0)\n expense_account_id: int = Field(..., description=\"Expense account ID to debit\", example=80)\n department_id: Optional[int] = Field(None, description=\"Department that bears this recurring expense\", example=4)\n frequency: str = Field(..., description=\"Run frequency (daily, weekly, monthly, quarterly, yearly)\", example=\"monthly\")\n next_run_date: str = Field(..., description=\"Next date the template should generate an expense (YYYY-MM-DD)\", example=\"2025-02-01\")\n end_date: Optional[str] = Field(None, description=\"Date after which no more runs occur\", example=\"2025-12-01\")\n is_active: Optional[bool] = Field(True, description=\"Whether this template is active\", example=True)\n\nclass RecurringExpenseResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Recurring expense template ID\", example=9001)\n name: str = Field(..., description=\"Template name\", example=\"Monthly Co-working Space Rent\")\n vendor_id: Optional[int] = Field(None, description=\"Vendor ID\", example=30)\n amount: float = Field(..., description=\"Recurring amount\", example=650.0)\n expense_account_id: int = Field(..., description=\"Expense account ID\", example=80)\n department_id: Optional[int] = Field(None, description=\"Department ID\", example=4)\n frequency: str = Field(..., description=\"Frequency\", example=\"monthly\")\n next_run_date: date = Field(..., description=\"Next run date\", example=\"2025-02-01\")\n end_date: Optional[date] = Field(None, description=\"End date\", example=\"2025-12-01\")\n is_active: bool = Field(..., description=\"Whether template is active\", example=True)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-15T09:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass BankTransactionItemRequest(BaseModel):\n transaction_date: str = Field(..., description=\"Transaction date (YYYY-MM-DD)\", example=\"2025-01-01\")\n posted_date: Optional[str] = Field(None, description=\"Posted date (YYYY-MM-DD)\", example=\"2025-01-02\")\n description: str = Field(..., description=\"Bank description\", example=\"Client payment ACME\")\n amount: float = Field(..., description=\"Transaction amount (positive or negative)\", example=1500.0)\n external_id: Optional[str] = Field(None, description=\"External bank transaction identifier\", example=\"txn_001\")\n\nclass BankTransactionsBatchImportRequest(BaseModel):\n bank_account_id: int = Field(..., description=\"Bank account ID these transactions belong to\", example=1)\n transactions: List[BankTransactionItemRequest] = Field(..., description=\"Array of bank transactions to import\", example=[])\n\nclass BankTransactionResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Bank transaction ID\", example=6001)\n bank_account_id: int = Field(..., description=\"Bank account ID\", example=1)\n transaction_date: date = Field(..., description=\"Transaction date\", example=\"2025-01-01\")\n posted_date: Optional[date] = Field(None, description=\"Posted date\", example=\"2025-01-02\")\n description: str = Field(..., description=\"Transaction description\", example=\"Client payment ACME\")\n amount: float = Field(..., description=\"Transaction amount\", example=1500.0)\n external_id: Optional[str] = Field(None, description=\"External transaction ID\", example=\"txn_001\")\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-07T10:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass BankTransactionsBatchImportResponse(BaseModel):\n bank_transactions: List[BankTransactionResponse] = Field(..., description=\"Imported bank transactions\", example=[])\n\nclass BankTransactionsListResponse(BaseModel):\n bank_transactions: List[BankTransactionResponse] = Field(..., description=\"List of bank transactions\", example=[])\n\nclass JournalEntryCreateRequest(BaseModel):\n entry_date: str = Field(..., description=\"Date of the journal entry (YYYY-MM-DD)\", example=\"2024-12-31\")\n description: Optional[str] = Field(None, description=\"Narrative description of the entry\", example=\"Year-end accrual for expenses\")\n department_id: Optional[int] = Field(None, description=\"Department that this entry belongs to\", example=4)\n source: Optional[str] = Field(None, description=\"System source of this entry\", example=\"manual\")\n source_id: Optional[int] = Field(None, description=\"External source ID if applicable\", example=None)\n\nclass JournalEntryResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Journal entry ID\", example=8001)\n entry_date: date = Field(..., description=\"Entry date\", example=\"2024-12-31\")\n description: Optional[str] = Field(None, description=\"Entry description\", example=\"Year-end accrual for expenses\")\n department_id: Optional[int] = Field(None, description=\"Department ID\", example=4)\n source: Optional[str] = Field(None, description=\"Source system\", example=\"manual\")\n source_id: Optional[int] = Field(None, description=\"Source record ID\", example=None)\n created_by_user_id: Optional[int] = Field(None, description=\"User who created the entry (always 1)\", example=1)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2024-12-31T23:50:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass JournalEntryLineCreateRequest(BaseModel):\n journal_entry_id: int = Field(..., description=\"Parent journal entry ID\", example=8001)\n account_id: int = Field(..., description=\"Account to debit or credit\", example=50)\n department_id: Optional[int] = Field(None, description=\"Department for this line if different from header\", example=4)\n description: Optional[str] = Field(None, description=\"Line-specific description\", example=\"Accrual for December software expenses\")\n debit: Optional[float] = Field(0.0, description=\"Debit amount (0 if this is a credit line)\", example=300.0)\n credit: Optional[float] = Field(0.0, description=\"Credit amount (0 if this is a debit line)\", example=0.0)\n\nclass JournalEntryLineResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Journal entry line ID\", example=8101)\n journal_entry_id: int = Field(..., description=\"Parent journal entry ID\", example=8001)\n account_id: int = Field(..., description=\"Account ID\", example=50)\n department_id: Optional[int] = Field(None, description=\"Department ID\", example=4)\n description: Optional[str] = Field(None, description=\"Line description\", example=\"Accrual for December software expenses\")\n debit: float = Field(..., description=\"Debit amount\", example=300.0)\n credit: float = Field(..., description=\"Credit amount\", example=0.0)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2024-12-31T23:51:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass BankTransactionJournalLinkCreateRequest(BaseModel):\n bank_transaction_id: int = Field(..., description=\"Bank transaction ID being reconciled\", example=6001)\n journal_entry_id: int = Field(..., description=\"Journal entry ID representing the accounting for this transaction\", example=8005)\n\nclass BankTransactionJournalLinkResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Link ID\", example=90001)\n bank_transaction_id: int = Field(..., description=\"Bank transaction ID\", example=6001)\n journal_entry_id: int = Field(..., description=\"Journal entry ID\", example=8005)\n created_at: Optional[datetime] = Field(None, description=\"Link creation timestamp\", example=\"2025-01-07T11:00:00Z\")\n\nclass RecurringInvoiceCreateRequest(BaseModel):\n customer_id: int = Field(..., description=\"Customer who will receive recurring invoices\", example=15)\n name: str = Field(..., description=\"Name of the recurring invoice template\", example=\"Monthly SEO Retainer\")\n description: Optional[str] = Field(None, description=\"Description of the service or product\", example=\"Monthly SEO services retainer\")\n quantity: float = Field(..., description=\"Quantity per recurring invoice\", example=1.0)\n unit_price: float = Field(..., description=\"Unit price per run\", example=1500.0)\n discount_percent: Optional[float] = Field(0.0, description=\"Discount percent per run\", example=0.0)\n frequency: str = Field(..., description=\"Frequency (daily, weekly, monthly, quarterly, yearly)\", example=\"monthly\")\n next_run_date: str = Field(..., description=\"Date of next invoice generation (YYYY-MM-DD)\", example=\"2025-02-01\")\n end_date: Optional[str] = Field(None, description=\"Final date for invoice generation\", example=\"2025-07-01\")\n payment_terms_id: Optional[int] = Field(None, description=\"Payment terms applied to generated invoices\", example=4)\n tax_category_id: Optional[int] = Field(None, description=\"Tax category for generated invoices\", example=5)\n department_id: Optional[int] = Field(None, description=\"Department for generated invoices\", example=2)\n currency: Optional[str] = Field(\"USD\", description=\"Currency for generated invoices\", example=\"USD\")\n is_active: Optional[bool] = Field(True, description=\"Whether this recurring schedule is active\", example=True)\n\nclass RecurringInvoiceResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Recurring invoice template ID\", example=9501)\n customer_id: int = Field(..., description=\"Customer ID\", example=15)\n name: str = Field(..., description=\"Template name\", example=\"Monthly SEO Retainer\")\n description: Optional[str] = Field(None, description=\"Template description\", example=\"Monthly SEO services retainer\")\n quantity: float = Field(..., description=\"Quantity per invoice\", example=1.0)\n unit_price: float = Field(..., description=\"Unit price\", example=1500.0)\n discount_percent: float = Field(..., description=\"Discount percent\", example=0.0)\n frequency: str = Field(..., description=\"Frequency\", example=\"monthly\")\n next_run_date: date = Field(..., description=\"Next run date\", example=\"2025-02-01\")\n end_date: Optional[date] = Field(None, description=\"End date\", example=\"2025-07-01\")\n payment_terms_id: Optional[int] = Field(None, description=\"Payment terms ID\", example=4)\n tax_category_id: Optional[int] = Field(None, description=\"Tax category ID\", example=5)\n department_id: Optional[int] = Field(None, description=\"Department ID\", example=2)\n currency: str = Field(..., description=\"Currency\", example=\"USD\")\n is_active: bool = Field(..., description=\"Whether template is active\", example=True)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2025-01-20T09:00:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass AccountingPeriodCreateRequest(BaseModel):\n start_date: str = Field(..., description=\"Start date of the period (YYYY-MM-DD)\", example=\"2024-01-01\")\n end_date: str = Field(..., description=\"End date of the period (YYYY-MM-DD)\", example=\"2024-12-31\")\n close_date: Optional[str] = Field(None, description=\"Date when the period was closed\", example=\"2024-12-31\")\n is_locked: Optional[bool] = Field(False, description=\"Whether the period is locked against changes\", example=True)\n\nclass AccountingPeriodUpdateRequest(BaseModel):\n close_date: Optional[str] = Field(None, description=\"New close date or null to clear\", example=\"2024-12-31\")\n is_locked: Optional[bool] = Field(None, description=\"Set true to lock or false to unlock\", example=True)\n\nclass AccountingPeriodResponse(BaseModel):\n model_config = ConfigDict(from_attributes=True)\n id: int = Field(..., description=\"Accounting period ID\", example=10001)\n start_date: date = Field(..., description=\"Start date\", example=\"2024-01-01\")\n end_date: date = Field(..., description=\"End date\", example=\"2024-12-31\")\n close_date: Optional[date] = Field(None, description=\"Close date or null\", example=\"2024-12-31\")\n is_locked: bool = Field(..., description=\"Locked flag\", example=True)\n created_at: Optional[datetime] = Field(None, description=\"Creation timestamp\", example=\"2024-12-31T23:55:00Z\")\n updated_at: Optional[datetime] = Field(None, description=\"Update timestamp\", example=None)\n\nclass ProfitAndLossReportResponse(BaseModel):\n start_date: str = Field(..., description=\"Report start date\", example=\"2025-01-01\")\n end_date: str = Field(..., description=\"Report end date\", example=\"2025-01-31\")\n department_id: Optional[int] = Field(None, description=\"Department filter or null if not filtered\", example=2)\n total_revenue: float = Field(..., description=\"Sum of income account balances for the period\", example=5000.0)\n total_expenses: float = Field(..., description=\"Sum of expense account balances for the period\", example=3000.0)\n net_profit: float = Field(..., description=\"total_revenue - total_expenses\", example=2000.0)\n detail: Dict[str, List[Dict[str, Optional[float]]]] = Field(..., description=\"Optional breakdown of accounts\", example={\"income_accounts\": [], \"expense_accounts\": []})\n\n@app.post(\n \"/api/customers\",\n response_model=CustomerResponse,\n summary=\"Create a new customer\",\n description=\"Create a customer with optional payment terms and tax category.\",\n tags=[\"customers\"],\n operation_id=\"create_customer\",\n)\nasync def create_customer_endpoint(body: CustomerCreateRequest = Body(...)) -> CustomerResponse:\n session = SessionLocal()\n customer = Customer(\n name=body.name,\n billing_email=body.billing_email,\n payment_terms_id=body.payment_terms_id,\n default_tax_category_id=body.default_tax_category_id,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(customer)\n session.commit()\n session.refresh(customer)\n session.close()\n return CustomerResponse(\n id=customer.id,\n name=customer.name,\n billing_email=customer.billing_email,\n payment_terms_id=customer.payment_terms_id,\n default_tax_category_id=customer.default_tax_category_id,\n created_at=customer.created_at,\n updated_at=customer.updated_at,\n )\n\n@app.get(\n \"/api/customers\",\n response_model=CustomersListResponse,\n summary=\"List customers with optional filters\",\n description=\"Retrieve customers filtered by name or billing email.\",\n tags=[\"customers\"],\n operation_id=\"list_customers\",\n)\nasync def list_customers_endpoint(\n name: Optional[str] = Query(None, description=\"Filter by exact or partial customer name\", example=\"Acme\"),\n billing_email: Optional[str] = Query(None, description=\"Filter customers by billing_email exact match\", example=\"billing@acmedesign.com\"),\n limit: Optional[int] = Query(50, description=\"Maximum number of records to return\", example=50),\n offset: Optional[int] = Query(0, description=\"Number of records to skip for pagination\", example=0),\n) -> CustomersListResponse:\n session = SessionLocal()\n query = session.query(Customer)\n if name is not None:\n query = query.filter(Customer.name.contains(name))\n if billing_email is not None:\n query = query.filter(Customer.billing_email == billing_email)\n customers = query.offset(offset).limit(limit).all()\n session.close()\n return CustomersListResponse(customers=customers)\n\n@app.get(\n \"/api/customers/{customer_id}\",\n response_model=CustomerResponse,\n summary=\"Get a single customer by ID\",\n description=\"Fetch one customer by ID to inspect billing settings.\",\n tags=[\"customers\"],\n operation_id=\"get_customer\",\n)\nasync def get_customer_endpoint(\n customer_id: int = Path(..., description=\"Customer ID to retrieve\", example=10)\n) -> CustomerResponse:\n session = SessionLocal()\n customer = session.query(Customer).filter(Customer.id == customer_id).first()\n session.close()\n if customer is None:\n return CustomerResponse(\n id=0,\n name=\"\",\n billing_email=None,\n payment_terms_id=None,\n default_tax_category_id=None,\n created_at=None,\n updated_at=None,\n )\n return CustomerResponse(\n id=customer.id,\n name=customer.name,\n billing_email=customer.billing_email,\n payment_terms_id=customer.payment_terms_id,\n default_tax_category_id=customer.default_tax_category_id,\n created_at=customer.created_at,\n updated_at=customer.updated_at,\n )\n\n@app.get(\n \"/api/payment_terms\",\n response_model=PaymentTermsListResponse,\n summary=\"List payment terms\",\n description=\"Retrieve payment_terms records optionally filtered by name.\",\n tags=[\"payment_terms\"],\n operation_id=\"list_payment_terms\",\n)\nasync def list_payment_terms_endpoint(\n name: Optional[str] = Query(None, description=\"Filter terms by name\", example=\"Net 30\")\n) -> PaymentTermsListResponse:\n session = SessionLocal()\n query = session.query(PaymentTerm)\n if name is not None:\n query = query.filter(PaymentTerm.name.contains(name))\n payment_terms = query.all()\n session.close()\n return PaymentTermsListResponse(payment_terms=payment_terms)\n\n@app.get(\n \"/api/tax_categories\",\n response_model=TaxCategoriesListResponse,\n summary=\"List tax categories\",\n description=\"Retrieve available tax_categories optionally filtered by name.\",\n tags=[\"tax_categories\"],\n operation_id=\"list_tax_categories\",\n)\nasync def list_tax_categories_endpoint(\n name: Optional[str] = Query(None, description=\"Filter tax categories by exact or partial name\", example=\"Standard Sales Tax 8.5%\")\n) -> TaxCategoriesListResponse:\n session = SessionLocal()\n query = session.query(TaxCategory)\n if name is not None:\n query = query.filter(TaxCategory.name.contains(name))\n rows = query.all()\n tax_categories: List[TaxCategoryResponse] = []\n for r in rows:\n tax_categories.append(\n TaxCategoryResponse(\n id=r.id,\n name=r.name,\n description=r.description,\n rate=r.rate,\n is_compound=bool(r.is_compound),\n created_at=r.created_at,\n updated_at=r.updated_at,\n )\n )\n session.close()\n return TaxCategoriesListResponse(tax_categories=tax_categories)\n\n@app.get(\n \"/api/departments\",\n response_model=DepartmentsListResponse,\n summary=\"List departments\",\n description=\"Retrieve departments to map human-readable names to IDs.\",\n tags=[\"departments\"],\n operation_id=\"list_departments\",\n)\nasync def list_departments_endpoint(\n name: Optional[str] = Query(None, description=\"Filter departments by name\", example=\"Design\")\n) -> DepartmentsListResponse:\n session = SessionLocal()\n query = session.query(Department)\n if name is not None:\n query = query.filter(Department.name.contains(name))\n departments = query.all()\n session.close()\n return DepartmentsListResponse(departments=departments)\n\n@app.get(\n \"/api/accounts\",\n response_model=AccountsListResponse,\n summary=\"List chart of accounts\",\n description=\"Retrieve accounts filtered by type or name.\",\n tags=[\"accounts\"],\n operation_id=\"list_accounts\",\n)\nasync def list_accounts_endpoint(\n type: Optional[str] = Query(None, description=\"Filter accounts by type (asset, liability, equity, income, expense, contra)\", example=\"expense\"),\n name: Optional[str] = Query(None, description=\"Filter accounts by name\", example=\"Software Subscriptions\"),\n) -> AccountsListResponse:\n session = SessionLocal()\n query = session.query(Account)\n if type is not None:\n query = query.filter(Account.type == type)\n if name is not None:\n query = query.filter(Account.name.contains(name))\n rows = query.all()\n accounts_list: List[AccountResponse] = []\n for a in rows:\n accounts_list.append(\n AccountResponse(\n id=a.id,\n name=a.name,\n code=a.code,\n type=a.type,\n sub_type=a.sub_type,\n is_active=bool(a.is_active),\n created_at=a.created_at,\n updated_at=a.updated_at,\n )\n )\n session.close()\n return AccountsListResponse(accounts=accounts_list)\n\n@app.get(\n \"/api/bank_accounts\",\n response_model=BankAccountsListResponse,\n summary=\"List bank accounts\",\n description=\"Retrieve bank_accounts to find IDs for bank transactions.\",\n tags=[\"bank_accounts\"],\n operation_id=\"list_bank_accounts\",\n)\nasync def list_bank_accounts_endpoint(\n name: Optional[str] = Query(None, description=\"Filter bank accounts by name\", example=\"Chase Business Checking ****1023\")\n) -> BankAccountsListResponse:\n session = SessionLocal()\n query = session.query(BankAccount)\n if name is not None:\n query = query.filter(BankAccount.name.contains(name))\n bank_accounts = query.all()\n session.close()\n return BankAccountsListResponse(bank_accounts=bank_accounts)\n\n@app.post(\n \"/api/invoices\",\n response_model=InvoiceResponse,\n summary=\"Create a new invoice header\",\n description=\"Create an invoice record without line items.\",\n tags=[\"invoices\"],\n operation_id=\"create_invoice\",\n)\nasync def create_invoice_endpoint(body: InvoiceCreateRequest = Body(...)) -> InvoiceResponse:\n session = SessionLocal()\n invoice = Invoice(\n invoice_number=body.invoice_number,\n customer_id=body.customer_id,\n department_id=body.department_id,\n tax_category_id=body.tax_category_id,\n invoice_date=date.fromisoformat(body.invoice_date),\n due_date=date.fromisoformat(body.due_date),\n currency=body.currency if body.currency is not None else \"USD\",\n status=body.status if body.status is not None else \"draft\",\n subtotal=0.0,\n tax_amount=0.0,\n total=0.0,\n balance_due=0.0,\n payment_terms_id=body.payment_terms_id,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(invoice)\n session.commit()\n session.refresh(invoice)\n session.close()\n return InvoiceResponse(\n id=invoice.id,\n invoice_number=invoice.invoice_number,\n customer_id=invoice.customer_id,\n department_id=invoice.department_id,\n tax_category_id=invoice.tax_category_id,\n invoice_date=invoice.invoice_date,\n due_date=invoice.due_date,\n currency=invoice.currency,\n status=invoice.status,\n subtotal=invoice.subtotal,\n tax_amount=invoice.tax_amount,\n total=invoice.total,\n balance_due=invoice.balance_due,\n payment_terms_id=invoice.payment_terms_id,\n created_at=invoice.created_at,\n updated_at=invoice.updated_at,\n )\n\n@app.post(\n \"/api/invoice_line_items\",\n response_model=InvoiceLineItemResponse,\n summary=\"Add a line item to an invoice\",\n description=\"Create an invoice line and update invoice totals.\",\n tags=[\"invoices\", \"invoice_line_items\"],\n operation_id=\"create_invoice_line_item\",\n)\nasync def create_invoice_line_item_endpoint(\n body: InvoiceLineItemCreateRequest = Body(...)\n) -> InvoiceLineItemResponse:\n session = SessionLocal()\n invoice = session.query(Invoice).filter(Invoice.id == body.invoice_id).first()\n tax_rate = 0.0\n if invoice is not None and invoice.tax_category_id is not None:\n tax_cat = session.query(TaxCategory).filter(TaxCategory.id == invoice.tax_category_id).first()\n if tax_cat is not None:\n tax_rate = tax_cat.rate\n discount_percent = body.discount_percent if body.discount_percent is not None else 0.0\n gross = body.quantity * body.unit_price\n discount_amount = gross * (discount_percent / 100.0)\n line_subtotal = gross - discount_amount\n tax_amount = line_subtotal * tax_rate\n total = line_subtotal + tax_amount\n item = InvoiceLineItem(\n invoice_id=body.invoice_id,\n description=body.description,\n quantity=body.quantity,\n unit_price=body.unit_price,\n discount_percent=discount_percent,\n line_subtotal=line_subtotal,\n tax_amount=tax_amount,\n total=total,\n revenue_account_id=body.revenue_account_id,\n department_id=body.department_id if body.department_id is not None else (invoice.department_id if invoice is not None else None),\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(item)\n if invoice is not None:\n subtotal_sum = session.query(InvoiceLineItem).filter(InvoiceLineItem.invoice_id == invoice.id).all()\n subtotal_value = 0.0\n tax_value = 0.0\n total_value = 0.0\n for li in subtotal_sum:\n subtotal_value += li.line_subtotal\n tax_value += li.tax_amount\n total_value += li.total\n subtotal_value += line_subtotal\n tax_value += tax_amount\n total_value += total\n invoice.subtotal = subtotal_value\n invoice.tax_amount = tax_value\n invoice.total = total_value\n payments = session.query(PaymentApplication).filter(PaymentApplication.invoice_id == invoice.id).all()\n paid_amount = 0.0\n for p in payments:\n paid_amount += p.amount\n invoice.balance_due = invoice.total - paid_amount\n invoice.updated_at = datetime.utcnow()\n session.commit()\n session.refresh(item)\n session.close()\n return InvoiceLineItemResponse(\n id=item.id,\n invoice_id=item.invoice_id,\n description=item.description,\n quantity=item.quantity,\n unit_price=item.unit_price,\n discount_percent=item.discount_percent,\n line_subtotal=item.line_subtotal,\n tax_amount=item.tax_amount,\n total=item.total,\n revenue_account_id=item.revenue_account_id,\n department_id=item.department_id,\n created_at=item.created_at,\n updated_at=item.updated_at,\n )\n\n@app.post(\n \"/api/invoices/{invoice_id}/recalculate_totals\",\n response_model=InvoiceRecalculateTotalsResponse,\n summary=\"Recalculate invoice totals\",\n description=\"Recompute totals from line items and applied payments.\",\n tags=[\"invoices\"],\n operation_id=\"recalculate_invoice_totals\",\n)\nasync def recalculate_invoice_totals_endpoint(\n invoice_id: int = Path(..., description=\"Invoice ID whose totals should be recalculated\", example=1001)\n) -> InvoiceRecalculateTotalsResponse:\n session = SessionLocal()\n invoice = session.query(Invoice).filter(Invoice.id == invoice_id).first()\n if invoice is None:\n session.close()\n return InvoiceRecalculateTotalsResponse(invoice_id=0, subtotal=0.0, tax_amount=0.0, total=0.0, balance_due=0.0)\n lines = session.query(InvoiceLineItem).filter(InvoiceLineItem.invoice_id == invoice_id).all()\n subtotal = 0.0\n tax_amount = 0.0\n total = 0.0\n for li in lines:\n subtotal += li.line_subtotal\n tax_amount += li.tax_amount\n total += li.total\n payments = session.query(PaymentApplication).filter(PaymentApplication.invoice_id == invoice_id).all()\n paid_amount = 0.0\n for pa in payments:\n paid_amount += pa.amount\n invoice.subtotal = subtotal\n invoice.tax_amount = tax_amount\n invoice.total = total\n invoice.balance_due = total - paid_amount\n invoice.updated_at = datetime.utcnow()\n session.commit()\n session.close()\n return InvoiceRecalculateTotalsResponse(\n invoice_id=invoice_id,\n subtotal=subtotal,\n tax_amount=tax_amount,\n total=total,\n balance_due=invoice.balance_due,\n )\n\n@app.get(\n \"/api/invoices\",\n response_model=InvoicesListResponse,\n summary=\"List invoices with filters\",\n description=\"Retrieve invoices filtered by number, customer, status, or dates.\",\n tags=[\"invoices\"],\n operation_id=\"list_invoices\",\n)\nasync def list_invoices_endpoint(\n invoice_number: Optional[str] = Query(None, description=\"Filter by invoice_number\", example=\"INV-2025-001\"),\n customer_id: Optional[int] = Query(None, description=\"Filter invoices for a given customer ID\", example=10),\n status: Optional[str] = Query(None, description=\"Filter by invoice status (draft, open, paid, void)\", example=\"open\"),\n from_date: Optional[str] = Query(None, description=\"Filter by minimum invoice_date (YYYY-MM-DD)\", example=\"2025-01-01\"),\n to_date: Optional[str] = Query(None, description=\"Filter by maximum invoice_date (YYYY-MM-DD)\", example=\"2025-01-31\"),\n limit: Optional[int] = Query(50, description=\"Max number of invoices to return\", example=50),\n offset: Optional[int] = Query(0, description=\"Number of invoices to skip\", example=0),\n) -> InvoicesListResponse:\n session = SessionLocal()\n query = session.query(Invoice)\n if invoice_number is not None:\n query = query.filter(Invoice.invoice_number == invoice_number)\n if customer_id is not None:\n query = query.filter(Invoice.customer_id == customer_id)\n if status is not None:\n query = query.filter(Invoice.status == status)\n if from_date is not None:\n query = query.filter(Invoice.invoice_date >= date.fromisoformat(from_date))\n if to_date is not None:\n query = query.filter(Invoice.invoice_date <= date.fromisoformat(to_date))\n invoices = query.offset(offset).limit(limit).all()\n session.close()\n return InvoicesListResponse(invoices=invoices)\n\n@app.post(\n \"/api/payments\",\n response_model=PaymentResponse,\n summary=\"Record a customer payment\",\n description=\"Create a payment row for a customer without allocations.\",\n tags=[\"payments\"],\n operation_id=\"create_payment\",\n)\nasync def create_payment_endpoint(body: PaymentCreateRequest = Body(...)) -> PaymentResponse:\n session = SessionLocal()\n payment = Payment(\n customer_id=body.customer_id,\n payment_date=date.fromisoformat(body.payment_date),\n settlement_date=date.fromisoformat(body.settlement_date) if body.settlement_date is not None else None,\n amount=body.amount,\n currency=body.currency if body.currency is not None else \"USD\",\n method=body.method,\n reference=body.reference,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(payment)\n session.commit()\n session.refresh(payment)\n session.close()\n return PaymentResponse(\n id=payment.id,\n customer_id=payment.customer_id,\n payment_date=payment.payment_date,\n settlement_date=payment.settlement_date,\n amount=payment.amount,\n currency=payment.currency,\n method=payment.method,\n reference=payment.reference,\n created_at=payment.created_at,\n updated_at=payment.updated_at,\n )\n\n@app.post(\n \"/api/payment_applications\",\n response_model=PaymentApplicationResponse,\n summary=\"Apply a payment to an invoice\",\n description=\"Allocate part or all of a payment amount to a specific invoice.\",\n tags=[\"payments\", \"payment_applications\"],\n operation_id=\"create_payment_application\",\n)\nasync def create_payment_application_endpoint(\n body: PaymentApplicationCreateRequest = Body(...)\n) -> PaymentApplicationResponse:\n session = SessionLocal()\n payment_app = PaymentApplication(\n payment_id=body.payment_id,\n invoice_id=body.invoice_id,\n amount=body.amount,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(payment_app)\n invoice = session.query(Invoice).filter(Invoice.id == body.invoice_id).first()\n if invoice is not None:\n payments = session.query(PaymentApplication).filter(PaymentApplication.invoice_id == body.invoice_id).all()\n total_applied = 0.0\n for p in payments:\n total_applied += p.amount\n total_applied += body.amount\n invoice.balance_due = invoice.total - total_applied\n if invoice.balance_due <= 0:\n invoice.status = \"paid\"\n invoice.updated_at = datetime.utcnow()\n session.commit()\n session.refresh(payment_app)\n session.close()\n return PaymentApplicationResponse(\n id=payment_app.id,\n payment_id=payment_app.payment_id,\n invoice_id=payment_app.invoice_id,\n amount=payment_app.amount,\n created_at=payment_app.created_at,\n updated_at=payment_app.updated_at,\n )\n\n@app.post(\n \"/api/vendors\",\n response_model=VendorResponse,\n summary=\"Create a new vendor\",\n description=\"Create a vendor with default payment terms and expense category.\",\n tags=[\"vendors\"],\n operation_id=\"create_vendor\",\n)\nasync def create_vendor_endpoint(body: VendorCreateRequest = Body(...)) -> VendorResponse:\n session = SessionLocal()\n vendor = Vendor(\n name=body.name,\n contact_email=body.contact_email,\n payment_terms_id=body.payment_terms_id,\n default_expense_category_id=body.default_expense_category_id,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(vendor)\n session.commit()\n session.refresh(vendor)\n session.close()\n return VendorResponse(\n id=vendor.id,\n name=vendor.name,\n contact_email=vendor.contact_email,\n payment_terms_id=vendor.payment_terms_id,\n default_expense_category_id=vendor.default_expense_category_id,\n created_at=vendor.created_at,\n updated_at=vendor.updated_at,\n )\n\n@app.get(\n \"/api/vendors\",\n response_model=VendorsListResponse,\n summary=\"List vendors\",\n description=\"Retrieve vendors to find IDs when creating bills.\",\n tags=[\"vendors\"],\n operation_id=\"list_vendors\",\n)\nasync def list_vendors_endpoint(\n name: Optional[str] = Query(None, description=\"Filter vendors by name\", example=\"PixelPrint\")\n) -> VendorsListResponse:\n session = SessionLocal()\n query = session.query(Vendor)\n if name is not None:\n query = query.filter(Vendor.name.contains(name))\n vendors = query.all()\n session.close()\n return VendorsListResponse(vendors=vendors)\n\n@app.post(\n \"/api/bills\",\n response_model=BillResponse,\n summary=\"Create a bill\",\n description=\"Create a bills row for vendor expenses.\",\n tags=[\"bills\"],\n operation_id=\"create_bill\",\n)\nasync def create_bill_endpoint(body: BillCreateRequest = Body(...)) -> BillResponse:\n session = SessionLocal()\n bill = Bill(\n bill_number=body.bill_number,\n vendor_id=body.vendor_id,\n bill_date=date.fromisoformat(body.bill_date),\n due_date=date.fromisoformat(body.due_date) if body.due_date is not None else None,\n currency=body.currency if body.currency is not None else \"USD\",\n amount=body.amount,\n description=body.description,\n department_id=body.department_id,\n reimbursement_status=body.reimbursement_status,\n payment_terms_id=body.payment_terms_id,\n status=body.status if body.status is not None else \"open\",\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(bill)\n session.commit()\n session.refresh(bill)\n session.close()\n return BillResponse(\n id=bill.id,\n bill_number=bill.bill_number,\n vendor_id=bill.vendor_id,\n bill_date=bill.bill_date,\n due_date=bill.due_date,\n currency=bill.currency,\n amount=bill.amount,\n description=bill.description,\n department_id=bill.department_id,\n reimbursement_status=bill.reimbursement_status,\n payment_terms_id=bill.payment_terms_id,\n status=bill.status,\n created_at=bill.created_at,\n updated_at=bill.updated_at,\n )\n\n@app.post(\n \"/api/recurring_expenses\",\n response_model=RecurringExpenseResponse,\n summary=\"Create a recurring expense template\",\n description=\"Create recurring_expenses templates such as monthly rent.\",\n tags=[\"recurring_expenses\"],\n operation_id=\"create_recurring_expense\",\n)\nasync def create_recurring_expense_endpoint(\n body: RecurringExpenseCreateRequest = Body(...)\n) -> RecurringExpenseResponse:\n session = SessionLocal()\n recurring = RecurringExpense(\n name=body.name,\n vendor_id=body.vendor_id,\n amount=body.amount,\n expense_account_id=body.expense_account_id,\n department_id=body.department_id,\n frequency=body.frequency,\n next_run_date=date.fromisoformat(body.next_run_date),\n end_date=date.fromisoformat(body.end_date) if body.end_date is not None else None,\n is_active=1 if (body.is_active if body.is_active is not None else True) else 0,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(recurring)\n session.commit()\n session.refresh(recurring)\n session.close()\n return RecurringExpenseResponse(\n id=recurring.id,\n name=recurring.name,\n vendor_id=recurring.vendor_id,\n amount=recurring.amount,\n expense_account_id=recurring.expense_account_id,\n department_id=recurring.department_id,\n frequency=recurring.frequency,\n next_run_date=recurring.next_run_date,\n end_date=recurring.end_date,\n is_active=bool(recurring.is_active),\n created_at=recurring.created_at,\n updated_at=recurring.updated_at,\n )\n\n@app.post(\n \"/api/bank_transactions/batch_import\",\n response_model=BankTransactionsBatchImportResponse,\n summary=\"Import a batch of bank transactions\",\n description=\"Insert multiple bank_transactions for a bank account in one call.\",\n tags=[\"bank_transactions\"],\n operation_id=\"batch_import_bank_transactions\",\n)\nasync def batch_import_bank_transactions_endpoint(\n body: BankTransactionsBatchImportRequest = Body(...)\n) -> BankTransactionsBatchImportResponse:\n session = SessionLocal()\n created_items: List[BankTransactionResponse] = []\n for t in body.transactions:\n bt = BankTransaction(\n bank_account_id=body.bank_account_id,\n transaction_date=date.fromisoformat(t.transaction_date),\n posted_date=date.fromisoformat(t.posted_date) if t.posted_date is not None else None,\n description=t.description,\n amount=t.amount,\n external_id=t.external_id,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(bt)\n session.commit()\n session.refresh(bt)\n created_items.append(\n BankTransactionResponse(\n id=bt.id,\n bank_account_id=bt.bank_account_id,\n transaction_date=bt.transaction_date,\n posted_date=bt.posted_date,\n description=bt.description,\n amount=bt.amount,\n external_id=bt.external_id,\n created_at=bt.created_at,\n updated_at=bt.updated_at,\n )\n )\n session.close()\n return BankTransactionsBatchImportResponse(bank_transactions=created_items)\n\n@app.get(\n \"/api/bank_transactions\",\n response_model=BankTransactionsListResponse,\n summary=\"List bank transactions\",\n description=\"Retrieve bank_transactions for a bank account filtered by date.\",\n tags=[\"bank_transactions\"],\n operation_id=\"list_bank_transactions\",\n)\nasync def list_bank_transactions_endpoint(\n bank_account_id: int = Query(..., description=\"Bank account ID to filter transactions\", example=1),\n from_date: Optional[str] = Query(None, description=\"Minimum transaction_date (YYYY-MM-DD)\", example=\"2025-01-01\"),\n to_date: Optional[str] = Query(None, description=\"Maximum transaction_date (YYYY-MM-DD)\", example=\"2025-01-07\"),\n limit: Optional[int] = Query(100, description=\"Maximum number of records\", example=100),\n offset: Optional[int] = Query(0, description=\"Records to skip\", example=0),\n) -> BankTransactionsListResponse:\n session = SessionLocal()\n query = session.query(BankTransaction).filter(BankTransaction.bank_account_id == bank_account_id)\n if from_date is not None:\n query = query.filter(BankTransaction.transaction_date >= date.fromisoformat(from_date))\n if to_date is not None:\n query = query.filter(BankTransaction.transaction_date <= date.fromisoformat(to_date))\n transactions = query.offset(offset).limit(limit).all()\n session.close()\n return BankTransactionsListResponse(bank_transactions=transactions)\n\n@app.post(\n \"/api/journal_entries\",\n response_model=JournalEntryResponse,\n summary=\"Create a journal entry header\",\n description=\"Create a journal_entries header with entry_date and description.\",\n tags=[\"journal_entries\"],\n operation_id=\"create_journal_entry\",\n)\nasync def create_journal_entry_endpoint(\n body: JournalEntryCreateRequest = Body(...)\n) -> JournalEntryResponse:\n session = SessionLocal()\n entry = JournalEntry(\n entry_date=date.fromisoformat(body.entry_date),\n description=body.description,\n department_id=body.department_id,\n source=body.source,\n source_id=body.source_id,\n created_by_user_id=1,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(entry)\n session.commit()\n session.refresh(entry)\n session.close()\n return JournalEntryResponse(\n id=entry.id,\n entry_date=entry.entry_date,\n description=entry.description,\n department_id=entry.department_id,\n source=entry.source,\n source_id=entry.source_id,\n created_by_user_id=entry.created_by_user_id,\n created_at=entry.created_at,\n updated_at=entry.updated_at,\n )\n\n@app.post(\n \"/api/journal_entry_lines\",\n response_model=JournalEntryLineResponse,\n summary=\"Add a line to a journal entry\",\n description=\"Create a journal_entry_lines row for an account with debit or credit.\",\n tags=[\"journal_entries\", \"journal_entry_lines\"],\n operation_id=\"create_journal_entry_line\",\n)\nasync def create_journal_entry_line_endpoint(\n body: JournalEntryLineCreateRequest = Body(...)\n) -> JournalEntryLineResponse:\n session = SessionLocal()\n debit_value = body.debit if body.debit is not None else 0.0\n credit_value = body.credit if body.credit is not None else 0.0\n line = JournalEntryLine(\n journal_entry_id=body.journal_entry_id,\n account_id=body.account_id,\n department_id=body.department_id,\n description=body.description,\n debit=debit_value,\n credit=credit_value,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(line)\n session.commit()\n session.refresh(line)\n session.close()\n return JournalEntryLineResponse(\n id=line.id,\n journal_entry_id=line.journal_entry_id,\n account_id=line.account_id,\n department_id=line.department_id,\n description=line.description,\n debit=line.debit,\n credit=line.credit,\n created_at=line.created_at,\n updated_at=line.updated_at,\n )\n\n@app.post(\n \"/api/bank_transaction_journal_links\",\n response_model=BankTransactionJournalLinkResponse,\n summary=\"Link a bank transaction to a journal entry\",\n description=\"Create a bank_transaction_journal_links row to connect bank_transactions with journal_entries.\",\n tags=[\"bank_transactions\", \"journal_entries\"],\n operation_id=\"create_bank_transaction_journal_link\",\n)\nasync def create_bank_transaction_journal_link_endpoint(\n body: BankTransactionJournalLinkCreateRequest = Body(...)\n) -> BankTransactionJournalLinkResponse:\n session = SessionLocal()\n link = BankTransactionJournalLink(\n bank_transaction_id=body.bank_transaction_id,\n journal_entry_id=body.journal_entry_id,\n created_at=datetime.utcnow(),\n )\n session.add(link)\n session.commit()\n session.refresh(link)\n session.close()\n return BankTransactionJournalLinkResponse(\n id=link.id,\n bank_transaction_id=link.bank_transaction_id,\n journal_entry_id=link.journal_entry_id,\n created_at=link.created_at,\n )\n\n@app.post(\n \"/api/recurring_invoices\",\n response_model=RecurringInvoiceResponse,\n summary=\"Create a recurring invoice schedule\",\n description=\"Create a recurring_invoices template specifying settings.\",\n tags=[\"recurring_invoices\"],\n operation_id=\"create_recurring_invoice\",\n)\nasync def create_recurring_invoice_endpoint(\n body: RecurringInvoiceCreateRequest = Body(...)\n) -> RecurringInvoiceResponse:\n session = SessionLocal()\n recurring = RecurringInvoice(\n customer_id=body.customer_id,\n name=body.name,\n description=body.description,\n quantity=body.quantity,\n unit_price=body.unit_price,\n discount_percent=body.discount_percent if body.discount_percent is not None else 0.0,\n frequency=body.frequency,\n next_run_date=date.fromisoformat(body.next_run_date),\n end_date=date.fromisoformat(body.end_date) if body.end_date is not None else None,\n payment_terms_id=body.payment_terms_id,\n tax_category_id=body.tax_category_id,\n department_id=body.department_id,\n currency=body.currency if body.currency is not None else \"USD\",\n is_active=1 if (body.is_active if body.is_active is not None else True) else 0,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(recurring)\n session.commit()\n session.refresh(recurring)\n session.close()\n return RecurringInvoiceResponse(\n id=recurring.id,\n customer_id=recurring.customer_id,\n name=recurring.name,\n description=recurring.description,\n quantity=recurring.quantity,\n unit_price=recurring.unit_price,\n discount_percent=recurring.discount_percent,\n frequency=recurring.frequency,\n next_run_date=recurring.next_run_date,\n end_date=recurring.end_date,\n payment_terms_id=recurring.payment_terms_id,\n tax_category_id=recurring.tax_category_id,\n department_id=recurring.department_id,\n currency=recurring.currency,\n is_active=bool(recurring.is_active),\n created_at=recurring.created_at,\n updated_at=recurring.updated_at,\n )\n\n@app.post(\n \"/api/accounting_periods\",\n response_model=AccountingPeriodResponse,\n summary=\"Create an accounting period\",\n description=\"Create an accounting_periods row representing a fiscal period.\",\n tags=[\"accounting_periods\"],\n operation_id=\"create_accounting_period\",\n)\nasync def create_accounting_period_endpoint(\n body: AccountingPeriodCreateRequest = Body(...)\n) -> AccountingPeriodResponse:\n session = SessionLocal()\n period = AccountingPeriod(\n start_date=date.fromisoformat(body.start_date),\n end_date=date.fromisoformat(body.end_date),\n close_date=date.fromisoformat(body.close_date) if body.close_date is not None else None,\n is_locked=1 if (body.is_locked if body.is_locked is not None else False) else 0,\n created_at=datetime.utcnow(),\n updated_at=None,\n )\n session.add(period)\n session.commit()\n session.refresh(period)\n session.close()\n return AccountingPeriodResponse(\n id=period.id,\n start_date=period.start_date,\n end_date=period.end_date,\n close_date=period.close_date,\n is_locked=bool(period.is_locked),\n created_at=period.created_at,\n updated_at=period.updated_at,\n )\n\n@app.patch(\n \"/api/accounting_periods/{period_id}\",\n response_model=AccountingPeriodResponse,\n summary=\"Update an accounting period lock status\",\n description=\"Update close_date and is_locked for an accounting period.\",\n tags=[\"accounting_periods\"],\n operation_id=\"update_accounting_period_lock\",\n)\nasync def update_accounting_period_lock_endpoint(\n period_id: int = Path(..., description=\"Accounting period ID to update\", example=10001),\n body: AccountingPeriodUpdateRequest = Body(...),\n) -> AccountingPeriodResponse:\n session = SessionLocal()\n period = session.query(AccountingPeriod).filter(AccountingPeriod.id == period_id).first()\n if period is None:\n session.close()\n return AccountingPeriodResponse(\n id=0,\n start_date=date.fromisoformat(\"1970-01-01\"),\n end_date=date.fromisoformat(\"1970-01-01\"),\n close_date=None,\n is_locked=False,\n created_at=None,\n updated_at=None,\n )\n if body.close_date is not None:\n period.close_date = date.fromisoformat(body.close_date)\n if body.close_date is None and body.close_date is not ...:\n if body.close_date is None:\n period.close_date = None\n if body.is_locked is not None:\n period.is_locked = 1 if body.is_locked else 0\n period.updated_at = datetime.utcnow()\n session.commit()\n session.refresh(period)\n session.close()\n return AccountingPeriodResponse(\n id=period.id,\n start_date=period.start_date,\n end_date=period.end_date,\n close_date=period.close_date,\n is_locked=bool(period.is_locked),\n created_at=period.created_at,\n updated_at=period.updated_at,\n )\n\n@app.get(\n \"/api/reports/profit_and_loss\",\n response_model=ProfitAndLossReportResponse,\n summary=\"Generate a profit and loss report\",\n description=\"Compute revenue, expenses, and net profit for a date range.\",\n tags=[\"reports\"],\n operation_id=\"generate_profit_and_loss\",\n)\nasync def generate_profit_and_loss_endpoint(\n start_date: str = Query(..., description=\"Start date for the report (YYYY-MM-DD)\", example=\"2025-01-01\"),\n end_date: str = Query(..., description=\"End date for the report (YYYY-MM-DD)\", example=\"2025-01-31\"),\n department_id: Optional[int] = Query(None, description=\"Optional department filter to restrict results\", example=2),\n) -> ProfitAndLossReportResponse:\n session = SessionLocal()\n start = date.fromisoformat(start_date)\n end = date.fromisoformat(end_date)\n entries_query = session.query(JournalEntry).filter(\n JournalEntry.entry_date >= start, JournalEntry.entry_date <= end\n )\n if department_id is not None:\n entries_query = entries_query.filter(JournalEntry.department_id == department_id)\n entries = entries_query.all()\n entry_ids = [e.id for e in entries]\n lines_query = session.query(JournalEntryLine).filter(JournalEntryLine.journal_entry_id.in_(entry_ids)) if entry_ids else session.query(JournalEntryLine).filter(JournalEntryLine.id == -1)\n if department_id is not None:\n lines_query = lines_query.filter(\n (JournalEntryLine.department_id == department_id) | (JournalEntryLine.department_id.is_(None))\n )\n lines = lines_query.all()\n account_ids = list({l.account_id for l in lines})\n accounts = {}\n if account_ids:\n account_rows = session.query(Account).filter(Account.id.in_(account_ids)).all()\n for a in account_rows:\n accounts[a.id] = a\n total_revenue = 0.0\n total_expenses = 0.0\n income_details: List[Dict[str, Optional[float]]] = []\n expense_details: List[Dict[str, Optional[float]]] = []\n income_map: Dict[int, float] = {}\n expense_map: Dict[int, float] = {}\n for l in lines:\n a = accounts.get(l.account_id)\n if a is None:\n continue\n net_amount = l.debit - l.credit\n if a.type == \"income\":\n amount = -net_amount\n total_revenue += amount\n income_map[a.id] = income_map.get(a.id, 0.0) + amount\n if a.type == \"expense\":\n amount = net_amount\n total_expenses += amount\n expense_map[a.id] = expense_map.get(a.id, 0.0) + amount\n for aid, amt in income_map.items():\n a = accounts.get(aid)\n if a is not None:\n income_details.append({\"account_id\": float(a.id), \"account_name\": a.name, \"amount\": amt})\n for aid, amt in expense_map.items():\n a = accounts.get(aid)\n if a is not None:\n expense_details.append({\"account_id\": float(a.id), \"account_name\": a.name, \"amount\": amt})\n net_profit = total_revenue - total_expenses\n session.close()\n detail = {\n \"income_accounts\": income_details,\n \"expense_accounts\": expense_details,\n }\n return ProfitAndLossReportResponse(\n start_date=start_date,\n end_date=end_date,\n department_id=department_id,\n total_revenue=total_revenue,\n total_expenses=total_expenses,\n net_profit=net_profit,\n detail=detail,\n )\n\nif __name__ == \"__main__\":\n import uvicorn, os\n host = os.getenv(\"HOST\", \"127.0.0.1\")\n port = int(os.getenv(\"PORT\", \"8000\"))\n uvicorn.run(app, host=host, port=port)"} diff --git a/components/awm/upstream/accounting_1-gen_sample.jsonl b/components/awm/upstream/accounting_1-gen_sample.jsonl deleted file mode 100644 index bb4dcebd26bc14d1197685cd9ba291832905aa92..0000000000000000000000000000000000000000 --- a/components/awm/upstream/accounting_1-gen_sample.jsonl +++ /dev/null @@ -1 +0,0 @@ -{"scenario": "accounting_1", "tables_count": 20, "inserts_count": 121, "sample_data": {"tables": [{"table_name": "users", "reasoning": "Provides a current authenticated user (id=1) and additional users to associate with journal entries or other audit fields that reference created_by_user_id, enabling realistic multi-user scenarios.", "insert_statements": ["INSERT INTO users (id, username, email, full_name, created_at) VALUES (1, 'current_user', 'user@example.com', 'Current User', '2024-11-01 10:00:00');", "INSERT INTO users (id, username, email, full_name, created_at) VALUES (2, 'staff_anna', 'anna@example.com', 'Anna Staff', '2024-11-15 09:00:00');", "INSERT INTO users (id, username, email, full_name, created_at) VALUES (3, 'staff_bob', 'bob@example.com', 'Bob Staff', '2024-12-01 12:00:00');"]}, {"table_name": "departments", "reasoning": "Defines departments referenced across tasks: Design, Operations, General & Administrative. Also includes extra departments to support filtering, reporting, and edge cases where data belongs to other departments.", "insert_statements": ["INSERT INTO departments (id, name, description, created_at) VALUES (1, 'Design', 'Design and creative services', '2024-10-01 09:00:00');", "INSERT INTO departments (id, name, description, created_at) VALUES (2, 'Operations', 'Operations and logistics', '2024-10-01 09:05:00');", "INSERT INTO departments (id, name, description, created_at) VALUES (3, 'General & Administrative', 'G&A overhead costs', '2024-10-01 09:10:00');", "INSERT INTO departments (id, name, description, created_at) VALUES (4, 'Marketing', 'Marketing and advertising expenses', '2024-10-01 09:15:00');", "INSERT INTO departments (id, name, description, created_at) VALUES (5, 'Sales', 'Sales team activities', '2024-10-01 09:20:00');"]}, {"table_name": "tax_categories", "reasoning": "Provides tax options for invoices and recurring invoices. Includes the requested 'Standard Sales Tax 8.5%' and 'No Tax' plus additional categories for more realistic filtering and historical data.", "insert_statements": ["INSERT INTO tax_categories (id, name, description, rate, is_compound, created_at) VALUES (1, 'Standard Sales Tax 8.5%', 'Standard state and local sales tax at 8.5%', 0.085, 0, '2024-10-10 08:00:00');", "INSERT INTO tax_categories (id, name, description, rate, is_compound, created_at) VALUES (2, 'Reduced Sales Tax 5%', 'Reduced rate for certain services', 0.05, 0, '2024-10-10 08:05:00');", "INSERT INTO tax_categories (id, name, description, rate, is_compound, created_at) VALUES (3, 'No Tax', 'No sales tax applicable', 0.0, 0, '2024-10-10 08:10:00');", "INSERT INTO tax_categories (id, name, description, rate, is_compound, created_at) VALUES (4, 'Digital Services Tax 10%', 'Higher rate for digital-only services', 0.10, 0, '2024-10-10 08:15:00');", "INSERT INTO tax_categories (id, name, description, rate, is_compound, created_at) VALUES (5, 'VAT 20%', 'Value Added Tax at 20%', 0.20, 0, '2024-10-10 08:20:00');"]}, {"table_name": "payment_terms", "reasoning": "Defines available payment terms. Includes Net 30, Net 15, and others for invoices, bills, customers, vendors, and recurring invoices as required by the tasks.", "insert_statements": ["INSERT INTO payment_terms (id, name, days, description, created_at) VALUES (1, 'Due on Receipt', 0, 'Payment due immediately upon receipt', '2024-09-20 09:00:00');", "INSERT INTO payment_terms (id, name, days, description, created_at) VALUES (2, 'Net 15', 15, 'Payment due 15 days from invoice date', '2024-09-20 09:05:00');", "INSERT INTO payment_terms (id, name, days, description, created_at) VALUES (3, 'Net 30', 30, 'Payment due 30 days from invoice date', '2024-09-20 09:10:00');", "INSERT INTO payment_terms (id, name, days, description, created_at) VALUES (4, 'Net 45', 45, 'Payment due 45 days from invoice date', '2024-09-20 09:15:00');", "INSERT INTO payment_terms (id, name, days, description, created_at) VALUES (5, 'Net 60', 60, 'Payment due 60 days from invoice date', '2024-09-20 09:20:00');"]}, {"table_name": "accounts", "reasoning": "Provides chart of accounts to support revenue, expenses, assets, liabilities, and equity. Required for linking vendors\u2019 default_expense_category, recurring_expenses, journal entries, and bank-related postings.", "insert_statements": ["INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (1, 'Chase Business Checking', '1000', 'asset', 'bank', 1, '2024-09-01 08:00:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (2, 'Accounts Receivable', '1100', 'asset', 'receivable', 1, '2024-09-01 08:05:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (3, 'Prepaid Rent', '1200', 'asset', 'prepaid_expense', 1, '2024-09-01 08:10:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (4, 'Office Supplies', '5200', 'expense', 'office', 1, '2024-09-01 08:15:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (5, 'Software Subscriptions', '5300', 'expense', 'software', 1, '2024-09-01 08:20:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (6, 'Contractor Expenses', '5400', 'expense', 'contractor', 1, '2024-09-01 08:25:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (7, 'Rent Expense', '5500', 'expense', 'rent', 1, '2024-09-01 08:30:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (8, 'Accrued Expenses', '2100', 'liability', 'accrual', 1, '2024-09-01 08:35:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (9, 'Design Services Revenue', '4000', 'income', 'services', 1, '2024-09-01 08:40:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (10, 'Client Income - General', '4010', 'income', 'services', 1, '2024-09-01 08:45:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (11, 'Bank Service Charges', '6100', 'expense', 'bank_fees', 1, '2024-09-01 08:50:00');", "INSERT INTO accounts (id, name, code, type, sub_type, is_active, created_at) VALUES (12, 'Owner Equity', '3000', 'equity', 'owner_equity', 1, '2024-09-01 08:55:00');"]}, {"table_name": "bank_accounts", "reasoning": "Creates a bank account mapped to the cash account. Required for importing bank_transactions into 'Chase Business Checking ****1023' and linking them to journal entries.", "insert_statements": ["INSERT INTO bank_accounts (id, name, institution_name, account_number_masked, account_id, created_at) VALUES (1, 'Chase Business Checking ****1023', 'Chase Bank', '****1023', 1, '2024-09-05 09:00:00');", "INSERT INTO bank_accounts (id, name, institution_name, account_number_masked, account_id, created_at) VALUES (2, 'PayPal Business ****7788', 'PayPal', '****7788', 1, '2024-09-05 09:05:00');"]}, {"table_name": "customers", "reasoning": "Defines customers including Acme Design Studio and BrightFuture Marketing required by tasks. Other customers give realistic listing and filtering behavior for reports and invoice operations.", "insert_statements": ["INSERT INTO customers (id, name, billing_email, payment_terms_id, default_tax_category_id, created_at) VALUES (1, 'Acme Design Studio', 'billing@acmedesign.com', 3, 1, '2024-11-20 10:00:00');", "INSERT INTO customers (id, name, billing_email, payment_terms_id, default_tax_category_id, created_at) VALUES (2, 'BrightFuture Marketing', 'ap@brightfuture.com', 2, 3, '2024-11-21 11:00:00');", "INSERT INTO customers (id, name, billing_email, payment_terms_id, default_tax_category_id, created_at) VALUES (3, 'Northwind Traders', 'accounts@northwind.com', 3, 1, '2024-10-15 09:00:00');", "INSERT INTO customers (id, name, billing_email, payment_terms_id, default_tax_category_id, created_at) VALUES (4, 'Global Retail Co', 'billing@globalretail.co', 4, 1, '2024-10-20 09:30:00');", "INSERT INTO customers (id, name, billing_email, payment_terms_id, default_tax_category_id, created_at) VALUES (5, 'UrbanHub Cowork Member', 'member@urbanhub.com', 1, 3, '2024-11-01 08:45:00');"]}, {"table_name": "vendors", "reasoning": "Creates vendors including PixelPrint Supplies and UrbanHub Cowork for bills and recurring expenses, plus additional vendors to exercise listing, filtering, and reporting across multiple payees.", "insert_statements": ["INSERT INTO vendors (id, name, contact_email, payment_terms_id, default_expense_category_id, created_at) VALUES (1, 'PixelPrint Supplies', 'accounts@pixelprint.com', 2, 4, '2024-11-10 14:00:00');", "INSERT INTO vendors (id, name, contact_email, payment_terms_id, default_expense_category_id, created_at) VALUES (2, 'UrbanHub Cowork', 'billing@urbanhubcowork.com', 3, 7, '2024-11-11 10:00:00');", "INSERT INTO vendors (id, name, contact_email, payment_terms_id, default_expense_category_id, created_at) VALUES (3, 'SaaSify Cloud', 'billing@saasify.com', 1, 5, '2024-10-05 11:00:00');", "INSERT INTO vendors (id, name, contact_email, payment_terms_id, default_expense_category_id, created_at) VALUES (4, 'Creative Contractors LLC', 'ap@creativecontractors.com', 2, 6, '2024-10-06 11:15:00');", "INSERT INTO vendors (id, name, contact_email, payment_terms_id, default_expense_category_id, created_at) VALUES (5, 'City Storage Units', 'accounts@citystorage.com', 3, 7, '2024-10-07 11:30:00');"]}, {"table_name": "invoices", "reasoning": "Includes INV-2025-001 for Acme with proper department, tax_category, and amounts, plus other invoices spanning dates and departments to support reporting and payment application scenarios.", "insert_statements": ["INSERT INTO invoices (id, invoice_number, customer_id, department_id, tax_category_id, invoice_date, due_date, currency, status, subtotal, tax_amount, total, balance_due, payment_terms_id, created_at) VALUES (1, 'INV-2024-010', 3, 1, 1, '2024-12-15', '2025-01-14', 'USD', 'open', 2000.0, 170.0, 2170.0, 2170.0, 3, '2024-12-15 09:00:00');", "INSERT INTO invoices (id, invoice_number, customer_id, department_id, tax_category_id, invoice_date, due_date, currency, status, subtotal, tax_amount, total, balance_due, payment_terms_id, created_at) VALUES (2, 'INV-2024-011', 4, 2, 3, '2024-12-20', '2025-01-19', 'USD', 'draft', 1500.0, 0.0, 1500.0, 1500.0, 4, '2024-12-20 10:00:00');", "INSERT INTO invoices (id, invoice_number, customer_id, department_id, tax_category_id, invoice_date, due_date, currency, status, subtotal, tax_amount, total, balance_due, payment_terms_id, created_at) VALUES (3, 'INV-2025-001', 1, 1, 1, '2025-01-05', '2025-02-04', 'USD', 'open', 1920.0, 163.2, 2083.2, 1183.2, 3, '2025-01-05 09:30:00');", "INSERT INTO invoices (id, invoice_number, customer_id, department_id, tax_category_id, invoice_date, due_date, currency, status, subtotal, tax_amount, total, balance_due, payment_terms_id, created_at) VALUES (4, 'INV-2025-002', 2, 4, 3, '2025-01-10', '2025-01-25', 'USD', 'open', 1500.0, 0.0, 1500.0, 1500.0, 2, '2025-01-10 11:00:00');", "INSERT INTO invoices (id, invoice_number, customer_id, department_id, tax_category_id, invoice_date, due_date, currency, status, subtotal, tax_amount, total, balance_due, payment_terms_id, created_at) VALUES (5, 'INV-2025-003', 1, 1, 1, '2025-01-20', '2025-02-19', 'USD', 'draft', 800.0, 68.0, 868.0, 868.0, 3, '2025-01-20 14:00:00');", "INSERT INTO invoices (id, invoice_number, customer_id, department_id, tax_category_id, invoice_date, due_date, currency, status, subtotal, tax_amount, total, balance_due, payment_terms_id, created_at) VALUES (6, 'INV-2025-004', 3, 5, 1, '2025-01-15', '2025-02-14', 'USD', 'paid', 5000.0, 425.0, 5425.0, 0.0, 3, '2025-01-15 10:30:00');"]}, {"table_name": "invoice_line_items", "reasoning": "Populates invoice lines including Acme\u2019s logo redesign and brand guideline items with correct discounts and department. Extra lines across invoices and departments support revenue reporting by department.", "insert_statements": ["INSERT INTO invoice_line_items (id, invoice_id, description, quantity, unit_price, discount_percent, line_subtotal, tax_amount, total, revenue_account_id, department_id, created_at) VALUES (1, 1, 'Website redesign project', 1.0, 2000.0, 0.0, 2000.0, 170.0, 2170.0, 9, 1, '2024-12-15 09:05:00');", "INSERT INTO invoice_line_items (id, invoice_id, description, quantity, unit_price, discount_percent, line_subtotal, tax_amount, total, revenue_account_id, department_id, created_at) VALUES (2, 2, 'Operations consulting retainer', 1.0, 1500.0, 0.0, 1500.0, 0.0, 1500.0, 10, 2, '2024-12-20 10:05:00');", "INSERT INTO invoice_line_items (id, invoice_id, description, quantity, unit_price, discount_percent, line_subtotal, tax_amount, total, revenue_account_id, department_id, created_at) VALUES (3, 3, 'Logo redesign', 1.0, 1200.0, 0.0, 1200.0, 102.0, 1302.0, 9, 1, '2025-01-05 09:35:00');", "INSERT INTO invoice_line_items (id, invoice_id, description, quantity, unit_price, discount_percent, line_subtotal, tax_amount, total, revenue_account_id, department_id, created_at) VALUES (4, 3, 'Brand guideline document', 1.0, 800.0, 10.0, 720.0, 61.2, 781.2, 9, 1, '2025-01-05 09:36:00');", "INSERT INTO invoice_line_items (id, invoice_id, description, quantity, unit_price, discount_percent, line_subtotal, tax_amount, total, revenue_account_id, department_id, created_at) VALUES (5, 4, 'Monthly SEO Retainer', 1.0, 1500.0, 0.0, 1500.0, 0.0, 1500.0, 10, 4, '2025-01-10 11:05:00');", "INSERT INTO invoice_line_items (id, invoice_id, description, quantity, unit_price, discount_percent, line_subtotal, tax_amount, total, revenue_account_id, department_id, created_at) VALUES (6, 5, 'Social media asset pack', 1.0, 800.0, 0.0, 800.0, 68.0, 868.0, 9, 1, '2025-01-20 14:05:00');", "INSERT INTO invoice_line_items (id, invoice_id, description, quantity, unit_price, discount_percent, line_subtotal, tax_amount, total, revenue_account_id, department_id, created_at) VALUES (7, 6, 'Enterprise UX audit', 1.0, 5000.0, 0.0, 5000.0, 425.0, 5425.0, 9, 5, '2025-01-15 10:35:00');"]}, {"table_name": "payments", "reasoning": "Records customer payments including the partial credit card payment for Acme against INV-2025-001, plus other payments to support open, paid, and partially paid invoice scenarios.", "insert_statements": ["INSERT INTO payments (id, customer_id, payment_date, settlement_date, amount, currency, method, reference, created_at) VALUES (1, 1, '2025-01-10', '2025-01-10', 900.0, 'USD', 'Credit Card', 'STRIPE-12345', '2025-01-10 12:00:00');", "INSERT INTO payments (id, customer_id, payment_date, settlement_date, amount, currency, method, reference, created_at) VALUES (2, 3, '2025-01-16', '2025-01-16', 5425.0, 'USD', 'Bank Transfer', 'ACH-778899', '2025-01-16 10:00:00');", "INSERT INTO payments (id, customer_id, payment_date, settlement_date, amount, currency, method, reference, created_at) VALUES (3, 3, '2025-01-05', '2025-01-06', 1000.0, 'USD', 'Check', 'CHK-1001', '2025-01-05 15:00:00');", "INSERT INTO payments (id, customer_id, payment_date, settlement_date, amount, currency, method, reference, created_at) VALUES (4, 4, '2025-01-21', '2025-01-21', 1500.0, 'USD', 'Credit Card', 'STRIPE-67890', '2025-01-21 11:30:00');", "INSERT INTO payments (id, customer_id, payment_date, settlement_date, amount, currency, method, reference, created_at) VALUES (5, 1, '2025-02-10', '2025-02-10', 1183.2, 'USD', 'Credit Card', 'STRIPE-ACME-FINAL', '2025-02-10 09:00:00');"]}, {"table_name": "payment_applications", "reasoning": "Applies payments to specific invoices, particularly linking the 900 USD payment to INV-2025-001. Additional applications demonstrate full and partial settlements for reporting and balance calculations.", "insert_statements": ["INSERT INTO payment_applications (id, payment_id, invoice_id, amount, created_at) VALUES (1, 1, 3, 900.0, '2025-01-10 12:05:00');", "INSERT INTO payment_applications (id, payment_id, invoice_id, amount, created_at) VALUES (2, 2, 6, 5425.0, '2025-01-16 10:05:00');", "INSERT INTO payment_applications (id, payment_id, invoice_id, amount, created_at) VALUES (3, 3, 1, 1000.0, '2025-01-05 15:05:00');", "INSERT INTO payment_applications (id, payment_id, invoice_id, amount, created_at) VALUES (4, 4, 2, 1500.0, '2025-01-21 11:35:00');", "INSERT INTO payment_applications (id, payment_id, invoice_id, amount, created_at) VALUES (5, 5, 3, 1183.2, '2025-02-10 09:05:00');"]}, {"table_name": "bills", "reasoning": "Creates bills including the PixelPrint Supplies bill for printer ink and paper, and extra bills across vendors and departments to test payables workflows and reimbursement_status filters.", "insert_statements": ["INSERT INTO bills (id, bill_number, vendor_id, bill_date, due_date, currency, amount, description, department_id, reimbursement_status, payment_terms_id, status, created_at) VALUES (1, 'BILL-2025-001', 1, '2025-01-03', '2025-01-18', 'USD', 325.50, 'Printer ink and paper', 2, 'Not Reimbursable', 2, 'open', '2025-01-03 10:00:00');", "INSERT INTO bills (id, bill_number, vendor_id, bill_date, due_date, currency, amount, description, department_id, reimbursement_status, payment_terms_id, status, created_at) VALUES (2, 'BILL-2024-015', 2, '2024-12-01', '2024-12-31', 'USD', 650.0, 'December co-working rent', 3, 'Not Reimbursable', 3, 'paid', '2024-12-01 09:00:00');", "INSERT INTO bills (id, bill_number, vendor_id, bill_date, due_date, currency, amount, description, department_id, reimbursement_status, payment_terms_id, status, created_at) VALUES (3, 'BILL-2025-002', 2, '2025-01-01', '2025-01-31', 'USD', 650.0, 'January co-working rent', 3, 'Not Reimbursable', 3, 'open', '2025-01-01 09:00:00');", "INSERT INTO bills (id, bill_number, vendor_id, bill_date, due_date, currency, amount, description, department_id, reimbursement_status, payment_terms_id, status, created_at) VALUES (4, 'BILL-2025-003', 3, '2025-01-05', '2025-02-04', 'USD', 300.0, 'SaaS subscription January', 3, 'Not Reimbursable', 1, 'open', '2025-01-05 11:00:00');", "INSERT INTO bills (id, bill_number, vendor_id, bill_date, due_date, currency, amount, description, department_id, reimbursement_status, payment_terms_id, status, created_at) VALUES (5, 'BILL-2025-004', 4, '2025-01-07', '2025-01-22', 'USD', 1200.0, 'Contract design support', 1, 'Not Reimbursable', 2, 'open', '2025-01-07 13:00:00');"]}, {"table_name": "recurring_expenses", "reasoning": "Defines a recurring expense template for Monthly Co-working Space Rent tied to UrbanHub Cowork and department G&A, plus other recurring templates to test scheduling and frequency behavior.", "insert_statements": ["INSERT INTO recurring_expenses (id, name, vendor_id, amount, expense_account_id, department_id, frequency, next_run_date, end_date, is_active, created_at) VALUES (1, 'Monthly Co-working Space Rent', 2, 650.0, 7, 3, 'monthly', '2025-02-01', '2025-12-01', 1, '2025-01-01 08:00:00');", "INSERT INTO recurring_expenses (id, name, vendor_id, amount, expense_account_id, department_id, frequency, next_run_date, end_date, is_active, created_at) VALUES (2, 'SaaS Project Management Tool', 3, 150.0, 5, 3, 'monthly', '2025-02-01', NULL, 1, '2025-01-01 08:05:00');", "INSERT INTO recurring_expenses (id, name, vendor_id, amount, expense_account_id, department_id, frequency, next_run_date, end_date, is_active, created_at) VALUES (3, 'Cloud Hosting', 3, 200.0, 5, 2, 'monthly', '2025-02-05', NULL, 1, '2025-01-05 09:00:00');", "INSERT INTO recurring_expenses (id, name, vendor_id, amount, expense_account_id, department_id, frequency, next_run_date, end_date, is_active, created_at) VALUES (4, 'Office Snacks', 1, 75.0, 4, 2, 'weekly', '2025-01-10', NULL, 1, '2025-01-03 10:30:00');", "INSERT INTO recurring_expenses (id, name, vendor_id, amount, expense_account_id, department_id, frequency, next_run_date, end_date, is_active, created_at) VALUES (5, 'Annual Domain Renewals', 3, 120.0, 5, 3, 'yearly', '2025-12-15', '2027-12-15', 1, '2024-12-15 08:00:00');"]}, {"table_name": "bank_transactions", "reasoning": "Imports 5 transactions into the Chase account between 2025-01-01 and 2025-01-07 with varied descriptions and amounts, used to categorize into income or expenses and link to journal entries.", "insert_statements": ["INSERT INTO bank_transactions (id, bank_account_id, transaction_date, posted_date, description, amount, external_id, created_at) VALUES (1, 1, '2025-01-01', '2025-01-02', 'Client deposit - Northwind', 2500.0, 'BTX-1001', '2025-01-02 09:00:00');", "INSERT INTO bank_transactions (id, bank_account_id, transaction_date, posted_date, description, amount, external_id, created_at) VALUES (2, 1, '2025-01-02', '2025-01-03', 'Software subscription - SaaSify', -150.0, 'BTX-1002', '2025-01-03 09:05:00');", "INSERT INTO bank_transactions (id, bank_account_id, transaction_date, posted_date, description, amount, external_id, created_at) VALUES (3, 1, '2025-01-03', '2025-01-04', 'Office supplies - PixelPrint', -85.75, 'BTX-1003', '2025-01-04 09:10:00');", "INSERT INTO bank_transactions (id, bank_account_id, transaction_date, posted_date, description, amount, external_id, created_at) VALUES (4, 1, '2025-01-05', '2025-01-06', 'Client payment - BrightFuture', 1500.0, 'BTX-1004', '2025-01-06 09:15:00');", "INSERT INTO bank_transactions (id, bank_account_id, transaction_date, posted_date, description, amount, external_id, created_at) VALUES (5, 1, '2025-01-07', '2025-01-08', 'Software subscription - AnalyticsPro', -99.0, 'BTX-1005', '2025-01-08 09:20:00');", "INSERT INTO bank_transactions (id, bank_account_id, transaction_date, posted_date, description, amount, external_id, created_at) VALUES (6, 2, '2025-01-04', '2025-01-05', 'Misc PayPal income', 300.0, 'PP-2001', '2025-01-05 10:00:00');"]}, {"table_name": "journal_entries", "reasoning": "Creates year-end accrual entries on 2024-12-31 and entries generated from bank transaction categorizations, all tied to departments and sources where relevant, enabling reporting and period-lock testing.", "insert_statements": ["INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (1, '2024-12-31', 'Accrue December software subscriptions', 3, 'year_end_accrual', 1, 1, '2024-12-31 16:00:00');", "INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (2, '2024-12-31', 'Accrue December contractor expenses', 3, 'year_end_accrual', 2, 1, '2024-12-31 16:05:00');", "INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (3, '2024-12-31', 'Adjust prepaid rent', 3, 'year_end_accrual', 3, 1, '2024-12-31 16:10:00');", "INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (4, '2025-01-01', 'Bank tx BTX-1001 - Client income', 3, 'bank_transaction', 1, 1, '2025-01-02 09:30:00');", "INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (5, '2025-01-02', 'Bank tx BTX-1002 - Software subscription', 3, 'bank_transaction', 2, 1, '2025-01-03 09:30:00');", "INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (6, '2025-01-03', 'Bank tx BTX-1003 - Office supplies', 2, 'bank_transaction', 3, 1, '2025-01-04 09:30:00');", "INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (7, '2025-01-05', 'Bank tx BTX-1004 - Client income', 4, 'bank_transaction', 4, 1, '2025-01-06 09:30:00');", "INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (8, '2025-01-07', 'Bank tx BTX-1005 - Software subscription', 3, 'bank_transaction', 5, 1, '2025-01-08 09:30:00');", "INSERT INTO journal_entries (id, entry_date, description, department_id, source, source_id, created_by_user_id, created_at) VALUES (9, '2024-12-15', 'Manual adjustment prior to period close', 3, 'manual', 1, 2, '2024-12-15 10:00:00');"]}, {"table_name": "journal_entry_lines", "reasoning": "Adds debits and credits for year-end accruals and bank-transaction-based entries, ensuring balanced postings and proper account usage for income and expense categorization tests.", "insert_statements": ["INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (1, 1, 5, 3, 'Accrue December SaaS', 300.0, 0.0, '2024-12-31 16:01:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (2, 1, 8, 3, 'Accrued expenses', 0.0, 300.0, '2024-12-31 16:01:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (3, 2, 6, 3, 'Accrue contractor fees', 1200.0, 0.0, '2024-12-31 16:06:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (4, 2, 8, 3, 'Accrued expenses', 0.0, 1200.0, '2024-12-31 16:06:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (5, 3, 7, 3, 'Recognize rent expense', 650.0, 0.0, '2024-12-31 16:11:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (6, 3, 3, 3, 'Reduce prepaid rent', 0.0, 650.0, '2024-12-31 16:11:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (7, 4, 1, 3, 'Client deposit Northwind', 2500.0, 0.0, '2025-01-02 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (8, 4, 10, 3, 'Client income from deposit', 0.0, 2500.0, '2025-01-02 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (9, 5, 5, 3, 'SaaSify subscription', 150.0, 0.0, '2025-01-03 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (10, 5, 1, 3, 'Bank payment for SaaSify', 0.0, 150.0, '2025-01-03 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (11, 6, 4, 2, 'PixelPrint office supplies', 85.75, 0.0, '2025-01-04 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (12, 6, 1, 2, 'Bank payment for supplies', 0.0, 85.75, '2025-01-04 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (13, 7, 1, 4, 'BrightFuture client receipt', 1500.0, 0.0, '2025-01-06 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (14, 7, 10, 4, 'Client income BrightFuture', 0.0, 1500.0, '2025-01-06 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (15, 8, 5, 3, 'AnalyticsPro subscription', 99.0, 0.0, '2025-01-08 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (16, 8, 1, 3, 'Bank payment for AnalyticsPro', 0.0, 99.0, '2025-01-08 09:31:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (17, 9, 11, 3, 'Bank fees adjustment', 50.0, 0.0, '2024-12-15 10:01:00');", "INSERT INTO journal_entry_lines (id, journal_entry_id, account_id, department_id, description, debit, credit, created_at) VALUES (18, 9, 1, 3, 'Bank account adjustment', 0.0, 50.0, '2024-12-15 10:01:00');"]}, {"table_name": "bank_transaction_journal_links", "reasoning": "Links each imported bank_transaction to its corresponding journal_entry, allowing traceability between bank feeds and general ledger for reconciliation and categorization validation.", "insert_statements": ["INSERT INTO bank_transaction_journal_links (id, bank_transaction_id, journal_entry_id, created_at) VALUES (1, 1, 4, '2025-01-02 09:35:00');", "INSERT INTO bank_transaction_journal_links (id, bank_transaction_id, journal_entry_id, created_at) VALUES (2, 2, 5, '2025-01-03 09:35:00');", "INSERT INTO bank_transaction_journal_links (id, bank_transaction_id, journal_entry_id, created_at) VALUES (3, 3, 6, '2025-01-04 09:35:00');", "INSERT INTO bank_transaction_journal_links (id, bank_transaction_id, journal_entry_id, created_at) VALUES (4, 4, 7, '2025-01-06 09:35:00');", "INSERT INTO bank_transaction_journal_links (id, bank_transaction_id, journal_entry_id, created_at) VALUES (5, 5, 8, '2025-01-08 09:35:00');"]}, {"table_name": "recurring_invoices", "reasoning": "Creates a recurring invoice schedule for BrightFuture Marketing\u2019s Monthly SEO Retainer with Net 15 terms and No Tax, plus other templates to test frequencies, departments, and active flags.", "insert_statements": ["INSERT INTO recurring_invoices (id, customer_id, name, description, quantity, unit_price, discount_percent, frequency, next_run_date, end_date, payment_terms_id, tax_category_id, department_id, currency, is_active, created_at) VALUES (1, 2, 'Monthly SEO Retainer', 'Ongoing SEO strategy and reporting', 1.0, 1500.0, 0.0, 'monthly', '2025-02-01', '2025-07-01', 2, 3, 4, 'USD', 1, '2025-01-10 12:00:00');", "INSERT INTO recurring_invoices (id, customer_id, name, description, quantity, unit_price, discount_percent, frequency, next_run_date, end_date, payment_terms_id, tax_category_id, department_id, currency, is_active, created_at) VALUES (2, 1, 'Monthly Design Support', 'Block of 10 design hours', 10.0, 120.0, 0.0, 'monthly', '2025-02-05', NULL, 3, 1, 1, 'USD', 1, '2025-01-15 10:00:00');", "INSERT INTO recurring_invoices (id, customer_id, name, description, quantity, unit_price, discount_percent, frequency, next_run_date, end_date, payment_terms_id, tax_category_id, department_id, currency, is_active, created_at) VALUES (3, 3, 'Quarterly UX Audit', 'Comprehensive UX review', 1.0, 4000.0, 5.0, 'quarterly', '2025-04-01', '2026-04-01', 3, 1, 5, 'USD', 1, '2025-01-05 09:00:00');", "INSERT INTO recurring_invoices (id, customer_id, name, description, quantity, unit_price, discount_percent, frequency, next_run_date, end_date, payment_terms_id, tax_category_id, department_id, currency, is_active, created_at) VALUES (4, 4, 'Annual Brand Review', 'Yearly brand health check', 1.0, 2500.0, 0.0, 'yearly', '2025-12-31', '2027-12-31', 4, 1, 1, 'USD', 1, '2024-12-31 13:00:00');", "INSERT INTO recurring_invoices (id, customer_id, name, description, quantity, unit_price, discount_percent, frequency, next_run_date, end_date, payment_terms_id, tax_category_id, department_id, currency, is_active, created_at) VALUES (5, 5, 'Weekly Social Media Pack', 'Design of weekly post templates', 4.0, 200.0, 10.0, 'weekly', '2025-01-12', '2025-06-30', 1, 1, 1, 'USD', 1, '2025-01-01 12:00:00');"]}, {"table_name": "accounting_periods", "reasoning": "Defines accounting periods and locks all transactions on or before 2024-12-31 by setting close_date and is_locked, supporting period-close logic and preventing subsequent edits via the API.", "insert_statements": ["INSERT INTO accounting_periods (id, start_date, end_date, close_date, is_locked, created_at) VALUES (1, '2024-01-01', '2024-12-31', '2024-12-31', 1, '2025-01-01 09:00:00');", "INSERT INTO accounting_periods (id, start_date, end_date, close_date, is_locked, created_at) VALUES (2, '2025-01-01', '2025-12-31', NULL, 0, '2025-01-01 09:05:00');", "INSERT INTO accounting_periods (id, start_date, end_date, close_date, is_locked, created_at) VALUES (3, '2023-01-01', '2023-12-31', '2024-01-31', 1, '2024-02-01 10:00:00');"]}]}} diff --git a/components/dnakhla/.dockerignore b/components/dnakhla/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..fffd596308c730148310386c92d13f850328dfe4 --- /dev/null +++ b/components/dnakhla/.dockerignore @@ -0,0 +1,5 @@ +upstream +README.md +LICENSE +NOTICE +**/__pycache__ diff --git a/components/dnakhla/Dockerfile b/components/dnakhla/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a9a6f99b09766961e887b2eea0faaf5fc3e9023a --- /dev/null +++ b/components/dnakhla/Dockerfile @@ -0,0 +1,8 @@ +FROM ghcr.io/dnakhla/terminal-desk@sha256:de59e5f70a416641a5cc39cd3510a0a91c57808841448e44dc7f4eaf10376c5e +USER root +COPY runtime /opt/dnakhla_compat +COPY SOURCE_MANIFEST.json /opt/dnakhla_compat/SOURCE_MANIFEST.json +RUN chmod -R go-rwx /opt/dnakhla_compat +ENV PYTHONPATH=/opt/dnakhla_compat:/opt/terminal_desk OPENENV_MODE=production +WORKDIR /opt/dnakhla_compat +CMD ["python", "-m", "dnakhla_compat.server"] diff --git a/components/pdbthink/licenses/LICENSE-PDBTHINK b/components/dnakhla/LICENSE similarity index 99% rename from components/pdbthink/licenses/LICENSE-PDBTHINK rename to components/dnakhla/LICENSE index 261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64..d645695673349e3947e8e5ae42332d0ac3164cd7 100644 --- a/components/pdbthink/licenses/LICENSE-PDBTHINK +++ b/components/dnakhla/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/components/dnakhla/NOTICE b/components/dnakhla/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..0559851c6c2b80d8f564390510a12474f5a88d39 --- /dev/null +++ b/components/dnakhla/NOTICE @@ -0,0 +1,4 @@ +Terminal Desk by dnakhla +Source: https://huggingface.co/datasets/dnakhla/terminal-desk/tree/08fab0beb50b665b42f0ac73840f03140f4ad1c9 +License declaration: Apache-2.0. The accompanying standard license text was added by this distribution. +This distribution adds a shared Arena interface and a five-task registry. Original task source remains unchanged. diff --git a/components/dnakhla/README.md b/components/dnakhla/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b1dc34102a2512ba4ae3bb94ef6c37bb524e361b --- /dev/null +++ b/components/dnakhla/README.md @@ -0,0 +1,6 @@ +# Terminal Desk + +Original tasks by dnakhla. The adapter exposes five tasks through the shared Arena interface. `exec` and `write_file` use the original runtime; `finish`, `evaluate`, and `close` invoke and cache the original evaluation. The 32nd action executes before evaluation. Reset preserves original random instance generation. + +Build: `docker build -t arena-dnakhla-v5r1:20261015 .` +Run: `python -m dnakhla_compat.server` diff --git a/components/dnakhla/SOURCE_MANIFEST.json b/components/dnakhla/SOURCE_MANIFEST.json new file mode 100644 index 0000000000000000000000000000000000000000..35870362ee47ab147ead06f4507bf3cad7e0a835 --- /dev/null +++ b/components/dnakhla/SOURCE_MANIFEST.json @@ -0,0 +1,67 @@ +{ + "base_image": "ghcr.io/dnakhla/terminal-desk@sha256:de59e5f70a416641a5cc39cd3510a0a91c57808841448e44dc7f4eaf10376c5e", + "dataset": "dnakhla/terminal-desk", + "revision": "08fab0beb50b665b42f0ac73840f03140f4ad1c9", + "license_declaration": "Apache-2.0", + "original_files": { + "openenv.yaml": "8c68fdfde651ec70155ec1a8d4b15f5c14cdd1f9d98197fc5037b49d6dc74524", + "terminal_desk/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "terminal_desk/core/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "terminal_desk/core/grading.py": "8606129c5aa3f99cc540a7c8269b65e9bb6c42e81bca36085c16963a0cccd2bd", + "terminal_desk/core/shell.py": "59b4b07b0d59e01792c8dbbf7877555e2da2346ddf5d2c17df3bbd4e17cb847f", + "terminal_desk/families/__init__.py": "2ca3d4eda1fb04a84a236fbb43b71d13d46ea68109f545e036842211be3e3958", + "terminal_desk/families/base.py": "d76cab459096d3748d2c4198753853d85418de61f64436cf4772b89345fdcf17", + "terminal_desk/families/finance.py": "312a26e2d48ac10a07716384d3059a697f75f16e5b37fcabb8c07fcac3397f6f", + "terminal_desk/families/finance3.py": "a4839540c7a54198ea8e480248428e9ca65bdaf45adea5ae9f81cad71cbb1311", + "terminal_desk/families/industrial.py": "9140985ca44b1bcfc78b853f44496b7a9b77288284675f3656898de5be70d6aa", + "terminal_desk/families/industrial3.py": "48e914996b67accb09350a6714a5cea4a6191c0a05ac12a8f3045309f961c49c", + "terminal_desk/families/mathematics.py": "552855819cbe4983529b864279c915bc56f8d68d850a3f221d84864066c0e2a5", + "terminal_desk/families/mathematics3.py": "9dc54710cd826aadbe5de55d9093959e38c59dc59ae080e40d379cc4db1987c1", + "terminal_desk/families/media.py": "52523502e6c679e34bd2dbeb46c3f539ba53ae2d4e1033adafca7ce859bc4de8", + "terminal_desk/families/media3.py": "9c91cfbde8ad60da034c15ba3418e21ae5891a12ce3932ecaf8035fcd6eef4bd", + "terminal_desk/families/office.py": "11f76ce7d62e18b535278b487f798703fd6f2bef04dd7ffaefae2c95bcba1102", + "terminal_desk/families/office3.py": "1926c4a6e600cabb4cd35fab9528b4e4d55ef4adc1623b7229ac356ef28c987b", + "terminal_desk/families/science.py": "836ab819a2231700a4bff2929a4579034c45a637992e883ddfbdb0c1f711446a", + "terminal_desk/families/science3.py": "59477a1f9d38dbe5607f6432b4f8538342eec93faeed09bb6c9cb1402980c9a1", + "terminal_desk/families/security.py": "1228db896b6ce796ccf1f133e2f2ba9aaa9d54b745d5ffaf4b584a63a6aab2bd", + "terminal_desk/families/security3.py": "6f5ec9c2dfe9aad81ba382d4f6ffdb7f64493d92cd7fe5d653134ef0dac107af", + "terminal_desk/families/software.py": "4bca03797d701fe33f567729baa9a4fb2cef59cf220d0b79a941cc3817f8ba3a", + "terminal_desk/families/software3.py": "d526ae88ca53ef22dbc1e578055fc27ebb491c184474e662736b8be9523086a7", + "terminal_desk/models.py": "f31264b0909878c6f2d4d18a270c7d92bc895052150c56e5ac3e6b38d4ceebb4", + "terminal_desk/oracles/__init__.py": "04e4b102444b5db19507a46814820d78ad1e9782f963e5764f8f4adfe4d366a3", + "terminal_desk/oracles/fin3_invoice_fraud.py": "975ff8045d42b2f483924e368e304c451bca894ddb4ba593d9dd3aea1c505329", + "terminal_desk/oracles/fin3_loan_schedule.py": "b0a32266ec725f5a4f76d8b40a27fc52759f679d74e4dfe5c7885a1b19a36711", + "terminal_desk/oracles/fin3_portfolio_value.py": "152a3516b9ec6811121747ea875fc1a73cb768ba6a98e05c2bee91325e4f7247", + "terminal_desk/oracles/ind3_service_due.py": "47914a6e1a5bde126ce301bc11d4dc95b11cb0910ac0208a4c78596d7e65e30e", + "terminal_desk/oracles/ind3_stl_mass.py": "53e6adc26768256ce6665bda20c4b04ad87602e24eb31b074c25dc8fbbc00653", + "terminal_desk/oracles/ind3_tank_balance.py": "c1049fdb6b4f11f0b5e0194b41e84b525d5a340213c2c94f5f99ffd6c2b75a42", + "terminal_desk/oracles/math3_count_items.py": "0fd62812cd9ef1d5be6d6ae9fa2fa047eb6bb0a4508ccb5a5369373aefbf8dd3", + "terminal_desk/oracles/math3_exam_slots.py": "03908ec43159f4a66678f37fb0366389608eeeba41361758d966c96eea50dc3f", + "terminal_desk/oracles/math3_route_plan.py": "c2bb32b08a3705a4be56ff8c4e3af94d64441c9a7432f5dcec4dce0b378ee465", + "terminal_desk/oracles/med3_silence_report.py": "554e36455da66fd258e6ad2c39e80acbc3856237fee4608ce57b494f23c3d16d", + "terminal_desk/oracles/med3_sprite_count.py": "8f0a1169d6e5b10c4981b53a22e957c4befad44d95e5d250cf53734105a40256", + "terminal_desk/oracles/med3_subtitle_retime.py": "72f448ba58ac9ee6082692dec88ddb6f279ae69bdb99d39b30d1acce12c19bfe", + "terminal_desk/oracles/off3_ar_recon.py": "b5320a71696443f1b04c0c5e02e35d0baee67a175a912bff86e32df7c2acb357", + "terminal_desk/oracles/off3_meeting_slot.py": "6eef5e15337e5029c8e0b3353adee791ea9ebe73c6d79e47d84d6b7294cb5a38", + "terminal_desk/oracles/off3_pdf_xlsx_diff.py": "82b5c15f02a03615699429a2342dbad4b8985aab76d82fa8a8b96f7fbebc544f", + "terminal_desk/oracles/sci3_kinetics_fit.py": "1ebc19667bf1963c83a47bd4905e99e0c32c3ce249b63ae2d7b39fcffa1b1bb7", + "terminal_desk/oracles/sci3_lightcurve_period.py": "a983fb3c03ba15bc0591ab32ce41ddb99f2f38329e273f3f5da20f775d6bd8ab", + "terminal_desk/oracles/sci3_stoich_batch.py": "56a84763e746f034571dc50a71f3716f340e4f8d9dee823eb3c9b209f471f48a", + "terminal_desk/oracles/sec3_auth_triage.py": "c5fb5f697e8cfdb6008fcd59d6c3095a509d9a488dc28d7b99da4f4fe128b8a6", + "terminal_desk/oracles/sec3_exfil_flows.py": "5a4cc8a38f0554be4b287e2592bd26553db2f3ee6b5c10339d641246a7a6af90", + "terminal_desk/oracles/sec3_fw_verdicts.py": "b91c7389813445d55edbdaadec60aa4c5d0b6c5ead6fdfca5268e425f512820f", + "terminal_desk/oracles/sw3_dep_lock.py": "6b46601bc7e4bdc42c62242344aa431a34e7a6d1a8c7201e77315c66c6a4ae09", + "terminal_desk/oracles/sw3_fix_module.py": "43eee7f24a02ca3f0d3b12db5a44c132a931fc8dba10f9c1d4028d7fa5775bf4", + "terminal_desk/oracles/sw3_rate_limit.py": "4f1f187ae42f47faecc85d84e1f0341c848b03eb2bba1bf538927e2e62758314", + "terminal_desk/server/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "terminal_desk/server/app.py": "6bf7658ec8ad07dda230a01fd893091a9b87df18ebf6af25af6c35965ed01fd8", + "terminal_desk/server/environment.py": "8e92f991e14098a0858490fe5beb43ca9b0ee2cfbddb36e73ecf987ba3922902" + }, + "selected_tasks": [ + "off3_ar_recon-L1", + "off3_meeting_slot-L2", + "off3_ar_recon-L2", + "off3_pdf_xlsx_diff-L1", + "sci3_kinetics_fit-L1" + ] +} diff --git a/components/awm/runtime/common/__init__.py b/components/dnakhla/runtime/common/__init__.py similarity index 100% rename from components/awm/runtime/common/__init__.py rename to components/dnakhla/runtime/common/__init__.py diff --git a/components/math/runtime/common/contracts.py b/components/dnakhla/runtime/common/contracts.py similarity index 100% rename from components/math/runtime/common/contracts.py rename to components/dnakhla/runtime/common/contracts.py diff --git a/components/pdbthink/runtime/common/models.py b/components/dnakhla/runtime/common/models.py similarity index 87% rename from components/pdbthink/runtime/common/models.py rename to components/dnakhla/runtime/common/models.py index b862e2d3259ab1c55bbb46e6423587b742dbcc51..4d7bfa208b39f5e19d3e358c6d23c0f59041efad 100644 --- a/components/pdbthink/runtime/common/models.py +++ b/components/dnakhla/runtime/common/models.py @@ -5,6 +5,7 @@ from typing import Any, Literal import jsonschema from openenv.core.env_server.types import Action, Observation from pydantic import ConfigDict, Field, model_serializer, model_validator +from pydantic_core import PydanticCustomError from .contracts import ACTION_SCHEMA @@ -22,7 +23,7 @@ class ArenaAction(Action): return value def finite(item): if isinstance(item,float) and not math.isfinite(item): - raise ValueError('Non-finite JSON number') + raise PydanticCustomError('finite_number', 'Non-finite JSON number') if isinstance(item,dict): for part in item.values():finite(part) elif isinstance(item,list): @@ -31,7 +32,7 @@ class ArenaAction(Action): try: jsonschema.Draft202012Validator(ACTION_SCHEMA).validate(value) except jsonschema.ValidationError as exc: - raise ValueError(exc.message) from exc + raise PydanticCustomError('action_contract', '{message}', {'message': exc.message}) from exc return value @classmethod diff --git a/components/dnakhla/runtime/dnakhla_compat/__init__.py b/components/dnakhla/runtime/dnakhla_compat/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8e9428f06894be913aed5bbd7c797ca3158b4423 --- /dev/null +++ b/components/dnakhla/runtime/dnakhla_compat/__init__.py @@ -0,0 +1 @@ +"""Local compatibility prototype for the original Terminal Desk environment.""" diff --git a/components/dnakhla/runtime/dnakhla_compat/environment.py b/components/dnakhla/runtime/dnakhla_compat/environment.py new file mode 100644 index 0000000000000000000000000000000000000000..fe6e6efa5a6e2034e266ceece796cecfc9a573ee --- /dev/null +++ b/components/dnakhla/runtime/dnakhla_compat/environment.py @@ -0,0 +1,152 @@ +"""Translate the shared Arena contract without editing original task code.""" +import hashlib +import json +import math +from pathlib import Path +from threading import RLock + +from openenv.core.env_server.interfaces import Environment +from openenv.core.env_server.types import EnvironmentMetadata, State +from common.models import ArenaAction, ArenaObservation + +ROOT = Path('/opt/terminal_desk') +MANIFEST = json.loads(Path('/opt/dnakhla_compat/SOURCE_MANIFEST.json').read_text()) +for relative, digest in MANIFEST['original_files'].items(): + if hashlib.sha256((ROOT / relative).read_bytes()).hexdigest() != digest: + raise RuntimeError('Original Terminal Desk file hash mismatch: ' + relative) + +from terminal_desk.models import Tbench2Action +from terminal_desk.families import all_task_ids +from terminal_desk.server.environment import TerminalDeskEnvironment, MAX_CALLS + +TASK_IDS = tuple(MANIFEST['selected_tasks']) +if len(set(TASK_IDS)) != len(TASK_IDS) or not set(TASK_IDS).issubset(all_task_ids()): + raise RuntimeError('Invalid task registry') +PROTOCOL = ( + '\n\nTools: {"op":"exec","command":""}; ' + '{"op":"call","tool":"write_file","arguments":{"file_path":"","content":""}}; ' + '{"op":"call","tool":"evaluate","arguments":{}}. ' + 'Use {"op":"finish"} to grade the current artifact and finish. ' + 'Every terminal action uses the original grader. There are at most 32 actions.' +) + + +class CompatEnvironment(Environment): + # Original roots and nobody-process cleanup require one episode per container. + SUPPORTS_CONCURRENT_SESSIONS = False + + def __init__(self, allow_seed=False): + super().__init__() + self._lock = RLock() + self._original = TerminalDeskEnvironment(allow_seed=allow_seed) + self._task_id = None + self._actions = 0 + self._terminal = None + + def reset(self, *, task_id=None, seed=None, index=None, split='train', episode_id=None, **kwargs): + with self._lock: + if split != 'train': + raise ValueError('Unknown split') + if index is not None: + if type(index) is not int or not 0 <= index < len(TASK_IDS): + raise ValueError('Invalid task index') + if task_id is not None and task_id != TASK_IDS[index]: + raise ValueError('Task selection mismatch') + task_id = TASK_IDS[index] + if task_id is None: + raise ValueError('reset needs task_id or an explicit task index') + if task_id not in TASK_IDS or (seed is not None and type(seed) is not int): + raise ValueError('Invalid task or seed') + self._task_id = None + self._actions = 0 + self._terminal = None + opening = self._original.reset(task_id=task_id, seed=seed, episode_id=episode_id) + self._task_id = task_id + return self._translate(opening, reset=True) + + def _translate(self, original, reset=False): + if original.done: + reward = original.reward + if isinstance(reward, bool) or not isinstance(reward, (int, float)) or not math.isfinite(reward) or not 0 <= reward <= 1: + raise RuntimeError('Original terminal evaluation did not return a valid reward') + message = original.instruction + PROTOCOL if reset else original.output + data = { + 'task_path': original.task_path, + 'success': original.success, + 'error': original.error, + 'actions_used': self._actions, + 'steps_left': max(0, MAX_CALLS - self._actions), + 'info': original.info, + } + result = ArenaObservation(task_id=self._task_id, message=message, data=data, + reward=original.reward, done=original.done) + if original.done: + self._terminal = result.model_copy(deep=True) + return result + + def _finish(self): + original = self._original.step(Tbench2Action(action_type='evaluate')) + return self._translate(original) + + def step(self, action, timeout_s=None, **kwargs): + with self._lock: + if self._task_id is None: + raise ValueError('Reset before stepping') + if self._terminal is not None: + return self._terminal.model_copy(deep=True) + value = action.action_payload() if isinstance(action, ArenaAction) else ArenaAction.model_validate(action).action_payload() + self._actions += 1 + if value['op'] == 'finish': + return self._finish() + mapped = Tbench2Action(action_type='unsupported_adapter_call') + if value['op'] == 'exec': + mapped = Tbench2Action(action_type='exec', command=value['command']) + elif value['op'] == 'call': + tool, args = value['tool'], value['arguments'] + if tool in ('evaluate', 'finish', 'close') and not args: + # Never forward the original close action: it has no reward. + return self._finish() + if tool == 'write_file' and set(args) == {'file_path', 'content'} and all(isinstance(args[k], str) for k in args): + mapped = Tbench2Action(action_type='write_file', **args) + original = self._original.step(mapped, timeout_s=timeout_s) + if not original.done and self._actions >= MAX_CALLS: + # Execute the last allowed action before grading its resulting artifact. + return self._finish() + return self._translate(original) + + @property + def state(self): + with self._lock: + return State(episode_id=self._original.state.episode_id, step_count=self._actions) + + def close(self): + with self._lock: + # Registry/metadata factories have no episode and must not kill a live + # episode's nobody subprocess during their lifecycle cleanup. + if self._task_id is not None: + self._original.close() + self._task_id = None + self._terminal = None + + def get_metadata(self): + return EnvironmentMetadata(name='terminal_desk_compat', version='0.0.1', + description='dnakhla Terminal Desk tasks with the shared Arena interface.') + + def list_splits(self): + return ['train'] + + def list_tasks(self, split): + if split != 'train': + raise ValueError('Unknown split') + return [{'id': name, 'index': i} for i, name in enumerate(TASK_IDS)] + + def num_tasks(self, split): + return len(self.list_tasks(split)) + + def get_task(self, split, index): + if type(index) is not int or not 0 <= index < len(TASK_IDS): + raise ValueError('Invalid task index') + return self.list_tasks(split)[index] + + def get_task_range(self, split, start=None, stop=None): + return self.list_tasks(split)[start:stop] diff --git a/components/dnakhla/runtime/dnakhla_compat/server.py b/components/dnakhla/runtime/dnakhla_compat/server.py new file mode 100644 index 0000000000000000000000000000000000000000..e388729cda7b234b70b648dc890bd79a878a992b --- /dev/null +++ b/components/dnakhla/runtime/dnakhla_compat/server.py @@ -0,0 +1,15 @@ +from openenv.core.env_server.http_server import create_app +from common.models import ArenaAction, ArenaObservation +from .environment import CompatEnvironment + +app = create_app(CompatEnvironment, ArenaAction, ArenaObservation, + env_name='terminal_desk_compat', max_concurrent_envs=1, mode='production') + + +def main(): + import uvicorn + uvicorn.run(app, host='0.0.0.0', port=8000, log_level='warning') + + +if __name__ == '__main__': + main() diff --git a/components/dnakhla/upstream/openenv.yaml b/components/dnakhla/upstream/openenv.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9769259ab1e53502c4bf649e56aff8fc3f4f73c3 --- /dev/null +++ b/components/dnakhla/upstream/openenv.yaml @@ -0,0 +1,30 @@ +spec_version: 1 +name: terminal_desk +version: 3.0.0 +type: space +runtime: fastapi +app: terminal_desk.server.app:app +port: 8000 +validation: + reward: + range: [0.0, 1.0] + oracle_tolerance: 0.0 + floor_margin: 0.1 + resources: + cpu: 1.0 + memory_mb: 2048 + disk_mb: 10240 + episode_timeout_s: 1500.0 + capabilities: + verifier: + kind: reward_channel + types: + tags: + - software-engineering + - industrial-physical-systems + - natural-science + - office-white-collar + - finance-economics + - mathematics-or-formal-reasoning + - cybersecurity + - media-content-production diff --git a/components/dnakhla/upstream/terminal_desk/__init__.py b/components/dnakhla/upstream/terminal_desk/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/components/dnakhla/upstream/terminal_desk/core/__init__.py b/components/dnakhla/upstream/terminal_desk/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/components/dnakhla/upstream/terminal_desk/core/grading.py b/components/dnakhla/upstream/terminal_desk/core/grading.py new file mode 100644 index 0000000000000000000000000000000000000000..afef9a11a5b0b0394e6c58954f0be6c283659c6f --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/core/grading.py @@ -0,0 +1,418 @@ +"""Check the one output file a task names. Reward is 1.0 when every check passes, else 0.0. + +Checks only parse: no file under the root is executed here. The root is +nobody-writable, so the root process only reads the artifact's bytes behind +read_artifact's lstat guards; xlsx and docx are parsed by a nobody subprocess +that prints a JSON dump (parse_in_sandbox). The sw_fix family runs its hidden +tests itself, as nobody, on a copy (see families/software.py). +""" + +import csv +import io +import json +import math +import os +import re +import time +import wave +from typing import Any + +from ..families.base import Artifact, Built, Field, FileContent +from . import shell + +MAX_ARTIFACT_BYTES = 4 * 1024**2 +SANDBOX_PARSES = ("xlsx", "docx") +LOCAL_PARSES = ("json", "csv", "text", "lines", "srt") +_DUMP_MARK = "@@TD_DUMP@@" + + +def _norm_text(value: Any) -> str: + return " ".join(str(value).strip().split()).casefold() + + +def _as_list(value: Any) -> list | None: + if isinstance(value, list): + return value + if isinstance(value, str): + return [part for part in (p.strip() for p in value.split(",")) if part] + return None + + +def _as_number(value: Any) -> float | None: + if isinstance(value, bool): + return None + if isinstance(value, (int, float)): + return float(value) + if isinstance(value, str): + try: + return float(value.strip().replace(",", "")) + except ValueError: + return None + return None + + +def score_field(field: Field, value: Any, expected: Any) -> float: + if value is None: + return 0.0 + kind = field.kind + if kind == "int": + number = _as_number(value) + return float(number is not None and math.isfinite(number) and number == int(expected)) + if kind == "number": + number = _as_number(value) + if number is None or not math.isfinite(number): + return 0.0 + tol = max(field.tol, field.rel * abs(expected)) + return float(abs(number - expected) <= tol + 1e-12) + if kind == "text": + return float(_norm_text(value) == _norm_text(expected)) + if kind == "list": + items = _as_list(value) + if items is None: + return 0.0 + got = {_norm_text(x) for x in items} + return float(len(got) == len(items) and got == {_norm_text(x) for x in expected}) + raise ValueError(f"unknown field kind {kind!r}") + + +def read_artifact(app: str, path: str) -> bytes | None: + """The file's bytes, or None when it is missing, a symlink, not a regular file, + outside the root dir `app` or over MAX_ARTIFACT_BYTES. lstat first so a FIFO or a link + planted at the path cannot hang or redirect the root-owned reader.""" + app_real = os.path.realpath(app) + full = os.path.join(app_real, path) + if os.path.commonpath([app_real, os.path.realpath(os.path.dirname(full))]) != app_real: + return None + try: + st = os.lstat(full) + except OSError: + return None + import stat + + if not stat.S_ISREG(st.st_mode) or st.st_size > MAX_ARTIFACT_BYTES: + return None + with open(full, "rb") as fh: + return fh.read(MAX_ARTIFACT_BYTES + 1) + + +def _text(data: bytes) -> str: + return data.decode("utf-8-sig", errors="replace").replace("\r\n", "\n") + + +def _fields_by_name(artifact: Artifact) -> dict[str, Field]: + return {f.name: f for f in artifact.fields} + + +def compare_json(artifact: Artifact, data: bytes) -> bool: + got = json.loads(_text(data)) + if not isinstance(got, dict) or set(got) != set(artifact.expected): + return False # exact key set, as the operator's verifiers check + fields = _fields_by_name(artifact) + for key, expected in artifact.expected.items(): + field = fields.get(key) or Field(key, "text") + if score_field(field, got.get(key), expected) != 1.0: + return False + return True + + +def _csv_rows(text: str) -> tuple[list[str], list[dict]]: + reader = csv.DictReader(io.StringIO(text)) + rows = [] + for row in reader: + # DictReader keeps extra cells as a list under None and fills missing cells with None; either is a + # malformed answer, so it is a parse failure (reward 0), never an exception out of the grader. + if None in row or any(v is None for v in row.values()): + raise ValueError("ragged csv row: cell count differs from the header") + rows.append({k.strip(): v.strip() for k, v in row.items()}) + header = [h.strip() for h in (reader.fieldnames or [])] + return header, rows + + +def compare_csv(artifact: Artifact, data: bytes) -> bool: + header, rows = _csv_rows(_text(data)) + fields = _fields_by_name(artifact) + columns = [f.name for f in artifact.fields] + if header != columns: + return False # the exact header the instruction shows + key = tuple(artifact.key) or tuple(columns[:1]) + if any(k not in header for k in key): + return False + + def row_key(row: dict) -> tuple: + return tuple(_norm_text(row.get(k, "")) for k in key) + + expected = {row_key({k: str(v) for k, v in r.items()}): r for r in artifact.expected} + got = {} + for row in rows: + k = row_key(row) + if k in got: + return False # duplicate key row + got[k] = row + if set(got) != set(expected): + return False + if artifact.ordered: + want = [row_key({k: str(v) for k, v in r.items()}) for r in artifact.expected] + if [row_key(r) for r in rows] != want: + return False + for k, want_row in expected.items(): + for column in columns: + if score_field(fields[column], got[k].get(column), want_row[column]) != 1.0: + return False + return True + + +def compare_lines(artifact: Artifact, data: bytes) -> bool: + lines = [_norm_text(ln) for ln in _text(data).split("\n") if ln.strip()] + want = [_norm_text(x) for x in artifact.expected] + if artifact.ordered: + return lines == want + return len(lines) == len(set(lines)) and set(lines) == set(want) + + +_SRT_TIME = re.compile(r"(\d+):(\d\d):(\d\d)[,.](\d{1,3})") + + +def _srt_ms(token: str) -> int: + m = _SRT_TIME.fullmatch(token.strip()) + if not m: + raise ValueError(token) + h, mi, s, ms = m.groups() + return ((int(h) * 60 + int(mi)) * 60 + int(s)) * 1000 + int(ms.ljust(3, "0")) + + +def parse_srt(text: str) -> list[tuple[int, int, str]]: + cues = [] + for block in re.split(r"\n\s*\n", text.strip()): + lines = [ln.rstrip() for ln in block.strip().split("\n")] + if len(lines) < 2: + raise ValueError("short cue") + if "-->" not in lines[0] and "-->" in lines[1]: + lines = lines[1:] + start, end = (t.strip() for t in lines[0].split("-->")) + cues.append((_srt_ms(start), _srt_ms(end), "\n".join(lines[1:]).strip())) + return cues + + +def compare_srt(artifact: Artifact, data: bytes) -> bool: + got = parse_srt(_text(data)) + want = artifact.expected + if len(got) != len(want): + return False + for (gs, ge, gt), (ws, we, wt) in zip(got, want): + if abs(gs - ws) > artifact.tol_ms or abs(ge - we) > artifact.tol_ms: + return False + if _norm_text(gt) != _norm_text(wt): + return False + return True + + +def compare_wav(artifact: Artifact, data: bytes) -> bool: + with wave.open(io.BytesIO(data)) as got, wave.open(io.BytesIO(artifact.expected)) as want: + if (got.getnchannels(), got.getsampwidth(), got.getframerate()) != ( + want.getnchannels(), + want.getsampwidth(), + want.getframerate(), + ): + return False + if got.getnframes() != want.getnframes(): + return False + return got.readframes(got.getnframes()) == want.readframes(want.getnframes()) + + +# The nobody parser for zip containers. It runs with python3 -I, so neither the +# root nor HOME is on sys.path, and prints one marked JSON line. +_SANDBOX_PARSER = r""" +import datetime, json, sys +kind, path = sys.argv[1], sys.argv[2] +def cell(v): + if isinstance(v, (datetime.datetime, datetime.date, datetime.time)): + return v.isoformat() + if isinstance(v, datetime.timedelta): + return v.total_seconds() + if v is None or isinstance(v, (bool, int, float, str)): + return v + return str(v) +if kind == "xlsx": + import openpyxl + values = openpyxl.load_workbook(path, data_only=True, read_only=True) + formulas = openpyxl.load_workbook(path, data_only=False, read_only=True) + out = {"sheets": {}, "formulas": {}} + for ws in values.worksheets: + out["sheets"][ws.title] = [[cell(v) for v in row] for row in ws.iter_rows(values_only=True)] + for ws in formulas.worksheets: + out["formulas"][ws.title] = {c.coordinate: c.value for row in ws.iter_rows() for c in row + if isinstance(c.value, str) and c.value.startswith("=")} +elif kind == "docx": + import docx + d = docx.Document(path) + out = {"paragraphs": [p.text for p in d.paragraphs], + "styles": [p.style.name if p.style is not None else "" for p in d.paragraphs], + "tables": [[[c.text for c in row.cells] for row in t.rows] for t in d.tables]} +else: + raise SystemExit("unknown kind " + kind) +print("@@TD_DUMP@@" + json.dumps(out)) +""" + + +def parse_in_sandbox(root: str, path: str, kind: str) -> Any: + """Parse an xlsx or docx file under root as nobody; return its JSON dump. + xlsx -> {"sheets": {title: [[value, ...], ...]}, "formulas": {title: {"B2": "=SUM(...)"}}} + (values are the cached ones, data_only=True); docx -> {"paragraphs": [str], "styles": [str], + "tables": [[[cell text]]]}. Raises ValueError when the parser fails or prints no dump.""" + if kind not in SANDBOX_PARSES: + raise ValueError(f"no sandbox parser for {kind!r}") + if read_artifact(root, path) is None: + raise ValueError(f"{path} is not a readable regular file under the root") + shell.kill_nobody() + code, text = shell.run(["python3", "-I", "-c", _SANDBOX_PARSER, kind, path], root) + dumps = [ln for ln in text.splitlines() if ln.startswith(_DUMP_MARK)] + if code != 0 or len(dumps) != 1: + raise ValueError(f"{kind} parse failed (exit {code}): {text[-300:]}") + out = json.loads(dumps[0][len(_DUMP_MARK):]) + want = ("sheets", "formulas") if kind == "xlsx" else ("paragraphs", "styles", "tables") + if not isinstance(out, dict) or tuple(sorted(out)) != tuple(sorted(want)): + raise ValueError(f"{kind} dump has keys {sorted(out) if isinstance(out, dict) else type(out)}") + return out + + +def parse_artifact(parse: str, data: bytes) -> Any: + """The in-process parses for kind="checks". json -> the loaded value; csv -> + {"header": [str], "rows": [{column: str}]} (cells and names stripped); text -> str + (utf-8, BOM and CRLF removed); lines -> non-empty lines, stripped; srt -> [(start_ms, end_ms, text)].""" + text = _text(data) + if parse == "json": + return json.loads(text) + if parse == "csv": + header, rows = _csv_rows(text) + return {"header": header, "rows": rows} + if parse == "text": + return text + if parse == "lines": + return [ln.strip() for ln in text.split("\n") if ln.strip()] + if parse == "srt": + return parse_srt(text) + raise ValueError(f"unknown parse {parse!r}") + + +def run_checks(root: str, artifact: Artifact) -> dict[str, bool]: + """kind="checks": test_file_exists, then every named check in order on the parsed file. + A parse failure fails every check; a check that raises fails.""" + names = [name for name, _ in artifact.checks] + if not names or len(set(names)) != len(names) or "test_file_exists" in names: + raise ValueError(f"checks need unique names other than test_file_exists: {names}") + if artifact.parse not in LOCAL_PARSES + SANDBOX_PARSES: + raise ValueError(f"unknown parse {artifact.parse!r}") + data = read_artifact(root, artifact.path) + results = {"test_file_exists": data is not None} + parsed, ok = None, False + if data is not None: + try: + if artifact.parse in SANDBOX_PARSES: + parsed = parse_in_sandbox(root, artifact.path, artifact.parse) + else: + parsed = parse_artifact(artifact.parse, data) + ok = True + except (ValueError, UnicodeError, csv.Error, RecursionError): + ok = False + for name, fn in artifact.checks: + try: + results[name] = ok and fn(parsed) is True + except Exception: + results[name] = False + return results + + +COMPARERS = { + "json": compare_json, + "csv": compare_csv, + "lines": compare_lines, + "srt": compare_srt, + "wav": compare_wav, +} + + +def _stem(path: str) -> str: + return re.sub(r"[^a-z0-9]+", "_", os.path.basename(path).rsplit(".", 1)[0].lower()).strip("_") or "artifact" + + +def verify(app: str, built: Built) -> tuple[float, dict[str, bool], str]: + """Run the checks for the task's artifact. Returns (reward, named results, pytest-style tail).""" + started = time.time() + artifact = built.artifact + stem = _stem(artifact.path) + results: dict[str, bool] = {} + if artifact.kind == "checks": + results = run_checks(app, artifact) + elif artifact.kind == "custom": + exists = read_artifact(app, artifact.path) is not None if artifact.path else True + results[f"test_{stem}_exists"] = exists + try: + results[f"test_{stem}_correct"] = bool(exists and artifact.verify(app)) + except Exception: + results[f"test_{stem}_correct"] = False + else: + data = read_artifact(app, artifact.path) + results[f"test_{stem}_exists"] = data is not None + try: + results[f"test_{stem}_correct"] = data is not None and bool(COMPARERS[artifact.kind](artifact, data)) + except Exception: + results[f"test_{stem}_correct"] = False + passed = sum(results.values()) + failed = len(results) - passed + elapsed = f"{time.time() - started:.2f}s" + if artifact.kind == "checks": + lines = [f"{'PASSED' if ok else 'FAILED'} tests/test_outputs.py::{name}" for name, ok in results.items()] + else: + lines = [f"FAILED tests/test_outputs.py::{name}" for name, ok in results.items() if not ok] + summary = f"{failed} failed, {passed} passed in {elapsed}" if failed else f"{passed} passed in {elapsed}" + return (1.0 if not failed else 0.0), results, "\n".join(lines + [summary]) + + +def render_artifact(artifact: Artifact) -> FileContent: + """Oracle content for tests and replay: what a perfect agent would write.""" + if artifact.render is not None: + return artifact.render() + kind = artifact.kind + if kind == "json": + return json.dumps(artifact.expected, indent=1) + "\n" + if kind == "csv": + columns = [f.name for f in artifact.fields] + out = io.StringIO() + writer = csv.DictWriter(out, fieldnames=columns, lineterminator="\n") + writer.writeheader() + for row in artifact.expected: + writer.writerow({c: row[c] for c in columns}) + return out.getvalue() + if kind == "lines": + return "\n".join(str(x) for x in artifact.expected) + "\n" + if kind == "srt": + blocks = [] + for i, (start, end, text) in enumerate(artifact.expected, 1): + blocks.append(f"{i}\n{_fmt_srt(start)} --> {_fmt_srt(end)}\n{text}") + return "\n\n".join(blocks) + "\n" + if kind == "wav": + return artifact.expected + raise ValueError(f"no renderer for {kind!r}; give the artifact a render callable") + + +def _fmt_srt(ms: int) -> str: + h, rem = divmod(ms, 3600_000) + m, rem = divmod(rem, 60_000) + s, ms = divmod(rem, 1000) + return f"{h:02d}:{m:02d}:{s:02d},{ms:03d}" + + +def oracle_actions(path: str, content) -> list: + """Actions that write an oracle artifact: write_file for text, chunked base64 through exec for bytes.""" + from ..models import Tbench2Action + + if isinstance(content, str): + return [Tbench2Action(action_type="write_file", file_path=path, content=content)] + import base64 + + b64 = base64.b64encode(content).decode() + acts = [Tbench2Action(action_type="exec", command=f'mkdir -p "$(dirname {path})" && : > {path}.b64')] + for i in range(0, len(b64), 60000): + acts.append(Tbench2Action(action_type="exec", command=f"printf %s {b64[i:i + 60000]} >> {path}.b64")) + acts.append(Tbench2Action(action_type="exec", command=f"base64 -d {path}.b64 > {path} && rm {path}.b64")) + return acts diff --git a/components/dnakhla/upstream/terminal_desk/core/shell.py b/components/dnakhla/upstream/terminal_desk/core/shell.py new file mode 100644 index 0000000000000000000000000000000000000000..298b1aa20b759ddc9e482dc01767640785aa2854 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/core/shell.py @@ -0,0 +1,143 @@ +"""Run one agent command in the episode workspace. + +The command runs as nobody when the server is root, so it cannot read the +server code, the generators or the answers held in server memory. Output goes +to a root-owned file so a runaway writer cannot fill server memory, and every +nobody process is killed after each command so nothing lingers between steps +or into grading. Network is not blocked; the sandbox is the outer boundary. +""" + +import os +import resource +import signal +import subprocess +import sys +import tempfile +import time + +WALL_TIMEOUT_S = 20 +CPU_SECONDS = 20 +MEMORY_BYTES = 2 * 1024**3 +FILE_BYTES = 20 * 1024**2 +MAX_PROCESSES = 256 +# A safety cap only. The operator's wrapper does not cut output; the arena's token budget +# ends an episode whose observation no longer fits, and that is the pressure to train under. +MAX_OUTPUT_CHARS = 60000 +NOBODY = 65534 + +IS_ROOT = os.geteuid() == 0 +# The server's own interpreter comes first: /usr/local/bin in the image (a no-op), the +# checkout's venv in tests, so agent commands and the xlsx/docx parser see the task libraries. +PATH = ":".join(dict.fromkeys([os.path.dirname(sys.executable), "/usr/local/bin", "/usr/bin", "/bin"])) + + +def _limits() -> None: + resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) + resource.setrlimit(resource.RLIMIT_CPU, (CPU_SECONDS, CPU_SECONDS + 1)) + resource.setrlimit(resource.RLIMIT_AS, (MEMORY_BYTES, MEMORY_BYTES)) + resource.setrlimit(resource.RLIMIT_FSIZE, (FILE_BYTES, FILE_BYTES)) + resource.setrlimit(resource.RLIMIT_NOFILE, (256, 256)) + if IS_ROOT: + resource.setrlimit(resource.RLIMIT_NPROC, (MAX_PROCESSES, MAX_PROCESSES)) + os.setgroups([]) + os.setgid(NOBODY) + os.setuid(NOBODY) + + +def kill_nobody() -> None: + """SIGKILL every process owned by nobody (no-op unless root).""" + if not IS_ROOT: + return + for _ in range(3): + found = False + for pid in os.listdir("/proc"): + if not pid.isdigit(): + continue + try: + if os.stat(f"/proc/{pid}").st_uid == NOBODY: + os.kill(int(pid), signal.SIGKILL) + found = True + except (FileNotFoundError, ProcessLookupError, PermissionError): + pass + if not found: + return + time.sleep(0.05) + + +def give_to_nobody(path: str) -> None: + if not IS_ROOT: + return + for dirpath, dirnames, filenames in os.walk(path): + os.chown(dirpath, NOBODY, NOBODY) + for name in filenames: + os.chown(os.path.join(dirpath, name), NOBODY, NOBODY) + + +def cut(text: str, limit: int = MAX_OUTPUT_CHARS) -> str: + if len(text) <= limit: + return text + head = int(limit * 0.75) + tail = limit - head + return f"{text[:head]}\n...[{len(text) - limit} characters cut]...\n{text[-tail:]}" + + +def run(argv: list[str], cwd: str, stdin_text: str | None = None) -> tuple[int, str]: + """Run argv as nobody in cwd. Returns (exit code, combined output, uncut).""" + env = { + "PATH": PATH, + "HOME": cwd, + "LANG": "C.UTF-8", + "TERM": "dumb", + "PYTHONDONTWRITEBYTECODE": "1", + } + with tempfile.TemporaryFile() as sink: + proc = subprocess.Popen( + argv, + cwd=cwd, + env=env, + stdin=subprocess.PIPE if stdin_text is not None else subprocess.DEVNULL, + stdout=sink, + stderr=subprocess.STDOUT, + preexec_fn=_limits, + start_new_session=True, + ) + timed_out = False + try: + proc.communicate( + input=stdin_text.encode() if stdin_text is not None else None, + timeout=WALL_TIMEOUT_S, + ) + except subprocess.TimeoutExpired: + timed_out = True + finally: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + proc.wait() + kill_nobody() + sink.seek(0) + raw = sink.read(4 * 1024**2) + text = raw.decode("utf-8", errors="replace") + code = proc.returncode + if timed_out: + text += f"\n[stopped: {WALL_TIMEOUT_S} s time limit]" + code = 124 + elif code == -signal.SIGXCPU: + text += f"\n[stopped: {CPU_SECONDS} s CPU limit]" + elif code == -signal.SIGXFSZ: + text += "\n[stopped: file size limit (20 MB)]" + return code, text + + +def run_command(cmd: str, cwd: str) -> tuple[int, str]: + code, text = run(["/bin/bash", "-c", cmd], cwd) + text = text.rstrip("\n") + return code, cut(text) if text else "" + + +def write_file(path: str, content: str, cwd: str) -> tuple[int, str]: + """Write content to path (relative to cwd unless absolute) as nobody, creating parents. + Running as nobody is the path check: the server tree and system files are not writable.""" + script = 'mkdir -p -- "$(dirname -- "$1")" && cat > "$1"' + return run(["/bin/sh", "-c", script, "sh", path], cwd, stdin_text=content) diff --git a/components/dnakhla/upstream/terminal_desk/families/__init__.py b/components/dnakhla/upstream/terminal_desk/families/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe4f214ba9137a17d8a6bdc9b1502efb3bf18c8d --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/__init__.py @@ -0,0 +1,21 @@ +"""Registry of task families. A task id is '-L', e.g. 'ind_tank-L2'.""" + +from . import finance, finance3, industrial, industrial3, mathematics, mathematics3, media, media3, office, office3, science, science3, security, security3, software, software3 +from .base import Family + +FAMILIES: dict[str, Family] = { + f.id: f + for module in (software, industrial, industrial3, science, office, finance, mathematics, security, media, office3, security3, mathematics3, science3, media3, software3, finance3) + for f in module.FAMILIES +} + + +def parse_task_id(task_id: str) -> tuple[str, int]: + family_id, _, level = task_id.rpartition("-L") + if family_id not in FAMILIES or not level.isdigit() or int(level) not in FAMILIES[family_id].levels: + raise ValueError(f"unknown task_id {task_id!r}") + return family_id, int(level) + + +def all_task_ids() -> list[str]: + return [f"{fid}-L{lv}" for fid, fam in FAMILIES.items() for lv in fam.levels] diff --git a/components/dnakhla/upstream/terminal_desk/families/base.py b/components/dnakhla/upstream/terminal_desk/families/base.py new file mode 100644 index 0000000000000000000000000000000000000000..537e5cc087d950611f57ada4c2405c1d36786e86 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/base.py @@ -0,0 +1,78 @@ +"""Shared types for task families. + +A family builds one instance per reset from a random generator: the task +instruction, the workspace files and the one output file the verifier checks. +The expected content stays in server memory; only the input files reach the +family's root (/app for v2 families, /root or /app for v3 families). +""" + +import random +from dataclasses import dataclass, field +from typing import Any, Callable, Union + +FileContent = Union[str, bytes] + + +@dataclass +class Field: + """One compared value: a JSON key or a CSV column. kind: int, number, text.""" + + name: str + kind: str + desc: str = "" + tol: float = 0.0 + rel: float = 0.0 + + +@dataclass +class Artifact: + """The file the agent must produce, and how it is checked (all or nothing). + + path: relative to the family root (Built.root), e.g. "output/schedule.csv". + kind: json | csv | lines | srt | wav | custom | checks. + expected: json -> dict; csv -> list of row dicts; lines -> list of str; + srt -> list of (start_ms, end_ms, text); wav -> bytes; custom -> unused. + fields: json/csv comparers per key or column (reuse Field tolerances). + key: csv key column(s); rows are matched by key. ordered: csv/lines keep order. + verify: custom check, root dir -> bool. render: oracle content for wav/custom/checks. + + kind="checks" (v3): the grader reads the file, parses it as `parse` + (json | csv | text | lines | srt | xlsx | docx, see grading.parse_artifact) + and runs `checks`, a list of (name, fn(parsed) -> bool), in order after the + implicit test_file_exists. A check that raises fails. Names start with test_. + """ + + path: str + kind: str + expected: Any = None + fields: list = field(default_factory=list) + key: tuple = () + ordered: bool = False + tol_ms: int = 1 + verify: Callable[[str], bool] | None = None + render: Callable[[], FileContent] | None = None + parse: str = "json" + checks: list = field(default_factory=list) + + +@dataclass +class Built: + instruction: str # names the output by absolute path under root; v2 <= 700 chars, v3 600-1,000 + files: dict[str, FileContent] # keys relative to root + artifact: Artifact + notes: dict = field(default_factory=dict) + root: str = "/app" # the episode workspace: "/app" or "/root"; fixed per family + + +@dataclass +class Family: + id: str + domain: str + title: str + build: Callable[[int, random.Random], Built] + levels: tuple = (1, 2, 3) + v3: bool = False # v3 bands in tools/check_family.py and an oracle script in terminal_desk/oracles/ + + +def money(x: float) -> str: + return f"{x:.2f}" diff --git a/components/dnakhla/upstream/terminal_desk/families/finance.py b/components/dnakhla/upstream/terminal_desk/families/finance.py new file mode 100644 index 0000000000000000000000000000000000000000..db88a0d592978734dba321c834b3fbdc46353d4b --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/finance.py @@ -0,0 +1,228 @@ +"""Finance: amortize a loan with extras and a rate reset; value a portfolio through corporate actions.""" + +import datetime as dt +import random +from decimal import ROUND_HALF_UP, Decimal, getcontext + +from .base import Artifact, Built, Family, Field + +getcontext().prec = 40 +CENT = Decimal("0.01") + +# ---------------------------------------------------------------- fin_loan + + +def _r(x: Decimal) -> Decimal: + return x.quantize(CENT, rounding=ROUND_HALF_UP) + + +def _payment(balance: Decimal, annual_pct: Decimal, months: int) -> Decimal: + i = annual_pct / 1200 + return _r(balance * i / (1 - (1 + i) ** -months)) + + +def build_loan(level: int, rng: random.Random) -> Built: + while True: + principal = Decimal(rng.randrange(100, 4000) * 100) + rate = Decimal(f"{rng.uniform(3, 9):.3f}") + months = rng.choice([60, 120, 180, 240, 360]) + extras = {} + if level >= 2: + for m in rng.sample(range(6, months // 2), rng.randint(2, 4)): + extras[m] = Decimal(rng.randrange(5, 60) * 100) + reset_month, new_rate = None, None + if level == 3: + reset_month = rng.randint(13, min(60, months - 12)) + new_rate = Decimal(f"{float(rate) + rng.uniform(-1.5, 2.5):.3f}") + pay = _payment(principal, rate, months) + bal, cur_rate, month, new_pay = principal, rate, 0, None + rows = [] + while bal > 0: + month += 1 + if reset_month and month == reset_month: + cur_rate = new_rate + pay = new_pay = _payment(bal, new_rate, months - month + 1) + interest = _r(bal * cur_rate / 1200) + if bal + interest <= pay or month == months: + rows.append({"month": month, "payment": float(bal + interest), "interest": float(interest), + "principal": float(bal), "balance": 0.0}) + bal = Decimal(0) + break + bal -= pay - interest + row = {"month": month, "payment": float(pay), "interest": float(interest), "principal": float(pay - interest)} + if month in extras: + bal -= min(extras[month], bal) + row["balance"] = float(bal) + rows.append(row) + if level < 3 or new_pay is not None: + break + lines = [ + f"Principal: {principal}", + f"Annual interest rate: {rate}% (monthly rate = annual rate / 12)", + f"Term: {months} months", + "Monthly payment: the standard annuity payment for the term, rounded to the cent.", + ] + if extras: + lines.append("Extra principal payments (made right after that month's regular payment):") + lines += [f" month {m}: {v}" for m, v in sorted(extras.items())] + if reset_month: + lines.append( + f"Rate reset: from month {reset_month} the annual rate is {new_rate}%. At that point the payment is " + f"recomputed as the annuity payment on the balance then owed over the {months - reset_month + 1} " + "months left, rounded to the cent." + ) + files = {"loan.txt": "\n".join(lines) + "\n"} + instruction = ( + "loan.txt in /app describes a loan. Write its amortization schedule to /app/schedule.csv with the header " + "month,payment,interest,principal,balance and one row per month until the loan is paid off, for example " + "1,1932.56,500.00,1432.56,98567.44. Interest = balance x monthly rate, rounded half up to the cent; " + "principal = payment - interest; balance is what remains after the row, after any extra payment that " + "month. If balance plus interest is no more than the payment (or in the last month of the term), that row " + "pays exactly balance plus interest and the balance is 0." + ) + artifact = Artifact( + path="schedule.csv", + kind="csv", + key=("month",), + ordered=True, + fields=[ + Field("month", "int"), + Field("payment", "number", tol=0.005), + Field("interest", "number", tol=0.005), + Field("principal", "number", tol=0.005), + Field("balance", "number", tol=0.005), + ], + expected=rows, + ) + return Built(instruction=instruction, files=files, artifact=artifact, notes={"payoff_month": month}) + + +# ---------------------------------------------------------------- fin_portfolio + +TICKERS = ["ALDR", "BRKS", "CNDL", "DRFT", "EMBR", "FJRD"] + + +def _trading_days(start: dt.date, n: int) -> list[dt.date]: + out, d = [], start + while len(out) < n: + if d.weekday() < 5: + out.append(d) + d += dt.timedelta(days=1) + return out + + +def build_portfolio(level: int, rng: random.Random) -> Built: + n_tick, n_days, n_trades = {1: (3, 20, 5), 2: (4, 40, 9), 3: (5, 60, 13)}[level] + while True: + tickers = rng.sample(TICKERS, n_tick) + days = _trading_days(dt.date(2026, 6, 1), n_days) + split = None + if level >= 2: + split = (rng.choice(tickers), days[rng.randint(n_days // 3, 2 * n_days // 3)], rng.choice([2, 3])) + closes = {} + for t in tickers: + p = rng.uniform(20, 300) + for d in days: + p *= 1 + rng.gauss(0.0005, 0.018) + adj = p / split[2] if split and t == split[0] and d >= split[1] else p + closes[(d, t)] = Decimal(f"{adj:.2f}") + divs = [] + if level == 3: + for t in rng.sample(tickers, 2): + d = rng.choice(days[3:-1]) + if split and d == split[1]: + continue + divs.append((d, t, Decimal(f"{rng.uniform(0.2, 1.5):.2f}"))) + cash = Decimal(100000) + hold = {t: 0 for t in tickers} + trade_days = sorted(rng.sample(days[:-2], n_trades)) + trades, div_income = [], Decimal(0) + events = sorted( + ([(split[1], 0, "split", None)] if split else []) + + [(d, 1, "div", (t, v)) for d, t, v in divs] + + [(d, 2, "trade", None) for d in trade_days], + key=lambda e: (e[0], e[1]), + ) + ok = True + for d, _, kind, info in events: + if kind == "split": + hold[split[0]] *= split[2] + elif kind == "div": + t, v = info + div_income += v * hold[t] # holdings at the end of the previous trading day + cash += v * hold[t] + else: + t = rng.choice(tickers) + price = closes[(d, t)] + Decimal(f"{rng.uniform(-0.5, 0.5):.2f}") + if hold[t] > 0 and rng.random() < 0.35: + qty, side = rng.randint(1, hold[t]), "SELL" + cash += qty * price + hold[t] -= qty + else: + qty, side = rng.randint(5, 200), "BUY" + if qty * price > cash: + ok = False + break + cash -= qty * price + hold[t] += qty + trades.append((d, t, side, qty, price)) + if not ok: + continue + last = days[-1] + values = {t: hold[t] * closes[(last, t)] for t in tickers} + ranked = sorted(values.items(), key=lambda kv: -kv[1]) + if ranked[0][1] > 0 and (len(ranked) < 2 or ranked[0][1] - ranked[1][1] > 50): + break + files = { + "prices.csv": "date,ticker,close\n" + + "".join(f"{d.isoformat()},{t},{closes[(d, t)]}\n" for d in days for t in tickers), + "trades.csv": "date,ticker,side,shares,price\n" + + "".join(f"{d.isoformat()},{t},{s},{q},{p}\n" for d, t, s, q, p in trades), + } + notes = [] + if split or divs: + lines = [] + if split: + lines.append( + f"{split[1].isoformat()} {split[0]} {split[2]}-for-1 stock split before the open: every share held " + "becomes " + str(split[2]) + " shares. Closes and trades from that date on are post-split." + ) + for d, t, v in sorted(divs): + lines.append( + f"{d.isoformat()} {t} cash dividend of {v} per share, paid on shares held at the end of the " + "previous trading day." + ) + files["corporate_actions.txt"] = "\n".join(lines) + "\n" + notes.append("Apply corporate_actions.txt.") + instruction = ( + "prices.csv and trades.csv in /app are a brokerage account's daily closes and trades. The account starts " + "with 100000.00 in cash and no shares; trades execute at their listed price (BUY spends cash, SELL adds " + "it; no fees). " + " ".join(notes) + f" Write /app/positions.csv with the header ticker,shares,close," + f"market_value: one row per ticker still held after the last date in prices.csv ({last.isoformat()}), " + "with its shares, that day's close and shares x close, plus a row CASH,0,0,. " + "Example: ALDR,120,45.10,5412.00" + ) + rows = [ + {"ticker": t, "shares": float(hold[t]), "close": float(closes[(last, t)]), "market_value": float(values[t])} + for t in tickers + if hold[t] > 0 + ] + [{"ticker": "CASH", "shares": 0.0, "close": 0.0, "market_value": float(cash)}] + artifact = Artifact( + path="positions.csv", + kind="csv", + key=("ticker",), + fields=[ + Field("ticker", "text"), + Field("shares", "number", tol=1e-6), + Field("close", "number", tol=0.005), + Field("market_value", "number", tol=0.01), + ], + expected=rows, + ) + return Built(instruction=instruction, files=files, artifact=artifact, notes={"dividend_income": float(div_income)}) + + +FAMILIES = [ + Family("fin_loan", "finance and economics", "Amortize a loan", build_loan), + Family("fin_portfolio", "finance and economics", "Value a portfolio", build_portfolio), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/finance3.py b/components/dnakhla/upstream/terminal_desk/families/finance3.py new file mode 100644 index 0000000000000000000000000000000000000000..04d96ba670a605f51f261f6c8eced93145c7bb02 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/finance3.py @@ -0,0 +1,428 @@ +"""Finance v3: amortize one loan from a loan book, value a brokerage account, screen invoices for fraud. + +All three are stdlib csv/json tasks rooted at /root. Each generator computes its expected answer itself; +the oracle scripts in terminal_desk/oracles/ only prove the files carry everything the answer needs. +""" + +import datetime as dt +import json +import random +from decimal import Decimal + +from .base import Artifact, Built, Family +from .finance import TICKERS, _payment, _r, _trading_days + +TOL = 0.005 + 1e-9 # "to the cent": a value two-decimal rounded the same way passes, one cent off fails + + +def _num(s) -> float: + return float(str(s).strip()) + + +def _col_close(rows: list[dict], want: list[dict], col: str, tol: float = TOL) -> bool: + return len(rows) == len(want) and all(abs(_num(r[col]) - w[col]) <= tol for r, w in zip(rows, want)) + + +# ---------------------------------------------------------------- fin3_loan_schedule + +LOAN_TERMS = (36, 48, 60) + + +class Overpaid(Exception): + """An extra would clear the loan; the instruction does not cover that case, so the generator resamples.""" + + +def _loan_id(rng: random.Random, used: set) -> str: + while True: + lid = f"LN-{rng.randrange(1000, 10000)}" + if lid not in used: + used.add(lid) + return lid + + +def _amortize(principal: Decimal, rate: Decimal, term: int, extras: dict, reset) -> list[dict]: + """The schedule, in Decimal: v2 build_loan arithmetic plus an extra column. reset = (month, new_rate) or None.""" + pay, bal, cur, month, rows = _payment(principal, rate, term), principal, rate, 0, [] + while bal > 0: + month += 1 + if reset and month == reset[0]: + cur = reset[1] + pay = _payment(bal, cur, term - month + 1) + interest = _r(bal * cur / 1200) + if bal + interest <= pay or month == term: + rows.append({"month": month, "payment": bal + interest, "interest": interest, "principal": bal, + "extra": Decimal(0), "balance": Decimal(0)}) + break + bal -= pay - interest + extra = extras.get(month, Decimal(0)) + if extra >= bal: + raise Overpaid(f"month {month}: extra {extra} >= balance {bal}") + bal -= extra + rows.append({"month": month, "payment": pay, "interest": interest, "principal": pay - interest, + "extra": extra, "balance": bal}) + return rows + + +def build_loan_schedule(level: int, rng: random.Random) -> Built: + n_book = {1: 130, 2: 140, 3: 150}[level] + while True: + used: set = set() + book = [(_loan_id(rng, used), Decimal(rng.randrange(100, 900) * 100), Decimal(f"{rng.uniform(4, 8):.3f}"), + rng.choice(LOAN_TERMS)) for _ in range(n_book)] + target = rng.randrange(n_book) + lid, principal, rate, term = book[target] + extras, ledger, reset, resets, reversed_m = {}, [], None, [], 0 + if level >= 2: + months = rng.sample(range(3, term // 2), rng.randint(3, 4)) + months.append(rng.choice(months)) # two extras on one payment add up + for m in months: + amt = Decimal(rng.randrange(5, 40) * 100) + extras[m] = extras.get(m, Decimal(0)) + amt + ledger.append((lid, m, amt, "POSTED")) + if level == 3: # a reversed extra that would change the answer if applied + reversed_m = rng.choice([m for m in range(3, term // 2) if m not in extras]) + ledger.append((lid, reversed_m, Decimal(rng.randrange(5, 40) * 100), "REVERSED")) + for other, _, _, oterm in rng.sample(book[:target] + book[target + 1:], 30): + for m in rng.sample(range(2, oterm // 2), rng.randint(1, 3)): + status = "REVERSED" if level == 3 and rng.random() < 0.15 else "POSTED" + ledger.append((other, m, Decimal(rng.randrange(5, 40) * 100), status)) + rng.shuffle(ledger) + if level == 3: + reset = (rng.randint(max(extras) + 1, term - 12), Decimal(f"{float(rate) + rng.uniform(-1.5, 2.5):.3f}")) + resets = [(lid,) + reset] + [(o, rng.randint(13, t - 12), Decimal(f"{float(r) + rng.uniform(-1, 2):.3f}")) + for o, _, r, t in rng.sample(book[:target] + book[target + 1:], 14)] + rng.shuffle(resets) + try: + rows = _amortize(principal, rate, term, extras, reset) + except Overpaid: + continue + payoff = rows[-1]["month"] + if max([0, reversed_m, *extras]) >= payoff or reset and reset[0] >= payoff: + continue + break + files = { + "data/loans.csv": "loan_id,principal,annual_rate_pct,term_months\n" + + "".join(f"{i},{p},{r},{t}\n" for i, p, r, t in book), + "data/ticket.txt": f"Ticket: SRV-{rng.randrange(10000, 99999)}\nLoan: {lid}\n" + "Request: rebuild the repayment schedule; the borrower disputes the balance on the statement.\n", + } + cols = ["month", "payment", "interest", "principal"] + (["extra"] if level >= 2 else []) + ["balance"] + inputs = f"ticket /root/data/ticket.txt names loan {lid}." + ( + " Its terms are in the loan book /root/data/loans.csv (loan_id, principal, annual_rate_pct, term_months)" + if level < 3 else " The loan book /root/data/loans.csv") + steps = [ + "Payment = annuity payment on the principal over the term at monthly rate annual rate / 1200.", + "Each month: interest = balance x monthly rate; principal = payment - interest. Round every payment and " + "interest half up to the cent.", + ] + if level >= 2: + files["data/extra_payments.csv"] = "loan_id,payment_no,amount" + (",status" if level == 3 else "") + "\n" + ( + "".join(f"{a},{m},{v:.2f}" + (f",{s}" if level == 3 else "") + "\n" for a, m, v, s in ledger)) + inputs += (". /root/data/extra_payments.csv (loan_id, payment_no, amount) covers every loan" if level == 2 else + ", /root/data/extra_payments.csv and /root/data/rate_resets.csv cover every loan") + steps.append("Extras are paid right after the regular payment with that payment_no and add up" + + ("; REVERSED rows were never paid." if level == 3 else ".")) + if level == 3: + files["data/rate_resets.csv"] = "loan_id,from_payment,new_rate_pct\n" + "".join( + f"{a},{m},{r}\n" for a, m, r in resets) + steps.append("From a reset's from_payment on, use new_rate_pct and re-amortize the balance then owed over the " + "payments left, this one included.") + steps.append("If balance + interest <= payment, or in the term's last month, pay balance + interest, set " + "balance to 0 and stop.") + ex_p, ex_r = Decimal(rng.randrange(100, 900) * 100), Decimal(f"{rng.uniform(4, 8):.3f}") # another loan + ex_i = _r(ex_p * ex_r / 1200) + ex_pay = _payment(ex_p, ex_r, rng.choice(LOAN_TERMS)) + ex_vals = {"payment": ex_pay, "interest": ex_i, "principal": ex_pay - ex_i, "extra": Decimal(0), + "balance": ex_p - ex_pay + ex_i} + example = ",".join("1" if c == "month" else f"{ex_vals[c]:.2f}" for c in cols) + opener = rng.choice(["A borrower disputes a statement:", "Servicing needs a fixed schedule:"]) + instruction = ( + f"{opener} {inputs}.\n\n" + "\n".join(f"{i}. {s}" for i, s in enumerate(steps, 1)) + + f"\n\nWrite /root/schedule.csv with header {','.join(cols)}, one row per month from 1, two decimals, " + f"e.g.\n{example}\nValues must match to the cent." + ) + want = [{c: float(r[c]) for c in cols} for r in rows] + + def render() -> str: + return ",".join(cols) + "\n" + "".join( + ",".join(str(r["month"]) if c == "month" else f"{r[c]:.2f}" for c in cols) + "\n" for r in rows) + + checks = [ + ("test_header", lambda p: p["header"] == cols), + ("test_row_count", lambda p: len(p["rows"]) == len(want)), + ("test_months_in_order", lambda p: [r["month"] for r in p["rows"]] == [str(i) for i in range(1, payoff + 1)]), + ] + [(f"test_{c}", lambda p, c=c: _col_close(p["rows"], want, c)) for c in cols[1:]] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="schedule.csv", kind="checks", parse="csv", checks=checks, render=render), + notes={"payoff_month": payoff, "loan_id": lid}, + root="/root", + ) + + +# ---------------------------------------------------------------- fin3_portfolio_value + + +def build_portfolio_value(level: int, rng: random.Random) -> Built: + n_tick, n_days, n_trades = {1: (4, 30, 6), 2: (5, 36, 10), 3: (6, 40, 14)}[level] + while True: + tickers = sorted(rng.sample(TICKERS, n_tick)) + days = _trading_days(dt.date(2026, 6, 1) + dt.timedelta(days=rng.randrange(0, 60)), n_days) + split = None + if level >= 2: + split = (rng.choice(tickers), days[rng.randint(n_days // 3, 2 * n_days // 3)], rng.choice([2, 3])) + closes = {} + for t in tickers: + p = rng.uniform(20, 300) + for d in days: + p *= 1 + rng.gauss(0.0005, 0.018) + adj = p / split[2] if split and t == split[0] and d >= split[1] else p + closes[(d, t)] = Decimal(f"{adj:.2f}") + divs = [] + if level == 3: + for t in rng.sample(tickers, 2): + d = rng.choice(days[3:-1]) + if not (split and d == split[1]): + divs.append((d, t, Decimal(f"{rng.uniform(0.2, 1.5):.2f}"))) + cash, hold = Decimal(100000), {t: 0 for t in tickers} + trades = [] + events = sorted(([(split[1], 0, "split", None)] if split else []) + + [(d, 1, "div", (t, v)) for d, t, v in divs] + + [(d, 2, "trade", None) for d in sorted(rng.sample(days[:-2], n_trades))], + key=lambda e: (e[0], e[1])) + ok, paid, split_shares = True, Decimal(0), 0 + for d, _, kind, info in events: + if kind == "split": + split_shares = hold[split[0]] + hold[split[0]] *= split[2] + elif kind == "div": + paid += info[1] * hold[info[0]] # shares held at the end of the previous trading day + cash += info[1] * hold[info[0]] + else: + t = rng.choice(tickers) + price = closes[(d, t)] + Decimal(f"{rng.uniform(-0.5, 0.5):.2f}") + if hold[t] > 0 and rng.random() < 0.35: + qty, side = rng.randint(1, hold[t]), "SELL" + cash += qty * price + hold[t] -= qty + else: + qty, side = rng.randint(5, 200), "BUY" + if qty * price > cash: + ok = False + break + cash -= qty * price + hold[t] += qty + trades.append((d, t, side, qty, price)) + if not ok or sum(1 for t in tickers if hold[t]) < 2: + continue + if split and not (split_shares and hold[split[0]]) or divs and paid == 0: # the caveat changes the answer + continue + break + last = days[-1] + want = {t: (hold[t], closes[(last, t)], hold[t] * closes[(last, t)]) for t in tickers if hold[t] > 0} + want["CASH"] = (0, Decimal(0), cash) + files = { + "data/prices.csv": "date,ticker,close\n" + "".join(f"{d.isoformat()},{t},{closes[(d, t)]}\n" + for d in days for t in tickers), + "data/trades.csv": "date,ticker,side,shares,price\n" + "".join(f"{d.isoformat()},{t},{s},{q},{p}\n" + for d, t, s, q, p in trades), + } + caveat = "" + if level >= 2: + lines = [f"{split[1].isoformat()} {split[0]} {split[2]}-for-1 stock split before the open: every share held " + f"becomes {split[2]} shares. Closes and trades from that date on are post-split."] + lines += [f"{d.isoformat()} {t} cash dividend of {v} per share, paid on shares held at the end of the previous " + "trading day." for d, t, v in sorted(divs)] + files["data/corporate_actions.txt"] = "\n".join(lines) + "\n" + caveat = " Apply every event in /root/data/corporate_actions.txt on its date, before that day's trades." + ex_t = rng.choice(("GLNT", "HRBR", "KSTL")) # not a ticker in any instance + ex_q, ex_c = rng.randint(5, 300), Decimal(rng.randrange(2000, 30000)) / 100 + opener = rng.choice([ + "You are reconciling a brokerage account for the month-end report.", + "The operations team needs a month-end valuation of a brokerage account.", + ]) + instruction = ( + f"{opener} /root/data/prices.csv holds daily closes (date, ticker, close) and /root/data/trades.csv the " + "account's trades (date, ticker, side, shares, price).\n\n" + "The account starts with 100000.00 in cash and no shares. Replay the trades in date order: a BUY spends " + "shares x price in cash, a SELL adds it, with no fees." + caveat + "\n\n" + f"Write /root/positions.csv with the header ticker,shares,close,market_value: one row per ticker still held " + f"after the last date in prices.csv ({last.isoformat()}), with its shares, that day's close and shares x " + "close; leave out tickers with zero shares. Add a final row CASH,0,0,. Money has two " + f"decimals, for example:\n{ex_t},{ex_q},{ex_c:.2f},{ex_q * ex_c:.2f}\n" + "Shares must match exactly and money to the cent." + ) + + def render() -> str: + return "ticker,shares,close,market_value\n" + "".join( + f"{t},{s},{c:.2f},{v:.2f}\n" for t, (s, c, v) in want.items()) + + def by_ticker(p): + return {r["ticker"]: r for r in p["rows"]} + + checks = [ + ("test_header", lambda p: p["header"] == ["ticker", "shares", "close", "market_value"]), + ("test_tickers", lambda p: len(p["rows"]) == len(want) and set(by_ticker(p)) == set(want)), + ("test_shares", lambda p: all(_num(by_ticker(p)[t]["shares"]) == s for t, (s, _, _) in want.items())), + ("test_close", lambda p: all(abs(_num(by_ticker(p)[t]["close"]) - float(c)) <= TOL + for t, (_, c, _) in want.items() if t != "CASH")), + ("test_market_value", lambda p: all(abs(_num(by_ticker(p)[t]["market_value"]) - float(v)) <= 0.01 + 1e-9 + for t, (_, _, v) in want.items() if t != "CASH")), + ("test_cash", lambda p: abs(_num(by_ticker(p)["CASH"]["market_value"]) - float(cash)) <= 0.01 + 1e-9), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="positions.csv", kind="checks", parse="csv", checks=checks, render=render), + notes={"dividend_income": float(paid), "split_shares": split_shares}, + root="/root", + ) + + +# ---------------------------------------------------------------- fin3_invoice_fraud + +TOLERANCE_PCT = 2 # an amount more than 2% away from its PO amount is out of tolerance +REASONS = ("Unknown Vendor", "Missing PO", "Amount Mismatch", "Duplicate Invoice") + + +def _screen(invoices: list[tuple], vendors: dict | None, pos: dict, level: int) -> list[dict]: + """The rules in order, first match wins. invoices: (invoice_no, vendor_id, po_number, amount).""" + report, seen = [], set() + for row, (no, vid, po, amt) in enumerate(invoices, 1): + reason = None + if vendors is not None and vendors.get(vid) != "ACTIVE": + reason = "Unknown Vendor" + elif level >= 2 and po not in pos: + reason = "Missing PO" + elif abs(amt - pos[po]) * 100 > TOLERANCE_PCT * pos[po]: + reason = "Amount Mismatch" + elif level == 3 and (vid, no) in seen: + reason = "Duplicate Invoice" + seen.add((vid, no)) + if reason: + report.append({"row": row, "invoice_no": no, "amount": float(amt), "reason": reason}) + return report + + +def build_invoice_fraud(level: int, rng: random.Random) -> Built: + n_inv, n_spare = {1: (70, 30), 2: (80, 30), 3: (90, 25)}[level] + live = REASONS[2:3] if level == 1 else REASONS[:3] if level == 2 else REASONS + while True: + vendor_ids = rng.sample(range(101, 200), 18) + listed = vendor_ids[:14] # in vendors.csv; the last four are not + inactive = set(rng.sample(listed, 2)) + vendors = {f"V{v}": ("INACTIVE" if v in inactive else "ACTIVE") for v in listed} + good = [f"V{v}" for v in listed if v not in inactive] + bad = [f"V{v}" for v in inactive] + [f"V{v}" for v in vendor_ids[14:]] + po_nums = [f"PO-{n}" for n in rng.sample(range(1000, 10000), n_inv + n_spare + 10)] + pos = {n: Decimal(rng.randrange(10000, 2000000)) / 100 for n in po_nums[:n_inv + n_spare]} + po_vendor = {n: rng.choice(good) for n in pos} + ghost_pos = po_nums[n_inv + n_spare:] # never issued + inv_nos = iter(rng.sample(range(10000, 100000), n_inv + 5)) + free = list(pos)[:n_inv] + invoices = [] + for i in range(n_inv): + po = free[i] + vid, amt = po_vendor[po], pos[po] + roll = rng.random() + if roll < 0.35: # clean but not exact: inside the tolerance + amt = _r(amt * (1 + Decimal(rng.uniform(-1.5, 1.5)) / 100)) + elif roll < 0.55: + amt = _r(amt * (1 + Decimal(rng.choice((-1, 1)) * rng.uniform(3, 25)) / 100)) + elif level >= 2 and roll < 0.67: + vid = rng.choice(bad) + if rng.random() < 0.5: # also out of tolerance: the order decides the reason + amt = _r(amt * Decimal("1.1")) + elif level >= 2 and roll < 0.79: + po = rng.choice(["", rng.choice(ghost_pos)]) + invoices.append((f"INV-{next(inv_nos)}", vid, po, amt)) + if level == 3: + for k in rng.sample(range(n_inv // 3), 3): # resubmissions of earlier invoices, appended later + no, vid, po, amt = invoices[k] + if rng.random() < 0.3: + amt = _r(amt * Decimal("1.08")) # resubmitted and inflated: Amount Mismatch outranks Duplicate + invoices.insert(rng.randrange(k + 5, len(invoices)), (no, vid, po, amt)) + k = rng.randrange(len(invoices)) # same number, another vendor: not a duplicate + no = invoices[k][0] + spare = next(n for n in list(pos)[n_inv:] if po_vendor[n] != invoices[k][1]) + invoices.insert(rng.randrange(k + 1, len(invoices) + 1), (no, po_vendor[spare], spare, pos[spare])) + report = _screen(invoices, vendors if level >= 2 else None, pos, level) + reasons = [r["reason"] for r in report] + if not all(reasons.count(x) >= 2 for x in live): + continue + if not 0.15 <= len(report) / len(invoices) <= 0.4: + continue + if level >= 2: # the status caveat, the unlisted vendor and the rule order each change the answer + used = {vid for _, vid, _, _ in invoices} + unknown_over = [r for r in report if r["reason"] == "Unknown Vendor" + and invoices[r["row"] - 1][2] in pos + and abs(invoices[r["row"] - 1][3] - pos[invoices[r["row"] - 1][2]]) * 100 + > TOLERANCE_PCT * pos[invoices[r["row"] - 1][2]]] + if not (used & {f"V{v}" for v in inactive} and used - set(vendors) and unknown_over): + continue + break + files = { + "data/invoices.csv": "invoice_no,vendor_id,po_number,amount\n" + + "".join(f"{no},{vid},{po},{amt:.2f}\n" for no, vid, po, amt in invoices), + "data/purchase_orders.csv": "po_number,vendor_id,amount\n" + + "".join(f"{n},{po_vendor[n]},{a:.2f}\n" for n, a in pos.items()), + } + rule_amount = (f"the invoice amount differs from its PO's amount by more than {TOLERANCE_PCT}% of the PO amount") + if level == 1: + rules = f"Flag an invoice as Amount Mismatch when {rule_amount}. Every invoice cites a valid PO." + else: + files["data/vendors.csv"] = "vendor_id,status\n" + "".join(f"{v},{s}\n" for v, s in vendors.items()) + rules = ("Check each invoice against these rules in order and report only the first that applies:\n" + "1. Unknown Vendor: vendor_id is not in /root/data/vendors.csv with status ACTIVE.\n" + "2. Missing PO: po_number is empty or not in the PO list.\n" + f"3. Amount Mismatch: {rule_amount}.") + if level == 3: + rules += "\n4. Duplicate Invoice: an earlier row has the same vendor_id and invoice_no." + ex = {"row": rng.randint(2, 60), "invoice_no": f"INV-{rng.randrange(10000, 100000)}", + "amount": float(Decimal(rng.randrange(10000, 2000000)) / 100), "reason": rng.choice(live)} + opener = rng.choice([ + "Accounts payable must screen this month's invoices before they are paid.", + "You are screening supplier invoices for fraud before the payment run.", + ]) + instruction = ( + f"{opener} /root/data/invoices.csv has one invoice per row (invoice_no, vendor_id, po_number, amount) and " + "/root/data/purchase_orders.csv lists the issued purchase orders (po_number, vendor_id, amount).\n\n" + f"{rules}\n\nWrite /root/fraud_report.json as a JSON array of the flagged invoices only, in file order. Each " + "item has row (the 1-based position in invoices.csv, header not counted), invoice_no, amount (a number) and " + f"reason, for example:\n{json.dumps(ex)}" + ) + + def render() -> str: + return json.dumps(report, indent=1) + "\n" + + def rows_of(p): + return [r["row"] for r in p] + + checks = [ + ("test_is_list", lambda p: isinstance(p, list) and all(isinstance(r, dict) for r in p)), + ("test_record_keys", lambda p: all(set(r) == {"row", "invoice_no", "amount", "reason"} for r in p)), + ("test_file_order", lambda p: rows_of(p) == sorted(set(rows_of(p)))), + ("test_flagged_rows", lambda p: rows_of(p) == [r["row"] for r in report]), + ("test_reasons", lambda p: [r["reason"] for r in p] == reasons), + ("test_invoice_numbers", lambda p: [r["invoice_no"] for r in p] == [r["invoice_no"] for r in report]), + ("test_amounts", lambda p: all(isinstance(r["amount"], (int, float)) and not isinstance(r["amount"], bool) + and abs(r["amount"] - w["amount"]) <= 0.01 + 1e-9 + for r, w in zip(p, report, strict=True))), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="fraud_report.json", kind="checks", parse="json", checks=checks, render=render), + notes={"flagged": len(report), "invoices": len(invoices)}, + root="/root", + ) + + +FAMILIES = [ + Family("fin3_loan_schedule", "finance and economics", "Amortize a loan from the loan book", build_loan_schedule, + v3=True), + Family("fin3_portfolio_value", "finance and economics", "Value a brokerage account", build_portfolio_value, + v3=True), + Family("fin3_invoice_fraud", "finance and economics", "Screen invoices for fraud", build_invoice_fraud, v3=True), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/industrial.py b/components/dnakhla/upstream/terminal_desk/families/industrial.py new file mode 100644 index 0000000000000000000000000000000000000000..1e11d39acba7b614f79023715874e48f03f0fec2 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/industrial.py @@ -0,0 +1,194 @@ +"""Industrial and physical systems: integrate a flow log; find overdue maintenance.""" + +import datetime as dt +import random + +from .base import Artifact, Built, Family, Field + +# ---------------------------------------------------------------- ind_tank + + +def build_tank(level: int, rng: random.Random) -> Built: + n_rows = {1: 120, 2: 240, 3: 360}[level] + t = dt.datetime(2026, 11, 3, 6, 0, 0) + flow, lvl = rng.uniform(30, 60), rng.uniform(120, 160) + rows = [] + for i in range(n_rows): + flow = min(max(flow + rng.gauss(0, 2.5), 5.0), 95.0) + lvl = min(max(lvl + rng.gauss(0, 1.8), 80.0), 220.0) + status = "OK" + if level >= 2 and i > 2 and rng.random() < 0.035: + status = "FAULT" + f_out = round(flow, 2) if status == "OK" else rng.choice([0.0, 999.99, round(flow * 3, 2)]) + l_out = round(lvl, 1) if status == "OK" else rng.choice([0.0, 999.9]) + rows.append((t, f_out, l_out, status)) + step = 30 if level < 3 else rng.choice([10, 20, 30, 30, 60]) + t += dt.timedelta(seconds=step) + good = [r for r in rows if r[3] == "OK"] + levels = sorted(r[2] for r in good) + threshold = round(levels[int(len(levels) * rng.uniform(0.6, 0.75))], 0) + cal_time = None + if level == 3: + cal_time = good[len(good) // 2 + rng.randint(-20, 20)][0] + + def corrected(r): + return r[1] / 1.04 if cal_time is not None and r[0] < cal_time else r[1] + + total = 0.0 + for a, b in zip(good, good[1:]): + total += (corrected(a) + corrected(b)) / 2 * (b[0] - a[0]).total_seconds() / 60 + longest, run_start = 0.0, None + for r in good: + if r[2] > threshold: + if run_start is None: + run_start = r[0] + longest = max(longest, (r[0] - run_start).total_seconds() / 60) + else: + run_start = None + csv = "time,flow_lpm,level_cm,status\n" + "".join( + f"{r[0]:%H:%M:%S},{r[1]:.2f},{r[2]:.1f},{r[3]}\n" for r in rows + ) + files = {"tank_log.csv": csv} + rules = [ + "flow_lpm is the inflow in litres per minute; level_cm is the tank level.", + ] + if level >= 2: + rules.append("Rows with status FAULT are sensor glitches: drop them before any calculation.") + if cal_time is not None: + files["maintenance_note.txt"] = ( + f"Flow meter recalibrated at {cal_time:%H:%M:%S}. Readings taken before that time read 4% high: " + "divide them by 1.04. Readings from that time on are correct.\n" + ) + rules.append("Read maintenance_note.txt.") + instruction = ( + "/app/tank_log.csv is one morning of a holding tank's sensor log. " + " ".join(rules) + " " + "Total inflow is the trapezoid-rule integral of flow over time between consecutive rows (after any " + "dropping). A high stretch is a maximal run of consecutive rows (after any dropping) with level_cm " + f"strictly above {threshold:.0f}; its length runs from its first to its last row. " + 'Write /app/tank_report.json with the keys total_liters (litres) and longest_high_minutes (minutes), ' + 'for example {"total_liters": 1234.5, "longest_high_minutes": 12.5}.' + ) + return Built( + instruction=instruction, + files=files, + artifact=Artifact( + path="tank_report.json", + kind="json", + expected={"total_liters": round(total, 3), "longest_high_minutes": round(longest, 4)}, + fields=[ + Field("total_liters", "number", "total inflow in litres", tol=0.5, rel=0.002), + Field("longest_high_minutes", "number", "length of the longest high stretch in minutes", tol=0.01), + ], + ), + ) + + +# ---------------------------------------------------------------- ind_maint + +TYPES = {"press": (250, 30), "lathe": (400, 45), "pump": (1000, 90), "conveyor": (600, 60)} + + +def build_maint(level: int, rng: random.Random) -> Built: + n_mach, n_days = {1: (6, 20), 2: (10, 45), 3: (12, 60)}[level] + while True: + asof = dt.date(2026, 10, 31) + start = asof - dt.timedelta(days=n_days - 1) + end = asof + (dt.timedelta(days=3) if level >= 2 else dt.timedelta(0)) + machines, readings, since = [], [], {} + swapped = None + swap_id = None + ids = [f"M{i:02d}" for i in range(1, n_mach + 1)] + if level == 3: + swap_id = rng.choice(ids) + for mid in ids: + mtype = rng.choice(sorted(TYPES)) + hours_cap, days_cap = TYPES[mtype] + meter = round(rng.uniform(500, 20000), 1) + daily = rng.uniform(2, 20) + service_day = start + dt.timedelta(days=rng.randint(0, n_days - 5)) + swap_day = None + if mid == swap_id: + swap_day = service_day + dt.timedelta(days=rng.randint(2, (asof - service_day).days)) + day, at_service, old_last, latest = start, None, None, None + while day <= end: + if day == swap_day: + old_last = meter + meter = 0.0 + meter = round(meter + max(0.0, rng.gauss(daily, daily * 0.3)), 1) + if day == service_day: + at_service = meter + protected = (service_day, swap_day, swap_day - dt.timedelta(days=1) if swap_day else None) + missing = level >= 2 and day not in protected and rng.random() < 0.1 + if not missing: + readings.append((day, mid, meter)) + if day <= asof: + latest = meter + day += dt.timedelta(days=1) + if swap_day is not None: + hours = old_last - at_service + latest + swapped = (mid, swap_day) + else: + hours = latest - at_service + days_since = (asof - service_day).days + overdue = hours >= hours_cap or days_since >= days_cap + since[mid] = (hours, overdue) + machines.append((mid, mtype, service_day, at_service)) + ranked = sorted(since.items(), key=lambda kv: -kv[1][0]) + if ranked[0][1][0] - ranked[1][1][0] < 1.0: + continue + overdue = sorted(m for m, (_, o) in since.items() if o) + if 0 < len(overdue) < n_mach: + break + rng.shuffle(readings) + readings.sort(key=lambda r: (r[0], rng.random())) + files = { + "machines.csv": "machine,type,last_service_date,meter_at_service\n" + + "".join(f"{m},{t},{d.isoformat()},{h:.1f}\n" for m, t, d, h in machines), + "meter_readings.csv": "date,machine,meter_hours\n" + + "".join(f"{d.isoformat()},{m},{h:.1f}\n" for d, m, h in readings), + "policy.txt": "Service interval by machine type (whichever limit comes first):\n" + + "".join(f" {t}: every {h} run-hours or {d} days\n" for t, (h, d) in sorted(TYPES.items())), + } + notes = [ + "meter_readings.csv holds end-of-day cumulative meter readings.", + "Use each machine's latest reading on or before the as-of date.", + ] + if swapped: + files["shift_log.txt"] = ( + f"{swapped[1].isoformat()}: {swapped[0]} hour meter failed and was replaced at the start of the day. " + "The new meter started from 0.0; its readings from that day on count up from zero. The old meter's " + "last reading is the one from the previous day.\n" + ) + notes.append("Check shift_log.txt.") + instruction = ( + "As of 2026-10-31, work out which machines in /app/machines.csv are due for service from " + "/app/meter_readings.csv and /app/policy.txt. Run-hours since service = meter now minus " + "meter_at_service. A machine is due when that reaches its type's hour limit or the days since its last " + "service (as-of date minus service date) reach its day limit. " + " ".join(notes) + " " + "Write /app/service_schedule.csv with the header machine,run_hours_since_service,due and one row per " + "machine, due being yes or no, e.g. M01,153.4,no" + ) + return Built( + instruction=instruction, + files=files, + artifact=Artifact( + path="service_schedule.csv", + kind="csv", + key=("machine",), + fields=[ + Field("machine", "text"), + Field("run_hours_since_service", "number", tol=0.15), + Field("due", "text"), + ], + expected=[ + {"machine": m, "run_hours_since_service": round(h, 1), "due": "yes" if o else "no"} + for m, (h, o) in sorted(since.items()) + ], + ), + ) + + +FAMILIES = [ + Family("ind_tank", "industrial and physical systems", "Integrate a tank flow log", build_tank), + Family("ind_maint", "industrial and physical systems", "Find machines due for service", build_maint), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/industrial3.py b/components/dnakhla/upstream/terminal_desk/families/industrial3.py new file mode 100644 index 0000000000000000000000000000000000000000..a8016c0c2e22d1763e9e2e0415e30b2a91d2e14f --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/industrial3.py @@ -0,0 +1,470 @@ +"""Industrial and physical systems, v3: service-due report, tank balance, STL part mass. + +ind3_service_due reshapes industrial.build_maint (hour meters against service intervals) as a /root csv report. +ind3_tank_balance reshapes industrial.build_tank (trapezoid flow integral, high-level stretch) as a tank balance. +ind3_stl_mass is new, modeled on SkillsBench 3d-scan-calc: signed-tetrahedron volume of an ASCII STL. + +All three are stdlib-only. Everything an instance needs beyond the fixed rules lives in its files, because the +family's one oracle script (terminal_desk/oracles/.py) cannot read the instruction. +""" + +import datetime as dt +import json +import math +import random + +from .base import Artifact, Built, Family +from .industrial import TYPES # press (250 h, 30 d), lathe (400, 45), pump (1000, 90), conveyor (600, 60) + +DOMAIN = "industrial and physical systems" + + +def _close(got, want: float, tol: float) -> bool: + return not isinstance(got, bool) and abs(float(got) - want) <= tol + 1e-9 + + +def _rel(got, want: float, rel: float = 1e-3) -> bool: + return not isinstance(got, bool) and abs(float(got) - want) <= rel * abs(want) + 1e-12 + + +# ---------------------------------------------------------------- ind3_service_due + +ASOF = dt.date(2026, 10, 31) # fixed: the oracle script cannot read the instruction +SERVICE_HEADER = ["machine", "run_hours_since_service", "days_since_service", "due"] + + +def _service_instance(level: int, rng: random.Random): + """One draw; None when the draw misses a constraint (the caller redraws).""" + n_mach, n_days = {1: (6, 20), 2: (9, 30), 3: (12, 40)}[level] + start = ASOF - dt.timedelta(days=n_days - 1) + end = ASOF + dt.timedelta(days=3 if level >= 2 else 0) + ids = [f"M{i:02d}" for i in range(1, n_mach + 1)] + resvc = rng.choice(ids) if level >= 2 else None + swap_id = rng.choice([m for m in ids if m != resvc]) if level == 3 else None + exact = rng.choice([m for m in ids if m not in (resvc, swap_id)]) # its days land exactly on the limit + machines, readings, want, notes = [], [], {}, [] + for mid in ids: + mtype = rng.choice(sorted(TYPES)) + hcap, dcap = TYPES[mtype] + swap_day = ASOF - dt.timedelta(days=rng.randint(3, n_days - 3)) if mid == swap_id else None + if mid == exact: + last = ASOF - dt.timedelta(days=dcap) + elif swap_day is not None: + last = swap_day - dt.timedelta(days=rng.randint(2, 60)) + else: + last = ASOF - dt.timedelta(days=rng.randint(5, int(dcap * 1.3))) + listed = last - dt.timedelta(days=rng.randint(20, 120)) if mid == resvc else last + daily = rng.uniform(2, 20) + meter = round(rng.uniform(500, 20000), 1) + at, day, old_last, recs = {}, min(listed, start), None, [] + while day <= end: + if day == swap_day: + old_last = meter + meter = 0.0 + meter = round(meter + max(0.0, rng.gauss(daily, daily * 0.3)), 1) + if day in (listed, last): + at[day] = meter + protected = swap_day is not None and day == swap_day - dt.timedelta(days=1) + if day >= start and (protected or level == 1 or rng.random() >= 0.1): + recs.append((day, meter)) + day += dt.timedelta(days=1) + readings += [(d, mid, v) for d, v in recs] + upto = [(d, v) for d, v in recs if d <= ASOF] + if not upto or upto[-1][0] <= last: + return None + if swap_day is not None: + if upto[-1][0] < swap_day or old_last is None: + return None + hours = old_last - at[last] + upto[-1][1] + else: + hours = upto[-1][1] - at[last] + hours = round(hours, 1) + if abs(hours - hcap) < 0.05: + return None + days = (ASOF - last).days + want[mid] = (hours, days, hours >= hcap, days >= dcap) + machines.append((mid, mtype, listed, at[listed])) + if mid == resvc: + notes.append(f"- {last.isoformat()}: {mid} was serviced again; its hour meter read {at[last]:.1f} at " + "the end of that day. machines.csv still shows the previous service.") + if mid == swap_id: + swap = (mid, swap_day) + due = [m for m, (_, _, h, d) in want.items() if h or d] + by_hours = [m for m, (_, _, h, d) in want.items() if h and not d] + by_days = [m for m, (_, _, h, d) in want.items() if d and not h] + if not (2 <= len(due) <= n_mach - 2 and by_hours and by_days): + return None + readings.sort(key=lambda r: (r[0], rng.random())) + files = { + "data/machines.csv": "machine,type,last_service_date,meter_at_service\n" + + "".join(f"{m},{t},{d.isoformat()},{h:.1f}\n" for m, t, d, h in machines), + "data/meter_readings.csv": "date,machine,meter_hours\n" + + "".join(f"{d.isoformat()},{m},{v:.1f}\n" for d, m, v in readings), + "data/service_intervals.csv": "type,max_run_hours,max_days\n" + + "".join(f"{t},{h},{d}\n" for t, (h, d) in sorted(TYPES.items())), + } + if level >= 2: + other = rng.choice([m for m in ids if m != resvc]) + day = ASOF - dt.timedelta(days=rng.randint(1, 15)) + notes.append(f"- {day.isoformat()}: {other} coolant topped up and guards checked; no service performed.") + rng.shuffle(notes) + files["data/notes.md"] = "# Shop floor notes\n\n" + "\n".join(notes) + "\n" + if level == 3: + other = rng.choice([m for m in ids if m != swap[0]]) + day = ASOF - dt.timedelta(days=rng.randint(1, n_days - 1)) + log = [ + f"{swap[1].isoformat()}: {swap[0]} hour meter failed and was replaced at the start of the day. The new " + "meter started from 0.0; its readings from that day on count up from zero. The old meter's last " + "reading is the one from the previous day.", + f"{day.isoformat()}: {other} spindle noise reported on the night shift; inspected, no fault found, " + "meter unchanged.", + ] + rng.shuffle(log) + files["data/shift_log.txt"] = "\n".join(log) + "\n" + return files, want + + +def build_service_due(level: int, rng: random.Random) -> Built: + while True: + drawn = _service_instance(level, rng) + if drawn is not None: + break + files, want = drawn + opener = rng.choice([ + "You are preparing a machine shop's service report as of 2026-10-31.", + "Our machine shop needs its service-due report as of 2026-10-31.", + ]) + extra = {1: "", 2: " Apply /root/data/notes.md.", 3: " Apply /root/data/notes.md and /root/data/shift_log.txt."} + instruction = ( + f"{opener} /root/data/machines.csv lists each machine's type, last_service_date and meter_at_service " + "(the hour meter at that service). /root/data/meter_readings.csv holds end-of-day cumulative " + "hour-meter readings, and /root/data/service_intervals.csv gives each type's limits.\n\n" + "For every machine:\n" + "1. Take its latest reading dated on or before 2026-10-31; days can be missing.\n" + "2. run_hours_since_service = that reading minus meter_at_service.\n" + "3. days_since_service = 2026-10-31 minus the last service date.\n" + "4. It is due when run-hours reach max_run_hours or days reach max_days, whichever comes first; " + f"exactly reaching a limit counts.{extra[level]}\n\n" + "Write /root/service_report.csv with the header machine,run_hours_since_service,days_since_service,due, " + "one row per machine sorted by machine, run-hours to 1 decimal and due as yes or no, e.g. M01,153.4,40,no. " + "Run-hours are checked within 0.05." + ) + ids = sorted(want) + rows = {m: (f"{h:.1f}", d, "yes" if a or b else "no") for m, (h, d, a, b) in want.items()} + + def render() -> str: + return ",".join(SERVICE_HEADER) + "\n" + "".join(f"{m},{h},{d},{u}\n" for m, (h, d, u) in sorted(rows.items())) + + checks = [ + ("test_header", lambda p: p["header"] == SERVICE_HEADER), + ("test_row_count", lambda p: len(p["rows"]) == len(ids)), + ("test_machine_order", lambda p: [r["machine"] for r in p["rows"]] == ids), + ("test_run_hours", lambda p: all(_close(r["run_hours_since_service"], want[r["machine"]][0], 0.05) + for r in p["rows"])), + ("test_days_since_service", lambda p: all(float(r["days_since_service"]) == want[r["machine"]][1] + for r in p["rows"])), + ("test_due", lambda p: all(r["due"] == rows[r["machine"]][2] for r in p["rows"])), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="service_report.csv", kind="checks", parse="csv", checks=checks, render=render), + root="/root", + ) + + +# ---------------------------------------------------------------- ind3_tank_balance + + +def _tank_rows(level: int, rng: random.Random): + n_rows = {1: 120, 2: 240, 3: 360}[level] + t = dt.datetime(2026, 11, 3, rng.randint(5, 8), rng.choice((0, 15, 30, 45)), 0) + fin, fout, lvl = rng.uniform(35, 60), rng.uniform(30, 55), rng.uniform(120, 160) + rows = [] + for i in range(n_rows): + fin = min(max(fin + rng.gauss(0, 2.5), 5.0), 95.0) + fout = min(max(fout + rng.gauss(0, 2.5), 5.0), 95.0) + lvl = min(max(lvl + rng.gauss(0, 1.8), 80.0), 220.0) + if level >= 2 and 2 < i < n_rows - 1 and rng.random() < 0.04: + rows.append((t, rng.choice((0.0, 999.9)), rng.choice((0.0, 999.9)), rng.choice((0.0, 999.9)), "FAULT")) + else: + rows.append((t, round(fin, 1), round(fout, 1), round(lvl, 1), "OK")) + t += dt.timedelta(seconds=30 if level < 3 else rng.choice((10, 20, 30, 30, 60))) + return rows + + +def _trapezoid(pts) -> float: + """pts: [(datetime, flow_lpm)] -> litres.""" + return sum((a[1] + b[1]) / 2 * (b[0] - a[0]).total_seconds() / 60 for a, b in zip(pts, pts[1:])) + + +def build_tank_balance(level: int, rng: random.Random) -> Built: + while True: + rows = _tank_rows(level, rng) + good = [r for r in rows if r[4] == "OK"] + cal, pct = None, rng.choice((3, 4, 5, 6)) + if level == 3: + cal = good[len(good) // 2 + rng.randint(-20, 20)][0] + + def inflow(r): + return r[1] / (1 + pct / 100) if cal is not None and r[0] < cal else r[1] + + fin = [(r[0], inflow(r)) for r in good] + total_in, total_out = _trapezoid(fin), _trapezoid([(r[0], r[2]) for r in good]) + minutes = (good[-1][0] - good[0][0]).total_seconds() / 60 + left = sum(a[1] * (b[0] - a[0]).total_seconds() / 60 for a, b in zip(fin, fin[1:])) + right = sum(b[1] * (b[0] - a[0]).total_seconds() / 60 for a, b in zip(fin, fin[1:])) + mean = sum(f for _, f in fin) / len(fin) * minutes + if min(abs(total_in - x) for x in (left, right, mean)) < 0.5: + continue # a wrong integration rule must not land inside the tolerance + levels = sorted(r[3] for r in good) + alarm = int(levels[int(len(levels) * rng.uniform(0.6, 0.75))]) + longest, run_start = 0.0, None + for r in good: + if r[3] > alarm: + run_start = r[0] if run_start is None else run_start + longest = max(longest, (r[0] - run_start).total_seconds() / 60) + else: + run_start = None + if level == 1 or longest > 0: + break + want = {"inflow_liters": total_in, "outflow_liters": total_out, "net_liters": total_in - total_out} + if level >= 2: + want["longest_high_minutes"] = longest + status = level >= 2 + files = { + "data/tank_log.csv": "time,inflow_lpm,outflow_lpm,level_cm" + (",status" if status else "") + "\n" + + "".join(f"{r[0]:%H:%M:%S},{r[1]:.1f},{r[2]:.1f},{r[3]:.1f}" + (f",{r[4]}" if status else "") + "\n" + for r in rows), + } + if level >= 2: + files["data/README.md"] = ( + "# Tank T-4 log notes\n\n" + "- Rows with status FAULT are sensor glitches and their readings are meaningless. Drop them before any " + "calculation; the rows on either side of a dropped row then count as consecutive.\n" + f"- The high-level alarm setpoint is {alarm} cm.\n" + "- The outlet meter was replaced in spring and reads true.\n" + ) + if cal is not None: + files["data/maintenance_note.txt"] = ( + f"Inlet flow meter recalibrated at {cal:%H:%M:%S}. Inflow readings taken before that time read {pct}% " + f"high: divide them by 1.0{pct}. Readings from that time on, and all outflow readings, are correct.\n" + ) + cols = "time (HH:MM:SS), inflow_lpm and outflow_lpm (litres per minute) and level_cm" + ( + ", plus a status column" if status else "") + notes = {1: "", 2: " Read /root/data/README.md first.", + 3: " Read /root/data/README.md and /root/data/maintenance_note.txt first."}[level] + opener = rng.choice([ + "You are checking the water balance of a holding tank over one morning shift.", + "The plant team wants a flow balance for holding tank T-4 over this morning's shift.", + ]) + steps = ( + "1. inflow_liters and outflow_liters: the trapezoid-rule integral of each flow over time, i.e. for every " + "pair of consecutive rows add the average of their two flows times the minutes between them.\n" + "2. net_liters = inflow_liters minus outflow_liters.\n" + ) + example = '"inflow_liters": 2710.45, "outflow_liters": 2532.1, "net_liters": 178.35' + if level >= 2: + steps += ("3. longest_high_minutes: the longest run of consecutive rows with level_cm strictly above the " + "high-level alarm setpoint, from its first to its last row (0 if none).\n") + example += ', "longest_high_minutes": 12.5' + instruction = ( + f"{opener} /root/data/tank_log.csv has one row per sample: {cols}.{notes}\n\n{steps}\n" + f"Write /root/tank_report.json as one JSON object, for example {{{example}}}. Round to 2 decimals; " + "litres are checked within 0.05" + (" and minutes within 0.01." if level >= 2 else ".") + ) + + def render() -> str: + return json.dumps({k: round(v, 2) for k, v in want.items()}) + "\n" + + checks = [ + ("test_is_object", lambda p: isinstance(p, dict)), + ("test_keys", lambda p: set(p) == set(want)), + ("test_inflow_liters", lambda p: _close(p["inflow_liters"], want["inflow_liters"], 0.05)), + ("test_outflow_liters", lambda p: _close(p["outflow_liters"], want["outflow_liters"], 0.05)), + ("test_net_liters", lambda p: _close(p["net_liters"], want["net_liters"], 0.05)), + ] + if level >= 2: + checks.append(("test_longest_high_minutes", + lambda p: _close(p["longest_high_minutes"], want["longest_high_minutes"], 0.01))) + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="tank_report.json", kind="checks", parse="json", checks=checks, render=render), + root="/root", + ) + + +# ---------------------------------------------------------------- ind3_stl_mass + +MATERIALS = [ + ("PLA", "PLA filament", 1.24), ("PETG", "PETG filament", 1.27), ("ABS", "ABS filament", 1.04), + ("ASA", "ASA filament", 1.07), ("PA12", "nylon 12 powder", 1.01), ("PC", "polycarbonate", 1.20), + ("AL6061", "aluminium 6061", 2.70), ("SS316L", "stainless steel 316L", 7.98), ("TI64", "titanium Ti-6Al-4V", 4.43), + ("IN718", "Inconel 718", 8.19), ("CUCRZR", "copper CuCrZr", 8.89), ("MS1", "maraging steel MS1", 8.10), +] + + +def _cross(a, b): + return (a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]) + + +def _prism(rng: random.Random, n: int, bands: int, radius: float, height: float, center, scale: float, inward: bool): + """A closed star-shaped prism: fan-triangulated caps, side walls split into `bands` strips. + Vertices are rounded as written, so every expected value comes from the file's own numbers.""" + cx, cy, z0 = center + phase = rng.uniform(0, 2 * math.pi) + ring = [] + for i in range(n): + a, r = phase + 2 * math.pi * i / n, radius * rng.uniform(0.7, 1.0) + ring.append((cx + r * math.cos(a), cy + r * math.sin(a))) + + def q(x, y, z): + return (round(x / scale, 4), round(y / scale, 4), round(z / scale, 4)) + + zs = [z0 + height * j / bands for j in range(bands + 1)] + p = [[q(x, y, z) for z in zs] for x, y in ring] + top, bot = q(cx, cy, zs[-1]), q(cx, cy, zs[0]) + tris = [] + for i in range(n): + k = (i + 1) % n + tris.append((top, p[i][bands], p[k][bands])) + tris.append((bot, p[k][0], p[i][0])) + for j in range(bands): + tris.append((p[i][j], p[k][j], p[k][j + 1])) + tris.append((p[i][j], p[k][j + 1], p[i][j + 1])) + if inward: + tris = [(a, c, b) for a, b, c in tris] + return tris + + +def _measure(tris): + vol = sum(sum(x * y for x, y in zip(a, _cross(b, c))) for a, b, c in tris) / 6 + area = 0.0 + for a, b, c in tris: + n = _cross([j - i for i, j in zip(a, b)], [j - i for i, j in zip(a, c)]) + area += math.sqrt(sum(x * x for x in n)) / 2 + return vol, area + + +def _stl_solid(name: str, code: str, tris) -> str: + out = [f"solid {name} {code}"] + for a, b, c in tris: + n = _cross([j - i for i, j in zip(a, b)], [j - i for i, j in zip(a, c)]) + m = math.sqrt(sum(x * x for x in n)) + if m == 0: + raise ValueError(f"degenerate facet in solid {name}: {a} {b} {c}") + out.append(" facet normal " + " ".join(f"{x / m:.4f}" for x in n)) + out.append(" outer loop") + out += [f" vertex {v[0]:.4f} {v[1]:.4f} {v[2]:.4f}" for v in (a, b, c)] + out += [" endloop", " endfacet"] + out.append(f"endsolid {name}") + return "\n".join(out) + "\n" + + +def build_stl_mass(level: int, rng: random.Random) -> Built: + inches = level == 3 + scale = 25.4 if inches else 1.0 + # L1 draws in exactly the order the first merged version did, so L1 instances are unchanged. + while True: + count = {1: 1, 2: rng.randint(3, 4), 3: 5}[level] + names = [f"body{k}" for k in rng.sample(range(1, 10), count)] + roles = ["part", "offcut", "trap"][: {1: 1, 2: 2, 3: 3}[level]] + roles += ["debris"] * (count - len(roles)) + solids = [] # (name, code, tris) + for role, name in zip(roles, names): + code = rng.choice(MATERIALS)[0] + center = (rng.uniform(10, 90), rng.uniform(10, 90), rng.uniform(0, 20)) + if role in ("part", "offcut"): # the offcut draws its facet count like the part: more about half the time + n, bands = (rng.randint(10, 13), 2) if level < 3 else (rng.randint(10, 12), 2) + if level == 2: + n, bands = rng.randint(14, 18), rng.randint(2, 3) + if role == "part": + radius, height = rng.uniform(15, 40), rng.uniform(8, 40) + size = (radius, height) + else: + size = (radius * rng.uniform(0.6, 0.8), height * rng.uniform(0.6, 0.9)) + tris = _prism(rng, n, bands, *size, center, scale, rng.random() < 0.5) + elif role == "trap": # more facets than the part, far less volume + tris = _prism(rng, rng.randint(26, 32), rng.randint(3, 4), rng.uniform(4, 6), rng.uniform(3, 5), + center, scale, rng.random() < 0.5) + else: # fixture pieces and debris + tris = _prism(rng, rng.randint(4, 6), 1, rng.uniform(1.5, 4), rng.uniform(1, 4), center, scale, + rng.random() < 0.3) + solids.append((name, code, tris)) + vols = [abs(_measure(t)[0]) for _, _, t in solids] + small = all(vols[0] > 3 * v for r, v in zip(roles[1:], vols[1:]) if r != "offcut") + offcut = level == 1 or 0.3 <= vols[1] / vols[0] <= 0.6 + if small and offcut and len({s[1] for s in solids}) == len(solids): + break + if level == 3: + assert len(solids[2][2]) > len(solids[0][2]) + part_name, part_code, part_tris = solids[0] + vol, area = _measure(part_tris) + k = 2.54 if inches else 0.1 # file units -> cm + density = dict((c, d) for c, _, d in MATERIALS)[part_code] + volume_cm3, area_cm2 = abs(vol) * k ** 3, area * k ** 2 + want = {"solid": part_name, "material": part_code, "volume_cm3": volume_cm3, "area_cm2": area_cm2, + "mass_g": volume_cm3 * density} + order = solids[:] + rng.shuffle(order) + table = rng.sample(MATERIALS, 8) + for _, code, _ in solids: + if code not in {c for c, _, _ in table}: + table.append(next(m for m in MATERIALS if m[0] == code)) + rng.shuffle(table) + files = { + "data/scan.stl": "".join(_stl_solid(*s) for s in order), + "data/materials.csv": "code,name,density_g_cm3\n" + "".join(f"{c},{n},{d:.2f}\n" for c, n, d in table), + } + if level >= 2: + notes = ("# Scan notes\n\nThe scanner exported every closed surface it found as its own solid: the part, plus " + "an offcut from another job, fixture pieces and loose debris picked up on the bed. Only the part " + "matters. The part is the solid with the largest enclosed volume; ignore the other solids entirely.\n") + if inches: + notes += "\nThis scan was exported in inches, not millimetres (1 in = 2.54 cm). Convert before reporting.\n" + files["data/scan_notes.md"] = notes + opener = rng.choice([ + "You need to calculate the mass of a 3D printed part from its scan.", + "Our print shop needs the mass of a finished part, computed from its 3D scan.", + ]) + scope = ("The file holds one solid, the part." if level == 1 + else "Read /root/data/scan_notes.md and apply it; it overrides anything above.") + instruction = ( + f"{opener} /root/data/scan.stl is an ASCII STL: each solid opens with a line `solid ` " + "and lists triangular facets as three `vertex x y z` lines, coordinates in millimetres. " + f"/root/data/materials.csv gives each material code's density in g/cm3. {scope}\n\n" + "For the part:\n" + "1. volume: the sum of v1 . (v2 x v3) / 6 over its facets (signed tetrahedra), then the absolute value, " + "because some exports wind facets inward.\n" + "2. surface area: the sum of |(v2 - v1) x (v3 - v1)| / 2 over its facets.\n" + "3. mass = volume in cm3 times the density.\n\n" + 'Write /root/mass_report.json like {"solid": "body2", "material": "PA12", "volume_cm3": 41.268, ' + '"area_cm2": 98.41, "mass_g": 41.68}. Numbers are checked within 0.1% (relative); names exactly.' + ) + + def render() -> str: + return json.dumps(want) + "\n" + + checks = [ + ("test_is_object", lambda p: isinstance(p, dict)), + ("test_keys", lambda p: set(p) == set(want)), + ("test_solid", lambda p: p["solid"] == part_name), + ("test_material", lambda p: p["material"] == part_code), + ("test_volume_cm3", lambda p: _rel(p["volume_cm3"], volume_cm3)), + ("test_area_cm2", lambda p: _rel(p["area_cm2"], area_cm2)), + ("test_mass_g", lambda p: _rel(p["mass_g"], want["mass_g"])), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="mass_report.json", kind="checks", parse="json", checks=checks, render=render), + root="/root", + ) + + +FAMILIES = [ + Family("ind3_service_due", DOMAIN, "Report machines due for service", build_service_due, v3=True), + Family("ind3_tank_balance", DOMAIN, "Balance a tank's inflow and outflow", build_tank_balance, v3=True), + Family("ind3_stl_mass", DOMAIN, "Compute a scanned part's mass from an STL", build_stl_mass, v3=True), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/mathematics.py b/components/dnakhla/upstream/terminal_desk/families/mathematics.py new file mode 100644 index 0000000000000000000000000000000000000000..1aabf3275f834a56f767670694c6cd2482367ee3 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/mathematics.py @@ -0,0 +1,177 @@ +"""Math and formal reasoning: find a fastest route in a road graph; count integers under constraints.""" + +import heapq +import random + +from .base import Artifact, Built, Family, Field + +# ---------------------------------------------------------------- math_paths + + +def _dijkstra_count(nodes, edges, src, dst): + adj = {n: [] for n in nodes} + for u, v, w in edges: + adj[u].append((v, w)) + dist = {n: None for n in nodes} + ways = {n: 0 for n in nodes} + dist[src], ways[src] = 0, 1 + heap = [(0, src)] + done = set() + while heap: + d, u = heapq.heappop(heap) + if u in done: + continue + done.add(u) + for v, w in adj[u]: + nd = d + w + if dist[v] is None or nd < dist[v]: + dist[v], ways[v] = nd, ways[u] + heapq.heappush(heap, (nd, v)) + elif nd == dist[v]: + ways[v] += ways[u] + return dist[dst], ways[dst] + + +def _dijkstra_path(nodes, edges, src, dst): + adj = {n: [] for n in nodes} + for u, v, w in edges: + adj[u].append((v, w)) + dist, prev = {src: 0}, {} + heap = [(0, src)] + while heap: + d, u = heapq.heappop(heap) + if d > dist[u]: + continue + for v, w in adj[u]: + if v not in dist or d + w < dist[v]: + dist[v], prev[v] = d + w, u + heapq.heappush(heap, (d + w, v)) + path = [dst] + while path[-1] != src: + path.append(prev[path[-1]]) + return path[::-1] + + +def build_paths(level: int, rng: random.Random) -> Built: + n_nodes, out_deg = {1: (8, 2), 2: (15, 3), 3: (25, 3)}[level] + while True: + nodes = [f"N{i:02d}" for i in range(1, n_nodes + 1)] + src, dst = nodes[0], nodes[-1] + edges, seen = [], set() + for u in nodes: + for v in rng.sample([x for x in nodes if x != u], out_deg): + if (u, v) not in seen: + seen.add((u, v)) + edges.append((u, v, rng.randint(1, 6))) + closed_edges, closed_nodes = set(), set() + if level == 3: + closed_edges = set(rng.sample([(u, v) for u, v, _ in edges], 6)) + closed_nodes = set(rng.sample(nodes[1:-1], 2)) + live = [ + (u, v, w) + for u, v, w in edges + if (u, v) not in closed_edges and u not in closed_nodes and v not in closed_nodes + ] + cost, ways = _dijkstra_count(nodes, live, src, dst) + if cost is None or ways < (1 if level == 1 else 2) or cost < 4: + continue + if level == 3: + full_cost, full_ways = _dijkstra_count(nodes, edges, src, dst) + if (full_cost, full_ways) == (cost, ways): + continue + break + rng.shuffle(edges) + files = {"roads.csv": "from,to,minutes\n" + "".join(f"{u},{v},{w}\n" for u, v, w in edges)} + extra = "" + if level == 3: + files["closures.txt"] = ( + "Closed roads (one way, from -> to):\n" + + "".join(f" {u} -> {v}\n" for u, v in sorted(closed_edges)) + + "Closed junctions (no road into or out of them can be used):\n" + + "".join(f" {n}\n" for n in sorted(closed_nodes)) + ) + extra = ", avoiding the closed roads and junctions in closures.txt" + instruction = ( + f"roads.csv lists one-way roads between junctions with their travel time in minutes. Find a fastest route " + f"from {src} to {dst}{extra}. " + f"Write the junction ids of the route in order, space separated, on one line in /app/route.txt, " + f"starting with {src} and ending with {dst}. Any fastest route is accepted." + ) + best_path = _dijkstra_path(nodes, live, src, dst) + live_w = {} + for u, v, w in live: + live_w[(u, v)] = min(w, live_w.get((u, v), w)) + + def verify(app: str) -> bool: + from ..core.grading import read_artifact # grading imports the families package + + data = read_artifact(app, "route.txt") + if data is None: + return False + route = data.decode("utf-8", errors="replace").split() + if len(route) < 2 or route[0] != src or route[-1] != dst: + return False + total = 0 + for u, v in zip(route, route[1:]): + if (u, v) not in live_w: + return False + total += live_w[(u, v)] + return total == cost + + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="route.txt", kind="custom", verify=verify, render=lambda: " ".join(best_path) + "\n"), + notes={"min_minutes": cost, "num_fastest_routes": ways}, + ) + + +# ---------------------------------------------------------------- math_count + + +def build_count(level: int, rng: random.Random) -> Built: + while True: + n = {1: rng.randint(5000, 20000), 2: rng.randint(50000, 200000), 3: rng.randint(400000, 900000)}[level] + a, b = rng.sample(range(3, 14), 2) + c = rng.choice([x for x in range(2, 10) if a % x and b % x]) + d = rng.randint(3, 7) + conds = [f"is divisible by {a} or by {b} (or both)", f"is not divisible by {c}"] + tests = [lambda x: x % a == 0 or x % b == 0, lambda x: x % c != 0] + if level >= 2: + conds.append(f"has a digit sum divisible by {d}") + tests.append(lambda x: sum(map(int, str(x))) % d == 0) + if level >= 3: + conds.append("is not a palindrome (reads differently backwards)") + conds.append("has no two equal adjacent digits") + tests.append(lambda x: str(x) != str(x)[::-1]) + tests.append(lambda x: all(p != q for p, q in zip(str(x), str(x)[1:]))) + hits = [x for x in range(1, n + 1) if all(t(x) for t in tests)] + if len(hits) >= 50: + break + k = rng.randint(len(hits) // 3, len(hits) - 1) + text = f"Consider the integers from 1 to {n} inclusive. Keep a number when it:\n" + "".join( + f" - {c_}\n" for c_ in conds + ) + instruction = ( + "problem.txt defines a set of integers. Write /app/results.json with three integer keys: " + f'"count" (how many integers are in the set), "kth_smallest" (the integer at position {k} when the set is sorted ascending, counting from 1) ' + 'and "largest" (the largest integer in the set).' + ) + expected = {"count": len(hits), "kth_smallest": hits[k - 1], "largest": hits[-1]} + return Built( + instruction=instruction, + files={"problem.txt": text}, + artifact=Artifact( + path="results.json", + kind="json", + expected=expected, + fields=[Field("count", "int"), Field("kth_smallest", "int"), Field("largest", "int")], + ), + notes=expected, + ) + + +FAMILIES = [ + Family("math_paths", "math and formal reasoning", "Count fastest routes", build_paths), + Family("math_count", "math and formal reasoning", "Count integers under constraints", build_count), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/mathematics3.py b/components/dnakhla/upstream/terminal_desk/families/mathematics3.py new file mode 100644 index 0000000000000000000000000000000000000000..5b3c24c95add634d79c7b6d84d9a2aa14d9cf2bb --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/mathematics3.py @@ -0,0 +1,471 @@ +"""Math and formal reasoning, v3: a fastest route under closures, counting raffle winners, exam-slot sequencing. + +Each verifier accepts any optimal answer: it replays the submitted route or schedule and compares its value +with the optimum the generator computed itself (SkillsBench pddl-tpp-planning, exam-block-sequencing). +""" + +import heapq +import itertools +import json +import random + +from .base import Artifact, Built, Family + +INF = float("inf") + + +def _is_int(x) -> bool: + return isinstance(x, int) and not isinstance(x, bool) + + +# ---------------------------------------------------------------- math3_route_plan + +CITIES = ("Northgate", "Riverton", "Ashford", "Millbrook", "Eastvale", "Harbor Point", "Kingsbridge") +VEHICLES = ("delivery van", "parts truck", "courier van", "service truck") +OPENERS = ( + "You are planning a {vehicle}'s route across {city}.", + "Our {city} dispatcher needs the fastest route for a {vehicle}.", + "You need the quickest route across {city} for a {vehicle}.", +) + + +def _earliest(adj: dict, src: str, windows: dict) -> tuple[dict, dict]: + """Earliest-arrival Dijkstra. windows[(u, v)] = (a, b): the road cannot be entered at a <= t < b; waiting is + allowed, so arrival times are FIFO and the label-setting search is exact.""" + best, prev, heap = {src: 0}, {}, [(0, src)] + while heap: + t, u = heapq.heappop(heap) + if t > best[u]: + continue + for v, w in adj.get(u, ()): + a, b = windows.get((u, v), (0, 0)) + arrive = (b if a <= t < b else t) + w + if arrive < best.get(v, INF): + best[v], prev[v] = arrive, u + heapq.heappush(heap, (arrive, v)) + return best, prev + + +def _adj(roads: dict) -> dict: + adj = {} + for (u, v), w in roads.items(): + adj.setdefault(u, []).append((v, w)) + return adj + + +def _trace(prev: dict, src: str, dst: str) -> list[str]: + path = [dst] + while path[-1] != src: + path.append(prev[path[-1]]) + return path[::-1] + + +def _route_instance(level: int, rng: random.Random): + n, deg, n_closed_roads, n_closed_nodes, n_timed = {1: (30, 3, 0, 0, 0), 2: (45, 3, 6, 2, 0), + 3: (60, 3, 6, 2, 8)}[level] + prefix = rng.choice("JNX") + nodes = [f"{prefix}{i:02d}" for i in range(1, n + 1)] + src, dst = rng.sample(nodes, 2) + roads = {} + for u in nodes: + for v in rng.sample([x for x in nodes if x != u], deg): + roads[(u, v)] = rng.randint(2, 15) + full, full_prev = _earliest(_adj(roads), src, {}) + if full.get(dst, 0) < 15: + return None + if level == 1: # the one-way caveat must bite: driving roads both ways finds a faster route + both = dict(roads) + for (u, v), w in roads.items(): + both[(v, u)] = min(w, both.get((v, u), INF)) + if _earliest(_adj(both), src, {})[0][dst] >= full[dst]: + return None + return nodes, src, dst, roads, set(), set(), {}, full[dst], _trace(full_prev, src, dst) + # closures: one junction and one road on the open optimum, the rest at random + on_path = _trace(full_prev, src, dst) + closed_nodes = {rng.choice(on_path[1:-1])} if len(on_path) > 2 else set() + while len(closed_nodes) < n_closed_nodes: + closed_nodes.add(rng.choice([x for x in nodes if x not in (src, dst)])) + closed_roads = {rng.choice(list(zip(on_path, on_path[1:])))} + while len(closed_roads) < n_closed_roads: + closed_roads.add(rng.choice(list(roads))) + live = {(u, v): w for (u, v), w in roads.items() + if (u, v) not in closed_roads and u not in closed_nodes and v not in closed_nodes} + static, static_prev = _earliest(_adj(live), src, {}) + if static.get(dst, 0) < 15 or static[dst] == full[dst]: + return None + if level == 2: + return nodes, src, dst, roads, closed_roads, closed_nodes, {}, static[dst], _trace(static_prev, src, dst) + # timed closures: two or three on the static optimum around the minute the van reaches them, the rest at random + path = _trace(static_prev, src, dst) + windows = {} + for u, v in rng.sample(list(zip(path, path[1:])), min(rng.randint(2, 3), len(path) - 1)): + t = static[u] + windows[(u, v)] = (max(0, t - rng.randint(0, 4)), t + rng.randint(4, 14)) + while len(windows) < n_timed: + a = rng.randint(0, 50) + windows.setdefault(rng.choice(list(live)), (a, a + rng.randint(5, 20))) + timed, timed_prev = _earliest(_adj(live), src, windows) + dropped = _earliest(_adj({k: w for k, w in live.items() if k not in windows}), src, {})[0] + if dst not in timed or timed[dst] == static[dst] or dropped.get(dst) == timed[dst]: + return None + return nodes, src, dst, roads, closed_roads, closed_nodes, windows, timed[dst], _trace(timed_prev, src, dst) + + +def build_route(level: int, rng: random.Random) -> Built: + for _ in range(500): + got = _route_instance(level, rng) + if got: + break + else: + raise RuntimeError(f"math3_route_plan L{level}: no instance in 500 draws") + nodes, src, dst, roads, closed_roads, closed_nodes, windows, best, best_path = got + city, vehicle = rng.choice(CITIES), rng.choice(VEHICLES) + depart = rng.choice(("06:45", "07:30", "08:00", "08:15", "09:00")) + order = list(roads) + rng.shuffle(order) + lines = [json.dumps({"from": u, "to": v, "minutes": roads[(u, v)]}) for u, v in order] + graph = '{"roads": [\n' + ",\n".join(lines) + '\n],\n"junctions": ' + json.dumps(sorted(nodes)) + "}\n" + files = { + "graph.json": graph, + "request.json": json.dumps({"vehicle": f"{vehicle} {rng.randint(2, 40)}", "from": src, "to": dst, + "depart": depart}) + "\n", + } + if level >= 2: + md = [f"# {city} closures, today", "", "## Closed roads (one way)"] + md += [f"- {u} -> {v}" for u, v in sorted(closed_roads)] + md += ["", "## Closed junctions"] + [f"- {x}" for x in sorted(closed_nodes)] + if windows: + md += ["", "## Timed closures"] + md += [f"- {u} -> {v}: closed from minute {a} to minute {b}" for (u, v), (a, b) in sorted(windows.items())] + files["closures.md"] = "\n".join(md) + "\n" + u0, v0 = rng.choice([(u, v) for u, v in order if (v, u) not in roads]) + ex = rng.sample([x for x in nodes if x not in (src, dst)], 3) # format only: not the requested endpoints + parts = [OPENERS[rng.randrange(3)].format(vehicle=vehicle, city=city), + "It must arrive as early as possible.\n", + "- /app/request.json: the start junction, the destination and the departure time.", + f"- /app/graph.json: each road's start junction, end junction and travel time in " + f"minutes. Roads are one-way: a road from {u0} to {v0} cannot be driven from {v0} to {u0}."] + if level >= 2: + timed_clause = " and timed closures" if windows else "" + parts.append(f"- /app/closures.md: today's closed roads, closed junctions{timed_clause}.\n") + rule = "A closed road, or any road into or out of a closed junction, cannot be used." + if windows: + rule += (" A timed-closure road cannot be entered while closed (minutes from departure), but the " + "vehicle may wait at a junction until it reopens; waiting counts toward the total.") + parts.append(rule) + parts.append(f"\nWrite /app/route.json with the junctions of the route in order and the total minutes from " + f'departure to arrival, e.g. {{"path": {json.dumps(ex)}, "total_minutes": {rng.randint(20, 60)}}}. ' + f"The path runs from the start to the destination on open roads, and total_minutes is the integer " + f"time it takes. Any fastest route is accepted.") + instruction = " ".join(parts[:2]) + "\n" + "\n".join(parts[2:]) + + live = {(u, v): w for (u, v), w in roads.items() + if (u, v) not in closed_roads and u not in closed_nodes and v not in closed_nodes} + + def replay(path: list) -> int: + t = 0 + for u, v in zip(path, path[1:]): + a, b = windows.get((u, v), (0, 0)) + t = (b if a <= t < b else t) + live[(u, v)] + return t + + checks = [ + ("test_is_object", lambda p: isinstance(p, dict)), + ("test_keys", lambda p: set(p) == {"path", "total_minutes"} and isinstance(p["path"], list) + and len(p["path"]) >= 2 and all(isinstance(x, str) for x in p["path"]) and _is_int(p["total_minutes"])), + ("test_endpoints", lambda p: p["path"][0] == src and p["path"][-1] == dst), + ("test_hops_open", lambda p: all((u, v) in live for u, v in zip(p["path"], p["path"][1:]))), + ("test_total_matches_path", lambda p: replay(p["path"]) == p["total_minutes"]), + ("test_total_optimal", lambda p: p["total_minutes"] == best), + ] + if replay(best_path) != best: + raise RuntimeError(f"math3_route_plan L{level}: generator path replays to {replay(best_path)}, not {best}") + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="route.json", kind="checks", parse="json", checks=checks, + render=lambda: json.dumps({"path": best_path, "total_minutes": best}) + "\n"), + notes={"src": src, "dst": dst, "min_minutes": best, "timed": len(windows)}, + root="/app", + ) + + +# ---------------------------------------------------------------- math3_count_items + +EVENTS = ("spring", "harvest", "winter", "founders' day", "summer fair", "library") +BOOTHS = ("A1", "A2", "B1", "B2", "B3", "C1", "C4", "D2") +VOID_REASONS = ("damaged", "unpaid", "duplicate print", "returned", "misprint") + + +def _count_instance(level: int, rng: random.Random): + n_rows = {1: 120, 2: 260, 3: 380}[level] + a, b = rng.sample(range(3, 14), 2) + c = rng.choice([x for x in range(2, 10) if a % x and b % x]) + d, m = rng.choice((3, 4, 5)), rng.randint(3, 9) + + def wins(x: int) -> bool: + if not (x % a == 0 or x % b == 0) or x % c == 0: + return False + return level == 1 or sum(map(int, str(x))) % d == 0 + + numbers, seen = [], set() + while len(numbers) < n_rows: + if level >= 2 and numbers and rng.random() < 0.07: + numbers.append(rng.choice(numbers)) # a reprint: the same number on a second ticket + continue + base = rng.choice((a, b)) + x = rng.randrange(100000 // base + 1, 999999 // base + 1) * base if rng.random() < 0.6 else \ + rng.randint(100000, 999999) + if x not in seen: + seen.add(x) + numbers.append(x) + tickets = [(f"T{i:04d}", x, rng.choice(BOOTHS)) for i, x in enumerate(numbers, 1)] + voided = {t for t, _, _ in rng.sample(tickets, n_rows // 12)} if level >= 3 else set() + alive = [x for t, x, _ in tickets if t not in voided] + winners = sorted({x for x in alive if wins(x)}) + if len(winners) < 20: + return None + # each caveat must change the answer + if level >= 2 and len([x for x in numbers if wins(x)]) == len({x for x in numbers if wins(x)}): + return None # no winning reprint: counting tickets would equal counting numbers + if level >= 3: + voided_wins = [x for t, x, _ in tickets if t in voided and wins(x)] + if not any(x not in alive for x in voided_wins) or not any(x in alive for x in voided_wins): + return None # need a voided winner that is gone and one that survives on its reprint + k = rng.randint(max(2, len(winners) // 4), len(winners) - 1) + residues = [0] * m + for x in winners: + residues[x % m] += 1 + pairs = residues[0] * (residues[0] - 1) // 2 + sum( + residues[r] * residues[m - r] for r in range(1, (m + 1) // 2)) + if m % 2 == 0: + pairs += residues[m // 2] * (residues[m // 2] - 1) // 2 + expected = {"count": len(winners), "kth_smallest": winners[k - 1], "largest": winners[-1]} + draw = {"draw": "", "divisors": [a, b], "excluded_divisor": c, "rank": k} + if level >= 2: + expected["pairs"] = pairs + draw.update(digit_sum_divisor=d, pair_modulus=m) + return draw, tickets, voided, expected + + +def build_count(level: int, rng: random.Random) -> Built: + for _ in range(500): + got = _count_instance(level, rng) + if got: + break + else: + raise RuntimeError(f"math3_count_items L{level}: no instance in 500 draws") + draw, tickets, voided, expected = got + event = rng.choice(EVENTS) + draw["draw"] = f"{event} raffle {rng.choice((2025, 2026))}" + files = {"data/tickets.csv": "ticket,number,booth\n" + "".join(f"{t},{x},{bo}\n" for t, x, bo in tickets), + "data/draw.json": "{\n" + ",\n".join(f' "{k}": {json.dumps(v)}' for k, v in draw.items()) + "\n}\n"} + if voided: + files["data/voided.csv"] = "ticket,reason\n" + "".join( + f"{t},{rng.choice(VOID_REASONS)}\n" for t in sorted(voided)) + head = (f"The {event} raffle sold {len(tickets)} tickets and the committee needs the prize figures. " + f"/root/data/tickets.csv has one row per ticket: ticket id, six-digit number and selling booth. " + f"/root/data/draw.json holds this draw's settings.") + rule = "its number is divisible by at least one of divisors and not by excluded_divisor" + rank = "kth_smallest (the winning number at position rank in ascending order, counting from 1)" + if level == 1: + body = (f" Every ticket carries a different number.\n\nA ticket wins when {rule}.\n\n" + f"Write /root/results.json with three integer keys: count (the number of winning tickets), {rank} " + f"and largest (the largest winning number).") + example = {"count": 31, "kth_smallest": 402115, "largest": 987350} + else: + void = " /root/data/voided.csv lists cancelled tickets; leave those tickets out." if voided else "" + after = " among the tickets that are not voided" if voided else "" + body = (f"{void}\n\nA ticket wins when {rule}, and its digit sum is divisible by " + f"digit_sum_divisor. Some numbers were printed on more than one ticket: count each winning number " + f"once{after}.\n\nWrite /root/results.json with four integer keys: count (distinct winning " + f"numbers), {rank}, largest (the largest winning number) and pairs (unordered pairs of different " + f"winning numbers whose sum is divisible by pair_modulus).") + example = {"count": 31, "kth_smallest": 402115, "largest": 987350, "pairs": 96} + instruction = head + body + f" For example: {json.dumps(example)}. Values are compared exactly." + keys = list(expected) + checks = [("test_is_object", lambda p: isinstance(p, dict)), + ("test_keys", lambda p: set(p) == set(keys) and all(_is_int(p[x]) for x in keys))] + checks += [(f"test_{key}", lambda p, key=key: p[key] == expected[key]) for key in keys] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="results.json", kind="checks", parse="json", checks=checks, + render=lambda: json.dumps(expected) + "\n"), + notes=dict(expected), + root="/root", + ) + + +# ---------------------------------------------------------------- math3_exam_slots + +DEPTS = ("CHEM", "MATH", "PHYS", "BIOL", "HIST", "ECON", "PSYC", "ENGL", "COMP", "PHIL", "SOCI", "STAT", "GEOG") +EXAM_OPENERS = ( + "You are helping the registrar sequence final exams.", + "The registrar's office needs the final-exam timetable for this term.", + "Our exams office has to place this term's final exams into slots.", +) + + +def _exam_terms(slots: list, pair: dict, trip: dict): + """slots: [(day, period)] in order; pair/trip keyed by sorted index tuples. Returns terms(order) -> + (back-to-back + same-day-triple cost, evening-to-morning pair sum).""" + p2 = {} + for (x, y), c in pair.items(): + p2[(x, y)] = p2[(y, x)] = c + t3 = {perm: c for key, c in trip.items() for perm in itertools.permutations(key)} + same, em = [], [] + for i in range(len(slots) - 1): + (d1, p1), (d2, q2) = slots[i], slots[i + 1] + if d1 == d2: + same.append(i) + elif p1 == "PM" and q2 == "AM" and d2 == d1 + 1: + em.append(i) + days = {} + for i, (day, _) in enumerate(slots): + days.setdefault(day, []).append(i) + triples = [ix for ix in days.values() if len(ix) == 3] + + def terms(order) -> tuple: + base = 3 * sum(p2[order[i], order[i + 1]] for i in same) + base += 10 * sum(t3[order[i], order[j], order[k]] for i, j, k in triples) + return base, sum(p2[order[i], order[i + 1]] for i in em) + + return terms + + +def _exam_instance(level: int, rng: random.Random): + days = {1: (3, 3), 2: (3, 3, 1), 3: (3, 3, 2)}[level] + periods = ("AM", "MID", "PM") + slots = [(d + 1, periods[i]) for d, n in enumerate(days) for i in range(n)] + n = len(slots) + letter = rng.choice("BEX") + blocks = [f"{letter}{i:02d}" for i in sorted(rng.sample(range(1, 30), n))] + courses, used = [], set() + for b in blocks: + for _ in range(rng.randint(24, 36)): + code = f"{rng.choice(DEPTS)}-{rng.randint(1, 4)}{rng.randint(0, 9)}{rng.randint(0, 9)}0" + if code not in used: + used.add(code) + courses.append((code, b, rng.randint(6, 30))) + size = {b: sum(s for _, bb, s in courses if bb == b) for b in blocks} + pair = {(i, j): 0 if rng.random() < 0.1 else rng.randint(1, 25) for i, j in + itertools.combinations(range(n), 2)} + trip = {(i, j, k): rng.randint(0, min(6, pair[(i, j)], pair[(i, k)], pair[(j, k)])) for i, j, k in + itertools.combinations(range(n), 3)} + cutoff, early, large = None, set(), [] + if level >= 2: + desc = sorted(size.values(), reverse=True) + n_large = rng.choice((1, 2)) + lo, hi = desc[n_large], desc[n_large - 1] + cutoff = (hi // 10) * 10 + if cutoff <= lo: + return None + early = {1, 2, 3} + large = [i for i, b in enumerate(blocks) if size[b] >= cutoff] + em = level >= 3 + terms = _exam_terms(slots, pair, trip) + late = [i for i in range(n) if i + 1 not in early] + # one pass: (cost without the README terms, cost with them, feasible under front-loading, schedule) + table = [] + for o in itertools.permutations(range(n)): + base, extra = terms(o) + table.append((base, base + extra if em else base, not any(o[i] in large for i in late), o)) + feasible = [row for row in table if row[2]] + best = min(row[1] for row in feasible) + orders = [row[3] for row in feasible if row[1] == best] + if best == 0: + return None + if level >= 2 and min(row[0] for row in table) >= min(row[0] for row in feasible): + return None # front-loading must cost something + if em: + naive = min(row[0] for row in feasible) + if any(row[1] == best for row in feasible if row[0] == naive): + return None # some schedule that ignores the evening-to-morning term would still be optimal + return slots, blocks, courses, size, pair, trip, cutoff, sorted(early), large, best, orders + + +def build_exams(level: int, rng: random.Random) -> Built: + for _ in range(200): + got = _exam_instance(level, rng) + if got: + break + else: + raise RuntimeError(f"math3_exam_slots L{level}: no instance in 200 draws") + slots, blocks, courses, size, pair, trip, cutoff, early, large, best, orders = got + n, days = len(blocks), slots[-1][0] + inst = {"blocks": blocks, "slots": [{"slot": i + 1, "day": d, "period": p} for i, (d, p) in enumerate(slots)], + "block_size": size} + readme = ["# Exam sequencing rules, this term", "", + "- Pair and triple counts are unordered: each group of blocks appears once, ids in ascending order."] + if level >= 2: + inst["large_block_cutoff"], inst["early_slots"] = cutoff, early + readme.append("- Front-loading: a block whose size is at or above `large_block_cutoff` in instance.json must " + "be placed in one of the `early_slots`.") + if level >= 3: + readme.append("- Evening-to-morning: when the PM slot of one day is followed by the AM slot of the next day, " + "add 1 x the pair count of the two blocks placed in them to the objective.") + rng.shuffle(courses) + files = { + "data/instance.json": json.dumps(inst, indent=1) + "\n", + "data/pair_counts.csv": "block_a,block_b,students\n" + "".join( + f"{blocks[i]},{blocks[j]},{c}\n" for (i, j), c in sorted(pair.items())), + "data/triplet_counts.csv": "block_a,block_b,block_c,students\n" + "".join( + f"{blocks[i]},{blocks[j]},{blocks[k]},{c}\n" for (i, j, k), c in sorted(trip.items())), + "data/blockmap.csv": "course,block,students\n" + "".join(f"{c},{b},{s}\n" for c, b, s in courses), + "data/README.md": "\n".join(readme) + "\n", + } + words = {6: "six", 7: "seven", 8: "eight"}[n] + instruction = ( + f"{rng.choice(EXAM_OPENERS)} The exams form {words} blocks, and {words} slots run over " + f"{'two' if days == 2 else 'three'} days. Place them so students sit as few close-together exams as " + f"possible.\n\nInputs in /root/data/:\n" + f"- instance.json: the blocks, the slots in order (slot, day, period) and each block's size.\n" + f"- pair_counts.csv and triplet_counts.csv: students taking both blocks of a pair, or all three of a triple.\n" + f"- blockmap.csv: the courses in each block.\n" + f"- README.md: this term's scheduling rules. Apply them.\n\n" + f"Objective, lower is better: for two consecutive slots on the same day, add 3 x the pair count of their " + f"blocks; for a day with three slots, add 10 x the triplet count of its three blocks.\n\n" + f"Create /root/output/ and write /root/output/schedule.csv with the header slot,block and one row per slot " + f"in slot order, for example 1,{rng.choice(blocks)}. Every block appears once. It must follow every rule " + f"and reach the lowest objective; any optimal schedule is accepted." + ) + index = {b: i for i, b in enumerate(blocks)} + terms = _exam_terms(slots, pair, trip) + + def cost(order) -> int: + base, extra = terms(order) + return base + extra if level >= 3 else base + + large_ids = {blocks[i] for i in large} + + def order_of(p) -> tuple: + return tuple(index[r["block"]] for r in p["rows"]) + + checks = [ + ("test_header", lambda p: p["header"] == ["slot", "block"]), + ("test_row_count", lambda p: len(p["rows"]) == n), + ("test_slots_in_order", lambda p: [r["slot"] for r in p["rows"]] == [str(i + 1) for i in range(n)]), + ("test_blocks_once", lambda p: sorted(r["block"] for r in p["rows"]) == sorted(blocks)), + ] + if level >= 2: + checks.append(("test_front_loading", lambda p: all( + int(r["slot"]) in early for r in p["rows"] if r["block"] in large_ids))) + checks.append(("test_objective_optimal", lambda p: cost(order_of(p)) == best)) + want = orders[0] + schedule = "slot,block\n" + "".join(f"{i + 1},{blocks[x]}\n" for i, x in enumerate(want)) + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="output/schedule.csv", kind="checks", parse="csv", checks=checks, + render=lambda: schedule), + notes={"objective": best, "optimal_schedules": len(orders), "large": sorted(large_ids)}, + root="/root", + ) + + +FAMILIES = [ + Family("math3_route_plan", "math and formal reasoning", "Fastest route under closures", build_route, v3=True), + Family("math3_count_items", "math and formal reasoning", "Count raffle winners and pairs", build_count, v3=True), + Family("math3_exam_slots", "math and formal reasoning", "Sequence exam blocks into slots", build_exams, v3=True), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/media.py b/components/dnakhla/upstream/terminal_desk/families/media.py new file mode 100644 index 0000000000000000000000000000000000000000..f6953af350510507ac4a6921f4f1ebdf4d48b670 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/media.py @@ -0,0 +1,180 @@ +"""Media production: fix subtitle timing; extract segments, a trim or a channel from a WAV recording.""" + +import io +import math +import random +import struct +import wave + +from .base import Artifact, Built, Family, Field + +WORDS = ( + "we need to leave before the tide turns and the road floods again so pack light take the map " + "and do not wait for me if the bridge is out find the ferry at the north dock" +).split() + +# ---------------------------------------------------------------- med_srt + + +def _ts(ms: int) -> str: + h, rem = divmod(ms, 3600000) + m, rem = divmod(rem, 60000) + s, ms = divmod(rem, 1000) + return f"{h:02d}:{m:02d}:{s:02d},{ms:03d}" + + +def build_srt(level: int, rng: random.Random) -> Built: + n = {1: 12, 2: 25, 3: 45}[level] + cues, t = [], rng.randint(1000, 5000) + for i in range(n): + dur = rng.randint(900, 4500) + lines = [] + for _ in range(rng.choice([1, 1, 2])): + lines.append(" ".join(rng.choice(WORDS) for _ in range(rng.randint(2, 7))).capitalize()) + if level == 3 and rng.random() < 0.25: + lines[0] = f"{lines[0]}" + cues.append([t, t + dur, lines]) + t = t + dur + rng.randint(-600, 1500) + t = max(t, cues[-1][0] + 100) + if level == 1: + shift_from, shift_ms = 1, rng.choice([2000, 3500, 5000]) + else: + shift_from = rng.randint(n // 3, 2 * n // 3) + shift_ms = rng.choice([1250, 800, 2000]) + texts = ["\n".join(lines) for _, _, lines in cues] + if level == 1: + # the file as shipped is late; the correct cues are the generated ones + fixed = [(s, e) for s, e, _ in cues] + late = [(s + shift_ms, e + shift_ms) for s, e in fixed] + else: + late = [(s, e) for s, e, _ in cues] + fixed = [(s - shift_ms, e - shift_ms) if i + 1 >= shift_from else (s, e) for i, (s, e) in enumerate(late)] + blocks = [f"{i + 1}\n{_ts(s)} --> {_ts(e)}\n{texts[i]}\n" for i, (s, e) in enumerate(late)] + text = "\n".join(blocks) + if level == 3: + text = "\ufeff" + text.replace("\n", "\r\n") + secs = f"{shift_ms / 1000:g}" + if level == 1: + what = f"Every cue in /app/episode.srt is {secs} s late." + else: + what = f"In /app/episode.srt, cues {shift_from} to the end are {secs} s late." + rest = "" if level == 1 else ", leave the other cues untouched" + instruction = ( + f"{what} Subtract that from both the start and end times of {'every cue' if level == 1 else 'those cues'}" + f"{rest}, keep all text as is, and save the corrected subtitles to /app/episode_fixed.srt in the same " + "SRT format." + ) + artifact = Artifact( + path="episode_fixed.srt", + kind="srt", + tol_ms=1, + expected=[(s, e, texts[i]) for i, (s, e) in enumerate(fixed)], + ) + return Built(instruction=instruction, files={"episode.srt": text}, artifact=artifact) + + +# ---------------------------------------------------------------- med_wav + +THRESH = 200 + + +def _segments(samples: list[int], rate: int) -> list[tuple[float, float]]: + """(first, last) loud sample time in seconds of each sound segment.""" + gap_max = int(0.05 * rate) + spans: list[list[int]] = [] + for i, x in enumerate(samples): + if abs(x) > THRESH: + if not spans or i - spans[-1][1] - 1 >= gap_max: + spans.append([i, i]) + else: + spans[-1][1] = i + return [(a / rate, b / rate) for a, b in spans] + + +def _wav_bytes(frames: bytes, channels: int, rate: int) -> bytes: + buf = io.BytesIO() + with wave.open(buf, "wb") as w: + w.setnchannels(channels) + w.setsampwidth(2) + w.setframerate(rate) + w.writeframes(frames) + return buf.getvalue() + + +def _track(rng: random.Random, rate: int, noise: int) -> list[int]: + out = [] + + def quiet(seconds): + for _ in range(int(seconds * rate)): + out.append(rng.randint(-noise, noise) if noise else 0) + + quiet(rng.uniform(0.1, 0.4)) + for _ in range(rng.randint(3, 7)): + amp, freq = rng.randint(2000, 20000), rng.uniform(200, 1000) + for j in range(int(rng.uniform(0.2, 0.8) * rate)): + v = amp * math.sin(2 * math.pi * freq * j / rate) + if noise: + v += rng.randint(-noise, noise) + out.append(int(max(-32768, min(32767, round(v))))) + quiet(rng.uniform(0.1, 0.6)) + return out + + +def build_wav(level: int, rng: random.Random) -> Built: + rate = {1: 8000, 2: 16000, 3: 16000}[level] + noise = 0 if level == 1 else rng.randint(40, 150) + left = _track(rng, rate, noise) + channels = 1 + right = [] + if level == 3: + right = _track(rng, rate, noise) + length = max(len(left), len(right)) + left += [0] * (length - len(left)) + right += [0] * (length - len(right)) + channels = 2 + frames = b"".join(struct.pack(" THRESH] + trimmed = struct.pack(f"<{loud[-1] - loud[0] + 1}h", *left[loud[0] : loud[-1] + 1]) + instruction = ( + f"take.wav in /app is a 16-bit mono recording with quiet background noise before and after the " + f"sound. A sample is loud when its absolute value is above {THRESH}. Cut the recording from the first " + "loud sample to the last loud sample, both included, and save it to /app/trimmed.wav as a WAV with " + "the same sample rate and sample width." + ) + artifact = Artifact(path="trimmed.wav", kind="wav", expected=_wav_bytes(trimmed, 1, rate)) + else: + mono = struct.pack(f"<{len(right)}h", *right) + instruction = ( + "take.wav in /app is a 16-bit stereo recording. Extract channel 2 (the right channel) as a mono WAV " + "of the same length, sample rate and sample width, and save it to /app/right.wav." + ) + artifact = Artifact(path="right.wav", kind="wav", expected=_wav_bytes(mono, 1, rate)) + return Built(instruction=instruction, files=files, artifact=artifact) + + +FAMILIES = [ + Family("med_srt", "media and content production", "Fix subtitle timing", build_srt), + Family("med_wav", "media and content production", "Process a WAV recording", build_wav), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/media3.py b/components/dnakhla/upstream/terminal_desk/families/media3.py new file mode 100644 index 0000000000000000000000000000000000000000..54e71e98a1ffa5a5723e22467837d974829d00de --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/media3.py @@ -0,0 +1,557 @@ +"""Media and content production, v3: silence report on a lecture WAV (/app), subtitle retiming +through an edit decision list (/root), sprite counting in game keyframes (/root, Pillow + numpy). + +Every generator computes the expected answer from its own construction and, where a numeric rule +could disagree with the construction (window levels, template matches), recomputes it from the +written data and asserts the two agree. A disagreement is a generator bug and raises. +""" + +import io +import json +import math +import random +import re +from array import array + +from .base import Artifact, Built, Family +from .media import WORDS, _ts, _wav_bytes + +DOMAIN = "media and content production" + +# ---------------------------------------------------------------- med3_silence_report + +RATE = 8000 +WIN = 400 # samples per 50 ms window at 8 kHz +WIN_S = 0.05 +QUIET_AMP, NOISY_AMP = 60, 1000 # uniform noise: about -59.5 and -35 dBFS +THR, NOISY_THR, PAUSE_S = -40.0, -30.0, 2.0 +TIME_TOL, PCT_TOL = 0.02, 0.1 + + +def _level_db(window) -> float: + rms = math.sqrt(sum(v * v for v in window) / len(window)) + return 20 * math.log10(max(rms, 1e-9) / 32768) + + +def _timeline(rng: random.Random, total_s: float) -> list[list]: + """[kind, windows] spans: an opening of quiet, then bursts of tone and gaps. Gap lengths avoid + 1.5-2.5 s so the 2.0 s rule is never decided by one window.""" + opening = rng.randint(12, 36) if rng.random() < 0.5 else rng.randint(60, 160) + spans = [["gap", opening]] + while sum(n for _, n in spans) < total_s / WIN_S: + spans.append(["tone", rng.randint(30, 140)]) + spans.append(["gap", rng.randint(50, 100) if rng.random() < 0.35 else rng.randint(4, 30)]) + spans.append(["tone", rng.randint(30, 80)]) + spans.append(["gap", rng.randint(4, 20)]) + return spans + + +def _noisy_span(rng: random.Random, spans: list[list]) -> tuple[float, float] | None: + """A 10-20 s span that starts and ends inside bursts and holds at least one long gap.""" + starts, t = [], 0 + for kind, n in spans: + starts.append(t) + t += n + tones = [i for i, (kind, _) in enumerate(spans) if kind == "tone"] + pairs = [] + for a in tones: + for b in tones: + inner = range(a + 1, b) + length = (starts[b] + spans[b][1] / 2 - starts[a] - spans[a][1] / 2) * WIN_S + if b > a and 10 <= length <= 20 and any(spans[i][0] == "gap" and spans[i][1] >= 50 for i in inner): + pairs.append((a, b)) + if not pairs: + return None + a, b = rng.choice(pairs) + for i in range(a + 1, b): + if spans[i][0] == "gap": + spans[i][0] = "noisy" + lo = round(rng.uniform(starts[a] + 4, starts[a] + spans[a][1] - 4) * WIN_S, 2) + hi = round(rng.uniform(starts[b] + 4, starts[b] + spans[b][1] - 4) * WIN_S, 2) + return lo, hi + + +def _render_channel(rng: random.Random, spans: list[list]) -> array: + pools = {kind: [array("h", (rng.randint(-amp, amp) for _ in range(WIN))) for _ in range(24)] + for kind, amp in (("gap", QUIET_AMP), ("noisy", NOISY_AMP))} + out = array("h") + for kind, n in spans: + if kind == "tone": + amp, freq = rng.randint(3000, 12000), rng.uniform(150, 600) + step = 2 * math.pi * freq / RATE + out.extend(int(round(amp * math.sin(step * j))) for j in range(n * WIN)) + else: + for _ in range(n): + out.extend(rng.choice(pools[kind])) + return out + + +def build_silence(level: int, rng: random.Random) -> Built: + total = {1: rng.uniform(60, 78), 2: rng.uniform(75, 88), 3: rng.uniform(40, 43)}[level] + seg_range = {1: (4, 8), 2: (4, 9), 3: (3, 7)}[level] + for _ in range(500): + spans = _timeline(rng, total) + span = _noisy_span(rng, spans) if level >= 2 else None + if level >= 2 and span is None: + continue + silent = [] + for kind, n in spans: + silent += [kind != "tone"] * n + runs, i = [], 0 + while i < len(silent): + j = i + while j < len(silent) and silent[j] == silent[i]: + j += 1 + if silent[i] and (i == 0 or (j - i) * WIN_S > PAUSE_S): + runs.append((i, j)) + i = j + if seg_range[0] <= len(runs) <= seg_range[1]: + break + else: + raise RuntimeError("med3_silence_report: no timeline in range after 500 draws") + lapel = _render_channel(rng, spans) + nwin = len(lapel) // WIN + if len(lapel) != nwin * WIN or nwin != len(silent): + raise AssertionError("med3_silence_report: samples do not fill whole windows of the timeline") + lo, hi = span if span else (math.inf, math.inf) + for w in range(nwin): # the stated rule applied to the written samples must give the built mask + limit = NOISY_THR if lo <= w * WIN_S < hi else THR + if (_level_db(lapel[w * WIN:(w + 1) * WIN]) < limit) != silent[w]: + raise AssertionError(f"med3_silence_report: window {w} disagrees with the timeline") + channels, frames = 1, lapel + if level == 3: # channel 2: the room mic, 60 Hz hum near -22 dBFS plus faint noise + hum, step = rng.randint(3500, 3900), 2 * math.pi * 60 / RATE + frames = array("h", bytes(4 * len(lapel))) + frames[0::2] = lapel + frames[1::2] = array("h", (int(round(hum * math.sin(step * j))) + rng.randint(-40, 40) + for j in range(len(lapel)))) + channels = 2 + files = {"data/lecture.wav": _wav_bytes(frames.tobytes(), channels, RATE)} + if level >= 2: + notes = (f"# Recording notes\n\nFrom {lo:.2f} s to {hi:.2f} s the class moved to the workshop, where the " + "air handling is loud. For windows starting in that span (start inclusive, end exclusive) use " + "-30 dBFS instead of -40 dBFS.\n") + if level == 3: + notes += ("\nThe file is stereo. Channel 1 is the instructor's lapel microphone. Channel 2 is a room " + "microphone that carries mains hum the whole time, so it never goes quiet: judge silence on " + "channel 1 only.\n") + files["data/notes.md"] = notes + original = round(nwin * WIN_S, 3) + segs = [{"start": round(a * WIN_S, 3), "end": round(b * WIN_S, 3), "duration": round((b - a) * WIN_S, 3)} + for a, b in runs] + removed = round(sum(s["duration"] for s in segs), 3) + report = {"original_duration_seconds": original, "compressed_duration_seconds": round(original - removed, 3), + "removed_duration_seconds": removed, "compression_percentage": round(removed / original * 100, 2), + "segments_removed": segs} + notes_line = " Recording notes in /app/data/notes.md override these rules where they differ." if level >= 2 else "" + instruction = ( + "A lecture recording for the course site, /app/data/lecture.wav (16-bit PCM), opens with dead air, and " + f"the instructor pauses between topics. Both should be cut.{notes_line}\n\n" + "1. Split the audio into consecutive 50 ms windows from 0 s.\n" + "2. A window's level is 20 * log10(rms / 32768) dBFS, rms being the root mean square of its samples. " + "Below -40 dBFS it is silent.\n" + "3. A silent run is a maximal stretch of consecutive silent windows (start of its first window to end " + "of its last).\n" + "4. Remove the run at the very start of the file, whatever its length, and every other run longer than " + "2.0 s.\n\n" + "Write /app/compression_report.json with the keys original_duration_seconds, " + "compressed_duration_seconds, removed_duration_seconds, compression_percentage (removed / original * " + "100) and segments_removed: a list in time order of objects like " + '{"start": 0.0, "end": 6.3, "duration": 6.3}. Times are checked within 0.02 s, the percentage within 0.1.' + ) + + def near(got, want, tol=TIME_TOL) -> bool: + return isinstance(got, (int, float)) and not isinstance(got, bool) and abs(got - want) <= tol + 1e-9 + + def seg_ok(p) -> bool: + got = p["segments_removed"] + return all(near(g[k], w[k]) for g, w in zip(got, segs) for k in ("start", "end", "duration")) + + keys = set(report) + checks = [ + ("test_valid_json", lambda p: isinstance(p, dict)), + ("test_keys", lambda p: set(p) == keys and isinstance(p["segments_removed"], list) + and all(isinstance(s, dict) and set(s) == {"start", "end", "duration"} for s in p["segments_removed"])), + ("test_original_duration", lambda p: near(p["original_duration_seconds"], original)), + ("test_segment_count", lambda p: len(p["segments_removed"]) == len(segs)), + ("test_segments", seg_ok), + ("test_removed_duration", lambda p: near(p["removed_duration_seconds"], removed)), + ("test_compressed_duration", lambda p: near(p["compressed_duration_seconds"], original - removed)), + ("test_consistency", lambda p: near(p["original_duration_seconds"], + p["compressed_duration_seconds"] + p["removed_duration_seconds"])), + ("test_compression_percentage", lambda p: near(p["compression_percentage"], + report["compression_percentage"], PCT_TOL)), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="compression_report.json", kind="checks", parse="json", checks=checks, + render=lambda: json.dumps(report, indent=2) + "\n"), + notes={"segments": len(segs), "noisy_span": span}, + root="/app", + ) + +# ---------------------------------------------------------------- med3_subtitle_retime + + +def _edl_ts(ms: int) -> str: + return _ts(ms).replace(",", ".") + + +def _cue_text(rng: random.Random, italics: bool) -> str: + lines = [" ".join(rng.choice(WORDS) for _ in range(rng.randint(2, 7))).capitalize() + for _ in range(rng.choice([1, 1, 2]))] + if italics and rng.random() < 0.25: + lines[0] = f"{lines[0]}" + return "\n".join(lines) + + +def _union(cuts: list[tuple[int, int]]) -> list[list[int]]: + merged: list[list[int]] = [] + for s, e in sorted(cuts): + if merged and s <= merged[-1][1]: + merged[-1][1] = max(merged[-1][1], e) + else: + merged.append([s, e]) + return merged + + +def _shift(t: int, union: list[list[int]]) -> int: + """t minus the removed footage before it; a time inside a cut lands on the cut point.""" + out = t + for s, e in union: + if t > s: + out -= min(t, e) - s + return out + + +def _draw_cuts(rng: random.Random, k: int, span: tuple[int, int], overlap: bool) -> list[tuple[int, int]]: + lo, hi = span + for _ in range(1000): + cuts = [] + for _ in range(k): + s = rng.randint(lo, hi - 16000) + cuts.append((s, s + rng.randint(2000, 14000))) + cuts.sort() + pairs = list(zip(cuts, cuts[1:])) + touching = any(e1 - 1000 <= s2 <= e1 + 500 for (_, e1), (s2, _) in pairs) # neither clear nor overlapping + overlapping = any(s2 < e1 - 1000 for (_, e1), (s2, _) in pairs) + if not touching and overlapping == overlap: + return cuts + raise RuntimeError("med3_subtitle_retime: no cut layout after 1000 draws") + + +def _gap_cut_cues(rng: random.Random, n_cues: int, n_cuts: int) -> tuple[list, list[tuple[int, int]]]: + """L1: cues with a long silent gap after n_cuts of them, and one cut inside each gap, so no cue + touches removed footage and every cue only shifts by the cuts before it.""" + while True: + picks = sorted(rng.sample(range(4, n_cues - 4), n_cuts)) + if all(b - a >= 8 for a, b in zip(picks, picks[1:])): + break + cues, cuts, t = [], [], rng.randint(1000, 5000) + for i in range(n_cues): + dur = rng.randint(900, 4500) + cues.append((t, t + dur, _cue_text(rng, False))) + t += dur + if i in picks: + lead, length = rng.randint(150, 600), rng.randint(2500, 12000) + cuts.append((t + lead, t + lead + length)) + t += lead + length + rng.randint(150, 600) + else: + t += rng.randint(100, 1500) + return cues, cuts + + +def build_retime(level: int, rng: random.Random) -> Built: + from ..core.grading import parse_srt # grading imports the families package, so not at module level + + n_cues, n_cuts = {1: (46, 2), 2: (46, 3), 3: (80, 7)}[level] + min_len = 500 if level == 3 else 1 + ids = [f"C{i}" for i in range(1, n_cuts + 1)] + reverted = None + if level == 1: + cues, cuts = _gap_cut_cues(rng, n_cues, n_cuts) + union = _union(cuts) + out = [(_shift(s, union), _shift(e, union), text) for s, e, text in cues] + if any(s < b and a < e for s, e, _ in cues for a, b in union): + raise AssertionError("med3_subtitle_retime: an L1 cut overlaps a cue") + else: + for _ in range(500): + cues, t = [], rng.randint(1000, 5000) + for _ in range(n_cues): + dur = rng.randint(900, 4500) + cues.append((t, t + dur, _cue_text(rng, level == 3))) + t += dur + rng.randint(100, 1500) + cuts = _draw_cuts(rng, n_cuts, (cues[0][0], cues[-1][1]), overlap=level == 3) + reverted = rng.choice(ids[1:-1]) if level == 3 else None + active = [c for cid, c in zip(ids, cuts) if cid != reverted] + union = _union(active) + out = [(_shift(s, union), _shift(e, union), text) for s, e, text in cues] + inside = sum(1 for s, e, _ in cues if any(a <= s and e <= b for a, b in union)) + straddle = sum(1 for s, e, _ in cues if any(s < a < e or s < b < e for a, b in union)) + near_min = any(abs((e - s) - 500) <= 5 for s, e, _ in out) if level == 3 else False + short = sum(1 for s, e, _ in out if 0 < e - s < 500) + sliver = any(0 < e - s < 20 for s, e, _ in out) # a kept 5 ms cue would hinge on the 1 ms tolerance + merged = len(union) < len(active) # L3: an overlapping pair survives the reverted cut + if inside >= 1 and straddle >= 2 and not near_min and not sliver and (level < 3 or (short >= 1 and merged)): + break + else: + raise RuntimeError("med3_subtitle_retime: no instance after 500 draws") + want = [(s, e, text) for s, e, text in out if e - s >= min_len] + srt = "\n".join(f"{i}\n{_ts(s)} --> {_ts(e)}\n{text}\n" for i, (s, e, text) in enumerate(cues, 1)) + if level == 3: + srt = "\ufeff" + srt.replace("\n", "\r\n") + if level == 1: + rows = [(cid, s, e, "dead air") for cid, (s, e) in zip(ids, cuts)] + else: + rows = [(cid, s, e, rng.choice(("retake", "dead air", "off topic", "legal", "pacing"))) + for cid, (s, e) in zip(ids, cuts)] + if level == 3: + rng.shuffle(rows) + edl = "cut_id,start,end,reason\n" + "".join(f"{c},{_edl_ts(s)},{_edl_ts(e)},{r}\n" for c, s, e, r in rows) + files = {"episode.srt": srt, "edl.csv": edl} + output = ( + "Write the result as an SRT file at /root/output/episode.srt with HH:MM:SS,mmm times, for example:\n" + "1\n00:00:01,250 --> 00:00:03,900\nPack light and take the map\n\n" + "Times are checked within 1 ms and text must match exactly." + ) + if level == 1: + instruction = ( + "Our editor removed stretches of dead air from an episode, and every subtitle after a removed stretch " + "now runs late. The subtitles are /root/episode.srt. The removed stretches are listed in " + "/root/edl.csv with the columns cut_id, start, end, reason; start and end are HH:MM:SS.mmm times on " + "the original timeline. Every cut lies in a silent gap between two cues, so no cue overlaps removed " + "footage.\n\n" + "1. A cue moves earlier by the total length (end - start) of all the cuts before it. Cues before the " + "first cut keep their times.\n" + "2. Shift a cue's start and end by the same amount.\n" + "3. Keep every cue, its number and its text exactly as they are.\n\n" + output + ) + elif level == 2: + instruction = ( + "Our editor cut sections out of an episode, and the subtitles now drift after each cut. The subtitles " + "are /root/episode.srt. The cuts are in /root/edl.csv (cut_id, start, end, reason); start and end are " + "HH:MM:SS.mmm times on the original timeline, and everything between them was removed.\n\n" + "1. A time t moves earlier by the removed footage before it: for every cut that starts before t, " + "subtract min(t, end) - start. A time inside a cut lands on the point where the cut was made.\n" + "2. Apply this to the start and end of every cue, so a cue that straddles a cut gets shorter.\n" + "3. Drop a cue whose start and end land on the same time.\n" + "4. Keep each cue's text exactly, line breaks included, and renumber the cues from 1.\n\n" + output + ) + else: + files["edit_notes.md"] = (f"# Edit notes\n\n{reverted} was reverted in the final cut: that footage stays " + "in. Ignore its row.\n\nAfter retiming, drop any cue shorter than 500 ms. Nobody " + "can read it.\n") + instruction = ( + "Our editor cut sections out of an episode, and the subtitles now drift after each cut. The subtitles " + "are /root/episode.srt. The cuts are in /root/edl.csv (cut_id, start, end, reason); start and end are " + "HH:MM:SS.mmm times on the original timeline, and everything between them was removed. The editor " + "left notes in /root/edit_notes.md; follow them.\n\n" + "1. A time t moves earlier by the total length of removed footage before t. A time inside a cut lands " + "on the point where the cut was made.\n" + "2. Apply this to the start and end of every cue, so a cue that straddles a cut gets shorter.\n" + "3. Drop a cue whose start and end land on the same time.\n" + "4. Keep each cue's text exactly, line breaks included, and renumber the cues from 1.\n\n" + output + ) + + def norm(text: str) -> list[str]: + return [" ".join(line.split()) for line in text.strip().split("\n")] + + def numbering(text: str) -> bool: + blocks = re.split(r"\n\s*\n", text.strip()) + return [b.strip().split("\n")[0].strip() for b in blocks] == [str(i) for i in range(1, len(blocks) + 1)] + + def times(text: str) -> bool: + got = parse_srt(text) + return len(got) == len(want) and all(abs(g[0] - w[0]) <= 1 and abs(g[1] - w[1]) <= 1 + for g, w in zip(got, want)) + + def texts(text: str) -> bool: + got = parse_srt(text) + return len(got) == len(want) and all(norm(g[2]) == norm(w[2]) for g, w in zip(got, want)) + + checks = [ + ("test_parses", lambda p: isinstance(parse_srt(p), list)), + ("test_cue_count", lambda p: len(parse_srt(p)) == len(want)), + ("test_numbering", numbering), + ("test_times", times), + ("test_text", texts), + ] + rendered = "\n".join(f"{i}\n{_ts(s)} --> {_ts(e)}\n{text}\n" for i, (s, e, text) in enumerate(want, 1)) + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="output/episode.srt", kind="checks", parse="text", checks=checks, + render=lambda: rendered), + notes={"cues": len(want), "dropped": len(cues) - len(want), "reverted": reverted}, + root="/root", + ) + + +# ---------------------------------------------------------------- med3_sprite_count + +FRAME_W, FRAME_H = 256, 144 +SPRITES = {"coin": (16, 12), "enemy": (16, 16), "turtle": (24, 16)} # (height, width) +MAX_DIFF = 10.0 +NOISE = 3 + + +def _gray(rgb): + """Pillow's mode "L" conversion, the same integer formula the instruction's step 1 runs.""" + from PIL import Image + + return __import__("numpy").asarray(Image.fromarray(rgb).convert("L"), dtype="float32") + + +def _sprite(nrng, h: int, w: int): + import numpy as np + + while True: + palette = nrng.integers(0, 256, size=(4, 3), dtype=np.uint8) + g = np.sort(palette @ np.array([0.299, 0.587, 0.114])) + if np.min(np.diff(g)) >= 40: # four clearly different gray levels + break + idx = nrng.integers(0, 4, size=(h // 2, w // 2)).repeat(2, axis=0).repeat(2, axis=1) # 2x2 pixel art + art = palette[idx] + if np.array_equal(art, art[:, ::-1]): + return _sprite(nrng, h, w) + return art + + +def _png(rgb) -> bytes: + from PIL import Image + + buf = io.BytesIO() + Image.fromarray(rgb).save(buf, format="PNG") + return buf.getvalue() + + +def _count(frame, variants) -> int: + """The instruction's rule: windows fully inside the frame, mean abs diff below 10, one hit per object. + Sums |frame - sprite pixel| one sprite pixel at a time over every window position (same numbers as a + sliding window, without the windows x sprite temporary).""" + import numpy as np + + h, w = variants[0].shape + ny, nx = frame.shape[0] - h + 1, frame.shape[1] - w + 1 + hits = np.zeros((ny, nx), dtype=bool) + for t in variants: + total = np.zeros((ny, nx), dtype=np.float32) + for dy in range(h): + for dx in range(w): + total += np.abs(frame[dy:dy + ny, dx:dx + nx] - t[dy, dx]) + hits |= total / (h * w) < MAX_DIFF + found: list[tuple[int, int]] = [] + for y, x in zip(*np.nonzero(hits)): + if all(abs(y - fy) >= h or abs(x - fx) >= w for fy, fx in found): + found.append((y, x)) + return len(found) + + +def _place(rng: random.Random, taken: list, h: int, w: int, x_range: tuple[int, int]): + for _ in range(200): + y, x = rng.randint(0, FRAME_H - h), rng.randint(*x_range) + if all(y + h + 2 <= ty or ty + th + 2 <= y or x + w + 2 <= tx or tx + tw + 2 <= x for ty, tx, th, tw in taken): + taken.append((y, x, h, w)) + return y, x + return None + + +def build_sprites(level: int, rng: random.Random) -> Built: + import numpy as np + + nrng = np.random.default_rng(rng.getrandbits(64)) + n_frames = {1: 6, 2: 8, 3: 9}[level] # the oracle at L3 takes ~4 s on a loaded 8-core host; 20 s is the cap + noisy, mirrored = level >= 2, level == 3 + art = {name: _sprite(nrng, h, w) for name, (h, w) in SPRITES.items()} + gray_art = {name: _gray(a) for name, a in art.items()} + files = {f"sprites/{name}.png": _png(a) for name, a in art.items()} + counts = [] + for f in range(1, n_frames + 1): + frame = np.empty((FRAME_H, FRAME_W, 3), dtype=np.uint8) + frame[:] = nrng.integers(0, 256, size=3, dtype=np.uint8) + for _ in range(25): # background blocks of random colours, so colour counting fails + y, x = rng.randint(0, FRAME_H - 8), rng.randint(0, FRAME_W - 8) + frame[y:y + rng.randint(8, 60), x:x + rng.randint(8, 60)] = nrng.integers(0, 256, 3, dtype=np.uint8) + taken, want = [], {name: 0 for name in SPRITES} + for _ in range(rng.randint(3, 9)): + name = rng.choice(list(SPRITES)) + h, w = SPRITES[name] + spot = _place(rng, taken, h, w, (0, FRAME_W - w)) + if spot is None: + continue + a = art[name][:, ::-1] if mirrored and rng.random() < 0.3 else art[name] + frame[spot[0]:spot[0] + h, spot[1]:spot[1] + w] = a + want[name] += 1 + for _ in range(rng.choice((0, 1, 1, 2))): # decoys cut by the left or right border + name = rng.choice(list(SPRITES)) + h, w = SPRITES[name] + cut = rng.randint(3, w - 3) + left = rng.random() < 0.5 + x_range = (-cut, -cut) if left else (FRAME_W - w + cut, FRAME_W - w + cut) + spot = _place(rng, taken, h, w, x_range) + if spot is None: + continue + y, x = spot + lo, hi = max(x, 0), min(x + w, FRAME_W) + frame[y:y + h, lo:hi] = art[name][:, lo - x:hi - x] + if noisy: + jitter = nrng.integers(-NOISE, NOISE + 1, size=frame.shape) + frame = np.clip(frame.astype(np.int16) + jitter, 0, 255).astype(np.uint8) + g = _gray(frame) + for name in SPRITES: # the stated rule on the written frame must find exactly what was placed + t = gray_art[name] + got = _count(g, [t, t[:, ::-1]] if mirrored else [t]) + if got != want[name]: + raise AssertionError(f"med3_sprite_count: frame {f} {name}: rule finds {got}, placed {want[name]}") + files[f"frames/frame_{f:03d}.png"] = _png(frame) + counts.append((f"frame_{f:03d}.png", want["coin"], want["enemy"], want["turtle"])) + if level >= 2: + notes = ("# Notes\n\nThe frames were re-encoded, so pixel values can differ by a few levels from the " + "sprites.\n") + if mirrored: + notes += "\nA sprite drawn mirrored left-to-right is the same object and counts.\n" + files["notes.md"] = notes + notes_line = " Read /root/notes.md before you start." if level >= 2 else "" + instruction = ( + "You are building ground truth for a game-footage object detector. Keyframes are in /root/frames/ as " + "frame_001.png, frame_002.png and so on; reference sprites are /root/sprites/coin.png, enemy.png and " + "turtle.png. Every object in a frame is a copy of one sprite at its original size, never rotated or " + f"scaled, and objects never overlap.{notes_line}\n\n" + "1. Convert frames and sprites to grayscale (Pillow mode \"L\").\n" + "2. A sprite occurs at a position when the mean absolute difference between the sprite and the frame " + "window of the same size there is below 10 gray levels.\n" + "3. Count each object once, even if neighbouring positions also pass.\n" + "4. An object cut off by the frame border does not count.\n\n" + "Write /root/counting_results.csv with the header frame_id,coins,enemies,turtles and one row per " + "keyframe in frame-number order; frame_id is the file name, e.g. frame_001.png,2,1,0. Every count must " + "match exactly." + ) + header = ["frame_id", "coins", "enemies", "turtles"] + + def column(i: int): + return lambda p: [r[header[i]] for r in p["rows"]] == [str(c[i]) for c in counts] + + checks = [ + ("test_header", lambda p: p["header"] == header), + ("test_row_count", lambda p: len(p["rows"]) == len(counts)), + ("test_frame_ids", column(0)), + ("test_coins", column(1)), + ("test_enemies", column(2)), + ("test_turtles", column(3)), + ] + rendered = ",".join(header) + "\n" + "".join(",".join(map(str, c)) + "\n" for c in counts) + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="counting_results.csv", kind="checks", parse="csv", checks=checks, + render=lambda: rendered), + notes={"totals": [sum(c[i] for c in counts) for i in (1, 2, 3)]}, + root="/root", + ) + +FAMILIES = [ + Family("med3_silence_report", DOMAIN, "Report silent segments in a lecture recording", build_silence, v3=True), + Family("med3_subtitle_retime", DOMAIN, "Retime subtitles through an edit decision list", build_retime, v3=True), + Family("med3_sprite_count", DOMAIN, "Count sprites in game keyframes", build_sprites, v3=True), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/office.py b/components/dnakhla/upstream/terminal_desk/families/office.py new file mode 100644 index 0000000000000000000000000000000000000000..d80607cd66bb56ad36fa08723862faff26cf04ab --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/office.py @@ -0,0 +1,234 @@ +"""Office work: reconcile invoices against payments; find a meeting slot across time zones.""" + +import datetime as dt +import random + +from .base import Artifact, Built, Family, Field, money + +CUSTOMERS = ["Arden Foods", "Blue Kettle", "Cobalt Labs", "Dune Freight", "Elm & Oak", "Fable Print"] + +# ---------------------------------------------------------------- off_recon + + +def _cents(x: float) -> int: + return int(round(x * 100)) + + +def build_recon(level: int, rng: random.Random) -> Built: + n_inv = {1: 8, 2: 15, 3: 25}[level] + while True: + ids = [1001 + i for i in range(n_inv)] + amount = {i: _cents(rng.uniform(120, 4800)) for i in ids} + day0 = dt.date(2026, 9, 1) + inv_date = {i: day0 + dt.timedelta(days=rng.randint(0, 20)) for i in ids} + credits = [] + if level >= 2: + for i in rng.sample(ids, max(2, n_inv // 6)): + credits.append((f"CN-{len(credits) + 1:03d}", i, _cents(rng.uniform(20, amount[i] / 100 * 0.3)))) + voided = rng.choice(ids) if level == 3 else None + payable = [i for i in ids if i != voided] + # Plan payments: each names 1 (or 2-3 at level >= 2) invoices; amounts cover them fully or partly. + payments, pool = [], payable[:] + rng.shuffle(pool) + while pool: + k = 1 if level == 1 else rng.choice([1, 1, 2, 3]) + named, pool = pool[:k], pool[k:] + if rng.random() < 0.2: + continue # these invoices get nothing + due = sum(amount[i] for i in named) + pay = due if rng.random() < 0.55 else _cents(due / 100 * rng.uniform(0.3, 0.95)) + paid_on = max(inv_date[i] for i in named) + dt.timedelta(days=rng.randint(3, 25)) + payments.append([named, pay, paid_on]) + moved = None + if level == 3 and len(payments) >= 3: + p = rng.randrange(len(payments)) + targets = [i for i in payable if i not in payments[p][0]] + moved = (p, rng.choice(targets)) + # Compute balances. + bal = {i: amount[i] for i in payable} + for _, i, c in credits: + if i in bal: + bal[i] = max(0, bal[i] - c) + for idx in sorted(range(len(payments)), key=lambda j: (payments[j][2], j)): + named, pay, _ = payments[idx] + order = [moved[1]] if moved and moved[0] == idx else named + left = pay + for i in order: + take = min(left, bal[i]) + bal[i] -= take + left -= take + unpaid = sorted(f"INV-{i}" for i, b in bal.items() if b > 0) + if 2 <= len(unpaid) < len(payable): + break + + def ref(i: int) -> str: + if level < 3: + return f"INV-{i}" + return rng.choice([f"INV-{i}", f"inv {i}", f"#{i}", f"invoice {i}"]) + + pay_rows = [] + for idx, (named, pay, d) in enumerate(payments): + memo = rng.choice(["Payment for ", "Remit ", "Re: ", ""]) + " ".join(ref(i) for i in named) + pay_rows.append((d, f"P-{idx + 1:04d}", pay, memo)) + pay_rows.sort(key=lambda r: (r[0], r[1])) + files = { + "invoices.csv": "invoice,customer,date,amount\n" + + "".join( + f"INV-{i},{rng.choice(CUSTOMERS)},{inv_date[i].isoformat()},{money(amount[i] / 100)}\n" for i in ids + ), + "payments.csv": "date,payment,amount,memo\n" + + "".join(f"{d.isoformat()},{pid},{money(a / 100)},\"{m}\"\n" for d, pid, a, m in pay_rows), + } + rules = ( + "Process payments in date order, then by payment ID. Each payment's memo names one or more invoices by number. Apply the payment to them in the order named, " + "paying each invoice's remaining balance in full before moving to the next; anything left over is " + "unapplied credit and is ignored." + ) + if credits: + files["credit_notes.csv"] = "credit_note,invoice,amount\n" + "".join( + f"{cid},INV-{i},{money(c / 100)}\n" for cid, i, c in credits + ) + rules += " Credit notes reduce their invoice's balance and are applied before any payment." + if level == 3: + memo = [f"INV-{voided} was voided: it is not owed and must not appear in your output."] + if moved: + pid = f"P-{moved[0] + 1:04d}" + memo.append(f"{pid} was keyed against the wrong invoice. Apply all of it to INV-{moved[1]} instead of what its memo says.") + files["controller_memo.txt"] = "\n".join(memo) + "\n" + rules += " controller_memo.txt has corrections that override the files." + instruction = ( + "Reconcile accounts receivable from /app/invoices.csv and /app/payments.csv. " + rules + " " + "Write /app/balances.csv with the header invoice,balance and one row per invoice (voided ones " + "excluded) giving the balance still owed in dollars, e.g. INV-1001,0.00" + ) + return Built( + instruction=instruction, + files=files, + artifact=Artifact( + path="balances.csv", + kind="csv", + key=("invoice",), + fields=[Field("invoice", "text"), Field("balance", "number", tol=0.005)], + expected=[{"invoice": f"INV-{i}", "balance": bal[i] / 100} for i in payable], + ), + ) + + +# ---------------------------------------------------------------- off_sched + +PEOPLE = ["ana", "ben", "chen", "dara", "eli"] +OFFSETS = [-7, -5, -4, 0, 1, 2, 3, 5.5] + + +def _fmt_off(h: float) -> str: + sign = "+" if h >= 0 else "-" + hh, mm = int(abs(h)), int(round((abs(h) % 1) * 60)) + return f"UTC{sign}{hh:02d}:{mm:02d}" + + +def build_sched(level: int, rng: random.Random) -> Built: + n_people, n_days, dur = {1: (3, 2, 30), 2: (4, 3, 45), 3: (5, 3, 60)}[level] + days = [dt.date(2026, 11, 2) + dt.timedelta(days=i) for i in range(n_days)] + step = dt.timedelta(minutes=15) + while True: + names = PEOPLE[:n_people] + base = rng.choice(OFFSETS) + offs = {} + for n in names: + close = [o for o in OFFSETS if abs(o - base) <= 4] + offs[n] = rng.choice(close) + busy = {n: [] for n in names} + for n in names: + for d in days: + for _ in range(rng.randint(1, 4)): + start = dt.datetime.combine(d, dt.time(9)) + step * rng.randint(0, 28) + busy[n].append((start, start + step * rng.randint(2, 8))) + lunch = level == 3 + ooo = {} + if level == 3: + ooo[rng.choice(names)] = rng.choice(days[:-1]) + + def free(n: str, t_utc: dt.datetime) -> bool: + off = dt.timedelta(hours=offs[n]) + s, e = t_utc + off, t_utc + off + dt.timedelta(minutes=dur) + day = s.date() + if ooo.get(n) == day: + return False + if s < dt.datetime.combine(day, dt.time(9)) or e > dt.datetime.combine(day, dt.time(17)): + return False + blocks = list(busy[n]) + if lunch: + blocks.append((dt.datetime.combine(day, dt.time(12)), dt.datetime.combine(day, dt.time(13)))) + return all(e <= b0 or s >= b1 for b0, b1 in blocks) + + valid = [] + t = dt.datetime.combine(days[0], dt.time(0)) + end = dt.datetime.combine(days[-1], dt.time(23, 45)) + while t <= end: + if all(free(n, t) for n in names): + valid.append(t) + t += step + if 2 <= len(valid): + break + files = {} + for n in names: + lines = [f"timezone: {_fmt_off(offs[n])}", "working hours: 09:00-17:00 local"] + if lunch: + lines.append("lunch: 12:00-13:00 local every day (not available)") + if n in ooo: + lines.append(f"out of office: {ooo[n].isoformat()} (whole local day)") + lines.append("busy (local time):") + for b0, b1 in sorted(busy[n]): + lines.append(f" {b0:%Y-%m-%d} {b0:%H:%M}-{b1:%H:%M}") + files[f"calendars/{n}.txt"] = "\n".join(lines) + "\n" + instruction = ( + f"Find a {dur}-minute meeting for everyone in /app/calendars/, one file per person with their time zone, " + "working hours and busy blocks in local time. A start works when, for every person, the whole meeting " + "falls inside their working hours on one local day and overlaps none of their busy blocks (a block " + "ending at 10:00 does not clash with a meeting starting at 10:00). Consider quarter-hour UTC starts " + f"from {days[0]} 00:00 to {days[-1]} 23:45. Create /app/meeting.ics with one VEVENT at the earliest " + "such slot. DTSTART and DTEND must be UTC (YYYYMMDDTHHMMSSZ)." + ) + want_start, want_end = valid[0], valid[0] + dt.timedelta(minutes=dur) + + def verify(app: str) -> bool: + from ..core.grading import read_artifact + + data = read_artifact(app, "meeting.ics") + if data is None: + return False + text = data.decode("utf-8", errors="replace").replace("\r\n", "\n") + if "BEGIN:VEVENT" not in text or "END:VEVENT" not in text: + return False + block = text.split("BEGIN:VEVENT", 1)[1].split("END:VEVENT", 1)[0] + got = {} + for line in block.split("\n"): + name, _, value = line.partition(":") + if name.strip() in ("DTSTART", "DTEND"): + got[name.strip()] = value.strip() + try: + start = dt.datetime.strptime(got["DTSTART"], "%Y%m%dT%H%M%SZ") + end = dt.datetime.strptime(got["DTEND"], "%Y%m%dT%H%M%SZ") + except (KeyError, ValueError): + return False + return start == want_start and end == want_end + + def render() -> str: + return ( + "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//terminal-desk//EN\nBEGIN:VEVENT\n" + f"UID:meeting-{want_start:%Y%m%dT%H%M%S}@terminal-desk\nDTSTAMP:20261101T000000Z\n" + f"DTSTART:{want_start:%Y%m%dT%H%M%SZ}\nDTEND:{want_end:%Y%m%dT%H%M%SZ}\n" + "SUMMARY:Team meeting\nEND:VEVENT\nEND:VCALENDAR\n" + ) + + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="meeting.ics", kind="custom", verify=verify, render=render), + ) + + +FAMILIES = [ + Family("off_recon", "office and white-collar work", "Reconcile receivables", build_recon), + Family("off_sched", "office and white-collar work", "Schedule across time zones", build_sched), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/office3.py b/components/dnakhla/upstream/terminal_desk/families/office3.py new file mode 100644 index 0000000000000000000000000000000000000000..0635b8bce75c0bec4678f36718e6cb1c7ecb66c9 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/office3.py @@ -0,0 +1,505 @@ +"""Office v3: receivables reconciliation, a meeting slot across time zones, and a PDF-vs-workbook diff. + +off3_ar_recon and off3_meeting_slot are stdlib csv/json tasks reshaped from v2's off_recon and off_sched. +off3_pdf_xlsx_diff is the domain's one library family (pdfplumber + openpyxl), modeled on SkillsBench +pdf-excel-diff. Every generator computes the expected answer itself; the oracles in terminal_desk/oracles/ +only prove the files carry it. +""" + +import datetime as dt +import io +import json +import random + +from .base import Artifact, Built, Family, money + +DOMAIN = "office and white-collar work" +CUSTOMERS = ["Arden Foods", "Blue Kettle", "Cobalt Labs", "Dune Freight", "Elm & Oak", "Fable Print", "Gull Marine"] + +# ---------------------------------------------------------------- off3_ar_recon + + +def _cents(x: float) -> int: + return int(round(x * 100)) + + +def _apply(bal: dict, order: list, pay: int) -> None: + """Pay each named invoice's remaining balance in full before the next; the excess is ignored.""" + left = pay + for i in order: + take = min(left, bal[i]) + bal[i] -= take + left -= take + + +def _plan_payments(level: int, rng: random.Random, payable: list, amount: dict, day0: dt.date) -> list: + """Payments as [named invoices, cents, date], sorted by date (ties keep plan order).""" + payments, pool = [], payable[:] + rng.shuffle(pool) + while pool: + k = 1 if level == 1 else rng.choice([1, 1, 2, 3]) + named, pool = pool[:k], pool[k:] + due = sum(amount[i] for i in named) + r = rng.random() + if r < 0.15: + continue # nothing paid yet + if r < 0.5: + pays = [due] + elif r < 0.65: + pays = [due + _cents(rng.uniform(5, 300))] # overpaid + elif r < 0.8 and level == 1: + pays = [_cents(due / 100 * rng.uniform(0.3, 0.6)), _cents(due / 100 * rng.uniform(0.2, 0.5))] + else: + pays = [_cents(due / 100 * rng.uniform(0.2, 0.9))] + for p in pays: + payments.append([named, p, day0 + dt.timedelta(days=rng.randint(0, 40))]) + payments.sort(key=lambda p: p[2]) + return payments + + +def _balances(amount: dict, payable: list, credits: list, payments: list, moved) -> dict: + bal = {i: amount[i] for i in payable} + for _, i, c in credits: + if i in bal: + bal[i] = max(0, bal[i] - c) + for j, (named, pay, _) in enumerate(payments): + _apply(bal, [moved[1]] if moved and moved[0] == j else named, pay) + return bal + + +def _status(amount: int, bal: int) -> str: + return "paid" if bal == 0 else "open" if bal == amount else "partial" + + +def build_ar_recon(level: int, rng: random.Random) -> Built: + n_inv = {1: 90, 2: 120, 3: 150}[level] + base = rng.randint(1001, 7000) + ids = [base + i for i in range(n_inv)] + amount = {i: _cents(rng.uniform(120, 2400)) for i in ids} + customer = {i: rng.choice(CUSTOMERS) for i in ids} + voided = rng.choice(ids) if level == 3 else None + payable = [i for i in ids if i != voided] + credits = [] + if level >= 2: + for i in sorted(rng.sample(ids, n_inv // 8)): + credits.append((f"CN-{len(credits) + 1:03d}", i, _cents(rng.uniform(10, amount[i] / 100 * 0.4)))) + while True: + payments = _plan_payments(level, rng, payable, amount, dt.date(2026, 9, 1)) + moved = None + if level == 3: + keys = [(p[1], p[2]) for p in payments] + idx = rng.choice([j for j, p in enumerate(payments) if keys.count((p[1], p[2])) == 1]) + moved = (idx, rng.choice([i for i in payable if i not in payments[idx][0]])) + bal = _balances(amount, payable, credits, payments, moved) + status = {i: _status(amount[i], bal[i]) for i in payable} + # every rule of the level must change the answer, so a script that skips one fails + naive = [] + if level == 1: + paid = {i: sum(p for named, p, _ in payments if named == [i]) for i in payable} + naive.append({i: amount[i] - paid[i] for i in payable}) # no floor at 0 + else: + naive.append(_balances(amount, payable, credits, [[n[::-1], p, d] for n, p, d in payments], moved)) + naive.append(_balances(amount, payable, [], payments, moved)) + if level == 3: + naive.append(_balances(amount, payable, credits, payments, None)) + # from L2 a credited invoice nobody paid is partial, not open + paid_any = {i for named, _, _ in payments for i in named} | ({moved[1]} if moved else set()) + credit_only = [i for _, i, _ in credits if i in status and i not in paid_any and status[i] == "partial"] + if (all(v != bal for v in naive) and set(status.values()) == {"paid", "open", "partial"} + and (level == 1 or credit_only)): + break + want = [(f"INV-{i}", customer[i], bal[i], status[i]) for i in payable] + + def ref(i: int) -> str: + return rng.choice([f"INV-{i}", f"inv {i}", f"#{i}"]) if level == 3 else f"INV-{i}" + + files = {"invoices.csv": "invoice,customer,amount\n" + + "".join(f"INV-{i},{customer[i]},{money(amount[i] / 100)}\n" for i in ids)} + if level == 1: + files["payments.csv"] = "date,invoice,amount\n" + "".join( + f"{d.isoformat()},INV-{named[0]},{money(p / 100)}\n" for named, p, d in payments) + else: + files["payments.csv"] = "date,amount,memo\n" + "".join( + f"{d.isoformat()},{money(p / 100)},{' '.join(ref(i) for i in named)}\n" for named, p, d in payments) + files["credit_notes.csv"] = "credit_note,invoice,amount\n" + "".join( + f"{cid},INV-{i},{money(c / 100)}\n" for cid, i, c in credits) + if level == 3: + _, p, d = payments[moved[0]] + files["controller_memo.md"] = ( + "# Controller memo\n\nCorrections for this month's receivables close:\n\n" + f"1. INV-{voided} was voided. It is not owed and must not appear in the balances.\n" + f"2. The payment of {money(p / 100)} received on {d.isoformat()} was keyed against the wrong invoice. " + f"Apply all of it to INV-{moved[1]} instead of what its memo says.\n") + opener = rng.choice([ + "You are closing the month for the receivables team.", + "Finance needs the open balance of every customer invoice.", + "Our accounts receivable ledger needs reconciling before the month closes.", + ]) + if level == 1: + rule = ( + "/root/invoices.csv lists each invoice with its customer and amount in dollars. /root/payments.csv lists " + "every payment received, one row per payment, with the invoice it pays. An invoice's balance is its " + "amount minus all payments against it; it can receive several payments or none. If the payments add up " + "to more than the amount, the balance is 0.00, never negative, and the excess is ignored.") + else: + rule = ( + "/root/invoices.csv lists invoices with customer and amount in dollars. /root/payments.csv lists " + "payments in the order received; each memo names one or more invoices. First apply the credit notes in " + "/root/credit_notes.csv, each reducing its invoice's balance (not below 0). Then take the payments top " + "to bottom: each pays the invoices its memo names, in that order, clearing one invoice's balance before " + "the next. Leftover money is ignored.") + if level == 3: + rule += (" Memos write invoice numbers as INV-1042, inv 1042 or #1042. " + "/root/controller_memo.md holds corrections that override the files.") + instruction = ( + f"{opener}\n\n{rule}\n\n" + "Write /root/balances.csv with the header invoice,customer,balance,status and one row per invoice in " + "invoice order. balance is in dollars with 2 decimals; status is paid when the balance is 0.00, open when " + "it equals the full amount, partial otherwise. Example row: INV-1001,Arden Foods,0.00,paid. Balances are " + "checked to within 0.005." + ) + + def column(p, name): + return [r[name] for r in p["rows"]] + + checks = [ + ("test_header", lambda p: p["header"] == ["invoice", "customer", "balance", "status"]), + ("test_row_count", lambda p: len(p["rows"]) == len(want)), + ("test_invoice_ids", lambda p: column(p, "invoice") == [w[0] for w in want]), + ("test_customers", lambda p: column(p, "customer") == [w[1] for w in want]), + ("test_balances", lambda p: len(p["rows"]) == len(want) and all( + abs(float(b) - w[2] / 100) <= 0.005 + 1e-9 for b, w in zip(column(p, "balance"), want))), + ("test_status", lambda p: column(p, "status") == [w[3] for w in want]), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="balances.csv", kind="checks", parse="csv", checks=checks, + render=lambda: "invoice,customer,balance,status\n" + + "".join(f"{k},{c},{money(b / 100)},{st}\n" for k, c, b, st in want)), + root="/root", + ) + + +# ---------------------------------------------------------------- off3_meeting_slot + +PEOPLE = ["ana", "ben", "chen", "dara", "eli"] +OFFSETS = {1: [-5, -4, 0, 1, 2, 3], 2: [-4, -3, 0, 1, 2, 3, 5.5], 3: [-4, -3, 0, 1, 2, 3, 5.5]} +STEP = dt.timedelta(minutes=15) + + +def _fmt_off(h: float) -> str: + sign = "+" if h >= 0 else "-" + return f"UTC{sign}{int(abs(h)):02d}:{int(round(abs(h) % 1 * 60)):02d}" + + +def _local_hour(t: dt.datetime, off: float) -> float: + s = t + dt.timedelta(hours=off) + return s.hour + s.minute / 60 + + +def _slots(days, offs, busy_local, dur, ooo, lunch): + """Quarter-hour UTC starts where everyone is inside 09:00-17:00 local on one day and free.""" + out = [] + t, end = dt.datetime.combine(days[0], dt.time(0)), dt.datetime.combine(days[-1], dt.time(23, 45)) + length = dt.timedelta(minutes=dur) + while t <= end: + ok = True + for n, off in offs.items(): + s = t + dt.timedelta(hours=off) + e, day = s + length, s.date() + blocks = list(busy_local[n]) + if n in lunch: + blocks.append((dt.datetime.combine(day, lunch[n][0]), dt.datetime.combine(day, lunch[n][1]))) + if (ooo.get(n) == day or s < dt.datetime.combine(day, dt.time(9)) + or e > dt.datetime.combine(day, dt.time(17)) or any(s < b1 and e > b0 for b0, b1 in blocks)): + ok = False + break + if ok: + out.append(t) + t += STEP + return out + + +def build_meeting_slot(level: int, rng: random.Random) -> Built: + n_people, per_day = {1: (3, (5, 7)), 2: (4, (4, 6)), 3: (5, (4, 5))}[level] + dur = 30 # fixed: the oracle runs on every level and the length lives only in the instruction + days = [dt.date(2026, 11, 2) + dt.timedelta(days=i) for i in range(5)] + names = PEOPLE[:n_people] + while True: + offs = {} + for n in names: + offs[n] = rng.choice(OFFSETS[level]) + if max(offs.values()) - min(offs.values()) > 4.5 or len(set(offs.values())) < 2: + continue + busy = {n: [] for n in names} + for n in names: + for d in days: + for _ in range(rng.randint(*per_day)): + s = dt.datetime.combine(d, dt.time(8)) + STEP * rng.randint(0, 36) + busy[n].append((s, s + STEP * rng.randint(2, 6))) + busy[n].sort() + ooo, lunch = {}, {} + if level == 3: # place both notes where they move the answer: out of office on the day of the + first = _slots(days, offs, busy, dur, {}, {}) # earliest slot, lunch over the next one + if not first: + continue + who = rng.choice(names) + ooo[who] = (first[0] + dt.timedelta(hours=offs[who])).date() + second = _slots(days, offs, busy, dur, ooo, {}) + noon = [n for n in names if second and 11.5 < _local_hour(second[0], offs[n]) < 13] + if not noon: + continue + lunch[rng.choice(noon)] = (dt.time(12), dt.time(13)) + valid = _slots(days, offs, busy, dur, ooo, lunch) + if not valid: + continue + free = {n: [] for n in names} + flipped = busy # offsets read with the wrong sign; at L1 that also moves the UTC busy blocks + if level == 1: + flipped = {n: [(b0 - dt.timedelta(hours=2 * offs[n]), b1 - dt.timedelta(hours=2 * offs[n])) + for b0, b1 in v] for n, v in busy.items()} + naive = [_slots(days, offs, free, dur, ooo, lunch), + _slots(days, {n: -o for n, o in offs.items()}, flipped, dur, ooo, lunch)] + if level >= 2: + as_utc = {n: [(b0 + dt.timedelta(hours=offs[n]), b1 + dt.timedelta(hours=offs[n])) for b0, b1 in v] + for n, v in busy.items()} # busy read as UTC where it is local + naive.append(_slots(days, offs, as_utc, dur, ooo, lunch)) + if level == 3: + naive.append(_slots(days, offs, busy, dur, {}, lunch)) + naive.append(_slots(days, offs, busy, dur, ooo, {})) + if all(not v or v[0] != valid[0] for v in naive) and valid[0].date() != days[0]: + break + start, end = valid[0], valid[0] + dt.timedelta(minutes=dur) + + rows = [] + for n in names: + for b0, b1 in busy[n]: + if level == 1: + b0, b1 = b0 - dt.timedelta(hours=offs[n]), b1 - dt.timedelta(hours=offs[n]) + assert b0.date() == b1.date(), (n, b0, b1) + rows.append((b0, n, b1)) + rows.sort() + zone = "utc" if level == 1 else "local" + files = { + "people.csv": "person,utc_offset\n" + "".join(f"{n},{_fmt_off(offs[n])}\n" for n in names), + "busy.csv": f"person,date,start_{zone},end_{zone}\n" + + "".join(f"{n},{b0:%Y-%m-%d},{b0:%H:%M},{b1:%H:%M}\n" for b0, n, b1 in rows), + } + if level == 3: + (o_name, o_day), = ooo.items() + (l_name, _), = lunch.items() + files["calendar_notes.md"] = ( + "# Calendar notes\n\n" + f"- {o_name} is out of office for the whole local day {o_day.isoformat()}.\n" + f"- {l_name} takes lunch 12:00-13:00 local time every day; treat it as busy.\n") + opener = rng.choice([ + f"You are scheduling a {dur}-minute review for a distributed team and need the earliest time that works.", + f"The team lead asked you to book a {dur}-minute sync at the first time everyone can make it.", + ]) + where = "in UTC" if level == 1 else "in that person's local time" + notes = " /root/calendar_notes.md has extra constraints from the team." if level == 3 else "" + instruction = ( + f"{opener}\n\n/root/people.csv gives each person's UTC offset (UTC+05:30 means local = UTC + 5h30m). " + f"/root/busy.csv lists everyone's busy blocks, one per row, {where}.{notes}\n\n" + "A start time works when, for every person, the whole meeting falls inside 09:00-17:00 of one local day " + "and overlaps none of their busy blocks. A block ending at 10:00 does not clash with a meeting starting " + "at 10:00. Try starts on the quarter hour in UTC from 2026-11-02 00:00 to 2026-11-06 23:45 and take " + "the earliest that works.\n\n" + "Write /root/meeting.json as a JSON object with start_utc and end_utc in this format: " + '{"start_utc": "2026-12-01T14:15", "end_utc": "2026-12-01T14:45"}.' + ) + + def ts(v) -> dt.datetime: + got = dt.datetime.fromisoformat(v.strip().removesuffix("Z")) + if got.tzinfo is not None: + raise ValueError("naive UTC expected") + return got + + checks = [ + ("test_is_object", lambda p: isinstance(p, dict)), + ("test_keys", lambda p: set(p) == {"start_utc", "end_utc"}), + ("test_start_utc", lambda p: ts(p["start_utc"]) == start), + ("test_end_utc", lambda p: ts(p["end_utc"]) == end), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="meeting.json", kind="checks", parse="json", checks=checks, + render=lambda: json.dumps({"start_utc": f"{start:%Y-%m-%dT%H:%M}", + "end_utc": f"{end:%Y-%m-%dT%H:%M}"}) + "\n"), + root="/root", + ) + + +# ---------------------------------------------------------------- off3_pdf_xlsx_diff + +FIRST = ["Ava", "Ben", "Cara", "Dev", "Ena", "Femi", "Gus", "Hana", "Ivo", "Jun", "Kai", "Lena", "Milo", "Nia", + "Omar", "Pia", "Quin", "Rosa", "Sami", "Tess", "Uma", "Vik", "Wren", "Yara", "Zeke"] +LAST = ["Abara", "Brandt", "Costa", "Diaz", "Eklund", "Fischer", "Gallo", "Haddad", "Ito", "Jansen", "Kowal", + "Lindqvist", "Moreau", "Novak", "Okafor", "Petrov", "Quist", "Rossi", "Sato", "Tanaka", "Ueda", "Varga"] +DEPTS = ["Sales", "Finance", "Legal", "Support", "Operations", "IT", "HR", "Marketing", "Research"] +TITLES = ["Analyst", "Senior Analyst", "Engineer", "Senior Engineer", "Account Manager", "Manager", "Coordinator", + "Specialist", "Director", "Associate"] +COLS = ["ID", "Name", "Department", "Title", "Salary", "Years", "Score"] +NUMERIC = ("Salary", "Years", "Score") +NOTE = "Text cells were pasted from the HR system and some carry trailing spaces; those are not changes." + + +def _pdf_bytes(rows: list[list[str]], heading: str) -> bytes: + from reportlab.lib import colors + from reportlab.lib.pagesizes import letter + from reportlab.lib.styles import getSampleStyleSheet + from reportlab.platypus import Paragraph, SimpleDocTemplate, Table, TableStyle + + buf = io.BytesIO() + doc = SimpleDocTemplate(buf, pagesize=letter, invariant=1, title=heading) + table = Table([COLS] + rows, repeatRows=1) # the ruled grid keeps pdfplumber's cells whole + table.setStyle(TableStyle([("GRID", (0, 0), (-1, -1), 0.5, colors.black), + ("FONTNAME", (0, 0), (-1, -1), "Helvetica"), ("FONTSIZE", (0, 0), (-1, -1), 8)])) + doc.build([Paragraph(heading, getSampleStyleSheet()["Heading2"]), table]) + return buf.getvalue() + + +def _xlsx_bytes(rows: list[list], note: str | None) -> bytes: + import openpyxl + + wb = openpyxl.Workbook() + ws = wb.active + ws.title = "Employees" + ws.append(COLS) + for r in rows: + ws.append(r) + if note: + wb.create_sheet("Notes").append([note]) + buf = io.BytesIO() + wb.save(buf) + return buf.getvalue() + + +def _changed(field: str, v, rng: random.Random): + if field == "Salary": + return v + rng.choice([-1, 1, 1, 1]) * 10 * rng.randint(100, 900) + if field == "Years": + return v + rng.randint(1, 3) + if field == "Score": + steps = [k for k in range(-10, 11) if k and 20 <= round(v * 10) + k <= 50] + return (round(v * 10) + rng.choice(steps)) / 10 + if field == "Department": + return rng.choice([d for d in DEPTS if d != v]) + if field == "Title": + return rng.choice([t for t in TITLES if t != v]) + return f"{v.split()[0]} {rng.choice([n for n in LAST if n != v.split()[1]])}" + + +def build_pdf_xlsx_diff(level: int, rng: random.Random) -> Built: + n, n_del, n_hire, n_mod, n_two = {1: (40, (2, 3), (1, 2), (3, 5), 0), 2: (70, (3, 5), (1, 3), (5, 8), 0), + 3: (100, (5, 7), (2, 3), (7, 10), 2)}[level] + n_del, n_hire, n_mod = rng.randint(*n_del), rng.randint(*n_hire), rng.randint(*n_mod) + staff = {} + for k in sorted(rng.sample(range(1, 1000), n + n_hire)): + staff[f"EMP{k:05d}"] = {"Name": f"{rng.choice(FIRST)} {rng.choice(LAST)}", "Department": rng.choice(DEPTS), + "Title": rng.choice(TITLES), "Salary": 10 * rng.randint(4200, 14500), + "Years": rng.randint(0, 30), "Score": rng.randint(20, 50) / 10} + hires = set(rng.sample(sorted(staff), n_hire)) # in the workbook only, never reported + old_ids = [i for i in sorted(staff) if i not in hires] + deleted = sorted(rng.sample(old_ids, n_del)) + kept = [i for i in old_ids if i not in deleted] + current = {i: dict(staff[i]) for i in sorted(staff) if i not in deleted} + mods = [] + for j, i in enumerate(rng.sample(kept, n_mod)): + for f in rng.sample(COLS[1:], 2 if j < n_two else 1): + current[i][f] = _changed(f, staff[i][f], rng) + mods.append((i, f, staff[i][f], current[i][f])) + mods.sort(key=lambda m: (m[0], COLS.index(m[1]))) + unchanged = [i for i in kept if i not in {m[0] for m in mods}] + spaced = set() + if level == 3: # a fifth of the names carry a trailing space, at least one on an unchanged employee + spaced = {rng.choice(unchanged)} | set(rng.sample(sorted(current), len(current) // 5)) + xlsx_rows = [[i] + [current[i][c] + " " if c == "Name" and i in spaced else current[i][c] for c in COLS[1:]] + for i in sorted(current)] + if level >= 2: + rng.shuffle(xlsx_rows) + + def pdf_cell(c, v): + if c == "Salary": + return f"${v:,}" if level >= 2 else str(v) + return f"{v:.1f}" if c == "Score" else str(v) + + backup = dt.date(2026, 3, 31) + dt.timedelta(days=rng.randint(0, 90)) + files = { + "employees_backup.pdf": _pdf_bytes([[i] + [pdf_cell(c, staff[i][c]) for c in COLS[1:]] for i in old_ids], + f"Employee records backup, {backup.isoformat()}"), + "employees_current.xlsx": _xlsx_bytes(xlsx_rows, NOTE if level == 3 else None), + } + opener = rng.choice([ + "You are helping HR find undocumented changes to the employee database.", + "Payroll needs an audit of every edit made to the employee records since the last backup.", + ]) + notes = "; read its Notes sheet as well" if level == 3 else "" + money_note = ", even though the PDF prints salaries like $52,300" if level >= 2 else "" + instruction = ( + f"{opener} The old records are a PDF table, /root/employees_backup.pdf (columns {', '.join(COLS)}). " + f"The current records are in /root/employees_current.xlsx, sheet Employees{notes}.\n\n" + "1. Match employees by ID (EMP plus 5 digits).\n" + "2. IDs in the PDF but missing from the workbook are deleted. Employees hired after the backup appear only " + "in the workbook; do not report them.\n" + "3. For an ID in both, each field whose value changed is one entry with the old (PDF) and new (workbook) " + "value.\n\n" + f"Salary, Years and Score are numbers: compare them as numbers and write JSON numbers{money_note}. " + "The other fields are strings.\n\n" + "Write /root/diff_report.json like " + '{"deleted_employees": ["EMP00002"], "modified_employees": [{"id": "EMP00003", "field": "Salary", ' + '"old_value": 50020, "new_value": 55010}]}, with deleted_employees sorted by ID.' + ) + want = {(i, f): (a, b) for i, f, a, b in mods} + + def entries(p) -> list: + ms = p["modified_employees"] + if not isinstance(ms, list) or not all(isinstance(m, dict) and set(m) == {"id", "field", "old_value", + "new_value"} for m in ms): + raise ValueError("modified_employees must be a list of {id, field, old_value, new_value}") + return ms + + def is_num(v) -> bool: + return isinstance(v, (int, float)) and not isinstance(v, bool) + + def numbers_match(p) -> bool: + got = [m for m in entries(p) if m["field"] in NUMERIC] + return all(is_num(m["old_value"]) and is_num(m["new_value"]) + and abs(m["old_value"] - want[m["id"], m["field"]][0]) <= 1e-6 + and abs(m["new_value"] - want[m["id"], m["field"]][1]) <= 1e-6 for m in got) + + def text_matches(p) -> bool: + got = [m for m in entries(p) if m["field"] not in NUMERIC] + return all(isinstance(m["old_value"], str) and isinstance(m["new_value"], str) + and (m["old_value"].strip(), m["new_value"].strip()) == want[m["id"], m["field"]] for m in got) + + checks = [ + ("test_is_object", lambda p: isinstance(p, dict)), + ("test_keys", lambda p: set(p) == {"deleted_employees", "modified_employees"}), + ("test_deleted_employees", lambda p: p["deleted_employees"] == deleted), + ("test_modified_count", lambda p: len(entries(p)) == len(mods)), + ("test_modified_fields", lambda p: sorted((m["id"], m["field"]) for m in entries(p)) == sorted(want)), + ("test_numeric_values", numbers_match), + ("test_text_values", text_matches), + ] + + def render() -> str: + return json.dumps({"deleted_employees": deleted, + "modified_employees": [{"id": i, "field": f, "old_value": a, "new_value": b} + for i, f, a, b in mods]}, indent=1) + "\n" + + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="diff_report.json", kind="checks", parse="json", checks=checks, render=render), + root="/root", + ) + + +FAMILIES = [ + Family("off3_ar_recon", DOMAIN, "Reconcile receivables to balances", build_ar_recon, v3=True), + Family("off3_meeting_slot", DOMAIN, "Earliest meeting slot across time zones", build_meeting_slot, v3=True), + Family("off3_pdf_xlsx_diff", DOMAIN, "Diff a PDF backup against a workbook", build_pdf_xlsx_diff, v3=True), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/science.py b/components/dnakhla/upstream/terminal_desk/families/science.py new file mode 100644 index 0000000000000000000000000000000000000000..53ad31a79095946a977ffd011971ba967cf1904e --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/science.py @@ -0,0 +1,250 @@ +"""Natural science: fit first-order kinetics; reaction stoichiometry with a limiting reagent.""" + +import math +import random +import re + +from .base import Artifact, Built, Family, Field + +R_GAS = 8.314 + +# ---------------------------------------------------------------- sci_kinetics + + +def _fit_k(points: list[tuple[float, float]]) -> float: + """-slope of least-squares ln(C) against t.""" + xs = [t for t, _ in points] + ys = [math.log(c) for _, c in points] + n = len(xs) + mx, my = sum(xs) / n, sum(ys) / n + sxy = sum((x - mx) * (y - my) for x, y in zip(xs, ys)) + sxx = sum((x - mx) ** 2 for x in xs) + return -sxy / sxx + + +def _run(rng: random.Random, k: float, n: int) -> list[tuple[int, float]]: + c0 = rng.uniform(0.5, 2.0) + span = rng.uniform(2.0, 3.5) * math.log(2) / k + pts = [] + for i in range(n): + t = round(span * i / (n - 1)) + c = c0 * math.exp(-k * t) * (1 + rng.gauss(0, 0.01)) + pts.append((t, c)) + return pts + + +def build_kinetics(level: int, rng: random.Random) -> Built: + if level < 3: + k = rng.uniform(0.002, 0.02) + pts = _run(rng, k, 12 if level == 1 else 14) + if level == 1: + data = [(t, round(c, 4)) for t, c in pts] + files = {"run.csv": "time_s,conc_M\n" + "".join(f"{t},{c:.4f}\n" for t, c in data)} + used = [(float(t), c) for t, c in data] + extra = "run.csv has time in seconds and concentration in mol/L." + else: + data = [(round(t / 60, 3), round(c * 1000, 2)) for t, c in pts] + bad = rng.randrange(2, len(data) - 1) + t_bad, c_bad = data[bad] + data[bad] = (t_bad, round(c_bad * rng.choice([0.55, 1.6]), 2)) + files = { + "run.csv": "time_min,conc_mM\n" + "".join(f"{t:.3f},{c:.2f}\n" for t, c in data), + "lab_notes.txt": f"The sample at t = {t_bad:.3f} min was a bad injection; exclude it from the fit.\n", + } + used = [(t * 60, c / 1000) for i, (t, c) in enumerate(data) if i != bad] + extra = "Mind the units in run.csv, and read lab_notes.txt." + kfit = _fit_k(used) + instruction = ( + "/app/run.csv follows a first-order decay over time. Find the rate constant k as minus the slope of " + "an ordinary least-squares line of ln(concentration) against time in seconds, and the half-life " + "ln(2)/k. " + extra + " " + 'Write /app/fit.json with the keys k_per_s (1/s) and half_life_s (seconds), ' + 'for example {"k_per_s": 0.005, "half_life_s": 138.6}.' + ) + return Built( + instruction=instruction, + files=files, + artifact=Artifact( + path="fit.json", + kind="json", + expected={"k_per_s": kfit, "half_life_s": math.log(2) / kfit}, + fields=[ + Field("k_per_s", "number", "rate constant in 1/s", rel=0.005), + Field("half_life_s", "number", "half-life in seconds", rel=0.005), + ], + ), + ) + t1 = rng.randint(288, 300) + t2 = t1 + rng.randint(15, 25) + ea = rng.uniform(40, 90) * 1000 + k1 = rng.uniform(0.001, 0.006) + k2 = k1 * math.exp(-ea / R_GAS * (1 / t2 - 1 / t1)) + files, fits = {}, [] + for temp, k in ((t1, k1), (t2, k2)): + data = [(t, round(c, 4)) for t, c in _run(rng, k, 12)] + files[f"run_{temp}K.csv"] = "time_s,conc_M\n" + "".join(f"{t},{c:.4f}\n" for t, c in data) + fits.append(_fit_k([(float(t), c) for t, c in data])) + ea_fit = R_GAS * math.log(fits[1] / fits[0]) / (1 / t1 - 1 / t2) / 1000 + instruction = ( + f"/app/run_{t1}K.csv and /app/run_{t2}K.csv are the same first-order decay at two temperatures. " + "For each run, k is minus the slope of an ordinary least-squares line of ln(concentration) against " + "time in seconds. Then find the activation energy from the Arrhenius equation using the two k values " + f"and R = {R_GAS} J/(mol K). Write /app/fit.json with the keys k_low_per_s and k_high_per_s (1/s, for " + "the colder and the warmer run) and ea_kj_per_mol (kJ/mol), " + 'for example {"k_low_per_s": 0.002, "k_high_per_s": 0.006, "ea_kj_per_mol": 60.0}.' + ) + return Built( + instruction=instruction, + files=files, + artifact=Artifact( + path="fit.json", + kind="json", + expected={"k_low_per_s": fits[0], "k_high_per_s": fits[1], "ea_kj_per_mol": ea_fit}, + fields=[ + Field("k_low_per_s", "number", f"k at {t1} K in 1/s", rel=0.005), + Field("k_high_per_s", "number", f"k at {t2} K in 1/s", rel=0.005), + Field("ea_kj_per_mol", "number", "activation energy in kJ/mol", rel=0.01), + ], + ), + ) + + +# ---------------------------------------------------------------- sci_stoich + +MASSES = { + "H": 1.008, "C": 12.011, "N": 14.007, "O": 15.999, "Na": 22.990, "Mg": 24.305, "Al": 26.982, + "P": 30.974, "S": 32.06, "Cl": 35.45, "K": 39.098, "Ca": 40.078, "Fe": 55.845, "Cu": 63.546, + "Ag": 107.868, "Ba": 137.327, +} + +# (equation, product index among products) +REACTIONS = { + 1: [ + "2 H2 + O2 -> 2 H2O", + "C3H8 + 5 O2 -> 3 CO2 + 4 H2O", + "2 Na + Cl2 -> 2 NaCl", + "Fe2O3 + 3 CO -> 2 Fe + 3 CO2", + "2 NaOH + H2SO4 -> Na2SO4 + 2 H2O", + "AgNO3 + NaCl -> AgCl + NaNO3", + ], + 2: [ + "Ca(OH)2 + 2 HCl -> CaCl2 + 2 H2O", + "2 Al + 3 CuSO4 -> Al2(SO4)3 + 3 Cu", + "Mg(OH)2 + 2 HNO3 -> Mg(NO3)2 + 2 H2O", + "3 Ba(NO3)2 + 2 Na3PO4 -> Ba3(PO4)2 + 6 NaNO3", + ], + 3: [ + "CuSO4*5H2O + 2 NaOH -> Cu(OH)2 + Na2SO4 + 5 H2O", + "FeSO4*7H2O + 2 KOH -> Fe(OH)2 + K2SO4 + 7 H2O", + "BaCl2*2H2O + Na2SO4 -> BaSO4 + 2 NaCl + 2 H2O", + "3 Ca(OH)2 + 2 H3PO4 -> Ca3(PO4)2 + 6 H2O", + ], +} + + +def molar_mass(formula: str) -> float: + total = 0.0 + for part in formula.split("*"): + m = re.match(r"^(\d+)(.*)$", part) + mult, body = (int(m.group(1)), m.group(2)) if m else (1, part) + total += mult * _group_mass(body) + return total + + +def _group_mass(s: str) -> float: + stack = [0.0] + i = 0 + while i < len(s): + ch = s[i] + if ch == "(": + stack.append(0.0) + i += 1 + elif ch == ")": + i += 1 + j = i + while j < len(s) and s[j].isdigit(): + j += 1 + n = int(s[i:j] or 1) + inner = stack.pop() + stack[-1] += inner * n + i = j + else: + m = re.match(r"([A-Z][a-z]?)(\d*)", s[i:]) + stack[-1] += MASSES[m.group(1)] * int(m.group(2) or 1) + i += len(m.group(0)) + return stack[0] + + +def _side(text: str) -> list[tuple[int, str]]: + out = [] + for term in text.split(" + "): + m = re.match(r"^(\d+) (.+)$", term.strip()) + out.append((int(m.group(1)), m.group(2)) if m else (1, term.strip())) + return out + + +def build_stoich(level: int, rng: random.Random) -> Built: + eq = rng.choice(REACTIONS[level]) + left, right = eq.split(" -> ") + reactants, products = _side(left), _side(right) + (ca, fa), (cb, fb) = reactants + cp, fp = rng.choice([p for p in products if p[1] not in ("H2O",)] or products) + while True: + mass_a = round(rng.uniform(5, 60), 2) + eq_a = mass_a / molar_mass(fa) / ca + ratio = rng.choice([rng.uniform(1.15, 1.6), rng.uniform(0.6, 0.87)]) + mass_b = round(eq_a * ratio * cb * molar_mass(fb), 2) + purity = {} + if level == 3: + who = rng.choice([fa, fb]) + purity[who] = round(rng.uniform(85, 97), 1) + yield_pct = round(rng.uniform(70, 95), 1) if level >= 2 else 100.0 + + def equivalents(f, coef, mass): + pure = mass * purity.get(f, 100.0) / 100 + return pure / molar_mass(f) / coef + + ea, eb = equivalents(fa, ca, mass_a), equivalents(fb, cb, mass_b) + limiting = fa if ea < eb else fb + if abs(ea / eb - 1) >= 0.08: + break + grams = min(ea, eb) * cp * molar_mass(fp) * yield_pct / 100 + lines = [f"Balanced equation: {eq}", f"Starting masses: {mass_a} g {fa}, {mass_b} g {fb}"] + if purity: + (who, pct), = purity.items() + lines.append(f"The {who} sample is {pct}% pure by mass; the rest is inert.") + if level >= 2: + lines.append(f"The isolated yield was {yield_pct}% of the theoretical yield.") + if level == 3 and any("*" in f for _, f in reactants): + lines.append("A formula like CuSO4*5H2O is a hydrate: the water molecules count toward its molar mass.") + files = { + "reaction.txt": "\n".join(lines) + "\n", + "atomic_masses.txt": "".join(f"{el} {m}\n" for el, m in MASSES.items()), + } + instruction = ( + f"/app/reaction.txt describes one batch. Using only the atomic masses in /app/atomic_masses.txt, find " + f"the limiting reagent, the molar mass of {fp}, and the grams of {fp} isolated. Write " + "/app/batch_report.json with the keys limiting_reagent (its formula as written in the equation), " + f'product_molar_mass (g/mol) and product_grams, for example {{"limiting_reagent": "{fa}", ' + '"product_molar_mass": 100.09, "product_grams": 12.5}.' + ) + return Built( + instruction=instruction, + files=files, + artifact=Artifact( + path="batch_report.json", + kind="json", + expected={"limiting_reagent": limiting, "product_molar_mass": molar_mass(fp), "product_grams": grams}, + fields=[ + Field("limiting_reagent", "text", "formula of the limiting reagent, written as in the equation"), + Field("product_molar_mass", "number", f"molar mass of {fp} in g/mol", tol=0.01), + Field("product_grams", "number", f"grams of {fp} isolated", rel=0.003), + ], + ), + ) + + +FAMILIES = [ + Family("sci_kinetics", "natural science", "Fit first-order kinetics", build_kinetics), + Family("sci_stoich", "natural science", "Limiting reagent and yield", build_stoich), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/science3.py b/components/dnakhla/upstream/terminal_desk/families/science3.py new file mode 100644 index 0000000000000000000000000000000000000000..061ceaebd9ba9da0778d4da8557f0ef0753d6e0f --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/science3.py @@ -0,0 +1,452 @@ +"""Natural science, v3: kinetics fit, stoichiometry batch, light-curve period. All stdlib. + +sci3_kinetics_fit and sci3_stoich_batch reshape v2's sci_kinetics and sci_stoich (the board's first natural-science +solves): same arithmetic and rule shape, with a SkillsBench-length instruction, /root output, inputs whose `head` is +cheap and whose `cat` is not, and kind="checks". sci3_lightcurve_period is new (exoplanet-detection-period shape): +detrend a spotted star's light curve and find the transit period with a box search over a stated grid. +""" + +import json +import math +import random + +from .base import Artifact, Built, Family +from .science import MASSES, R_GAS, _fit_k, _side, molar_mass + +ROOT = "/root" + + +def _ols(xs: list[float], ys: list[float]) -> tuple[float, float]: + """(slope, R squared) of the least-squares line of ys on xs.""" + n = len(xs) + mx, my = sum(xs) / n, sum(ys) / n + sxx = sum((x - mx) ** 2 for x in xs) + syy = sum((y - my) ** 2 for y in ys) + sxy = sum((x - mx) * (y - my) for x, y in zip(xs, ys)) + return sxy / sxx, sxy * sxy / (sxx * syy) + + +def _rel(got, want: float, rel: float) -> bool: + return not isinstance(got, bool) and abs(float(got) - want) <= rel * abs(want) + 1e-12 + + +# ---------------------------------------------------------------- sci3_kinetics_fit + + +def _conc(order: int, c0: float, k: float, t: float) -> float: + return c0 * math.exp(-k * t) if order == 1 else c0 / (1 + k * c0 * t) + + +def _fit(order: int, pts: list[tuple[float, float]]) -> tuple[float, float]: + """(k, R squared) for one order on (t_s, c_M) points: v2's _fit_k for first order, 1/C slope for second.""" + ts = [t for t, _ in pts] + if order == 1: + return _fit_k(pts), _ols(ts, [math.log(c) for _, c in pts])[1] + return _ols(ts, [1 / c for _, c in pts]) + + +def _kin_run(rng: random.Random, order: int, n: int, milli: bool, bad: bool): + """One sampler run: (csv text, cleaned (t_s, c_M) points, bad sample id or None, points with the bad row).""" + dt = rng.choice([5, 6, 8, 10, 12, 15, 20, 24, 30]) + c0 = rng.uniform(20, 80) / 1000 if milli else rng.uniform(0.5, 2.0) + t_half = n * dt / rng.uniform(2.5, 3.8) + k = math.log(2) / t_half if order == 1 else 1 / (t_half * c0) + lod = rng.randint(3, 6) + conc = [_conc(order, c0, k, i * dt) * (1 + rng.gauss(0, 0.01)) for i in range(n - lod)] + bad_i = rng.randrange(int(0.6 * len(conc)), len(conc) - 1) if bad else None + if bad: # a double or half injection late in the run, where it moves the slope most + conc[bad_i] *= rng.choice([0.4, 2.5]) + lines = ["sample,time_min,conc_mM" if milli else "sample,time_s,conc_M"] + pts, every = [], [] + for i in range(n): + tt = f"{i * dt / 60:.3f}" if milli else str(i * dt) + if i >= len(conc): + lines.append(f"S{i + 1:03d},{tt}, bool: + """The true order wins the R squared comparison by a margin no rounding can flip.""" + return _fit(order, pts)[1] - _fit(3 - order, pts)[1] > 0.003 + + +def _notes(rng: random.Random, bad: list[tuple[str, str]]) -> str: + filler = [ + "Thermostat bath checked against the reference thermometer before the first run.", + "Stock solution prepared fresh this morning; no precipitate seen.", + "Sampler needle flushed between runs.", + "Absorbance cell cleaned and blanked at the start of the shift.", + ] + lines = rng.sample(filler, 2) + [ + f"Sample {sid} in {fname} was a bad injection; exclude it from the fit." for sid, fname in bad + ] + rng.shuffle(lines) + return "\n".join(f"- {line}" for line in lines) + "\n" + + +def build_kinetics(level: int, rng: random.Random) -> Built: + opener = rng.choice([ + "You are analysing the decomposition of a reactant at constant temperature.", + "A kinetics lab is studying how fast a reactant decomposes at constant temperature.", + ]) + out = f"{ROOT}/kinetics_report.json" + if level == 1: + while True: # the flagged rows must move k past twice the tolerance when they are kept + text, pts, every = _kin_flagged(rng, rng.randint(110, 125)) + k = _fit_k(pts) + if _order_clear(1, pts) and abs(_fit_k(every) / k - 1) > 0.01: + break + want = {"k_per_s": k, "half_life_s": math.log(2) / k} + files = {"data/run.csv": text} + instruction = ( + f"{opener} An automatic sampler logged one row per sample to {ROOT}/data/run.csv, with the columns " + "sample, time_s (seconds since mixing), conc_M (concentration in mol/L) and flag. The reaction is " + "first order. Near the end of the run the concentration fell below the detection limit: on those rows " + "the sampler wrote the limit itself in conc_M and 0.01: + break + half = math.log(2) / k if order == 1 else 1 / (k * pts[0][1]) + want = {"order": order, "k": k, "half_life_s": half} + files = {"data/run.csv": text, "data/lab_notes.txt": _notes(rng, [(bad_id, "run.csv")])} + instruction = ( + f"{opener} An automatic sampler logged {ROOT}/data/run.csv (columns sample, time_min, conc_mM). Rows " + "below the detection limit say 0.01): + break + want = {"order": order, "k_low": ks[0], "k_high": ks[1], "ea_kj_per_mol": ea} + files = {f"data/{names[j]}": runs[j][0] for j in range(2)} + files["data/lab_notes.txt"] = _notes(rng, [(runs[bad_run][2], names[bad_run])]) + instruction = ( + f"The same decomposition was run at {t_low} K and {t_high} K. An automatic sampler logged " + f"{ROOT}/data/{names[0]} and {ROOT}/data/{names[1]} (columns sample, time_min, conc_mM). Drop rows " + f"that say Na2SO4 + 2 H2O", + "AgNO3 + NaCl -> AgCl + NaNO3", + "AgNO3 + KCl -> AgCl + KNO3", + "BaCl2 + Na2SO4 -> BaSO4 + 2 NaCl", + "CaCl2 + Na2CO3 -> CaCO3 + 2 NaCl", + "2 KOH + H2SO4 -> K2SO4 + 2 H2O", +] +HYDRATES = [ + "CuSO4*5H2O + 2 NaOH -> Cu(OH)2 + Na2SO4 + 5 H2O", + "FeSO4*7H2O + 2 KOH -> Fe(OH)2 + K2SO4 + 7 H2O", + "BaCl2*2H2O + Na2SO4 -> BaSO4 + 2 NaCl + 2 H2O", + "MgSO4*7H2O + 2 NaOH -> Mg(OH)2 + Na2SO4 + 7 H2O", +] +SHELF = [ # other stockroom formulas, so the inventory is a real lookup + "NaCl", "KCl", "NaOH", "KOH", "HCl", "HNO3", "H2SO4", "Na2CO3", "NaHCO3", "CaCO3", "CaCl2", "MgCl2", + "KNO3", "NaNO3", "Na2SO4", "K2SO4", "MgSO4", "CuSO4", "AgNO3", "BaCl2", "Na3PO4", "H3PO4", "Ca(OH)2", + "Mg(OH)2", "Ba(NO3)2", "Ba(OH)2", "Al", "Cu", "Fe", "Mg", "Na2S2O3", "CuSO4*5H2O", "FeSO4*7H2O", + "MgSO4*7H2O", "BaCl2*2H2O", "NH4Cl", "(NH4)2SO4", "CaSO4*2H2O", "Na2HPO4", "KHCO3", +] +def _lot(rng: random.Random, used: set) -> str: + while True: + lot = f"{rng.choice('ABCDEFGHJK')}{rng.randrange(100, 1000)}" + if lot not in used: + used.add(lot) + return lot + + +def _date(rng: random.Random, lo: int = 0, hi: int = 600) -> str: + day = rng.randrange(lo, hi) # days after 2025-01-01, 30-day months, days capped at 28 so every date is real + return f"{2025 + day // 360}-{day % 360 // 30 + 1:02d}-{min(day % 30 + 1, 28):02d}" + + +def build_stoich(level: int, rng: random.Random) -> Built: + eq = rng.choice(HYDRATES if level == 3 else PLAIN) + left, right = eq.split(" -> ") + (ca, fa), (cb, fb) = _side(left) + cp, fp = rng.choice([p for p in _side(right) if p[1] != "H2O"]) + n_rows = {1: 100, 2: 110, 3: 220}[level] # L1-L2: cat ~1,700 tokens, so a dump still leaves room to finish + dated = level == 3 # certified dates and re-assayed lots only at L3 + while True: + used: set = set() + lots = {fa: _lot(rng, used), fb: _lot(rng, used)} + purity = {f: round(rng.uniform(88, 99.9), 1) for f in (fa, fb)} + stale = {} + if dated: # one batch lot was re-certified: an older row with a different purity stays in the table + who = rng.choice([fa, fb]) + stale[who] = round(min(99.9, purity[who] + rng.choice([-1, 1]) * rng.uniform(3, 8)), 1) + mass_a = round(rng.uniform(8, 60), 2) + eq_a = mass_a * purity[fa] / 100 / molar_mass(fa) / ca + ratio = rng.choice([rng.uniform(1.15, 1.6), rng.uniform(0.6, 0.87)]) + mass_b = round(eq_a * ratio * cb * molar_mass(fb) / (purity[fb] / 100), 2) + + def report(pur): + ea_, eb_ = (m * pur[f] / 100 / molar_mass(f) / c for m, f, c in ((mass_a, fa, ca), (mass_b, fb, cb))) + return (fa if ea_ < eb_ else fb), min(ea_, eb_) * cp * molar_mass(fp), ea_ / eb_ + + limiting, theo, r = report(purity) + if abs(r - 1) < 0.08: + continue + iso = round(theo * rng.uniform(0.62, 0.95), 2) + if stale: + lim2, theo2, _ = report(dict(purity, **stale)) + if lim2 == limiting and abs(theo2 / theo - 1) < 0.01: + continue # the stale row must change the answer + break + pct = iso / theo * 100 + + def extra(): # the fourth column: certified date at L3, shelf position at L1-L2 + return _date(rng, 0, 600) if dated else f"{rng.choice('ABCDEF')}{rng.randint(1, 9)}" + + # inventory: the batch lots plus shelf stock, shuffled; at L3 a few unrelated lots are re-certified too + rows = [(lots[f], f, purity[f], _date(rng, 300, 600) if dated else extra()) for f in (fa, fb)] + for f, p in stale.items(): + rows.append((lots[f], f, p, _date(rng, 0, 290))) + while len(rows) < n_rows: + lot, f = _lot(rng, used), rng.choice(SHELF) + rows.append((lot, f, round(rng.uniform(85, 99.9), 1), extra())) + if dated and rng.random() < 0.08: + rows.append((lot, f, round(rng.uniform(85, 99.9), 1), extra())) + rng.shuffle(rows) + header = "lot,formula,purity_pct," + ("certified" if dated else "shelf") + reagents = header + "\n" + "".join(f"{a},{b},{c},{d}\n" for a, b, c, d in rows) + atomic = "element,mass\n" + "".join(f"{el},{m}\n" for el, m in MASSES.items()) + charges = [(mass_a, fa), (mass_b, fb)] + rng.shuffle(charges) + batch = (f"Batch B-{rng.randrange(1000, 10000)}\nReaction: {eq}\n" + + "".join(f"Charged: {m:.2f} g {f} from lot {lots[f]}\n" for m, f in charges) + + f"Isolated: {iso:.2f} g {fp} (dried)\n") + files = {"data/batch.txt": batch, "data/reagents.csv": reagents, "data/atomic_masses.csv": atomic} + if dated: + files["data/README.md"] = ( + "# Stockroom inventory notes\n\nLots are re-assayed from time to time and the new assay is added as a " + "new row, so a lot can appear more than once in reagents.csv. Use the row with the latest certified " + "date; older rows are superseded.\n\nA formula written like CuSO4*5H2O is a hydrate: the water " + "molecules are part of the solid and count toward its molar mass.\n") + out = f"{ROOT}/batch_report.json" + example = rng.choice([f for f in SHELF if f not in eq and "*" not in f and "(" not in f]) + opener = rng.choice([ + "You are checking a production batch for a small chemistry lab.", + "A process chemist asks you to audit one pilot-plant batch.", + ]) + table = (f"{ROOT}/data/reagents.csv is the stockroom inventory ({header.replace(',', ', ')}) and " + f"{ROOT}/data/atomic_masses.csv the atomic masses.") + if level == 1: # the v2 shape: the batch and both lots are named right here + charged = " and ".join(f"{m:.2f} g of {f} from lot {lots[f]}" for m, f in charges) + intro = (f"{opener} The batch ran {eq}, charging {charged}; {iso:.2f} g of {fp} was isolated " + f"(record: {ROOT}/data/batch.txt). {table}") + else: + intro = (f"{opener} {ROOT}/data/batch.txt is the batch record: the balanced equation, grams charged per " + f"reagent lot and grams of product isolated. {table}" + + (f" Apply the notes in {ROOT}/data/README.md." if dated else "")) + instruction = ( + f"{intro}\n\n" + "Only the pure part of a charge reacts: grams x purity_pct / 100. The limiting reagent has the fewest " + "moles divided by its coefficient. The theoretical yield is the grams of product that amount makes; " + "percent yield = isolated / theoretical x 100.\n\n" + f"Write {out} with the keys limiting_reagent (formula as in the equation), product_molar_mass (g/mol), " + f'theoretical_yield_g and percent_yield, for example {{"limiting_reagent": "{example}", ' + '"product_molar_mass": 158.11, "theoretical_yield_g": 25.41, "percent_yield": 88.6}. Molar mass must be ' + "within 0.01 and the others within 0.3% (relative)." + ) + want = {"limiting_reagent": limiting, "product_molar_mass": molar_mass(fp), "theoretical_yield_g": theo, + "percent_yield": pct} + checks = [ + ("test_is_object", lambda p: isinstance(p, dict)), + ("test_keys", lambda p: set(p) == set(want)), + ("test_limiting_reagent", lambda p: isinstance(p["limiting_reagent"], str) + and p["limiting_reagent"].strip() == limiting), + ("test_product_molar_mass", lambda p: not isinstance(p["product_molar_mass"], bool) + and abs(float(p["product_molar_mass"]) - want["product_molar_mass"]) <= 0.01 + 1e-9), + ("test_theoretical_yield_g", lambda p: _rel(p["theoretical_yield_g"], theo, 0.003)), + ("test_percent_yield", lambda p: _rel(p["percent_yield"], pct, 0.003)), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="batch_report.json", kind="checks", parse="json", checks=checks, + render=lambda: json.dumps(want, indent=1) + "\n"), + root=ROOT, + ) + + +# ---------------------------------------------------------------- sci3_lightcurve_period + +CADENCE_D = 20 / 1440 +QUALITY_BAD = (1, 4, 32, 128, 1024) + + +def _in_transit(t: float, period: float, t0: float, dur: float) -> bool: + return abs((t - t0 + period / 2) % period - period / 2) < dur / 2 + + +def build_lightcurve(level: int, rng: random.Random) -> Built: + days = 40.0 if level == 3 else 27.0 + start = round(rng.uniform(60000, 61000), 2) + period = round(rng.uniform(1.5, 4.2), 5) + dur = rng.choice([0.08, 0.09, 0.10, 0.11, 0.12]) + depth = rng.uniform(0.005, 0.009) + t0 = start + rng.uniform(0, period) + prot, amp, phase = rng.uniform(3.5, 9.0), rng.uniform(0.005, 0.015), rng.uniform(0, 2 * math.pi) + second = None + if level == 3: # a shallower, shorter planet whose box signal stays well below the target's + while True: + p2 = round(rng.uniform(1.1, 4.8), 5) + ratio = max(p2, period) / min(p2, period) + if min(abs(ratio - m) for m in (1, 1.5, 2, 2.5, 3, 4)) > 0.12: + break + second = (p2, start + rng.uniform(0, p2), 0.05, 0.35 * depth) + dump = None + if level >= 2: # momentum dump: quality 0 but corrupted by a ramp + a = round(start + rng.uniform(0.2, 0.8) * days, 3) + dump = (a, round(a + 0.5, 3), rng.choice([-1, 1]) * rng.uniform(0.01, 0.02)) + lines = ["# time_mjd flux quality"] + for i in range(int(days / CADENCE_D)): + t = start + i * CADENCE_D + x = 2 * math.pi * (t - start) / prot + phase + f = 1 + amp * math.sin(x) + 0.3 * amp * math.sin(2 * x + 1.0) + if _in_transit(t, period, t0, dur): + f -= depth + if second and _in_transit(t, second[0], second[1], second[2]): + f -= second[3] + f += rng.gauss(0, 0.0009) + q = 0 + if rng.random() < 0.03: + q = rng.choice(QUALITY_BAD) + f *= 1 + rng.choice([-1, 1]) * rng.uniform(0.02, 0.08) + if dump and dump[0] <= t <= dump[1]: + f *= 1 + dump[2] * (t - dump[0]) / 0.5 + lines.append(f"{t:.5f} {f:.6f} {q}") + files = {"data/lc.txt": "\n".join(lines) + "\n"} + if dump: + files["data/README.md"] = ( + "# Light curve notes\n\nBetween MJD {:.3f} and {:.3f} the spacecraft fired its thrusters (momentum " + "dump). Those points carry quality 0 but are corrupted: discard every point in that interval before " + "searching.\n".format(dump[0], dump[1])) + out = f"{ROOT}/period.txt" + hours = round(dur * 24, 2) + example = "2.44535" if abs(period - 2.44535) > 0.05 else "3.81726" # never near the answer + notes = f" Read {ROOT}/data/README.md for other data to discard." if dump else "" + two = " The data may hold two transit signals; report the deeper one." if second else "" + instruction = ( + f"{ROOT}/data/lc.txt is a space-telescope light curve: a comment line, then rows of time (MJD), " + "normalized flux and a quality flag (0 means good), one every 20 minutes. The star is spotted, so its " + "brightness swings by about one percent as it rotates every few days. Hidden under that is a planet " + f"whose transit dims the star by about 0.5-0.9% for {hours} hours ({dur:.2f} d) once per orbit.\n\n" + f"1. Drop every point with a nonzero quality flag.{notes}\n" + "2. Remove the stellar variability, for example by dividing by a running median about 0.75 d wide.\n" + "3. Search trial periods from 1.000 to 5.000 d in steps of 0.001 d for the periodic box-shaped dip of " + f"that duration. The rotation period is not the answer.{two}\n\n" + f"Write the period in days to {out} as one number with exactly 5 decimals, for example {example}. It is " + "accepted within 0.2% of the true period." + ) + + def single(text): + return len(text.split()) == 1 and float(text.strip()) > 0 + + checks = [ + ("test_single_number", single), + ("test_five_decimals", lambda s: len(s.strip().partition(".")[2]) == 5 and s.strip().count(".") == 1), + ("test_period_value", lambda s: abs(float(s.strip()) - period) <= 0.002 * period), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="period.txt", kind="checks", parse="text", checks=checks, + render=lambda: f"{period:.5f}\n"), + root=ROOT, + notes={"period": period, "second": second}, + ) + + +FAMILIES = [ + Family("sci3_kinetics_fit", "natural science", "Kinetics order, rate constant and half-life", + build_kinetics, v3=True), + Family("sci3_stoich_batch", "natural science", "Batch limiting reagent and yield from a stockroom table", + build_stoich, v3=True), + Family("sci3_lightcurve_period", "natural science", "Transit period from a spotted star's light curve", + build_lightcurve, v3=True), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/security.py b/components/dnakhla/upstream/terminal_desk/families/security.py new file mode 100644 index 0000000000000000000000000000000000000000..0c4b0b80daaaf2a7ace98eee255aa68138e4e2e9 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/security.py @@ -0,0 +1,224 @@ +"""Cybersecurity: find brute-forced SSH logins; evaluate first-match firewall rules.""" + +import datetime as dt +import ipaddress +import random + +from .base import Artifact, Built, Family, Field + +USERS = ["alice", "bob", "carol", "deploy", "backup", "root", "admin", "git"] + +# ---------------------------------------------------------------- sec_auth + + +def _ip(rng: random.Random, v6: bool = False) -> str: + if v6: + return f"2001:db8:{rng.randint(1, 0xffff):x}::{rng.randint(1, 0xffff):x}" + net = rng.choice(["198.51.100", "203.0.113", "192.0.2"]) + return f"{net}.{rng.randint(2, 254)}" + + +def build_auth(level: int, rng: random.Random) -> Built: + k = {1: 5, 2: 4, 3: 4}[level] + while True: + day = dt.datetime(2026, 11, 3, 0, 0, 0) + events = [] # (time, ip, kind, user) + actors = [] + n_actors = {1: 8, 2: 14, 3: 20}[level] + used = set() + allow_nets = ["198.51.100.0/26"] if level == 3 else [] + for _ in range(n_actors): + v6 = level >= 2 and rng.random() < 0.25 + ip = _ip(rng, v6) + if ip in used: + continue + used.add(ip) + role = rng.choice(["brute_win", "brute_fail", "legit", "legit_typo"]) + t = day + dt.timedelta(seconds=rng.randint(0, 80000)) + if role.startswith("brute"): + fails = rng.randint(k - 2, k + 8) + for _ in range(fails): + user = rng.choice(USERS) + invalid = level >= 2 and user in ("admin", "git") and rng.random() < 0.7 + events.append((t, ip, "fail_invalid" if invalid else "fail", user)) + t += dt.timedelta(seconds=rng.randint(1, 20)) + if role == "brute_win": + events.append((t, ip, "accept", rng.choice(["root", "deploy", "backup"]))) + t += dt.timedelta(seconds=rng.randint(30, 600)) + if rng.random() < 0.5: + events.append((t, ip, "fail", "root")) + else: + user = rng.choice(USERS[:4]) + if role == "legit_typo": + for _ in range(rng.randint(1, k - 1)): + events.append((t, ip, "fail", user)) + t += dt.timedelta(seconds=rng.randint(3, 30)) + events.append((t, ip, "accept", user)) + actors.append(ip) + if level == 3: + scanner = f"198.51.100.{rng.randint(2, 60)}" + if scanner not in used: + t = day + dt.timedelta(seconds=rng.randint(0, 80000)) + for _ in range(k + 3): + events.append((t, scanner, "fail", "root")) + t += dt.timedelta(seconds=2) + events.append((t, scanner, "accept", "audit")) + events.sort() + fails, breach = {}, {} + for t, ip, kind, user in events: + if kind.startswith("fail"): + if ip not in breach: + fails[ip] = fails.get(ip, 0) + 1 + elif ip not in breach and fails.get(ip, 0) >= k: + breach[ip] = t + elif kind == "accept" and ip not in breach: + fails[ip] = fails.get(ip, 0) + breach.setdefault(ip, None) + hits = { + ip: t + for ip, t in breach.items() + if t is not None and not any(ipaddress.ip_address(ip) in ipaddress.ip_network(n) for n in allow_nets) + } + if 1 <= len(hits) <= 5: + break + def line(t, ip, kind, user, pid): + port = rng.randint(30000, 65000) + stamp = f"{t:%b} {t.day:2d} {t:%H:%M:%S}" + if kind == "fail": + msg = f"Failed password for {user} from {ip} port {port} ssh2" + elif kind == "fail_invalid": + msg = f"Failed password for invalid user {user} from {ip} port {port} ssh2" + else: + method = "publickey" if level >= 2 and rng.random() < 0.4 else "password" + msg = f"Accepted {method} for {user} from {ip} port {port} ssh2" + return f"{stamp} bastion sshd[{pid}]: {msg}" + + out = [] + for t, ip, kind, user in events: + pid = rng.randint(1000, 60000) + out.append((t, line(t, ip, kind, user, pid))) + if rng.random() < 0.3: + stamp = f"{t:%b} {t.day:2d} {t:%H:%M:%S}" + out.append((t, f"{stamp} bastion sshd[{pid}]: Connection closed by {ip} port {rng.randint(30000, 65000)} [preauth]")) + files = {} + if level == 3: + cut = len(out) // 2 + files["auth.log.1"] = "\n".join(s for _, s in out[:cut]) + "\n" + files["auth.log"] = "\n".join(s for _, s in out[cut:]) + "\n" + files["allowlist.txt"] = ( + "Internal audit scanners. Their activity is expected; never report them:\n" + + "".join(f" {n}\n" for n in allow_nets) + ) + where = "auth.log.1 (older) and auth.log (newer) in /app hold one day of sshd logs; never block a source in allowlist.txt." + else: + files["auth.log"] = "\n".join(s for _, s in out) + "\n" + where = "auth.log in /app holds one day of sshd logs." + instruction = ( + f"{where} Block every source IP that logged at least {k} failed password attempts (for any user, valid " + "or not) before its first accepted login (password or key); lines after that login do not count. " + "Write the IPs to /app/blocked.txt, one per line, nothing else." + ) + artifact = Artifact(path="blocked.txt", kind="lines", expected=sorted(hits)) + return Built(instruction=instruction, files=files, artifact=artifact) + + +# ---------------------------------------------------------------- sec_fw + + +def _port_spec(rng: random.Random) -> tuple[str, set | None]: + kind = rng.random() + if kind < 0.45: + p = rng.choice([22, 53, 80, 443, 3306, 5432, 6379, 8080]) + return str(p), {p} + if kind < 0.7: + ps = rng.sample([22, 25, 80, 443, 8080, 8443], 2) + return ",".join(map(str, ps)), set(ps) + if kind < 0.9: + lo = rng.choice([1000, 3000, 8000]) + hi = lo + rng.choice([99, 999]) + return f"{lo}-{hi}", set(range(lo, hi + 1)) + return "any", None + + +NETS = ["10.0.0.0/8", "10.20.0.0/16", "10.20.5.0/24", "192.168.0.0/16", "192.168.10.0/24", "172.16.0.0/12", "any"] + + +def build_fw(level: int, rng: random.Random) -> Built: + n_rules, n_conn = {1: 5, 2: 9, 3: 14}[level], {1: 15, 2: 40, 3: 70}[level] + while True: + rules = [] + for _ in range(n_rules): + action = rng.choice(["allow", "allow", "deny"]) + proto = rng.choice(["tcp", "tcp", "udp", "any"]) + net = rng.choice(NETS if level >= 2 else ["10.0.0.0/8", "192.168.0.0/16", "any"]) + spec, ports = _port_spec(rng) + disabled = level == 3 and rng.random() < 0.2 + rules.append((action, proto, net, spec, ports, disabled)) + conns = [] + for i in range(n_conn): + src = rng.choice( + [ + f"10.{rng.choice([20, rng.randint(0, 255)])}.{rng.choice([5, rng.randint(0, 255)])}.{rng.randint(1, 254)}", + f"192.168.{rng.choice([10, rng.randint(0, 255)])}.{rng.randint(1, 254)}", + f"172.{rng.randint(10, 40)}.{rng.randint(0, 255)}.{rng.randint(1, 254)}", + f"203.0.113.{rng.randint(1, 254)}", + ] + ) + proto = rng.choice(["tcp", "tcp", "udp"]) + port = rng.choice([22, 22, 53, 80, 443, 3306, 5432, 8080, 8443, 1080, 3100, 8050, 25]) + conns.append((f"c{i + 1:03d}", src, proto, port)) + + def match(rule, src, proto, port): + action, rproto, net, _, ports, disabled = rule + if disabled: + return False + if rproto != "any" and rproto != proto: + return False + if net != "any" and ipaddress.ip_address(src) not in ipaddress.ip_network(net): + return False + return ports is None or port in ports + + hit_count = {i: 0 for i in range(n_rules + 1)} + allowed, denied_ssh, verdicts = 0, [], [] + for cid, src, proto, port in conns: + num = next((i + 1 for i, r in enumerate(rules) if match(r, src, proto, port)), 0) + hit_count[num] += 1 + verdict = rules[num - 1][0] if num else "deny" + verdicts.append({"id": cid, "verdict": verdict, "rule": num}) + if verdict == "allow": + allowed += 1 + elif port == 22: + denied_ssh.append(cid) + ranked = sorted(hit_count.items(), key=lambda kv: -kv[1]) + if ranked[0][1] > ranked[1][1] and 0 < allowed < n_conn and denied_ssh: + break + lines = ["# first matching rule wins; a connection no rule matches is denied (default deny)"] + for i, (action, proto, net, spec, _, disabled) in enumerate(rules, start=1): + text = f"{i} {action} proto={proto} src={net} port={spec}" + lines.append(f"# {text} (disabled, not loaded)" if disabled else text) + files = { + "rules.txt": "\n".join(lines) + "\n", + "connections.csv": "id,src_ip,proto,dst_port\n" + "".join(f"{c},{s},{p},{d}\n" for c, s, p, d in conns), + } + instruction = ( + "rules.txt and connections.csv are in /app. Evaluate every connection against the rules: a rule matches " + "when its proto equals the connection's (or is any), the source IP is inside its src network (or src is " + "any), and the destination port is in its port list or range (or port is any). The first matching rule " + "decides; commented-out rules are not loaded; no match means deny. Write /app/verdicts.csv with the " + "header id,verdict,rule and one row per connection: verdict is allow or deny, rule is the deciding " + "rule's number (0 for the default deny). Example: c001,allow,3" + ) + artifact = Artifact( + path="verdicts.csv", + kind="csv", + key=("id",), + fields=[Field("id", "text"), Field("verdict", "text"), Field("rule", "int")], + expected=verdicts, + ) + return Built(instruction=instruction, files=files, artifact=artifact) + + +FAMILIES = [ + Family("sec_auth", "cybersecurity", "Find brute-forced SSH logins", build_auth), + Family("sec_fw", "cybersecurity", "Evaluate firewall rules", build_fw), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/security3.py b/components/dnakhla/upstream/terminal_desk/families/security3.py new file mode 100644 index 0000000000000000000000000000000000000000..aa79919b9af169f10430b6d5e0d97d7c42272c0f --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/security3.py @@ -0,0 +1,521 @@ +"""Cybersecurity v3: SSH brute-force triage, firewall verdicts, off-hours exfiltration flows. + +Each generator computes the expected answer itself from the records it emits; the oracle +scripts in terminal_desk/oracles/ only prove the files carry everything the answer needs. +""" + +import ipaddress +import json +import random + +from .base import Artifact, Built, Family + +ROOT = "/root" +DAYS = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") + + +def _clock(sec: int) -> str: + return f"{sec // 3600:02d}:{sec // 60 % 60:02d}:{sec % 60:02d}" + + +def _public_ip(rng: random.Random, used: set) -> str: + while True: + ip = f"{rng.choice([37, 45, 61, 77, 89, 91, 94])}.{rng.randint(1, 99)}.{rng.randint(0, 99)}.{rng.randint(2, 99)}" + if ip not in used: + used.add(ip) + return ip + + +def _in_any(ip: str, nets) -> bool: + addr = ipaddress.ip_address(ip) + return any(addr in ipaddress.ip_network(n) for n in nets) + + +def _ip_checks(want: set) -> list: + def one_ip_per_line(lines): + for s in lines: + ipaddress.ip_address(s) + return True + + return [ + ("test_one_ip_per_line", one_ip_per_line), + ("test_no_duplicates", lambda lines: len(lines) == len(set(lines))), + ("test_no_false_positives", lambda lines: set(lines) <= want), + ("test_no_missed_ips", lambda lines: want <= set(lines)), + ] + + +# ---------------------------------------------------------------- sec3_auth_triage + +USERS_VALID = ["root", "deploy", "git", "backup", "ubuntu", "alice", "bob", "carol"] +USERS_INVALID = ["admin", "oracle", "test", "postgres", "user", "pi", "ftp", "guest"] + + +def build_auth(level: int, rng: random.Random) -> Built: + k, w = 5, 10 # fixed: the rule lives in the instruction, so one oracle serves every instance + span = w * 60 + target = {1: 150, 2: 300, 3: 450}[level] + while True: + used: set = set() + lines = [] # (sec, ip, text, failures) + allow = [] + + def fail(t, ip, user=None): + user = user or rng.choice(USERS_VALID[:5] + USERS_INVALID) + if user in USERS_INVALID: + if level >= 2: + lines.append((t, ip, f"Invalid user {user} from {ip}", 0)) + lines.append((t, ip, f"Failed password for invalid user {user} from {ip}", 1)) + else: + lines.append((t, ip, f"Failed password for {user} from {ip}", 1)) + + def burst(ip, n, gap_lo, gap_hi, t=None, repeats=True): + t = rng.randint(0, 86399 - n * gap_hi - 700) if t is None else t + times, i = [], 0 + user = rng.choice(USERS_VALID[:5] + USERS_INVALID) + while i < n: + fail(t, ip, user) + times.append(t) + i += 1 + if repeats and level == 3 and user in USERS_VALID and n - i >= 2 and rng.random() < 0.3: + rep = rng.randint(2, min(4, n - i)) + t += rng.randint(1, 3) * rep + lines.append((t, ip, f"message repeated {rep} times: [ Failed password for {user} from {ip}]", rep)) + times += [t] * rep + i += rep + t += rng.randint(gap_lo, gap_hi) + if rng.random() < 0.3: + user = rng.choice(USERS_VALID[:5] + USERS_INVALID) + lines.append((t, ip, f"Connection closed by {ip} [preauth]", 0)) + return times + + def session(ip, user=None): + user = user or rng.choice(USERS_VALID[3:]) + t = rng.randint(0, 80000) + method = rng.choice(["password", "publickey"]) + lines.append((t, ip, f"Accepted {method} for {user} from {ip}", 0)) + lines.append((t + rng.randint(30, 5000), ip, f"Disconnected from user {user} {ip}", 0)) + + n_brute = rng.randint(*{1: (2, 4), 2: (3, 5), 3: (4, 6)}[level]) + for _ in range(n_brute): + burst(_public_ip(rng, used), rng.randint(k, k + 9), 2, 40) + for _ in range({1: 2, 2: 3, 3: 4}[level]): # slow: spaced out, unless a collapsed repeat bunches k (L3) + lo = span // (k - 1) + 5 + burst(_public_ip(rng, used), rng.randint(k + 1, k + 4), lo, lo + 120) + for _ in range({1: 2, 2: 3, 3: 4}[level]): # near miss: k-1 quick failures, then a login + ip = _public_ip(rng, used) + user = rng.choice(USERS_VALID[5:]) + t0 = rng.randint(0, 80000) + for j in range(k - 1): + fail(t0 + 9 * j, ip, user) + lines.append((t0 + 9 * (k - 1), ip, f"Accepted password for {user} from {ip}", 0)) + if level >= 2: + for exact in (True, False): # k failures spanning exactly the window (blocked) or one second more + ip = _public_ip(rng, used) + t0 = rng.randint(0, 80000) + cuts = sorted(rng.sample(range(1, span), k - 2)) + for off in [0] + cuts + [span + (0 if exact else 1)]: + fail(t0 + off, ip) + prefix, base = f"10.{rng.randint(2, 9)}.{rng.randint(2, 9)}", rng.choice([0, 64]) + allow = [f"{prefix}.{base}/26"] # the audit scanner network; its neighbour /26 is not exempt + scanner = f"{prefix}.{base + rng.randint(1, 62)}" + outsider = f"{prefix}.{64 + rng.randint(1, 35) if base == 0 else rng.randint(2, 62)}" + used.update({scanner, outsider}) + burst(scanner, rng.randint(k + 2, k + 8), 1, 5) + burst(outsider, rng.randint(k, k + 4), 3, 30) + straddle = None + if level == 3: + straddle = _public_ip(rng, used) + times = burst(straddle, k, 5, 30, t=rng.randint(40000, 46000), repeats=False) + cut = times[1] + 1 + offices = [f"10.0.{rng.randint(1, 9)}.{rng.randint(2, 99)}" for _ in range(rng.randint(4, 7))] + while len(lines) < target - 20: + r = rng.random() + if r < 0.45: + session(rng.choice(offices)) + else: # internet background noise: one or two failures + ip = _public_ip(rng, used) + t = rng.randint(0, 86000) + for j in range(rng.randint(1, 2)): + fail(t + j * rng.randint(60, 900), ip) + lines = [ln for ln in lines if ln[0] < 86400] + lines.sort(key=lambda x: x[0]) + + def blocked(notice=0, repeat=None): + """The answer; notice=1 or repeat=1 give the two README misreadings.""" + per_ip: dict = {} + for t, ip, msg, n in lines: + if msg.startswith("Invalid user"): + n = notice + elif repeat is not None and msg.startswith("message repeated"): + n = repeat + per_ip.setdefault(ip, []).extend([t] * n) + out = set() + for ip, ts in per_ip.items(): + ts.sort() + if any(ts[i + k - 1] - ts[i] <= span for i in range(len(ts) - k + 1)) and not _in_any(ip, allow): + out.add(ip) + return out + + want = blocked() + ok = 2 <= len(want) <= 10 and (straddle is None or straddle in want) + if level >= 2: # counting the Invalid user notices as attempts must change the answer + ok = ok and blocked(notice=1) != want + if level == 3: # reading a repeated-message line as one attempt must change the answer + ok = ok and blocked(repeat=1) != want + if ok: + break + + def text(chunk): + return "".join(f"{_clock(t)} {msg}\n" for t, _, msg, _ in chunk) + + if level == 3: + files = {"auth.log.1": text([x for x in lines if x[0] < cut]), "auth.log": text([x for x in lines if x[0] >= cut])} + where = ("The log was rotated at midday: /root/auth.log.1 holds the morning and /root/auth.log the rest of " + "3 November 2026.") + else: + files = {"auth.log": text(lines)} + where = "The sshd messages for 3 November 2026 are in /root/auth.log, one per line." + readme = "" + if level >= 2: + readme = ("# Bastion notes\n\nThe audit team runs a password-spray test from the scanner network below. " + "Its addresses are expected to fail logins: never block an address inside it.\n\n" + f"- {allow[0]}\n\nsshd logs `Invalid user NAME from IP` just before the matching failed password " + "line. That line is a notice, not a separate attempt.\n") + if level == 3: + readme += ("\nWhen sshd repeats an identical message, syslog writes `message repeated N times: [ ... ]` " + "instead. That line stands for N more failed attempts at that line's time.\n") + files["README.md"] = readme + opener = rng.choice([ + "You are on call for the company's SSH bastion host and need to stop a password-guessing attack.", + "A bastion host is being hit by SSH password guessing, and you have been asked to decide which sources to block.", + ]) + notes = " Notes from the security team are in /root/README.md." if level >= 2 else "" + instruction = ( + f"{opener} {where} Each line starts with the time as HH:MM:SS, for example " + f"`00:14:07 Failed password for root from 45.9.2.18`.{notes}\n\n" + "A failed attempt is a `Failed password for USER from IP` line, including `Failed password for invalid user " + "USER from IP`. Accepted logins, disconnects and other messages are not attempts.\n\n" + f"Block a source IP when it has at least {k} failed attempts within {w} minutes: some {k} of its failures, " + f"where the last is no more than {span} seconds after the first. Failures spread over a longer time do not count " + "together.\n\n" + "Write /root/blocked.txt with each blocked IP once, one per line, in any order, and nothing else." + ) + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="blocked.txt", kind="checks", parse="lines", checks=_ip_checks(want), + render=lambda: "".join(f"{ip}\n" for ip in sorted(want))), + root=ROOT, + notes={"blocked": sorted(want), "k": k, "window_s": span}, + ) + + +# ---------------------------------------------------------------- sec3_fw_verdicts + +FW_NETS = ["10.0.0.0/8", "10.20.0.0/16", "10.20.5.0/24", "192.168.0.0/16", "192.168.10.0/24", "172.16.0.0/12", + "203.0.113.0/24", "any"] +FW_PORTS = [22, 25, 53, 80, 443, 3306, 5432, 6379, 8080, 8443] + + +def _fw_ports(rng: random.Random) -> tuple[str, set | None]: + r = rng.random() + if r < 0.4: + p = rng.choice(FW_PORTS) + return str(p), {p} + if r < 0.65: + ps = sorted(rng.sample(FW_PORTS, rng.randint(2, 3))) + return ";".join(map(str, ps)), set(ps) + if r < 0.88: + lo = rng.choice([1000, 3000, 5400, 8000]) + hi = lo + rng.choice([99, 999]) + return f"{lo}-{hi}", set(range(lo, hi + 1)) + return "any", None + + +def _fw_src(rng: random.Random, nets: list[str]) -> str: + net = ipaddress.ip_network(rng.choice(nets)) + if rng.random() < 0.35: # from anywhere + return rng.choice([f"10.{rng.randint(0, 40)}.{rng.randint(0, 20)}.{rng.randint(1, 254)}", + f"192.168.{rng.choice([10, 11, rng.randint(0, 40)])}.{rng.randint(1, 254)}", + f"172.{rng.randint(12, 34)}.{rng.randint(0, 20)}.{rng.randint(1, 254)}", + f"203.0.113.{rng.randint(1, 254)}", f"198.51.100.{rng.randint(1, 254)}"]) + return str(net.network_address + rng.randint(1, net.num_addresses - 2)) + + +def build_fw(level: int, rng: random.Random) -> Built: + n_rules, n_conn = {1: 5, 2: 8, 3: 11}[level], {1: 120, 2: 220, 3: 360}[level] + protos = ["tcp", "tcp", "udp", "any"] + (["icmp"] if level >= 2 else []) + groups = {} + if level == 3: + groups = {"office": sorted(rng.sample(["10.20.5.0/24", "10.20.6.0/24", "10.20.9.0/24"], 2)), + "vpn": [rng.choice(["172.16.8.0/22", "172.20.0.0/16"])], + "partners": sorted(rng.sample(["203.0.113.0/25", "198.51.100.0/24", "192.168.10.0/24"], 2))} + while True: + nums = sorted(rng.sample(range(100, 1000, 10), n_rules)) + rules = [] # (no, action, proto, src_text, nets or None, port_text, ports or None, enabled) + for no in nums: + proto = rng.choice(protos) + if level == 3 and rng.random() < 0.3: + g = rng.choice(sorted(groups)) + src_text, nets = f"@{g}", groups[g] + else: + src_text = rng.choice(FW_NETS if level >= 2 else ["10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12", "any"]) + nets = None if src_text == "any" else [src_text] + ptext, ports = ("any", None) if proto == "icmp" else _fw_ports(rng) + enabled = not (level == 3 and rng.random() < 0.2) + rules.append((no, rng.choice(["allow", "allow", "deny"]), proto, src_text, nets, ptext, ports, enabled)) + src_pool = [n for r in rules if r[4] for n in r[4]] + if not src_pool: # every rule says src=any: draw a new table + continue + ends = [int(x) for r in rules if "-" in r[5] for x in r[5].split("-")] + conns = [] + for i in range(n_conn): + proto = rng.choice(["tcp", "tcp", "tcp", "udp"] + (["icmp"] if level >= 2 else [])) + port = "" if proto == "icmp" else str(rng.choice(FW_PORTS + [1080, 3100, 5432, 8050, 1234, 5500, 9000] + ends * 2)) + conns.append((f"c{i + 1:04d}", _fw_src(rng, src_pool), proto, port)) + + def decide(rule_list): + out = [] + for cid, src, proto, port in conns: + hit = 0 + for no, action, rproto, _, nets, _, ports, enabled in rule_list: + if not enabled or rproto not in ("any", proto): + continue + if nets is not None and not _in_any(src, nets): + continue + if ports is not None and (port == "" or int(port) not in ports): + continue + hit = no + break + verdict = next(r[1] for r in rule_list if r[0] == hit) if hit else "deny" + out.append((cid, verdict, hit)) + return out + + rows = decide(rules) + deciders = {r[2] for r in rows} + allowed = sum(r[1] == "allow" for r in rows) + ok = 0 in deciders and len(deciders - {0}) >= (n_rules + 1) // 2 and 0.15 * n_conn < allowed < 0.85 * n_conn + # a range's upper end is included: reading it as exclusive must change the answer + excl = [r[:6] + ((r[6] - {max(r[6])}) if "-" in r[5] else r[6], r[7]) for r in rules] + ok = ok and decide(excl) != rows + file_order = rules[:] + if level >= 2: + rng.shuffle(file_order) + ok = ok and decide(file_order) != rows and any(c[2] == "icmp" and r[2] for c, r in zip(conns, rows)) + if level == 3: + loaded = [r[:7] + (True,) for r in rules] + ok = ok and decide(loaded) != rows and any(r[3].startswith("@") and r[0] in deciders for r in rules) + if ok: + break + head = "rule_no,action,proto,src,ports" + (",enabled" if level == 3 else "") + body = "".join(f"{no},{a},{p},{s},{pt}" + ((",yes" if en else ",no") if level == 3 else "") + "\n" + for no, a, p, s, _, pt, _, en in file_order) + files = {"rules.csv": f"{head}\n{body}", + "connections.csv": "id,src_ip,proto,dst_port\n" + "".join(f"{c},{s},{p},{d}\n" for c, s, p, d in conns)} + if level >= 2: + readme = ("# Rule export notes\n\nICMP connections have no port, so their dst_port is empty. An ICMP " + "connection matches a rule only when the rule's proto is icmp or any and its ports is any.\n") + if level == 3: + readme += ("\nRules with enabled=no are kept for reference and are not loaded. A src that starts with `@` " + "names an address group in /root/groups.txt: the source matches when it lies inside any of " + "the group's networks.\n") + files["groups.txt"] = "# address groups, used in rules.csv as @name\n" + "".join( + f"{g}: {' '.join(n)}\n" for g, n in groups.items()) + files["README.md"] = readme + opener = rng.choice([ + "You are reviewing a perimeter firewall change before it goes live.", + "The network team wants to know what a proposed firewall rule table would have done to yesterday's traffic.", + ]) + notes = " Export notes are in /root/README.md." if level >= 2 else "" + instruction = ( + f"{opener} The rule table is /root/rules.csv with the columns rule_no, action (allow or deny), proto, src " + "(a CIDR network or any) and ports (one port, ports joined by `;`, a range such as `8000-8099`, or any). " + f"The connection attempts are in /root/connections.csv with the columns id, src_ip, proto and dst_port.{notes}\n\n" + "A rule matches a connection when its proto equals the connection's or is any, the source IP lies inside " + "its src network or src is any, and dst_port is one of its ports or inside its range (both ends included) " + "or ports is any. Rules are checked in ascending rule_no and the first match decides. A connection that no " + "rule matches is denied by the default rule, numbered 0.\n\n" + "Write /root/verdicts.csv with the header id,verdict,rule and one row per connection in input order, " + "for example `c0007,allow,120`." + ) + want = rows + + def ids_in_order(p): + return [r["id"] for r in p["rows"]] == [r[0] for r in want] + + return Built( + instruction=instruction, + files=files, + artifact=Artifact( + path="verdicts.csv", kind="checks", parse="csv", + checks=[ + ("test_header", lambda p: p["header"] == ["id", "verdict", "rule"]), + ("test_row_count", lambda p: len(p["rows"]) == len(want)), + ("test_ids_in_order", ids_in_order), + ("test_verdicts", lambda p: [r["verdict"] for r in p["rows"]] == [r[1] for r in want]), + ("test_rule_numbers", lambda p: [int(r["rule"]) for r in p["rows"]] == [r[2] for r in want]), + ], + render=lambda: "id,verdict,rule\n" + "".join(f"{c},{v},{n}\n" for c, v, n in want), + ), + root=ROOT, + notes={"allowed": sum(r[1] == "allow" for r in want), "default_deny": sum(r[2] == 0 for r in want)}, + ) + + +# ---------------------------------------------------------------- sec3_exfil_flows + + +def _hm(minute: int) -> str: + return f"{minute // 60:02d}:{minute % 60:02d}" + + +def build_exfil(level: int, rng: random.Random) -> Built: + n_flows = {1: 130, 2: 250, 3: 380}[level] + threshold = rng.choice([200, 250, 300, 400, 500]) + start_h, end_h = rng.choice([(8, 18), (7, 19), (9, 17), (8, 17)]) + bdays = list(DAYS[:5]) if rng.random() < 0.8 else list(DAYS[:6]) + offset = rng.choice([-5, -4, 1, 2]) if level == 3 else 0 + internal = ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"] + while True: + used: set = set() + cloud = [_public_ip(rng, used) for _ in range(rng.randint(14, 22))] + if level == 1: + allowlist = rng.sample(cloud, 5) + allowed_ips = set(allowlist) + else: + nets = rng.sample(["52.94.0.0/16", "13.107.6.0/24", "140.82.112.0/20", "151.101.0.0/16"], 3) + singles = rng.sample(cloud, 3) + allowlist = sorted(nets) + singles + for n in nets: # remote hosts inside the approved networks + net = ipaddress.ip_network(n) + cloud.append(str(net.network_address + rng.randint(1, min(net.num_addresses - 2, 4000)))) + cloud.append(str(net.network_address + rng.randint(1, min(net.num_addresses - 2, 4000)))) + # just outside an approved network: not approved + cloud.append(str(ipaddress.ip_network(nets[0]).broadcast_address + rng.randint(2, 200))) + allowed_ips = set(singles) + + def approved(ip): + return ip in allowed_ips or (level >= 2 and _in_any(ip, allowlist)) + + flows = [] # (local day index, local minute, dst, mb) + for _ in range(n_flows): + day = rng.randrange(7) + minute = rng.randint(start_h * 60, end_h * 60 - 1) if rng.random() < 0.65 else rng.randrange(1440) + dst = rng.choice(cloud) + if level >= 2 and rng.random() < 0.12: + dst = f"10.{rng.randint(0, 9)}.{rng.randint(0, 20)}.{rng.randint(2, 254)}" + r = rng.random() + mb = rng.randint(threshold + 1, threshold * 4) if r < 0.12 else rng.randint(0, int(threshold * 0.8)) + flows.append([day, minute, dst, mb]) + # boundary rows: exactly the threshold off hours (not flagged), starting at closing time (flagged), + # starting at opening time (not flagged) + plain = [c for c in cloud if not approved(c)] + flows += [[rng.randrange(5), start_h * 60 - rng.randint(1, 30), rng.choice(plain), threshold], + [rng.randrange(5), end_h * 60, rng.choice(plain), threshold + rng.randint(1, 40)], + [rng.randrange(5), start_h * 60, rng.choice(plain), threshold + rng.randint(1, 40)]] + + def off_hours(day, minute): + return DAYS[day % 7] not in bdays or not (start_h * 60 <= minute < end_h * 60) + + def flagged(f, clock=None, internal_rule=True, cidr=True): + day, minute, dst, mb = f + if clock is not None: + day, minute = clock // 1440, clock % 1440 + ok_dst = dst in allowed_ips or (level >= 2 and cidr and _in_any(dst, allowlist)) + inside = level >= 2 and internal_rule and _in_any(dst, internal) + return mb > threshold and not ok_dst and not inside and off_hours(day, minute) + + # display time: local for L1-L2, UTC for L3 (local = utc + offset) + shown = [] + for f in flows: + utc = (f[0] * 1440 + f[1] - offset * 60) % (7 * 1440) + shown.append((utc, f)) + shown.sort(key=lambda x: x[0]) + fid, rows, want = rng.randint(100, 199), [], [] + for utc, f in shown: + fid += rng.randint(1, 3) + rows.append(f"{fid},{DAYS[utc // 1440]},{_hm(utc % 1440)},{f[2]},{f[3]}") + if flagged(f): + want.append(fid) + big_off = [f for f in flows if f[3] > threshold and not flagged(f)] + ok = 4 <= len(want) <= 14 and len(big_off) >= 4 + if level >= 2: # ignoring the internal networks or the CIDR entries must change the answer + ok = ok and any(flagged(f, internal_rule=False) != flagged(f) for f in flows) + ok = ok and any(flagged(f, cidr=False) != flagged(f) for f in flows) + if level == 3: # judging on the UTC clock must change the answer + ok = ok and sum(flagged(f, clock=utc) != flagged(f) for utc, f in shown) >= 2 + if ok: + break + policy = {"threshold_mb": threshold, "business_days": bdays, + "business_hours": [f"{start_h:02d}:00", f"{end_h:02d}:00"]} + if level >= 2: + policy["internal_networks"] = internal + if level == 3: + policy["office_utc_offset_hours"] = offset + else: + policy["allowlist"] = allowlist + files = {"flows.csv": "flow,day,time,dst,mb_out\n" + "\n".join(rows) + "\n", + "policy.json": json.dumps(policy, indent=2) + "\n"} + if level == 1: + policy_text = "threshold_mb, business_days, business_hours as [start, end] and allowlist, the approved remote addresses" + elif level == 2: + policy_text = ("threshold_mb, business_days, business_hours as [start, end] and allowlist, the approved remote " + "destinations (addresses or CIDR networks)") + else: + files["allowlist.txt"] = "# approved remote destinations, one address or CIDR network per line\n" + "".join( + f"{a}\n" for a in allowlist) + policy_text = ("threshold_mb, business_days and business_hours as [start, end]; the approved remote destinations " + "are in /root/allowlist.txt, one address or CIDR network per line") + if level >= 2: + readme = ("# Collector notes\n\nThe collector also records traffic between internal machines. A flow whose dst " + "is inside one of policy.json's internal_networks is not outbound and never alerts.\n") + if level == 3: + readme += ("\nThe collector writes day and time in UTC. Business days and hours in policy.json are office " + "local time, which is UTC plus office_utc_offset_hours; convert before checking, which can " + "change the day.\n") + files["README.md"] = readme + opener = rng.choice([ + "You are hunting for data exfiltration in last week's outbound traffic from an office network.", + "Security suspects that someone copied data out of the office network after hours last week.", + ]) + notes = " Collector notes are in /root/README.md." if level >= 2 else "" + instruction = ( + f"{opener} The flow summary is /root/flows.csv with the columns flow (an integer id), day (Mon to Sun), time " + "(HH:MM, when the flow started), dst (the remote IP) and mb_out (whole megabytes sent). The policy file " + f"/root/policy.json gives {policy_text}.{notes}\n\n" + "Flag a flow when all three hold:\n" + "1. mb_out is greater than threshold_mb; equal is not flagged.\n" + "2. dst is not an approved destination.\n" + "3. It started outside business hours: on a day not in business_days, or before start, or at or after end.\n\n" + "Write the flagged flow ids to /root/alerts.json as a JSON array of integers sorted ascending, for example " + "`[104, 187, 203]`." + ) + + def is_int_list(p): + return isinstance(p, list) and all(isinstance(x, int) and not isinstance(x, bool) for x in p) + + want_set = set(want) + return Built( + instruction=instruction, + files=files, + artifact=Artifact( + path="alerts.json", kind="checks", parse="json", + checks=[ + ("test_is_int_list", is_int_list), + ("test_sorted_unique", lambda p: p == sorted(set(p))), + ("test_no_false_positives", lambda p: set(p) <= want_set), + ("test_no_missed_alerts", lambda p: want_set <= set(p)), + ], + render=lambda: json.dumps(want) + "\n", + ), + root=ROOT, + notes={"alerts": want, "threshold_mb": threshold}, + ) + + +FAMILIES = [ + Family("sec3_auth_triage", "cybersecurity", "Block SSH brute-force sources", build_auth, v3=True), + Family("sec3_fw_verdicts", "cybersecurity", "Evaluate an ordered firewall rule table", build_fw, v3=True), + Family("sec3_exfil_flows", "cybersecurity", "Flag off-hours exfiltration flows", build_exfil, v3=True), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/software.py b/components/dnakhla/upstream/terminal_desk/families/software.py new file mode 100644 index 0000000000000000000000000000000000000000..9ec1fc55119e6608e1a75deed0d5489660b01d1d --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/software.py @@ -0,0 +1,388 @@ +"""Software engineering: repair a small module against hidden tests; resolve package versions.""" + +import itertools +import json +import os +import random +import shutil +import tempfile + +from ..core import shell +from .base import Artifact, Built, Family + +# ---------------------------------------------------------------- sw_fix + +FUNCS = { + "median": { + "src": '''def median(values): + """Median of a non-empty list of numbers; for an even count, the mean of the two middle values.""" + s = sorted(values) + n = len(s) + mid = n // 2 + if n % 2 == 1: + return s[mid] + return (s[mid - 1] + s[mid]) / 2 +''', + "bugs": [("return (s[mid - 1] + s[mid]) / 2", "return s[mid]"), ("s = sorted(values)", "s = list(values)")], + "gen": lambda r: ([r.randint(-40, 40) for _ in range(r.randint(1, 9))],), + }, + "clamp": { + "src": '''def clamp(x, lo, hi): + """Limit x to the closed range [lo, hi] (lo <= hi).""" + if x < lo: + return lo + if x > hi: + return hi + return x +''', + "bugs": [(" return hi\n", " return lo\n"), ("if x < lo:", "if x <= lo + 1:")], + "gen": lambda r: (r.randint(-20, 20), r.randint(-10, 0), r.randint(1, 10)), + }, + "moving_average": { + "src": '''def moving_average(values, k): + """Means of every window of k consecutive values, in order: len(values) - k + 1 results.""" + return [sum(values[i:i + k]) / k for i in range(len(values) - k + 1)] +''', + "bugs": [("range(len(values) - k + 1)", "range(len(values) - k)"), ("sum(values[i:i + k]) / k", "sum(values[i:i + k]) / len(values)")], + "gen": lambda r: (lambda v: (v, r.randint(1, len(v))))([r.randint(0, 50) for _ in range(r.randint(3, 10))]), + }, + "percent_change": { + "src": '''def percent_change(old, new): + """Percent change from old to new (old != 0), rounded to 2 decimals.""" + return round((new - old) / old * 100, 2) +''', + "bugs": [("(new - old) / old", "(new - old) / new"), ("round((new - old) / old * 100, 2)", "round((new - old) / old, 2) * 100")], + "gen": lambda r: (r.randint(1, 500), r.randint(1, 500)), + }, + "chunk": { + "src": '''def chunk(items, size): + """Split items into consecutive lists of length size; the last list may be shorter.""" + return [items[i:i + size] for i in range(0, len(items), size)] +''', + "bugs": [("range(0, len(items), size)", "range(0, len(items) - size + 1, size)"), ("items[i:i + size]", "items[i:i + size - 1] or items[i:i + 1]")], + "gen": lambda r: ([r.randint(0, 9) for _ in range(r.randint(0, 12))], r.randint(2, 5)), + }, + "is_leap": { + "src": '''def is_leap(year): + """True for Gregorian leap years.""" + return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) +''', + "bugs": [("(year % 100 != 0 or year % 400 == 0)", "year % 100 != 0"), ("year % 4 == 0 and", "year % 4 == 0 or")], + "gen": lambda r: (r.choice([r.randint(1582, 2400), r.choice([1600, 1700, 1800, 1900, 2000, 2100, 2400])]),), + }, + "dedupe": { + "src": '''def dedupe(items): + """Remove repeats, keeping the first occurrence of each item, in original order.""" + seen = set() + out = [] + for item in items: + if item not in seen: + seen.add(item) + out.append(item) + return out +''', + "bugs": [(" if item not in seen:\n seen.add(item)\n out.append(item)\n return out", " seen.add(item)\n return sorted(seen)"), (" out.append(item)\n return out", " out.insert(0, item)\n return out")], + "gen": lambda r: ([r.randint(0, 6) for _ in range(r.randint(0, 10))],), + }, + "overlap": { + "src": '''def overlap(a_start, a_end, b_start, b_end): + """Length of the overlap of [a_start, a_end] and [b_start, b_end]; 0 when they do not overlap.""" + return max(0, min(a_end, b_end) - max(a_start, b_start)) +''', + "bugs": [("max(0, min(a_end, b_end) - max(a_start, b_start))", "abs(min(a_end, b_end) - max(a_start, b_start))"), ("min(a_end, b_end) - max(a_start, b_start)", "min(a_end, b_end) - min(a_start, b_start)")], + "gen": lambda r: (lambda a, b: (a, a + r.randint(0, 10), b, b + r.randint(0, 10)))(r.randint(0, 15), r.randint(0, 15)), + }, + "word_count": { + "src": '''def word_count(text): + """Count words case-insensitively. A word is a run of letters a-z. Returns {word: count}.""" + counts = {} + for word in re.findall(r"[a-z]+", text.lower()): + counts[word] = counts.get(word, 0) + 1 + return counts +''', + "bugs": [("text.lower()", "text"), ('r"[a-z]+"', 'r"[a-z]+ "')], + "gen": lambda r: (" ".join(r.choice(["Red", "red", "blue", "Blue", "GREEN", "green,", "red.", "x-ray"]) for _ in range(r.randint(1, 8))),), + }, + "to_seconds": { + "src": '''def to_seconds(clock): + """Seconds in a 'H:MM:SS' or 'MM:SS' string.""" + total = 0 + for part in clock.split(":"): + total = total * 60 + int(part) + return total +''', + "bugs": [('clock.split(":")', 'reversed(clock.split(":"))'), ("total * 60 + int(part)", "total * 100 + int(part)")], + "gen": lambda r: (r.choice([f"{r.randint(0, 9)}:{r.randint(0, 59):02d}:{r.randint(0, 59):02d}", f"{r.randint(0, 59):02d}:{r.randint(0, 59):02d}"]),), + }, +} + +HEADER = '"""toolkit: small helpers used by the reporting jobs."""\n\nimport re\n\n\n' + +HARNESS = r''' +import json, sys +sys.path.insert(0, sys.argv[1]) +cases = json.loads(sys.stdin.read()) +out = {} +try: + import toolkit +except BaseException as exc: + print("@@RESULT@@" + json.dumps({"import_error": type(exc).__name__})) + raise SystemExit(0) +for name, arglists in cases.items(): + res = [] + for args in arglists: + try: + res.append(getattr(toolkit, name)(*args)) + except BaseException as exc: + res.append({"__error__": type(exc).__name__}) + out[name] = res +print("@@RESULT@@" + json.dumps(out, default=repr)) +''' + + +def _compile(src: str): + ns: dict = {} + exec("import re\n" + src, ns) # noqa: S102 - our own fixed templates + return next(v for k, v in ns.items() if callable(v) and k != "re" and not k.startswith("__")) + + +def _jsonable(x): + return json.loads(json.dumps(x)) + + +def _same(a, b) -> bool: + if isinstance(a, float) or isinstance(b, float): + try: + return abs(float(a) - float(b)) <= 1e-9 + except (TypeError, ValueError): + return False + if isinstance(a, list) and isinstance(b, list): + return len(a) == len(b) and all(_same(x, y) for x, y in zip(a, b)) + if isinstance(a, dict) and isinstance(b, dict): + return a.keys() == b.keys() and all(_same(a[k], b[k]) for k in a) + return type(a) is type(b) and a == b + + +def _differs(good, bad, args) -> bool: + try: + b = bad(*args) + except Exception: + return True + return not _same(_jsonable(good(*args)), _jsonable(b)) + + +def build_fix(level: int, rng: random.Random) -> Built: + n_funcs, n_bugs = {1: (3, 1), 2: (4, 2), 3: (5, 2)}[level] + names = rng.sample(sorted(FUNCS), n_funcs) + buggy = set(rng.sample(names, n_bugs)) + shown = rng.choice(sorted(buggy)) # the one bug with a failing visible test + sources, good_sources, hidden, tests = [], [], {}, [] + for name in names: + spec = FUNCS[name] + good = _compile(spec["src"]) + src = spec["src"] + bad = None + if name in buggy: + old, new = rng.choice(spec["bugs"]) + assert old in src, (name, old) + src = src.replace(old, new, 1) + bad = _compile(src) + sources.append(src) + good_sources.append(spec["src"]) + cases = [spec["gen"](rng) for _ in range(40)] + if bad is not None: + diffs = [c for c in cases if _differs(good, bad, c)] + while len(diffs) < 3: + c = spec["gen"](rng) + if _differs(good, bad, c): + diffs.append(c) + cases.append(c) + hidden[name] = (_jsonable([list(c) for c in cases]), _jsonable([good(*c) for c in cases])) + # Visible tests: two passing cases for correct functions, one failing case for `shown`. + if name == shown: + c = next(c for c in cases if _differs(good, bad, c)) + tests.append((name, c, good(*c))) + elif name not in buggy: + for c in cases[:2]: + tests.append((name, c, good(*c))) + module = HEADER + "\n\n".join(sources) + test_lines = [ + "import os, sys, unittest", + "sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'src'))", + "import toolkit", + "", + "", + "class ToolkitTest(unittest.TestCase):", + ] + for i, (name, args, want) in enumerate(tests): + test_lines += [ + f" def test_{name}_{i}(self):", + f" self.assertEqual(toolkit.{name}(*{list(args)!r}), {want!r})", + "", + ] + test_lines += ["", 'if __name__ == "__main__":', " unittest.main()", ""] + readme = ( + "toolkit.py feeds the nightly reports. Each function's docstring is its specification.\n" + "Run the tests from /work with: python3 -m unittest discover -s tests -v\n" + ) + if level >= 2: + readme += "The visible tests are incomplete: a function can be wrong and still pass them.\n" + + def verify(app: str) -> bool: + from ..core.grading import read_artifact + + source = read_artifact(app, "src/toolkit.py") # lstat-guarded: a planted link is not followed + if source is None: + return False + tmp = tempfile.mkdtemp(prefix="tdchk-") + try: + os.chmod(tmp, 0o755) + src_dir = os.path.join(tmp, "src") + os.mkdir(src_dir) + with open(os.path.join(src_dir, "toolkit.py"), "wb") as fh: + fh.write(source) + with open(os.path.join(tmp, "harness.py"), "w") as fh: + fh.write(HARNESS) + shell.give_to_nobody(tmp) + payload = json.dumps({n: args for n, (args, _) in hidden.items()}) + _, text = shell.run(["python3", "-I", os.path.join(tmp, "harness.py"), src_dir], tmp, stdin_text=payload) + lines = [ln for ln in text.splitlines() if ln.startswith("@@RESULT@@")] + if not lines: + return False + got = json.loads(lines[-1][len("@@RESULT@@"):]) + return all(name in got and _same(got[name], want) for name, (_, want) in hidden.items()) + finally: + shell.kill_nobody() + shutil.rmtree(tmp, ignore_errors=True) + + oracle = HEADER + "\n\n".join(good_sources) + instruction = ( + f"src/toolkit.py has {n_funcs} functions, and {'one does not do what its docstring says' if n_bugs == 1 else f'{n_bugs} do not do what their docstrings say'}. Fix the module in place in /app/src/toolkit.py so that every function matches its " + "docstring, and keep the function names and signatures. The tests in tests/ are visible but incomplete: " + "the grader runs hidden tests against the edited file." + ) + return Built( + instruction=instruction, + files={"src/toolkit.py": module, "tests/test_toolkit.py": "\n".join(test_lines), "README.md": readme}, + artifact=Artifact(path="src/toolkit.py", kind="custom", verify=verify, render=lambda: oracle), + notes={"oracle_files": {"src/toolkit.py": oracle}, "buggy": sorted(buggy)}, + ) + + +# ---------------------------------------------------------------- sw_deps + +PKG_NAMES = ["acorn", "birch", "cedar", "dahlia", "ember", "fennel", "garnet", "hazel"] + + +def _vkey(v: str) -> tuple: + return tuple(int(p) for p in v.split(".")) + + +def _versions(rng: random.Random, n: int) -> list[str]: + out, major, minor = [], 1, 0 + for _ in range(n): + out.append(f"{major}.{minor}") + if rng.random() < 0.3: + major, minor = major + 1, 0 + else: + minor += rng.randint(1, 2) + return out + + +def _constraint(rng: random.Random, versions: list[str]) -> tuple: + """(lo inclusive or None, hi exclusive or None), never empty over versions.""" + i, j = sorted(rng.sample(range(len(versions) + 1), 2)) + lo = versions[i] if i > 0 else None + hi = versions[j] if j < len(versions) else None + if lo is None and hi is None: + lo = versions[1] + return lo, hi + + +def _fmt(name: str, c: tuple) -> str: + lo, hi = c + parts = ([f">={lo}"] if lo else []) + ([f"<{hi}"] if hi else []) + return name + ",".join(parts) + + +def _ok(v: str, c: tuple) -> bool: + lo, hi = c + return (lo is None or _vkey(v) >= _vkey(lo)) and (hi is None or _vkey(v) < _vkey(hi)) + + +def build_deps(level: int, rng: random.Random) -> Built: + n_pkg, n_ver = {1: (3, 3), 2: (5, 4), 3: (6, 3)}[level] + while True: + pkgs = sorted(rng.sample(PKG_NAMES, n_pkg)) + vers = {p: _versions(rng, n_ver) for p in pkgs} + reqs = {} + for p in pkgs: + for v in vers[p]: + others = [q for q in pkgs if q != p and rng.random() < {1: 0.45, 2: 0.4, 3: 0.22}[level]] + reqs[(p, v)] = {q: _constraint(rng, vers[q]) for q in others} + root = {p: _constraint(rng, vers[p]) for p in pkgs if rng.random() < 0.5} + order = rng.sample(pkgs, n_pkg) + + def solve(yanked): + valid = [] + for combo in itertools.product(*(vers[p] for p in pkgs)): + pick = dict(zip(pkgs, combo)) + if any((p, v) in yanked for p, v in pick.items()): + continue + if not all(_ok(pick[p], c) for p, c in root.items()): + continue + if all(_ok(pick[q], c) for p in pkgs for q, c in reqs[(p, pick[p])].items()): + valid.append(pick) + best = max(valid, key=lambda pk: tuple(_vkey(pk[p]) for p in order)) if valid else None + return valid, best + + yanked = set() + valid, best = solve(yanked) + if level == 3 and best: + # Yank a release the unyanked optimum would pick, so yanked.txt matters. + target = rng.choice(pkgs) + yanked = {(target, best[target])} | {(p, rng.choice(vers[p])) for p in rng.sample(pkgs, 2)} + valid, best = solve(yanked) + if len(valid) < 2 or best == {p: vers[p][-1] for p in pkgs}: + continue + break + lines = [] + for p in pkgs: + lines.append(p) + for v in vers[p]: + r = reqs[(p, v)] + need = "; ".join(_fmt(q, c) for q, c in sorted(r.items())) or "(no requirements)" + lines.append(f" {v}: {need}") + app = ( + "The app installs every package in index.txt, one version each.\n" + f"App constraints: {'; '.join(_fmt(p, c) for p, c in sorted(root.items())) or '(none)'}\n" + f"Preference order: {', '.join(order)}\n" + ) + files = {"index.txt": "\n".join(lines) + "\n", "app.txt": app} + if yanked: + files["yanked.txt"] = ( + "These releases were yanked and must not be installed:\n" + + "\n".join(f"{p} {v}" for p, v in sorted(yanked)) + + "\n" + ) + instruction = ( + "index.txt lists every package with its versions and what each version requires, and app.txt gives the " + "app constraints and a preference order. Pick one version of every package so the app constraints and " + "the requirements of every picked version all hold. '>=X' means at least X, ' 1.9). Among all valid picks, " + "take the highest version of the first package in the preference order, then of the second, and so on." + + (" Never pick a release listed in yanked.txt." if yanked else "") + + " Write /app/lock.txt with one name==version line per package, for example acorn==1.2, and nothing else." + ) + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="lock.txt", kind="lines", expected=[f"{p}=={best[p]}" for p in pkgs]), + notes={"valid_count": len(valid)}, + ) + + +FAMILIES = [ + Family("sw_fix", "software engineering", "Repair a module against hidden tests", build_fix), + Family("sw_deps", "software engineering", "Resolve package versions", build_deps), +] diff --git a/components/dnakhla/upstream/terminal_desk/families/software3.py b/components/dnakhla/upstream/terminal_desk/families/software3.py new file mode 100644 index 0000000000000000000000000000000000000000..e843a95ea6beac95b6f7f0a7c3ba5047fc1540b7 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/families/software3.py @@ -0,0 +1,665 @@ +"""Software engineering v3: repair a module against hidden tests, replay a token-bucket limiter, +resolve a lock file against a package index. All three are stdlib-only.""" + +import datetime +import itertools +import json +import os +import random +import shutil +import tempfile + +from ..core import shell +from .base import Artifact, Built, Family +from .software import FUNCS, _compile, _jsonable, _same + +# ---------------------------------------------------------------- sw3_rate_limit + +RL_OPENERS = ( + "Our gateway's token-bucket limiter rejected the wrong requests during last night's incident.", + "A customer says our gateway's rate limiter dropped requests it should have served.", + "Nobody trusts the rejection log of our gateway's token-bucket limiter after an incident.", +) + + +def _rl_tiers(rng: random.Random) -> dict: + return { + "free": {"capacity": rng.randint(5, 12), "refill_per_sec": round(rng.uniform(0.4, 1.2), 1)}, + "pro": {"capacity": rng.randint(15, 30), "refill_per_sec": round(rng.uniform(1.0, 2.5), 1)}, + "batch": {"capacity": rng.randint(30, 60), "refill_per_sec": round(rng.uniform(0.3, 0.9), 1)}, + } + + +def _rl_replay(reqs, tiers, key_tier, default, exempt, change, *, file_order=False, ignore_exempt=False, + ignore_change=False, charge_rejects=False, whole_seconds=False, unit_cost=False): + """Rejected ids, and the smallest |tokens - cost| over decisions whose token count is inexact (and + |refilled - capacity| over refills), so float evaluation order cannot flip a decision. + Keyword flags replay the common mistakes so the generator can insist each one changes the answer.""" + order = list(reqs) if file_order else sorted(reqs, key=lambda r: (r["ms"], r["id"])) + buckets, rejected, margin = {}, [], float("inf") + for r in order: + key = r["key"] + if key in exempt and not ignore_exempt: + continue + tier = key_tier.get(key, default) + cap, rate = tiers[tier]["capacity"], tiers[tier]["refill_per_sec"] + if change and not ignore_change and tier == change["tier"] and r["ms"] >= change["ms"]: + cap, rate = change["capacity"], change["refill_per_sec"] + ts = r["ms"] / 1000 + if key not in buckets: + tokens, exact = float(cap), True + else: + tokens, last, exact = buckets[key] + gap = ts - last + if whole_seconds: + gap = float(int(gap)) + refilled = tokens + gap * rate + if gap != 0: # a refill that lands within float noise of capacity could clip either way + margin = min(margin, abs(refilled - cap)) + if refilled >= cap: + tokens, exact = float(cap), True + elif gap != 0: + tokens, exact = refilled, False + cost = 1 if unit_cost else r["cost"] + if not exact: + margin = min(margin, abs(tokens - cost)) + if tokens >= cost: + tokens -= cost + else: + rejected.append(r["id"]) + if charge_rejects: + tokens = max(0.0, tokens - cost) + buckets[key] = (tokens, ts, exact) + return sorted(rejected), margin + + +def build_rate_limit(level: int, rng: random.Random) -> Built: + n_req = {1: (400, 550), 2: (600, 800), 3: (700, 900)}[level] + n_keys = {1: (6, 8), 2: (8, 10), 3: (9, 11)}[level] + while True: + keys = sorted({f"k-{rng.randrange(16 ** 4):04x}" for _ in range(rng.randint(*n_keys))}) + hot = rng.sample(keys, 4) + weights = [rng.uniform(4, 7) if k in hot else rng.uniform(0.3, 1.0) for k in keys] + tiers = _rl_tiers(rng) + key_tier = {k: rng.choice(sorted(tiers)) for k in keys} + default, exempt, change = "free", set(), None + if level >= 2: + unmapped = rng.sample([k for k in keys if k not in hot[:1]], 2) + for k in unmapped: + del key_tier[k] + default = rng.choice(sorted(tiers)) + exempt = {hot[0]} | ({rng.choice([k for k in keys if k not in hot])} if rng.random() < 0.5 else set()) + base, ms, reqs = rng.randint(100000, 899999), 0, [] + rate = rng.uniform(4.0, 6.0) + for i in range(rng.randint(*n_req)): + ms += max(1, int(rng.expovariate(rate) * 1000)) + key = rng.choices(keys, weights)[0] + reqs.append({"id": base + i, "ms": ms, "key": key, "cost": rng.choice((1, 1, 1, 2, 3, 5))}) + if level >= 3: + tier = key_tier.get(hot[1], default) + old = tiers[tier] + change = {"tier": tier, "ms": reqs[len(reqs) // 2 + rng.randint(-60, 60)]["ms"], + "capacity": max(5, old["capacity"] + rng.choice((-1, 1)) * rng.randint(3, 8)), + "refill_per_sec": round(max(0.3, old["refill_per_sec"] * rng.uniform(0.4, 0.7)), 1)} + file_reqs = list(reqs) + if level >= 2: # gateway arrival order: some same-key pairs land out of ts order + i = rng.randint(5, 15) + while i < len(file_reqs) - 6: + j = next((j for j in range(i + 1, i + 6) if file_reqs[j]["key"] == file_reqs[i]["key"]), None) + if j is not None: + file_reqs[i], file_reqs[j] = file_reqs[j], file_reqs[i] + i += rng.randint(25, 40) + args = (file_reqs, tiers, key_tier, default, exempt, change) + want, margin = _rl_replay(*args) + if margin < 1e-4 or not 0.05 <= len(want) / len(reqs) <= 0.30: + continue + traps = [dict(charge_rejects=True), dict(whole_seconds=True), dict(unit_cost=True)] + if level >= 2: + traps += [dict(file_order=True), dict(ignore_exempt=True)] + if level >= 3: + traps.append(dict(ignore_change=True)) + if all(_rl_replay(*args, **t)[0] != want for t in traps): + break + exempt_ids = {r["id"] for r in reqs if r["key"] in exempt} + example = sorted(rng.sample([r["id"] for r in reqs if r["id"] not in set(want)], 2)) + csv_lines = ["id,ts,key,cost"] + [f"{r['id']},{r['ms'] / 1000:.3f},{r['key']},{r['cost']}" for r in file_reqs] + limits = {"tiers": tiers, "keys": dict(sorted(key_tier.items()))} + if level >= 2: + limits["default_tier"] = default + limits["exempt_keys"] = sorted(exempt) + files = {"requests.csv": "\n".join(csv_lines) + "\n", "limits.json": json.dumps(limits, indent=2) + "\n"} + inputs = ("- /root/requests.csv: id, ts (seconds, millisecond precision), key and cost (tokens needed) for " + "each request.\n- /root/limits.json: the tiers (capacity, refill_per_sec) and the key-to-tier map.") + rules = ["Each key has its own bucket, full (its tier's capacity) at the key's first request."] + if level == 1: + inputs += "\n" + rules.append("Process requests in ts order.") + else: + inputs += " Unmapped keys use default_tier; exempt_keys are never limited.\n" + rules.append("Process requests in ts order, ties by id (the file is not always in ts order).") + if level >= 3: + inputs += "- /root/CHANGE_NOTICE.md: a tier change made mid-capture.\n" + t = change["ms"] / 1000 + files["CHANGE_NOTICE.md"] = ( + "# Limiter config change\n\n" + f"From ts {t:.3f} onward the {change['tier']} tier is capacity {change['capacity']}, refill_per_sec " + f"{change['refill_per_sec']}. Requests before that time use the old values. Refill for a gap that spans " + "the change uses the new rate, and stored tokens above the new capacity are clipped the next time the " + "key is seen.\n" + ) + rules += [ + "Before each request, refill: tokens = min(capacity, tokens + seconds since the key's previous request " + "x refill_per_sec).", + "If tokens >= cost, accept and subtract cost; otherwise reject without consuming anything.", + ] + instruction = ( + rng.choice(RL_OPENERS) + " Replay the traffic and find which requests should have been rejected.\n\n" + "Inputs:\n" + inputs + "\nRules:\n" + "".join(f"{i}. {r}\n" for i, r in enumerate(rules, 1)) + + "\nWrite /root/rejected.json: the rejected ids as a JSON array of integers, sorted ascending, " + f"e.g. [{example[0]}, {example[1]}]." + ) + want_set = set(want) + checks = [ + ("test_is_list", lambda p: isinstance(p, list)), + ("test_items_are_ints", lambda p: all(type(x) is int for x in p)), + ("test_sorted_unique", lambda p: all(a < b for a, b in zip(p, p[1:]))), + ] + if exempt_ids: + checks.append(("test_no_exempt_ids", lambda p: not exempt_ids & set(p))) + checks += [ + ("test_rejected_count", lambda p: len(p) == len(want)), + ("test_rejected_ids", lambda p: p == want and set(p) == want_set), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="rejected.json", kind="checks", parse="json", checks=checks, + render=lambda: json.dumps(want) + "\n"), + notes={"rejected": len(want), "requests": len(reqs)}, + root="/root", + ) + + +# ---------------------------------------------------------------- sw3_dep_lock + +PKG_POOL = ( + "acorn", "alder", "amber", "aspen", "basil", "birch", "bramble", "briar", "cedar", "clover", "cobalt", "coral", + "cypress", "dahlia", "ember", "fennel", "fern", "flint", "garnet", "ginger", "hazel", "heather", "hemlock", + "indigo", "iris", "ivy", "jasper", "juniper", "kelp", "larch", "laurel", "lichen", "linden", "maple", "marble", + "moss", "nettle", "obsidian", "onyx", "opal", "pebble", "quartz", "reed", "rowan", "saffron", "sage", "slate", + "sorrel", "spruce", "tansy", "thistle", "willow", "yarrow", "zinnia", +) +DL_OPENERS = ( + "The lock file for our build went stale when the internal package mirror was refreshed.", + "Our release pipeline will not build until the lock file is regenerated against the new package index.", + "A dependency bump broke our build, and the lock file must be regenerated from the package index.", +) + + +def _vkey(v: str) -> tuple: + return tuple(int(p) for p in v.split(".")) + + +def _dl_versions(rng: random.Random, n: int, wide: bool) -> list[str]: + """n ascending major.minor versions with single-digit minors; wide=True forces one jump to a minor of 10+.""" + major, minor, out = rng.randint(0, 3), rng.randint(0, 4), [] + for i in range(n): + out.append(f"{major}.{minor}") + if wide and i == n // 2 - 1: + minor = 10 + rng.randint(0, 3) + if minor <= int(out[-1].split(".")[1]): + minor = int(out[-1].split(".")[1]) + 1 + continue + minor += rng.randint(1, 3) + if rng.random() < 0.25 or minor > 9: # minors of 10+ come only from the wide jump above + major, minor = major + 1, 0 + return out + + +def _dl_spec(rng: random.Random, versions: list[str], ne: bool) -> list[tuple]: + """A constraint as [(op, version)], never empty over `versions`.""" + while True: + i, j = sorted(rng.sample(range(len(versions) + 1), 2)) + spec = ([(">=", versions[i])] if i > 0 else []) + ([("<", versions[j])] if j < len(versions) else []) + if ne and rng.random() < 0.35: + spec = spec[:1] + [("!=", rng.choice(versions))] + if spec and any(_dl_ok(v, spec) for v in versions): + return spec + + +def _dl_ok(v: str, spec, key=_vkey) -> bool: + ops = {">=": lambda a, b: a >= b, "<": lambda a, b: a < b, "!=": lambda a, b: a != b, "==": lambda a, b: a == b} + return all(ops[op](key(v), key(w)) for op, w in spec) + + +def _dl_fmt(spec) -> str: + return ",".join(f"{op}{w}" for op, w in spec) + + +def _dl_solve(pkgs, vers, reqs, top, yanked, key=_vkey, cap=50): + """Valid picks (one version per package; counted up to `cap`) and the preferred one: the newest version of + pkgs[0], then of pkgs[1], ... Depth-first, newest first, so the first complete pick is the preferred one.""" + found = [] + + def fits(pick, p, v): + if (p, v) in yanked or (p in top and not _dl_ok(v, top[p], key)): + return False + mine = reqs[(p, v)] + return all(not (q in mine and not _dl_ok(w, mine[q], key)) + and not (p in reqs[(q, w)] and not _dl_ok(v, reqs[(q, w)][p], key)) for q, w in pick.items()) + + def walk(i, pick): + if len(found) >= cap: + return + if i == len(pkgs): + found.append(dict(pick)) + return + p = pkgs[i] + for v in sorted(vers[p], key=key, reverse=True): + if fits(pick, p, v): + pick[p] = v + walk(i + 1, pick) + del pick[p] + + walk(0, {}) + return found, (found[0] if found else None) + + +def _strkey(v: str) -> tuple: + return tuple(v.split(".")) # the common mistake: comparing version parts as strings + + +def build_dep_lock(level: int, rng: random.Random) -> Built: + n_pkg, n_ver, n_noise = {1: (4, (3, 4), 36), 2: (5, (4, 5), 38), 3: (6, (3, 4), 40)}[level] + dep_p = {1: 0.4, 2: 0.35, 3: 0.3}[level] + names = rng.sample(PKG_POOL, n_pkg + n_noise) + pkgs, noise = names[:n_pkg], names[n_pkg:] + while True: # only the requested packages decide the answer; the mirror's other packages come after + wide = set(rng.sample(pkgs, 2)) if level >= 2 else set() + vers = {p: _dl_versions(rng, rng.randint(*n_ver), p in wide) for p in pkgs} + reqs = {} + for p in pkgs: + for v in vers[p]: + reqs[(p, v)] = {q: _dl_spec(rng, vers[q], level >= 2) for q in pkgs if q != p and rng.random() < dep_p} + top = {p: _dl_spec(rng, vers[p], False) for p in pkgs if rng.random() < 0.5} + valid, best = _dl_solve(pkgs, vers, reqs, top, set()) + yanked = set() + if level >= 3 and best: + target = rng.choice(pkgs) + yanked = {(target, best[target])} + yanked |= {(p, rng.choice(vers[p])) for p in rng.sample(pkgs, 2)} + valid, best = _dl_solve(pkgs, vers, reqs, top, yanked) + if not best or len(valid) < 3: + continue + newest = {p: max(vers[p], key=_vkey) for p in pkgs} + if best == newest: + continue + if level >= 2 and _dl_solve(pkgs, vers, reqs, top, yanked, key=_strkey)[1] == best: + continue + if level >= 3 and _dl_solve(pkgs, vers, reqs, top, set())[1] == best: + continue + break + for p in noise: + vers[p] = _dl_versions(rng, rng.randint(*n_ver), False) + for p in noise: + pool = [q for q in names if q != p] + for v in vers[p]: + deps = rng.sample(pool, rng.choice((0, 0, 1, 1, 2))) + reqs[(p, v)] = {q: _dl_spec(rng, vers[q], level >= 2) for q in deps} + if level >= 3: + yanked |= {(p, rng.choice(vers[p])) for p in rng.sample(noise, 2)} + index = ["# package version requires (';'-separated, '-' for none)"] + for p in sorted(names): + for v in vers[p]: + r = reqs[(p, v)] + index.append(f"{p} {v} " + (";".join(f"{q}{_dl_fmt(s)}" for q, s in sorted(r.items())) or "-")) + manifest = [f"{p}{_dl_fmt(top[p])}" if p in top else p for p in pkgs] + files = {"index.txt": "\n".join(index) + "\n", "requirements.txt": "\n".join(manifest) + "\n"} + ops = "'>=X' means at least X, '= 2: + ops += ", '!=X' anything but X" + ops += ", and a comma joins conditions" + extra = "" + if level >= 2: + extra = " Versions compare by major, then minor, as numbers (1.10 is newer than 1.9)." + if level >= 3: + files["yanked.txt"] = ("# yanked releases: never install these\n" + + "".join(f"{p} {v}\n" for p, v in sorted(yanked))) + extra += " Never pick a release listed in /root/yanked.txt." + instruction = ( + rng.choice(DL_OPENERS) + "\n\n" + "/root/requirements.txt names the packages to install, in priority order, some with a version condition. " + "/root/index.txt lists every release in the mirror, one per line: package, version, and what it requires. " + "Most mirror packages are unused; releases of the packages you install only require each other.\n\n" + "Pick one version of each package in requirements.txt so that its conditions and the requirements of " + f"every picked release hold ({ops}).{extra} Among all valid picks, take the newest version of the first " + "package in requirements.txt, then of the second, and so on.\n\n" + "Write /root/lock.txt with one name==version line per package, sorted by name, for example " + f"{rng.choice(noise)}==2.4, and nothing else." + ) + want = [f"{p}=={best[p]}" for p in sorted(pkgs)] + + def lock(lines): + return dict(ln.split("==", 1) for ln in lines) + + def satisfies(lines): + pick = lock(lines) + return (all(_dl_ok(pick[p], s) for p, s in top.items()) + and all(_dl_ok(pick[q], s) for p in pkgs for q, s in reqs[(p, pick[p])].items()) + and not any((p, v) in yanked for p, v in pick.items())) + + checks = [ + ("test_line_format", lambda p: all(ln.count("==") == 1 and " " not in ln for ln in p)), + ("test_one_line_per_package", lambda p: len(p) == len(pkgs) and set(lock(p)) == set(pkgs)), + ("test_sorted_by_name", lambda p: [ln.split("==")[0] for ln in p] == sorted(pkgs)), + ("test_versions_in_index", lambda p: all(v in vers[n] for n, v in lock(p).items())), + ("test_constraints_hold", satisfies), + ("test_preferred_lock", lambda p: p == want), + ] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path="lock.txt", kind="checks", parse="lines", checks=checks, + render=lambda: "\n".join(want) + "\n"), + notes={"valid": len(valid), "best": best}, + root="/root", + ) + + +# ---------------------------------------------------------------- sw3_fix_module + +MODULES = { # module name -> (test class, what the job does) + "report_utils": ("ReportUtilsTest", "nightly reporting job"), + "metrics_helpers": ("MetricsHelpersTest", "metrics rollup job"), + "toolkit": ("ToolkitTest", "nightly export job"), + "text_tools": ("TextToolsTest", "search indexing job"), +} + +# CHANGELOG revisions: the newer behaviour wins over the (stale) docstring. +REVISIONS = { + "median": { + "entry": "`median` now returns `None` for an empty list instead of raising.", + "edit": (" s = sorted(values)\n", " if not values:\n return None\n s = sorted(values)\n"), + "extra": lambda r: ([],), + }, + "percent_change": { + "entry": "`percent_change` now rounds to 1 decimal place instead of 2.", + "edit": ("old * 100, 2)", "old * 100, 1)"), + "extra": lambda r: (r.randint(3, 97), r.randint(3, 997)), + }, + "clamp": { + "entry": "`clamp` accepts its bounds in either order: when `lo > hi` the two are swapped first.", + "edit": (" if x < lo:\n", " if lo > hi:\n lo, hi = hi, lo\n if x < lo:\n"), + "extra": lambda r: (r.randint(-20, 20), r.randint(1, 10), r.randint(-10, 0)), + }, + "dedupe": { + "entry": "`dedupe` compares strings case-insensitively and keeps the first spelling it sees.", + "edit": (" if item not in seen:\n seen.add(item)\n", + " k = item.lower() if isinstance(item, str) else item\n if k not in seen:\n" + " seen.add(k)\n"), + "extra": lambda r: ([r.choice(["ok", "OK", "Ok", "red", "Red", "RED", "x"]) for _ in range(r.randint(3, 9))],), + }, + "word_count": { + "entry": "`word_count` counts digits as word characters: a word is now a run of a-z or 0-9.", + "edit": ('r"[a-z]+"', 'r"[a-z0-9]+"'), + "extra": lambda r: (" ".join(r.choice(["Room", "101", "room", "B12", "7", "go", "v2.1"]) for _ in range(r.randint(2, 7))),), + }, + "moving_average": { + "entry": "`moving_average` rounds every result to 4 decimal places.", + "edit": ("[sum(values[i:i + k]) / k ", "[round(sum(values[i:i + k]) / k, 4) "), + "extra": lambda r: ([r.randint(0, 50) for _ in range(r.randint(4, 9))], 3), + }, +} + +NOISE_ENTRIES = ( + ("Performance", "`word_count` is faster on long inputs."), + ("Performance", "`chunk` no longer copies the input list first."), + ("Docs", "Added usage examples to the README."), + ("Fixed", "Packaging: the wheel now ships `py.typed`."), + ("Internal", "CI runs on Python 3.12."), + ("Internal", "Moved the helpers out of the monolith into their own module."), + ("Docs", "Fixed a typo in the module docstring."), + ("Internal", "Type hints checked with mypy in CI."), + ("Performance", "`median` sorts a copy only once."), + ("Fixed", "The release script tags versions correctly."), +) + +FIX_HARNESS = r''' +import importlib, json, sys +sys.path.insert(0, sys.argv[1]) +cases = json.loads(sys.stdin.read()) +out = {} +try: + mod = importlib.import_module(sys.argv[2]) +except BaseException as exc: + print("@@RESULT@@" + json.dumps({"__import_error__": type(exc).__name__})) + raise SystemExit(0) +for name, arglists in cases.items(): + res = [] + for args in arglists: + try: + res.append(getattr(mod, name)(*args)) + except BaseException as exc: + res.append({"__error__": type(exc).__name__}) + out[name] = res +print("@@RESULT@@" + json.dumps(out, default=repr)) +''' + + +def _call(fn, args): + try: + return _jsonable(fn(*args)) + except Exception as exc: # the harness records raises the same way + return {"__error__": type(exc).__name__} + + +def _diff(f, g, args) -> bool: + return not _same(_call(f, args), _call(g, args)) + + +def _raises(fn, args) -> bool: + got = _call(fn, args) + return isinstance(got, dict) and "__error__" in got + + +def _run_hidden(module: str, source: str, cases: dict) -> dict | None: + """Import the agent's module as nobody on a private copy and call every hidden case.""" + tmp = tempfile.mkdtemp(prefix="tdchk-") + try: + os.chmod(tmp, 0o755) + src_dir = os.path.join(tmp, "src") + os.mkdir(src_dir) + with open(os.path.join(src_dir, f"{module}.py"), "w") as fh: + fh.write(source) + with open(os.path.join(tmp, "harness.py"), "w") as fh: + fh.write(FIX_HARNESS) + shell.give_to_nobody(tmp) + _, text = shell.run(["python3", "-I", os.path.join(tmp, "harness.py"), src_dir, module], tmp, + stdin_text=json.dumps(cases)) + lines = [ln for ln in text.splitlines() if ln.startswith("@@RESULT@@")] + return json.loads(lines[-1][len("@@RESULT@@"):]) if lines else None + finally: + shell.kill_nobody() + shutil.rmtree(tmp, ignore_errors=True) + + +def _ci_log(rng: random.Random, module: str, job: str, test_cls: str, failing: tuple) -> str: + """A noisy nightly CI log, a few hundred short lines, with the one failing visible test near the end.""" + t = rng.randint(0, 600) + + def stamp(): + nonlocal t + t += rng.randint(0, 4) + return f"02:{t // 60 % 60:02d}:{t % 60:02d}" + + out = [f"{stamp()} [ci] nightly run of the {job}, 2026-10-13"] + for step in ("checkout", "setup-python 3.12", f"restore cache (hit, {rng.randint(20, 90)} MB)"): + out.append(f"{stamp()} [step] {step}") + out.append(f"{stamp()} [step] install requirements") + for _ in range(rng.randint(24, 40)): + pkg = rng.choice(PKG_POOL) + out.append(f"{stamp()} fetched {pkg}-{rng.randint(0, 4)}.{rng.randint(0, 19)} ({rng.randint(8, 900)} kB)") + out.append(f"{stamp()} [step] run job dry-run") + for _ in range(rng.randint(70, 110)): + out.append(f"{stamp()} {rng.choice(('INFO', 'INFO', 'INFO', 'DEBUG', 'WARN'))} " + f"{rng.choice(('ingest', 'transform', 'rollup', 'export'))}: batch {rng.randint(1, 400)} " + f"rows={rng.randint(10, 9999)} took={rng.randint(3, 2000)}ms") + out.append(f"{stamp()} [step] unit tests: python3 -m unittest discover -s tests -v") + name, idx, args, got, want = failing + out.append(f"{stamp()} FAILED (failures=1)") + out += [ + "=" * 70, + f"FAIL: test_{name}_{idx} (test_{module}.{test_cls}.test_{name}_{idx})", + "-" * 70, + "Traceback (most recent call last):", + f' File "/app/tests/test_{module}.py", line {9 + 3 * idx}, in test_{name}_{idx}', + f" self.assertEqual({module}.{name}(*{list(args)!r}), {want!r})", + f"AssertionError: {got!r} != {want!r}", + f"{stamp()} [ci] job failed: exit code 1", + ] + return "\n".join(out) + "\n" + + +def _changelog(rng: random.Random, revised: str | None, n: int, position: int) -> str: + entries = rng.sample(NOISE_ENTRIES, n - (revised is not None)) + if revised is not None: + entries.insert(position, ("Changed", REVISIONS[revised]["entry"])) + minor, day = rng.randint(2, 4), datetime.date(2026, 5, 1) + datetime.timedelta(days=rng.randint(0, 60)) + blocks = [] + for patch, (kind, text) in enumerate(reversed(entries), 1): # oldest release first + day += datetime.timedelta(days=rng.randint(3, 14)) + blocks.append(f"## [{minor}.{patch}.0] - {day.isoformat()}\n\n### {kind}\n- {text}\n") + blocks.reverse() # printed newest first + return "# Changelog\n\nAll notable changes to this module. Newest first.\n\n" + "\n".join(blocks) + + +def build_fix_module(level: int, rng: random.Random) -> Built: + n_funcs, n_bugs = {1: (3, 1), 2: (4, 2), 3: (5, 2)}[level] + module = rng.choice(sorted(MODULES)) + test_cls, job = MODULES[module] + while True: + names = rng.sample(sorted(FUNCS), n_funcs) + buggy = rng.sample(names, n_bugs) + revised = None + if level == 2: # the CHANGELOG revises a function that is not buggy + pool = [n for n in names if n in REVISIONS and n not in buggy] + elif level == 3: # it revises a buggy one, so restoring the docstring is wrong + pool = [n for n in buggy if n in REVISIONS] + else: + pool = [None] + if pool: + revised = rng.choice(pool) + break + shown = next(n for n in buggy if n != revised) # the bug with a failing visible test (never the revised one) + sources, good_sources, hidden, tests, failing = [], [], {}, [], None + for name in names: + spec = FUNCS[name] + good_src = spec["src"] + if name == revised: + old, new = REVISIONS[name]["edit"] + assert old in good_src, (name, old) + good_src = good_src.replace(old, new, 1) + good = _compile(good_src) + src, bad = spec["src"], None + if name in buggy: + old, new = rng.choice(spec["bugs"]) + assert old in src, (name, old) + src = src.replace(old, new, 1) + bad = _compile(src) + cases = [spec["gen"](rng) for _ in range(40)] + if name == revised: + original = _compile(spec["src"]) + extra = [REVISIONS[name]["extra"](rng) for _ in range(6)] + assert sum(_diff(original, good, c) for c in cases + extra) >= 3, name + cases += extra + if bad is not None: + diffs = [c for c in cases if _diff(good, bad, c)] + while len(diffs) < 3: + c = spec["gen"](rng) + if _diff(good, bad, c): + diffs.append(c) + cases.append(c) + sources.append(src) + good_sources.append(good_src) + hidden[name] = (_jsonable([list(c) for c in cases]), [_call(good, c) for c in cases]) + if name == shown: + c = next(c for c in cases if _diff(good, bad, c) and not _raises(bad, c) and not _raises(good, c)) + failing = (name, len(tests), c, bad(*c), good(*c)) + tests.append((name, c, good(*c))) + elif name not in buggy and name != revised: + for c in cases[:2]: + tests.append((name, c, good(*c))) + header = f'"""{module}: small helpers used by the {job}."""\n\nimport re\n\n\n' + module_src = header + "\n\n".join(sources) + fixed_src = header + "\n\n".join(good_sources) + test_lines = [ + "import os, sys, unittest", + "sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'src'))", + f"import {module}", + "", + "", + f"class {test_cls}(unittest.TestCase):", + ] + for i, (name, args, want) in enumerate(tests): + test_lines += [f" def test_{name}_{i}(self):", + f" self.assertEqual({module}.{name}(*{list(args)!r}), {want!r})", ""] + test_lines += ["", 'if __name__ == "__main__":', " unittest.main()", ""] + files = { + f"src/{module}.py": module_src, + f"tests/test_{module}.py": "\n".join(test_lines), + "ci/nightly.log": _ci_log(rng, module, job, test_cls, failing), + } + path = f"src/{module}.py" + broken = "one of them no longer does what its docstring says" if n_bugs == 1 else \ + f"{n_bugs} of them no longer do what their docstrings say" + listing = [ + f"- src/{module}.py: the module; each function's docstring is its specification.", + f"- tests/test_{module}.py: visible unit tests. They are incomplete: a function can be wrong and still " + "pass them. Run them from /app with python3 -m unittest discover -s tests.", + "- ci/nightly.log: the log of last night's failed run.", + ] + if level >= 2: + n_entries = rng.randint(6, 8) + files["CHANGELOG.md"] = _changelog(rng, revised, n_entries, rng.randint(1, n_entries - 2) if level == 3 else + rng.randint(0, 2)) + listing.append("- CHANGELOG.md: release notes. Where an entry and a docstring disagree, the entry is newer " + "and wins; leave the docstring as it is.") + instruction = ( + f"Our {job} started failing in CI after a refactor of /app/{path}. The module has {n_funcs} functions and " + f"{broken}. Repair the module in place.\n\nFiles in /app:\n" + "\n".join(listing) + "\n\n" + "Keep every function name and signature, use only the standard library, and do not edit the tests. The " + f"grader imports /app/{path} and runs its own hidden tests against every function, including the ones the " + "visible tests do not cover; the task passes only if all of them pass." + ) + cases = {n: args for n, (args, _) in hidden.items()} + cache: dict = {} + + def results(text: str): + if cache.get("text") != text: + cache.update(text=text, got=_run_hidden(module, text, cases)) + return cache["got"] + + def imports(text): + got = results(text) + return isinstance(got, dict) and "__import_error__" not in got + + def passes(name): + return lambda text: imports(text) and _same(results(text)[name], hidden[name][1]) + + checks = [("test_module_imports", imports)] + [(f"test_{n}", passes(n)) for n in names] + return Built( + instruction=instruction, + files=files, + artifact=Artifact(path=path, kind="checks", parse="text", checks=checks, render=lambda: fixed_src), + notes={"buggy": sorted(buggy), "revised": revised, "module": module}, + root="/app", + ) + + +FAMILIES = [ + Family("sw3_fix_module", "software engineering", "Repair a helper module against hidden tests", + build_fix_module, v3=True), + Family("sw3_rate_limit", "software engineering", "Replay token-bucket rate limiting", build_rate_limit, v3=True), + Family("sw3_dep_lock", "software engineering", "Resolve a lock file against a package index", build_dep_lock, + v3=True), +] diff --git a/components/dnakhla/upstream/terminal_desk/models.py b/components/dnakhla/upstream/terminal_desk/models.py new file mode 100644 index 0000000000000000000000000000000000000000..bc47568aa25d26766899fb564ddd2db884f52952 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/models.py @@ -0,0 +1,51 @@ +"""Actions and observations for Terminal Desk v2. + +These reproduce the upstream OpenEnv ``envs/tbench2_env`` models (the wrapper the +arena operator uses for its own Terminal-Bench 2 tasks) field for field, so the +schema the policy trains against here equals the one it meets on the private +tasks. tests/fixtures/tb2_schema.json is the operator's published schema; a test +diffs ours against it. +""" + +from typing import Optional + +from openenv.core.env_server.types import Action, Observation, State +from pydantic import Field + + +class Tbench2Action(Action): + """Action for interacting with a TB2 task session.""" + + action_type: str = Field(default="exec") + command: str = Field(default="") + session_id: Optional[str] = Field(default=None) + block: bool = Field(default=True) + wait_seconds: Optional[float] = Field(default=None) + file_path: str = Field(default="") + content: str = Field(default="") + + +class Tbench2Observation(Observation): + """Observation returned from the TB2 environment.""" + + instruction: str = Field(default="") + output: str = Field(default="") + success: bool = Field(default=True) + error: str = Field(default="") + task_id: str = Field(default="") + task_path: str = Field(default="") + session_id: Optional[str] = Field(default=None) + action_type: str = Field(default="") + info: dict = Field(default_factory=dict) + + +class Tbench2State(State): + """Server-side state for a TB2 task.""" + + task_id: str = Field(default="") + task_path: str = Field(default="") + session_id: str = Field(default="") + terminal_ready: bool = Field(default=False) + last_action_type: str = Field(default="") + last_command: str = Field(default="") + last_output: str = Field(default="") diff --git a/components/dnakhla/upstream/terminal_desk/oracles/__init__.py b/components/dnakhla/upstream/terminal_desk/oracles/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..623ca4acae1958a1dc93780585e4ad944b9d5c46 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/__init__.py @@ -0,0 +1,40 @@ +"""Oracle scripts for v3 families: terminal_desk/oracles/.py. + +An oracle is the standalone script a good agent writes in one write_file: it +reads the inputs and writes the output file using only the image's packages. +It is not the grader; it proves the files carry everything the answer needs. + +Oracles open paths relative to the working directory (the environment runs +commands with cwd = the family root), so the same script works under the real +/root and /app and under TERMINAL_DESK_ROOTS in tests. +""" + +import os + +from ..models import Tbench2Action + +ORACLE_DIR = os.path.dirname(os.path.abspath(__file__)) +ORACLE_FILE = "oracle.py" # where the runner writes the script, relative to the root +EXIT_MARK = "@@oracle-exit=" + + +def oracle_path(family_id: str, directory: str = ORACLE_DIR) -> str: + return os.path.join(directory, f"{family_id}.py") + + +def oracle_source(family_id: str, directory: str = ORACLE_DIR) -> str | None: + path = oracle_path(family_id, directory) + if not os.path.isfile(path): + return None + with open(path, encoding="utf-8") as fh: + return fh.read() + + +def run_oracle(env, source: str): + """Play the oracle the way an agent would on a reset env: write_file it, exec python3, evaluate. + Returns (exec output, evaluate observation). Commands run as nobody when the server is root.""" + wrote = env.step(Tbench2Action(action_type="write_file", file_path=ORACLE_FILE, content=source)) + if not wrote.success: + raise RuntimeError(f"could not write the oracle: {wrote.error}") + ran = env.step(Tbench2Action(action_type="exec", command=f'python3 {ORACLE_FILE}; echo "{EXIT_MARK}$?"')) + return ran.output, env.step(Tbench2Action(action_type="evaluate")) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/fin3_invoice_fraud.py b/components/dnakhla/upstream/terminal_desk/oracles/fin3_invoice_fraud.py new file mode 100644 index 0000000000000000000000000000000000000000..a3058b71e0a669b330211a238274669bec33d261 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/fin3_invoice_fraud.py @@ -0,0 +1,34 @@ +"""Oracle for fin3_invoice_fraud: the first matching rule per invoice row, in file order.""" +import csv +import json +import os + + +def rows(name): + with open(f"data/{name}", newline="") as fh: + return list(csv.DictReader(fh)) + + +pos = {r["po_number"]: float(r["amount"]) for r in rows("purchase_orders.csv")} +vendors = {r["vendor_id"]: r["status"] for r in rows("vendors.csv")} if os.path.exists("data/vendors.csv") else None + +report, seen = [], set() +for n, inv in enumerate(rows("invoices.csv"), 1): + vid, po, amount = inv["vendor_id"], inv["po_number"], float(inv["amount"]) + key = (vid, inv["invoice_no"]) + if vendors is not None and vendors.get(vid) != "ACTIVE": + reason = "Unknown Vendor" + elif po not in pos: + reason = "Missing PO" + elif abs(amount - pos[po]) > 0.02 * pos[po]: + reason = "Amount Mismatch" + elif key in seen: + reason = "Duplicate Invoice" + else: + reason = None + seen.add(key) + if reason: + report.append({"row": n, "invoice_no": inv["invoice_no"], "amount": amount, "reason": reason}) + +with open("fraud_report.json", "w") as fh: + json.dump(report, fh, indent=1) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/fin3_loan_schedule.py b/components/dnakhla/upstream/terminal_desk/oracles/fin3_loan_schedule.py new file mode 100644 index 0000000000000000000000000000000000000000..9f3dcebd596e46007f4f974978878d3c7db8b460 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/fin3_loan_schedule.py @@ -0,0 +1,55 @@ +"""Oracle for fin3_loan_schedule.""" +import csv +import os +from decimal import ROUND_HALF_UP, Decimal + + +def r2(x): + return x.quantize(Decimal("0.01"), rounding=ROUND_HALF_UP) + + +def annuity(bal, pct, n): + i = pct / 1200 + return r2(bal * i / (1 - (1 + i) ** -n)) + + +def rows(name): + if not os.path.exists(f"data/{name}"): + return [] + with open(f"data/{name}", newline="") as fh: + return [r for r in csv.DictReader(fh) if r.get("loan_id") == lid] + + +lid = open("data/ticket.txt").read().split("Loan:")[1].split()[0] +loan = rows("loans.csv")[0] +bal, cur, term = Decimal(loan["principal"]), Decimal(loan["annual_rate_pct"]), int(loan["term_months"]) +extras = {} +for r in rows("extra_payments.csv"): + if r.get("status") != "REVERSED": + m = int(r["payment_no"]) + extras[m] = extras.get(m, 0) + Decimal(r["amount"]) +resets = {int(r["from_payment"]): Decimal(r["new_rate_pct"]) for r in rows("rate_resets.csv")} + +out, month, pay = [], 0, annuity(bal, cur, term) +while bal > 0: + month += 1 + if month in resets: + cur = resets[month] + pay = annuity(bal, cur, term - month + 1) + i = r2(bal * cur / 1200) + if bal + i <= pay or month == term: + out.append([month, bal + i, i, bal, 0, 0]) + break + bal -= pay - i + extra = min(extras.get(month, 0), bal) + bal -= extra + out.append([month, pay, i, pay - i, extra, bal]) + +head = ["month", "payment", "interest", "principal", "extra", "balance"] +if not os.path.exists("data/extra_payments.csv"): + head.remove("extra") + out = [r[:4] + r[5:] for r in out] +with open("schedule.csv", "w", newline="") as fh: + w = csv.writer(fh) + w.writerow(head) + w.writerows([r[0]] + [f"{Decimal(x):.2f}" for x in r[1:]] for r in out) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/fin3_portfolio_value.py b/components/dnakhla/upstream/terminal_desk/oracles/fin3_portfolio_value.py new file mode 100644 index 0000000000000000000000000000000000000000..67d5a7625b8ec84f1461a673b7839a0f7742d999 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/fin3_portfolio_value.py @@ -0,0 +1,42 @@ +"""Oracle for fin3_portfolio_value: replay trades and corporate actions, value at the last close.""" +import csv +import os +import re +from decimal import Decimal + +with open("data/prices.csv", newline="") as fh: + prices = list(csv.DictReader(fh)) +last = max(r["date"] for r in prices) +close = {r["ticker"]: Decimal(r["close"]) for r in prices if r["date"] == last} + +events = [] # (date, 0 = corporate action before 1 = that day's trades, kind, data) +if os.path.exists("data/corporate_actions.txt"): + for line in open("data/corporate_actions.txt"): + m = re.match(r"(\S+) (\S+) (\d+)-for-1", line) + if m: + events.append((m[1], 0, "split", (m[2], int(m[3])))) + m = re.match(r"(\S+) (\S+) cash dividend of ([\d.]+)", line) + if m: + events.append((m[1], 0, "div", (m[2], Decimal(m[3])))) +with open("data/trades.csv", newline="") as fh: + events += [(r["date"], 1, "trade", r) for r in csv.DictReader(fh)] + +cash, hold = Decimal(100000), {} +for date, _, kind, data in sorted(events, key=lambda e: (e[0], e[1])): + if kind == "split": + hold[data[0]] = hold.get(data[0], 0) * data[1] + elif kind == "div": + cash += data[1] * hold.get(data[0], 0) + else: + sign = 1 if data["side"] == "BUY" else -1 + qty = sign * int(data["shares"]) + hold[data["ticker"]] = hold.get(data["ticker"], 0) + qty + cash -= qty * Decimal(data["price"]) + +with open("positions.csv", "w", newline="") as fh: + w = csv.writer(fh) + w.writerow(["ticker", "shares", "close", "market_value"]) + for t, q in sorted(hold.items()): + if q: + w.writerow([t, q, f"{close[t]:.2f}", f"{q * close[t]:.2f}"]) + w.writerow(["CASH", 0, 0, f"{cash:.2f}"]) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/ind3_service_due.py b/components/dnakhla/upstream/terminal_desk/oracles/ind3_service_due.py new file mode 100644 index 0000000000000000000000000000000000000000..c11722d8b60df1aa983fbc160fc1c1d036b60322 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/ind3_service_due.py @@ -0,0 +1,47 @@ +"""Oracle for ind3_service_due: run-hours and days since service against each type's limits.""" +import csv +import os +import re +from datetime import date + +ASOF = date(2026, 10, 31) + + +def rows(path): + with open(path, newline="") as fh: + return list(csv.DictReader(fh)) + + +def text(path): + return open(path).read() if os.path.exists(path) else "" + + +limits = {r["type"]: (float(r["max_run_hours"]), int(r["max_days"])) for r in rows("data/service_intervals.csv")} +machines = {r["machine"]: r for r in rows("data/machines.csv")} +service = {m: (date.fromisoformat(r["last_service_date"]), float(r["meter_at_service"])) for m, r in machines.items()} +for day, m, meter in re.findall(r"(\S+): (M\d+) was serviced again; its hour meter read ([\d.]+)", text("data/notes.md")): + service[m] = (date.fromisoformat(day), float(meter)) +swaps = {m: date.fromisoformat(d) for d, m in re.findall(r"(\S+): (M\d+) hour meter failed", text("data/shift_log.txt"))} + +readings = {} +for r in rows("data/meter_readings.csv"): + day = date.fromisoformat(r["date"]) + if day <= ASOF: + readings.setdefault(r["machine"], []).append((day, float(r["meter_hours"]))) + +out = [] +for m in sorted(machines): + served, at = service[m] + seq = sorted(readings[m]) + hours = seq[-1][1] - at + if m in swaps: # the new meter counts from zero; add the old meter's hours up to the swap + hours += max(x for x in seq if x[0] < swaps[m])[1] + days = (ASOF - served).days + max_hours, max_days = limits[machines[m]["type"]] + out.append([m, f"{hours:.1f}", days, "yes" if hours >= max_hours or days >= max_days else "no"]) + +with open("service_report.csv", "w", newline="") as fh: + w = csv.writer(fh) + w.writerow(["machine", "run_hours_since_service", "days_since_service", "due"]) + w.writerows(out) +print(out) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/ind3_stl_mass.py b/components/dnakhla/upstream/terminal_desk/oracles/ind3_stl_mass.py new file mode 100644 index 0000000000000000000000000000000000000000..dea097e83de090357c41055ee9f510b001116e90 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/ind3_stl_mass.py @@ -0,0 +1,42 @@ +"""Oracle for ind3_stl_mass: signed-tetrahedron volume and area per solid, keep the largest, mass.""" +import csv +import json +import os + +with open("data/materials.csv", newline="") as fh: + density = {r["code"]: float(r["density_g_cm3"]) for r in csv.DictReader(fh)} +notes = open("data/scan_notes.md").read() if os.path.exists("data/scan_notes.md") else "" + +solids = [] +for line in open("data/scan.stl"): + w = line.split() + if w and w[0] == "solid": + solid = {"name": w[1], "code": w[2], "tris": [], "v": []} + solids.append(solid) + elif w and w[0] == "vertex": + solid["v"].append([float(x) for x in w[1:4]]) + if len(solid["v"]) == 3: + solid["tris"].append(solid["v"]) + solid["v"] = [] + + +def cross(a, b): + return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]] + + +for s in solids: + vol = area = 0.0 + for a, b, c in s["tris"]: + vol += sum(x * y for x, y in zip(a, cross(b, c))) / 6 + n = cross([q - p for p, q in zip(a, b)], [q - p for p, q in zip(a, c)]) + area += sum(x * x for x in n) ** 0.5 / 2 + s["vol"], s["area"] = abs(vol), area + +part = max(solids, key=lambda s: s["vol"]) +k = 2.54 if "exported in inches" in notes else 0.1 # file units to cm +volume, area = part["vol"] * k**3, part["area"] * k**2 +report = {"solid": part["name"], "material": part["code"], "volume_cm3": volume, "area_cm2": area, + "mass_g": volume * density[part["code"]]} +with open("mass_report.json", "w") as fh: + json.dump(report, fh) +print(report) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/ind3_tank_balance.py b/components/dnakhla/upstream/terminal_desk/oracles/ind3_tank_balance.py new file mode 100644 index 0000000000000000000000000000000000000000..58ac5e66ffa7d24a3bf8a52826da4cf0a0c1309b --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/ind3_tank_balance.py @@ -0,0 +1,50 @@ +"""Oracle for ind3_tank_balance: trapezoid inflow/outflow, net, and the longest high-level run.""" +import csv +import json +import os +import re + + +def text(path): + return open(path).read() if os.path.exists(path) else "" + + +def sec(t): + h, m, s = map(int, t.split(":")) + return h * 3600 + m * 60 + s + + +readme, note = text("data/README.md"), text("data/maintenance_note.txt") +cal = re.search(r"at (\d\d:\d\d:\d\d)\. Inflow readings taken before that time read (\d+)% high", note) +with open("data/tank_log.csv", newline="") as fh: + rows = [r for r in csv.DictReader(fh) if r.get("status", "OK") != "FAULT"] + + +def inflow(r): + f = float(r["inflow_lpm"]) + if cal and sec(r["time"]) < sec(cal.group(1)): + f /= 1 + int(cal.group(2)) / 100 + return f + + +tin = tout = 0.0 +for a, b in zip(rows, rows[1:]): + minutes = (sec(b["time"]) - sec(a["time"])) / 60 + tin += (inflow(a) + inflow(b)) / 2 * minutes + tout += (float(a["outflow_lpm"]) + float(b["outflow_lpm"])) / 2 * minutes +report = {"inflow_liters": round(tin, 2), "outflow_liters": round(tout, 2), "net_liters": round(tin - tout, 2)} + +alarm = re.search(r"alarm setpoint is (\d+) cm", readme) +if alarm: + best, start = 0, None + for r in rows: + if float(r["level_cm"]) > int(alarm.group(1)): + start = sec(r["time"]) if start is None else start + best = max(best, sec(r["time"]) - start) + else: + start = None + report["longest_high_minutes"] = round(best / 60, 2) + +with open("tank_report.json", "w") as fh: + json.dump(report, fh) +print(report) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/math3_count_items.py b/components/dnakhla/upstream/terminal_desk/oracles/math3_count_items.py new file mode 100644 index 0000000000000000000000000000000000000000..030decb27d428867698dae2cf920128ab261fd5e --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/math3_count_items.py @@ -0,0 +1,32 @@ +"""Oracle for math3_count_items: filter the raffle tickets by the draw rules, then rank and count pairs.""" +import csv +import json +import os + +cfg = json.load(open("data/draw.json")) +void = set() +if os.path.exists("data/voided.csv"): + void = {r["ticket"] for r in csv.DictReader(open("data/voided.csv"))} + + +def wins(x): + if not any(x % d == 0 for d in cfg["divisors"]) or x % cfg["excluded_divisor"] == 0: + return False + ds = cfg.get("digit_sum_divisor") + return ds is None or sum(map(int, str(x))) % ds == 0 + + +nums = set() +for r in csv.DictReader(open("data/tickets.csv")): + x = int(r["number"]) + if r["ticket"] not in void and wins(x): + nums.add(x) +nums = sorted(nums) + +out = {"count": len(nums), "kth_smallest": nums[cfg["rank"] - 1], "largest": nums[-1]} +if "pair_modulus" in cfg: + m = cfg["pair_modulus"] + out["pairs"] = sum((p + q) % m == 0 for i, p in enumerate(nums) for q in nums[i + 1:]) +with open("results.json", "w") as f: + json.dump(out, f) +print(out) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/math3_exam_slots.py b/components/dnakhla/upstream/terminal_desk/oracles/math3_exam_slots.py new file mode 100644 index 0000000000000000000000000000000000000000..e61e0a9aebd9f87465d61cf600f91e711cb82524 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/math3_exam_slots.py @@ -0,0 +1,50 @@ +"""Oracle for math3_exam_slots: brute-force every block order that respects front-loading.""" +import csv +import itertools +import json +import os + +inst = json.load(open("data/instance.json")) +blocks, slots = inst["blocks"], inst["slots"] +evening = "evening-to-morning" in open("data/README.md").read().lower() +cutoff = inst.get("large_block_cutoff") +large = {b for b in blocks if cutoff is not None and inst["block_size"][b] >= cutoff} +early = set(inst.get("early_slots", [])) + +pair, trip = {}, {} +for r in csv.DictReader(open("data/pair_counts.csv")): + pair[frozenset((r["block_a"], r["block_b"]))] = int(r["students"]) +for r in csv.DictReader(open("data/triplet_counts.csv")): + trip[frozenset((r["block_a"], r["block_b"], r["block_c"]))] = int(r["students"]) + + +def cost(order): + total = 0 + for i in range(len(slots) - 1): + s, t = slots[i], slots[i + 1] + k = pair[frozenset(order[i:i + 2])] + if s["day"] == t["day"]: + total += 3 * k + elif evening and s["period"] == "PM" and t["period"] == "AM" and t["day"] == s["day"] + 1: + total += k + days = {} + for s, b in zip(slots, order): + days.setdefault(s["day"], []).append(b) + return total + sum(10 * trip[frozenset(d)] for d in days.values() if len(d) == 3) + + +best = None +for order in itertools.permutations(blocks): + if any(b in large and s["slot"] not in early for s, b in zip(slots, order)): + continue + c = cost(order) + if best is None or c < best[0]: + best = (c, order) + +os.makedirs("output", exist_ok=True) +with open("output/schedule.csv", "w", newline="") as f: + w = csv.writer(f) + w.writerow(["slot", "block"]) + for s, b in zip(slots, best[1]): + w.writerow([s["slot"], b]) +print("objective", best[0]) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/math3_route_plan.py b/components/dnakhla/upstream/terminal_desk/oracles/math3_route_plan.py new file mode 100644 index 0000000000000000000000000000000000000000..0052baed973981f7257e7f4ef56f9156db80e7fc --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/math3_route_plan.py @@ -0,0 +1,48 @@ +"""Oracle for math3_route_plan: earliest-arrival Dijkstra over the open roads, waiting out timed closures.""" +import heapq +import json +import os +import re + +req = json.load(open("request.json")) +src, dst = req["from"], req["to"] +closed, shut, timed = set(), set(), {} +if os.path.exists("closures.md"): + section = "" + for line in open("closures.md"): + line = line.strip() + if line.startswith("## "): + section = line[3:].lower() + elif line.startswith("- "): + m = re.match(r"- (\w+) -> (\w+)(?:: closed from minute (\d+) to minute (\d+))?$", line) + if section.startswith("closed roads"): + closed.add(m.group(1, 2)) + elif section.startswith("closed junctions"): + shut.add(line[2:]) + elif section.startswith("timed"): + timed[m.group(1, 2)] = (int(m.group(3)), int(m.group(4))) + +adj = {} +for r in json.load(open("graph.json"))["roads"]: + u, v = r["from"], r["to"] + if (u, v) not in closed and u not in shut and v not in shut: + adj.setdefault(u, []).append((v, r["minutes"])) + +best, prev, heap = {src: 0}, {}, [(0, src)] +while heap: + t, u = heapq.heappop(heap) + if t > best[u]: + continue + for v, w in adj.get(u, []): + a, b = timed.get((u, v), (0, 0)) + arrive = (b if a <= t < b else t) + w + if arrive < best.get(v, float("inf")): + best[v], prev[v] = arrive, u + heapq.heappush(heap, (arrive, v)) + +path = [dst] +while path[-1] != src: + path.append(prev[path[-1]]) +with open("route.json", "w") as f: + json.dump({"path": path[::-1], "total_minutes": best[dst]}, f) +print(path[::-1], best[dst]) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/med3_silence_report.py b/components/dnakhla/upstream/terminal_desk/oracles/med3_silence_report.py new file mode 100644 index 0000000000000000000000000000000000000000..564ab3e29e170351afe8a9a5765a3b94ced769b5 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/med3_silence_report.py @@ -0,0 +1,44 @@ +"""Oracle for med3_silence_report: 50 ms windows, RMS in dBFS, silent runs become removed segments.""" +import json +import math +import os +import re +import wave +from array import array + +w = wave.open("data/lecture.wav") +rate, ch, n = w.getframerate(), w.getnchannels(), w.getnframes() +x = array("h", w.readframes(n))[::ch] # mono, or channel 1 (the lapel mic) of a stereo file +win = int(rate * 0.05) +nwin = len(x) // win + +notes = open("data/notes.md").read() if os.path.exists("data/notes.md") else "" +m = re.search(r"From ([\d.]+) s to ([\d.]+) s.*?use (-[\d.]+) dBFS", notes, re.S) + +silent = [] +for i in range(nwin): + rms = math.sqrt(sum(v * v for v in x[i * win:(i + 1) * win]) / win) + db = 20 * math.log10(max(rms, 1e-9) / 32768) + limit = float(m[3]) if m and float(m[1]) <= i * 0.05 < float(m[2]) else -40.0 + silent.append(db < limit) + +segments, i = [], 0 +while i < nwin: + j = i + while j < nwin and silent[j] == silent[i]: + j += 1 + if silent[i] and (i == 0 or (j - i) * 0.05 > 2.0): + segments.append({"start": round(i * 0.05, 3), "end": round(j * 0.05, 3), "duration": round((j - i) * 0.05, 3)}) + i = j + +original = n / rate +removed = sum(s["duration"] for s in segments) +report = { + "original_duration_seconds": round(original, 3), + "compressed_duration_seconds": round(original - removed, 3), + "removed_duration_seconds": round(removed, 3), + "compression_percentage": round(removed / original * 100, 2), + "segments_removed": segments, +} +json.dump(report, open("compression_report.json", "w"), indent=2) +print(len(segments), "segments removed") diff --git a/components/dnakhla/upstream/terminal_desk/oracles/med3_sprite_count.py b/components/dnakhla/upstream/terminal_desk/oracles/med3_sprite_count.py new file mode 100644 index 0000000000000000000000000000000000000000..c156041f5059380d7a313896a336596bd9344ef1 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/med3_sprite_count.py @@ -0,0 +1,44 @@ +"""Oracle for med3_sprite_count: grayscale template matching with a mean-abs-diff threshold.""" +import csv +import glob +import os + +import numpy as np +from numpy.lib.stride_tricks import sliding_window_view +from PIL import Image + + +def gray(path): + return np.asarray(Image.open(path).convert("L"), dtype=np.float32) + + +notes = open("notes.md").read() if os.path.exists("notes.md") else "" +templates = {} +for name in ("coin", "enemy", "turtle"): + t = gray(f"sprites/{name}.png") + templates[name] = [t, t[:, ::-1]] if "mirrored" in notes else [t] + + +def count(frame, variants): + h, w = variants[0].shape + windows = sliding_window_view(frame, (h, w)) # only windows fully inside the frame + hits = np.zeros(windows.shape[:2], dtype=bool) + for t in variants: + hits |= np.abs(windows - t).mean(axis=(2, 3)) < 10 + found = [] + for y, x in zip(*np.nonzero(hits)): + if all(abs(y - fy) >= h or abs(x - fx) >= w for fy, fx in found): + found.append((y, x)) # neighbouring hits belong to the same object + return len(found) + + +rows = [] +for path in sorted(glob.glob("frames/frame_*.png")): + frame = gray(path) + rows.append([os.path.basename(path)] + [count(frame, templates[n]) for n in ("coin", "enemy", "turtle")]) + +with open("counting_results.csv", "w", newline="") as f: + writer = csv.writer(f) + writer.writerow(["frame_id", "coins", "enemies", "turtles"]) + writer.writerows(rows) +print(len(rows), "frames; totals", [sum(r[i] for r in rows) for i in (1, 2, 3)]) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/med3_subtitle_retime.py b/components/dnakhla/upstream/terminal_desk/oracles/med3_subtitle_retime.py new file mode 100644 index 0000000000000000000000000000000000000000..247da0630367e359aee55d396a11e3fdd6bae019 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/med3_subtitle_retime.py @@ -0,0 +1,43 @@ +"""Oracle for med3_subtitle_retime: map every cue time through the union of the active cuts.""" +import csv +import os +import re + + +def ms(s): + h, m, sec, milli = map(int, re.search(r"(\d+):(\d\d):(\d\d)[,.](\d{3})", s).groups()) + return ((h * 60 + m) * 60 + sec) * 1000 + milli + + +def fmt(t): + return f"{t // 3600000:02d}:{t // 60000 % 60:02d}:{t // 1000 % 60:02d},{t % 1000:03d}" + + +notes = open("edit_notes.md").read() if os.path.exists("edit_notes.md") else "" +reverted = set(re.findall(r"(C\d+) was reverted", notes)) +min_len = 500 if "shorter than 500 ms" in notes else 1 + +cuts = sorted([ms(r["start"]), ms(r["end"])] for r in csv.DictReader(open("edl.csv")) if r["cut_id"] not in reverted) +union = [] +for s, e in cuts: # merge overlapping cuts so no footage is removed twice + if union and s <= union[-1][1]: + union[-1][1] = max(union[-1][1], e) + else: + union.append([s, e]) + + +def shift(t): + return t - sum(min(t, e) - s for s, e in union if t > s) + + +text = open("episode.srt", encoding="utf-8-sig").read().replace("\r\n", "\n") +out = [] +for block in re.split(r"\n\s*\n", text.strip()): + lines = block.split("\n") + start, end = (shift(ms(p)) for p in lines[1].split("-->")) + if end - start >= min_len: + out.append(f"{len(out) + 1}\n{fmt(start)} --> {fmt(end)}\n" + "\n".join(lines[2:]) + "\n") + +os.makedirs("output", exist_ok=True) +open("output/episode.srt", "w").write("\n".join(out)) +print(len(union), "cut spans;", len(out), "cues written") diff --git a/components/dnakhla/upstream/terminal_desk/oracles/off3_ar_recon.py b/components/dnakhla/upstream/terminal_desk/oracles/off3_ar_recon.py new file mode 100644 index 0000000000000000000000000000000000000000..e3f75adc2ad3ab9f82a0b00559c052f130352267 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/off3_ar_recon.py @@ -0,0 +1,39 @@ +"""Oracle for off3_ar_recon: credit notes first, then payments top to bottom, memo corrections applied.""" +import csv +import os +import re + + +def rows(name): + with open(name, newline="") as fh: + return list(csv.DictReader(fh)) + + +def cents(s): + return round(float(s) * 100) + + +inv = {r["invoice"]: r for r in rows("invoices.csv")} +bal = {i: cents(r["amount"]) for i, r in inv.items()} +void, moved = None, {} +if os.path.exists("controller_memo.md"): + memo = open("controller_memo.md").read() + void = re.search(r"(INV-\d+) was voided", memo).group(1) + m = re.search(r"payment of ([\d.]+) received on (\S+) .*? to (INV-\d+)", memo) + moved = {(m.group(2), cents(m.group(1))): [m.group(3)]} +if os.path.exists("credit_notes.csv"): + for r in rows("credit_notes.csv"): + bal[r["invoice"]] = max(0, bal[r["invoice"]] - cents(r["amount"])) +for r in rows("payments.csv"): + named = [f"INV-{n}" for n in re.findall(r"\d+", r["memo"])] if "memo" in r else [r["invoice"]] + left = cents(r["amount"]) + for i in moved.get((r["date"], left), named): + take = min(left, bal[i]) + bal[i] -= take + left -= take +with open("balances.csv", "w") as fh: + fh.write("invoice,customer,balance,status\n") + for i, b in bal.items(): + status = "paid" if b == 0 else "open" if b == cents(inv[i]["amount"]) else "partial" + if i != void: + fh.write(f"{i},{inv[i]['customer']},{b / 100:.2f},{status}\n") diff --git a/components/dnakhla/upstream/terminal_desk/oracles/off3_meeting_slot.py b/components/dnakhla/upstream/terminal_desk/oracles/off3_meeting_slot.py new file mode 100644 index 0000000000000000000000000000000000000000..f7ed9cfcbdcf3832fa4f20c789de95d354d1f609 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/off3_meeting_slot.py @@ -0,0 +1,44 @@ +"""Oracle for off3_meeting_slot: earliest quarter-hour UTC start inside everyone's 09-17 local and free.""" +import csv +import json +import os +import re +from datetime import datetime, time, timedelta + +people = {} +for r in csv.DictReader(open("people.csv")): + h, m = r["utc_offset"][4:].split(":") + sign = -1 if r["utc_offset"][3] == "-" else 1 + people[r["person"]] = sign * timedelta(hours=int(h), minutes=int(m)) +reader = csv.reader(open("busy.csv")) +in_utc = next(reader)[2] == "start_utc" +busy = {p: [] for p in people} +for p, d, s, e in reader: + b0, b1 = datetime.fromisoformat(f"{d} {s}"), datetime.fromisoformat(f"{d} {e}") + shift = people[p] if in_utc else timedelta(0) + busy[p].append((b0 + shift, b1 + shift)) +ooo, lunch = {}, set() +if os.path.exists("calendar_notes.md"): + for line in open("calendar_notes.md"): + m = re.match(r"- (\w+) is out of office .* (\d{4}-\d\d-\d\d)", line) + if m: + ooo[m.group(1)] = m.group(2) + if re.match(r"- \w+ takes lunch", line): + lunch.add(line.split()[1]) + +dur, t = timedelta(minutes=30), datetime(2026, 11, 2) + + +def works(p, off): + s = t + off + e, day = s + dur, s.date() + blocks = busy[p] + ([(datetime.combine(day, time(12)), datetime.combine(day, time(13)))] if p in lunch else []) + if str(day) == ooo.get(p) or s < datetime.combine(day, time(9)) or e > datetime.combine(day, time(17)): + return False + return all(e <= b0 or s >= b1 for b0, b1 in blocks) + + +while not all(works(p, off) for p, off in people.items()): + t += timedelta(minutes=15) +with open("meeting.json", "w") as fh: + json.dump({"start_utc": f"{t:%Y-%m-%dT%H:%M}", "end_utc": f"{t + dur:%Y-%m-%dT%H:%M}"}, fh) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/off3_pdf_xlsx_diff.py b/components/dnakhla/upstream/terminal_desk/oracles/off3_pdf_xlsx_diff.py new file mode 100644 index 0000000000000000000000000000000000000000..040e092decd470e6e50bff5f35818a97bec3c369 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/off3_pdf_xlsx_diff.py @@ -0,0 +1,36 @@ +"""Oracle for off3_pdf_xlsx_diff: PDF table (pdfplumber) vs workbook (openpyxl), matched by ID.""" +import json + +import openpyxl +import pdfplumber + +NUMERIC = ("Salary", "Years", "Score") + + +def value(field, v): + if field in NUMERIC: # the PDF may print salaries as $52,300 + x = float(str(v).replace("$", "").replace(",", "")) + return x if field == "Score" else int(x) + return str(v).strip() # trailing spaces are not changes + + +old, cols = {}, None +with pdfplumber.open("employees_backup.pdf") as pdf: + for page in pdf.pages: + for row in page.extract_table(): + if row[0] == "ID": # the header repeats on every page + cols = row + else: + old[row[0]] = dict(zip(cols, row)) +rows = list(openpyxl.load_workbook("employees_current.xlsx")["Employees"].iter_rows(values_only=True)) +new = {r[0]: dict(zip(rows[0], r)) for r in rows[1:]} + +mods = [] +for i in sorted(set(old) & set(new)): + for f in cols[1:]: + a, b = value(f, old[i][f]), value(f, new[i][f]) + if a != b: + mods.append({"id": i, "field": f, "old_value": a, "new_value": b}) +report = {"deleted_employees": sorted(set(old) - set(new)), "modified_employees": mods} +with open("diff_report.json", "w") as fh: + json.dump(report, fh, indent=1) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sci3_kinetics_fit.py b/components/dnakhla/upstream/terminal_desk/oracles/sci3_kinetics_fit.py new file mode 100644 index 0000000000000000000000000000000000000000..c88cc85582ca6eca851bc8fa6221e8352300c6f0 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sci3_kinetics_fit.py @@ -0,0 +1,38 @@ +# sci3_kinetics_fit: order by R^2, k, half-life, Arrhenius +import csv +import glob +import json +import math +import os +import re +from statistics import correlation, linear_regression + +notes = open("data/lab_notes.txt").read() if os.path.exists("data/lab_notes.txt") else "" +bad = set(re.findall(r"Sample (S\d+) in (\S+\.csv)", notes)) +SCALE = {"time_s": 1, "time_min": 60, "conc_M": 1, "conc_mM": 0.001} + + +def ols(t, y): # slope and R^2 + return linear_regression(t, y).slope, correlation(t, y) ** 2 + + +fits = [] +for path in sorted(glob.glob("data/run*.csv")): # run_289K.csv sorts before run_302K.csv + name = os.path.basename(path) + (_, tk, ck, *_), *body = csv.reader(open(path)) + t, c = zip(*[(float(x) * SCALE[tk], float(y) * SCALE[ck]) for s, x, y, *flag in body + if " r2 else (name, 2, s2, c[0])) + +name, order, k, c0 = fits[0] +if not notes: # stated first order + report = {"k_per_s": k, "half_life_s": math.log(2) / k} +elif len(fits) == 1: + report = {"order": order, "k": k, "half_life_s": math.log(2) / k if order == 1 else 1 / (k * c0)} +else: + lo, hi, k_hi = int(name[4:7]), int(fits[1][0][4:7]), fits[1][2] + ea = 8.314 * math.log(k_hi / k) / (1 / lo - 1 / hi) / 1000 + report = {"order": order, "k_low": k, "k_high": k_hi, "ea_kj_per_mol": ea} +json.dump(report, open("kinetics_report.json", "w")) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sci3_lightcurve_period.py b/components/dnakhla/upstream/terminal_desk/oracles/sci3_lightcurve_period.py new file mode 100644 index 0000000000000000000000000000000000000000..d15523a0e5d531d016a7bc28f0dbb2cb6598b678 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sci3_lightcurve_period.py @@ -0,0 +1,38 @@ +# oracle for sci3_lightcurve_period: filter, running-median detrend, box search over the stated grid +import math +import os +import re + +rows = [list(map(float, ln.split())) for ln in open("data/lc.txt") if not ln.startswith("#")] +rows = [r for r in rows if r[2] == 0] +if os.path.exists("data/README.md"): + a, b = map(float, re.search(r"MJD ([\d.]+) and ([\d.]+)", open("data/README.md").read()).groups()) + rows = [r for r in rows if not a <= r[0] <= b] +t = [r[0] for r in rows] +f = [r[1] for r in rows] +resid = [] +for i in range(len(f)): # divide by a running median ~0.75 d wide (27 points each side) + win = sorted(f[max(0, i - 27):i + 28]) + resid.append(f[i] / win[len(win) // 2] - 1) + +DUR, SUB = 0.10, 4 # box days (stated 0.08-0.12; 0.10 finds all), sub-bins per box +t = [x - t[0] for x in t] + + +def power(p): + """Best box signal at trial period p: phase-fold into bins, slide a box of SUB bins.""" + nb = int(round(SUB * p / DUR)) + c, s, n = nb / p, [0.0] * nb, [0] * nb + for b, r in zip([int(x * c) % nb for x in t], resid): + s[b] += r + n[b] += 1 + s, n = s + s[:SUB], n + n[:SUB] + return max(-sum(s[b:b + SUB]) / math.sqrt(max(sum(n[b:b + SUB]), 1)) for b in range(nb)) + + +coarse = max((k / 1000 for k in range(1000, 5001, 2)), key=power) # every other grid step +period = max((coarse + k / 10000 for k in range(-20, 21)), key=power) # then refine + +with open("period.txt", "w") as fh: + fh.write(f"{period:.5f}\n") +print(f"{period:.5f}", "power", round(power(period), 5), "points", len(t)) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sci3_stoich_batch.py b/components/dnakhla/upstream/terminal_desk/oracles/sci3_stoich_batch.py new file mode 100644 index 0000000000000000000000000000000000000000..319b48401e5691959db2a50d31ae010d47996721 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sci3_stoich_batch.py @@ -0,0 +1,46 @@ +# oracle for sci3_stoich_batch: lot lookup, molar masses, limiting reagent, yields +import csv +import json +import re + +mass = {r["element"]: float(r["mass"]) for r in csv.DictReader(open("data/atomic_masses.csv"))} + + +def molar(formula): + total = 0.0 + for part in formula.split("*"): # hydrate: CuSO4*5H2O + n, body = re.match(r"(\d*)(.*)", part).groups() + while "(" in body: # (SO4)3 -> SO4SO4SO4 + body = re.sub(r"\(([^()]*)\)(\d*)", lambda m: m.group(1) * int(m.group(2) or 1), body) + atoms = re.findall(r"([A-Z][a-z]?)(\d*)", body) + total += int(n or 1) * sum(mass[e] * int(k or 1) for e, k in atoms) + return total + + +lots = {} +for r in csv.DictReader(open("data/reagents.csv")): # latest certified row per lot wins + if r["lot"] not in lots or r["certified"] > lots[r["lot"]]["certified"]: + lots[r["lot"]] = r + +text = open("data/batch.txt").read() +left, right = re.search(r"Reaction: (.+)", text).group(1).split(" -> ") + + +def side(s): + return {f: int(c or 1) for c, f in re.findall(r"(?:(\d+) )?(\S+)", s) if f != "+"} + + +coef, prod_coef = side(left), side(right) +equiv = {} +for grams, formula, lot in re.findall(r"Charged: ([\d.]+) g (\S+) from lot (\S+)", text): + pure = float(grams) * float(lots[lot]["purity_pct"]) / 100 + equiv[formula] = pure / molar(formula) / coef[formula] +iso, product = re.search(r"Isolated: ([\d.]+) g (\S+)", text).groups() + +limiting = min(equiv, key=equiv.get) +mm = molar(product) +theo = equiv[limiting] * prod_coef[product] * mm +report = {"limiting_reagent": limiting, "product_molar_mass": mm, "theoretical_yield_g": theo, + "percent_yield": float(iso) / theo * 100} +json.dump(report, open("batch_report.json", "w"), indent=1) +print(report) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sec3_auth_triage.py b/components/dnakhla/upstream/terminal_desk/oracles/sec3_auth_triage.py new file mode 100644 index 0000000000000000000000000000000000000000..e264428f983d5caea715e7921cf8ba457b8575b9 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sec3_auth_triage.py @@ -0,0 +1,37 @@ +# oracle: sec3_auth_triage. Count failed SSH passwords per source inside a 10-minute window. +import ipaddress +import os +import re +from collections import defaultdict + +K, WINDOW = 5, 600 +notes = open("README.md").read() if os.path.exists("README.md") else "" +allow = [ipaddress.ip_network(n) for n in re.findall(r"\d+\.\d+\.\d+\.\d+/\d+", notes)] + +fails = defaultdict(list) +for name in ("auth.log.1", "auth.log"): # older file first + if not os.path.exists(name): + continue + for line in open(name): + clock, _, msg = line.rstrip("\n").partition(" ") + h, m, s = map(int, clock.split(":")) + t = h * 3600 + m * 60 + s + rep = re.match(r"message repeated (\d+) times: \[ Failed password for .* from (\S+?)\]$", msg) + if rep: + fails[rep.group(2)] += [t] * int(rep.group(1)) + continue + hit = re.match(r"Failed password for .* from (\S+)$", msg) + if hit: + fails[hit.group(1)].append(t) + +if not fails: + raise SystemExit("no failed attempts parsed") +blocked = [] +for ip, ts in fails.items(): + ts.sort() + if any(ts[i + K - 1] - ts[i] <= WINDOW for i in range(len(ts) - K + 1)): + if not any(ipaddress.ip_address(ip) in net for net in allow): + blocked.append(ip) +with open("blocked.txt", "w") as f: + f.write("".join(ip + "\n" for ip in sorted(blocked))) +print(len(fails), "sources with failures,", len(blocked), "blocked:", blocked) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sec3_exfil_flows.py b/components/dnakhla/upstream/terminal_desk/oracles/sec3_exfil_flows.py new file mode 100644 index 0000000000000000000000000000000000000000..4716ee3df6bf24fffae6931178e1fac40ad7bbdb --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sec3_exfil_flows.py @@ -0,0 +1,35 @@ +# oracle: sec3_exfil_flows. Big, unapproved, outbound flows that start outside office hours. +import csv +import ipaddress +import json +import os + +DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] +policy = json.load(open("policy.json")) +approved = list(policy.get("allowlist", [])) +if os.path.exists("allowlist.txt"): + approved += [ln.strip() for ln in open("allowlist.txt") if ln.strip() and not ln.startswith("#")] +approved = [ipaddress.ip_network(a) for a in approved] +internal = [ipaddress.ip_network(n) for n in policy.get("internal_networks", [])] +offset = policy.get("office_utc_offset_hours", 0) * 60 # local = UTC + offset (README, L3) + + +def minutes(hhmm): + h, m = hhmm.split(":") + return int(h) * 60 + int(m) + + +start, end = (minutes(x) for x in policy["business_hours"]) +alerts = [] +for r in csv.DictReader(open("flows.csv", newline="")): + t = (DAYS.index(r["day"]) * 1440 + minutes(r["time"]) + offset) % (7 * 1440) + day, minute = DAYS[t // 1440], t % 1440 + off_hours = day not in policy["business_days"] or not start <= minute < end + dst = ipaddress.ip_address(r["dst"]) + if (float(r["mb_out"]) > policy["threshold_mb"] and off_hours + and not any(dst in n for n in approved) and not any(dst in n for n in internal)): + alerts.append(int(r["flow"])) +alerts.sort() +with open("alerts.json", "w") as f: + json.dump(alerts, f) +print(len(alerts), "alerts:", alerts[:10]) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sec3_fw_verdicts.py b/components/dnakhla/upstream/terminal_desk/oracles/sec3_fw_verdicts.py new file mode 100644 index 0000000000000000000000000000000000000000..1d493da2de0a9726314edcc9127e519500905695 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sec3_fw_verdicts.py @@ -0,0 +1,49 @@ +# oracle: sec3_fw_verdicts. First matching rule by ascending rule_no; default deny is rule 0. +import csv +import ipaddress +import os + +groups = {} +if os.path.exists("groups.txt"): + for line in open("groups.txt"): + if line.strip() and not line.startswith("#"): + name, _, nets = line.partition(":") + groups["@" + name.strip()] = nets.split() + +rules = [] +for r in csv.DictReader(open("rules.csv", newline="")): + if r.get("enabled", "yes") != "yes": + continue + src = r["src"] + nets = None if src == "any" else [ipaddress.ip_network(n) for n in groups.get(src, [src])] + ports = None + if r["ports"] != "any": + ports = set() + for part in r["ports"].split(";"): + lo, _, hi = part.partition("-") + ports.update(range(int(lo), int(hi or lo) + 1)) + rules.append((int(r["rule_no"]), r["action"], r["proto"], nets, ports)) +rules.sort(key=lambda r: r[0]) + + +def decide(c): + ip = ipaddress.ip_address(c["src_ip"]) + port = c["dst_port"].strip() + for no, action, proto, nets, ports in rules: + if proto not in ("any", c["proto"]): + continue + if nets is not None and not any(ip in n for n in nets): + continue + if ports is not None and (not port or int(port) not in ports): + continue + return action, no + return "deny", 0 + + +conns = list(csv.DictReader(open("connections.csv", newline=""))) +with open("verdicts.csv", "w", newline="") as f: + w = csv.writer(f) + w.writerow(["id", "verdict", "rule"]) + for c in conns: + w.writerow([c["id"], *decide(c)]) +print(len(rules), "rules loaded,", len(conns), "connections") diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sw3_dep_lock.py b/components/dnakhla/upstream/terminal_desk/oracles/sw3_dep_lock.py new file mode 100644 index 0000000000000000000000000000000000000000..364b07da75d4863365248614c030e4e4ee05cb49 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sw3_dep_lock.py @@ -0,0 +1,51 @@ +"""Oracle for sw3_dep_lock: brute-force every pick of the requested packages and keep the preferred valid one.""" +import itertools +import os +import re + + +def vkey(v): + return tuple(int(x) for x in v.split(".")) + + +def parse(spec): + m = re.match(r"([a-z]+)(.*)", spec) + conds = [re.match(r"(>=|<|!=|==)(.+)", c).groups() for c in m[2].split(",") if c] + return m[1], [(op, vkey(w)) for op, w in conds] + + +def ok(v, conds): + k = vkey(v) + tests = {">=": k.__ge__, "<": k.__lt__, "!=": k.__ne__, "==": k.__eq__} + return all(tests[op](w) for op, w in conds) + + +wanted = [parse(ln.strip()) for ln in open("requirements.txt") if ln.strip()] +pkgs = [n for n, _ in wanted] +yanked = set() +if os.path.exists("yanked.txt"): + yanked = {tuple(ln.split()) for ln in open("yanked.txt") if ln.strip() and not ln.startswith("#")} + +releases = {} # package -> {version: [(dep, conds)]} +for ln in open("index.txt"): + if not ln.strip() or ln.startswith("#"): + continue + name, ver, req = ln.split() + if name in pkgs and (name, ver) not in yanked: + releases.setdefault(name, {})[ver] = [] if req == "-" else [parse(r) for r in req.split(";")] + +best = None +for combo in itertools.product(*(sorted(releases[p], key=vkey) for p in pkgs)): + pick = dict(zip(pkgs, combo)) + if not all(ok(pick[n], c) for n, c in wanted): + continue + if not all(ok(pick[d], c) for p in pkgs for d, c in releases[p][pick[p]]): + continue + score = tuple(vkey(pick[p]) for p in pkgs) + if best is None or score > best[0]: + best = (score, pick) + +pick = best[1] +with open("lock.txt", "w") as fh: + fh.write("".join(f"{p}=={pick[p]}\n" for p in sorted(pick))) +print(open("lock.txt").read()) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sw3_fix_module.py b/components/dnakhla/upstream/terminal_desk/oracles/sw3_fix_module.py new file mode 100644 index 0000000000000000000000000000000000000000..2bb04cab01d9a991865a585f74c70e18c094c954 --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sw3_fix_module.py @@ -0,0 +1,59 @@ +"""Oracle for sw3_fix_module: rewrite each function from its docstring and the CHANGELOG.""" +import glob +import os +import re + +log = open("CHANGELOG.md").read() if os.path.exists("CHANGELOG.md") else "" +REV = sorted(set(re.findall(r"### Changed\n- `(\w+)`", log))) +LIB = '''import re +REV = REVSET + +def median(values): + if not values and "median" in REV: + return None + s = sorted(values) + m = len(s) // 2 + return s[m] if len(s) % 2 else (s[m - 1] + s[m]) / 2 + +def clamp(x, lo, hi): + if lo > hi and "clamp" in REV: + lo, hi = hi, lo + return min(max(x, lo), hi) + +def moving_average(values, k): + out = [sum(values[i:i + k]) / k for i in range(len(values) - k + 1)] + return [round(v, 4) for v in out] if "moving_average" in REV else out + +def percent_change(old, new): + return round((new - old) / old * 100, 1 if "percent_change" in REV else 2) + +def chunk(items, size): + return [items[i:i + size] for i in range(0, len(items), size)] + +def is_leap(year): + return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) + +def dedupe(items): + seen, out = set(), [] + for item in items: + k = item.lower() if "dedupe" in REV and isinstance(item, str) else item + if k not in seen: + seen.add(k) + out.append(item) + return out + +def overlap(a_start, a_end, b_start, b_end): + return max(0, min(a_end, b_end) - max(a_start, b_start)) + +def to_seconds(clock): + return sum(int(p) * 60 ** i for i, p in enumerate(reversed(clock.split(":")))) + +def word_count(text): + counts = {} + for w in re.findall("[a-z0-9]+" if "word_count" in REV else "[a-z]+", text.lower()): + counts[w] = counts.get(w, 0) + 1 + return counts +''' +for path in glob.glob("src/*.py"): + open(path, "w").write(LIB.replace("REVSET", repr(REV))) + print("rewrote", path, REV) diff --git a/components/dnakhla/upstream/terminal_desk/oracles/sw3_rate_limit.py b/components/dnakhla/upstream/terminal_desk/oracles/sw3_rate_limit.py new file mode 100644 index 0000000000000000000000000000000000000000..1d3ac7a88d478c74b336879dadd1b90b4dd7ed7e --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/oracles/sw3_rate_limit.py @@ -0,0 +1,44 @@ +"""Oracle for sw3_rate_limit: replay per-key token buckets in ts order and list the rejected ids.""" +import csv +import json +import os +import re + +cfg = json.load(open("limits.json")) +tiers = cfg["tiers"] +key_tier = cfg["keys"] +default = cfg.get("default_tier") +exempt = set(cfg.get("exempt_keys", [])) + +changes = [] # (from_ts, tier, capacity, refill_per_sec) +if os.path.exists("CHANGE_NOTICE.md"): + num = r"(\d+(?:\.\d+)?)" + pat = rf"From ts {num} onward the (\w+) tier is capacity {num}, refill_per_sec {num}" + for m in re.finditer(pat, open("CHANGE_NOTICE.md").read()): + changes.append((float(m[1]), m[2], float(m[3]), float(m[4]))) + assert changes, "CHANGE_NOTICE.md did not parse" + +reqs = list(csv.DictReader(open("requests.csv"))) +reqs.sort(key=lambda r: (float(r["ts"]), int(r["id"]))) + +buckets, rejected = {}, [] +for r in reqs: + key, ts, cost = r["key"], float(r["ts"]), int(r["cost"]) + if key in exempt: + continue + tier = key_tier.get(key, default) + cap, rate = tiers[tier]["capacity"], tiers[tier]["refill_per_sec"] + for at, name, c, rr in changes: + if name == tier and ts >= at: + cap, rate = c, rr + tokens, last = buckets.get(key, (cap, ts)) + tokens = min(cap, tokens + (ts - last) * rate) + if tokens >= cost: + tokens -= cost + else: + rejected.append(int(r["id"])) + buckets[key] = (tokens, ts) + +rejected = sorted(set(rejected)) +json.dump(rejected, open("rejected.json", "w")) +print(len(reqs), "requests,", len(rejected), "rejected, first:", rejected[:5]) diff --git a/components/dnakhla/upstream/terminal_desk/server/__init__.py b/components/dnakhla/upstream/terminal_desk/server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/components/dnakhla/upstream/terminal_desk/server/app.py b/components/dnakhla/upstream/terminal_desk/server/app.py new file mode 100644 index 0000000000000000000000000000000000000000..d4caadb55b824dab9a0164b705b1080f9890bf4c --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/server/app.py @@ -0,0 +1,30 @@ +"""HTTP and WebSocket server for Terminal Desk. Episodes run over /ws. + +Run locally: + uvicorn terminal_desk.server.app:app --host 0.0.0.0 --port 8000 +""" + +from openenv.core.env_server.http_server import create_app + +from ..models import Tbench2Action, Tbench2Observation +from .environment import TerminalDeskEnvironment + +# One episode per container: the workspace is the fixed /app directory, as in the +# operator's tbench2_env images, and the arena gives every episode its own sandbox. +app = create_app( + TerminalDeskEnvironment, + Tbench2Action, + Tbench2Observation, + env_name="terminal_desk", + max_concurrent_envs=1, +) + + +def main(host: str = "0.0.0.0", port: int = 8000) -> None: + import uvicorn + + uvicorn.run(app, host=host, port=port) + + +if __name__ == "__main__": + main() diff --git a/components/dnakhla/upstream/terminal_desk/server/environment.py b/components/dnakhla/upstream/terminal_desk/server/environment.py new file mode 100644 index 0000000000000000000000000000000000000000..e0752e168e53ce890d2d724c4388b1077ffd186c --- /dev/null +++ b/components/dnakhla/upstream/terminal_desk/server/environment.py @@ -0,0 +1,191 @@ +"""Terminal Desk environment: a TB2-shaped server for procedural artifact tasks. + +reset(task_id=...) builds a fresh instance of that family and level under the +family's root, /app or /root (Built.root). Reset wipes both roots, dotfiles +included, writes the instance files under the family root and hands it to +nobody; commands then run as nobody with cwd and HOME set to that root, and +task_path reports it. Tests map both roots under one temp dir with +TERMINAL_DESK_ROOTS=/tmp/x (/tmp/x/root and /tmp/x/app); the server never reads +from either root as root except the artifact bytes the grader reads behind its +lstat guards. Each reset draws new randomness: a client cannot +pick the instance, so a second session opened from the agent's own shell learns +nothing about the live one. In-process callers (tests, calibration) may pass a +seed with allow_seed=True. + +The step contract mirrors the upstream OpenEnv tbench2_env wrapper the arena +operator uses for its own tasks: exec runs a command, write_file writes a file, +evaluate runs the hidden checks and ends the episode with reward 1 or 0, close +ends it without a reward, session actions fail softly, and the instruction is +repeated in every observation. Commands and writes run as nobody. +""" + +import os +import random +import secrets +import shutil +import stat +from uuid import uuid4 + +from openenv.core.env_server.interfaces import Environment + +from ..core import shell +from ..core.grading import verify +from ..families import FAMILIES, parse_task_id +from ..families.base import Built +from ..models import Tbench2Action, Tbench2Observation, Tbench2State + +if "TERMINAL_DESK_APP" in os.environ: + raise RuntimeError("TERMINAL_DESK_APP is gone: set TERMINAL_DESK_ROOTS= to map /root and /app under ") +ROOTS_BASE = os.environ.get("TERMINAL_DESK_ROOTS", "") +ROOTS = ("/root", "/app") +MAX_CALLS = 32 # the operator's tool_calls_total; the arena's budgets end episodes first +SESSION_ACTIONS = ("write", "view", "wait", "kill") + + +def host_root(root: str) -> str: + """Where a family root lives on this machine: itself, or under TERMINAL_DESK_ROOTS in tests.""" + if root not in ROOTS: + raise ValueError(f"family root must be one of {ROOTS}, got {root!r}") + return os.path.join(ROOTS_BASE, root.lstrip("/")) if ROOTS_BASE else root + + +def _wipe(path: str) -> None: + """Empty a root (dotfiles too) without following links, and give it back to root 0755.""" + os.makedirs(path, exist_ok=True) + if not stat.S_ISDIR(os.lstat(path).st_mode): + raise RuntimeError(f"{path} is not a directory") + for entry in os.scandir(path): + if entry.is_dir(follow_symlinks=False): + shutil.rmtree(entry.path) + else: + os.unlink(entry.path) + if shell.IS_ROOT: + os.chown(path, 0, 0) + os.chmod(path, 0o755) + + +class TerminalDeskEnvironment(Environment): + SUPPORTS_CONCURRENT_SESSIONS = False + + def __init__(self, allow_seed: bool = False): + super().__init__() + self._allow_seed = allow_seed + self._ep: dict | None = None + self._state = Tbench2State(episode_id=None, step_count=0) + + def reset(self, seed=None, episode_id=None, task_id=None, **kwargs) -> Tbench2Observation: + if not isinstance(task_id, str): + raise ValueError("reset needs task_id, for example task_id='ind_tank-L1'") + family_id, level = parse_task_id(task_id) + rng = random.Random(seed if (seed is not None and self._allow_seed) else secrets.randbits(64)) + built = FAMILIES[family_id].build(level, rng) + root = host_root(built.root) + self._cleanup() + self._ep = None + for r in ROOTS: + _wipe(host_root(r)) + for name, content in built.files.items(): + if os.path.isabs(name) or ".." in name.split("/"): + raise ValueError(f"instance file {name!r} must be relative to the root") + target = os.path.join(root, name) + os.makedirs(os.path.dirname(target), exist_ok=True) + mode = "wb" if isinstance(content, bytes) else "w" + with open(target, mode, **({} if mode == "wb" else {"encoding": "utf-8", "newline": ""})) as fh: + fh.write(content) + shell.give_to_nobody(root) + self._ep = {"task_id": task_id, "built": built, "root": root, "calls": 0, "done": False} + self._state = Tbench2State( + episode_id=episode_id or str(uuid4()), + step_count=0, + task_id=task_id, + task_path=built.root, + terminal_ready=True, + ) + return self._obs("reset", "", reward=0.0, done=False, session_id=None) + + def step(self, action: Tbench2Action, timeout_s=None, **kwargs) -> Tbench2Observation: + ep = self._ep + if ep is None: + raise RuntimeError("call reset(task_id=...) first") + if ep["done"]: + return self._obs(action.action_type, "The episode is over.", reward=None, done=True, success=False, + error="episode is over") + ep["calls"] += 1 + self._state.step_count = ep["calls"] + self._state.last_action_type = action.action_type + self._state.last_command = action.command + kind = action.action_type + if kind in ("evaluate", "close") or ep["calls"] > MAX_CALLS: + if kind == "close": + self._cleanup() + ep["done"] = True + return self._obs("close", "Closed TB2 environment.", reward=None, done=True) + return self._evaluate(kind) + + output, success, error, session_id = "", True, "", action.session_id or "tb2-session" + try: + if kind == "exec": + _, output = shell.run_command(action.command, ep["root"]) + elif kind == "write_file": + if not action.file_path: + raise ValueError("file_path is required for action_type='write_file'") + code, text = shell.write_file(action.file_path, action.content, ep["root"]) + if code != 0: + raise OSError(text.strip() or f"could not write {action.file_path}") + output = f"Wrote content to {action.file_path}" + elif kind in SESSION_ACTIONS: + if not action.session_id: + raise ValueError(f"session_id is required for action_type='{kind}'") + raise ValueError("streaming sessions are not available here; use a blocking exec") + else: + raise ValueError(f"Unsupported action_type: {kind}") + except Exception as exc: + success, error = False, str(exc) + self._state.last_output = output + self._state.session_id = session_id + return self._obs(kind, output, reward=None, done=False, success=success, error=error, session_id=session_id) + + def _evaluate(self, kind: str) -> Tbench2Observation: + ep = self._ep + built: Built = ep["built"] + ep["done"] = True + shell.kill_nobody() + reward, results, tail = verify(ep["root"], built) + self._cleanup() + return self._obs( + kind, + tail, + reward=reward, + done=True, + info={"tests_passed": reward == 1.0, "assertions_passed": sum(results.values()), + "assertions_total": len(results), "harness": "tests/test.sh", "results": results, + "task_id": ep["task_id"], "calls": ep["calls"]}, + ) + + def _obs(self, action_type: str, output: str, reward, done: bool, success: bool = True, error: str = "", + session_id=None, info: dict | None = None) -> Tbench2Observation: + ep = self._ep or {} + built = ep.get("built") + return Tbench2Observation( + instruction=built.instruction if built else "", + output=output, + success=success, + error=error, + task_id=ep.get("task_id", ""), + task_path=built.root if built else "", + session_id=session_id, + action_type=action_type, + info=info or {}, + reward=reward, + done=done, + ) + + def _cleanup(self) -> None: + shell.kill_nobody() + + def close(self) -> None: + self._cleanup() + + @property + def state(self) -> Tbench2State: + return self._state diff --git a/components/loui/Dockerfile b/components/loui/Dockerfile index d50c434cc90a45a36a7b5ad6176c4c136eeb417b..13b6e9d9990410f214c747d43793fa331af097e5 100644 --- a/components/loui/Dockerfile +++ b/components/loui/Dockerfile @@ -1,12 +1,8 @@ -FROM ghcr.io/bochencs/openenv-pdbthink@sha256:93c21c8ccca55b7bb0af838eb42c64e6702dd9d97cd689357f5929ae72460f71 +FROM ghcr.io/bochencs/openenv-mimo-code@sha256:7e90439a0499dfd1498434a8fafb7efa6d5aeb9b96d9eb23b3f8c96e6047ea88 USER root -COPY runtime /opt/loui/runtime +RUN rm -rf /opt/loui/tasks +COPY SOURCE.json config.json README.md /opt/loui/ COPY upstream /opt/loui/upstream +COPY runtime /opt/loui/runtime COPY tasks /opt/loui/tasks -COPY SOURCE.json config.json /opt/loui/ -RUN chmod -R go-rwx /opt/loui && mkdir -p /var/lib/loui-exec && chmod 711 /var/lib/loui-exec -ENV PYTHONPATH=/opt/loui/runtime:/opt/loui/upstream/v3 PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 ENABLE_WEB_INTERFACE=false OPENENV_MODE=simulation GRADIO_ANALYTICS_ENABLED=false HF_HUB_OFFLINE=1 -WORKDIR /opt/loui -EXPOSE 8000 -HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3).read()"] -CMD ["python", "-m", "loui.server"] +RUN chmod -R go-rwx /opt/loui diff --git a/components/loui/README.md b/components/loui/README.md index faf08f3f263ec4b5b47ea1ea231e2fe4f5d7cfd9..0c87ec27f232bdb0446361639265945f5f5e6ff0 100644 --- a/components/loui/README.md +++ b/components/loui/README.md @@ -1,7 +1,3 @@ -# Original multi-module repair tasks +One original Python Repair Lab v3 task: `expression-3`. The original generator, seed behavior and behavior-group reward are retained. The adapter provides shared call/finish actions, isolated execution with separate startup and learner deadlines, and JSON-safe validation errors. -`incident-3` and `expression-3` reuse Python Repair Lab v3 at Hugging Face revision `f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad`. Original source and MIT license are in `upstream/`. - -Use `op=call` with `read`, `write`, `test`, or `submit`; tool arguments are listed on reset. `op=finish` grades the current source. Reset defaults to the original seed 0. The 30-action limit and original mean over six verification groups are preserved. - -The runtime uses the Arena-pinned OpenEnv SDK. Candidate code runs as UID 2000 with no network or child processes. Source, reference implementations, and grading state remain in the root supervisor. +Source: [Python Repair Lab v3](https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad/v3). MIT; copyright 2026 Louis Grenard. See `upstream/LICENSE`. diff --git a/components/loui/SOURCE.json b/components/loui/SOURCE.json index 80cdfdfda9c499e34c6b14336e73ac7a7ed93858..f0abdec2400f64f855735162bc6d9e2d246ffda2 100644 --- a/components/loui/SOURCE.json +++ b/components/loui/SOURCE.json @@ -5,7 +5,6 @@ "source_github_revision": "8762c34c465ab37304f2c967d5a01d55283f2531", "license": "MIT", "registered_tasks": [ - "incident-3", "expression-3" ], "default_seed": 0, diff --git a/components/loui/config.json b/components/loui/config.json index 2aff35f4872b74c1549358b25ffa0630f7518d14..b50dfc886947a3b8b9671ae85fcbfcb3b163c18f 100644 --- a/components/loui/config.json +++ b/components/loui/config.json @@ -1,22 +1,5 @@ { "tasks": [ - { - "task_id": "incident-3", - "split": "train", - "seed": 0, - "family": "incident", - "instruction_source": "upstream/v3/tasks.jsonl", - "instruction_sha256": "682c7db0f0911e85174652574349fbe957c1cc235a68d224c569e405d9674452", - "source_dataset": "Louistiti/openenv-python-repair", - "source_revision": "f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad", - "source_url": "https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad/v3", - "license": "MIT", - "grading": "Unchanged original mean of per-behavior-group pass fractions", - "default_empty_finish": "Original starter partial reward; not forced to zero", - "instruction_jsonl_row": 12, - "instruction_field": "prompt", - "original_instruction": "tasks/incident-3/instruction.md" - }, { "task_id": "expression-3", "split": "train", diff --git a/components/loui/runtime/common/models.py b/components/loui/runtime/common/models.py index b862e2d3259ab1c55bbb46e6423587b742dbcc51..4d7bfa208b39f5e19d3e358c6d23c0f59041efad 100644 --- a/components/loui/runtime/common/models.py +++ b/components/loui/runtime/common/models.py @@ -5,6 +5,7 @@ from typing import Any, Literal import jsonschema from openenv.core.env_server.types import Action, Observation from pydantic import ConfigDict, Field, model_serializer, model_validator +from pydantic_core import PydanticCustomError from .contracts import ACTION_SCHEMA @@ -22,7 +23,7 @@ class ArenaAction(Action): return value def finite(item): if isinstance(item,float) and not math.isfinite(item): - raise ValueError('Non-finite JSON number') + raise PydanticCustomError('finite_number', 'Non-finite JSON number') if isinstance(item,dict): for part in item.values():finite(part) elif isinstance(item,list): @@ -31,7 +32,7 @@ class ArenaAction(Action): try: jsonschema.Draft202012Validator(ACTION_SCHEMA).validate(value) except jsonschema.ValidationError as exc: - raise ValueError(exc.message) from exc + raise PydanticCustomError('action_contract', '{message}', {'message': exc.message}) from exc return value @classmethod diff --git a/components/loui/runtime/loui/executor.py b/components/loui/runtime/loui/executor.py index 0d570590dd654f05f54c4fe273641dfad1ba88b8..a6bff79ca61cbcb2be0c7525b512fb7a441aaa05 100644 --- a/components/loui/runtime/loui/executor.py +++ b/components/loui/runtime/loui/executor.py @@ -1,10 +1,12 @@ import base64 import os from pathlib import Path +import select import signal import subprocess import sys import tempfile +import time from types import SimpleNamespace @@ -12,6 +14,11 @@ class InfrastructureError(RuntimeError): pass +# Trusted setup has its own bounded phase. Learner input is withheld until ready. +STARTUP_TIMEOUT_SECONDS = 4.0 +CLEANUP_TIMEOUT_SECONDS = 1.0 + + def configure(module): original_runner = module.RUNNER root = Path('/var/lib/loui-exec') @@ -36,30 +43,50 @@ def configure(module): encoded = base64.b64encode(original_runner.encode()).decode() command = [sys.executable, '-I', '-S', str(Path(__file__).with_name('child.py')), str(write_fd), encoded] try: + started = time.monotonic() process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=stdout, stderr=stderr, text=text, cwd=cwd, env=env, pass_fds=(write_fd,), start_new_session=True) os.close(write_fd) write_fd = None - timed_out = None - try: - out, err = process.communicate(input, timeout=timeout) - except subprocess.TimeoutExpired as error: - timed_out = error - os.killpg(process.pid, signal.SIGKILL) - out, err = process.communicate() + remaining = STARTUP_TIMEOUT_SECONDS - (time.monotonic() - started) + if remaining <= 0 or not select.select([read_fd], [], [], remaining)[0]: + raise InfrastructureError('Learner startup timed out before isolation readiness') status = os.read(read_fd, 2048) if status != b'ready': - raise InfrastructureError('Learner isolation failed: ' + status.decode(errors='replace')) - if timed_out is not None: - raise timed_out + raise InfrastructureError('Learner isolation initialization failed: ' + + repr(status) + '; returncode=' + str(process.poll())) + # child.py has already verified isolation and closed the status pipe. + # Keep the original grader's learner execution timeout unchanged. + try: + out, err = process.communicate(input, timeout=timeout) + except subprocess.TimeoutExpired: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + process.communicate(timeout=CLEANUP_TIMEOUT_SECONDS) + except subprocess.TimeoutExpired as error: + raise InfrastructureError('Learner cleanup timed out') from error + raise return subprocess.CompletedProcess(argv, process.returncode, out, err) finally: if write_fd is not None: os.close(write_fd) os.close(read_fd) if process is not None and process.poll() is None: - os.killpg(process.pid, signal.SIGKILL) - process.wait() + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + try: + process.wait(timeout=CLEANUP_TIMEOUT_SECONDS) + except subprocess.TimeoutExpired as error: + raise InfrastructureError('Learner cleanup timed out') from error + if process is not None: + for stream in (process.stdin, process.stdout, process.stderr): + if stream is not None and not stream.closed: + stream.close() module.subprocess = SimpleNamespace(run=run, DEVNULL=subprocess.DEVNULL, TimeoutExpired=subprocess.TimeoutExpired) diff --git a/components/loui/tasks/incident-3/instruction.md b/components/loui/tasks/incident-3/instruction.md deleted file mode 100644 index 1baa2d218060f3375c2b18d7169f9e8cf0fbb79a..0000000000000000000000000000000000000000 --- a/components/loui/tasks/incident-3/instruction.md +++ /dev/null @@ -1,2 +0,0 @@ -solve(events): process events by (time, original index), preserving ties. Global event id deduplication keeps the first in that sorted order. Group failures by (user,ip). At each failure retain times in inclusive [time-WINDOW,time]. Alert [user,ip,time] only on a crossing from fewer than THRESHOLD failures to at least THRESHOLD. A success clears that pair only. Return alerts in processing order, without mutating events. -Runtime constants are in settings.py. There are multiple modules; main.solve is the entry point. Repair any necessary files. Imports may use these local modules or csv, io, fractions. No filesystem/network/process access. Use read/write/test/submit; test exposes only public examples; submit runs hidden checks. Maximum 30 actions. Fresh data and defect combinations depend on reset seed. \ No newline at end of file diff --git a/components/math/ADAPTATIONS.txt b/components/math/ADAPTATIONS.txt deleted file mode 100644 index fd519c9d863846f2bedc16c2def825e4d84642fd..0000000000000000000000000000000000000000 --- a/components/math/ADAPTATIONS.txt +++ /dev/null @@ -1,2 +0,0 @@ -Actions: exec and finish. Workspace: /workdir. Input: instance.json. Output: answer.json. Persistent episode transport: /ws. -Reset restores the task input; finish invokes the original checker. diff --git a/components/math/Dockerfile b/components/math/Dockerfile deleted file mode 100644 index ac9373ee146241e6587f2735493cb68e225d79b7..0000000000000000000000000000000000000000 --- a/components/math/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ghcr.io/bochencs/openenv-math@sha256:a68a875afe093fd2ca29c1d5f8a4465bba39da60262faddd4548e684befc161f -USER root -COPY config.json /opt/native-shell/config.json -COPY runtime/native_shell/backend.py /opt/native-shell/runtime/native_shell/backend.py -RUN rm -rf /opt/native-shell/tasks/construct-mc-ramsey-l4-s0 /opt/native-shell/tasks/construct-rlve-round-robin-scores-l3-s0 /opt/native-shell/tasks/construct-mc-social-golfers-l4-s0 && chmod 600 /opt/native-shell/config.json diff --git a/components/math/NOTICE.txt b/components/math/NOTICE.txt deleted file mode 100644 index fda04d09580febaad4e061fc178bcce8a88fe927..0000000000000000000000000000000000000000 --- a/components/math/NOTICE.txt +++ /dev/null @@ -1,3 +0,0 @@ -Costas array task published by amphora; immutable revision in SOURCE.json. -Original source: MathConstraint by Viresh Pati and contributors, https://github.com/vireshpati/Math-Constraint. License: CC BY 4.0. -The original prompt, instance and checker are preserved. OpenEnv transport and isolated execution are local adaptations. diff --git a/components/math/SDK_DEPENDENCIES.json b/components/math/SDK_DEPENDENCIES.json deleted file mode 100644 index b57732bb502e33b63bea9ff612f4123077d80330..0000000000000000000000000000000000000000 --- a/components/math/SDK_DEPENDENCIES.json +++ /dev/null @@ -1,667 +0,0 @@ -{ - "openenv_revision": "86a180ede21e044f7929b9a7783ad83aa67d83a3", - "openenv_wheel_sha256": "93a5781b64e2f174f17fff40a558d43745a7f4e48a8b247363da4f27906be53a", - "python": "3.11", - "wheels": { - "pycparser": { - "version": "3.11", - "sha256": "51d5a8ba2be0bbe440b99d2112604c95bbbc3c2748a64260186c541e1729cd80", - "filename": "pycparser-3.11-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "keyring": { - "version": "25.7.0", - "sha256": "be4a0b195f149690c166e850609a477c532ddbfbaed96a404d4e43f8d5e2689f", - "filename": "keyring-25.7.0-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "huggingface-hub": { - "version": "2.2.0", - "sha256": "1667f145dc56dc210d60966069397df9ecfca9607a5d43db88b308c89dae56b3", - "filename": "huggingface_hub-2.2.0-py3-none-any.whl", - "requires_python": ">=3.10.0" - }, - "safehttpx": { - "version": "0.1.7", - "sha256": "c4f4a162db6993464d7ca3d7cc4af0ffc6515a606dfd220b9f82c6945d869cde", - "filename": "safehttpx-0.1.7-py3-none-any.whl", - "requires_python": ">3.9" - }, - "truststore": { - "version": "0.10.4", - "sha256": "adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981", - "filename": "truststore-0.10.4-py3-none-any.whl", - "requires_python": ">= 3.10" - }, - "urllib3": { - "version": "2.8.0", - "sha256": "0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3", - "filename": "urllib3-2.8.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "python-dotenv": { - "version": "1.2.4", - "sha256": "42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc", - "filename": "python_dotenv-1.2.4-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "more-itertools": { - "version": "11.1.0", - "sha256": "4b65538ae22f6fed0ce4874efd317463a7489796a0939fa66824dd542125a192", - "filename": "more_itertools-11.1.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "idna": { - "version": "3.20", - "sha256": "ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", - "filename": "idna-3.20-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "cryptography": { - "version": "50.0.2", - "sha256": "4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856", - "filename": "cryptography-50.0.2-cp311-abi3-manylinux_2_28_x86_64.whl", - "requires_python": ">=3.9, !=3.9.0, !=3.9.1" - }, - "httpx-sse": { - "version": "0.4.3", - "sha256": "0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", - "filename": "httpx_sse-0.4.3-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "packaging": { - "version": "26.3", - "sha256": "d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", - "filename": "packaging-26.3-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "jaraco.classes": { - "version": "3.4.0", - "sha256": "f662826b6bed8cace05e7ff873ce0f9283b5c924470fe664fff1c2f00f581790", - "filename": "jaraco.classes-3.4.0-py3-none-any.whl", - "requires_python": ">=3.8" - }, - "tomli-w": { - "version": "1.2.0", - "sha256": "188306098d013b691fcadc011abd66727d3c414c571bb01b1a174ba8c983cf90", - "filename": "tomli_w-1.2.0-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "uncalled-for": { - "version": "0.4.1", - "sha256": "b611b38879d9fe5088297e7bb28f2ddd12d2d73dad933d93da107fb63eb4058e", - "filename": "uncalled_for-0.4.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "beartype": { - "version": "0.23.0", - "sha256": "a88b85be516c064d4de2b42045a258a43be97bce5cbc18b777f332027c0979f7", - "filename": "beartype-0.23.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "openai": { - "version": "3.28.0", - "sha256": "1ea40a084ffe2f9f16fd3bea6e870f757853b536b18d8e737c518ef849a2920c", - "filename": "openai-3.28.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "pydantic-settings": { - "version": "2.15.0", - "sha256": "0ba092c291c94baceb5eff768aa0d56400a457585bc0175925a5a5510303da42", - "filename": "pydantic_settings-2.15.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "openapi-pydantic": { - "version": "0.6.0", - "sha256": "8bd6d548a250da37db96f461bcd52b3468e8834ad7d6db14b00a6b2ebbd163a3", - "filename": "openapi_pydantic-0.6.0-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "httpcore": { - "version": "1.0.9", - "sha256": "2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", - "filename": "httpcore-1.0.9-py3-none-any.whl", - "requires_python": ">=3.8" - }, - "exceptiongroup": { - "version": "1.3.1", - "sha256": "a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", - "filename": "exceptiongroup-1.3.1-py3-none-any.whl", - "requires_python": ">=3.7" - }, - "rich-rst": { - "version": "2.2.0", - "sha256": "1ea1c43813dc4a8d86475fce27ffb74e0ada3d4656c9f8130ba2a59868055fe9", - "filename": "rich_rst-2.2.0-py3-none-any.whl", - "requires_python": null - }, - "starlette": { - "version": "1.7.0", - "sha256": "67f8e99895493dd2911a03f11314af6ceebeae4e704bb9f43dfc6a9db151c93e", - "filename": "starlette-1.7.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "secretstorage": { - "version": "3.5.0", - "sha256": "0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137", - "filename": "secretstorage-3.5.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "annotated-doc": { - "version": "0.0.5", - "sha256": "117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101", - "filename": "annotated_doc-0.0.5-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "rpds-py": { - "version": "2026.9.1", - "sha256": "136a1c3fe4402b7008bc81cb62ee538481795b61a7e83df88dff3b3f02b726ff", - "filename": "rpds_py-2026.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", - "requires_python": ">=3.11" - }, - "markdown-it-py": { - "version": "4.2.0", - "sha256": "9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", - "filename": "markdown_it_py-4.2.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "mdurl": { - "version": "0.1.2", - "sha256": "84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", - "filename": "mdurl-0.1.2-py3-none-any.whl", - "requires_python": ">=3.7" - }, - "pandas": { - "version": "3.0.6", - "sha256": "47121f9571503f724c9b93e297ab6254ac99c77adf5e9ed085ea419fd585c258", - "filename": "pandas-3.0.6-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", - "requires_python": ">=3.11" - }, - "jsonschema-specifications": { - "version": "2025.9.1", - "sha256": "98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", - "filename": "jsonschema_specifications-2025.9.1-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "griffelib": { - "version": "2.3.2", - "sha256": "8e710afededd5607f95bf3c8ccc175ee306e7084459faf27b9f9f44ef2a7a274", - "filename": "griffelib-2.3.2-py3-none-any.whl", - "requires_python": ">=3.11" - }, - "tomlkit": { - "version": "0.14.0", - "sha256": "592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", - "filename": "tomlkit-0.14.0-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "gradio": { - "version": "6.30.0", - "sha256": "aae3aa81ec9f44e55781b498ad2ba12b117aa512e8d2bb0ef3e52af7f2ee6305", - "filename": "gradio-6.30.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "zipp": { - "version": "4.1.1", - "sha256": "8979f52d874162f485ff2981e3891f3a3317b7a3dd43ff1e1775b9304f307a9c", - "filename": "zipp-4.1.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "docstring-parser": { - "version": "0.18.0", - "sha256": "b3fcbed555c47d8479be0796ef7e19c2670d428d72e96da63f3a40122860374b", - "filename": "docstring_parser-0.18.0-py3-none-any.whl", - "requires_python": ">=3.8" - }, - "semantic-version": { - "version": "2.10.0", - "sha256": "de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177", - "filename": "semantic_version-2.10.0-py2.py3-none-any.whl", - "requires_python": ">=2.7" - }, - "jsonschema-path": { - "version": "0.5.0", - "sha256": "2790a070bc7abb08ea3dbe4d340ece4efadf639223001f020c7503229ba068e2", - "filename": "jsonschema_path-0.5.0-py3-none-any.whl", - "requires_python": ">=3.10,<4.0.0" - }, - "brotli": { - "version": "1.2.0", - "sha256": "40d918bce2b427a0c4ba189df7a006ac0c7277c180aee4617d99e9ccaaf59e6a", - "filename": "brotli-1.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", - "requires_python": null - }, - "markupsafe": { - "version": "3.0.4", - "sha256": "6da83a088f8ef93b2d483a8232a4dbf4d69d3d8496b568a03c56becac43e1808", - "filename": "markupsafe-3.0.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", - "requires_python": ">=3.9" - }, - "orjson": { - "version": "3.13.0", - "sha256": "89bcf2d4bc6c9a7e1763c8cf534f38712e66b76a0fefda7fb7785462f0d635e4", - "filename": "orjson-3.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", - "requires_python": ">=3.10" - }, - "importlib-metadata": { - "version": "9.0.1", - "sha256": "bba5600596a7e21f3eef53281cf28d6a5195634d2f2b78ff9501a3272c6eaab0", - "filename": "importlib_metadata-9.0.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "py-key-value-aio": { - "version": "0.4.6", - "sha256": "820b30c7959fc738ea3d00160cdb10cd258f51e38737b2add530defeea1ded77", - "filename": "py_key_value_aio-0.4.6-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "joserfc": { - "version": "1.7.5", - "sha256": "add2c2c84e8373b084d526a8b53daba5d7a513a118cd2dcd9fc9f979d0922159", - "filename": "joserfc-1.7.5-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "dnspython": { - "version": "2.9.0", - "sha256": "9a4aedb833c3c1b49214d04d44d3032ab7a9135f7c1d29a549b4ff78fd82fda9", - "filename": "dnspython-2.9.0-py3-none-any.whl", - "requires_python": ">=3.11" - }, - "tomli": { - "version": "2.5.0", - "sha256": "d7e369fd63331746182360977b1892bfc215476a30d61612d732425311639f56", - "filename": "tomli-2.5.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", - "requires_python": ">=3.8" - }, - "pydub": { - "version": "0.25.1", - "sha256": "65617e33033874b59d87db603aa1ed450633288aefead953b30bded59cb599a6", - "filename": "pydub-0.25.1-py2.py3-none-any.whl", - "requires_python": null - }, - "pillow": { - "version": "12.3.0", - "sha256": "23d27a3e0307ec2244cc51e7287b919aa68d097504ebe19df4e76a98a3eea5bd", - "filename": "pillow-12.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", - "requires_python": ">=3.10" - }, - "pathable": { - "version": "0.6.0", - "sha256": "82c4ca6c98c502ad12e0d4e9779b6210afee93c38990988c8c5d1b49bdcdf566", - "filename": "pathable-0.6.0-py3-none-any.whl", - "requires_python": ">=3.10,<4.0" - }, - "pydantic": { - "version": "2.14.0", - "sha256": "15fab1bea6f1dc5003b54fc2ecab230c1fd1dbade2acd4addc52d81e32416d4b", - "filename": "pydantic-2.14.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "six": { - "version": "1.17.0", - "sha256": "4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", - "filename": "six-1.17.0-py2.py3-none-any.whl", - "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" - }, - "cffi": { - "version": "2.1.1", - "sha256": "34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632", - "filename": "cffi-2.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", - "requires_python": ">=3.10" - }, - "attrs": { - "version": "26.1.0", - "sha256": "c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", - "filename": "attrs-26.1.0-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "jeepney": { - "version": "0.9.0", - "sha256": "97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683", - "filename": "jeepney-0.9.0-py3-none-any.whl", - "requires_python": ">=3.7" - }, - "charset-normalizer": { - "version": "3.5.2", - "sha256": "211d5a3eb6af8f513b8d4ca19a8c1b7accab1b5f0d3175f9826b03c1a920dc1f", - "filename": "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", - "requires_python": ">=3.7" - }, - "pytz": { - "version": "2026.5", - "sha256": "e658af3757f9e26a9d25dd2aff38335acd92bc9104f890a894b2c1ba28311b03", - "filename": "pytz-2026.5-py2.py3-none-any.whl", - "requires_python": null - }, - "python-dateutil": { - "version": "2.9.0.post0", - "sha256": "a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", - "filename": "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", - "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" - }, - "fastmcp": { - "version": "3.4.8", - "sha256": "ab4e8abe6c9d50b110f367e8c29f82b90c1478ac9180be61af10354f84f0ad8c", - "filename": "fastmcp-3.4.8-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "pygments": { - "version": "2.21.0", - "sha256": "2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", - "filename": "pygments-2.21.0-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "httpcore2": { - "version": "2.13.1", - "sha256": "e1e05d4f25f7d7d496bfb96748f6f4b67657b03da069b3a68c36069f3db73d0a", - "filename": "httpcore2-2.13.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "openenv": { - "version": "0.6.1.dev0", - "sha256": "93a5781b64e2f174f17fff40a558d43745a7f4e48a8b247363da4f27906be53a", - "filename": "openenv-0.6.1.dev0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "typer": { - "version": "0.27.3", - "sha256": "e50022f28b82a86313e54501317a1db64bf8f8d036ff8cfe5ca7e47675454aff", - "filename": "typer-0.27.3-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "jsonref": { - "version": "1.1.0", - "sha256": "590dc7773df6c21cbf948b5dac07a72a251db28b0238ceecce0a2abfa8ec30a9", - "filename": "jsonref-1.1.0-py3-none-any.whl", - "requires_python": ">=3.7" - }, - "referencing": { - "version": "0.37.0", - "sha256": "381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", - "filename": "referencing-0.37.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "rich": { - "version": "15.0.0", - "sha256": "33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", - "filename": "rich-15.0.0-py3-none-any.whl", - "requires_python": ">=3.9.0" - }, - "annotated-types": { - "version": "0.8.0", - "sha256": "f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", - "filename": "annotated_types-0.8.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "jsonschema": { - "version": "4.26.0", - "sha256": "d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce", - "filename": "jsonschema-4.26.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "numpy": { - "version": "2.4.6", - "sha256": "89cd468399cfd2504718f0ba50e410dca55a170b61a02ad92bb18c8a65186e93", - "filename": "numpy-2.4.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", - "requires_python": ">=3.11" - }, - "shellingham": { - "version": "1.5.4", - "sha256": "7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", - "filename": "shellingham-1.5.4-py2.py3-none-any.whl", - "requires_python": ">=3.7" - }, - "jinja2": { - "version": "3.1.6", - "sha256": "85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", - "filename": "jinja2-3.1.6-py3-none-any.whl", - "requires_python": ">=3.7" - }, - "caio": { - "version": "0.12.9", - "sha256": "bf12d4f014b2a33e642ed7905b5787656ede2fc24be21f7c086826ff0d32cec3", - "filename": "caio-0.12.9-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "watchfiles": { - "version": "1.3.0", - "sha256": "b5768b49e426fd5b550b012c866db347cdf15c398ef98dc557b6e6b72fa74cd1", - "filename": "watchfiles-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", - "requires_python": ">=3.10" - }, - "fsspec": { - "version": "2026.9.0", - "sha256": "8dd6e646e99ea382bd85f97a45e6b526a442d79423a7dc673f1e2756d05fcb5f", - "filename": "fsspec-2026.9.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "aiofile": { - "version": "3.12.3", - "sha256": "5c1bcc9e929c50834608e8cc1a4cc1d7503eb60c15a535b779fd39e2f372c017", - "filename": "aiofile-3.12.3-py3-none-any.whl", - "requires_python": ">=3.11" - }, - "pydantic-core": { - "version": "2.50.0", - "sha256": "ac223ea031905319a64d0df116979ae438b42d6265862a3d63c9f9808c2905a7", - "filename": "pydantic_core-2.50.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", - "requires_python": ">=3.10" - }, - "typing-inspection": { - "version": "0.4.4", - "sha256": "65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", - "filename": "typing_inspection-0.4.4-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "typing-extensions": { - "version": "4.16.0", - "sha256": "481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", - "filename": "typing_extensions-4.16.0-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "gradio-client": { - "version": "2.7.2", - "sha256": "12c9d2d940df28eb8dce58eef61f5e808265ad87bbbca53704d1330aa701e5e2", - "filename": "gradio_client-2.7.2-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "authlib": { - "version": "1.8.0", - "sha256": "88aebbd9af6757e14e912d5dc007ae1dc1f3e27e3b2152ce7c552ee2c3b3c121", - "filename": "authlib-1.8.0-py2.py3-none-any.whl", - "requires_python": ">=3.10" - }, - "jaraco.functools": { - "version": "4.6.0", - "sha256": "99e3dc0060c5cbe8fcd1cdb36258e2a65ca40f1566b2033b12abb1bb44dd3c30", - "filename": "jaraco_functools-4.6.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "jiter": { - "version": "0.17.0", - "sha256": "5888fe5abc1ca2fa834a3e1b4c7ef0dcece286a7d7e95a609ef0934b777b9fc9", - "filename": "jiter-0.17.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", - "requires_python": ">=3.10" - }, - "httpx2": { - "version": "2.13.1", - "sha256": "6dff50fabc270ee5fd25d845d0b078ed20564579744d6d962850975996d2f9a4", - "filename": "httpx2-2.13.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "sse-starlette": { - "version": "3.5.0", - "sha256": "3e6e1070df3f0f5d9cea81496de92dbb72f6721871d99748ece67441dd8b7997", - "filename": "sse_starlette-3.5.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "platformdirs": { - "version": "4.12.4", - "sha256": "78bfb9db2a8471ed7eebe3c3c932da413911042994e699b384fbb4493fa872d7", - "filename": "platformdirs-4.12.4-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "cyclopts": { - "version": "5.2.0", - "sha256": "5da2a5d65164e03008621fc4795946b88a722b881398b5dfa58afa6218342cff", - "filename": "cyclopts-5.2.0-py3-none-any.whl", - "requires_python": ">=3.11" - }, - "pyyaml": { - "version": "6.0.3", - "sha256": "b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d", - "filename": "pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", - "requires_python": ">=3.8" - }, - "pyperclip": { - "version": "1.11.0", - "sha256": "299403e9ff44581cb9ba2ffeed69c7aa96a008622ad0c46cb575ca75b5b84273", - "filename": "pyperclip-1.11.0-py3-none-any.whl", - "requires_python": null - }, - "cachetools": { - "version": "7.2.1", - "sha256": "63aa53dfe7473c10cccdd5a01dedf76ef2c4b73a58840d9396e7d0752cbdac3b", - "filename": "cachetools-7.2.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "groovy": { - "version": "0.1.2", - "sha256": "7f7975bab18c729a257a8b1ae9dcd70b7cafb1720481beae47719af57c35fa64", - "filename": "groovy-0.1.2-py3-none-any.whl", - "requires_python": ">3.9" - }, - "websockets": { - "version": "17.2", - "sha256": "376a693697ddb695ea282ead76060f4847f90e564b12b4389f2c7589e6fadb9e", - "filename": "websockets-17.2-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", - "requires_python": ">=3.11" - }, - "httpx": { - "version": "0.28.1", - "sha256": "d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", - "filename": "httpx-0.28.1-py3-none-any.whl", - "requires_python": ">=3.8" - }, - "jaraco.context": { - "version": "6.1.2", - "sha256": "bf8150b79a2d5d91ae48629d8b427a8f7ba0e1097dd6202a9059f29a36379535", - "filename": "jaraco_context-6.1.2-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "python-multipart": { - "version": "0.0.32", - "sha256": "ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23", - "filename": "python_multipart-0.0.32-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "requests": { - "version": "2.34.2", - "sha256": "2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", - "filename": "requests-2.34.2-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "pyjwt": { - "version": "2.15.1", - "sha256": "42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193", - "filename": "pyjwt-2.15.1-py3-none-any.whl", - "requires_python": ">=3.9" - }, - "anyio": { - "version": "4.15.1", - "sha256": "6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101", - "filename": "anyio-4.15.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "uvicorn": { - "version": "0.54.0", - "sha256": "505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf", - "filename": "uvicorn-0.54.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "tqdm": { - "version": "4.70.1", - "sha256": "c293e525e6fef9c20e8728fd4612df02a0aa31bb5fe91ecd93e123b1b7bffa73", - "filename": "tqdm-4.70.1-py3-none-any.whl", - "requires_python": ">=3.8" - }, - "fastmcp-slim": { - "version": "3.4.8", - "sha256": "e72c6b74e90c5dcdc8f58087fbdf213636d8b5d339384a498de1c5df6fc037a7", - "filename": "fastmcp_slim-3.4.8-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "backports.tarfile": { - "version": "1.2.0", - "sha256": "77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34", - "filename": "backports.tarfile-1.2.0-py3-none-any.whl", - "requires_python": ">=3.8" - }, - "opentelemetry-api": { - "version": "1.45.1", - "sha256": "b31553efa588ae44bc306f863c785c5333a9ecc091248c6ee68b4b6c87fdedfb", - "filename": "opentelemetry_api-1.45.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "sniffio": { - "version": "1.3.1", - "sha256": "2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", - "filename": "sniffio-1.3.1-py3-none-any.whl", - "requires_python": ">=3.7" - }, - "filelock": { - "version": "4.1.0", - "sha256": "2ce9818e3e2d8f284c1a964414447ef148d42a5fd5e2a477a7118e574b293ec1", - "filename": "filelock-4.1.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "hf-gradio": { - "version": "0.4.1", - "sha256": "76b8cb8be6abe62d74c1ad2d35b42f0629db89aa9e1a8d033cecfe7c856eeab3", - "filename": "hf_gradio-0.4.1-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "mcp": { - "version": "1.30.0", - "sha256": "666edb5009503e1047c9d60346a756f94b261f05cc2625f23d41c728ffc484d0", - "filename": "mcp-1.30.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "email-validator": { - "version": "2.3.0", - "sha256": "80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4", - "filename": "email_validator-2.3.0-py3-none-any.whl", - "requires_python": ">=3.8" - }, - "hf-xet": { - "version": "1.7.0", - "sha256": "2814a6e999d13464c4d679b788cc5d784eb5a4edfc638a31f10e9a11ab531ef8", - "filename": "hf_xet-1.7.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", - "requires_python": ">=3.8" - }, - "certifi": { - "version": "2026.7.22", - "sha256": "62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", - "filename": "certifi-2026.7.22-py3-none-any.whl", - "requires_python": ">=3.7" - }, - "fastapi": { - "version": "0.143.0", - "sha256": "3e9395fd35276425b61b516a31fdd7c77fe2af83e41b4da22e30696fb1304c5d", - "filename": "fastapi-0.143.0-py3-none-any.whl", - "requires_python": ">=3.10" - }, - "h11": { - "version": "0.16.0", - "sha256": "63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", - "filename": "h11-0.16.0-py3-none-any.whl", - "requires_python": ">=3.8" - }, - "click": { - "version": "8.5.0", - "sha256": "255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360", - "filename": "click-8.5.0-py3-none-any.whl", - "requires_python": ">=3.10" - } - } -} diff --git a/components/math/SOURCE.json b/components/math/SOURCE.json deleted file mode 100644 index 48d0d4f16d85cbaf7a4bf86bc471f29c7f14f2b9..0000000000000000000000000000000000000000 --- a/components/math/SOURCE.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "source_dataset": "amphora/MathConstructOptimize-Envs-harbor", - "source_revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "source_url": "https://huggingface.co/datasets/amphora/MathConstructOptimize-Envs-harbor/tree/66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "tasks": [ - { - "task_id": "construct-mc-costas-array-l3-s0", - "source": "MathConstraint", - "license": "CC-BY-4.0" - } - ], - "adaptation": "Original prompts, instances and checker files unchanged. Shared OpenEnv action/observation and isolated shell execution added. Original task workspace and no-network policy preserved. Upstream solution scripts omitted from runtime and this source component.", - "inventory": "../../SOURCE_LOCK.json", - "execution_limits": { - "commands": 64, - "command_timeout_seconds": 90, - "verifier_timeout_cap_seconds": 90, - "finish_after_command_budget": "separate_request" - } -} diff --git a/components/math/TASKS.json b/components/math/TASKS.json deleted file mode 100644 index 80c09ef34da74f4055b567798b0b612b8280d19f..0000000000000000000000000000000000000000 --- a/components/math/TASKS.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "tasks": [ - { - "task_id": "construct-mc-costas-array-l3-s0", - "interface": { - "operations": [ - "exec", - "finish" - ], - "workspace": "/workdir", - "input": "/workdir/instance.json", - "output": "/workdir/answer.json", - "network": false, - "finish_after_command_budget": "separate_request" - }, - "resources": { - "cpus": 2, - "memory_mb": 4096, - "agent_timeout_sec": 900.0, - "verifier_timeout_sec": 90, - "command_timeout_sec": 90, - "max_commands": 64 - }, - "source": { - "repo": "amphora/MathConstructOptimize-Envs-harbor", - "revision": "66cd5c87d51113c76faaef1b05397f1a6282a0f7", - "path": "tasks/construct-mc-costas-array-l3-s0", - "original_family": "MathConstraint/costas_array", - "license": "CC-BY-4.0" - }, - "original_limits": { - "cpus": 2, - "memory_mb": 4096, - "agent_timeout_sec": 900.0, - "verifier_timeout_sec": 300.0 - } - } - ], - "schema_sha256": "10993deaaa8553929fa0b3b6bf3c1ad100baaaf9ff10ae8ed139a8ec4279a3c4", - "image_task_count": 1 -} diff --git a/components/math/config.json b/components/math/config.json deleted file mode 100644 index a10af22f598f79eb5840d05bfd6fecffa9e483c0..0000000000000000000000000000000000000000 --- a/components/math/config.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "tasks": [ - { - "id": "construct-mc-costas-array-l3-s0", - "source": "/opt/native-shell/tasks/construct-mc-costas-array-l3-s0/source", - "pristine_workspace": "/opt/native-shell/tasks/construct-mc-costas-array-l3-s0/pristine", - "workspace": "/workdir", - "inputs": [ - "/workdir/instance.json" - ], - "outputs": [ - "/workdir/answer.json" - ], - "editable": [], - "grading_mode": "file-output", - "grader": { - "kind": "original-shell", - "script": "test.sh", - "executes_learner_code": false - }, - "python": "/usr/local/bin/python3", - "cpus": 2, - "memory_mb": 4096, - "agent_timeout_sec": 900.0, - "verifier_timeout_sec": 300.0, - "source_sha256": { - "task.toml": "b62ba527da418f1b84d165707ea56ea805953289b0993cc3176e988ef59c3d32", - "instruction.md": "88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9", - "tests/run.py": "d364958443f46cf3ebb71808afc270e23203f62550246eb5008a847a8701bd73", - "tests/check.py": "3c0290e35201f077926099989cd0e82c10bf091cb33c572cacc02bca075debdb", - "tests/test.sh": "a35b815edf35d07fee8b5b341be2af0539010888f73ce39a0c15f025367eae3e", - "tests/instance.json": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5" - }, - "pristine_sha256": { - "instance.json": "15a02495c009c52f7cbc0f2c1daa95e0a4d0981026e123b83aaa892565fd68b5" - } - } - ], - "private_root": "/opt/native-shell/private", - "max_actions": 64, - "command_timeout_sec": 90, - "output_limit_bytes": 65536 -} diff --git a/components/math/licenses/MathConstraint-LICENSE b/components/math/licenses/MathConstraint-LICENSE deleted file mode 100644 index 4ea99c213c5c0c005ae4e80df8e52169d06896ec..0000000000000000000000000000000000000000 --- a/components/math/licenses/MathConstraint-LICENSE +++ /dev/null @@ -1,395 +0,0 @@ -Attribution 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution 4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution 4.0 International Public License ("Public License"). To the -extent this Public License may be interpreted as a contract, You are -granted the Licensed Rights in consideration of Your acceptance of -these terms and conditions, and the Licensor grants You such rights in -consideration of benefits the Licensor receives from making the -Licensed Material available under these terms and conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - d. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - e. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - f. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - g. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - h. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - i. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - j. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - k. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - 4. If You Share Adapted Material You produce, the Adapter's - License You apply must not prevent recipients of the Adapted - Material from complying with this Public License. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material; and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/components/math/licenses/UPSTREAM_COLLECTION_LICENSES.md b/components/math/licenses/UPSTREAM_COLLECTION_LICENSES.md deleted file mode 100644 index 456ee2faedb2514e72a6d3c735adb745dc943146..0000000000000000000000000000000000000000 --- a/components/math/licenses/UPSTREAM_COLLECTION_LICENSES.md +++ /dev/null @@ -1,9 +0,0 @@ -# Licenses - -This collection repackages tasks from several sources. Each row's `license` column gives the license of its source: - -- MIT: RLVE-Gym, NPPC, EinsteinArena (platform and baselines) -- CC-BY-4.0: MathConstraint; AlphaEvolve repository of problems (materials) -- Apache-2.0: Reasoning Gym, FunSearch, AlphaEvolve repository of problems (code), Finch / Evolution Fine-Tuning (code) - -Please attribute the original authors when using the corresponding tasks. diff --git a/components/math/runtime/common/http_routes.py b/components/math/runtime/common/http_routes.py deleted file mode 100644 index a3ab94f85fc92d044895d022d16d4659be018d8b..0000000000000000000000000000000000000000 --- a/components/math/runtime/common/http_routes.py +++ /dev/null @@ -1,64 +0,0 @@ - -from threading import RLock -from contextlib import asynccontextmanager -from copy import deepcopy -from fastapi import HTTPException -from pydantic import ValidationError -from starlette.concurrency import run_in_threadpool -from openenv.core.env_server.serialization import serialize_observation -from openenv.core.env_server.types import ResetRequest,ResetResponse,StepRequest,StepResponse -from .models import ArenaAction - - -def install_persistent_http_routes(app,env,conflict_error=None): - lock=RLock() - app.router.routes=[route for route in app.router.routes if getattr(route,'path',None) not in {'/reset','/step','/state'}] - - def reset_sync(request): - with lock: - return ResetResponse(**serialize_observation(env.reset(**request.model_dump(exclude_unset=True)))) - - def step_sync(request): - with lock: - action=ArenaAction.model_validate(request.action) - return StepResponse(**serialize_observation(env.step(action,timeout_s=request.timeout_s))) - - def state_sync(): - with lock: - value=env.state - return value.model_copy(deep=True) if hasattr(value,'model_copy') else deepcopy(value) - - @app.post('/reset',response_model=ResetResponse) - async def reset(request:ResetRequest): - try:return await run_in_threadpool(reset_sync,request) - except (ValueError,IndexError) as exc:raise HTTPException(status_code=400,detail=str(exc)) from exc - except Exception as exc: - if conflict_error is not None and isinstance(exc,conflict_error): - raise HTTPException(status_code=409,detail=str(exc)) from exc - raise - - @app.post('/step',response_model=StepResponse) - async def step(request:StepRequest): - try:return await run_in_threadpool(step_sync,request) - except (ValueError,ValidationError) as exc:raise HTTPException(status_code=422,detail=str(exc)) from exc - - @app.get('/state') - async def state(): - return await run_in_threadpool(state_sync) - - def shutdown(): - with lock:env.close() - - - - - original_lifespan=app.router.lifespan_context - - @asynccontextmanager - async def lifespan(application): - async with original_lifespan(application) as state: - try:yield state - finally:await run_in_threadpool(shutdown) - - app.router.lifespan_context=lifespan - return lock diff --git a/components/math/runtime/native_shell/__init__.py b/components/math/runtime/native_shell/__init__.py deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/components/math/runtime/native_shell/actor_launcher.py b/components/math/runtime/native_shell/actor_launcher.py deleted file mode 100644 index 82e7bd183e0e328163d12ef3fb049c14737c8978..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/actor_launcher.py +++ /dev/null @@ -1,117 +0,0 @@ - -import argparse -import ctypes -import errno -import os -import resource -import sys - - -def deny_actor_network(): - - - - - - lib = ctypes.CDLL("libseccomp.so.2", use_errno=True) - lib.seccomp_init.argtypes = [ctypes.c_uint32] - lib.seccomp_init.restype = ctypes.c_void_p - lib.seccomp_syscall_resolve_name.argtypes = [ctypes.c_char_p] - lib.seccomp_syscall_resolve_name.restype = ctypes.c_int - lib.seccomp_rule_add.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_int, ctypes.c_uint] - lib.seccomp_rule_add.restype = ctypes.c_int - lib.seccomp_load.argtypes = [ctypes.c_void_p] - lib.seccomp_load.restype = ctypes.c_int - lib.seccomp_release.argtypes = [ctypes.c_void_p] - context = lib.seccomp_init(0x7FFF0000) - if not context: - raise RuntimeError("seccomp_init failed") - blocked = ("socket", "socketpair", "connect", "bind", "listen", "accept", "accept4", - "sendto", "sendmsg", "sendmmsg", "recvfrom", "recvmsg", "recvmmsg", - "shutdown", "getsockname", "getpeername", "setsockopt", "getsockopt", - - "io_uring_setup", "io_uring_register", "io_uring_enter") - try: - for name in blocked: - number = lib.seccomp_syscall_resolve_name(name.encode()) - if number < 0: - raise RuntimeError("Required syscall could not be resolved: " + name) - rc = lib.seccomp_rule_add(context, 0x00050000 | errno.EPERM, number, 0) - if rc: - raise OSError(-rc, "seccomp rule: " + name) - rc = lib.seccomp_load(context) - if rc: - raise OSError(-rc, "seccomp_load") - finally: - lib.seccomp_release(context) - - -def enter(uid, gid, cwd, status_fd, memory_mb, cpus, nproc): - if sys.platform != "linux" or os.geteuid() != 0 or uid <= 0 or gid <= 0: - raise RuntimeError("A Linux root supervisor and non-root actor IDs are required") - libc = ctypes.CDLL(None, use_errno=True) - if libc.prctl(38, 1, 0, 0, 0): - raise OSError(ctypes.get_errno(), "PR_SET_NO_NEW_PRIVS") - if libc.prctl(47, 4, 0, 0, 0): - raise OSError(ctypes.get_errno(), "PR_CAP_AMBIENT_CLEAR_ALL") - if libc.prctl(8, 0, 0, 0, 0): - raise OSError(ctypes.get_errno(), "PR_SET_KEEPCAPS") - os.setgroups([]) - os.setresgid(gid, gid, gid) - os.setresuid(uid, uid, uid) - if os.getresuid() != (uid, uid, uid) or os.getresgid() != (gid, gid, gid): - raise RuntimeError("Actor identity change did not take effect") - if libc.prctl(4, 0, 0, 0, 0): - raise OSError(ctypes.get_errno(), "PR_SET_DUMPABLE") - os.chdir(cwd) - os.umask(0o077) - resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) - resource.setrlimit(resource.RLIMIT_FSIZE, (16 * 1024 * 1024,) * 2) - resource.setrlimit(resource.RLIMIT_NOFILE, (128, 128)) - resource.setrlimit(resource.RLIMIT_NPROC, (nproc, nproc)) - resource.setrlimit(resource.RLIMIT_AS, (memory_mb * 1024 * 1024,) * 2) - allowed = sorted(os.sched_getaffinity(0)) - os.sched_setaffinity(0, allowed[:cpus]) - deny_actor_network() - state = dict(line.split(":", 1) for line in open("/proc/self/status") if ":" in line) - if state["NoNewPrivs"].strip() != "1" or int(state["CapEff"].strip(), 16): - raise RuntimeError("Actor still has effective capabilities or lacks no_new_privs") - if state["Seccomp"].strip() != "2": - raise RuntimeError("Actor seccomp filter did not become active") - os.write(status_fd, b"ready") - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("--uid", type=int, required=True) - parser.add_argument("--gid", type=int, required=True) - parser.add_argument("--cwd", required=True) - parser.add_argument("--status-fd", type=int, required=True) - parser.add_argument('--memory-mb', type=int, required=True) - parser.add_argument('--cpus', type=int, required=True) - parser.add_argument('--nproc', type=int, default=32) - parser.add_argument("argv", nargs=argparse.REMAINDER) - args = parser.parse_args() - argv = args.argv[1:] if args.argv[:1] == ["--"] else args.argv - if not argv: - parser.error("A command is required") - try: - if not 128 <= args.memory_mb <= 16384 or not 1 <= args.cpus <= 2 or not 1 <= args.nproc <= 64: - raise ValueError('Invalid actor resource bounds') - enter(args.uid, args.gid, args.cwd, args.status_fd, args.memory_mb, args.cpus, args.nproc) - except Exception as exc: - os.write(args.status_fd, ("error:" + str(exc)).encode()[:2048]) - raise - finally: - os.close(args.status_fd) - - env = {"PATH": "/usr/local/bin:/usr/bin:/bin", "HOME": args.cwd, - "TMPDIR": args.cwd + "/.actor_tmp", "LANG": "C.UTF-8", - "LC_ALL": "C.UTF-8", "PYTHONDONTWRITEBYTECODE": "1", - "OPENBLAS_NUM_THREADS": str(args.cpus), "OMP_NUM_THREADS": str(args.cpus), - "MKL_NUM_THREADS": str(args.cpus), "NUMEXPR_NUM_THREADS": str(args.cpus)} - os.execvpe(argv[0], argv, env) - - -if __name__ == "__main__": - main() diff --git a/components/math/runtime/native_shell/backend.py b/components/math/runtime/native_shell/backend.py deleted file mode 100644 index fb77286419c9f68d907e3558d4a37b7730be02c5..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/backend.py +++ /dev/null @@ -1,264 +0,0 @@ - - - - - -import hashlib -import json -import math -import os -from pathlib import Path -import shutil -import signal -import subprocess -import sys -from threading import Lock, RLock -import time -from uuid import uuid4 - -from common.contracts import ACTION_SCHEMA, observation_payload -from .guard import Guard, GuardError, InvalidOutput, Policy, ordinary - -_lease = Lock() - - -class RuntimeUnavailable(RuntimeError): - pass - - -def sha256(path): - return hashlib.sha256(Path(path).read_bytes()).hexdigest() - - -def clear_contents(path): - path = Path(path) - if path.is_symlink(): - raise RuntimeUnavailable('Trusted root was replaced by a symlink') - path.mkdir(parents=True, exist_ok=True) - for child in path.iterdir(): - if not child.is_symlink() and child.is_dir(): - shutil.rmtree(child) - else: - child.unlink() - - -class ShellBackend: - def __init__(self, config_path=None): - self.config_path=Path(config_path or os.environ.get('NATIVE_SHELL_CONFIG','/opt/native-shell/config.json')) - self.config=json.loads(self.config_path.read_text()) - self.tasks={item['id']:item for item in self.config['tasks']} - if not self.tasks: - raise ValueError('No prepared tasks') - if len({task['workspace'] for task in self.tasks.values()})!=1: - raise ValueError('One runtime image must use one original workspace root') - for task in self.tasks.values(): - if task.get('grading_mode') != 'file-output': - raise ValueError('Learner-code graders are not supported by the file-output guard') - if task['grader']['kind'] not in ('pytest', 'original-shell'): - raise ValueError('Unreviewed grader kind') - if task['grader'].get('executes_learner_code') is not False: - raise ValueError('Explicit file-output grader review is required') - work=Path(task['workspace']) - if str(work) not in ('/app','/workdir','/home/user'): - raise ValueError('Workspace must be an explicitly supported original task root') - if not (128 <= task['memory_mb'] <= 16384 and 1 <= task['cpus'] <= 2): - raise ValueError('Resources exceed the reviewed Arena bounds') - self.lock=RLock() - self.owns_lease=False - self.guard=None - self.task=None - self.final=None - self.failed=False - self.episode_id=None - self.step_count=0 - self.started=0.0 - - def _private_root(self): - return Path(self.config.get('private_root','/opt/native-shell/private')) - - def _check_task_sources(self,task): - root=Path(task['source']) - actual={str(path.relative_to(root)) for path in root.rglob('*') if path.is_file()} - if actual!=set(task['source_sha256']) or any(path.is_symlink() for path in root.rglob('*')): - raise RuntimeUnavailable('Pinned original source tree membership changed') - for relative,digest in task['source_sha256'].items(): - path=root/relative - if path.is_symlink() or not path.is_file() or sha256(path)!=digest: - raise RuntimeUnavailable('Pinned original task source changed') - pristine=Path(task['pristine_workspace']) - if {str(path.relative_to(pristine)) for path in pristine.rglob('*') if path.is_file()}!=set(task['pristine_sha256']): - raise RuntimeUnavailable('Pristine input tree membership changed') - for relative,digest in task['pristine_sha256'].items(): - path=pristine/relative - if path.is_symlink() or not path.is_file() or sha256(path)!=digest: - raise RuntimeUnavailable('Pristine task input changed') - - def reset(self,*,task_id=None,index=None,split='train',seed=None,episode_id=None,**kwargs): - with self.lock: - if sys.platform!='linux' or os.geteuid()!=0 or os.environ.get('ARENA_DEDICATED_CONTAINER')!='1': - raise RuntimeUnavailable('Use a dedicated disposable Linux container with a root supervisor') - if split!='train': - raise ValueError('Unknown split') - if task_id is None: - selected=0 if index is None else index - if type(selected) is not int or not 0<=selected=self.config.get('max_actions',64): - return self._finish() - if len(action['command'].encode())>1048576: - raise ValueError('Command exceeds the transport limit') - limit=min(float(timeout_s or self.config.get('command_timeout_sec',120)),remaining, - self.config.get('command_timeout_sec',120)) - result=self.guard.run_actor(action['command'],timeout=max(.01,limit), - output_limit=self.config.get('output_limit_bytes',65536)) - self.step_count+=1 - exhausted=self.step_count>=self.config.get('max_actions',64) - result.update(actions_remaining=max(0,self.config.get('max_actions',64)-self.step_count),finish_required=exhausted) - return observation_payload(self.task['id'],'Command completed. Finish to grade.' if exhausted else 'Command completed.',result) - - def _finish(self): - try: - return self._finish_impl() - except Exception: - self.failed=True - self.guard.stop_actor() - raise - finally: - if self.owns_lease: - self.owns_lease=False - _lease.release() - - def _finish_impl(self): - try: - self.guard.freeze() - except InvalidOutput: - self.guard.stop_actor() - self.final=observation_payload(self.task['id'],'Output violates the published regular-file boundary.', - {'status':'invalid_output'},reward=0.0,done=True) - return self.final - - - - grader=self.task['grader'] - python=self.task['python'] - verifier_timeout=min(90.0,float(self.task['verifier_timeout_sec'])) - private=self._private_root()/'episode' - verifier_tmp=private/'tmp';verifier_tmp.mkdir(mode=0o700) - if grader['kind']=='pytest': - command=[python,'-I','-B','-m','pytest','-c','/dev/null','--confcutdir=/tests', - '--rootdir=/tests','--import-mode=importlib','-p','no:cacheprovider', - '/tests/'+grader['test_file'],'-q'] - else: - command=['/bin/bash','--noprofile','--norc','/tests/'+grader['script']] - command=[python,'-I','-B',str(Path(__file__).with_name('verifier_launcher.py')), - '--cpus',str(self.task['cpus']),'--memory-mb',str(self.task['memory_mb']), - '--wall-seconds',str(verifier_timeout),'--',*command] - env={'PATH':'/usr/local/bin:/usr/bin:/bin','HOME':'/root','LANG':'C.UTF-8','LC_ALL':'C.UTF-8', - 'PYTHONDONTWRITEBYTECODE':'1','PYTHONNOUSERSITE':'1','PYTEST_DISABLE_PLUGIN_AUTOLOAD':'1', - 'OPENBLAS_NUM_THREADS':str(self.task['cpus']),'OMP_NUM_THREADS':str(self.task['cpus']), - 'TMPDIR':str(verifier_tmp)} - process=subprocess.Popen(command,cwd='/tests',env=env,stdin=subprocess.DEVNULL, - stdout=subprocess.PIPE,stderr=subprocess.PIPE,start_new_session=True) - try: - stdout,stderr=process.communicate(timeout=verifier_timeout) - except subprocess.TimeoutExpired: - os.killpg(process.pid,signal.SIGKILL);process.communicate() - raise RuntimeUnavailable('Original verifier exceeded its time limit') - self.guard.check_integrity() - (private/'verifier-result.json').write_text(json.dumps({'return_code':process.returncode, - 'stdout':stdout.decode(errors='replace')[-262144:],'stderr':stderr.decode(errors='replace')[-262144:]},indent=2)+'\n') - if grader['kind']=='pytest': - if process.returncode not in (0,1): - raise RuntimeUnavailable('Original pytest did not produce a valid score') - reward=float(process.returncode==0) - else: - if process.returncode!=0: - raise RuntimeUnavailable('Original grader script failed') - try:reward=float(Path('/logs/verifier/reward.txt').read_text().strip()) - except (OSError,ValueError) as exc:raise RuntimeUnavailable('Original grader produced no numeric score') from exc - if not math.isfinite(reward) or not 0<=reward<=1: - raise RuntimeUnavailable('Original grader produced an invalid score') - self.final=observation_payload(self.task['id'],'Original verifier completed.', - {'status':'verified','step_count':self.step_count},reward=reward,done=True) - return self.final - - @property - def state(self): - return {'episode_id':self.episode_id,'step_count':self.step_count,'task_id':self.task['id'] if self.task else None, - 'done':self.final is not None or self.failed,'infrastructure_failed':self.failed} - - def close(self): - with self.lock: - if self.owns_lease: - try: - if self.guard is not None:self.guard.stop_actor() - finally: - self.guard=None;self.task=None;self.final=None;self.episode_id=None;self.failed=False - self.owns_lease=False;_lease.release() diff --git a/components/math/runtime/native_shell/environment.py b/components/math/runtime/native_shell/environment.py deleted file mode 100644 index c5bd72d364747be79eb618ee2f0a042ceba972ea..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/environment.py +++ /dev/null @@ -1,46 +0,0 @@ - -from openenv.core.env_server.interfaces import Environment -from openenv.core.env_server.types import State, EnvironmentMetadata -from common.models import ArenaAction, ArenaObservation -from .backend import ShellBackend - - -class NativeHarborEnvironment(Environment): - SUPPORTS_CONCURRENT_SESSIONS = False - - def __init__(self): - super().__init__() - self.backend=ShellBackend() - - def reset(self,**kwargs): - return ArenaObservation.model_validate(self.backend.reset(**kwargs)) - - def step(self,action,timeout_s=None,**kwargs): - value=action.action_payload() if isinstance(action,ArenaAction) else ArenaAction.model_validate(action).action_payload() - return ArenaObservation.model_validate(self.backend.step(value,timeout_s=timeout_s)) - - @property - def state(self): - return State.model_validate(self.backend.state) - - def close(self): - self.backend.close() - - def get_metadata(self): - return EnvironmentMetadata(name='native_harbor',version='0.1.0',description='Original Harbor tasks with offline dependencies and private file-output grading.') - - def list_splits(self): - return ['train'] - - def list_tasks(self,split): - if split!='train':raise ValueError('Unknown split') - return [{'id':key,'index':index} for index,key in enumerate(self.backend.tasks)] - - def num_tasks(self,split): - return len(self.list_tasks(split)) - - def get_task(self,split,index): - return self.list_tasks(split)[index] - - def get_task_range(self,split,start=None,stop=None): - return self.list_tasks(split)[start:stop] diff --git a/components/math/runtime/native_shell/guard.py b/components/math/runtime/native_shell/guard.py deleted file mode 100644 index 22d92442be74beefa1c4ef9b21be0f55a12df800..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/guard.py +++ /dev/null @@ -1,309 +0,0 @@ - - - - - -from dataclasses import dataclass -import hashlib -import json -import os -from pathlib import Path -import selectors -import signal -import stat -import subprocess -import sys -import time - - -try: - from .process_scope import current_scope -except ImportError: - from process_scope import current_scope - - -class GuardError(RuntimeError): - pass - - -class InvalidOutput(GuardError): - pass - - -def ordinary(path): - path = Path(path) - for current in [path, *path.parents]: - if current.is_symlink(): - raise GuardError(f"Symlink is forbidden in guarded path: {current}") - st = path.lstat() - if not (stat.S_ISREG(st.st_mode) or stat.S_ISDIR(st.st_mode)): - raise GuardError(f"Special filesystem object: {path}") - if stat.S_ISREG(st.st_mode) and st.st_nlink != 1: - raise GuardError(f"Hard-linked file: {path}") - return st - - -def descendants(path): - - pending = [(Path(path), 0)] - seen = 0 - while pending: - current, depth = pending.pop() - seen += 1 - if depth > 32 or seen > 4096: - raise GuardError("Guarded tree exceeds prototype depth/file limits") - st = ordinary(current) - yield current - if stat.S_ISDIR(st.st_mode): - pending.extend((child, depth + 1) for child in sorted(current.iterdir(), reverse=True)) - - -def record(path): - st = ordinary(path) - result = {"uid": st.st_uid, "gid": st.st_gid, "mode": stat.S_IMODE(st.st_mode), - "dev": st.st_dev, "inode": st.st_ino, - "kind": "directory" if stat.S_ISDIR(st.st_mode) else "file"} - if stat.S_ISREG(st.st_mode): - h = hashlib.sha256() - with open(path, "rb") as stream: - for block in iter(lambda: stream.read(65536), b""): - h.update(block) - result.update(size=st.st_size, nlink=st.st_nlink, sha256=h.hexdigest()) - return result - - -@dataclass(frozen=True) -class Policy: - workspace: Path - inputs: tuple[Path, ...] - private_paths: tuple[Path, ...] - output_paths: tuple[Path, ...] - editable_paths: tuple[Path, ...] = () - private_write_dirs: tuple[Path, ...] = (Path("/logs/verifier"),) - uid: int = 2000 - gid: int = 2000 - state_dir: Path = Path("/opt/guard-private") - memory_mb: int = 2048 - cpus: int = 1 - nproc: int = 32 - actor_python: str = '/usr/local/bin/python3' - - -class Guard: - def __init__(self, policy): - if sys.platform != "linux" or os.geteuid() != 0: - raise GuardError("Guard requires a dedicated Linux root supervisor") - self.policy = policy - self.scope = current_scope() - self.records = {} - self.closed_trees = {} - self.phase = "new" - - @staticmethod - def check_runtime_paths(): - - - for path in [Path(sys.executable).resolve(), Path("/bin/bash").resolve(), - Path("/usr/local/bin"), Path("/usr/bin")]: - for item in [path, *path.parents]: - st = item.stat() - if st.st_uid != 0 or st.st_mode & 0o022: - raise GuardError(f"Untrusted runtime lookup path: {item}") - - def _protect_parents(self, path): - - - for parent in [Path(path).parent, *Path(path).parent.parents]: - st = ordinary(parent) - if st.st_uid != 0 or st.st_gid != 0: - os.chown(parent, 0, 0) - mode = stat.S_IMODE(st.st_mode) - if mode & 0o022: - os.chmod(parent, mode | stat.S_ISVTX) - - def _seal(self, path, private=False): - objects = list(descendants(path)) - for current in objects: - st = ordinary(current) - os.chown(current, 0, 0) - directory = stat.S_ISDIR(st.st_mode) - os.chmod(current, (0o700 if directory else 0o600) if private else - (0o555 if directory or st.st_mode & 0o111 else 0o444)) - self._protect_parents(path) - for current in objects: - self.records[str(current)] = record(current) - if Path(path).is_dir(): - self.closed_trees[str(path)] = sorted(str(x) for x in objects) - - def prepare(self): - if self.phase != "new": - raise GuardError("Guard preparation is single use") - p = self.policy - self.check_runtime_paths() - if p.uid <= 0 or p.gid <= 0: - raise GuardError("Actor IDs must be non-root") - if not p.workspace.is_absolute() or str(p.workspace) in ("/", "/tmp", "/home"): - raise GuardError("Unsafe workspace") - ordinary(p.workspace) - os.chown(p.workspace, 0, 0) - os.chmod(p.workspace, 0o1777) - self._protect_parents(p.workspace) - for editable in p.editable_paths: - if not editable.is_relative_to(p.workspace): - raise GuardError("Editable paths must be inside the workspace") - for item in descendants(editable): - st = ordinary(item) - os.chown(item, p.uid, p.gid) - os.chmod(item, 0o700 if stat.S_ISDIR(st.st_mode) or st.st_mode & 0o111 else 0o600) - tmp = p.workspace / ".actor_tmp" - if tmp.exists(): - raise GuardError("Actor temporary directory must start absent") - tmp.mkdir(mode=0o700) - os.chown(tmp, p.uid, p.gid) - p.state_dir.mkdir(parents=True, exist_ok=True) - os.chown(p.state_dir, 0, 0) - os.chmod(p.state_dir, 0o700) - self._protect_parents(p.state_dir) - for item in p.inputs: - self._seal(item) - for item in p.private_paths: - self._seal(item, private=True) - for item in p.private_write_dirs: - item.mkdir(parents=True, exist_ok=True) - ordinary(item) - os.chown(item, 0, 0) - os.chmod(item, 0o700) - self._protect_parents(item) - self.records[str(item)] = record(item) - - for item in (*p.inputs, *p.private_paths, p.state_dir, p.workspace): - for ancestor in Path(item).parents: - self.records.setdefault(str(ancestor), record(ancestor)) - self.records[str(p.workspace)] = record(p.workspace) - (p.state_dir / "input_manifest.json").write_text(json.dumps(self.records, indent=2)) - self.phase = "actor" - self.check_integrity() - - def check_integrity(self): - for path, before in self.records.items(): - if record(path) != before: - raise GuardError(f"Protected input or parent changed: {path}") - for root, before in self.closed_trees.items(): - if sorted(str(x) for x in descendants(root)) != before: - raise GuardError(f"Protected directory membership changed: {root}") - - def stop_actor(self): - return self.scope.stop_uid(self.policy.uid) - - def run_actor(self, command, timeout=10, output_limit=65536): - if self.phase != "actor": - raise GuardError("Actor phase is closed") - self.check_integrity() - read_fd, write_fd = os.pipe() - launcher = Path(__file__).with_name("actor_launcher.py") - argv = [self.policy.actor_python, "-I", str(launcher), "--uid", str(self.policy.uid), - "--gid", str(self.policy.gid), "--cwd", str(self.policy.workspace), - '--memory-mb', str(self.policy.memory_mb), '--cpus', str(self.policy.cpus), - '--nproc', str(self.policy.nproc), - "--status-fd", str(write_fd), "--", "/bin/bash", "--noprofile", "--norc", "-c", command] - process = subprocess.Popen(argv, env={"PATH": "/usr/local/bin:/usr/bin:/bin"}, - stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - pass_fds=(write_fd,), start_new_session=True) - identity = self.scope.track_child(process.pid) - os.close(write_fd) - selector = selectors.DefaultSelector() - for stream in [process.stdout, process.stderr]: - os.set_blocking(stream.fileno(), False) - selector.register(stream, selectors.EVENT_READ) - output = {process.stdout: bytearray(), process.stderr: bytearray()} - reason = "completed" - deadline = time.monotonic() + timeout - try: - while selector.get_map(): - rss_kib = self.scope.rss_kib(self.policy.uid) - if rss_kib > self.policy.memory_mb * 1024: - reason = 'aggregate_rss_limit' - self.stop_actor() - process.kill() - break - if time.monotonic() > deadline: - reason = "command_timeout" - self.stop_actor() - process.kill() - break - for key, _ in selector.select(0.05): - data = os.read(key.fileobj.fileno(), 65536) - if not data: - selector.unregister(key.fileobj) - continue - remaining = output_limit - sum(len(v) for v in output.values()) - output[key.fileobj].extend(data[:max(remaining, 0)]) - if len(data) > remaining: - reason = "output_limit" - self.stop_actor() - process.kill() - break - if reason != "completed": - break - process.wait(timeout=3) - status = os.read(read_fd, 2048) - if status != b"ready": - raise GuardError("Actor isolation failed: " + status.decode(errors="replace")) - finally: - selector.close() - os.close(read_fd) - process.stdout.close() - process.stderr.close() - if process.poll() is None: - self.stop_actor() - process.kill() - process.wait() - self.scope.untrack_child(identity) - self.scope.reap_uid(self.policy.uid) - self.check_integrity() - return {"return_code": process.returncode, "reason": reason, - "stdout": output[process.stdout].decode(errors="replace"), - "stderr": output[process.stderr].decode(errors="replace")} - - def freeze(self): - if self.phase != "actor": - raise GuardError("Can only freeze an active actor phase") - self.stop_actor() - self.check_integrity() - try: - total = 0 - for path in self.policy.output_paths: - if not path.is_relative_to(self.policy.workspace): - raise GuardError("Output path is outside workspace") - if not os.path.lexists(path): - continue - for item in descendants(path): - st = ordinary(item) - if stat.S_ISREG(st.st_mode): - total += st.st_size - if st.st_size > 16 * 1024 * 1024 or total > 64 * 1024 * 1024: - raise GuardError("Output artifact exceeds prototype limits") - os.chown(item, 0, 0) - os.chmod(item, 0o555 if stat.S_ISDIR(st.st_mode) else 0o444) - except GuardError as exc: - raise InvalidOutput(str(exc)) from exc - self.phase = "frozen" - - def run_verifier(self, script, timeout=30): - if self.phase != "frozen": - raise GuardError("Freeze actor before grading") - self.check_integrity() - script = Path(script) - if str(script) not in self.records or self.records[str(script)]["uid"] != 0: - raise GuardError("Verifier was not sealed as a private trusted file") - env = {"PATH": "/usr/local/bin:/usr/bin:/bin", "HOME": "/root", "LANG": "C.UTF-8", - "LC_ALL": "C.UTF-8", "PYTHONDONTWRITEBYTECODE": "1", - "PYTHONNOUSERSITE": "1", "PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1", - "PYTEST_ADDOPTS": "-p no:cacheprovider"} - result = subprocess.run(["/bin/bash", "--noprofile", "--norc", str(script)], - cwd=script.parent, env=env, stdin=subprocess.DEVNULL, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=timeout) - self.check_integrity() - return {"return_code": result.returncode, - "stdout": result.stdout.decode(errors="replace"), - "stderr": result.stderr.decode(errors="replace")} diff --git a/components/math/runtime/native_shell/launch_service.py b/components/math/runtime/native_shell/launch_service.py deleted file mode 100644 index 09f9fbe8804c60947c33e427c1f3e4583190157b..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/launch_service.py +++ /dev/null @@ -1,51 +0,0 @@ - -import argparse -import json -import os -from pathlib import Path -import subprocess -import time -import urllib.request - - -class RejectRedirects(urllib.request.HTTPRedirectHandler): - def redirect_request(self,*args,**kwargs): - raise RuntimeError('Redirects are forbidden for the local readiness probe') - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('--python',default='/opt/openenv-venv/bin/python') - parser.add_argument('--config',default='/opt/native-shell/config.json') - args=parser.parse_args() - if os.geteuid()!=0:raise PermissionError('Only the trusted supervisor may launch this service') - opener=urllib.request.build_opener(urllib.request.ProxyHandler({}),RejectRedirects()) - url='http://127.0.0.1:8000/metadata' - def ready(): - try: - with opener.open(url,timeout=2) as response: - return json.load(response).get('name')=='native_harbor' - except Exception:return False - if ready(): - print(json.dumps({'status':'already_running','base_url':'http://127.0.0.1:8000'}));return - private=Path('/opt/native-shell/private');private.mkdir(parents=True,exist_ok=True);private.chmod(0o700) - log=private/'service.log' - env={'PATH':'/usr/local/bin:/usr/bin:/bin','HOME':'/root','LANG':'C.UTF-8','LC_ALL':'C.UTF-8', - 'PYTHONPATH':'/opt/native-shell/runtime','PYTHONDONTWRITEBYTECODE':'1','PYTHONUNBUFFERED':'1', - 'NATIVE_SHELL_CONFIG':args.config,'ARENA_DEDICATED_CONTAINER':'1','ENABLE_WEB_INTERFACE':'false', - 'OPENENV_MODE':'simulation','GRADIO_ANALYTICS_ENABLED':'false','HF_HUB_OFFLINE':'1'} - with log.open('w') as stream: - process=subprocess.Popen([args.python,'-m','native_shell.server'],env=env,stdin=subprocess.DEVNULL, - stdout=stream,stderr=subprocess.STDOUT,start_new_session=True) - (private/'service.pid').write_text(str(process.pid)+'\n') - deadline=time.monotonic()+90 - while time.monotonic()= 2: - return {'signaled': len(signaled), 'reaped': reaped} - else: - quiet = 0 - for record in live: - fd = self._open_checked_pidfd(record, uid) - if fd is None: - continue - try: - try: - signal.pidfd_send_signal(fd, signal.SIGKILL, None, 0) - signaled.add(record.identity) - except ProcessLookupError: - pass - except OSError as error: - raise ProcessScopeError('Could not stop a learner process') from error - finally: - os.close(fd) - reaped += self.reap_uid(uid) - if time.monotonic() >= deadline: - raise ProcessScopeError('Could not stop all scoped learner processes') - time.sleep(0.02) - - -_current_scope = None -_current_lock = threading.Lock() - - -def current_scope(): - global _current_scope - with _current_lock: - if _current_scope is None or _current_scope.owner.pid != os.getpid(): - _current_scope = ProcessScope() - return _current_scope diff --git a/components/math/runtime/native_shell/server.py b/components/math/runtime/native_shell/server.py deleted file mode 100644 index 9aa1e83e6fd7dee697f3cb101d47495737dcdd7c..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/server.py +++ /dev/null @@ -1,14 +0,0 @@ - -from openenv.core.env_server.http_server import create_app -from common.models import ArenaAction, ArenaObservation -from .environment import NativeHarborEnvironment - -app=create_app(NativeHarborEnvironment,ArenaAction,ArenaObservation,env_name='native_harbor',max_concurrent_envs=1) - - -def main(): - import uvicorn - uvicorn.run(app,host='0.0.0.0',port=8000,log_level='warning') - - -if __name__=='__main__':main() diff --git a/components/math/runtime/native_shell/verifier_launcher.py b/components/math/runtime/native_shell/verifier_launcher.py deleted file mode 100644 index 9d5a1bdd65d608c8e7b046a13008f69b977256be..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/verifier_launcher.py +++ /dev/null @@ -1,26 +0,0 @@ - -import argparse -import math -import os -import resource - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('--cpus',type=int,required=True) - parser.add_argument('--memory-mb',type=int,required=True) - parser.add_argument('--wall-seconds',type=float,required=True) - parser.add_argument('argv',nargs=argparse.REMAINDER) - args=parser.parse_args() - argv=args.argv[1:] if args.argv[:1]==['--'] else args.argv - if not argv or not 1<=args.cpus<=2 or not 128<=args.memory_mb<=16384: - raise ValueError('Invalid verifier resource configuration') - os.sched_setaffinity(0,sorted(os.sched_getaffinity(0))[:args.cpus]) - resource.setrlimit(resource.RLIMIT_AS,(args.memory_mb*1024*1024,)*2) - resource.setrlimit(resource.RLIMIT_CORE,(0,0)) - resource.setrlimit(resource.RLIMIT_CPU,(math.ceil(args.wall_seconds*args.cpus)+1,)*2) - os.umask(0o077) - os.execvpe(argv[0],argv,os.environ) - - -if __name__=='__main__':main() diff --git a/components/math/runtime/native_shell/wire_client.py b/components/math/runtime/native_shell/wire_client.py deleted file mode 100644 index fffc56ab1420b816a2fcfe0a6e1b00040f039dfd..0000000000000000000000000000000000000000 --- a/components/math/runtime/native_shell/wire_client.py +++ /dev/null @@ -1,150 +0,0 @@ - -import argparse -import base64 -import json -import math -import os -import sys -import urllib.error -import urllib.parse -import urllib.request - - -class WireProtocolError(RuntimeError): - pass - - -class RejectRedirects(urllib.request.HTTPRedirectHandler): - def redirect_request(self,request,fp,code,message,headers,new_url): - raise WireProtocolError('Redirects are forbidden for the local OpenEnv transport') - - -def _constant(value): - raise WireProtocolError('Non-finite JSON number: '+value) - - -def _unique(pairs): - result={} - for key,value in pairs: - if key in result:raise WireProtocolError('Duplicate JSON key') - result[key]=value - return result - - -def _finite(value): - if isinstance(value,float) and not math.isfinite(value): - raise WireProtocolError('Non-finite wire value') - if isinstance(value,dict): - for item in value.values():_finite(item) - elif isinstance(value,list): - for item in value:_finite(item) - - -def loads(raw): - value=json.loads(raw,parse_constant=_constant,object_pairs_hook=_unique) - _finite(value) - return value - - -def validate_envelope(value,*,require_done=False): - if not isinstance(value,dict) or not isinstance(value.get('observation'),dict): - raise WireProtocolError('Missing SDK observation object') - observation=value['observation'] - if (set(observation)!={'task_id','message','data','metadata'} or - not isinstance(observation['task_id'],str) or not isinstance(observation['message'],str) or - not isinstance(observation['data'],dict) or not isinstance(observation['metadata'],dict)): - raise WireProtocolError('Observation does not match the common public contract') - if type(value.get('done')) is not bool: - raise WireProtocolError('SDK done must be a JSON boolean') - reward=value.get('reward') - if reward is not None and (type(reward) not in (int,float) or not math.isfinite(reward) or not 0<=reward<=1): - raise WireProtocolError('SDK reward is not a finite number in [0,1]') - if require_done and (not value['done'] or reward is None): - raise WireProtocolError('Finish did not return a terminal numeric score') - _finite(value) - return value - - -class WireClient: - def __init__(self,base_url='http://127.0.0.1:8000',timeout=330): - if os.geteuid()!=0: - raise PermissionError('Wire client is reserved for the trusted supervisor') - url=urllib.parse.urlsplit(base_url) - if url.scheme!='http' or url.hostname not in ('127.0.0.1','localhost','::1') or url.username or url.password or url.query or url.fragment or url.path not in ('','/'): - raise ValueError('Only an unauthenticated local server is allowed') - self.ws_url='ws://'+url.netloc+'/ws' - self.timeout=timeout - self.connection=None - - def close(self): - if self.connection is not None: - from websockets.exceptions import ConnectionClosedOK - connection,self.connection=self.connection,None - try: - connection.send('{"type":"close"}') - connection.recv(timeout=min(self.timeout,10)) - raise WireProtocolError('OpenEnv session did not close') - except ConnectionClosedOK: - pass - finally: - connection.close() - - def _request(self,kind,payload): - from websockets.sync.client import connect - if self.connection is None: - if kind!='reset':raise WireProtocolError('Reset before stepping') - self.connection=connect(self.ws_url,proxy=None,open_timeout=min(self.timeout,30),max_size=2*1024*1024) - body=json.dumps({'type':kind,'data':payload},ensure_ascii=False,allow_nan=False,separators=(',',':')) - try: - self.connection.send(body) - response=loads(self.connection.recv(timeout=self.timeout)) - if response.get('type')!='observation': - raise WireProtocolError('OpenEnv error: '+json.dumps(response.get('data',{}),ensure_ascii=False)) - result=validate_envelope(response['data']) - return result - except BaseException: - self.close() - raise - - def reset(self,**kwargs): - return self._request('reset',kwargs) - - def step(self,action): - return self._request('step',action) - - def finish(self): - return validate_envelope(self.step({'op':'finish'}),require_done=True) - - def __enter__(self): - return self - - def __exit__(self,*args): - self.close() - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('operation',choices=['episode']) - parser.add_argument('--payload-base64',required=True) - parser.add_argument('--url',default='http://127.0.0.1:8000') - parser.add_argument('--timeout',type=float,default=330) - args=parser.parse_args() - payload=loads(base64.b64decode(args.payload_base64,validate=True)) - if not isinstance(payload,dict) or set(payload)-{'reset','actions'}: - raise WireProtocolError('Expected reset and actions') - actions=payload.get('actions',[]) - if not isinstance(actions,list):raise WireProtocolError('Actions must be a list') - with WireClient(args.url,args.timeout) as client: - result=client.reset(**payload.get('reset',{})) - for action in actions: - if result['done']:break - result=client.step(action) - if not result['done']:result=client.finish() - print(json.dumps(result,ensure_ascii=False,allow_nan=False,separators=(',',':'))) - - -if __name__=='__main__': - try:main() - except Exception as exc: - print(type(exc).__name__+': '+str(exc),file=sys.stderr) - raise SystemExit(1) diff --git a/components/math/upstream/construct-mc-costas-array-l3-s0/environment/Dockerfile b/components/math/upstream/construct-mc-costas-array-l3-s0/environment/Dockerfile deleted file mode 100644 index 06d0365485bd1fc9437a07fafe38cb8333e9ac65..0000000000000000000000000000000000000000 --- a/components/math/upstream/construct-mc-costas-array-l3-s0/environment/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM python:3.11.16-slim -RUN apt-get update && apt-get install -y --no-install-recommends tmux curl git procps build-essential \ - && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir numpy==2.4.6 scipy==1.17.1 sympy==1.14.0 networkx==3.6.1 \ - python-sat==1.9.dev15 z3-solver==5.1.0.0 PuLP==3.3.2 ortools==9.15.6755 -WORKDIR /workdir -COPY instance.json /workdir/instance.json diff --git a/components/math/upstream/construct-mc-costas-array-l3-s0/environment/instance.json b/components/math/upstream/construct-mc-costas-array-l3-s0/environment/instance.json deleted file mode 100644 index 7fca96f5ec81cf0dfeec2803134a197b7e1c2828..0000000000000000000000000000000000000000 --- a/components/math/upstream/construct-mc-costas-array-l3-s0/environment/instance.json +++ /dev/null @@ -1 +0,0 @@ -{"n": 13, "fixed": [["x", 4, 3], ["x", 9, 1]], "family": "mc_costas_array", "subset": "construct"} \ No newline at end of file diff --git a/components/math/upstream/construct-mc-costas-array-l3-s0/instruction.md b/components/math/upstream/construct-mc-costas-array-l3-s0/instruction.md deleted file mode 100644 index 87a2a979778baf8291e14e05e1849784b3072ccf..0000000000000000000000000000000000000000 --- a/components/math/upstream/construct-mc-costas-array-l3-s0/instruction.md +++ /dev/null @@ -1,10 +0,0 @@ -A Costas array of order 13 is a 13x13 grid with exactly one mark in every row and every column such that the displacement vectors between pairs of marks are all distinct. Encode it as a permutation x[0..12] of 0..12, where x[c] is the row of the mark in column c; the condition is that the vectors (j - i, x[j] - x[i]) over all column pairs i < j are pairwise distinct. - -Find a Costas array of order 13. - -Some values are fixed in advance and your answer must agree with them: -x[4] = 3, x[9] = 1 - -Answer format: {"x": [x_0, x_1, ..., x_12]} - -Write your final answer as JSON to `/workdir/answer.json`. The instance data is also in `/workdir/instance.json`. Only `/workdir/answer.json` is graded. There is no internet access. diff --git a/components/math/upstream/construct-mc-costas-array-l3-s0/task.toml b/components/math/upstream/construct-mc-costas-array-l3-s0/task.toml deleted file mode 100644 index caefc13f04143740a9350faa3f31dd6214558ca6..0000000000000000000000000000000000000000 --- a/components/math/upstream/construct-mc-costas-array-l3-s0/task.toml +++ /dev/null @@ -1,40 +0,0 @@ -schema_version = "1.4" -artifacts = [] - -[task] -name = "rlmath/construct-mc-costas-array-l3-s0" -version = "0.2.0" -description = "construct/mc_costas_array" -authors = [] -keywords = ["rlmath", "construct", "mc_costas_array"] - -[metadata] -subset = "construct" -family = "mc_costas_array" -problem_key = "costas_array" -domain = "combinatorics" -tier = "competition" -level = "3" -source = "MathConstraint/costas_array" -source_license = "CC-BY-4.0" -tags = ["np_search"] - -[verifier] -timeout_sec = 300.0 - -[verifier.env] - -[agent] -timeout_sec = 900.0 - -[environment] -network_mode = "no-network" -build_timeout_sec = 600.0 -os = "linux" -cpus = 2 -memory_mb = 4096 -mcp_servers = [] - -[environment.env] - -[solution.env] diff --git a/components/math/upstream/construct-mc-costas-array-l3-s0/tests/check.py b/components/math/upstream/construct-mc-costas-array-l3-s0/tests/check.py deleted file mode 100644 index c86323a5b639b23787ecd4d5f358b986bbd91b6c..0000000000000000000000000000000000000000 --- a/components/math/upstream/construct-mc-costas-array-l3-s0/tests/check.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Costas array of order n (MathConstraint costas_array, CC-BY-4.0). Accepts any valid array. -Adapted from pilot/grader.py check_costas; adds the optional fixed entries (upstream partial assignment).""" -import itertools - -from run import Invalid, int_list - - -def check(inst, ans): - n = inst["n"] - x = int_list(ans.get("x"), n, 0, n - 1, "x") - if sorted(x) != list(range(n)): - raise Invalid("x is not a permutation of 0..n-1") - for name, i, v in inst.get("fixed", []): - if x[i] != v: - raise Invalid(f"fixed value {name}[{i}] = {v} not respected") - vecs = set() - for i, j in itertools.combinations(range(n), 2): - d = (j - i, x[j] - x[i]) - if d in vecs: - raise Invalid(f"repeated displacement vector {d}") - vecs.add(d) - return None, {} diff --git a/components/math/upstream/construct-mc-costas-array-l3-s0/tests/instance.json b/components/math/upstream/construct-mc-costas-array-l3-s0/tests/instance.json deleted file mode 100644 index 7fca96f5ec81cf0dfeec2803134a197b7e1c2828..0000000000000000000000000000000000000000 --- a/components/math/upstream/construct-mc-costas-array-l3-s0/tests/instance.json +++ /dev/null @@ -1 +0,0 @@ -{"n": 13, "fixed": [["x", 4, 3], ["x", 9, 1]], "family": "mc_costas_array", "subset": "construct"} \ No newline at end of file diff --git a/components/math/upstream/construct-mc-costas-array-l3-s0/tests/run.py b/components/math/upstream/construct-mc-costas-array-l3-s0/tests/run.py deleted file mode 100644 index 9f6db6107aa1f8132aeb1abdcf9bbf100792e48a..0000000000000000000000000000000000000000 --- a/components/math/upstream/construct-mc-costas-array-l3-s0/tests/run.py +++ /dev/null @@ -1,127 +0,0 @@ -"""rlmath runtime grader. Copied into every task as /tests/run.py next to /tests/check.py. - -Deterministic; no LLM in the reward path. Runs with python3 + numpy/scipy/sympy/networkx only. - - python3 /tests/run.py /tests/instance.json /workdir/answer.json - -Prints the reward in [0, 1] and writes /logs/verifier/details.json when that directory exists. - -check.py must define check(inst, ans) -> (value, extra_dict) and raise Invalid for a bad answer. - construct : value is ignored; a returned check means the witness is valid -> reward 1.0 - optimize : value is the raw objective; reward = 0.1 + 0.9 * progress, where - progress = clip((s - baseline) / (best_known - baseline), 0, 1) (maximize) - clip((baseline - s) / (baseline - best_known), 0, 1) (minimize) - inst must carry "direction", "baseline", "best_known". -""" -import json -import math -import os -import sys - -VALID_FLOOR = 0.1 - - -class Invalid(Exception): - pass - - -# ------------------------------------------------------------ input helpers - -def int_list(v, n=None, lo=None, hi=None, name="list"): - if not isinstance(v, list): - raise Invalid(f"{name} must be a list") - if n is not None and len(v) != n: - raise Invalid(f"{name} must have length {n}, got {len(v)}") - for x in v: - if isinstance(x, bool) or not isinstance(x, int): - raise Invalid(f"{name} must contain integers only") - if (lo is not None and x < lo) or (hi is not None and x > hi): - raise Invalid(f"{name} entry {x} out of range [{lo}, {hi}]") - return v - - -def as_int(x, name="value", lo=None, hi=None): - return int_list([x], 1, lo, hi, name)[0] - - -def num(x, name="value"): - if isinstance(x, bool) or not isinstance(x, (int, float)): - raise Invalid(f"{name} must be a number") - if not math.isfinite(x): - raise Invalid(f"{name} is not finite") - return float(x) - - -def float_matrix(v, rows=None, cols=None, name="matrix"): - if not isinstance(v, list) or (rows is not None and len(v) != rows): - raise Invalid(f"{name} must be a list of {rows} rows") - out = [] - for r in v: - if not isinstance(r, list) or (cols is not None and len(r) != cols): - raise Invalid(f"each row of {name} must have {cols} numbers") - out.append([num(x, name) for x in r]) - return out - - -def float_list(v, n=None, name="list"): - if not isinstance(v, list) or (n is not None and len(v) != n): - raise Invalid(f"{name} must be a list of length {n}") - return [num(x, name) for x in v] - - -# ------------------------------------------------------------------ reward - -def optimize_reward(inst, s): - b, best = inst["baseline"], inst["best_known"] - if inst.get("progress_scale") == "log": - # for non-negative losses spanning orders of magnitude (e.g. overlap loss -> 0); - # progress is measured in log10(value + floor) - f = inst.get("log_floor", 1e-3) - b, best, s = (math.log10(max(x, 0.0) + f) for x in (b, best, s)) - if inst["direction"] == "maximize": - p = (s - b) / (best - b) - else: - p = (b - s) / (b - best) - return VALID_FLOOR + (1 - VALID_FLOOR) * max(0.0, min(1.0, p)) - - -def grade(inst, ans, check): - try: - if not isinstance(ans, dict): - raise Invalid("answer must be a JSON object") - value, extra = check(inst, ans) - if inst.get("subset") == "optimize": - s = float(value) - if not math.isfinite(s): - raise Invalid("non-finite score") - return optimize_reward(inst, s), {"valid": True, "raw_score": s, **(extra or {})} - return 1.0, {"valid": True, **(extra or {})} - except Invalid as e: - return 0.0, {"valid": False, "error": str(e)} - except Exception as e: # any malformed answer - return 0.0, {"valid": False, "error": f"{type(e).__name__}: {e}"} - - -def main(): - here = os.path.dirname(os.path.abspath(__file__)) - sys.path.insert(0, here) - # import ourselves as `run` so check.py's `from run import Invalid` is the same class - import run as R # noqa: E402 - import check as family # noqa: E402 - - inst = json.load(open(sys.argv[1])) - try: - ans = json.load(open(sys.argv[2])) - except Exception as e: - reward, det = 0.0, {"valid": False, "error": f"unreadable answer: {e}"} - else: - reward, det = R.grade(inst, ans, family.check) - det["reward"] = reward - if os.path.isdir("/logs/verifier"): - with open("/logs/verifier/details.json", "w") as f: - json.dump(det, f) - print(reward) - - -if __name__ == "__main__": - main() diff --git a/components/math/upstream/construct-mc-costas-array-l3-s0/tests/test.sh b/components/math/upstream/construct-mc-costas-array-l3-s0/tests/test.sh deleted file mode 100644 index 648521fa89684f62943a573f74ce3cb75cd3ae29..0000000000000000000000000000000000000000 --- a/components/math/upstream/construct-mc-costas-array-l3-s0/tests/test.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -mkdir -p /logs/verifier -if [ ! -s /workdir/answer.json ]; then - echo '{"valid": false, "error": "no /workdir/answer.json"}' > /logs/verifier/details.json - echo 0 > /logs/verifier/reward.txt - exit 0 -fi -timeout 290 python3 /tests/run.py /tests/instance.json /workdir/answer.json \ - > /logs/verifier/reward.txt 2> /logs/verifier/grader.log || echo 0 > /logs/verifier/reward.txt diff --git a/components/metaharness/.dockerignore b/components/metaharness/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..8224c18eebdd9cfc4857014da5f122d94035f8fa --- /dev/null +++ b/components/metaharness/.dockerignore @@ -0,0 +1,13 @@ +* +!Dockerfile +!LICENSE +!NOTICE +!SOURCE.json +!TASKS.json +!upstream +!upstream/arena_env +!upstream/arena_env/*.py +!runtime +!runtime/common +!runtime/common/*.py +!runtime/shared_adapter.py diff --git a/components/metaharness/Dockerfile b/components/metaharness/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c81e3f6a987078146034b997a2e8923eaef75a63 --- /dev/null +++ b/components/metaharness/Dockerfile @@ -0,0 +1,6 @@ +FROM ghcr.io/ruvnet/metaharness-arena@sha256:228329c4928eef054d6e1d3021c9867df416539d4d5e656cc760f97c17c9e35a +COPY LICENSE NOTICE SOURCE.json TASKS.json /app/ +COPY upstream/arena_env /app/arena_env +COPY runtime/common /app/common +COPY runtime/shared_adapter.py /app/shared_adapter.py +CMD ["python", "-m", "uvicorn", "shared_adapter:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"] diff --git a/components/math/licenses/RLVE-LICENSE b/components/metaharness/LICENSE similarity index 96% rename from components/math/licenses/RLVE-LICENSE rename to components/metaharness/LICENSE index 5677eb6d02ee26cd27b6dce1cbfaa9676b1a2382..f082aa28727e6f5c821d6a77ffec622d8acfc5b2 100644 --- a/components/math/licenses/RLVE-LICENSE +++ b/components/metaharness/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Zhiyuan Zeng +Copyright (c) 2026 RuvNet (https://ruv.io) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/components/metaharness/NOTICE b/components/metaharness/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..eae2b7378097d38b9db28335008fc8b6d7ee9f89 --- /dev/null +++ b/components/metaharness/NOTICE @@ -0,0 +1,6 @@ +MetaHarness procedural task environment +Copyright (c) 2026 RuvNet (https://ruv.io) +Original license: MIT; see LICENSE. +Source: https://github.com/ruvnet/metaharness/tree/4657e5b82e124917b01d79ee5e9de41badb48fda/integrations/openenv-arena +Dataset: https://huggingface.co/datasets/ruv/metaharness-arena-tasks/tree/c359366240115bfb24d2edae807c8e52ed5b39f0 +Adaptations: shared action delivery, selected-task metadata and validation, and JSON-safe validation errors. Original questions, virtual files, generation, grading, seed behavior and the 16-action limit are retained. A reset without a task selects the first registered task. diff --git a/components/metaharness/README.md b/components/metaharness/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2752055ac3cec5775895e59a80309f1db79d24f8 --- /dev/null +++ b/components/metaharness/README.md @@ -0,0 +1,7 @@ +# MetaHarness component + +Five original difficulty-2 task variants use the original generator and grader. `TASKS.json` lists the selected IDs. `upstream/tasks.selected.jsonl` contains 160 unchanged public seed records; runtime reset uses the original explicit-seed or unseeded generation behavior. + +Actions use `op=call` with `list`, `read`, or `submit`. Submit the documented answer object in `arguments.answer`; `op=finish` submits an empty answer. The original 16-action limit applies. Original public file contents are delivered in observation data. + +`SOURCE.json` records source pins, file hashes and adaptations. Upstream code and MIT attribution are retained. diff --git a/components/metaharness/SOURCE.json b/components/metaharness/SOURCE.json new file mode 100644 index 0000000000000000000000000000000000000000..8c533b9070f578ce2545c8324e9dccddd0700513 --- /dev/null +++ b/components/metaharness/SOURCE.json @@ -0,0 +1,47 @@ +{ + "source_repository": "ruvnet/metaharness", + "source_revision": "4657e5b82e124917b01d79ee5e9de41badb48fda", + "source_directory": "integrations/openenv-arena", + "dataset_repository": "ruv/metaharness-arena-tasks", + "dataset_revision": "c359366240115bfb24d2edae807c8e52ed5b39f0", + "original_dataset_sha256": "ffa57cbf04758156b15d61662a8faa7f4129f938bdc21c023dc897330e771ed3", + "selected_dataset_rows": 160, + "dataset_derivation": "Unmodified original JSONL lines selected by family and difficulty.", + "base_image": "ghcr.io/ruvnet/metaharness-arena@sha256:228329c4928eef054d6e1d3021c9867df416539d4d5e656cc760f97c17c9e35a", + "sdk_revision": "86a180ede21e044f7929b9a7783ad83aa67d83a3", + "license": "MIT", + "registered_tasks": [ + "office_reconciliation-d2", + "media_timeline-d2", + "security_triage-d2", + "math_route-d2", + "science_calibration-d2" + ], + "seed_policy": "Original explicit seed or unseeded random generation; no group-based reseeding.", + "adaptations": [ + "Shared list/read/submit delivery; finish maps to original empty submission", + "Only the original delivery suffix is replaced", + "Metadata and reset allowlist restricted to the five registered variants; default reset selects the first", + "JSON-safe validation errors with unchanged action/observation/state schema" + ], + "files": { + ".dockerignore": "54805fba51273053c3dd388970db3b31aae4de8e5998f1c05e735c18e242857f", + "Dockerfile": "1bfc7ebdbe65d93c93fa3122a2efb3e3cf8f6c138113fb6be9d09e5bfe2061ba", + "LICENSE": "09ed6717912f408da29e15b55170cd56c9658218a540b7c72e70909b9101274c", + "NOTICE": "605977e7d6dcc2b1eda0dfc6501d2b1d5c64c129ff84e793a9a983919530e1ed", + "README.md": "99e6a092e24b941b4ac79a57eeb593beff579f199d3994f73aa7e538f98398d9", + "TASKS.json": "3f122a94c8aecb947b4f95bc2a8d67980ec9a9bc2b7adeea3b1c5e08c3504e06", + "runtime/common/__init__.py": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", + "runtime/common/contracts.py": "b1e1429208e84aefc2422ee1d2400ad793c43cd5c0e8db213a3b669fe0947ce1", + "runtime/common/models.py": "6a1ac8e55af6168d3fdd6b17c700a15cf0546b6154773aa3c59c97d6bffa2ffd", + "runtime/shared_adapter.py": "485aa11684c1ca537e3f439ceb3e2bcdfb8848e1012ada02cb5783ae3deeb02d", + "upstream/Dockerfile": "ceddb0dfe82b01ae91859db2215fa697381064801f0eb0a4d96dd6d0473bd25e", + "upstream/README.md": "8802e5b5d1796dc9d15647705598971ec4be2e7b53e6b30556440a5ebb89d069", + "upstream/arena_env/__init__.py": "d0cca47bd35b44e121fb394856996d9f2271c29528b73d5b6160ab63f47f9a0f", + "upstream/arena_env/app.py": "62815cb244cb4404379dc28e897503994bef49a8e4f4b5721dace574a8865c63", + "upstream/arena_env/environment.py": "d6882e2c9dabf1ee0fde75df0acdef85670598da633ce523cf54038fd40562a9", + "upstream/arena_env/tasks.py": "94e29b6d884302f57e9440591cca5c07350cc4eb47d9e4e9f7a27689c519b781", + "upstream/requirements.lock": "3fbed6fc6af3931cdacd290353a02ba1740222974c91a022145ec4e6a5f3a347", + "upstream/tasks.selected.jsonl": "bb488a65100922227f9e7e8288beced72577c44cec8c2aa7a54be446d6ce9606" + } +} diff --git a/components/metaharness/TASKS.json b/components/metaharness/TASKS.json new file mode 100644 index 0000000000000000000000000000000000000000..453afef0fe8920dcc9177cd97434acb60114ebf4 --- /dev/null +++ b/components/metaharness/TASKS.json @@ -0,0 +1,32 @@ +[ + { + "task_id": "office_reconciliation-d2", + "index": 0, + "family": "office_reconciliation", + "difficulty": 2 + }, + { + "task_id": "media_timeline-d2", + "index": 1, + "family": "media_timeline", + "difficulty": 2 + }, + { + "task_id": "security_triage-d2", + "index": 2, + "family": "security_triage", + "difficulty": 2 + }, + { + "task_id": "math_route-d2", + "index": 3, + "family": "math_route", + "difficulty": 2 + }, + { + "task_id": "science_calibration-d2", + "index": 4, + "family": "science_calibration", + "difficulty": 2 + } +] diff --git a/components/math/runtime/common/__init__.py b/components/metaharness/runtime/common/__init__.py similarity index 100% rename from components/math/runtime/common/__init__.py rename to components/metaharness/runtime/common/__init__.py diff --git a/components/pdbthink/runtime/common/contracts.py b/components/metaharness/runtime/common/contracts.py similarity index 100% rename from components/pdbthink/runtime/common/contracts.py rename to components/metaharness/runtime/common/contracts.py diff --git a/components/awm/runtime/common/models.py b/components/metaharness/runtime/common/models.py similarity index 87% rename from components/awm/runtime/common/models.py rename to components/metaharness/runtime/common/models.py index b862e2d3259ab1c55bbb46e6423587b742dbcc51..4d7bfa208b39f5e19d3e358c6d23c0f59041efad 100644 --- a/components/awm/runtime/common/models.py +++ b/components/metaharness/runtime/common/models.py @@ -5,6 +5,7 @@ from typing import Any, Literal import jsonschema from openenv.core.env_server.types import Action, Observation from pydantic import ConfigDict, Field, model_serializer, model_validator +from pydantic_core import PydanticCustomError from .contracts import ACTION_SCHEMA @@ -22,7 +23,7 @@ class ArenaAction(Action): return value def finite(item): if isinstance(item,float) and not math.isfinite(item): - raise ValueError('Non-finite JSON number') + raise PydanticCustomError('finite_number', 'Non-finite JSON number') if isinstance(item,dict): for part in item.values():finite(part) elif isinstance(item,list): @@ -31,7 +32,7 @@ class ArenaAction(Action): try: jsonschema.Draft202012Validator(ACTION_SCHEMA).validate(value) except jsonschema.ValidationError as exc: - raise ValueError(exc.message) from exc + raise PydanticCustomError('action_contract', '{message}', {'message': exc.message}) from exc return value @classmethod diff --git a/components/metaharness/runtime/shared_adapter.py b/components/metaharness/runtime/shared_adapter.py new file mode 100644 index 0000000000000000000000000000000000000000..4598b74dd4af903ef093064211f186775f0ab918 --- /dev/null +++ b/components/metaharness/runtime/shared_adapter.py @@ -0,0 +1,115 @@ +"""Shared delivery schema around the unchanged original MetaHarness environment.""" +from threading import RLock +from openenv.core.env_server.interfaces import Environment +from openenv.core.env_server.http_server import create_app +from arena_env.environment import ArenaAction as NativeAction, ArenaEnvironment as NativeEnvironment +from arena_env.tasks import TASK_IDS +from common.models import ArenaAction, ArenaObservation + +REGISTERED_TASKS = ('office_reconciliation-d2', 'media_timeline-d2', 'security_triage-d2', 'math_route-d2', 'science_calibration-d2') +NATIVE_SUFFIX = "\nUse read with path * to read all files in one call. Then submit your answer object once. No shell is available." +SHARED_SUFFIX = ( + '\nUse {"op":"call","tool":"read","arguments":{"path":"*"}} to read all files in one call. ' + 'Submit the documented answer object as arguments.answer using ' + '{"op":"call","tool":"submit","arguments":{"answer":{}}}; replace {} with your answer object. ' + 'Use {"op":"call","tool":"list","arguments":{}} to list virtual filenames. ' + 'Use {"op":"finish"} to end without answering. No shell is available.' +) + + +def render_prompt(prompt): + if not prompt: + return prompt + if not prompt.endswith(NATIVE_SUFFIX) or prompt.count(NATIVE_SUFFIX) != 1: + raise RuntimeError("Original protocol suffix changed") + return prompt[:-len(NATIVE_SUFFIX)] + SHARED_SUFFIX + + +class SharedEnvironment(Environment): + SUPPORTS_CONCURRENT_SESSIONS = True + + def __init__(self): + self._lock = RLock() + self._native = NativeEnvironment() + + def _translate(self, observation, invalid=False): + message = render_prompt(observation.prompt) if observation.prompt else observation.error + if invalid and not observation.done: + message = "Unavailable action. Use call with list {}, read {path}, or submit {answer}; finish ends without an answer." + return ArenaObservation( + task_id=observation.task_id, message=message, + data={"files": observation.files, "content": observation.content, + "remaining_steps": observation.remaining_steps}, + reward=observation.reward, done=observation.done, + ) + + def reset(self, seed=None, episode_id=None, *, task_id=None, index=None, split="train", **kwargs): + with self._lock: + if split != "train": + raise ValueError("Unknown split") + if index is not None: + selected = self.get_task(split, index)["id"] + if task_id is not None and task_id != selected: + raise ValueError("Task selection mismatch") + task_id = selected + task_id = REGISTERED_TASKS[0] if task_id is None else task_id + if task_id not in REGISTERED_TASKS: + raise ValueError("Unknown registered task") + return self._translate(self._native.reset(seed=seed, episode_id=episode_id, task_id=task_id, **kwargs)) + + def step(self, action, timeout_s=None, **kwargs): + with self._lock: + value = action.action_payload() if isinstance(action, ArenaAction) else ArenaAction.model_validate(action).action_payload() + mapped = None + if value["op"] == "finish": + mapped = NativeAction(op="submit", answer={}) + elif value["op"] == "call": + tool, args = value["tool"], value["arguments"] + if tool == "list" and not args: + mapped = NativeAction(op="list") + elif tool == "read" and set(args) == {"path"} and isinstance(args["path"], str): + mapped = NativeAction(op="read", path=args["path"]) + elif tool == "submit" and set(args) <= {"answer"} and isinstance(args.get("answer", {}), dict): + mapped = NativeAction(op="submit", answer=args.get("answer", {})) + # Original virtual filenames are nonempty. An unavailable shared action is + # an original failed read, consuming one original action with no new tools. + invalid = mapped is None + mapped = mapped or NativeAction(op="read", path="") + return self._translate(self._native.step(mapped, timeout_s=timeout_s, **kwargs), invalid=invalid) + + @property + def state(self): + with self._lock: + return self._native.state + + def close(self): + with self._lock: + self._native = NativeEnvironment() + + def list_splits(self): + return ["train"] + + def list_tasks(self, split): + if split != "train": + raise ValueError("Unknown split") + return [{"id": task_id, "index": index} for index, task_id in enumerate(REGISTERED_TASKS)] + + def num_tasks(self, split): + return len(self.list_tasks(split)) + + def get_task(self, split, index): + tasks = self.list_tasks(split) + if type(index) is not int or not 0 <= index < len(tasks): + raise ValueError("Invalid task index") + return tasks[index] + + def get_task_range(self, split, start=None, stop=None): + tasks = self.list_tasks(split) + start, stop = 0 if start is None else start, len(tasks) if stop is None else stop + if type(start) is not int or type(stop) is not int or not 0 <= start <= stop <= len(tasks): + raise ValueError("Invalid task range") + return tasks[start:stop] + + +app = create_app(SharedEnvironment, ArenaAction, ArenaObservation, + env_name="metaharness_shared", max_concurrent_envs=8) diff --git a/components/metaharness/upstream/Dockerfile b/components/metaharness/upstream/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d6b9b6b97ea63b28c9c6ddf3c53d78422b215f6f --- /dev/null +++ b/components/metaharness/upstream/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.12-slim +LABEL org.opencontainers.image.source="https://github.com/ruvnet/metaharness" +LABEL org.opencontainers.image.description="Original procedural OpenEnv tasks; no measured transfer claim" +WORKDIR /app +RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates tini && rm -rf /var/lib/apt/lists/* +COPY requirements.lock /app/requirements.lock +RUN pip install --no-cache-dir -r /app/requirements.lock && useradd --uid 10001 --create-home arena +COPY arena_env /app/arena_env +COPY openenv.yaml /app/openenv.yaml +ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 ENABLE_WEB_INTERFACE=false +USER 10001 +EXPOSE 8000 +ENTRYPOINT ["/usr/bin/tini", "--"] +CMD ["python", "-m", "uvicorn", "arena_env.app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"] diff --git a/components/metaharness/upstream/README.md b/components/metaharness/upstream/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6f6cb4ca9ba013d4aa7d7e02dbe2079f3776a02d --- /dev/null +++ b/components/metaharness/upstream/README.md @@ -0,0 +1,151 @@ +# MetaHarness OpenEnv Arena + +An original procedural training environment and bounded curriculum review workflow for [OpenEnv Arena](https://openenvarena-arena.hf.space/). It prepares a competitive entry; it does not establish an Arena rank or model improvement. Read [PLAN.md](PLAN.md) for the measured strategy, budgets and gates. + +Arena trains **its fixed Qwen3.8-27B** with GRPO on one H200 for up to four hours, then evaluates 40 private tasks across eight domains. We supply the environment that teaches the model. MetaHarness, Autogenous, rGi and Ruflo belong around curriculum development, evaluation and governance. They are not an ensemble installed into the Arena evaluator. + +**Release hold:** the first real Qwen3.8 probe from the ruvultra executor reports that several v1 families are saturated while some failures come from reasoning truncation. Public v1 trajectories are available in the [calibration artifact](https://gist.github.com/ruvnet/00fb40aeabb35a893f140597e2695c1d); independent replay review is pending. Generator, verifier, calibration and dependency revisions are implemented; the v1 image and request below are historical qualified artifacts, not the final candidate. No Arena submission is approved. + +## What is implemented + +| Part | Behavior | Limit | +| --- | --- | --- | +| `arena_env` | Native OpenEnv server; eight generated task families; typed `list`, `read`, `submit`; independent terminal rewards | Initial practice coverage, not proven task transfer | +| Difficulty variants | Each family supports `-d1`, `-d2`, `-d3`; fresh instance on every unseeded reset | 24 variants are still eight generator families | +| Local checks | Correct, incorrect and malformed answers; deterministic reset; bounded episodes and virtual files | Oracle controls are verifier tests, not model scores | +| `scripts/calibrate.py` | Explicitly invoked four-attempt model probe, bounded calls, dry-run default | Requires a real endpoint and credential; does not train or establish official scores | +| `orchestration` | Actual MetaHarness gates/receipts and pinned rGi journal; explicit Autogenous curriculum gate contract | No upstream Autogenous training runtime or Arena submission capability | +| `submission.py` | Live schema request rendering; immutable image requirement; reviewed digest; atomic receipt and status reconciliation | Public image/dataset and an existing Hugging Face login or HF_TOKEN must be available; no automatic retry | + +The implementation makes no host filesystem, shell, network or verifier endpoint available through the policy's actions. Reading `*` returns only the generated virtual files. Submission ends the episode once; later actions cannot amend the answer. The container does not need model credentials or rGi. + +## Local run + +From this directory, with Python 3.12: + +```sh +python -m venv .venv +.venv/bin/pip install -r requirements.lock +.venv/bin/python -m unittest discover -s tests -v +.venv/bin/python -m uvicorn arena_env.app:app --host 127.0.0.1 --port 8000 +``` + +In another terminal: + +```sh +.venv/bin/openenv validate --url http://127.0.0.1:8000 +curl --fail http://127.0.0.1:8000/schema +``` + +The dependency uses Arena's required OpenEnv commit `86a180ede21e044f7929b9a7783ad83aa67d83a3`. Native `/schema` is the source of the submitted action and observation schemas. Do not substitute a handwritten HTTP imitation or a stale indexed Arena format. + +`example-actions.json` reads the virtual files then submits an empty answer. It deliberately ends with zero reward for every task, satisfying admission's terminal protocol without leaking solutions. Correct answers are tested separately with the independent local oracle. Protocol validation, model capability and leaderboard scores are separate evidence. + +The eight task IDs are: + +| Arena domain | Task ID | +| --- | --- | +| Software engineering | `software_change` | +| Industrial and physical systems | `industrial_schedule` | +| Natural science | `science_calibration` | +| Office work | `office_reconciliation` | +| Finance and economics | `finance_ledger` | +| Math and formal reasoning | `math_route` | +| Cybersecurity | `security_triage` | +| Media and content production | `media_timeline` | + +For each, `-d1`, `-d2` or `-d3` selects its difficulty; without a suffix the environment uses medium difficulty. Seeds are passed to local reset calls, never as unsupported fields in an Arena task contract. + +## Model calibration and local review + +Inspect a bounded calibration plan without provider calls: + +```sh +PYTHONPATH=. .venv/bin/python scripts/calibrate.py \ + --base-url https://YOUR_PROVIDER/v1 \ + --model YOUR_MODEL --model-revision YOUR_CHECKPOINT_REVISION \ + --output .arena/calibration.jsonl +``` + +Use real provider values and review the dry-run caps before execution. `--request-timeout` is configurable from 30 to 900 seconds (default 300), and `--max-tokens` from 128 to 32,768. Execution requires an explicit `--max-total-tokens` ceiling reserving prompt plus output units before each call; unused reservations are not refunded. This is not a provider dollar or billing guarantee. Four attempts identify obvious difficulty problems; they do not prove improvement. + +For local aggregate accounting use `--accounting arena`, a locally available `--tokenizer-json` plus its exact `--tokenizer-sha256`, and explicit `--episode-completion-tokens` and `--episode-context-tokens`, or `--task-budgets-json` in the native task-list format. The optional local `tokenizers` helper is not installed in the image. Generated completion includes reasoning once, and every observation after reset is charged. The runner retains separate reasoning, action text, finish reasons, reported token counts and failures. Context is counted using documented local JSON serialization; Arena's production chat wrapper and wall timing remain unverified, so `arena_budget_matched` and `arena_wall_matched` stay false. No provider call or tokenizer download happens in dry-run. + +An offline [observation token measurement](evidence/observation-tokens.json) uses the pinned Qwen tokenizer on the 32 calibration instances. Read-all plus terminal observations range up to 1,485 tokens for a family, leaving as few as 2,611 of the candidate 4,096 completion tokens for generation. This excludes chat-template overhead and does not establish the production serializer or model performance. + +See [orchestration/README.md](orchestration/README.md) for the separate evidence contract, actual rGi runtime, frozen plan, transfer requirements, authority and rollback. Its tests use synthetic fixtures explicitly marked as tests. The calibration runner emits a native calibration receipt bound to its manifest and runner revision. Retain the episode trajectories and bind their manifest and structural family names into the frozen plan. This diagnostic receipt alone cannot promote a curriculum; independently trained baseline and candidate transfer evidence is still required. + +## Container and public assets + +Build on an amd64 capable Docker host: + +```sh +export DOCKER_DEFAULT_PLATFORM=linux/amd64 +docker build -t ghcr.io/YOUR_LOWERCASE_ACCOUNT/metaharness-arena:v1 . +``` + +The placeholders in documentation are not publishable references. Publish the built image under an account you control, make it public, then record its actual amd64 SHA256 digest. Pull it anonymously and rerun native validation plus every task's example replay. Publish the exported tasks, generator/verifier source and dataset card as a real public, ungated Hugging Face dataset. Do not claim completion before both public artifacts are readable. + +Arena uses the image, not the dataset contents, to run training. The dataset establishes public attribution and provenance. Bundle source and task assets in the image, and pin any optional asset revision. Keep image size below 2 GiB compressed and 128 layers. The Dockerfile runs as a nonroot user and exposes one port. + +## Reviewable submission + +Render only after the server is running and the public assets exist. Environment variables below hold nonsecret identifiers, except HF_TOKEN which must be supplied securely in the environment only. + +```sh +python submission.py render \ + --submission-id metaharness-arena-v1 \ + --name 'MetaHarness Procedural Reasoning' \ + --image "$ARENA_IMAGE_DIGEST" \ + --dataset "$ARENA_DATASET" \ + --schema-url http://127.0.0.1:8000/schema \ + --tasks-json tasks.json \ + --example-actions-json example-actions.json \ + --finish-action-json finish-action.json \ + --source https://github.com/ruvnet/metaharness \ + --out .arena/submission.json +``` + +`ARENA_IMAGE_DIGEST` must be a real `ghcr.io/owner/image@sha256:...` or `docker.io/owner/image@sha256:...` reference with all 64 hex characters. `ARENA_DATASET` is the real HF `owner/name`. The command reads live `/schema`, enforces task limits, writes the request and prints its canonical request SHA256. It never sends a submission and does not need an HF token. The local checks cover contract shape and numeric bounds; official native validation checks full action schema semantics and replay behavior. + +Show the user the exact request and wait for their explicit go-ahead before any submission. This is the user's required final gate. Check the digest without submitting: + +```sh +python submission.py submit \ + --request .arena/submission.json \ + --approve-sha256 "$REVIEWED_REQUEST_SHA256" \ + --receipt .arena/submission-receipt.json +``` + +Only the explicit addition of `--execute`, with existing HF authentication available, sends a POST. HF_TOKEN takes priority; otherwise the official Hugging Face cache lookup is used in memory without saving or exporting a token. It first checks the caller's own submission ID, durably records intent, then records the resulting ID/status. An altered request fails the digest check. A preexisting receipt only triggers reconciliation and never a second POST. The client refuses authenticated redirects and never logs tokens or raw error bodies. + +```sh +python submission.py status --receipt .arena/submission-receipt.json +``` + +A timeout or uncertain answer is not permission to create another ID. This client performs a status read and leaves an atomic `unknown` or `unconfirmed` receipt if unresolved. Reconcile with the official own-submission endpoint before explicitly deciding how to proceed. A leftover lock after process interruption likewise requires checking the original process and receipt. Do not delete evidence to make an uncertain request appear new. + +## Evidence and release state + +[evidence/live-contract.json](evidence/live-contract.json) records the official contract, a timestamped leaderboard response and read-only connection status. On 8 October 2026 at 22:59 UTC, the leading account average was 12.5%, versus an untrained 10% reference. That one-task gap is not a statistically established advantage. The latest official leaderboard remains authoritative. + +Verification completed locally on 8 October 2026: + +| Check | Observed result | +| --- | --- | +| Current v2 Python suite | 88/88 passed plus 782 subtests; v2 image validation pending | +| Original generator/oracle coverage | 768 deterministic cases: 8 families × 3 difficulties × 32 seeds | +| Pinned native OpenEnv validator against a real local server process | 6/6 criteria passed; [report](evidence/openenv-runtime.json) and [native schema](evidence/schema.json) | +| Submission safety tests | 22/22 passed | +| MetaHarness/rGi workflow tests | 16/16 passed, zero skipped | +| Linux amd64 container build, isolated controls and native runtime | Passed in [GitHub Actions](https://github.com/ruvnet/metaharness/actions/runs/37858042127): 61 tests and 6/6 protocol criteria | +| GHCR push, anonymous pull and 61 container controls | Passed in [publication CI](https://github.com/ruvnet/metaharness/actions/runs/37858361136) | +| Native WebSocket controls | 32/32 episodes passed from the anonymously pulled release on a [fresh runner](https://github.com/ruvnet/metaharness/actions/runs/37859352503); reports archived | +| Actual model calibration or transfer | Public v1 target-model probe retained; independent review pending; no transfer result | +| Arena submission and private evaluation | Not run | + +The native validator report uses the SDK label `mode: simulation` for its local protocol check. It contacted the running localhost HTTP/WebSocket server; it is not a GPU training or model performance result. These checks establish a local foundation. A built and anonymously verified public image, attributed public dataset, accepted submission and private evaluation must each be reported separately. No Arena submission or public board message is sent by the implementation tests. + +Acceptance: run the native validator and full local suite, replay every declared task from the exact anonymous image digest, then obtain an actual private evaluation whose public attributed score exceeds the contemporaneous leader. Until the final step, competitive performance remains unmeasured. + +Released image: `ghcr.io/ruvnet/metaharness-arena@sha256:730f64d25ff21431a0af9c5d4fea8da2d74257569e1d53a2295d90c2c9721252`. This is the v1 baseline built from source commit `90a793a9f4f1a06a5b6422164951e9192c909daa`. Publication and anonymous registry access passed. The public HF dataset is [ruv/metaharness-arena-tasks](https://huggingface.co/datasets/ruv/metaharness-arena-tasks), revision `8323b7b221ea977d8fce4409973678a80e50fb77`, verified anonymously as 768 rows. Model evidence and final user approval remain separate gates. diff --git a/components/metaharness/upstream/arena_env/__init__.py b/components/metaharness/upstream/arena_env/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4ce2ee5065e1b08c3f8b7e0831822d3706ee1309 --- /dev/null +++ b/components/metaharness/upstream/arena_env/__init__.py @@ -0,0 +1 @@ +"""Original procedural environments for OpenEnv Arena.""" diff --git a/components/metaharness/upstream/arena_env/app.py b/components/metaharness/upstream/arena_env/app.py new file mode 100644 index 0000000000000000000000000000000000000000..c103ca7a0e28bd8b51567bcaaa498c77d2250bef --- /dev/null +++ b/components/metaharness/upstream/arena_env/app.py @@ -0,0 +1,4 @@ +from openenv.core.env_server.http_server import create_app +from .environment import ArenaAction, ArenaEnvironment, ArenaObservation + +app = create_app(ArenaEnvironment, ArenaAction, ArenaObservation, env_name="metaharness_arena", max_concurrent_envs=8) diff --git a/components/metaharness/upstream/arena_env/environment.py b/components/metaharness/upstream/arena_env/environment.py new file mode 100644 index 0000000000000000000000000000000000000000..9365f452f56fa1495735075806d015fbfef654fc --- /dev/null +++ b/components/metaharness/upstream/arena_env/environment.py @@ -0,0 +1,95 @@ +"""A bounded virtual-file environment, with no shell or filesystem capabilities.""" +from __future__ import annotations + +import json +import secrets +from typing import Any, Literal +from uuid import uuid4 + +from openenv.core.env_server.interfaces import Environment +from openenv.core.env_server.types import Action, Observation, State +from pydantic import Field + +from .tasks import TASK_IDS, make_task, grade + +MAX_STEPS = 16 +MAX_ANSWER_BYTES = 16384 + + +class ArenaAction(Action): + op: Literal["list", "read", "submit"] = Field(description="List files, read a file (or * for all), or submit the final structured answer once.") + path: str = Field(default="", description="Exact virtual filename, or * to read all files.") + answer: dict[str, Any] = Field(default_factory=dict, description="For submit: answer object matching the prompt. An empty object ends with reward zero.") + + +class ArenaObservation(Observation): + task_id: str = "" + prompt: str = "" + files: list[str] = Field(default_factory=list) + content: str = "" + error: str = "" + remaining_steps: int = 0 + + +class ArenaEnvironment(Environment[ArenaAction, ArenaObservation, State]): + SUPPORTS_CONCURRENT_SESSIONS = True + + def __init__(self): + super().__init__() + self._state = State(episode_id=str(uuid4()), step_count=0) + self._task: dict[str, Any] | None = None + self._done = False + self._reward = 0.0 + + def reset(self, seed: int | None = None, episode_id: str | None = None, **kwargs: Any) -> ArenaObservation: + task_id = kwargs.get("task_id", TASK_IDS[0]) + if not isinstance(task_id, str): + raise ValueError("task_id must be a string") + difficulty = 2 + family = task_id + for level in (1, 2, 3): + if task_id.endswith(f"-d{level}"): + family, difficulty = task_id[:-3], level + break + if family not in TASK_IDS: + raise ValueError("unknown task_id") + if seed is None: + seed = secrets.randbelow(2**63) + if type(seed) is not int or seed < 0 or seed >= 2**64: + raise ValueError("seed must be an unsigned 64 bit integer") + self._task = make_task(family, seed, difficulty) + self._state = State(episode_id=episode_id or str(uuid4()), step_count=0) + self._done, self._reward = False, 0.0 + return self._observe(prompt=self._task["prompt"] + "\nUse read with path * to read all files in one call. Then submit your answer object once. No shell is available.", files=sorted(self._task["files"])) + + def _observe(self, **fields: Any) -> ArenaObservation: + return ArenaObservation(task_id=self._task["task_id"] if self._task else "", done=self._done, reward=self._reward, remaining_steps=max(0, MAX_STEPS-self._state.step_count), **fields) + + def step(self, action: ArenaAction, timeout_s: float | None = None, **kwargs: Any) -> ArenaObservation: + if self._task is None: + raise RuntimeError("reset required") + if self._done: + return self._observe(error="episode is terminal; reset before another attempt") + self._state.step_count += 1 + if action.op == "submit": + self._done = True + try: + encoded = json.dumps(action.answer, allow_nan=False, separators=(",", ":")) + self._reward = grade(self._task, action.answer) if len(encoded.encode()) <= MAX_ANSWER_BYTES else 0.0 + except (ValueError, TypeError, RecursionError): + self._reward = 0.0 + return self._observe() + if self._state.step_count >= MAX_STEPS: + self._done = True + return self._observe(error="step budget exhausted") + if action.op == "list": + return self._observe(files=sorted(self._task["files"])) + if action.path == "*": + return self._observe(content=json.dumps(self._task["files"], ensure_ascii=True, separators=(",", ":"))) + if action.path not in self._task["files"]: + return self._observe(error="unknown virtual file; use list for exact names") + return self._observe(content=self._task["files"][action.path]) + + @property + def state(self) -> State: + return self._state.model_copy(deep=True) diff --git a/components/metaharness/upstream/arena_env/tasks.py b/components/metaharness/upstream/arena_env/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..2e3fa41ddbdf0ca7aaaef10c3d991430d7fb98e3 --- /dev/null +++ b/components/metaharness/upstream/arena_env/tasks.py @@ -0,0 +1,800 @@ +"""Original bounded tool-reading curricula for OpenEnv Arena. + +Task source files contain all facts needed to solve the episode. ``expected`` +and ``rubric`` are private server-side verifier material and MUST NOT be sent +in observations. No source file is executed and no network access is needed. + +Generation uses an isolated PRNG; the reference oracle rereads the virtual +files and never reads ``expected``. Scheduling and routing use different +search formulations in generation and in the oracle. +""" + +from __future__ import annotations + +import copy +import hashlib +import heapq +import itertools +import json +import math +import random +from collections import deque +from fractions import Fraction +from typing import Any + + +TASK_IDS = [ + "software_change", "industrial_schedule", "science_calibration", + "office_reconciliation", "finance_ledger", "math_route", + "security_triage", "media_timeline", +] +DOMAINS = dict(zip(TASK_IDS, [ + "software engineering", "industrial and physical systems", "natural science", + "office and white-collar work", "finance and economics", "math and formal reasoning", + "cybersecurity", "media and content production", +])) + + +def _json(value: Any) -> str: + return json.dumps(value, sort_keys=True, separators=(",", ":")) + "\n" + + +def _load(task: dict, name: str) -> Any: + return json.loads(task["files"][name]) + + +def _ids(rng: random.Random, prefix: str, count: int) -> list[str]: + """Opaque synthetic identifiers prevent memorizing fixed anomaly rows.""" + return [f"{prefix}_{number:04}" for number in rng.sample(range(1000, 10000), count)] + + +def _task(task_id: str, prompt: str, files: dict, expected: dict) -> dict: + return { + "task_id": task_id, + "domain": DOMAINS[task_id], + "prompt": prompt + " Read all three files. Submit exactly the documented JSON object; " + "all numeric results must have integer values, and ID lists must be lexicographically sorted " + "unless an execution order or route is requested. Do not include explanations or extra keys.", + "files": {k: _json(v) for k, v in files.items()}, + "expected": copy.deepcopy(expected), + "rubric": { + "version": 2, + "components": {k: 1 / len(expected) for k in expected}, + "partial_credit": "Equal credit for wholly correct output components; zero/empty components count once " + "another correct substantive component anchors the answer. " + "incomplete answers are capped at 0.8. Empty/noop answers receive zero.", + "max_partial": 0.8, + }, + } + + +def _software(rng: random.Random, d: int) -> dict: + names = [f"svc_{i:02}" for i in range(4 + 2 * d)] + rng.shuffle(names) + modules = {} + for i, name in enumerate(names): + deps = rng.sample(names[:i], min(i, rng.randint(1, 3))) + modules[name] = sorted(deps) + changed = sorted(rng.sample(names[1:1 + len(names) // 2], d)) + tests = {f"test_{i:02}": {"targets": sorted(rng.sample(names, rng.randint(1, min(4, d + 2)))), + "cost": rng.randint(2, 10)} for i in range(5 + d)} + # Two expensive fallback suites guarantee coverage without disclosing impact. + tests["test_full_a"] = {"targets": names[::2], "cost": 12 + d} + tests["test_full_b"] = {"targets": names[1::2], "cost": 12 + d} + affected = set(changed) + # Generation order is topological, independent of the shuffled public IDs. + for name in names: + if any(dep in affected for dep in modules[name]): + affected.add(name) + indegree = {name: sum(dep in affected for dep in modules[name]) for name in affected} + ready = [name for name, count in indegree.items() if count == 0] + heapq.heapify(ready) + order = [] + while ready: + current = heapq.heappop(ready) + order.append(current) + for consumer in affected: + if current in modules[consumer]: + indegree[consumer] -= 1 + if indegree[consumer] == 0: + heapq.heappush(ready, consumer) + covers = [] + test_names = sorted(tests) + for count in range(1, len(tests) + 1): + for selected in itertools.combinations(test_names, count): + covered = set().union(*(tests[name]["targets"] for name in selected)) + if affected <= covered: + covers.append((sum(tests[name]["cost"] for name in selected), count, selected)) + test_cost, _, selected = min(covers) + expected = { + "affected": sorted(affected), + "tests": list(selected), "test_cost": test_cost, + "build_order": order, + } + return _task("software_change", + "A release changes the modules in change.json. modules.json maps each module to its direct " + "dependencies. Rebuild changed modules and every transitive consumer. Unaffected dependencies " + "are already built. tests.json gives each regression suite's targets and cost. Select suites " + "whose target union covers EVERY affected module; minimize total cost, then suite count, " + "then the sorted suite ID list lexicographically. Covering extra unaffected modules is allowed. " + 'Return {"affected":[module IDs],"tests":[selected suite IDs],"test_cost":integer,"build_order":[module IDs]}. ' + "build_order must be a topological ordering of affected modules, always choosing the " + "lexicographically smallest currently eligible module.", + {"modules.json": modules, "change.json": {"changed": changed}, "tests.json": tests}, expected) + + +def _industrial(rng: random.Random, d: int) -> dict: + n = 4 + d + jobs = [{"id": f"job_{i}", "duration": rng.randint(2, 8), "release": rng.randint(0, 8), + "due": rng.randint(9, 30), "weight": rng.randint(1, 5)} for i in range(n)] + precedences = [[f"job_{i}", f"job_{j}"] for j in range(1, n) for i in range(j) + if rng.random() < 0.12 * d] + calendar = {"blackout": [rng.randint(7, 11), rng.randint(14, 18)], "start": 0} + # Layered prefix expansion, discarding precedence-infeasible branches. + states = [((), 0, 0, {})] + for _ in range(n): + expanded = [] + for order, end, penalty, completion in states: + for job in jobs: + name = job["id"] + if name in order or any(a not in order for a, b in precedences if b == name): + continue + start = max(end, job["release"]) + lo, hi = calendar["blackout"] + if start < hi and start + job["duration"] > lo: + start = hi + finish = start + job["duration"] + expanded.append((order + (name,), finish, + penalty + job["weight"] * max(0, finish - job["due"]), + {**completion, name: finish})) + states = expanded + order, end, penalty, completion = min(states, key=lambda x: (x[2], x[1], x[0])) + return _task("industrial_schedule", + "Plan jobs on one nonpreemptive shared service machine. Read jobs.json, precedences.json " + "and calendar.json. Each precedence pair [a,b] requires a before b. For a chosen order, " + "start each job as early as possible after the prior completion and its release time. " + "No interval may overlap blackout [lo,hi); a job ending exactly at lo is allowed and a job " + "starting exactly at hi is allowed. If it overlaps, move its start to hi. Minimize the sum " + "of weight*max(0,completion-due), then makespan, then lexicographic execution order. " + 'Return {"order":[job IDs],"completion":{job ID:completion minute},' + '"weighted_tardiness":integer,"makespan":integer}. Do not insert discretionary idle time.', + {"jobs.json": jobs, "precedences.json": precedences, "calendar.json": calendar}, + {"order": list(order), "completion": completion, "weighted_tardiness": penalty, "makespan": end}) + + +def _science(rng: random.Random, d: int) -> dict: + gain, offset, drift = rng.randint(2, 7), rng.randint(-15, 15), rng.choice([-3, -2, -1, 1, 2, 3]) + refs = [{"reference": v, "time": t, "raw": v * gain + offset + drift * t} + for v, t in ((5, 0), (45, 0), (5, 10))] + rng.shuffle(refs) + policy = {"acceptable_median": [15, 35], "max_replicate_span": rng.randint(6, 9)} + raw, medians, quarantine, accepted = {}, {}, [], [] + sample_ids = _ids(rng, "sample", 4 + d * 2) + bad_positions = set(rng.sample(range(len(sample_ids)), rng.randint(1, len(sample_ids) - 2))) + for i, name in enumerate(sample_ids): + base = rng.randint(19, 31) + values = [base - 1, base, base + 1] if d == 1 else [base - 2, base - 1, base, base + 1, base + 2] + if i in bad_positions: + if rng.random() < .5: + values[0] -= policy["max_replicate_span"] + 3 + else: + values = [v + 20 for v in values] + time, weight = rng.randint(1, 12), rng.randint(1, 2 + d) + medians[name] = sorted(values)[len(values) // 2] + bad = max(values) - min(values) > policy["max_replicate_span"] or not 15 <= medians[name] <= 35 + if bad: + quarantine.append(name) + else: + accepted.append((medians[name], weight)) + rng.shuffle(values) + raw[name] = {"time": time, "weight": weight, "raw": [gain * v + offset + drift * time for v in values]} + mean = Fraction(sum(value * weight for value, weight in accepted), sum(weight for _, weight in accepted)) + return _task("science_calibration", + "Audit a sensor with linear time drift. calibration.json gives standards satisfying " + "raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards " + "regardless of their file order. Correct each sample's raw replicates at its recorded time. " + "Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose " + "median is outside the inclusive acceptable_median interval in policy.json. Compute the " + "WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction " + "with positive denominator. " + '{"calibration":{"gain":integer,"offset":integer,"drift":integer},"medians":{sample ID:integer},' + '"quarantine":[sample IDs],"accepted_mean":{"numerator":integer,"denominator":integer}}.', + {"calibration.json": refs, "samples.json": raw, "policy.json": policy}, + {"calibration": {"gain": gain, "offset": offset, "drift": drift}, "medians": medians, + "quarantine": sorted(quarantine), "accepted_mean": {"numerator": mean.numerator, "denominator": mean.denominator}}) + + +def _office(rng: random.Random, d: int) -> dict: + master = [{"id": f"person_{i}", "email": f"person{i}@example.invalid", + "phone": f"555010{i:04}", "team": rng.choice(["ops", "sales", "research"])} + for i in range(3 + d)] + aliases = {f"legacy{i}@example.invalid": row["email"] for i, row in enumerate(master)} + policy = {"aliases": aliases, "source_priority": {"hr": 3, "crm": 2, "import": 1}} + changes = [] + row_ids = _ids(rng, "row", 6 + 3 * d) + unresolved_index = rng.randrange(len(row_ids)) + for i, row_id in enumerate(row_ids): + person = rng.randrange(len(master)) + email = rng.choice([f"person{person}@example.invalid", f"legacy{person}@example.invalid"]) + if i == unresolved_index: + email = "unknown@example.invalid" + fields = {"team": rng.choice(["ops", "sales", "research", "support"])} + if i % 3 != 0: + fields["phone"] = f"(555) 02{rng.randrange(100000):05}" + changes.append({"id": row_id, "email": f" {email.upper()} ", + "timestamp": rng.randint(100, 103), "source": rng.choice(list(policy["source_priority"])), + "fields": fields}) + # Group by entity and field; pick the maximum provenance tuple. + result = {r["id"]: {"phone": r["phone"], "team": r["team"]} for r in master} + email_to_id = {r["email"]: r["id"] for r in master} + groups: dict = {} + unresolved = [] + for row in changes: + address = row["email"].strip().lower() + address = aliases.get(address, address) + who = email_to_id.get(address) + if who is None: + unresolved.append(row["id"]) + continue + for key, value in row["fields"].items(): + if key == "phone": + value = "".join(c for c in value if c.isdigit()) + groups.setdefault((who, key), []).append( + ((row["timestamp"], policy["source_priority"][row["source"]], row["id"]), value)) + for (who, field), candidates in groups.items(): + result[who][field] = max(candidates)[1] + rng.shuffle(changes) + return _task("office_reconciliation", + "Merge contact updates without merging different people. Read contacts.json, changes.json " + "and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly " + "one alias lookup, then match the master email. Unmatched rows are unresolved. For each " + "person and each field independently, use the update with greatest timestamp, then greatest " + "source_priority, then lexicographically greatest row ID. Preserve the master value if no " + "matching update supplies that field. Strip every nondigit character from updated phones. " + 'Return {"contacts":{person ID:{"phone":string,"team":string}},"unresolved":[row IDs]}.', + {"contacts.json": master, "changes.json": changes, "policy.json": policy}, + {"contacts": result, "unresolved": sorted(unresolved)}) + + +def _finance(rng: random.Random, d: int) -> dict: + opening = {f"acct_{i}": rng.randint(2000, 12000) for i in range(2 + d)} + entry_count, reversal_count = 5 + d * 2, rng.randint(3, 4 + d) + event_ids = _ids(rng, "txn", entry_count + reversal_count) + pending = set(rng.sample(range(entry_count), rng.randint(0, d + 1))) + protected = rng.choice([i for i in range(entry_count) if i not in pending]) + events = [] + for i in range(entry_count): + events.append({"id": event_ids[i], "kind": "entry", + "account": rng.choice(list(opening)), "cents": rng.choice([-1, 1]) * rng.randint(50, 1900), + "status": "pending" if i in pending else "posted"}) + amount = abs(events[protected]["cents"]) + first_amount = rng.randint(1, amount) + second_amount = rng.randint(1, amount) + for i in range(reversal_count): + target = event_ids[protected] if i < 2 else rng.choice([name for name in event_ids if name != event_ids[protected]] + ["absent"]) + events.append({"id": event_ids[entry_count + i], "kind": "reversal", "target": target, + "cents": [first_amount, second_amount][i] if i < 2 else rng.randint(1, 1600), + "status": "posted" if i < 2 or rng.random() > .2 else "pending"}) + # Interleave timestamps, then guarantee one real partial reversal. The second + # may succeed or exceed remaining principal; other events may refer forward. + forced = events[entry_count:entry_count + 2] + events = events[:entry_count] + events[entry_count + 2:] + rng.shuffle(events) + pos = next(i for i, event in enumerate(events) if event["id"] == event_ids[protected]) + 1 + events[pos:pos] = forced + for sequence, event in enumerate(events): + event["sequence"] = sequence + policy = {"currency": "USD", "unit": "integer cents", "reversal": "positive partial amount, cumulative cap is original absolute cents"} + closing = dict(opening) + applied, rejected, held, used, posting = [], [], [], {}, {} + for event in events: + name = event["id"] + if event["status"] != "posted": + held.append(name) + elif event["kind"] == "entry": + closing[event["account"]] += event["cents"] + posting[name] = event + applied.append(name) + else: + target = posting.get(event["target"]) + cents = event["cents"] + if target is None or cents <= 0 or used.get(target["id"], 0) + cents > abs(target["cents"]): + rejected.append(name) + else: + closing[target["account"]] -= cents if target["cents"] > 0 else -cents + used[target["id"]] = used.get(target["id"], 0) + cents + applied.append(name) + rng.shuffle(events) + return _task("finance_ledger", + "Close a synthetic cash ledger using accounts.json, events.json and policy.json. Process " + "ascending sequence, not file order. Pending entries AND pending reversals are held with " + "no effect. Posted entries add signed cents. A posted reversal has POSITIVE cents and undoes " + "that amount against a previously applied entry, in the opposite direction to its sign. " + "Reject unknown, future, pending, or reversal targets, nonpositive amounts, and reversals " + "that would make cumulative accepted reversal cents exceed the original absolute cents. " + "Reject the entire over-limit event; never clip its amount. Partial reversals may repeat " + "until the principal is exhausted. applied_ids includes BOTH accepted entry events AND " + "accepted reversal events; original entries remain applied even when fully reversed. " + 'Return {"closing_cents":{account ID:integer},"applied_ids":[event IDs],' + '"rejected_ids":[event IDs],"held_ids":[event IDs]}.', + {"accounts.json": opening, "events.json": events, "policy.json": policy}, + {"closing_cents": closing, "applied_ids": sorted(applied), "rejected_ids": sorted(rejected), "held_ids": sorted(held)}) + + +def _math(rng: random.Random, d: int) -> dict: + n = 6 + 2 * d + nodes = [f"N{i:02}" for i in range(n)] + blocked = rng.choice(nodes[2:-2]) + backbone = [node for node in nodes if node != blocked] + edges = {} + for a, b in zip(backbone, backbone[1:]): + edges[(a, b)] = {"from": a, "to": b, "minutes": rng.randint(1, 7), "exposure": rng.randint(0, 2)} + for i in range(n): + for j in range(i + 1, n): + if (nodes[i], nodes[j]) not in edges and rng.random() < .23: + edges[(nodes[i], nodes[j])] = {"from": nodes[i], "to": nodes[j], + "minutes": rng.randint(2, 12), "exposure": rng.randint(0, 5)} + checkpoints = sorted(rng.sample(backbone[1:-1], d)) + budget = sum(edges[(a, b)]["exposure"] for a, b in zip(backbone, backbone[1:])) + rng.randint(0, 3) + request = {"start": nodes[0], "goal": nodes[-1], "required": checkpoints} + policy = {"forbidden": [blocked], "max_exposure": budget} + arrivals = {backbone[0]: 0} + for a, b in zip(backbone, backbone[1:]): + arrivals[b] = arrivals[a] + edges[(a, b)]["minutes"] + policy["node_windows"] = {node: [max(0, arrivals[node] - rng.randint(0, 5)), arrivals[node] + rng.randint(0, 4)] + for node in rng.sample(backbone[2:], d + 1)} + policy["required_before"] = {node: [rng.choice(backbone[1:backbone.index(node)])] + for node in rng.sample(backbone[3:], d)} + candidates = [] + def visit(path: list, minutes: int, exposure: int) -> None: + if exposure > budget: + return + if path[-1] == nodes[-1]: + if all(c in path for c in checkpoints): + candidates.append((minutes, exposure, tuple(path))) + return + for (a, b), edge in edges.items(): + if a == path[-1] and b != blocked: + if any(key not in path for key in policy["required_before"].get(b, [])): + continue + arrival = minutes + edge["minutes"] + lo, hi = policy["node_windows"].get(b, [0, 10**9]) + arrival = max(arrival, lo) + if arrival <= hi: + visit(path + [b], arrival, exposure + edge["exposure"]) + visit([nodes[0]], 0, 0) + minutes, exposure, route = min(candidates) + return _task("math_route", + "Find a constrained route in a directed acyclic network. Read graph.json, request.json " + "and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed " + "exposure at or below max_exposure. Among feasible routes minimize total minutes, then " + "total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a " + "node with [open,close] in node_windows, wait until open if early and reject arrival after " + "close. Waiting adds minutes but no exposure. Each required_before mapping requires those " + "nodes to have been visited BEFORE entering its key node. Edges are directed. " + 'Return {"route":[node IDs in travel order],"minutes":integer,"exposure":integer}.', + {"graph.json": list(edges.values()), "request.json": request, "policy.json": policy}, + {"route": list(route), "minutes": minutes, "exposure": exposure}) + + +def _security(rng: random.Random, d: int) -> dict: + users = {f"user_{i}": {"role": ["reader", "operator", "admin"][i % 3], "enabled": i != 1} + for i in range(3 + d)} + policy = { + "role_actions": {"reader": ["read"], "operator": ["read", "write"], "admin": ["read", "write", "delete"]}, + "secret_roles": ["admin"], "trusted_zones": ["office", "vpn"], + "mfa_actions": ["write", "delete"], "containment_denials": 2, + } + events = [] + for event_id in _ids(rng, "event", 7 + d * 3): + events.append({"id": event_id, "user": rng.choice(list(users)), + "action": rng.choice(["read", "write", "delete"]), + "sensitivity": rng.choice(["public", "internal", "secret"]), + "zone": rng.choice(["office", "vpn", "external"]), + "mfa": rng.choice([True, False]), "time": rng.randint(95, 105), "expires": 100}) + events[0].update(user="user_0", action="read", sensitivity="public", zone="office", mfa=True, time=99) + allowed, denied, counts = [], {}, dict.fromkeys(users, 0) + for event in events: + user = users[event["user"]] + tests = { + "disabled": not user["enabled"], + "action_forbidden": event["action"] not in policy["role_actions"][user["role"]], + "secret_role": event["sensitivity"] == "secret" and user["role"] not in policy["secret_roles"], + "mfa_required": (event["action"] in policy["mfa_actions"] or event["sensitivity"] == "secret") and not event["mfa"], + "untrusted_zone": event["sensitivity"] != "public" and event["zone"] not in policy["trusted_zones"], + "expired": event["time"] >= event["expires"], + } + reasons = sorted(k for k, bad in tests.items() if bad) + if reasons: + denied[event["id"]] = reasons + counts[event["user"]] += 1 + else: + allowed.append(event["id"]) + return _task("security_triage", + "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json " + "and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: " + "disabled if the identity is disabled; action_forbidden if the role lacks the action; " + "secret_role if secret data needs a role absent from secret_roles; mfa_required if a " + "mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic " + "data is accessed outside trusted_zones; expired if time>=expires. Count denied requests " + "per user, not individual reason codes. Contain users meeting containment_denials. " + 'Return {"allowed_ids":[event IDs],"denied":{event ID:[sorted reason codes]},' + '"containment":[user IDs]}. Only denied events belong in denied.', + {"identities.json": users, "policy.json": policy, "events.json": events}, + {"allowed_ids": sorted(allowed), "denied": denied, + "containment": sorted(k for k, count in counts.items() if count >= policy["containment_denials"])}) + + +def _media(rng: random.Random, d: int) -> dict: + names = [f"asset_{i}" for i in range(4 + d)] + unlicensed = set(rng.sample(names, rng.randint(1, 2))) + assets = {name: {"frames": rng.randint(350, 650), "licensed": name not in unlicensed, + "fps": rng.choice([24, 25, 30])} for name in names} + policy = {"max_overlap": rng.randint(8, 18), "delivery_budget": 150 + d * 60, + "require_license": True, "fps": rng.choice([24, 25, 30])} + clip_ids = _ids(rng, "clip", 4 + d * 2) + faults = set(rng.sample(range(len(clip_ids)), rng.randint(1, len(clip_ids) - 2))) + clips = [] + for i, clip_id in enumerate(clip_ids): + asset = rng.choice([name for name in names if name not in unlicensed]) + speed = rng.choice([(1, 1), (2, 1), (1, 2), (3, 2)]) + ratio = Fraction(speed[1] * policy["fps"], speed[0] * assets[asset]["fps"]) + start = rng.randint(0, 40) + length = ratio.denominator * rng.randint(4, min(12, 250 // ratio.denominator)) + stop = start + length + if i in faults: + mode = rng.choice(["license", "bounds", "fraction", "combined"]) + if mode in ("license", "combined"): + asset = rng.choice(sorted(unlicensed)) + if mode in ("bounds", "combined"): + stop = assets[asset]["frames"] + rng.randint(1, 12) + if mode == "fraction": + # Rendering one source frame at this rational speed cannot be integral. + speed = (2 * policy["fps"], 1) + stop = start + 1 + clips.append({"id": clip_id, "asset": asset, "in": start, "out": stop, + "speed_num": speed[0], "speed_den": speed[1], "overlap": rng.randint(0, 30), + "gap_before": rng.randint(1, 12) if rng.random() < .25 else 0}) + rejected, timeline = {}, [] + previous_duration, end = 0, 0 + for clip in clips: + asset = assets[clip["asset"]] + reasons = [] + if not asset["licensed"]: + reasons.append("unlicensed") + if not 0 <= clip["in"] < clip["out"] <= asset["frames"]: + reasons.append("source_bounds") + length = Fraction((clip["out"] - clip["in"]) * clip["speed_den"] * policy["fps"], + clip["speed_num"] * asset["fps"]) + if length.denominator != 1: + reasons.append("fractional_frame") + if reasons: + rejected[clip["id"]] = sorted(reasons) + continue + duration = int(length) + gap = clip["gap_before"] + overlap = 0 if not timeline or gap else min(clip["overlap"], policy["max_overlap"], previous_duration - 1, duration - 1) + start = end + gap - overlap + end = start + duration + timeline.append({"id": clip["id"], "start": start, "end": end}) + previous_duration = duration + return _task("media_timeline", + "Repair an edit list with mixed source frame rates. Read assets.json, edits.json and " + "delivery.json. Source [in,out) intervals use the asset fps; timeline uses delivery fps. " + "Rendered duration=(out-in)*speed_den*delivery.fps/(speed_num*asset.fps). Reject clips for ALL " + "applicable reasons: unlicensed when a required license is absent; source_bounds unless " + "0<=in dict: + """Generate a fresh task without touching global RNG state or caller data.""" + if task_id not in _GENERATORS: + raise ValueError(f"Unknown task_id: {task_id!r}") + if type(seed) is not int: + raise ValueError("seed must be an integer, not a boolean") + if type(difficulty) is not int or difficulty not in (1, 2, 3): + raise ValueError("difficulty must be 1, 2, or 3") + seed_bytes = f"arena-curriculum-v2|{task_id}|{seed}|{difficulty}".encode() + rng = random.Random(int.from_bytes(hashlib.sha256(seed_bytes).digest(), "big")) + result = _GENERATORS[task_id](rng, difficulty) + result.update(seed=seed, difficulty=difficulty, generator_version=2) + return result + + +def _strict_equal(a: Any, b: Any) -> bool: + """JSON equality without Python's True==1 or nonfinite-number traps.""" + if type(b) is int and type(a) in (int, float): + return type(a) is int and a == b or type(a) is float and math.isfinite(a) and a.is_integer() and a == b + if type(a) is not type(b): + return False + if isinstance(a, dict): + return a.keys() == b.keys() and all(_strict_equal(a[k], b[k]) for k in a) + if isinstance(a, list): + return len(a) == len(b) and all(_strict_equal(x, y) for x, y in zip(a, b)) + if isinstance(a, float) and not math.isfinite(a): + return False + return a == b + + +def _substantive(value: Any) -> bool: + if isinstance(value, dict): + return any(_substantive(v) for v in value.values()) + if isinstance(value, list): + return any(_substantive(v) for v in value) + return type(value) is str and bool(value) or type(value) in (int, float) and value != 0 + + +def _valid_answer(value: Any) -> bool: + """Bound verifier work and reject coercion-prone or non-JSON answers.""" + pending, count = [(value, 0)], 0 + while pending: + node, depth = pending.pop() + count += 1 + if depth > 20 or count > 2048: + return False + if type(node) is dict: + if any(type(key) is not str for key in node): + return False + pending.extend((item, depth + 1) for item in node.values()) + elif type(node) is list: + pending.extend((item, depth + 1) for item in node) + elif type(node) is float: + if not math.isfinite(node): + return False + elif type(node) not in (int, str): + return False + return True + + +def grade(task: dict, answer: dict) -> float: + """Grade only exact meaningful components; never mutate task or answer.""" + if type(answer) is not dict or not answer or not _valid_answer(answer): + return 0.0 + expected = task["expected"] + if any(type(key) is not str or key not in expected for key in answer): + return 0.0 + correct = [key for key in expected if key in answer and _strict_equal(answer[key], expected[key])] + if len(correct) == len(expected): + return 1.0 + if not any(_substantive(answer[key]) for key in correct): + return 0.0 + return min(0.8, len(correct) / len(expected)) + + +def oracle_answer(task: dict) -> dict: + """Independent deterministic reference solution from the three source files. + + This function is an offline test/benchmark helper, never an environment tool. + It intentionally ignores cached expected answers and hidden generator state. + """ + task_id = task["task_id"] + if task_id == "software_change": + modules, changes, tests = (_load(task, x) for x in ("modules.json", "change.json", "tests.json")) + reverse = {name: [] for name in modules} + for consumer, dependencies in modules.items(): + for dependency in dependencies: + reverse[dependency].append(consumer) + affected, queue = set(), deque(changes["changed"]) + while queue: + name = queue.popleft() + if name not in affected: + affected.add(name) + queue.extend(reverse[name]) + remaining, order = set(affected), [] + while remaining: + chosen = min(name for name in remaining if not remaining.intersection(modules[name])) + order.append(chosen) + remaining.remove(chosen) + # Coverage-state dynamic programming, independent of subset enumeration. + bits = {name: 1 << i for i, name in enumerate(sorted(affected))} + states = {0: (0, 0, ())} + for name, suite in sorted(tests.items()): + mask = sum(bits.get(target, 0) for target in suite["targets"]) + for covered, (cost, count, selected) in list(states.items()): + candidate = (cost + suite["cost"], count + 1, selected + (name,)) + union = covered | mask + if union not in states or candidate < states[union]: + states[union] = candidate + cost, _, selected = states[(1 << len(bits)) - 1] + return {"affected": sorted(affected), "tests": list(selected), "test_cost": cost, "build_order": order} + + if task_id == "industrial_schedule": + jobs, precedences, calendar = (_load(task, x) for x in ("jobs.json", "precedences.json", "calendar.json")) + by_id = {job["id"]: job for job in jobs} + best, completions = None, None + for order in itertools.permutations(sorted(by_id)): + positions = {name: i for i, name in enumerate(order)} + if any(positions[a] >= positions[b] for a, b in precedences): + continue + end, penalty, completion = calendar["start"], 0, {} + for name in order: + job = by_id[name] + end = max(end, job["release"]) + lo, hi = calendar["blackout"] + # Two half-open intervals intersect iff max(starts) policy["max_replicate_span"] or middle < lo or middle > hi: + quarantine.append(name) + else: + total += middle * sample["weight"] + count += sample["weight"] + mean = total / count + return {"calibration": {"gain": int(slope), "offset": int(intercept), "drift": int(drift)}, "medians": medians, + "quarantine": sorted(quarantine), "accepted_mean": {"numerator": mean.numerator, "denominator": mean.denominator}} + + if task_id == "office_reconciliation": + master, changes, policy = (_load(task, x) for x in ("contacts.json", "changes.json", "policy.json")) + contacts = {person["id"]: {"phone": person["phone"], "team": person["team"]} for person in master} + unresolved = [] + # Applying ascending provenance order naturally retains the last field update. + for row in sorted(changes, key=lambda r: (r["timestamp"], policy["source_priority"][r["source"]], r["id"])): + address = row["email"].lower().strip() + address = policy["aliases"].get(address, address) + matching = [person for person in master if person["email"] == address] + if not matching: + unresolved.append(row["id"]) + continue + for field in ("phone", "team"): + if field in row["fields"]: + value = row["fields"][field] + contacts[matching[0]["id"]][field] = "".join(filter(str.isdigit, value)) if field == "phone" else value + return {"contacts": contacts, "unresolved": sorted(unresolved)} + + if task_id == "finance_ledger": + opening, events = _load(task, "accounts.json"), _load(task, "events.json") + ordered = sorted(events, key=lambda row: row["sequence"]) + applied, held, rejected = [], [], [] + contributions = {account: [] for account in opening} + for position, event in enumerate(ordered): + if event["status"] == "pending": + held.append(event["id"]) + continue + if event["kind"] == "entry": + contributions[event["account"]].append(event["cents"]) + else: + targets = [old for old in ordered[:position] if old["id"] == event["target"] + and old["kind"] == "entry" and old["id"] in applied] + if not targets: + rejected.append(event["id"]) + continue + target = targets[0] + used = sum(old["cents"] for old in ordered[:position] if old["kind"] == "reversal" + and old["id"] in applied and old["target"] == target["id"]) + if event["cents"] <= 0 or used + event["cents"] > abs(target["cents"]): + rejected.append(event["id"]) + continue + contributions[target["account"]].append(-event["cents"] if target["cents"] > 0 else event["cents"]) + applied.append(event["id"]) + return {"closing_cents": {account: opening[account] + sum(values) for account, values in contributions.items()}, + "applied_ids": sorted(applied), "rejected_ids": sorted(rejected), "held_ids": sorted(held)} + + if task_id == "math_route": + edges, request, policy = (_load(task, x) for x in ("graph.json", "request.json", "policy.json")) + keys = set(request["required"]).union(*(set(required) for required in policy["required_before"].values())) + bits = {node: 1 << i for i, node in enumerate(sorted(keys))} + goal_mask = sum(bits[node] for node in request["required"]) + heap = [(0, 0, (request["start"],), bits.get(request["start"], 0))] + visited = set() + while heap: + minutes, exposure, route, mask = heapq.heappop(heap) + node = route[-1] + # Different arrival times can coalesce at a later opening window; + # retaining them preserves the route lexicographic tie breaker. + state = (node, mask, exposure, minutes) + if state in visited: + continue + visited.add(state) + if node == request["goal"] and mask & goal_mask == goal_mask: + return {"route": list(route), "minutes": minutes, "exposure": exposure} + for edge in edges: + if edge["from"] != node or edge["to"] in policy["forbidden"]: + continue + if any(not mask & bits[key] for key in policy["required_before"].get(edge["to"], [])): + continue + next_exposure = exposure + edge["exposure"] + lo, hi = policy["node_windows"].get(edge["to"], [0, 10**9]) + arrival = max(minutes + edge["minutes"], lo) + if arrival > hi: + continue + if next_exposure <= policy["max_exposure"]: + heapq.heappush(heap, (arrival, next_exposure, + route + (edge["to"],), mask | bits.get(edge["to"], 0))) + raise ValueError("No feasible route in task") + + if task_id == "security_triage": + identities, policy, events = (_load(task, x) for x in ("identities.json", "policy.json", "events.json")) + allowed, denied, denied_users = [], {}, [] + for event in events: + user = identities[event["user"]] + reasons = [] + if not user["enabled"]: + reasons.append("disabled") + if event["action"] not in policy["role_actions"].get(user["role"], []): + reasons.append("action_forbidden") + if event["sensitivity"] == "secret" and user["role"] not in policy["secret_roles"]: + reasons.append("secret_role") + needs_mfa = event["sensitivity"] == "secret" or event["action"] in policy["mfa_actions"] + if needs_mfa and not event["mfa"]: + reasons.append("mfa_required") + if event["sensitivity"] in ("internal", "secret") and event["zone"] not in policy["trusted_zones"]: + reasons.append("untrusted_zone") + if event["expires"] <= event["time"]: + reasons.append("expired") + if reasons: + denied[event["id"]] = sorted(reasons) + denied_users.append(event["user"]) + else: + allowed.append(event["id"]) + return {"allowed_ids": sorted(allowed), "denied": denied, + "containment": sorted(user for user in identities if denied_users.count(user) >= policy["containment_denials"])} + + if task_id == "media_timeline": + assets, clips, policy = (_load(task, x) for x in ("assets.json", "edits.json", "delivery.json")) + retained, rejected = [], {} + for clip in clips: + asset = assets[clip["asset"]] + numerator = (clip["out"] - clip["in"]) * clip["speed_den"] * policy["fps"] + duration, remainder = divmod(numerator, clip["speed_num"] * asset["fps"]) + reasons = [] + if policy["require_license"] and not asset["licensed"]: + reasons.append("unlicensed") + if not (0 <= clip["in"] < clip["out"] <= asset["frames"]): + reasons.append("source_bounds") + if remainder: + reasons.append("fractional_frame") + if reasons: + rejected[clip["id"]] = sorted(reasons) + else: + retained.append((clip, duration)) + timeline, total = [], 0 + for i, (clip, duration) in enumerate(retained): + gap = clip["gap_before"] + overlap = 0 if i == 0 or gap else min(policy["max_overlap"], clip["overlap"], duration - 1, retained[i - 1][1] - 1) + total += duration + gap - overlap + timeline.append({"id": clip["id"], "start": total - duration, "end": total}) + return {"rejected": rejected, "timeline": timeline, "total_frames": total, + "over_budget_frames": max(0, total - policy["delivery_budget"])} + raise ValueError(f"Unknown task_id: {task_id!r}") diff --git a/components/metaharness/upstream/requirements.lock b/components/metaharness/upstream/requirements.lock new file mode 100644 index 0000000000000000000000000000000000000000..8c0e359fb22e940e3f0006ebb947837467b8870f --- /dev/null +++ b/components/metaharness/upstream/requirements.lock @@ -0,0 +1,108 @@ +aiofile==3.12.3 +annotated-doc==0.0.5 +annotated-types==0.8.0 +anyio==4.15.1 +attrs==26.1.0 +authlib==1.8.0 +beartype==0.22.9 +brotli==1.2.0 +cachetools==7.2.1 +caio==0.12.9 +certifi==2026.7.22 +cffi==2.1.1 +charset-normalizer==3.5.2 +click==8.5.0 +cryptography==50.0.2 +cyclopts==5.2.0 +dnspython==2.8.0 +docstring-parser==0.18.0 +email-validator==2.3.0 +exceptiongroup==1.3.1 +fastapi==0.143.0 +fastmcp==3.4.8 +fastmcp-slim==3.4.8 +filelock==4.0.12 +fsspec==2026.9.0 +gradio==6.30.0 +gradio-client==2.7.2 +griffelib==2.3.2 +groovy==0.1.2 +h11==0.16.0 +hf-gradio==0.4.1 +hf-xet==1.7.0 +httpcore==1.0.9 +httpcore2==2.13.1 +httpx==0.28.1 +httpx-sse==0.4.3 +httpx2==2.13.1 +huggingface-hub==2.2.0 +idna==3.20 +jaraco-classes==3.4.0 +jaraco-context==6.1.2 +jaraco-functools==4.6.0 +jeepney==0.9.0 +jinja2==3.1.6 +jiter==0.17.0 +joserfc==1.7.5 +jsonref==1.1.0 +jsonschema==4.26.0 +jsonschema-path==0.5.0 +jsonschema-specifications==2025.9.1 +keyring==25.7.0 +markdown-it-py==4.2.0 +markupsafe==3.0.4 +mcp==1.30.0 +mdurl==0.1.2 +more-itertools==11.1.0 +numpy==2.5.3 +openai==3.26.1 +openapi-pydantic==0.6.0 +openenv @ git+https://github.com/meta-pytorch/OpenEnv.git@86a180ede21e044f7929b9a7783ad83aa67d83a3 +opentelemetry-api==1.45.1 +orjson==3.13.0 +packaging==26.3 +pandas==3.0.6 +pathable==0.6.0 +pillow==12.3.0 +platformdirs==4.12.4 +py-key-value-aio==0.4.6 +pycparser==3.1 +pydantic==2.14.0 +pydantic-core==2.50.0 +pydantic-settings==2.15.0 +pydub==0.25.1 +pygments==2.21.0 +pyjwt==2.15.1 +pyperclip==1.11.0 +python-dateutil==2.9.0.post0 +python-dotenv==1.2.4 +python-multipart==0.0.32 +pytz==2026.5 +pyyaml==6.0.3 +referencing==0.37.0 +requests==2.34.2 +rich==15.0.0 +rich-rst==2.2.0 +rpds-py==2026.9.1 +safehttpx==0.1.7 +secretstorage==3.5.0 +semantic-version==2.10.0 +shellingham==1.5.4 +six==1.17.0 +sniffio==1.3.1 +sse-starlette==3.5.0 +starlette==1.7.0 +tomli==2.5.0 +tomli-w==1.2.0 +tomlkit==0.14.0 +tqdm==4.70.1 +truststore==0.10.4 +typer==0.27.3 +typing-extensions==4.16.0 +typing-inspection==0.4.4 +uncalled-for==0.4.0 +urllib3==2.8.0 +uvicorn==0.54.0 +watchfiles==1.3.0 +websockets==17.2 +socksio==1.0.0 diff --git a/components/metaharness/upstream/tasks.selected.jsonl b/components/metaharness/upstream/tasks.selected.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..b17a113ff2ff467e519f15cdaedbbcd28c083543 --- /dev/null +++ b/components/metaharness/upstream/tasks.selected.jsonl @@ -0,0 +1,160 @@ +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":24,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":34,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":264,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":7}\\n\", \"samples.json\": \"{\\\"sample_2662\\\":{\\\"raw\\\":[240,252,264,246,258],\\\"time\\\":6,\\\"weight\\\":2},\\\"sample_2886\\\":{\\\"raw\\\":[130,118,124,46,112],\\\"time\\\":10,\\\"weight\\\":4},\\\"sample_3205\\\":{\\\"raw\\\":[276,264,258,252,270],\\\"time\\\":6,\\\"weight\\\":4},\\\"sample_3614\\\":{\\\"raw\\\":[191,179,173,185,167],\\\"time\\\":11,\\\"weight\\\":4},\\\"sample_4531\\\":{\\\"raw\\\":[105,129,117,123,111],\\\"time\\\":9,\\\"weight\\\":3},\\\"sample_4607\\\":{\\\"raw\\\":[110,116,128,122,104],\\\"time\\\":2,\\\"weight\\\":4},\\\"sample_7904\\\":{\\\"raw\\\":[128,146,134,140,152],\\\"time\\\":2,\\\"weight\\\":3},\\\"sample_8653\\\":{\\\"raw\\\":[176,188,200,182,194],\\\"time\\\":8,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 0, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":9,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":129,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":19,\\\"reference\\\":5,\\\"time\\\":10}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":7}\\n\", \"samples.json\": \"{\\\"sample_1354\\\":{\\\"raw\\\":[64,67,58,55,61],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_2133\\\":{\\\"raw\\\":[97,85,91,88,94],\\\"time\\\":10,\\\"weight\\\":2},\\\"sample_2531\\\":{\\\"raw\\\":[82,85,91,88,49],\\\"time\\\":10,\\\"weight\\\":3},\\\"sample_3290\\\":{\\\"raw\\\":[141,135,132,138,144],\\\"time\\\":9,\\\"weight\\\":4},\\\"sample_4295\\\":{\\\"raw\\\":[94,100,58,97,91],\\\"time\\\":10,\\\"weight\\\":4},\\\"sample_5134\\\":{\\\"raw\\\":[93,102,60,99,96],\\\"time\\\":9,\\\"weight\\\":4},\\\"sample_5295\\\":{\\\"raw\\\":[58,64,61,52,55],\\\"time\\\":4,\\\"weight\\\":1},\\\"sample_5936\\\":{\\\"raw\\\":[57,66,63,60,69],\\\"time\\\":12,\\\"weight\\\":1}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 1, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":26,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":146,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":36,\\\"reference\\\":5,\\\"time\\\":10}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":9}\\n\", \"samples.json\": \"{\\\"sample_1132\\\":{\\\"raw\\\":[80,86,77,74,83],\\\"time\\\":9,\\\"weight\\\":2},\\\"sample_2021\\\":{\\\"raw\\\":[76,73,34,82,79],\\\"time\\\":5,\\\"weight\\\":2},\\\"sample_3043\\\":{\\\"raw\\\":[78,84,75,72,81],\\\"time\\\":10,\\\"weight\\\":2},\\\"sample_4341\\\":{\\\"raw\\\":[162,165,171,159,168],\\\"time\\\":1,\\\"weight\\\":2},\\\"sample_5100\\\":{\\\"raw\\\":[153,162,156,159,150],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_7055\\\":{\\\"raw\\\":[83,77,74,71,80],\\\"time\\\":3,\\\"weight\\\":4},\\\"sample_9474\\\":{\\\"raw\\\":[87,75,84,81,78],\\\"time\\\":4,\\\"weight\\\":2},\\\"sample_9769\\\":{\\\"raw\\\":[157,151,160,154,148],\\\"time\\\":11,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 2, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":96,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":-4,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":16,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":6}\\n\", \"samples.json\": \"{\\\"sample_4981\\\":{\\\"raw\\\":[88,92,94,86,90],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_5364\\\":{\\\"raw\\\":[38,34,32,12,36],\\\"time\\\":10,\\\"weight\\\":1},\\\"sample_5723\\\":{\\\"raw\\\":[50,44,46,52,48],\\\"time\\\":5,\\\"weight\\\":2},\\\"sample_5905\\\":{\\\"raw\\\":[32,28,34,30,36],\\\"time\\\":12,\\\"weight\\\":2},\\\"sample_6033\\\":{\\\"raw\\\":[46,38,40,42,44],\\\"time\\\":8,\\\"weight\\\":3},\\\"sample_6870\\\":{\\\"raw\\\":[50,46,24,44,48],\\\"time\\\":4,\\\"weight\\\":2},\\\"sample_7043\\\":{\\\"raw\\\":[48,40,42,46,44],\\\"time\\\":4,\\\"weight\\\":4},\\\"sample_7854\\\":{\\\"raw\\\":[48,56,54,50,52],\\\"time\\\":1,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 3, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":58,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":48,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":328,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_3043\\\":{\\\"raw\\\":[352,338,359,366,345],\\\"time\\\":3,\\\"weight\\\":1},\\\"sample_3287\\\":{\\\"raw\\\":[140,161,147,154,133],\\\"time\\\":1,\\\"weight\\\":2},\\\"sample_3341\\\":{\\\"raw\\\":[213,227,220,206,199],\\\"time\\\":4,\\\"weight\\\":1},\\\"sample_4392\\\":{\\\"raw\\\":[188,202,209,216,195],\\\"time\\\":7,\\\"weight\\\":2},\\\"sample_4579\\\":{\\\"raw\\\":[189,196,210,203,217],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_5670\\\":{\\\"raw\\\":[184,163,177,156,170],\\\"time\\\":3,\\\"weight\\\":1},\\\"sample_6245\\\":{\\\"raw\\\":[177,170,149,163,156],\\\"time\\\":10,\\\"weight\\\":1},\\\"sample_8045\\\":{\\\"raw\\\":[164,157,136,150,143],\\\"time\\\":4,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 4, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":40,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":130,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":10,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_2547\\\":{\\\"raw\\\":[106,109,100,97,103],\\\"time\\\":10,\\\"weight\\\":3},\\\"sample_4102\\\":{\\\"raw\\\":[91,85,82,88,94],\\\"time\\\":7,\\\"weight\\\":4},\\\"sample_4927\\\":{\\\"raw\\\":[76,85,88,79,82],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_5906\\\":{\\\"raw\\\":[160,148,154,151,157],\\\"time\\\":3,\\\"weight\\\":2},\\\"sample_6625\\\":{\\\"raw\\\":[88,91,94,85,97],\\\"time\\\":7,\\\"weight\\\":2},\\\"sample_7437\\\":{\\\"raw\\\":[88,82,79,85,91],\\\"time\\\":3,\\\"weight\\\":3},\\\"sample_9166\\\":{\\\"raw\\\":[85,91,82,88,79],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_9898\\\":{\\\"raw\\\":[79,91,88,85,82],\\\"time\\\":1,\\\"weight\\\":1}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 5, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":25,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":315,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":35,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_1051\\\":{\\\"raw\\\":[37,121,142,135,128],\\\"time\\\":5,\\\"weight\\\":2},\\\"sample_2387\\\":{\\\"raw\\\":[184,93,198,191,177],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_3504\\\":{\\\"raw\\\":[172,179,165,186,193],\\\"time\\\":3,\\\"weight\\\":1},\\\"sample_4595\\\":{\\\"raw\\\":[288,302,295,316,309],\\\"time\\\":6,\\\"weight\\\":3},\\\"sample_5939\\\":{\\\"raw\\\":[146,139,153,167,160],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_7658\\\":{\\\"raw\\\":[148,134,141,155,162],\\\"time\\\":6,\\\"weight\\\":2},\\\"sample_9019\\\":{\\\"raw\\\":[126,133,147,154,140],\\\"time\\\":7,\\\"weight\\\":2},\\\"sample_9467\\\":{\\\"raw\\\":[293,286,272,300,279],\\\"time\\\":8,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 6, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":280,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":60,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":40,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":7}\\n\", \"samples.json\": \"{\\\"sample_1901\\\":{\\\"raw\\\":[156,180,174,168,162],\\\"time\\\":10,\\\"weight\\\":3},\\\"sample_2049\\\":{\\\"raw\\\":[160,148,82,154,166],\\\"time\\\":12,\\\"weight\\\":2},\\\"sample_4255\\\":{\\\"raw\\\":[336,318,324,342,330],\\\"time\\\":7,\\\"weight\\\":1},\\\"sample_5178\\\":{\\\"raw\\\":[192,204,198,210,186],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_6517\\\":{\\\"raw\\\":[148,142,154,136,130],\\\"time\\\":3,\\\"weight\\\":2},\\\"sample_6603\\\":{\\\"raw\\\":[196,214,202,190,208],\\\"time\\\":9,\\\"weight\\\":2},\\\"sample_7546\\\":{\\\"raw\\\":[182,188,164,176,170],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_7764\\\":{\\\"raw\\\":[196,190,202,184,178],\\\"time\\\":12,\\\"weight\\\":4}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 7, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":184,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":-6,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":24,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":9}\\n\", \"samples.json\": \"{\\\"sample_2607\\\":{\\\"raw\\\":[90,86,94,82,98],\\\"time\\\":10,\\\"weight\\\":1},\\\"sample_3726\\\":{\\\"raw\\\":[59,55,71,63,67],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_3841\\\":{\\\"raw\\\":[95,83,91,99,87],\\\"time\\\":3,\\\"weight\\\":4},\\\"sample_4945\\\":{\\\"raw\\\":[-4,56,60,52,48],\\\"time\\\":12,\\\"weight\\\":1},\\\"sample_5191\\\":{\\\"raw\\\":[125,121,133,129,117],\\\"time\\\":1,\\\"weight\\\":4},\\\"sample_6392\\\":{\\\"raw\\\":[90,34,98,94,86],\\\"time\\\":2,\\\"weight\\\":2},\\\"sample_8580\\\":{\\\"raw\\\":[100,116,112,104,108],\\\"time\\\":4,\\\"weight\\\":2},\\\"sample_9269\\\":{\\\"raw\\\":[178,182,174,186,190],\\\"time\\\":2,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 8, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":269,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":29,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":19,\\\"reference\\\":5,\\\"time\\\":10}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":6}\\n\", \"samples.json\": \"{\\\"sample_1886\\\":{\\\"raw\\\":[228,246,234,252,240],\\\"time\\\":5,\\\"weight\\\":1},\\\"sample_2997\\\":{\\\"raw\\\":[142,136,154,160,148],\\\"time\\\":1,\\\"weight\\\":1},\\\"sample_3371\\\":{\\\"raw\\\":[130,136,142,148,154],\\\"time\\\":7,\\\"weight\\\":2},\\\"sample_3797\\\":{\\\"raw\\\":[95,119,101,113,107],\\\"time\\\":6,\\\"weight\\\":3},\\\"sample_5177\\\":{\\\"raw\\\":[149,143,125,131,137],\\\"time\\\":6,\\\"weight\\\":1},\\\"sample_7171\\\":{\\\"raw\\\":[155,149,77,137,143],\\\"time\\\":12,\\\"weight\\\":2},\\\"sample_7951\\\":{\\\"raw\\\":[119,107,125,113,47],\\\"time\\\":6,\\\"weight\\\":1},\\\"sample_8925\\\":{\\\"raw\\\":[171,177,183,195,189],\\\"time\\\":2,\\\"weight\\\":1}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 9, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":23,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":33,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":103,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_2251\\\":{\\\"raw\\\":[63,61,69,65,67],\\\"time\\\":8,\\\"weight\\\":2},\\\"sample_2365\\\":{\\\"raw\\\":[66,42,72,68,70],\\\"time\\\":5,\\\"weight\\\":1},\\\"sample_5077\\\":{\\\"raw\\\":[74,72,76,46,70],\\\"time\\\":7,\\\"weight\\\":2},\\\"sample_5233\\\":{\\\"raw\\\":[76,84,78,80,82],\\\"time\\\":7,\\\"weight\\\":2},\\\"sample_5256\\\":{\\\"raw\\\":[98,96,102,94,100],\\\"time\\\":3,\\\"weight\\\":4},\\\"sample_5335\\\":{\\\"raw\\\":[56,60,58,32,62],\\\"time\\\":7,\\\"weight\\\":4},\\\"sample_6689\\\":{\\\"raw\\\":[68,76,74,70,72],\\\"time\\\":7,\\\"weight\\\":4},\\\"sample_8931\\\":{\\\"raw\\\":[62,60,64,68,66],\\\"time\\\":11,\\\"weight\\\":4}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 10, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":225,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":15,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":25,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":6}\\n\", \"samples.json\": \"{\\\"sample_1075\\\":{\\\"raw\\\":[78,88,83,93,98],\\\"time\\\":12,\\\"weight\\\":4},\\\"sample_1151\\\":{\\\"raw\\\":[142,137,157,152,147],\\\"time\\\":3,\\\"weight\\\":3},\\\"sample_3086\\\":{\\\"raw\\\":[98,113,103,118,108],\\\"time\\\":12,\\\"weight\\\":3},\\\"sample_4410\\\":{\\\"raw\\\":[107,112,122,127,117],\\\"time\\\":8,\\\"weight\\\":4},\\\"sample_8220\\\":{\\\"raw\\\":[104,89,99,109,94],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_8767\\\":{\\\"raw\\\":[141,136,131,126,121],\\\"time\\\":4,\\\"weight\\\":2},\\\"sample_9147\\\":{\\\"raw\\\":[141,76,131,126,136],\\\"time\\\":4,\\\"weight\\\":2},\\\"sample_9151\\\":{\\\"raw\\\":[108,98,103,113,93],\\\"time\\\":2,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 11, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":-14,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":86,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":6,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_1849\\\":{\\\"raw\\\":[42,50,44,46,48],\\\"time\\\":5,\\\"weight\\\":2},\\\"sample_2273\\\":{\\\"raw\\\":[30,2,28,26,32],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_2550\\\":{\\\"raw\\\":[42,38,12,36,40],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_3367\\\":{\\\"raw\\\":[24,22,18,20,26],\\\"time\\\":11,\\\"weight\\\":3},\\\"sample_3453\\\":{\\\"raw\\\":[22,26,20,-4,24],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_6731\\\":{\\\"raw\\\":[46,38,42,44,40],\\\"time\\\":8,\\\"weight\\\":3},\\\"sample_7582\\\":{\\\"raw\\\":[42,44,46,48,40],\\\"time\\\":6,\\\"weight\\\":2},\\\"sample_8549\\\":{\\\"raw\\\":[40,38,44,46,42],\\\"time\\\":7,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 12, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":11,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":-9,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":131,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_1034\\\":{\\\"raw\\\":[100,112,109,106,103],\\\"time\\\":8,\\\"weight\\\":2},\\\"sample_1927\\\":{\\\"raw\\\":[45,9,54,48,51],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_3311\\\":{\\\"raw\\\":[87,81,90,84,45],\\\"time\\\":1,\\\"weight\\\":4},\\\"sample_3619\\\":{\\\"raw\\\":[40,46,43,49,37],\\\"time\\\":5,\\\"weight\\\":1},\\\"sample_6057\\\":{\\\"raw\\\":[45,36,0,42,39],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_6840\\\":{\\\"raw\\\":[122,119,110,116,113],\\\"time\\\":12,\\\"weight\\\":1},\\\"sample_8403\\\":{\\\"raw\\\":[49,52,61,58,55],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_9495\\\":{\\\"raw\\\":[132,135,144,141,138],\\\"time\\\":1,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 13, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":14,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":-16,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":134,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":9}\\n\", \"samples.json\": \"{\\\"sample_1881\\\":{\\\"raw\\\":[143,140,149,137,146],\\\"time\\\":1,\\\"weight\\\":4},\\\"sample_2513\\\":{\\\"raw\\\":[56,53,50,47,44],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_4091\\\":{\\\"raw\\\":[41,47,44,35,38],\\\"time\\\":12,\\\"weight\\\":4},\\\"sample_4191\\\":{\\\"raw\\\":[17,56,62,65,59],\\\"time\\\":11,\\\"weight\\\":2},\\\"sample_6154\\\":{\\\"raw\\\":[125,122,128,116,119],\\\"time\\\":6,\\\"weight\\\":2},\\\"sample_7402\\\":{\\\"raw\\\":[2,41,50,47,44],\\\"time\\\":6,\\\"weight\\\":4},\\\"sample_7919\\\":{\\\"raw\\\":[134,137,125,131,128],\\\"time\\\":3,\\\"weight\\\":4},\\\"sample_8776\\\":{\\\"raw\\\":[47,50,44,41,53],\\\"time\\\":4,\\\"weight\\\":4}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 14, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":45,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":35,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":325,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":6}\\n\", \"samples.json\": \"{\\\"sample_1686\\\":{\\\"raw\\\":[285,278,271,292,264],\\\"time\\\":12,\\\"weight\\\":4},\\\"sample_2612\\\":{\\\"raw\\\":[143,150,129,136,157],\\\"time\\\":7,\\\"weight\\\":2},\\\"sample_3041\\\":{\\\"raw\\\":[196,189,203,217,210],\\\"time\\\":10,\\\"weight\\\":3},\\\"sample_4346\\\":{\\\"raw\\\":[202,223,209,216,230],\\\"time\\\":11,\\\"weight\\\":4},\\\"sample_5480\\\":{\\\"raw\\\":[183,197,113,204,190],\\\"time\\\":2,\\\"weight\\\":4},\\\"sample_8208\\\":{\\\"raw\\\":[280,287,294,301,308],\\\"time\\\":3,\\\"weight\\\":1},\\\"sample_8372\\\":{\\\"raw\\\":[148,78,169,162,155],\\\"time\\\":2,\\\"weight\\\":2},\\\"sample_8816\\\":{\\\"raw\\\":[140,133,154,147,126],\\\"time\\\":10,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 15, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":329,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":39,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":49,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_3270\\\":{\\\"raw\\\":[181,167,174,195,188],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_3832\\\":{\\\"raw\\\":[165,186,179,172,158],\\\"time\\\":10,\\\"weight\\\":3},\\\"sample_4321\\\":{\\\"raw\\\":[294,308,280,287,301],\\\"time\\\":7,\\\"weight\\\":4},\\\"sample_5071\\\":{\\\"raw\\\":[184,156,170,177,163],\\\"time\\\":12,\\\"weight\\\":3},\\\"sample_5339\\\":{\\\"raw\\\":[160,174,167,188,181],\\\"time\\\":1,\\\"weight\\\":2},\\\"sample_5411\\\":{\\\"raw\\\":[190,197,211,183,204],\\\"time\\\":6,\\\"weight\\\":1},\\\"sample_9778\\\":{\\\"raw\\\":[178,192,199,185,206],\\\"time\\\":11,\\\"weight\\\":1},\\\"sample_9843\\\":{\\\"raw\\\":[187,180,208,201,194],\\\"time\\\":9,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 16, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":129,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":-1,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":9,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":7}\\n\", \"samples.json\": \"{\\\"sample_3102\\\":{\\\"raw\\\":[55,67,64,58,61],\\\"time\\\":5,\\\"weight\\\":3},\\\"sample_5284\\\":{\\\"raw\\\":[53,59,56,65,62],\\\"time\\\":1,\\\"weight\\\":2},\\\"sample_7369\\\":{\\\"raw\\\":[113,119,125,122,116],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_7475\\\":{\\\"raw\\\":[71,38,74,77,80],\\\"time\\\":1,\\\"weight\\\":1},\\\"sample_8551\\\":{\\\"raw\\\":[74,86,77,83,80],\\\"time\\\":1,\\\"weight\\\":1},\\\"sample_8962\\\":{\\\"raw\\\":[55,58,61,22,64],\\\"time\\\":2,\\\"weight\\\":2},\\\"sample_9075\\\":{\\\"raw\\\":[57,66,54,63,60],\\\"time\\\":12,\\\"weight\\\":3},\\\"sample_9971\\\":{\\\"raw\\\":[63,72,60,69,66],\\\"time\\\":9,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 17, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":98,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":18,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":8,\\\"reference\\\":5,\\\"time\\\":10}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_2183\\\":{\\\"raw\\\":[53,57,55,51,49],\\\"time\\\":9,\\\"weight\\\":1},\\\"sample_3338\\\":{\\\"raw\\\":[42,44,46,48,40],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_4907\\\":{\\\"raw\\\":[49,43,45,47,19],\\\"time\\\":1,\\\"weight\\\":2},\\\"sample_5590\\\":{\\\"raw\\\":[64,66,60,58,62],\\\"time\\\":4,\\\"weight\\\":1},\\\"sample_6610\\\":{\\\"raw\\\":[47,53,49,51,55],\\\"time\\\":5,\\\"weight\\\":2},\\\"sample_7198\\\":{\\\"raw\\\":[56,28,52,58,54],\\\"time\\\":4,\\\"weight\\\":3},\\\"sample_7997\\\":{\\\"raw\\\":[57,61,55,53,59],\\\"time\\\":9,\\\"weight\\\":3},\\\"sample_8141\\\":{\\\"raw\\\":[58,56,64,60,62],\\\"time\\\":10,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 18, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":17,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":307,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":27,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_1239\\\":{\\\"raw\\\":[30,121,128,114,135],\\\"time\\\":4,\\\"weight\\\":4},\\\"sample_2058\\\":{\\\"raw\\\":[179,193,165,186,172],\\\"time\\\":2,\\\"weight\\\":4},\\\"sample_2084\\\":{\\\"raw\\\":[132,125,118,104,111],\\\"time\\\":7,\\\"weight\\\":4},\\\"sample_5614\\\":{\\\"raw\\\":[132,34,118,125,139],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_6190\\\":{\\\"raw\\\":[289,310,317,303,296],\\\"time\\\":11,\\\"weight\\\":4},\\\"sample_6521\\\":{\\\"raw\\\":[131,110,26,124,117],\\\"time\\\":8,\\\"weight\\\":3},\\\"sample_7640\\\":{\\\"raw\\\":[284,312,298,305,291],\\\"time\\\":9,\\\"weight\\\":1},\\\"sample_8896\\\":{\\\"raw\\\":[199,185,206,192,101],\\\"time\\\":10,\\\"weight\\\":1}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 19, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":122,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":22,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":2,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":6}\\n\", \"samples.json\": \"{\\\"sample_2045\\\":{\\\"raw\\\":[102,90,96,93,99],\\\"time\\\":11,\\\"weight\\\":4},\\\"sample_2968\\\":{\\\"raw\\\":[73,76,67,70,79],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_4471\\\":{\\\"raw\\\":[89,83,92,86,53],\\\"time\\\":12,\\\"weight\\\":2},\\\"sample_5031\\\":{\\\"raw\\\":[127,121,124,133,130],\\\"time\\\":4,\\\"weight\\\":4},\\\"sample_6073\\\":{\\\"raw\\\":[94,88,85,91,82],\\\"time\\\":4,\\\"weight\\\":3},\\\"sample_7314\\\":{\\\"raw\\\":[88,100,91,94,97],\\\"time\\\":7,\\\"weight\\\":2},\\\"sample_8070\\\":{\\\"raw\\\":[64,67,73,34,70],\\\"time\\\":1,\\\"weight\\\":1},\\\"sample_8885\\\":{\\\"raw\\\":[60,63,72,69,66],\\\"time\\\":8,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 20, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":330,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":50,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":40,\\\"reference\\\":5,\\\"time\\\":10}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_2469\\\":{\\\"raw\\\":[215,208,201,110,194],\\\"time\\\":10,\\\"weight\\\":2},\\\"sample_2675\\\":{\\\"raw\\\":[194,201,187,103,208],\\\"time\\\":3,\\\"weight\\\":2},\\\"sample_2762\\\":{\\\"raw\\\":[162,155,176,169,71],\\\"time\\\":7,\\\"weight\\\":1},\\\"sample_5414\\\":{\\\"raw\\\":[178,185,171,80,164],\\\"time\\\":12,\\\"weight\\\":4},\\\"sample_5892\\\":{\\\"raw\\\":[119,224,210,203,217],\\\"time\\\":8,\\\"weight\\\":3},\\\"sample_6515\\\":{\\\"raw\\\":[152,145,166,159,173],\\\"time\\\":3,\\\"weight\\\":3},\\\"sample_7498\\\":{\\\"raw\\\":[224,217,126,231,210],\\\"time\\\":8,\\\"weight\\\":2},\\\"sample_9454\\\":{\\\"raw\\\":[234,206,220,227,213],\\\"time\\\":12,\\\"weight\\\":4}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 21, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":-17,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":133,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":13,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":6}\\n\", \"samples.json\": \"{\\\"sample_1475\\\":{\\\"raw\\\":[73,67,76,70,37],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_3036\\\":{\\\"raw\\\":[52,58,55,49,46],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_3853\\\":{\\\"raw\\\":[118,115,112,109,121],\\\"time\\\":12,\\\"weight\\\":3},\\\"sample_4516\\\":{\\\"raw\\\":[76,73,67,70,37],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_4951\\\":{\\\"raw\\\":[34,46,43,40,37],\\\"time\\\":11,\\\"weight\\\":3},\\\"sample_5003\\\":{\\\"raw\\\":[55,64,67,61,58],\\\"time\\\":8,\\\"weight\\\":3},\\\"sample_5026\\\":{\\\"raw\\\":[73,34,70,64,67],\\\"time\\\":7,\\\"weight\\\":1},\\\"sample_6029\\\":{\\\"raw\\\":[61,55,52,64,58],\\\"time\\\":10,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 22, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":-20,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":120,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":0,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":9}\\n\", \"samples.json\": \"{\\\"sample_2160\\\":{\\\"raw\\\":[58,49,52,55,61],\\\"time\\\":7,\\\"weight\\\":4},\\\"sample_4329\\\":{\\\"raw\\\":[124,118,115,112,121],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_4406\\\":{\\\"raw\\\":[59,53,62,14,56],\\\"time\\\":8,\\\"weight\\\":2},\\\"sample_4628\\\":{\\\"raw\\\":[42,48,3,45,51],\\\"time\\\":9,\\\"weight\\\":4},\\\"sample_4762\\\":{\\\"raw\\\":[63,66,75,69,72],\\\"time\\\":3,\\\"weight\\\":3},\\\"sample_5263\\\":{\\\"raw\\\":[51,54,60,48,57],\\\"time\\\":3,\\\"weight\\\":3},\\\"sample_6285\\\":{\\\"raw\\\":[107,95,98,104,101],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_7142\\\":{\\\"raw\\\":[33,39,36,45,42],\\\"time\\\":12,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 23, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":88,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":18,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":8,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":7}\\n\", \"samples.json\": \"{\\\"sample_1228\\\":{\\\"raw\\\":[53,55,51,59,57],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_1750\\\":{\\\"raw\\\":[116,114,108,110,112],\\\"time\\\":12,\\\"weight\\\":2},\\\"sample_2816\\\":{\\\"raw\\\":[49,57,51,53,55],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_3508\\\":{\\\"raw\\\":[56,54,52,58,60],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_3647\\\":{\\\"raw\\\":[43,47,49,45,41],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_4282\\\":{\\\"raw\\\":[82,90,84,86,88],\\\"time\\\":2,\\\"weight\\\":1},\\\"sample_7084\\\":{\\\"raw\\\":[60,58,54,56,62],\\\"time\\\":6,\\\"weight\\\":3},\\\"sample_7723\\\":{\\\"raw\\\":[61,59,55,63,57],\\\"time\\\":5,\\\"weight\\\":2}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 24, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":10,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":90,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":-10,\\\"reference\\\":5,\\\"time\\\":10}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":9}\\n\", \"samples.json\": \"{\\\"sample_1444\\\":{\\\"raw\\\":[28,2,34,32,30],\\\"time\\\":6,\\\"weight\\\":1},\\\"sample_1930\\\":{\\\"raw\\\":[78,72,74,80,76],\\\"time\\\":11,\\\"weight\\\":3},\\\"sample_3932\\\":{\\\"raw\\\":[24,26,28,30,32],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_5372\\\":{\\\"raw\\\":[40,42,44,12,38],\\\"time\\\":8,\\\"weight\\\":3},\\\"sample_7179\\\":{\\\"raw\\\":[18,16,14,20,-12],\\\"time\\\":12,\\\"weight\\\":1},\\\"sample_8974\\\":{\\\"raw\\\":[46,42,48,40,44],\\\"time\\\":1,\\\"weight\\\":2},\\\"sample_9880\\\":{\\\"raw\\\":[24,30,28,-2,26],\\\"time\\\":6,\\\"weight\\\":2},\\\"sample_9926\\\":{\\\"raw\\\":[40,34,36,42,38],\\\"time\\\":9,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 25, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":4,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":194,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":34,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_1591\\\":{\\\"raw\\\":[144,148,152,156,160],\\\"time\\\":6,\\\"weight\\\":4},\\\"sample_2099\\\":{\\\"raw\\\":[81,77,73,65,69],\\\"time\\\":11,\\\"weight\\\":3},\\\"sample_3707\\\":{\\\"raw\\\":[89,85,81,93,33],\\\"time\\\":3,\\\"weight\\\":1},\\\"sample_5984\\\":{\\\"raw\\\":[170,162,174,178,166],\\\"time\\\":12,\\\"weight\\\":1},\\\"sample_6003\\\":{\\\"raw\\\":[87,83,71,79,75],\\\"time\\\":5,\\\"weight\\\":3},\\\"sample_7355\\\":{\\\"raw\\\":[81,85,77,73,89],\\\"time\\\":11,\\\"weight\\\":4},\\\"sample_8971\\\":{\\\"raw\\\":[76,84,80,72,88],\\\"time\\\":10,\\\"weight\\\":2},\\\"sample_9511\\\":{\\\"raw\\\":[90,94,86,98,102],\\\"time\\\":8,\\\"weight\\\":4}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 26, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":40,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":20,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":180,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":6}\\n\", \"samples.json\": \"{\\\"sample_1773\\\":{\\\"raw\\\":[126,138,134,130,142],\\\"time\\\":9,\\\"weight\\\":3},\\\"sample_1811\\\":{\\\"raw\\\":[112,104,116,100,108],\\\"time\\\":2,\\\"weight\\\":3},\\\"sample_3218\\\":{\\\"raw\\\":[100,88,92,96,104],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_5100\\\":{\\\"raw\\\":[112,120,108,124,116],\\\"time\\\":4,\\\"weight\\\":2},\\\"sample_7140\\\":{\\\"raw\\\":[136,128,140,132,124],\\\"time\\\":4,\\\"weight\\\":4},\\\"sample_8816\\\":{\\\"raw\\\":[202,190,198,194,206],\\\"time\\\":5,\\\"weight\\\":3},\\\"sample_9048\\\":{\\\"raw\\\":[114,106,118,110,122],\\\"time\\\":11,\\\"weight\\\":3},\\\"sample_9564\\\":{\\\"raw\\\":[92,108,100,96,104],\\\"time\\\":8,\\\"weight\\\":4}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 27, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":10,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":-10,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":90,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":7}\\n\", \"samples.json\": \"{\\\"sample_2884\\\":{\\\"raw\\\":[66,70,68,64,72],\\\"time\\\":12,\\\"weight\\\":1},\\\"sample_2886\\\":{\\\"raw\\\":[48,50,22,44,46],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_5715\\\":{\\\"raw\\\":[42,36,44,40,38],\\\"time\\\":3,\\\"weight\\\":2},\\\"sample_6371\\\":{\\\"raw\\\":[32,38,36,34,40],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_8169\\\":{\\\"raw\\\":[80,74,78,76,72],\\\"time\\\":5,\\\"weight\\\":4},\\\"sample_8850\\\":{\\\"raw\\\":[84,88,80,82,86],\\\"time\\\":7,\\\"weight\\\":3},\\\"sample_9829\\\":{\\\"raw\\\":[34,30,32,26,28],\\\"time\\\":10,\\\"weight\\\":1},\\\"sample_9995\\\":{\\\"raw\\\":[42,46,38,40,44],\\\"time\\\":10,\\\"weight\\\":1}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 28, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":27,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":47,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":307,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":9}\\n\", \"samples.json\": \"{\\\"sample_1783\\\":{\\\"raw\\\":[183,176,162,169,155],\\\"time\\\":1,\\\"weight\\\":3},\\\"sample_2654\\\":{\\\"raw\\\":[312,319,305,326,333],\\\"time\\\":6,\\\"weight\\\":3},\\\"sample_4983\\\":{\\\"raw\\\":[309,323,330,316,337],\\\"time\\\":8,\\\"weight\\\":3},\\\"sample_5363\\\":{\\\"raw\\\":[164,178,185,171,192],\\\"time\\\":9,\\\"weight\\\":3},\\\"sample_6961\\\":{\\\"raw\\\":[155,169,176,148,162],\\\"time\\\":1,\\\"weight\\\":1},\\\"sample_7433\\\":{\\\"raw\\\":[142,37,128,149,135],\\\"time\\\":5,\\\"weight\\\":2},\\\"sample_8287\\\":{\\\"raw\\\":[173,187,180,201,194],\\\"time\\\":10,\\\"weight\\\":3},\\\"sample_9770\\\":{\\\"raw\\\":[178,164,157,66,171],\\\"time\\\":2,\\\"weight\\\":4}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 29, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":-4,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":216,\\\"reference\\\":45,\\\"time\\\":0},{\\\"raw\\\":16,\\\"reference\\\":5,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":7}\\n\", \"samples.json\": \"{\\\"sample_3749\\\":{\\\"raw\\\":[225,220,230,215,235],\\\"time\\\":8,\\\"weight\\\":2},\\\"sample_4117\\\":{\\\"raw\\\":[234,244,239,229,224],\\\"time\\\":6,\\\"weight\\\":4},\\\"sample_4815\\\":{\\\"raw\\\":[184,174,189,194,179],\\\"time\\\":1,\\\"weight\\\":4},\\\"sample_5715\\\":{\\\"raw\\\":[174,179,189,194,184],\\\"time\\\":11,\\\"weight\\\":4},\\\"sample_6106\\\":{\\\"raw\\\":[105,115,120,110,125],\\\"time\\\":8,\\\"weight\\\":2},\\\"sample_7149\\\":{\\\"raw\\\":[89,109,104,94,99],\\\"time\\\":6,\\\"weight\\\":3},\\\"sample_9615\\\":{\\\"raw\\\":[118,123,103,113,108],\\\"time\\\":9,\\\"weight\\\":1},\\\"sample_9956\\\":{\\\"raw\\\":[113,118,133,123,128],\\\"time\\\":4,\\\"weight\\\":3}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 30, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "natural science", "files_json": "{\"calibration.json\": \"[{\\\"raw\\\":50,\\\"reference\\\":5,\\\"time\\\":10},{\\\"raw\\\":30,\\\"reference\\\":5,\\\"time\\\":0},{\\\"raw\\\":230,\\\"reference\\\":45,\\\"time\\\":0}]\\n\", \"policy.json\": \"{\\\"acceptable_median\\\":[15,35],\\\"max_replicate_span\\\":8}\\n\", \"samples.json\": \"{\\\"sample_1204\\\":{\\\"raw\\\":[226,231,216,221,211],\\\"time\\\":8,\\\"weight\\\":1},\\\"sample_3213\\\":{\\\"raw\\\":[131,121,61,126,136],\\\"time\\\":8,\\\"weight\\\":2},\\\"sample_3446\\\":{\\\"raw\\\":[113,123,53,128,118],\\\"time\\\":4,\\\"weight\\\":1},\\\"sample_7029\\\":{\\\"raw\\\":[176,166,156,171,161],\\\"time\\\":8,\\\"weight\\\":2},\\\"sample_8039\\\":{\\\"raw\\\":[258,253,268,263,273],\\\"time\\\":4,\\\"weight\\\":3},\\\"sample_8534\\\":{\\\"raw\\\":[137,127,132,62,122],\\\"time\\\":1,\\\"weight\\\":1},\\\"sample_8604\\\":{\\\"raw\\\":[107,172,182,167,177],\\\"time\\\":6,\\\"weight\\\":1},\\\"sample_9183\\\":{\\\"raw\\\":[141,131,136,151,146],\\\"time\\\":8,\\\"weight\\\":1}}\\n\"}", "origin": "generated", "prompt": "Audit a sensor with linear time drift. calibration.json gives standards satisfying raw=gain*reference+offset+drift*time. Infer all three integer parameters from the standards regardless of their file order. Correct each sample's raw replicates at its recorded time. Quarantine samples whose corrected replicate span exceeds max_replicate_span or whose median is outside the inclusive acceptable_median interval in policy.json. Compute the WEIGHTED mean of accepted sample medians using each sample's weight, as a reduced fraction with positive denominator. {\"calibration\":{\"gain\":integer,\"offset\":integer,\"drift\":integer},\"medians\":{sample ID:integer},\"quarantine\":[sample IDs],\"accepted_mean\":{\"numerator\":integer,\"denominator\":integer}}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 31, "task_id": "science_calibration"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0256584\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_7006\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_2813\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0212979\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8331\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1301\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9577\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8348\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0236559\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3881\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0265473\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3512\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0267597\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5651\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0294844\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5347\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0226976\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_4838\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0260368\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_7564\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 0, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0200469\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8183\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4518\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0221562\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3895\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0259809\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7959\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0248510\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3218\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0288744\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2090\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2197\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0286801\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8090\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0204592\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5282\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0298732\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3224\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9539\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1941\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 1, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0265334\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2449\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0240802\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8642\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0288075\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3202\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2955\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_9462\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0200994\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4855\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_3409\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5306\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0288802\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4302\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0249408\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6256\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0220706\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4069\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0273422\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1240\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 2, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1947\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5836\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0284300\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6829\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1709\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0293016\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5006\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1598\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0216340\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5331\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0263340\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6465\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0221480\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5623\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0270012\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1536\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0268032\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_5594\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0257474\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2807\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"research\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 3, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8265\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0238154\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6851\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0289540\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_7229\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0268623\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5804\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0278064\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6928\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0274732\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3508\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_3782\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_7983\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0254100\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1901\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7397\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0228016\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2904\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0299661\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9263\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 4, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0200253\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6775\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_4202\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0238742\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_4757\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0262040\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9857\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4006\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0296787\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8504\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0269269\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2752\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0207885\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1624\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0207022\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4054\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0247401\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5912\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7428\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_2944\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 5, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0260411\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5613\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0240897\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9629\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0238894\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9859\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0253722\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3332\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0246425\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5862\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3466\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_8060\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0229536\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_5233\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3351\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0254921\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3179\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3546\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0285554\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5502\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 6, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0291920\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6199\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0247435\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6414\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0213011\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4437\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5682\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_4733\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2001\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0294636\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9967\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0236711\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1169\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0235080\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9461\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0273573\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_4749\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_4323\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0282230\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2274\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"research\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 7, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6826\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0222430\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1137\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0295984\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_8515\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1529\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1961\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8213\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0263443\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9581\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0210974\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8476\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0258232\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1586\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0265542\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4320\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0258697\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2636\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0205554\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4069\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 8, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0271177\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3385\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1697\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0210930\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8050\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0258097\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6259\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0278230\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9826\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0218378\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1631\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0207636\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4022\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1807\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0225371\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2303\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0278702\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6391\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7322\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5322\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 9, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6976\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0214069\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8213\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0241468\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2333\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5946\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0206408\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_8497\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0218770\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8204\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6442\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0235164\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4163\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0278459\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2888\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8765\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0244260\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5771\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0211304\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4174\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"research\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 10, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0226260\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5200\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0290719\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1509\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0205495\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2450\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0285623\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5201\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5959\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0211683\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6513\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2027\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0202365\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2447\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5486\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_5219\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0229238\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5468\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0286558\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1460\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 11, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0222825\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6232\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0208504\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8517\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3903\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0276302\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7548\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0285447\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6257\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0268874\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9092\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0219836\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9865\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9886\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0201661\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6558\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9006\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6582\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0286453\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5089\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 12, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0267552\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8736\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_2733\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0205894\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7628\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0242333\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_2570\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0201416\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_4138\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0255485\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_9587\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0287199\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_4246\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6548\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9090\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0293475\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1641\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9147\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0290678\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9251\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 13, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5122\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5803\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0244616\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8808\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0219374\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9491\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0221727\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2807\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1007\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0208564\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2340\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0294204\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5327\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0218872\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_9546\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0234140\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6017\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0231098\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6765\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_2346\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"research\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 14, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0270879\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4012\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4853\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0242942\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_7386\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8835\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0252563\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6147\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0258766\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5502\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0294471\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7861\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0221246\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8736\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0231744\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1804\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0247777\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3691\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6046\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4134\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 15, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0236923\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3312\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4593\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0268565\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2942\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0202899\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6861\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0238528\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3334\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2568\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6438\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9298\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0243198\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5238\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0296700\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1777\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0201849\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8805\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0208724\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5280\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 16, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0233168\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2796\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0235599\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5697\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1616\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0266014\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2776\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1780\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0263611\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6101\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_2187\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0260045\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_5183\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0245593\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4216\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0280396\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2594\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9973\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0236932\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9939\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 17, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0248193\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_7622\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_8202\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9988\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0235421\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9073\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0248046\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_5479\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0272126\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2150\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_7921\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0231203\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5028\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_2038\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0282661\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3105\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0216270\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_5833\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0228329\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5554\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 18, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0257985\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6299\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2964\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0264387\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_4662\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0219486\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9699\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2521\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0287552\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9111\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6395\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0254108\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6973\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0297283\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_7503\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0283993\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9198\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8736\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0267712\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2040\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"research\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 19, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0229158\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6932\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_4287\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0207208\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9618\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8832\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0252821\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4691\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0261283\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5467\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0216964\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9332\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0260902\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1482\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0282619\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9664\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6490\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0239541\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1121\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5899\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 20, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9083\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0274449\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5677\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6563\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0295010\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5266\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0241124\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1415\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0297077\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5094\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0229213\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1678\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3708\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6269\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0222285\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2817\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0213428\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_8202\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0291951\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6947\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 21, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0220233\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6173\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0285203\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3134\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9943\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2401\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_9757\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0293660\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3736\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5109\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0261174\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4504\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0260382\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3854\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0218256\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8487\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0288993\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_8300\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0289665\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5588\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 22, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_9260\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0222456\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5073\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0211878\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1607\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0285369\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1642\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0287017\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5030\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0230743\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6914\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0257838\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5601\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5675\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0248048\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1290\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4643\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0202302\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6821\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_7448\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"research\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 23, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_8763\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0242500\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6161\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5921\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1740\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9153\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0222453\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5540\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0222853\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_5332\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0237941\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1236\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0227685\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6167\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0274613\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9739\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0209070\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_6962\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0260566\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1287\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 24, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0284061\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_7489\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0232251\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5947\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4338\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7909\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0269461\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2101\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0206741\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8977\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0209506\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_2471\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0292209\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2299\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_8596\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5104\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0209678\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_7081\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0299739\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4833\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 25, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0206457\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3577\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0217143\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4874\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0283862\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1100\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4555\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9174\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0289053\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9171\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_7246\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0283925\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_7833\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8913\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0293481\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_4495\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0267818\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9132\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0201729\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8922\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 26, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0212781\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1602\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0279938\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4373\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0246659\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_1245\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_2856\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0285277\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2668\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1864\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0216348\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8566\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0226825\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_4046\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0237648\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_9570\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0243356\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_5645\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1255\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_7159\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"research\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 27, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_1003\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0249681\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_4626\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0225272\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_3340\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0226851\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5000\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_9657\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0275977\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2806\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_7491\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0274448\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_5457\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8619\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0201652\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_3593\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0264164\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6905\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0278220\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_7578\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"research\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 28, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0268703\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_1617\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0230474\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7242\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0280715\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_3251\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0251898\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4487\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_8416\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0278693\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4192\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0219122\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5680\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_5530\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0286488\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_9788\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_3553\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_3343\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0267079\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2805\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"sales\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 29, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0230484\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_3123\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0236256\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4887\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3111\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_6888\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0269565\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8585\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0280141\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_9985\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6171\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_8168\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0231292\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_5423\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0297092\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_7623\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" PERSON3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0296423\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_1085\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0292878\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_8358\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":101}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"ops\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 30, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "office and white-collar work", "files_json": "{\"changes.json\": \"[{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0287501\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4195\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" PERSON2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0221722\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_2252\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY0@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0294423\\\",\\\"team\\\":\\\"research\\\"},\\\"id\\\":\\\"row_6859\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" UNKNOWN@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0265696\\\",\\\"team\\\":\\\"sales\\\"},\\\"id\\\":\\\"row_2158\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0279131\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4260\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY4@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0250891\\\",\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_3109\\\",\\\"source\\\":\\\"import\\\",\\\"timestamp\\\":103},{\\\"email\\\":\\\" LEGACY3@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_7336\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102},{\\\"email\\\":\\\" LEGACY1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_6423\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0229650\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_3705\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":100},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_7217\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" LEGACY2@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"team\\\":\\\"ops\\\"},\\\"id\\\":\\\"row_4858\\\",\\\"source\\\":\\\"hr\\\",\\\"timestamp\\\":101},{\\\"email\\\":\\\" PERSON1@EXAMPLE.INVALID \\\",\\\"fields\\\":{\\\"phone\\\":\\\"(555) 0291773\\\",\\\"team\\\":\\\"support\\\"},\\\"id\\\":\\\"row_3636\\\",\\\"source\\\":\\\"crm\\\",\\\"timestamp\\\":102}]\\n\", \"contacts.json\": \"[{\\\"email\\\":\\\"person0@example.invalid\\\",\\\"id\\\":\\\"person_0\\\",\\\"phone\\\":\\\"5550100000\\\",\\\"team\\\":\\\"sales\\\"},{\\\"email\\\":\\\"person1@example.invalid\\\",\\\"id\\\":\\\"person_1\\\",\\\"phone\\\":\\\"5550100001\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person2@example.invalid\\\",\\\"id\\\":\\\"person_2\\\",\\\"phone\\\":\\\"5550100002\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person3@example.invalid\\\",\\\"id\\\":\\\"person_3\\\",\\\"phone\\\":\\\"5550100003\\\",\\\"team\\\":\\\"ops\\\"},{\\\"email\\\":\\\"person4@example.invalid\\\",\\\"id\\\":\\\"person_4\\\",\\\"phone\\\":\\\"5550100004\\\",\\\"team\\\":\\\"research\\\"}]\\n\", \"policy.json\": \"{\\\"aliases\\\":{\\\"legacy0@example.invalid\\\":\\\"person0@example.invalid\\\",\\\"legacy1@example.invalid\\\":\\\"person1@example.invalid\\\",\\\"legacy2@example.invalid\\\":\\\"person2@example.invalid\\\",\\\"legacy3@example.invalid\\\":\\\"person3@example.invalid\\\",\\\"legacy4@example.invalid\\\":\\\"person4@example.invalid\\\"},\\\"source_priority\\\":{\\\"crm\\\":2,\\\"hr\\\":3,\\\"import\\\":1}}\\n\"}", "origin": "generated", "prompt": "Merge contact updates without merging different people. Read contacts.json, changes.json and policy.json. Normalize email by trimming whitespace and lowercasing; apply exactly one alias lookup, then match the master email. Unmatched rows are unresolved. For each person and each field independently, use the update with greatest timestamp, then greatest source_priority, then lexicographically greatest row ID. Preserve the master value if no matching update supplies that field. Strip every nondigit character from updated phones. Return {\"contacts\":{person ID:{\"phone\":string,\"team\":string}},\"unresolved\":[row IDs]}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 31, "task_id": "office_reconciliation"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N04\\\"],\\\"max_exposure\\\":8,\\\"node_windows\\\":{\\\"N02\\\":[7,12],\\\"N07\\\":[32,36],\\\"N08\\\":[33,39]},\\\"required_before\\\":{\\\"N03\\\":[\\\"N02\\\"],\\\"N06\\\":[\\\"N01\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N06\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 0, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":10,\\\"node_windows\\\":{\\\"N03\\\":[8,11],\\\"N04\\\":[13,21],\\\"N07\\\":[27,28]},\\\"required_before\\\":{\\\"N05\\\":[\\\"N03\\\"],\\\"N08\\\":[\\\"N01\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N04\\\",\\\"N06\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 1, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N06\\\"],\\\"max_exposure\\\":10,\\\"node_windows\\\":{\\\"N07\\\":[30,33],\\\"N08\\\":[32,35],\\\"N09\\\":[32,36]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N02\\\"],\\\"N07\\\":[\\\"N01\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N02\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 2, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":7,\\\"node_windows\\\":{\\\"N05\\\":[9,11],\\\"N06\\\":[9,14],\\\"N07\\\":[15,18]},\\\"required_before\\\":{\\\"N07\\\":[\\\"N04\\\"],\\\"N09\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N03\\\",\\\"N07\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 3, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N04\\\"],\\\"max_exposure\\\":6,\\\"node_windows\\\":{\\\"N02\\\":[4,13],\\\"N05\\\":[14,18],\\\"N08\\\":[27,34]},\\\"required_before\\\":{\\\"N05\\\":[\\\"N03\\\"],\\\"N07\\\":[\\\"N05\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N02\\\",\\\"N07\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 4, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N06\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N04\\\"],\\\"max_exposure\\\":10,\\\"node_windows\\\":{\\\"N03\\\":[8,8],\\\"N05\\\":[7,12],\\\"N07\\\":[17,20]},\\\"required_before\\\":{\\\"N06\\\":[\\\"N05\\\"],\\\"N09\\\":[\\\"N01\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N03\\\",\\\"N06\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 5, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N04\\\"],\\\"max_exposure\\\":10,\\\"node_windows\\\":{\\\"N02\\\":[6,14],\\\"N05\\\":[14,17],\\\"N07\\\":[19,21]},\\\"required_before\\\":{\\\"N03\\\":[\\\"N01\\\"],\\\"N09\\\":[\\\"N08\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N03\\\",\\\"N06\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 6, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N06\\\"],\\\"max_exposure\\\":8,\\\"node_windows\\\":{\\\"N03\\\":[12,12],\\\"N05\\\":[14,19],\\\"N07\\\":[18,20]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N01\\\"],\\\"N05\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N03\\\",\\\"N05\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 7, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N03\\\"],\\\"max_exposure\\\":8,\\\"node_windows\\\":{\\\"N02\\\":[4,9],\\\"N04\\\":[15,16],\\\"N08\\\":[36,42]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N01\\\"],\\\"N06\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N05\\\",\\\"N06\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 8, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":12,\\\"node_windows\\\":{\\\"N04\\\":[7,8],\\\"N07\\\":[15,20],\\\"N08\\\":[23,25]},\\\"required_before\\\":{\\\"N05\\\":[\\\"N04\\\"],\\\"N07\\\":[\\\"N01\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N04\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 9, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N06\\\"],\\\"max_exposure\\\":7,\\\"node_windows\\\":{\\\"N02\\\":[14,18],\\\"N03\\\":[18,18],\\\"N05\\\":[21,21]},\\\"required_before\\\":{\\\"N08\\\":[\\\"N02\\\"],\\\"N09\\\":[\\\"N02\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N04\\\",\\\"N07\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 10, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":11,\\\"node_windows\\\":{\\\"N03\\\":[2,7],\\\"N05\\\":[16,18],\\\"N07\\\":[21,26]},\\\"required_before\\\":{\\\"N05\\\":[\\\"N04\\\"],\\\"N07\\\":[\\\"N05\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N05\\\",\\\"N07\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 11, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N03\\\"],\\\"max_exposure\\\":7,\\\"node_windows\\\":{\\\"N04\\\":[14,21],\\\"N05\\\":[20,25],\\\"N08\\\":[34,37]},\\\"required_before\\\":{\\\"N07\\\":[\\\"N01\\\"],\\\"N08\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N07\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 12, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N07\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N06\\\"],\\\"max_exposure\\\":9,\\\"node_windows\\\":{\\\"N02\\\":[4,8],\\\"N05\\\":[12,18],\\\"N08\\\":[21,25]},\\\"required_before\\\":{\\\"N05\\\":[\\\"N02\\\"],\\\"N08\\\":[\\\"N07\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N03\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 13, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N06\\\"],\\\"max_exposure\\\":9,\\\"node_windows\\\":{\\\"N02\\\":[11,15],\\\"N07\\\":[21,28],\\\"N08\\\":[21,28]},\\\"required_before\\\":{\\\"N07\\\":[\\\"N01\\\"],\\\"N09\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N02\\\",\\\"N08\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 14, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":10,\\\"node_windows\\\":{\\\"N03\\\":[6,13],\\\"N04\\\":[16,20],\\\"N07\\\":[26,32]},\\\"required_before\\\":{\\\"N08\\\":[\\\"N06\\\"],\\\"N09\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N07\\\",\\\"N08\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 15, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N03\\\"],\\\"max_exposure\\\":6,\\\"node_windows\\\":{\\\"N06\\\":[22,25],\\\"N08\\\":[30,33],\\\"N09\\\":[33,40]},\\\"required_before\\\":{\\\"N07\\\":[\\\"N01\\\"],\\\"N08\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N04\\\",\\\"N08\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 16, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N07\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N05\\\"],\\\"max_exposure\\\":14,\\\"node_windows\\\":{\\\"N06\\\":[15,15],\\\"N07\\\":[22,23],\\\"N08\\\":[21,30]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N03\\\"],\\\"N06\\\":[\\\"N02\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N04\\\",\\\"N07\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 17, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N07\\\"],\\\"max_exposure\\\":8,\\\"node_windows\\\":{\\\"N02\\\":[8,11],\\\"N04\\\":[18,26],\\\"N05\\\":[25,29]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N01\\\"],\\\"N09\\\":[\\\"N06\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N02\\\",\\\"N03\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 18, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":7,\\\"node_windows\\\":{\\\"N04\\\":[12,18],\\\"N06\\\":[23,28],\\\"N07\\\":[26,28]},\\\"required_before\\\":{\\\"N07\\\":[\\\"N05\\\"],\\\"N08\\\":[\\\"N06\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N04\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 19, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":10,\\\"node_windows\\\":{\\\"N04\\\":[8,16],\\\"N06\\\":[21,24],\\\"N07\\\":[21,24]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N03\\\"],\\\"N06\\\":[\\\"N05\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N04\\\",\\\"N08\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 20, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N05\\\"],\\\"max_exposure\\\":11,\\\"node_windows\\\":{\\\"N04\\\":[11,15],\\\"N06\\\":[13,18],\\\"N09\\\":[19,24]},\\\"required_before\\\":{\\\"N07\\\":[\\\"N06\\\"],\\\"N08\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N03\\\",\\\"N06\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 21, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":7,\\\"node_windows\\\":{\\\"N04\\\":[6,11],\\\"N06\\\":[14,16],\\\"N07\\\":[15,21]},\\\"required_before\\\":{\\\"N06\\\":[\\\"N01\\\"],\\\"N07\\\":[\\\"N06\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N06\\\",\\\"N08\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 22, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N06\\\"],\\\"max_exposure\\\":8,\\\"node_windows\\\":{\\\"N02\\\":[0,7],\\\"N04\\\":[7,9],\\\"N08\\\":[16,20]},\\\"required_before\\\":{\\\"N07\\\":[\\\"N01\\\"],\\\"N09\\\":[\\\"N03\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N03\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 23, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N07\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N06\\\"],\\\"max_exposure\\\":9,\\\"node_windows\\\":{\\\"N05\\\":[17,19],\\\"N07\\\":[19,22],\\\"N09\\\":[26,30]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N02\\\"],\\\"N07\\\":[\\\"N03\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N04\\\",\\\"N05\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 24, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":8,\\\"node_windows\\\":{\\\"N03\\\":[0,8],\\\"N07\\\":[13,19],\\\"N09\\\":[20,28]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N03\\\"],\\\"N09\\\":[\\\"N01\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N03\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 25, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N06\\\"],\\\"max_exposure\\\":11,\\\"node_windows\\\":{\\\"N03\\\":[4,7],\\\"N04\\\":[5,8],\\\"N08\\\":[18,21]},\\\"required_before\\\":{\\\"N04\\\":[\\\"N02\\\"],\\\"N07\\\":[\\\"N02\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N05\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 26, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N02\\\"],\\\"max_exposure\\\":16,\\\"node_windows\\\":{\\\"N05\\\":[18,19],\\\"N06\\\":[20,26],\\\"N08\\\":[24,32]},\\\"required_before\\\":{\\\"N07\\\":[\\\"N01\\\"],\\\"N09\\\":[\\\"N05\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N06\\\",\\\"N07\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 27, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":3,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":11,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N07\\\"],\\\"max_exposure\\\":10,\\\"node_windows\\\":{\\\"N05\\\":[17,25],\\\"N08\\\":[27,29],\\\"N09\\\":[27,30]},\\\"required_before\\\":{\\\"N03\\\":[\\\"N01\\\"],\\\"N04\\\":[\\\"N02\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N05\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 28, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":3,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N07\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N07\\\"],\\\"max_exposure\\\":13,\\\"node_windows\\\":{\\\"N05\\\":[20,24],\\\"N06\\\":[24,31],\\\"N08\\\":[29,32]},\\\"required_before\\\":{\\\"N06\\\":[\\\"N02\\\"],\\\"N09\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N01\\\",\\\"N06\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 29, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":5,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":7,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N09\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N03\\\"],\\\"max_exposure\\\":11,\\\"node_windows\\\":{\\\"N02\\\":[8,13],\\\"N05\\\":[14,19],\\\"N06\\\":[16,23]},\\\"required_before\\\":{\\\"N08\\\":[\\\"N07\\\"],\\\"N09\\\":[\\\"N01\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N04\\\",\\\"N08\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 30, "task_id": "math_route"} +{"difficulty": 2, "domain": "math and formal reasoning", "files_json": "{\"graph.json\": \"[{\\\"exposure\\\":0,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N01\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N02\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N03\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N06\\\",\\\"minutes\\\":6,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N07\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N08\\\",\\\"minutes\\\":1,\\\"to\\\":\\\"N09\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N00\\\",\\\"minutes\\\":12,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N01\\\",\\\"minutes\\\":4,\\\"to\\\":\\\"N08\\\"},{\\\"exposure\\\":1,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":9,\\\"to\\\":\\\"N04\\\"},{\\\"exposure\\\":2,\\\"from\\\":\\\"N02\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N06\\\"},{\\\"exposure\\\":5,\\\"from\\\":\\\"N03\\\",\\\"minutes\\\":8,\\\"to\\\":\\\"N07\\\"},{\\\"exposure\\\":0,\\\"from\\\":\\\"N04\\\",\\\"minutes\\\":10,\\\"to\\\":\\\"N05\\\"},{\\\"exposure\\\":4,\\\"from\\\":\\\"N05\\\",\\\"minutes\\\":2,\\\"to\\\":\\\"N08\\\"}]\\n\", \"policy.json\": \"{\\\"forbidden\\\":[\\\"N05\\\"],\\\"max_exposure\\\":11,\\\"node_windows\\\":{\\\"N02\\\":[8,8],\\\"N04\\\":[17,22],\\\"N07\\\":[21,29]},\\\"required_before\\\":{\\\"N08\\\":[\\\"N06\\\"],\\\"N09\\\":[\\\"N04\\\"]}}\\n\", \"request.json\": \"{\\\"goal\\\":\\\"N09\\\",\\\"required\\\":[\\\"N02\\\",\\\"N03\\\"],\\\"start\\\":\\\"N00\\\"}\\n\"}", "origin": "generated", "prompt": "Find a constrained route in a directed acyclic network. Read graph.json, request.json and policy.json. Visit every required checkpoint, avoid forbidden nodes, and keep summed exposure at or below max_exposure. Among feasible routes minimize total minutes, then total exposure, then the lexicographic node sequence. Time starts at zero. On reaching a node with [open,close] in node_windows, wait until open if early and reject arrival after close. Waiting adds minutes but no exposure. Each required_before mapping requires those nodes to have been visited BEFORE entering its key node. Edges are directed. Return {\"route\":[node IDs in travel order],\"minutes\":integer,\"exposure\":integer}. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 31, "task_id": "math_route"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4101\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1906\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4598\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6630\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1819\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3576\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4853\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3004\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9029\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3134\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9161\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5897\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4024\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 0, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2209\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4134\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3998\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5820\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7046\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4225\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8019\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8541\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9659\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5007\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4616\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2934\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2546\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 1, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8589\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1114\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3830\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6713\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2347\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3980\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1543\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2684\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6006\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7058\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3990\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9907\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9099\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 2, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3298\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4123\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1578\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2054\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9776\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7487\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4063\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6519\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9721\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4579\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9449\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4367\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4015\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 3, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2813\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1347\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7992\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7614\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6620\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4875\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2042\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9650\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8333\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6425\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4232\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9925\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3468\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 4, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4858\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1693\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6287\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1779\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5412\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3261\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6339\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1166\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4178\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2722\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6597\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3989\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5858\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 5, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1282\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3209\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2407\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7244\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3718\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9247\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3041\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7333\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7557\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9242\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4282\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4214\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8283\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 6, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7384\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9666\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2548\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6486\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5782\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7988\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5970\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8888\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3202\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4770\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6672\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9019\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2352\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 7, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7502\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7116\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2327\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9846\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9742\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7282\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7281\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7943\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9798\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2401\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8697\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1779\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9797\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 8, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6111\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9784\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7034\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6001\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3077\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5804\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1744\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1786\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2554\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5072\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8014\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9253\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5386\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 9, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6411\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5502\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4880\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2587\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7397\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1504\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3042\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7122\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1668\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3001\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8705\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5335\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1075\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 10, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6045\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9826\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8309\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1956\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2545\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8303\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5350\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2297\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3745\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9675\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4912\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8799\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7384\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 11, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4318\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1957\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6890\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2555\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9482\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1379\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9747\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9429\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6551\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5445\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7284\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3095\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7212\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 12, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2364\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8018\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9523\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6062\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2328\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5773\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6629\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9829\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6499\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2461\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4767\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2046\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4234\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 13, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8770\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6014\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6733\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7412\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2604\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8805\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7137\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1967\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4752\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8150\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4991\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7574\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4122\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 14, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6326\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7566\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2308\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8396\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1933\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1048\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2090\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6238\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9041\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2882\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8007\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8358\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4731\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 15, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8051\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9785\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4468\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3869\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1319\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6627\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4140\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3176\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8515\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8271\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2912\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2782\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7162\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 16, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2023\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9299\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1689\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7789\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1816\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2102\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2609\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8486\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9577\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5773\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7297\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8053\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4939\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 17, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5050\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1544\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6781\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8790\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6767\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5227\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5868\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9258\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6972\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6741\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9705\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5621\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3783\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 18, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9885\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9884\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1502\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8029\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3397\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4868\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7837\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2626\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8402\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3635\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2094\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8578\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6243\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 19, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1494\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9306\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3320\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4127\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2907\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2774\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7902\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9815\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5452\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6996\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2306\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5178\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2349\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 20, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8215\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4048\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3709\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4483\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5017\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4024\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6171\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4383\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7526\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8217\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9201\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5290\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8036\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 21, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1483\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9544\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1463\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4511\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4996\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6708\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7904\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4885\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4886\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2558\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4938\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1763\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1347\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 22, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4117\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7790\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2166\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4227\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6720\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1303\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5975\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9940\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7503\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9088\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9918\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7569\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4768\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 23, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3339\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2865\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7070\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7226\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8795\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3688\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4552\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8209\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5446\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9664\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6630\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3088\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1237\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 24, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6035\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1114\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4184\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3432\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5443\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9915\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9028\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7874\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3700\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3537\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3464\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7854\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9219\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 25, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9657\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6189\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8290\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5218\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4071\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5482\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7574\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2376\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8885\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9087\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4873\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8525\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8228\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 26, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1689\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6224\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5322\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8436\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6901\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6385\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4406\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1962\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9402\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8484\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9847\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5862\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7838\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 27, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1857\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3265\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3010\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2921\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1253\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9659\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8594\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5403\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1323\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6883\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6069\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9262\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5692\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 28, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9250\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1022\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8344\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9930\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5743\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1387\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6430\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5828\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":104,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5977\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7252\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9928\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4893\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8568\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 29, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_7815\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1732\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6005\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":95,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4113\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1450\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2848\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":103,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_9274\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8854\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5000\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3277\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2147\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":98,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4506\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1898\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 30, "task_id": "security_triage"} +{"difficulty": 2, "domain": "cybersecurity", "files_json": "{\"events.json\": \"[{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5638\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1873\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4833\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6612\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":102,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1713\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":99,\\\"user\\\":\\\"user_0\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_6735\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_3\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_4227\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":96,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_8923\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"external\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_5537\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"write\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2050\\\",\\\"mfa\\\":true,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":105,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"vpn\\\"},{\\\"action\\\":\\\"read\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_2887\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"secret\\\",\\\"time\\\":100,\\\"user\\\":\\\"user_1\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_3259\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"public\\\",\\\"time\\\":101,\\\"user\\\":\\\"user_2\\\",\\\"zone\\\":\\\"office\\\"},{\\\"action\\\":\\\"delete\\\",\\\"expires\\\":100,\\\"id\\\":\\\"event_1271\\\",\\\"mfa\\\":false,\\\"sensitivity\\\":\\\"internal\\\",\\\"time\\\":97,\\\"user\\\":\\\"user_4\\\",\\\"zone\\\":\\\"office\\\"}]\\n\", \"identities.json\": \"{\\\"user_0\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_1\\\":{\\\"enabled\\\":false,\\\"role\\\":\\\"operator\\\"},\\\"user_2\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"admin\\\"},\\\"user_3\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"reader\\\"},\\\"user_4\\\":{\\\"enabled\\\":true,\\\"role\\\":\\\"operator\\\"}}\\n\", \"policy.json\": \"{\\\"containment_denials\\\":2,\\\"mfa_actions\\\":[\\\"write\\\",\\\"delete\\\"],\\\"role_actions\\\":{\\\"admin\\\":[\\\"read\\\",\\\"write\\\",\\\"delete\\\"],\\\"operator\\\":[\\\"read\\\",\\\"write\\\"],\\\"reader\\\":[\\\"read\\\"]},\\\"secret_roles\\\":[\\\"admin\\\"],\\\"trusted_zones\\\":[\\\"office\\\",\\\"vpn\\\"]}\\n\"}", "origin": "generated", "prompt": "Audit synthetic authorization logs, not a live system. Read identities.json, policy.json and events.json. A request is denied if ANY rule fails. Report ALL applicable reason codes: disabled if the identity is disabled; action_forbidden if the role lacks the action; secret_role if secret data needs a role absent from secret_roles; mfa_required if a mfa_actions action OR secret data is requested without MFA; untrusted_zone if nonpublic data is accessed outside trusted_zones; expired if time>=expires. Count denied requests per user, not individual reason codes. Contain users meeting containment_denials. Return {\"allowed_ids\":[event IDs],\"denied\":{event ID:[sorted reason codes]},\"containment\":[user IDs]}. Only denied events belong in denied. Read all three files. Submit exactly the documented JSON object; all numeric results must have integer values, and ID lists must be lexicographically sorted unless an execution order or route is requested. Do not include explanations or extra keys.", "seed": 31, "task_id": "security_triage"} +{"difficulty": 2, "domain": "media and content production", "files_json": "{\"assets.json\": \"{\\\"asset_0\\\":{\\\"fps\\\":25,\\\"frames\\\":572,\\\"licensed\\\":false},\\\"asset_1\\\":{\\\"fps\\\":25,\\\"frames\\\":569,\\\"licensed\\\":true},\\\"asset_2\\\":{\\\"fps\\\":24,\\\"frames\\\":441,\\\"licensed\\\":true},\\\"asset_3\\\":{\\\"fps\\\":30,\\\"frames\\\":505,\\\"licensed\\\":true},\\\"asset_4\\\":{\\\"fps\\\":25,\\\"frames\\\":492,\\\"licensed\\\":true},\\\"asset_5\\\":{\\\"fps\\\":24,\\\"frames\\\":465,\\\"licensed\\\":true}}\\n\", \"delivery.json\": \"{\\\"delivery_budget\\\":270,\\\"fps\\\":24,\\\"max_overlap\\\":9,\\\"require_license\\\":true}\\n\", \"edits.json\": \"[{\\\"asset\\\":\\\"asset_0\\\",\\\"gap_before\\\":0,\\\"id\\\":\\\"clip_7501\\\",\\\"in\\\":12,\\\"out\\\":583,\\\"overlap\\\":14,\\\"speed_den\\\":1,\\\"speed_num\\\":1},{\\\"asset\\\":\\\"asset_0\\\",\\\"gap_before\\\":0,\\\"id\\\":\\\"clip_1142\\\",\\\"in\\\":26,\\\"out\\\":126,\\\"overlap\\\":19,\\\"speed_den\\\":1,\\\"speed_num\\\":1},{\\\"asset\\\":\\\"asset_5\\\",\\\"gap_before\\\":0,\\\"id\\\":\\\"clip_8732\\\",\\\"in\\\":9,\\\"out\\\":467,\\\"overlap\\\":9,\\\"speed_den\\\":2,\\\"speed_num\\\":1},{\\\"asset\\\":\\\"asset_2\\\",\\\"gap_before\\\":6,\\\"id\\\":\\\"clip_9204\\\",\\\"in\\\":29,\\\"out\\\":35,\\\"overlap\\\":0,\\\"speed_den\\\":1,\\\"speed_num\\\":1},{\\\"asset\\\":\\\"asset_4\\\",\\\"gap_before\\\":0,\\\"id\\\":\\\"clip_5922\\\",\\\"in\\\":20,\\\"out\\\":499,\\\"overlap\\\":8,\\\"speed_den\\\":2,\\\"speed_num\\\":3},{\\\"asset\\\":\\\"asset_0\\\",\\\"gap_before\\\":0,\\\"id\\\":\\\"clip_8039\\\",\\\"in\\\":8,\\\"out\\\":133,\\\"overlap\\\":6,\\\"speed_den\\\":2,\\\"speed_num\\\":1},{\\\"asset\\\":\\\"asset_1\\\",\\\"gap_before\\\":0,\\\"id\\\":\\\"clip_9770\\\",\\\"in\\\":8,\\\"out\\\":133,\\\"overlap\\\":14,\\\"speed_den\\\":2,\\\"speed_num\\\":1},{\\\"asset\\\":\\\"asset_0\\\",\\\"gap_before\\\":0,\\\"id\\\":\\\"clip_6696\\\",\\\"in\\\":23,\\\"out\\\":59,\\\"overlap\\\":25,\\\"speed_den\\\":2,\\\"speed_num\\\":3}]\\n\"}", "origin": "generated", "prompt": "Repair an edit list with mixed source frame rates. Read assets.json, edits.json and delivery.json. Source [in,out) intervals use the asset fps; timeline uses delivery fps. Rendered duration=(out-in)*speed_den*delivery.fps/(speed_num*asset.fps). Reject clips for ALL applicable reasons: unlicensed when a required license is absent; source_bounds unless 0<=in:. For example, A:V22 is valine 22 in chain A. When asked for a\nresidue, use exactly this format. When asked for a list, put the complete residue identifiers in a JSON\narray. Do not include additional residues.\n\nDeliver the answer as exactly one JSON object with op=\"call\",\ntool=\"submit_answer\", and an arguments object containing the required answer.\nYou may put visible working in an optional arguments.reasoning string before\narguments.answer; key order is not graded. Omit reasoning if it is unnecessary,\nand do not repeat work already completed in internal thinking.\nAfter any internal thinking, the reply must contain only the JSON object,\nwithout prose, Markdown fences, or a FINAL: line outside it.\nUse a number for a distance, an array of complete identifiers for a residue\nlist, or the specified label string for a category. Only answer is graded.\nThe first submission ends the episode. This delivery operation provides\nno computational tools or answer revisions.\n\nYou are given one molecular structure.\n\nThe structure is given below in PDB format. Only coordinate records are included; there are no header, annotation, connectivity or secondary-structure records, hydrogens have been removed, and B-factors are zero.\nThe coordinates have been rigidly rotated and translated; distances and angles are unchanged.\n\nStructure:\nATOM 1 N GLU B 482 -11.015 5.737 -3.681 1.00 0.00 N\nATOM 2 CA GLU B 482 -10.112 6.819 -3.302 1.00 0.00 C\nATOM 3 C GLU B 482 -8.676 6.522 -3.712 1.00 0.00 C\nATOM 4 O GLU B 482 -8.415 5.604 -4.492 1.00 0.00 O\nATOM 5 CB GLU B 482 -10.172 7.065 -1.794 1.00 0.00 C\nATOM 6 CG GLU B 482 -11.534 7.482 -1.277 1.00 0.00 C\nATOM 7 CD GLU B 482 -11.484 7.942 0.167 1.00 0.00 C\nATOM 8 OE1 GLU B 482 -10.473 7.657 0.848 1.00 0.00 O\nATOM 9 OE2 GLU B 482 -12.453 8.593 0.618 1.00 0.00 O\nATOM 10 N GLU B 483 -7.747 7.311 -3.181 1.00 0.00 N\nATOM 11 CA GLU B 483 -6.329 7.040 -3.361 1.00 0.00 C\nATOM 12 C GLU B 483 -5.775 6.378 -2.107 1.00 0.00 C\nATOM 13 O GLU B 483 -5.752 6.971 -1.022 1.00 0.00 O\nATOM 14 CB GLU B 483 -5.555 8.319 -3.676 1.00 0.00 C\nATOM 15 CG GLU B 483 -4.112 8.068 -4.079 1.00 0.00 C\nATOM 16 CD GLU B 483 -3.996 7.239 -5.347 1.00 0.00 C\nATOM 17 OE1 GLU B 483 -3.520 6.083 -5.264 1.00 0.00 O\nATOM 18 OE2 GLU B 483 -4.379 7.745 -6.426 1.00 0.00 O\nATOM 19 N PHE B 484 -5.343 5.135 -2.260 1.00 0.00 N\nATOM 20 CA PHE B 484 -4.799 4.376 -1.148 1.00 0.00 C\nATOM 21 C PHE B 484 -3.332 4.072 -1.363 1.00 0.00 C\nATOM 22 O PHE B 484 -2.960 3.445 -2.349 1.00 0.00 O\nATOM 23 CB PHE B 484 -5.578 3.077 -0.953 1.00 0.00 C\nATOM 24 CG PHE B 484 -7.033 3.293 -0.684 1.00 0.00 C\nATOM 25 CD1 PHE B 484 -7.456 3.741 0.561 1.00 0.00 C\nATOM 26 CD2 PHE B 484 -7.978 3.084 -1.677 1.00 0.00 C\nATOM 27 CE1 PHE B 484 -8.801 3.956 0.817 1.00 0.00 C\nATOM 28 CE2 PHE B 484 -9.328 3.300 -1.429 1.00 0.00 C\nATOM 29 CZ PHE B 484 -9.739 3.734 -0.180 1.00 0.00 C\nATOM 30 N GLU B 485 -2.505 4.527 -0.434 1.00 0.00 N\nATOM 31 CA GLU B 485 -1.085 4.249 -0.489 1.00 0.00 C\nATOM 32 C GLU B 485 -0.786 3.106 0.466 1.00 0.00 C\nATOM 33 O GLU B 485 -0.545 3.326 1.654 1.00 0.00 O\nATOM 34 CB GLU B 485 -0.269 5.489 -0.132 1.00 0.00 C\nATOM 35 CG GLU B 485 -0.581 6.703 -0.989 1.00 0.00 C\nATOM 36 CD GLU B 485 0.455 7.799 -0.845 1.00 0.00 C\nATOM 37 OE1 GLU B 485 1.548 7.515 -0.312 1.00 0.00 O\nATOM 38 OE2 GLU B 485 0.174 8.942 -1.266 1.00 0.00 O\nATOM 39 N LEU B 486 -0.819 1.882 -0.046 1.00 0.00 N\nATOM 40 CA LEU B 486 -0.627 0.725 0.817 1.00 0.00 C\nATOM 41 C LEU B 486 0.840 0.573 1.188 1.00 0.00 C\nATOM 42 O LEU B 486 1.734 0.793 0.363 1.00 0.00 O\nATOM 43 CB LEU B 486 -1.147 -0.549 0.150 1.00 0.00 C\nATOM 44 CG LEU B 486 -2.592 -0.494 -0.351 1.00 0.00 C\nATOM 45 CD1 LEU B 486 -3.034 -1.846 -0.871 1.00 0.00 C\nATOM 46 CD2 LEU B 486 -3.546 -0.009 0.757 1.00 0.00 C\nATOM 47 N LEU B 487 1.076 0.201 2.441 1.00 0.00 N\nATOM 48 CA LEU B 487 2.417 0.020 2.964 1.00 0.00 C\nATOM 49 C LEU B 487 2.593 -1.453 3.285 1.00 0.00 C\nATOM 50 O LEU B 487 2.361 -1.898 4.408 1.00 0.00 O\nATOM 51 CB LEU B 487 2.645 0.885 4.197 1.00 0.00 C\nATOM 52 CG LEU B 487 2.381 2.376 3.978 1.00 0.00 C\nATOM 53 CD1 LEU B 487 2.501 3.145 5.286 1.00 0.00 C\nATOM 54 CD2 LEU B 487 3.332 2.935 2.934 1.00 0.00 C\nATOM 55 N ILE B 488 2.974 -2.196 2.258 1.00 0.00 N\nATOM 56 CA ILE B 488 3.053 -3.641 2.303 1.00 0.00 C\nATOM 57 C ILE B 488 4.380 -4.028 1.683 1.00 0.00 C\nATOM 58 O ILE B 488 4.646 -3.679 0.536 1.00 0.00 O\nATOM 59 CB ILE B 488 1.889 -4.293 1.531 1.00 0.00 C\nATOM 60 CG1 ILE B 488 0.551 -3.936 2.190 1.00 0.00 C\nATOM 61 CG2 ILE B 488 2.072 -5.804 1.441 1.00 0.00 C\nATOM 62 CD1 ILE B 488 -0.653 -4.277 1.325 1.00 0.00 C\nATOM 63 N SEP B 489 5.227 -4.719 2.434 1.00 0.00 N\nATOM 64 CA SEP B 489 6.527 -5.113 1.887 1.00 0.00 C\nATOM 65 CB SEP B 489 7.503 -5.398 3.017 1.00 0.00 C\nATOM 66 OG SEP B 489 6.940 -6.405 3.816 1.00 0.00 O\nATOM 67 C SEP B 489 6.415 -6.360 1.009 1.00 0.00 C\nATOM 68 O SEP B 489 5.361 -6.991 0.942 1.00 0.00 O\nATOM 69 P SEP B 489 8.038 -7.289 4.557 1.00 0.00 P\nATOM 70 O1P SEP B 489 9.234 -7.617 3.531 1.00 0.00 O\nATOM 71 O2P SEP B 489 7.337 -8.665 4.988 1.00 0.00 O\nATOM 72 O3P SEP B 489 8.643 -6.479 5.796 1.00 0.00 O\nATOM 73 N ASN B 490 7.513 -6.718 0.350 1.00 0.00 N\nATOM 74 CA ASN B 490 7.547 -7.901 -0.513 1.00 0.00 C\nATOM 75 C ASN B 490 7.997 -9.176 0.194 1.00 0.00 C\nATOM 76 O ASN B 490 8.071 -9.231 1.420 1.00 0.00 O\nATOM 77 CB ASN B 490 8.457 -7.654 -1.715 1.00 0.00 C\nATOM 78 CG ASN B 490 7.733 -6.991 -2.861 1.00 0.00 C\nATOM 79 OD1 ASN B 490 6.726 -6.311 -2.662 1.00 0.00 O\nATOM 80 ND2 ASN B 490 8.235 -7.191 -4.074 1.00 0.00 N\nATOM 81 N SER B 491 8.291 -10.201 -0.597 1.00 0.00 N\nATOM 82 CA SER B 491 8.723 -11.489 -0.068 1.00 0.00 C\nATOM 83 C SER B 491 10.244 -11.587 -0.037 1.00 0.00 C\nATOM 84 O SER B 491 10.941 -10.868 -0.755 1.00 0.00 O\nATOM 85 CB SER B 491 8.136 -12.633 -0.900 1.00 0.00 C\nATOM 86 OG SER B 491 8.574 -13.894 -0.426 1.00 0.00 O\nTER 87 SER B 491\nEND\n\nQuestion: Classify the chi1 side-chain rotamer of residue B:F484. Chi1 is the N-CA-CB-CG dihedral angle, normalised to [-180, 180) degrees. Answer g+ for 0 <= chi1 < 120, t for chi1 >= 120 or chi1 < -120, and g- for -120 <= chi1 < 0.\n\nAnswer with exactly one of the listed categories.\nDelivery example: {\"op\":\"call\",\"tool\":\"submit_answer\",\"arguments\":{\"answer\":\"g+\"}}\n", - "answer_schema": "category", - "categories": [ - "g+", - "t", - "g-" - ] -} diff --git a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py b/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py deleted file mode 100644 index 5e0495cb114e72c83fe317c202aa1b870049adc3..0000000000000000000000000000000000000000 --- a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py +++ /dev/null @@ -1,74 +0,0 @@ -"""Deterministic answer parsing and scoring.""" - -from __future__ import annotations - -from typing import Any - -from .parse import ( - AnswerFormatError, - ParsedAnswer, - canonical_atom, - canonical_pair, - canonical_residue, - extract_final, - looks_like_refusal, - parse_answer, -) -from .scorers import SCORING_VERSION, score_answer, set_scores - -__all__ = [ - "AnswerFormatError", - "ParsedAnswer", - "canonical_atom", - "canonical_pair", - "canonical_residue", - "extract_final", - "looks_like_refusal", - "parse_answer", - "score_answer", - "score_response", - "set_scores", -] - - -def score_response( - raw_response: str, - answer_schema: str, - gold_answer: dict[str, Any], - *, - parameters: dict[str, Any] | None = None, - truncated: bool = False, - provider_refusal: bool = False, -) -> dict[str, Any]: - """Parse and score one raw model response end to end. - - Returns ``{"parsed": ..., "score": ..., "format_error": ..., "refusal": ...}``. - Malformed, refused and truncated answers score zero and are reported under - their own failure category (section 12). ``provider_refusal`` covers an - explicit terminal API signal even when partial text happens to parse. - - ``format_error`` and ``refusal`` are mutually exclusive. Both score zero, but - they are opposite events: a refusal is a model saying the question cannot be - answered from what it was given, which on a context-only control is the - correct response; a format error is a model failing to say anything the - scorer can read. Counting a refusal under both made a model that declines - to guess look like one that cannot write an answer. - """ - parameters = parameters or {} - parsed = parse_answer(raw_response, answer_schema, parameters) - refusal = provider_refusal or ( - parsed.format_error and looks_like_refusal(raw_response) - ) - result = score_answer(answer_schema, gold_answer, parsed, parameters) - if truncated or provider_refusal: - result = {**result, "score": 0.0, "correct": False} - if truncated: - result["truncated"] = True - return { - "scoring_version": SCORING_VERSION, - "parsed": parsed.as_dict(), - "score": result, - "format_error": bool(parsed.format_error and not refusal), - "refusal": bool(refusal), - "truncated": bool(truncated), - } diff --git a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py b/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py deleted file mode 100644 index a75ee7d22a8cd9e97700b510cb070ddfb401b128..0000000000000000000000000000000000000000 --- a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py +++ /dev/null @@ -1,383 +0,0 @@ -"""Parsing and canonicalisation of model answers (specification section 7). - -Only the ``FINAL`` field is scored. The parser is deliberately forgiving about -harmless surface variation (whitespace, markdown emphasis, trailing full stops, -case) and deliberately strict about content: an answer that names extra items, -uses the wrong separator or omits the field scores zero and is reported as a -format error. -""" - -from __future__ import annotations - -import re -from dataclasses import dataclass, field -from typing import Any - -# Only horizontal whitespace is allowed around the marker: a class containing -# `\s` would swallow the newline of a bare ``FINAL`` line and mistake the first -# field of a multi-field answer for a single-line answer. -FINAL_PATTERN = re.compile( - r"(?im)^[^\S\n]*[*_`#>]*[^\S\n]*final\b[*_`]*[^\S\n]*(:)?[*_`]*[^\S\n]*(.*)$" -) -FIELD_PATTERN = re.compile(r"^[^\S\n]*[*_`]*([A-Za-z][A-Za-z0-9_ \-]*?)[*_`]*[^\S\n]*:[^\S\n]*(.*)$") -RESIDUE_PATTERN = re.compile(r"^([A-Za-z0-9])[:\s]+([A-Za-z])[\s]*(-?\d+)$") -ATOM_PATTERN = re.compile(r"^([A-Za-z0-9])[:\s]+([A-Za-z])[\s]*(-?\d+)[:\s]+([A-Za-z0-9']{1,4})$") -# Non-greedy component name so ``M:ZN501`` parses as ZN/501 and ``L:L2401`` as -# L/2401 -- either way the parse is deterministic and round-trips the renderer. -ENTITY_PATTERN = re.compile(r"^([A-Za-z0-9])[:\s]+([A-Za-z][A-Za-z0-9]{0,2}?)[\s]*(-?\d+)$") -NUMBER_PATTERN = re.compile(r"[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?") - -PAIR_SEPARATOR = "--" -PATH_SEPARATOR = "->" - -#: A residue left on the marker line that is only a label, e.g. the "Answer:" of -#: "### Final Answer:". Requires the trailing colon, so real one-word answers -#: such as `helix` or `yes` are never mistaken for a label. -LABEL_ONLY = re.compile(r"^[A-Za-z][A-Za-z ]*:$") - -#: Phrases that mark a response as a declared inability to answer rather than a -#: malformed one. The two are different events and are counted separately: a -#: model that says the question cannot be answered from what it was given has -#: understood the task, and one that emits an unparseable answer has not. -#: -#: The second group covers a model declining a context-only control, where "this -#: cannot be determined from the information supplied" is the epistemically -#: correct response and the benchmark should record it as such. -REFUSAL_MARKERS = ( - "i cannot", "i can't", "i am unable", "i'm unable", "cannot answer", - "as an ai", "i do not have access", "i don't have access", "unable to determine", - "insufficient information to answer", - "cannot be determined", "can't be determined", "can not be determined", - "cannot be established", "not determinable", "impossible to determine", - "no coordinates", "not enough information", "insufficient information", -) - - -class AnswerFormatError(ValueError): - """The model output did not contain a parseable FINAL answer.""" - - -@dataclass -class ParsedAnswer: - """Result of parsing one model response.""" - - raw_final: str = "" - fields: dict[str, str] = field(default_factory=dict) - value: Any = None - format_error: bool = False - error: str = "" - - def as_dict(self) -> dict[str, Any]: - return { - "raw_final": self.raw_final, - "fields": self.fields, - "value": self.value, - "format_error": self.format_error, - "error": self.error, - } - - -# --------------------------------------------------------------------------- # -# Locating the FINAL block -# --------------------------------------------------------------------------- # - -def strip_markup(text: str) -> str: - out = text.strip() - out = out.strip("`") - out = re.sub(r"\*\*(.*?)\*\*", r"\1", out) - out = re.sub(r"^[*_`\s]+|[*_`\s]+$", "", out) - out = out.rstrip(".") - return out.strip() - - -def extract_final(text: str) -> tuple[str, dict[str, str]]: - """Return ``(inline_value, fields)`` for the last FINAL block in ``text``. - - A single-line answer yields a non-empty ``inline_value``. A multi-field - answer yields ``fields`` keyed by lowercase field name. - """ - if not text: - raise AnswerFormatError("empty response") - matches = list(FINAL_PATTERN.finditer(text)) - if not matches: - raise AnswerFormatError("no FINAL field found") - match = matches[-1] - inline = strip_markup(match.group(2) or "") - lines = text[match.end():].splitlines() - - # Continuation lines for long single-line lists that wrapped. The split - # leaves an empty first element for the newline itself, so skip it. - if inline and inline.endswith(","): - continuation = list(lines) - while continuation and not continuation[0].strip(): - continuation.pop(0) - for line in continuation: - candidate = strip_markup(line) - if not candidate: - break - inline = f"{inline} {candidate}".strip() - if not inline.endswith(","): - break - - fields: dict[str, str] = {} - if not inline: - for line in lines: - if not line.strip(): - if fields: - break - continue - field_match = FIELD_PATTERN.match(line) - if not field_match: - break - key = field_match.group(1).strip().lower().replace(" ", "_") - if len(key) == 1: - break # `A:V22` is a residue identifier, not a named field - fields[key] = strip_markup(field_match.group(2)) - # A marker followed by nothing usable on its own line: take the next - # non-empty line as the value. Models routinely write "Final answer:" and - # put the value underneath, and the specification's own multi-field layout - # already places answers on the lines after the marker. This does not widen - # what counts as an answer -- text elsewhere in the response is still - # ignored, and a non-answer on that line still fails to canonicalise. - if not fields and (not inline or LABEL_ONLY.match(inline)): - for line in lines: - candidate = strip_markup(line) - if candidate: - inline = candidate - break - - if not inline and not fields: - raise AnswerFormatError("FINAL field is empty") - return inline, fields - - -def looks_like_refusal(text: str) -> bool: - lowered = (text or "").lower() - return any(marker in lowered for marker in REFUSAL_MARKERS) - - -# --------------------------------------------------------------------------- # -# Canonicalisation of individual tokens -# --------------------------------------------------------------------------- # - -def canonical_residue(token: str) -> str: - """``a: v 22`` -> ``A:V22``; raises for anything that is not a residue id. - - Chain identifiers are upper-cased. The dataset builder rejects any rendering - whose chains differ only by case, so this cannot merge distinct chains. - """ - text = strip_markup(token).replace(" ", "") - match = RESIDUE_PATTERN.match(text) - if match: - return f"{match.group(1).upper()}:{match.group(2).upper()}{int(match.group(3))}" - entity = ENTITY_PATTERN.match(text) - if entity: - return f"{entity.group(1).upper()}:{entity.group(2).upper()}{int(entity.group(3))}" - raise AnswerFormatError(f"not a residue identifier: {token!r}") - - -def canonical_atom(token: str) -> str: - text = strip_markup(token).replace(" ", "") - match = ATOM_PATTERN.match(text) - if not match: - raise AnswerFormatError(f"not an atom identifier: {token!r}") - return ( - f"{match.group(1).upper()}:{match.group(2).upper()}{int(match.group(3))}" - f":{match.group(4).upper()}" - ) - - -def canonical_pair(token: str) -> str: - """Unordered residue pair, canonicalised to sorted ``A--B`` form.""" - text = strip_markup(token) - parts = [p for p in re.split(r"--+|\s+--\s+|—|–", text) if p.strip()] - if len(parts) != 2: - raise AnswerFormatError(f"not a residue pair: {token!r}") - a, b = (canonical_residue(parts[0]), canonical_residue(parts[1])) - first, second = sorted((a, b)) - return f"{first}{PAIR_SEPARATOR}{second}" - - -def split_list(text: str) -> list[str]: - """Split a comma or semicolon separated list, tolerating ``and``/newlines.""" - cleaned = strip_markup(text) - if not cleaned or cleaned.lower() in ("none", "no residues", "empty", "n/a", "-"): - return [] - cleaned = re.sub(r"\band\b", ",", cleaned, flags=re.IGNORECASE) - parts = re.split(r"[,;\n]+", cleaned) - return [p.strip() for p in parts if p.strip()] - - -def canonical_residue_set(text: str) -> list[str]: - return sorted({canonical_residue(p) for p in split_list(text)}) - - -def canonical_pair_set(text: str) -> list[str]: - return sorted({canonical_pair(p) for p in split_list(text)}) - - -def canonical_string_set(text: str) -> list[str]: - return sorted({strip_markup(p).upper() for p in split_list(text) if strip_markup(p)}) - - -def canonical_category(text: str, allowed: list[str] | None = None) -> str: - cleaned = re.sub(r"\s+", " ", strip_markup(text)).strip().lower() - if allowed is None: - return cleaned - lookup = {a.lower(): a for a in allowed} - if cleaned in lookup: - return lookup[cleaned] - # Tolerate a model that answers with the option in a longer sentence. - for option in sorted(allowed, key=len, reverse=True): - if re.search(rf"\b{re.escape(option.lower())}\b", cleaned): - return option - raise AnswerFormatError(f"category {text!r} is not one of {allowed}") - - -def canonical_boolean(text: str) -> bool: - cleaned = strip_markup(text).lower() - if cleaned in ("yes", "y", "true", "t"): - return True - if cleaned in ("no", "n", "false", "f"): - return False - raise AnswerFormatError(f"not a boolean: {text!r}") - - -def canonical_choice(text: str, options: list[str] | None = None) -> str: - cleaned = strip_markup(text).upper() - match = re.match(r"^\(?([A-Z])\)?\b", cleaned) - if not match: - raise AnswerFormatError(f"not a multiple-choice letter: {text!r}") - letter = match.group(1) - if options and letter not in [o.upper() for o in options]: - raise AnswerFormatError(f"option {letter!r} is not among {options}") - return letter - - -def canonical_number(text: str) -> float: - cleaned = strip_markup(text).replace("Å", "").replace("angstrom", "").strip() - match = NUMBER_PATTERN.search(cleaned) - if not match: - raise AnswerFormatError(f"no number found in {text!r}") - return float(match.group(0)) - - -def canonical_integer(text: str) -> int: - value = canonical_number(text) - if abs(value - round(value)) > 1e-9: - raise AnswerFormatError(f"not an integer: {text!r}") - return int(round(value)) - - -def canonical_triple(text: str) -> list[float]: - cleaned = strip_markup(text).replace("(", " ").replace(")", " ").replace("[", " ").replace("]", " ") - numbers = NUMBER_PATTERN.findall(cleaned) - if len(numbers) != 3: - raise AnswerFormatError(f"expected three numbers, found {len(numbers)} in {text!r}") - return [float(n) for n in numbers] - - -def canonical_path(text: str) -> list[str]: - cleaned = strip_markup(text) - parts = [p for p in re.split(r"->|→", cleaned) if p.strip()] - if len(parts) < 2: - raise AnswerFormatError(f"not an ordered path: {text!r}") - return [canonical_residue(p) for p in parts] - - -# --------------------------------------------------------------------------- # -# Schema dispatch -# --------------------------------------------------------------------------- # - -def parse_answer(text: str, answer_schema: str, parameters: dict[str, Any] | None = None) -> ParsedAnswer: - """Parse a raw model response into the canonical form for ``answer_schema``.""" - parameters = parameters or {} - try: - inline, fields = extract_final(text) - except AnswerFormatError as exc: - return ParsedAnswer(format_error=True, error=str(exc)) - - parsed = ParsedAnswer(raw_final=inline or _fields_repr(fields), fields=fields) - try: - parsed.value = _dispatch(answer_schema, inline, fields, parameters) - except AnswerFormatError as exc: - parsed.format_error = True - parsed.error = str(exc) - return parsed - - -def _fields_repr(fields: dict[str, str]) -> str: - return "\n".join(f"{k}: {v}" for k, v in fields.items()) - - -def _dispatch( - schema: str, inline: str, fields: dict[str, str], parameters: dict[str, Any] -) -> Any: - if schema == "string_set": - return canonical_string_set(inline) - if schema == "integer": - return canonical_integer(inline) - if schema == "numeric_triple": - return canonical_triple(inline) - if schema == "distance": - return canonical_number(inline) - if schema == "atom": - return canonical_atom(inline) - if schema == "residue": - return canonical_residue(inline) - if schema == "residue_set": - return canonical_residue_set(inline) - if schema == "residue_pair": - return canonical_pair(inline) - if schema == "residue_pair_set": - return canonical_pair_set(inline) - if schema == "category": - return canonical_category(inline, parameters.get("categories")) - if schema == "boolean": - return canonical_boolean(inline) - if schema == "multiple_choice": - return canonical_choice(inline, parameters.get("options")) - if schema == "ordered_path": - return canonical_path(inline) - if schema == "two_interaction_sets": - return _parse_two_sets(inline, fields) - if schema == "multi_field": - return _parse_multi_field(fields, parameters) - raise AnswerFormatError(f"unknown answer schema {schema!r}") - - -def _parse_two_sets(inline: str, fields: dict[str, str]) -> dict[str, list[str]]: - source = dict(fields) - if inline and not source: - # Tolerate "gained: ...; lost: ..." on one line. - for chunk in re.split(r";|\|", inline): - m = FIELD_PATTERN.match(chunk.strip()) - if m: - source[m.group(1).strip().lower()] = m.group(2) - missing = [k for k in ("gained", "lost") if k not in source] - if missing: - raise AnswerFormatError(f"missing required field(s) {missing}") - return { - "gained": canonical_pair_set(source["gained"]), - "lost": canonical_pair_set(source["lost"]), - } - - -def _parse_multi_field(fields: dict[str, str], parameters: dict[str, Any]) -> dict[str, Any]: - spec: dict[str, str] = parameters.get("field_schemas") or {} - if not spec: - raise AnswerFormatError("multi_field answers require a field_schemas parameter") - missing = [name for name in spec if name not in fields] - if missing: - raise AnswerFormatError(f"missing required field(s) {missing}") - out: dict[str, Any] = {} - errors: list[str] = [] - for name, sub_schema in spec.items(): - try: - out[name] = _dispatch(sub_schema, fields[name], {}, parameters.get(name, {})) - except AnswerFormatError as exc: - out[name] = None - errors.append(f"{name}: {exc}") - if errors and len(errors) == len(spec): - raise AnswerFormatError("; ".join(errors)) - return out diff --git a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py b/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py deleted file mode 100644 index f541597e6f7d19ecf5993fa7ac5a9b8cea4e2554..0000000000000000000000000000000000000000 --- a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py +++ /dev/null @@ -1,173 +0,0 @@ -"""Deterministic scorers (specification section 12). - -No scorer consults a language model. Every scorer returns a dictionary with a -primary ``score`` in [0, 1] plus the secondary metrics the report needs. -""" - -from __future__ import annotations - -from fractions import Fraction -from math import isfinite -from typing import Any - -from .parse import ParsedAnswer, canonical_pair, canonical_residue - -DEFAULT_DISTANCE_TOLERANCE = 0.02 # A.4 -DEFAULT_COORDINATE_TOLERANCE = 0.001 # section 8, P03 -SCORING_VERSION = "1.1.0" - - -def numeric_error(predicted: float, expected: float) -> Fraction | float: - """Compare parsed decimal values without binary subtraction at the boundary.""" - if not isfinite(predicted): - return float("inf") - return abs(Fraction(str(predicted)) - Fraction(str(expected))) - - -def set_scores(gold: list[str], predicted: list[str]) -> dict[str, Any]: - """Set F1 (primary) and exact-set accuracy (strict secondary).""" - gold_set, pred_set = set(gold), set(predicted) - true_positive = len(gold_set & pred_set) - precision = true_positive / len(pred_set) if pred_set else (1.0 if not gold_set else 0.0) - recall = true_positive / len(gold_set) if gold_set else (1.0 if not pred_set else 0.0) - f1 = 0.0 if (precision + recall) == 0 else 2 * precision * recall / (precision + recall) - if not gold_set and not pred_set: - precision = recall = f1 = 1.0 - return { - "score": f1, - "f1": f1, - "precision": precision, - "recall": recall, - "exact_set": float(gold_set == pred_set), - "correct": bool(gold_set == pred_set), - "n_gold": len(gold_set), - "n_predicted": len(pred_set), - "missing": sorted(gold_set - pred_set), - "spurious": sorted(pred_set - gold_set), - } - - -def score_answer( - answer_schema: str, - gold: dict[str, Any], - parsed: ParsedAnswer, - parameters: dict[str, Any] | None = None, -) -> dict[str, Any]: - """Score one parsed answer against its gold label.""" - parameters = parameters or {} - if parsed.format_error or parsed.value is None: - return { - "score": 0.0, - "correct": False, - "format_error": True, - "error": parsed.error or "unparseable answer", - } - - predicted = parsed.value - if answer_schema in ("residue", "atom", "category", "multiple_choice"): - expected = gold["value"] - correct = str(predicted) == str(expected) - return {"score": float(correct), "correct": correct, "predicted": predicted, "gold": expected} - - if answer_schema == "boolean": - expected = bool(gold["value"]) - correct = bool(predicted) == expected - return {"score": float(correct), "correct": correct, "predicted": predicted, "gold": expected} - - if answer_schema == "integer": - expected = int(gold["value"]) - correct = int(predicted) == expected - return {"score": float(correct), "correct": correct, "predicted": predicted, "gold": expected} - - if answer_schema == "distance": - tolerance = float(parameters.get("tolerance", DEFAULT_DISTANCE_TOLERANCE)) - expected = float(gold["value"]) - error = numeric_error(float(predicted), expected) - correct = error <= Fraction(str(tolerance)) - return { - "score": float(correct), - "correct": correct, - "absolute_error": float(error), - "tolerance": tolerance, - "predicted": predicted, - "gold": expected, - } - - if answer_schema == "numeric_triple": - tolerance = float(parameters.get("tolerance", DEFAULT_COORDINATE_TOLERANCE)) - expected = [float(v) for v in gold["value"]] - errors = [numeric_error(float(p), e) for p, e in zip(predicted, expected)] - within = [e <= Fraction(str(tolerance)) for e in errors] - correct = all(within) - return { - "score": float(correct), - "correct": correct, - "component_errors": [float(e) for e in errors], - "components_within_tolerance": sum(within), - "tolerance": tolerance, - "predicted": predicted, - "gold": expected, - } - - if answer_schema == "residue_pair": - expected = canonical_pair(gold["value"]) - correct = predicted == expected - return {"score": float(correct), "correct": correct, "predicted": predicted, "gold": expected} - - if answer_schema in ("string_set", "residue_set", "residue_pair_set"): - expected = list(gold["value"]) - out = set_scores(expected, list(predicted)) - out.update({"predicted": sorted(predicted), "gold": sorted(expected)}) - return out - - if answer_schema == "ordered_path": - expected = [canonical_residue(v) for v in gold["value"]] - exact = list(predicted) == expected - positions = sum( - 1 for a, b in zip(predicted, expected) if a == b - ) / max(len(expected), 1) - return { - "score": float(exact), - "correct": exact, - "per_position": positions, - "predicted": list(predicted), - "gold": expected, - } - - if answer_schema == "two_interaction_sets": - gained = set_scores(list(gold.get("gained", [])), list(predicted.get("gained", []))) - lost = set_scores(list(gold.get("lost", [])), list(predicted.get("lost", []))) - mean = (gained["score"] + lost["score"]) / 2.0 - return { - "score": mean, - "correct": bool(gained["correct"] and lost["correct"]), - "gained": gained, - "lost": lost, - "exact_set": float(gained["correct"] and lost["correct"]), - } - - if answer_schema == "multi_field": - return _score_multi_field(gold, predicted, parameters) - - raise ValueError(f"no scorer for answer schema {answer_schema!r}") - - -def _score_multi_field( - gold: dict[str, Any], predicted: dict[str, Any], parameters: dict[str, Any] -) -> dict[str, Any]: - fields = gold.get("fields") or {} - per_field: dict[str, Any] = {} - for name, spec in fields.items(): - sub_schema = spec["schema"] - sub_gold = {k: v for k, v in spec.items() if k != "schema"} - value = predicted.get(name) - sub_parsed = ParsedAnswer(value=value, format_error=value is None) - per_field[name] = score_answer( - sub_schema, sub_gold, sub_parsed, parameters.get(name, {}) - ) - scores = [v["score"] for v in per_field.values()] - return { - "score": sum(scores) / len(scores) if scores else 0.0, - "correct": all(v["correct"] for v in per_field.values()) if per_field else False, - "fields": per_field, - } diff --git a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json b/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json deleted file mode 100644 index f7274de0ee8ddf65774fdc867c170efb34d81572..0000000000000000000000000000000000000000 --- a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json +++ /dev/null @@ -1 +0,0 @@ -{"answer_schema": "category", "definition_version": "v1.0.0", "gold_answer": {"value": "g-"}, "parameters": {"atom4": "CG", "categories": ["g+", "t", "g-"], "residue": "B:F484"}, "reward": "exact_correct", "scoring_version": "1.1.0", "version": "1.1.0"} \ No newline at end of file diff --git a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh b/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh deleted file mode 100644 index cdba8796c64e2d36448c41092163144f8da304eb..0000000000000000000000000000000000000000 --- a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -set -eu -python /tests/verify.py diff --git a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml b/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml deleted file mode 100644 index 07563b64a6afac2846c2f50ad59df56f79887254..0000000000000000000000000000000000000000 --- a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml +++ /dev/null @@ -1,6 +0,0 @@ -version = "1.1.0" -mode = "pdbthink-coordinate" -scoring_version = "1.1.0" -answer_path = "/app/answer.txt" -contract = "/tests/gold.json" -reward = "exact_correct" diff --git a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py b/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py deleted file mode 100644 index c8da25a86cba2b415036d0a6975a7d9dc2c8cf26..0000000000000000000000000000000000000000 --- a/components/pdbthink/private/tasks/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Run only after the model response has been saved by the host harness.""" -import json -import os -from pathlib import Path -from coordinate_scoring import score_response - -def verify(root=Path("/tests"), answer=Path("/app/answer.txt"), output=Path("/logs/verifier")): - output.mkdir(parents=True, exist_ok=True) - (output / "reward.txt").write_text("0\n") - contract = json.loads((root / "gold.json").read_text()) - raw = answer.read_text() if answer.exists() and answer.stat().st_size <= 8000000 else "" - status_path = answer.with_name("answer_status.json") - status = json.loads(status_path.read_text()) if status_path.exists() else {} - outcome = score_response(raw, contract["answer_schema"], contract["gold_answer"], - parameters=contract["parameters"], truncated=status.get("truncated", False), - provider_refusal=status.get("provider_refusal", False)) - tool_violation = bool(status.get("tool_events", [])) - reward = float(outcome["score"].get("correct", False) and not tool_violation) - details = {"reward": reward, "partial_credit": outcome["score"]["score"], - "tool_violation": tool_violation, "outcome": outcome} - (output / "details.json").write_text(json.dumps(details, indent=2)) - (output / "reward.txt").write_text(str(reward) + "\n") - return details - -if __name__ == "__main__": - verify(Path(os.environ.get("PDBTHINK_TEST_ROOT", "/tests")), - Path(os.environ.get("PDBTHINK_ANSWER", "/app/answer.txt")), - Path(os.environ.get("PDBTHINK_REWARD_DIR", "/logs/verifier"))) diff --git a/components/pdbthink/requirements.lock b/components/pdbthink/requirements.lock deleted file mode 100644 index 543936bbbe0a1b14059cdfb3aeae89aeac00fb4b..0000000000000000000000000000000000000000 --- a/components/pdbthink/requirements.lock +++ /dev/null @@ -1,112 +0,0 @@ -# Linux/amd64 CPython 3.12 wheel lock. Offline inputs: vendor/build-manifest.json. -# OpenEnv source commit: 86a180ede21e044f7929b9a7783ad83aa67d83a3. -aiofile==3.12.3 --hash=sha256:5c1bcc9e929c50834608e8cc1a4cc1d7503eb60c15a535b779fd39e2f372c017 -annotated-doc==0.0.5 --hash=sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101 -annotated-types==0.8.0 --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 -anyio==4.15.1 --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101 -attrs==26.1.0 --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 -Authlib==1.8.0 --hash=sha256:88aebbd9af6757e14e912d5dc007ae1dc1f3e27e3b2152ce7c552ee2c3b3c121 -beartype==0.22.9 --hash=sha256:d16c9bbc61ea14637596c5f6fbff2ee99cbe3573e46a716401734ef50c3060c2 -brotli==1.2.0 --hash=sha256:072e7624b1fc4d601036ab3f4f27942ef772887e876beff0301d261210bca97f -cachetools==7.2.1 --hash=sha256:63aa53dfe7473c10cccdd5a01dedf76ef2c4b73a58840d9396e7d0752cbdac3b -caio==0.12.9 --hash=sha256:bf12d4f014b2a33e642ed7905b5787656ede2fc24be21f7c086826ff0d32cec3 -certifi==2026.7.22 --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775 -cffi==2.1.1 --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf -charset-normalizer==3.5.2 --hash=sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649 -click==8.5.0 --hash=sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360 -cryptography==50.0.2 --hash=sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856 -cyclopts==5.2.0 --hash=sha256:5da2a5d65164e03008621fc4795946b88a722b881398b5dfa58afa6218342cff -dnspython==2.9.0 --hash=sha256:9a4aedb833c3c1b49214d04d44d3032ab7a9135f7c1d29a549b4ff78fd82fda9 -docstring_parser==0.18.0 --hash=sha256:b3fcbed555c47d8479be0796ef7e19c2670d428d72e96da63f3a40122860374b -email-validator==2.3.0 --hash=sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4 -exceptiongroup==1.3.1 --hash=sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598 -fastapi==0.143.0 --hash=sha256:3e9395fd35276425b61b516a31fdd7c77fe2af83e41b4da22e30696fb1304c5d -fastmcp==3.4.8 --hash=sha256:ab4e8abe6c9d50b110f367e8c29f82b90c1478ac9180be61af10354f84f0ad8c -fastmcp-slim==3.4.8 --hash=sha256:e72c6b74e90c5dcdc8f58087fbdf213636d8b5d339384a498de1c5df6fc037a7 -filelock==4.1.0 --hash=sha256:2ce9818e3e2d8f284c1a964414447ef148d42a5fd5e2a477a7118e574b293ec1 -fsspec==2026.9.0 --hash=sha256:8dd6e646e99ea382bd85f97a45e6b526a442d79423a7dc673f1e2756d05fcb5f -gradio==6.30.0 --hash=sha256:aae3aa81ec9f44e55781b498ad2ba12b117aa512e8d2bb0ef3e52af7f2ee6305 -gradio_client==2.7.2 --hash=sha256:12c9d2d940df28eb8dce58eef61f5e808265ad87bbbca53704d1330aa701e5e2 -griffelib==2.3.2 --hash=sha256:8e710afededd5607f95bf3c8ccc175ee306e7084459faf27b9f9f44ef2a7a274 -groovy==0.1.2 --hash=sha256:7f7975bab18c729a257a8b1ae9dcd70b7cafb1720481beae47719af57c35fa64 -h11==0.16.0 --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 -hf-gradio==0.4.1 --hash=sha256:76b8cb8be6abe62d74c1ad2d35b42f0629db89aa9e1a8d033cecfe7c856eeab3 -hf-xet==1.7.0 --hash=sha256:2814a6e999d13464c4d679b788cc5d784eb5a4edfc638a31f10e9a11ab531ef8 -httpcore==1.0.9 --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55 -httpcore2==2.13.1 --hash=sha256:e1e05d4f25f7d7d496bfb96748f6f4b67657b03da069b3a68c36069f3db73d0a -httpx==0.28.1 --hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad -httpx-sse==0.4.3 --hash=sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc -httpx2==2.13.1 --hash=sha256:6dff50fabc270ee5fd25d845d0b078ed20564579744d6d962850975996d2f9a4 -huggingface_hub==2.2.0 --hash=sha256:1667f145dc56dc210d60966069397df9ecfca9607a5d43db88b308c89dae56b3 -idna==3.20 --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c -iniconfig==2.3.1 --hash=sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7 -jaraco.classes==3.4.0 --hash=sha256:f662826b6bed8cace05e7ff873ce0f9283b5c924470fe664fff1c2f00f581790 -jaraco.context==6.1.2 --hash=sha256:bf8150b79a2d5d91ae48629d8b427a8f7ba0e1097dd6202a9059f29a36379535 -jaraco.functools==4.6.0 --hash=sha256:99e3dc0060c5cbe8fcd1cdb36258e2a65ca40f1566b2033b12abb1bb44dd3c30 -jeepney==0.9.0 --hash=sha256:97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683 -Jinja2==3.1.6 --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 -jiter==0.17.0 --hash=sha256:8c21265b251d99bbb40080d178a8953e35601d3a1564e05c4de4c0d2ca616797 -joserfc==1.7.5 --hash=sha256:add2c2c84e8373b084d526a8b53daba5d7a513a118cd2dcd9fc9f979d0922159 -jsonref==1.1.0 --hash=sha256:590dc7773df6c21cbf948b5dac07a72a251db28b0238ceecce0a2abfa8ec30a9 -jsonschema==4.26.0 --hash=sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce -jsonschema-path==0.5.0 --hash=sha256:2790a070bc7abb08ea3dbe4d340ece4efadf639223001f020c7503229ba068e2 -jsonschema-specifications==2025.9.1 --hash=sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe -keyring==25.7.0 --hash=sha256:be4a0b195f149690c166e850609a477c532ddbfbaed96a404d4e43f8d5e2689f -markdown-it-py==4.2.0 --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a -MarkupSafe==3.0.4 --hash=sha256:8e124f974786f831d6043728e38296969d3579db8896fe004682f5758e613581 -mcp==1.30.0 --hash=sha256:666edb5009503e1047c9d60346a756f94b261f05cc2625f23d41c728ffc484d0 -mdurl==0.1.2 --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 -more-itertools==11.1.0 --hash=sha256:4b65538ae22f6fed0ce4874efd317463a7489796a0939fa66824dd542125a192 -numpy==2.5.3 --hash=sha256:b7e18c623bb5c95acb3b3328861272816ba199fb531921c5d6d0b675f1fde9e3 -openai==3.28.0 --hash=sha256:1ea40a084ffe2f9f16fd3bea6e870f757853b536b18d8e737c518ef849a2920c -openapi-pydantic==0.6.0 --hash=sha256:8bd6d548a250da37db96f461bcd52b3468e8834ad7d6db14b00a6b2ebbd163a3 -openenv==0.6.1.dev0 --hash=sha256:93a5781b64e2f174f17fff40a558d43745a7f4e48a8b247363da4f27906be53a -opentelemetry-api==1.45.1 --hash=sha256:b31553efa588ae44bc306f863c785c5333a9ecc091248c6ee68b4b6c87fdedfb -orjson==3.13.0 --hash=sha256:bceadfd314bd238f584fc229a4bbaf0e573597e7a026dec5429fbf29fd66c641 -packaging==26.3 --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c -pandas==3.0.6 --hash=sha256:0704044b676496b8350e023b09f174a26772456c974a2b11c36bebb558c9490d -pathable==0.6.0 --hash=sha256:82c4ca6c98c502ad12e0d4e9779b6210afee93c38990988c8c5d1b49bdcdf566 -pillow==12.3.0 --hash=sha256:78cb2c6865a35ab8ff8b75fd122f6033b92a62c82801110e48ddd6c936a45d91 -platformdirs==4.12.4 --hash=sha256:78bfb9db2a8471ed7eebe3c3c932da413911042994e699b384fbb4493fa872d7 -pluggy==1.6.0 --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 -py-key-value-aio==0.4.6 --hash=sha256:820b30c7959fc738ea3d00160cdb10cd258f51e38737b2add530defeea1ded77 -pycparser==3.11 --hash=sha256:51d5a8ba2be0bbe440b99d2112604c95bbbc3c2748a64260186c541e1729cd80 -pydantic==2.14.0 --hash=sha256:15fab1bea6f1dc5003b54fc2ecab230c1fd1dbade2acd4addc52d81e32416d4b -pydantic-settings==2.15.0 --hash=sha256:0ba092c291c94baceb5eff768aa0d56400a457585bc0175925a5a5510303da42 -pydantic_core==2.50.0 --hash=sha256:f187030fc3d62c668feb0f09e92852e0eb414d7fcefc4748f2e67d245aade37e -pydub==0.25.1 --hash=sha256:65617e33033874b59d87db603aa1ed450633288aefead953b30bded59cb599a6 -Pygments==2.21.0 --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 -PyJWT==2.15.1 --hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193 -pyperclip==1.11.0 --hash=sha256:299403e9ff44581cb9ba2ffeed69c7aa96a008622ad0c46cb575ca75b5b84273 -pytest==9.1.1 --hash=sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c -python-dateutil==2.9.0.post0 --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 -python-dotenv==1.2.4 --hash=sha256:42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc -python-multipart==0.0.32 --hash=sha256:ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23 -pytz==2026.5 --hash=sha256:e658af3757f9e26a9d25dd2aff38335acd92bc9104f890a894b2c1ba28311b03 -PyYAML==6.0.3 --hash=sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc -referencing==0.37.0 --hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231 -requests==2.34.2 --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 -rich==15.0.0 --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb -rich-rst==2.2.0 --hash=sha256:1ea1c43813dc4a8d86475fce27ffb74e0ada3d4656c9f8130ba2a59868055fe9 -rpds-py==2026.9.1 --hash=sha256:addeda51556dac7c1a2f14cda62db8b621cd12afba3091d03a96c72932387eab -safehttpx==0.1.7 --hash=sha256:c4f4a162db6993464d7ca3d7cc4af0ffc6515a606dfd220b9f82c6945d869cde -SecretStorage==3.5.0 --hash=sha256:0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137 -semantic-version==2.10.0 --hash=sha256:de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177 -shellingham==1.5.4 --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 -six==1.17.0 --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 -sniffio==1.3.1 --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 -sse-starlette==3.5.0 --hash=sha256:3e6e1070df3f0f5d9cea81496de92dbb72f6721871d99748ece67441dd8b7997 -starlette==1.7.0 --hash=sha256:67f8e99895493dd2911a03f11314af6ceebeae4e704bb9f43dfc6a9db151c93e -tomli==2.5.0 --hash=sha256:6cf74416bdc94ae458b14e37286c1073081850ac8459a00d0c5efef5d44294c6 -tomli_w==1.2.0 --hash=sha256:188306098d013b691fcadc011abd66727d3c414c571bb01b1a174ba8c983cf90 -tomlkit==0.14.0 --hash=sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680 -tqdm==4.70.1 --hash=sha256:c293e525e6fef9c20e8728fd4612df02a0aa31bb5fe91ecd93e123b1b7bffa73 -truststore==0.10.4 --hash=sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981 -typer==0.27.3 --hash=sha256:e50022f28b82a86313e54501317a1db64bf8f8d036ff8cfe5ca7e47675454aff -typing-inspection==0.4.4 --hash=sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147 -typing_extensions==4.16.0 --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 -uncalled-for==0.4.1 --hash=sha256:b611b38879d9fe5088297e7bb28f2ddd12d2d73dad933d93da107fb63eb4058e -urllib3==2.8.0 --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 -uvicorn==0.54.0 --hash=sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf -watchfiles==1.3.0 --hash=sha256:b5768b49e426fd5b550b012c866db347cdf15c398ef98dc557b6e6b72fa74cd1 -websockets==17.2 --hash=sha256:6627b913b8586b1c06db9516b31dd0dfbc621de3bb9312616d92a7e44f268a5b diff --git a/components/pdbthink/runtime/common/__init__.py b/components/pdbthink/runtime/common/__init__.py deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/components/pdbthink/runtime/common/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/components/pdbthink/runtime/common/http_routes.py b/components/pdbthink/runtime/common/http_routes.py deleted file mode 100644 index a3ab94f85fc92d044895d022d16d4659be018d8b..0000000000000000000000000000000000000000 --- a/components/pdbthink/runtime/common/http_routes.py +++ /dev/null @@ -1,64 +0,0 @@ - -from threading import RLock -from contextlib import asynccontextmanager -from copy import deepcopy -from fastapi import HTTPException -from pydantic import ValidationError -from starlette.concurrency import run_in_threadpool -from openenv.core.env_server.serialization import serialize_observation -from openenv.core.env_server.types import ResetRequest,ResetResponse,StepRequest,StepResponse -from .models import ArenaAction - - -def install_persistent_http_routes(app,env,conflict_error=None): - lock=RLock() - app.router.routes=[route for route in app.router.routes if getattr(route,'path',None) not in {'/reset','/step','/state'}] - - def reset_sync(request): - with lock: - return ResetResponse(**serialize_observation(env.reset(**request.model_dump(exclude_unset=True)))) - - def step_sync(request): - with lock: - action=ArenaAction.model_validate(request.action) - return StepResponse(**serialize_observation(env.step(action,timeout_s=request.timeout_s))) - - def state_sync(): - with lock: - value=env.state - return value.model_copy(deep=True) if hasattr(value,'model_copy') else deepcopy(value) - - @app.post('/reset',response_model=ResetResponse) - async def reset(request:ResetRequest): - try:return await run_in_threadpool(reset_sync,request) - except (ValueError,IndexError) as exc:raise HTTPException(status_code=400,detail=str(exc)) from exc - except Exception as exc: - if conflict_error is not None and isinstance(exc,conflict_error): - raise HTTPException(status_code=409,detail=str(exc)) from exc - raise - - @app.post('/step',response_model=StepResponse) - async def step(request:StepRequest): - try:return await run_in_threadpool(step_sync,request) - except (ValueError,ValidationError) as exc:raise HTTPException(status_code=422,detail=str(exc)) from exc - - @app.get('/state') - async def state(): - return await run_in_threadpool(state_sync) - - def shutdown(): - with lock:env.close() - - - - - original_lifespan=app.router.lifespan_context - - @asynccontextmanager - async def lifespan(application): - async with original_lifespan(application) as state: - try:yield state - finally:await run_in_threadpool(shutdown) - - app.router.lifespan_context=lifespan - return lock diff --git a/components/pdbthink/runtime/pdbthink/__init__.py b/components/pdbthink/runtime/pdbthink/__init__.py deleted file mode 100644 index 2ae28399f5fda2dfb1b04405f4a3b4895f5fac1e..0000000000000000000000000000000000000000 --- a/components/pdbthink/runtime/pdbthink/__init__.py +++ /dev/null @@ -1 +0,0 @@ -pass diff --git a/components/pdbthink/runtime/pdbthink/adapter.py b/components/pdbthink/runtime/pdbthink/adapter.py deleted file mode 100644 index d0632167010c9b5ed7ebede328c98f973aa9753c..0000000000000000000000000000000000000000 --- a/components/pdbthink/runtime/pdbthink/adapter.py +++ /dev/null @@ -1,160 +0,0 @@ - -from functools import wraps -import hashlib -import json -import math -import os -from pathlib import Path -import subprocess -import sys -import tempfile -from threading import RLock - -import jsonschema -from common.contracts import ACTION_SCHEMA, observation_payload -from .transport import Controller - - -class CheckerInfrastructureError(RuntimeError): - pass - - -def serialized(method): - @wraps(method) - def invoke(self, *args, **kwargs): - with self._lock: - return method(self, *args, **kwargs) - return invoke - - -class PDBThinkAdapter: - def __init__(self, task_entries, runtime_parent): - self._lock = RLock() - self.registry = dict(task_entries) - if not self.registry: - raise ValueError('At least one original train task is required') - for name, entry in self.registry.items(): - if entry['task_id'] != name or entry['split'] != 'train': - raise ValueError('Only matching original train entries are permitted') - public = Path(entry['directory']) / 'public_task.json' - if hashlib.sha256(public.read_bytes()).hexdigest() != entry['public_sha256']: - raise ValueError('Delivery profile text hash mismatch') - if json.loads(public.read_text())['task_id'] != name: - raise ValueError('Public task id does not match the registry') - for relative, expected in entry['original_checker_sha256'].items(): - path = Path(entry['directory']) / 'tests' / relative - if path.is_symlink() or hashlib.sha256(path.read_bytes()).hexdigest() != expected: - raise ValueError('Original checker or private contract hash mismatch') - self.runtime_parent = Path(runtime_parent) - self.runtime_parent.mkdir(parents=True, exist_ok=True) - self.temporary = None - self.controller = None - self.task_id = None - self.reward = None - self.checker_failure = None - - @serialized - def reset(self, task_id=None): - if task_id is None and len(self.registry) == 1: - task_id = next(iter(self.registry)) - if not isinstance(task_id, str) or task_id not in self.registry: - raise ValueError('Unknown or missing original train task id') - self.close() - self.task_id = task_id - self.temporary = tempfile.TemporaryDirectory(prefix='pdbthink-', dir=self.runtime_parent) - workspace = Path(self.temporary.name) - self.controller = Controller(private=Path(self.registry[task_id]['directory']), - state=workspace / 'state', answer=workspace / 'answer.txt') - self.reward = None - self.checker_failure = None - opening = self.controller.reset() - return observation_payload(task_id, opening['instructions'], - {'available_ops': ['call', 'finish'], 'tools': opening['tools'], - 'answer_delivery': opening['answer_delivery'], 'max_submissions': 1, - 'no_computational_tools': True, 'delivery_profile': 'pdbthink-json-delivery-v3'}, - reward=0.0, done=False) - - def _score(self): - if self.reward is not None: - return self.reward - if self.checker_failure is not None: - raise CheckerInfrastructureError(self.checker_failure) - entry = self.registry[self.task_id] - tests = Path(entry['directory']) / 'tests' - output = Path(self.temporary.name) / 'verifier' - - - - env = {'PATH': os.defpath, 'PYTHONDONTWRITEBYTECODE': '1', - 'PDBTHINK_TEST_ROOT': str(tests), 'PDBTHINK_ANSWER': str(self.controller.answer), - 'PDBTHINK_REWARD_DIR': str(output)} - try: - result = subprocess.run([sys.executable, str(tests / 'verify.py')], - env=env, capture_output=True, text=True, timeout=30) - except (OSError, subprocess.TimeoutExpired) as exc: - self.checker_failure = 'Original PDBThink checker did not complete' - raise CheckerInfrastructureError(self.checker_failure) from exc - if result.returncode: - self.checker_failure = 'Original PDBThink checker exited unsuccessfully' - raise CheckerInfrastructureError(self.checker_failure) - try: - reward = float((output / 'reward.txt').read_text()) - except (OSError, ValueError) as exc: - self.checker_failure = 'Original checker reward is missing or malformed' - raise CheckerInfrastructureError(self.checker_failure) from exc - if not math.isfinite(reward) or reward not in (0.0, 1.0): - self.checker_failure = 'Original checker returned an unexpected reward' - raise CheckerInfrastructureError(self.checker_failure) - self.reward = reward - return reward - - def _terminal(self): - attempted = bool(json.loads(self.controller.metadata.read_text())['submissions']) - return observation_payload(self.task_id, 'The answer attempt is complete. The episode has ended.', - {'answer_attempted': attempted}, reward=self._score(), done=True) - - @serialized - def step(self, action): - if self.controller is None: - raise ValueError('reset is required before step') - if hasattr(action, 'action_payload'): - action = action.action_payload() - json.dumps(action, allow_nan=False) - jsonschema.validate(action, ACTION_SCHEMA) - if json.loads(self.controller.metadata.read_text())['done']: - return self._terminal() - if action['op'] == 'finish': - return self.finalize() - if action['op'] == 'call': - self.controller.call(action['tool'], action['arguments']) - else: - - - self.controller.call('forbidden_exec', {}) - return self._terminal() - - @serialized - def finalize(self): - if self.controller is None: - raise ValueError('reset is required before finish') - self.controller.finalize() - return self._terminal() - - @property - @serialized - def state(self): - if self.controller is None: - return {'task_id': None, 'initialized': False, 'done': False} - original = json.loads(self.controller.metadata.read_text()) - return {'task_id': self.task_id, 'initialized': True, 'done': original['done'], - 'submissions': original['submissions']} - - @serialized - def close(self): - if self.temporary is not None: - self.temporary.cleanup() - self.temporary = None - self.controller = None - self.task_id = None - self.reward = None - self.checker_failure = None diff --git a/components/pdbthink/runtime/pdbthink/launch_service.py b/components/pdbthink/runtime/pdbthink/launch_service.py deleted file mode 100644 index 44bdf9908242dc60b69bb0ccc503abc682f5c29c..0000000000000000000000000000000000000000 --- a/components/pdbthink/runtime/pdbthink/launch_service.py +++ /dev/null @@ -1,52 +0,0 @@ - -import argparse -import json -import os -from pathlib import Path -import subprocess -import time -import urllib.request - - -class RejectRedirects(urllib.request.HTTPRedirectHandler): - def redirect_request(self,*args,**kwargs): - raise RuntimeError('Redirects are forbidden for the local readiness probe') - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('--python',default='/usr/local/bin/python') - parser.add_argument('--config',default='/opt/pdbthink/config.json') - args=parser.parse_args() - if os.geteuid()!=0:raise PermissionError('Only the trusted supervisor may launch this service') - if args.config!='/opt/pdbthink/config.json':raise ValueError('This prototype uses its fixed image registry') - opener=urllib.request.build_opener(urllib.request.ProxyHandler({}),RejectRedirects()) - url='http://127.0.0.1:8000/metadata' - def ready(): - try: - with opener.open(url,timeout=2) as response: - return json.load(response).get('name')=='pdbthink_original' - except Exception:return False - if ready(): - print(json.dumps({'status':'already_running','base_url':'http://127.0.0.1:8000'}));return - private=Path('/opt/pdbthink/private');private.mkdir(parents=True,exist_ok=True);private.chmod(0o700) - log=private/'service.log' - env={'PATH':'/usr/local/bin:/usr/bin:/bin','HOME':'/root','LANG':'C.UTF-8','LC_ALL':'C.UTF-8', - 'PYTHONPATH':'/opt/pdbthink/runtime','PYTHONDONTWRITEBYTECODE':'1','PYTHONUNBUFFERED':'1', - 'ARENA_DEDICATED_CONTAINER':'1','ENABLE_WEB_INTERFACE':'false', - 'OPENENV_MODE':'simulation','GRADIO_ANALYTICS_ENABLED':'false','HF_HUB_OFFLINE':'1'} - with log.open('w') as stream: - process=subprocess.Popen([args.python,'-m','pdbthink.server'],env=env,stdin=subprocess.DEVNULL, - stdout=stream,stderr=subprocess.STDOUT,start_new_session=True) - (private/'service.pid').write_text(str(process.pid)+'\n') - deadline=time.monotonic()+90 - while time.monotonic() 2 else {} - if operation == 'reset': - result = controller.reset() - elif operation == 'call': - result = controller.call(request.get('name'), request.get('arguments')) - elif operation == 'finalize': - result = controller.finalize(request or None) - else: - raise ValueError('Unknown trusted controller operation') - print(json.dumps(result, ensure_ascii=False, allow_nan=False)) - - -if __name__ == '__main__': - main() diff --git a/components/pdbthink/runtime/pdbthink/wire_client.py b/components/pdbthink/runtime/pdbthink/wire_client.py deleted file mode 100644 index 7863243bee03a0a205c2e5580e2eaa68b4079e81..0000000000000000000000000000000000000000 --- a/components/pdbthink/runtime/pdbthink/wire_client.py +++ /dev/null @@ -1,123 +0,0 @@ - -import argparse -import base64 -import json -import math -import os -import sys -import urllib.error -import urllib.parse -import urllib.request - - -class WireProtocolError(RuntimeError): - pass - - -class RejectRedirects(urllib.request.HTTPRedirectHandler): - def redirect_request(self,request,fp,code,message,headers,new_url): - raise WireProtocolError('Redirects are forbidden for the local OpenEnv transport') - - -def _constant(value): - raise WireProtocolError('Non-finite JSON number: '+value) - - -def _unique(pairs): - result={} - for key,value in pairs: - if key in result:raise WireProtocolError('Duplicate JSON key') - result[key]=value - return result - - -def _finite(value): - if isinstance(value,float) and not math.isfinite(value): - raise WireProtocolError('Non-finite wire value') - if isinstance(value,dict): - for item in value.values():_finite(item) - elif isinstance(value,list): - for item in value:_finite(item) - - -def loads(raw): - value=json.loads(raw,parse_constant=_constant,object_pairs_hook=_unique) - _finite(value) - return value - - -def validate_envelope(value,*,require_done=False): - if not isinstance(value,dict) or not isinstance(value.get('observation'),dict): - raise WireProtocolError('Missing SDK observation object') - observation=value['observation'] - if (set(observation)!={'task_id','message','data','metadata'} or - not isinstance(observation['task_id'],str) or not isinstance(observation['message'],str) or - not isinstance(observation['data'],dict) or not isinstance(observation['metadata'],dict)): - raise WireProtocolError('Observation does not match the common public contract') - if type(value.get('done')) is not bool: - raise WireProtocolError('SDK done must be a JSON boolean') - reward=value.get('reward') - if reward is not None and (type(reward) not in (int,float) or not math.isfinite(reward) or not 0<=reward<=1): - raise WireProtocolError('SDK reward is not a finite number in [0,1]') - if require_done and (not value['done'] or reward is None): - raise WireProtocolError('Finish did not return a terminal numeric score') - _finite(value) - return value - - -class WireClient: - def __init__(self,base_url='http://127.0.0.1:8000',timeout=330): - if os.geteuid()!=0: - raise PermissionError('Wire client is reserved for the trusted supervisor') - url=urllib.parse.urlsplit(base_url) - if url.scheme!='http' or url.hostname not in ('127.0.0.1','localhost','::1') or url.username or url.password or url.query or url.fragment or url.path not in ('','/'): - raise ValueError('Only an unauthenticated local HTTP server is allowed') - self.base_url=base_url.rstrip('/') - self.timeout=timeout - self.opener=urllib.request.build_opener(urllib.request.ProxyHandler({}),RejectRedirects()) - - def _post(self,path,payload): - body=json.dumps(payload,ensure_ascii=False,allow_nan=False,separators=(',',':')).encode() - request=urllib.request.Request(self.base_url+path,data=body,headers={'Content-Type':'application/json'}) - try: - with self.opener.open(request,timeout=self.timeout) as response: - if response.status!=200:raise WireProtocolError('Unexpected HTTP status') - raw=response.read(2*1024*1024+1) - except urllib.error.HTTPError as exc: - raise WireProtocolError(f'OpenEnv HTTP {exc.code}: '+exc.read(2048).decode(errors='replace')) from exc - if len(raw)>2*1024*1024:raise WireProtocolError('SDK response exceeds the transport limit') - return validate_envelope(loads(raw)) - - def reset(self,**kwargs): - return self._post('/reset',kwargs) - - def step(self,action): - return self._post('/step',{'action':action}) - - def finish(self): - return validate_envelope(self.step({'op':'finish'}),require_done=True) - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('operation',choices=['reset','step','finish']) - parser.add_argument('--payload-base64') - parser.add_argument('--url',default='http://127.0.0.1:8000') - parser.add_argument('--timeout',type=float,default=330) - args=parser.parse_args() - payload={} if args.payload_base64 is None else loads(base64.b64decode(args.payload_base64,validate=True)) - if not isinstance(payload,dict):raise WireProtocolError('Payload must be a JSON object') - client=WireClient(args.url,args.timeout) - if args.operation=='reset':result=client.reset(**payload) - elif args.operation=='step':result=client.step(payload) - else: - if payload:raise WireProtocolError('Finish has no payload') - result=client.finish() - print(json.dumps(result,ensure_ascii=False,allow_nan=False,separators=(',',':'))) - - -if __name__=='__main__': - try:main() - except Exception as exc: - print(type(exc).__name__+': '+str(exc),file=sys.stderr) - raise SystemExit(1) diff --git a/components/tmax/DEPENDENCIES.json b/components/tmax/DEPENDENCIES.json deleted file mode 100644 index 0f9940b725cd52aa6bdfe42d7c46751f88fcac1d..0000000000000000000000000000000000000000 --- a/components/tmax/DEPENDENCIES.json +++ /dev/null @@ -1,5191 +0,0 @@ -{ - "schema_version": 1, - "source_rootfs_archive_sha256": "bedcbdb12f8cdeb19cc7853e01959028c5c88b6c7f3062007754d0ae5deeb687", - "inventory_method": "Read installed package metadata from the complete uncompressed OCI layer produced from the frozen source rootfs; no installers were executed.", - "os_release": { - "path": "/usr/lib/os-release", - "fields": { - "PRETTY_NAME": "Ubuntu 22.04.5 LTS", - "VERSION_ID": "22.04", - "VERSION_CODENAME": "jammy", - "ID": "ubuntu" - }, - "sha256": "594d5ddd35aedb47f00d9c34d140017907a5b9f93c975aba125fc924daac5c07" - }, - "system_packages": { - "source_path": "/var/lib/dpkg/status", - "source_sha256": "fd6fb1d44d9298e6216ea1871145b199804011a3e53d08410bde1efa552d1a89", - "packages": [ - { - "name": "adduser", - "version": "3.118ubuntu5", - "architecture": "all" - }, - { - "name": "apt", - "version": "2.4.14", - "architecture": "amd64" - }, - { - "name": "autoconf", - "version": "2.71-2", - "architecture": "all" - }, - { - "name": "automake", - "version": "1:1.16.5-1.3", - "architecture": "all" - }, - { - "name": "autotools-dev", - "version": "20220109.1", - "architecture": "all" - }, - { - "name": "base-files", - "version": "12ubuntu4.7", - "architecture": "amd64" - }, - { - "name": "base-passwd", - "version": "3.5.52build1", - "architecture": "amd64" - }, - { - "name": "bash", - "version": "5.1-6ubuntu1.1", - "architecture": "amd64" - }, - { - "name": "binutils", - "version": "2.38-4ubuntu2.12", - "architecture": "amd64" - }, - { - "name": "binutils-common", - "version": "2.38-4ubuntu2.12", - "architecture": "amd64" - }, - { - "name": "binutils-x86-64-linux-gnu", - "version": "2.38-4ubuntu2.12", - "architecture": "amd64" - }, - { - "name": "bsdutils", - "version": "1:2.37.2-4ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "build-essential", - "version": "12.9ubuntu3", - "architecture": "amd64" - }, - { - "name": "bzip2", - "version": "1.0.8-5ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "ca-certificates", - "version": "20260601~22.04.1", - "architecture": "all" - }, - { - "name": "cargo", - "version": "1.75.0+dfsg0ubuntu1~bpo0-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "cmake", - "version": "3.22.1-1ubuntu1.22.04.2", - "architecture": "amd64" - }, - { - "name": "cmake-data", - "version": "3.22.1-1ubuntu1.22.04.2", - "architecture": "all" - }, - { - "name": "coreutils", - "version": "8.32-4.1ubuntu1.4", - "architecture": "amd64" - }, - { - "name": "cpio", - "version": "2.13+dfsg-7ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "cpp", - "version": "4:11.2.0-1ubuntu1", - "architecture": "amd64" - }, - { - "name": "cpp-11", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "curl", - "version": "7.81.0-1ubuntu1.29", - "architecture": "amd64" - }, - { - "name": "dash", - "version": "0.5.11+git20210903+057cd650a4ed-3build1", - "architecture": "amd64" - }, - { - "name": "debconf", - "version": "1.5.79ubuntu1", - "architecture": "all" - }, - { - "name": "debianutils", - "version": "5.5-1ubuntu2", - "architecture": "amd64" - }, - { - "name": "dh-elpa-helper", - "version": "2.0.9ubuntu1", - "architecture": "all" - }, - { - "name": "diffutils", - "version": "1:3.8-0ubuntu2.1", - "architecture": "amd64" - }, - { - "name": "dpkg", - "version": "1.21.1ubuntu2.6", - "architecture": "amd64" - }, - { - "name": "dpkg-dev", - "version": "1.21.1ubuntu2.6", - "architecture": "all" - }, - { - "name": "e2fsprogs", - "version": "1.46.5-2ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "emacsen-common", - "version": "3.0.4", - "architecture": "all" - }, - { - "name": "espeak", - "version": "1.48.15+dfsg-3", - "architecture": "amd64" - }, - { - "name": "espeak-data", - "version": "1.48.15+dfsg-3", - "architecture": "amd64" - }, - { - "name": "espeak-ng", - "version": "1.50+dfsg-10ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "espeak-ng-data", - "version": "1.50+dfsg-10ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "expect", - "version": "5.45.4-2build1", - "architecture": "amd64" - }, - { - "name": "ffmpeg", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "file", - "version": "1:5.41-3ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "findutils", - "version": "4.8.0-1ubuntu3", - "architecture": "amd64" - }, - { - "name": "fontconfig", - "version": "2.13.1-4.2ubuntu5", - "architecture": "amd64" - }, - { - "name": "fontconfig-config", - "version": "2.13.1-4.2ubuntu5", - "architecture": "all" - }, - { - "name": "fonts-dejavu-core", - "version": "2.37-2build1", - "architecture": "all" - }, - { - "name": "g++", - "version": "4:11.2.0-1ubuntu1", - "architecture": "amd64" - }, - { - "name": "g++-11", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "gawk", - "version": "1:5.1.0-1ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "gcc", - "version": "4:11.2.0-1ubuntu1", - "architecture": "amd64" - }, - { - "name": "gcc-11", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "gcc-11-base", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "gcc-12-base", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "gdb", - "version": "12.1-0ubuntu1~22.04.2", - "architecture": "amd64" - }, - { - "name": "gfortran-11", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "git", - "version": "1:2.34.1-1ubuntu1.17", - "architecture": "amd64" - }, - { - "name": "git-man", - "version": "1:2.34.1-1ubuntu1.17", - "architecture": "all" - }, - { - "name": "golang-1.18-go", - "version": "1.18.1-1ubuntu1.3", - "architecture": "amd64" - }, - { - "name": "golang-1.18-src", - "version": "1.18.1-1ubuntu1.3", - "architecture": "all" - }, - { - "name": "golang-go", - "version": "2:1.18~0ubuntu2", - "architecture": "amd64" - }, - { - "name": "golang-src", - "version": "2:1.18~0ubuntu2", - "architecture": "all" - }, - { - "name": "gpgv", - "version": "2.2.27-3ubuntu2.5", - "architecture": "amd64" - }, - { - "name": "grep", - "version": "3.7-1build1", - "architecture": "amd64" - }, - { - "name": "gsasl-common", - "version": "1.10.0-5", - "architecture": "all" - }, - { - "name": "guile-3.0-libs", - "version": "3.0.7-1", - "architecture": "amd64" - }, - { - "name": "gyp", - "version": "0.1+20210831gitd6c5dd5-5", - "architecture": "all" - }, - { - "name": "gzip", - "version": "1.10-4ubuntu4.2", - "architecture": "amd64" - }, - { - "name": "hicolor-icon-theme", - "version": "0.17-2", - "architecture": "all" - }, - { - "name": "hostname", - "version": "3.23ubuntu2", - "architecture": "amd64" - }, - { - "name": "ibverbs-providers", - "version": "39.0-1", - "architecture": "amd64" - }, - { - "name": "imagemagick", - "version": "8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5", - "architecture": "amd64" - }, - { - "name": "imagemagick-6-common", - "version": "8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5", - "architecture": "all" - }, - { - "name": "imagemagick-6.q16", - "version": "8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5", - "architecture": "amd64" - }, - { - "name": "init-system-helpers", - "version": "1.62", - "architecture": "all" - }, - { - "name": "inotify-tools", - "version": "3.22.1.0-2", - "architecture": "amd64" - }, - { - "name": "iproute2", - "version": "5.15.0-1ubuntu2.2", - "architecture": "amd64" - }, - { - "name": "jq", - "version": "1.6-2.1ubuntu3.2", - "architecture": "amd64" - }, - { - "name": "libacl1", - "version": "2.3.1-1", - "architecture": "amd64" - }, - { - "name": "libaom3", - "version": "3.3.0-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libapparmor1", - "version": "3.0.4-2ubuntu2.5", - "architecture": "amd64" - }, - { - "name": "libapt-pkg6.0", - "version": "2.4.14", - "architecture": "amd64" - }, - { - "name": "libarchive13", - "version": "3.6.0-1ubuntu1.9", - "architecture": "amd64" - }, - { - "name": "libasan6", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libasound2", - "version": "1.2.6.1-1ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "libasound2-data", - "version": "1.2.6.1-1ubuntu1.2", - "architecture": "all" - }, - { - "name": "libass9", - "version": "1:0.15.2-1", - "architecture": "amd64" - }, - { - "name": "libasyncns0", - "version": "0.8-6build2", - "architecture": "amd64" - }, - { - "name": "libatomic1", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libattr1", - "version": "1:2.5.1-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libaudit-common", - "version": "1:3.0.7-1ubuntu0.1", - "architecture": "all" - }, - { - "name": "libaudit1", - "version": "1:3.0.7-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libavc1394-0", - "version": "0.5.4-5build2", - "architecture": "amd64" - }, - { - "name": "libavcodec58", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libavdevice58", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libavfilter7", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libavformat58", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libavutil56", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libbabeltrace1", - "version": "1.5.8-2build1", - "architecture": "amd64" - }, - { - "name": "libbinutils", - "version": "2.38-4ubuntu2.12", - "architecture": "amd64" - }, - { - "name": "libblas-dev", - "version": "3.10.0-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libblas3", - "version": "3.10.0-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libblkid1", - "version": "2.37.2-4ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "libbluray2", - "version": "1:1.3.1-1", - "architecture": "amd64" - }, - { - "name": "libboost-regex1.74.0", - "version": "1.74.0-14ubuntu3", - "architecture": "amd64" - }, - { - "name": "libbpf0", - "version": "1:0.5.0-1ubuntu22.04.1", - "architecture": "amd64" - }, - { - "name": "libbrotli-dev", - "version": "1.0.9-2build6", - "architecture": "amd64" - }, - { - "name": "libbrotli1", - "version": "1.0.9-2build6", - "architecture": "amd64" - }, - { - "name": "libbs2b0", - "version": "3.1.0+dfsg-2.2build1", - "architecture": "amd64" - }, - { - "name": "libbsd0", - "version": "0.11.5-1", - "architecture": "amd64" - }, - { - "name": "libbz2-1.0", - "version": "1.0.8-5ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libc-ares2", - "version": "1.18.1-1ubuntu0.22.04.3", - "architecture": "amd64" - }, - { - "name": "libc-bin", - "version": "2.35-0ubuntu3.15", - "architecture": "amd64" - }, - { - "name": "libc-dev-bin", - "version": "2.35-0ubuntu3.15", - "architecture": "amd64" - }, - { - "name": "libc6", - "version": "2.35-0ubuntu3.15", - "architecture": "amd64" - }, - { - "name": "libc6-dbg", - "version": "2.35-0ubuntu3.15", - "architecture": "amd64" - }, - { - "name": "libc6-dev", - "version": "2.35-0ubuntu3.15", - "architecture": "amd64" - }, - { - "name": "libc6-i386", - "version": "2.35-0ubuntu3.15", - "architecture": "amd64" - }, - { - "name": "libcaca0", - "version": "0.99.beta19-2.2ubuntu4.2", - "architecture": "amd64" - }, - { - "name": "libcairo-gobject2", - "version": "1.16.0-5ubuntu2.1", - "architecture": "amd64" - }, - { - "name": "libcairo2", - "version": "1.16.0-5ubuntu2.1", - "architecture": "amd64" - }, - { - "name": "libcap-ng0", - "version": "0.7.9-2.2build3", - "architecture": "amd64" - }, - { - "name": "libcap2", - "version": "1:2.44-1ubuntu0.22.04.3", - "architecture": "amd64" - }, - { - "name": "libcap2-bin", - "version": "1:2.44-1ubuntu0.22.04.3", - "architecture": "amd64" - }, - { - "name": "libcbor0.8", - "version": "0.8.0-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libcc1-0", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libcdio-cdda2", - "version": "10.2+2.0.0-1build3", - "architecture": "amd64" - }, - { - "name": "libcdio-paranoia2", - "version": "10.2+2.0.0-1build3", - "architecture": "amd64" - }, - { - "name": "libcdio19", - "version": "2.1.0-3ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libchromaprint1", - "version": "1.5.1-2", - "architecture": "amd64" - }, - { - "name": "libcodec2-1.0", - "version": "1.0.1-3", - "architecture": "amd64" - }, - { - "name": "libcom-err2", - "version": "1.46.5-2ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "libconfig-inifiles-perl", - "version": "3.000003-1ubuntu0.1", - "architecture": "all" - }, - { - "name": "libcrypt-dev", - "version": "1:4.4.27-1", - "architecture": "amd64" - }, - { - "name": "libcrypt1", - "version": "1:4.4.27-1", - "architecture": "amd64" - }, - { - "name": "libctf-nobfd0", - "version": "2.38-4ubuntu2.12", - "architecture": "amd64" - }, - { - "name": "libctf0", - "version": "2.38-4ubuntu2.12", - "architecture": "amd64" - }, - { - "name": "libcurl3-gnutls", - "version": "7.81.0-1ubuntu1.29", - "architecture": "amd64" - }, - { - "name": "libcurl4", - "version": "7.81.0-1ubuntu1.29", - "architecture": "amd64" - }, - { - "name": "libdatrie1", - "version": "0.2.13-2", - "architecture": "amd64" - }, - { - "name": "libdav1d5", - "version": "0.9.2-1", - "architecture": "amd64" - }, - { - "name": "libdb5.3", - "version": "5.3.28+dfsg1-0.8ubuntu3", - "architecture": "amd64" - }, - { - "name": "libdbus-1-3", - "version": "1.12.20-2ubuntu4.1", - "architecture": "amd64" - }, - { - "name": "libdc1394-25", - "version": "2.2.6-4", - "architecture": "amd64" - }, - { - "name": "libde265-0", - "version": "1.0.8-1ubuntu0.3", - "architecture": "amd64" - }, - { - "name": "libdebconfclient0", - "version": "0.261ubuntu1", - "architecture": "amd64" - }, - { - "name": "libdebuginfod-common", - "version": "0.186-1ubuntu0.1", - "architecture": "all" - }, - { - "name": "libdebuginfod1", - "version": "0.186-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libdecor-0-0", - "version": "0.1.0-3build1", - "architecture": "amd64" - }, - { - "name": "libdeflate-dev", - "version": "1.10-2", - "architecture": "amd64" - }, - { - "name": "libdeflate0", - "version": "1.10-2", - "architecture": "amd64" - }, - { - "name": "libdpkg-perl", - "version": "1.21.1ubuntu2.6", - "architecture": "all" - }, - { - "name": "libdrm-amdgpu1", - "version": "2.4.113-2~ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libdrm-common", - "version": "2.4.113-2~ubuntu0.22.04.1", - "architecture": "all" - }, - { - "name": "libdrm-intel1", - "version": "2.4.113-2~ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libdrm-nouveau2", - "version": "2.4.113-2~ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libdrm-radeon1", - "version": "2.4.113-2~ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libdrm2", - "version": "2.4.113-2~ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libdw1", - "version": "0.186-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libedit2", - "version": "3.1-20210910-1build1", - "architecture": "amd64" - }, - { - "name": "libelf1", - "version": "0.186-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "liberror-perl", - "version": "0.17029-1", - "architecture": "all" - }, - { - "name": "libespeak-ng-dev", - "version": "1.50+dfsg-10ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libespeak-ng1", - "version": "1.50+dfsg-10ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libespeak1", - "version": "1.48.15+dfsg-3", - "architecture": "amd64" - }, - { - "name": "libevent-2.1-7", - "version": "2.1.12-stable-1ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libevent-core-2.1-7", - "version": "2.1.12-stable-1ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libevent-dev", - "version": "2.1.12-stable-1ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libevent-extra-2.1-7", - "version": "2.1.12-stable-1ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libevent-openssl-2.1-7", - "version": "2.1.12-stable-1ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libevent-pthreads-2.1-7", - "version": "2.1.12-stable-1ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libexpat1", - "version": "2.4.7-1ubuntu0.9", - "architecture": "amd64" - }, - { - "name": "libext2fs2", - "version": "1.46.5-2ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "libfabric1", - "version": "1.11.0-3", - "architecture": "amd64" - }, - { - "name": "libffi8", - "version": "3.4.2-4", - "architecture": "amd64" - }, - { - "name": "libfftw3-double3", - "version": "3.3.8-2ubuntu8", - "architecture": "amd64" - }, - { - "name": "libfido2-1", - "version": "1.10.0-1", - "architecture": "amd64" - }, - { - "name": "libflac8", - "version": "1.3.3-2ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libflite1", - "version": "2.2-3", - "architecture": "amd64" - }, - { - "name": "libfontconfig1", - "version": "2.13.1-4.2ubuntu5", - "architecture": "amd64" - }, - { - "name": "libfreetype-dev", - "version": "2.11.1+dfsg-1ubuntu0.4", - "architecture": "amd64" - }, - { - "name": "libfreetype6", - "version": "2.11.1+dfsg-1ubuntu0.4", - "architecture": "amd64" - }, - { - "name": "libfreetype6-dev", - "version": "2.11.1+dfsg-1ubuntu0.4", - "architecture": "amd64" - }, - { - "name": "libfribidi0", - "version": "1.0.8-2ubuntu3.1", - "architecture": "amd64" - }, - { - "name": "libgbm1", - "version": "23.2.1-1ubuntu3.1~22.04.4", - "architecture": "amd64" - }, - { - "name": "libgc1", - "version": "1:8.0.6-1.1build1", - "architecture": "amd64" - }, - { - "name": "libgcc-11-dev", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libgcc-s1", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libgcrypt20", - "version": "1.9.4-3ubuntu3.3", - "architecture": "amd64" - }, - { - "name": "libgd3", - "version": "2.3.0-2ubuntu2.3", - "architecture": "amd64" - }, - { - "name": "libgdbm-compat4", - "version": "1.23-1", - "architecture": "amd64" - }, - { - "name": "libgdbm6", - "version": "1.23-1", - "architecture": "amd64" - }, - { - "name": "libgdk-pixbuf-2.0-0", - "version": "2.42.8+dfsg-1ubuntu0.5", - "architecture": "amd64" - }, - { - "name": "libgdk-pixbuf2.0-common", - "version": "2.42.8+dfsg-1ubuntu0.5", - "architecture": "all" - }, - { - "name": "libgfortran-11-dev", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libgfortran5", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libgif7", - "version": "5.1.9-2ubuntu0.3", - "architecture": "amd64" - }, - { - "name": "libgl1", - "version": "1.4.0-1", - "architecture": "amd64" - }, - { - "name": "libgl1-mesa-dri", - "version": "23.2.1-1ubuntu3.1~22.04.4", - "architecture": "amd64" - }, - { - "name": "libglapi-mesa", - "version": "23.2.1-1ubuntu3.1~22.04.4", - "architecture": "amd64" - }, - { - "name": "libglib2.0-0", - "version": "2.72.4-0ubuntu2.10", - "architecture": "amd64" - }, - { - "name": "libglvnd0", - "version": "1.4.0-1", - "architecture": "amd64" - }, - { - "name": "libglx-mesa0", - "version": "23.2.1-1ubuntu3.1~22.04.4", - "architecture": "amd64" - }, - { - "name": "libglx0", - "version": "1.4.0-1", - "architecture": "amd64" - }, - { - "name": "libgme0", - "version": "0.6.3-2", - "architecture": "amd64" - }, - { - "name": "libgmp10", - "version": "2:6.2.1+dfsg-3ubuntu1", - "architecture": "amd64" - }, - { - "name": "libgnutls30", - "version": "3.7.3-4ubuntu1.9", - "architecture": "amd64" - }, - { - "name": "libgomp1", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libgpg-error0", - "version": "1.43-3", - "architecture": "amd64" - }, - { - "name": "libgraphite2-3", - "version": "1.3.14-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libgsasl7", - "version": "1.10.0-5", - "architecture": "amd64" - }, - { - "name": "libgsm1", - "version": "1.0.19-1", - "architecture": "amd64" - }, - { - "name": "libgssapi-krb5-2", - "version": "1.19.2-2ubuntu0.10", - "architecture": "amd64" - }, - { - "name": "libharfbuzz0b", - "version": "2.7.4-1ubuntu3.2", - "architecture": "amd64" - }, - { - "name": "libheif1", - "version": "1.12.0-2build1", - "architecture": "amd64" - }, - { - "name": "libhogweed6", - "version": "3.7.3-1build2", - "architecture": "amd64" - }, - { - "name": "libhwloc-dev", - "version": "2.7.0-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libhwloc-plugins", - "version": "2.7.0-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libhwloc15", - "version": "2.7.0-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libibverbs-dev", - "version": "39.0-1", - "architecture": "amd64" - }, - { - "name": "libibverbs1", - "version": "39.0-1", - "architecture": "amd64" - }, - { - "name": "libicu70", - "version": "70.1-2", - "architecture": "amd64" - }, - { - "name": "libidn12", - "version": "1.38-4ubuntu1.1", - "architecture": "amd64" - }, - { - "name": "libidn2-0", - "version": "2.3.2-2build1", - "architecture": "amd64" - }, - { - "name": "libiec61883-0", - "version": "1.2.0-4build3", - "architecture": "amd64" - }, - { - "name": "libinotifytools0", - "version": "3.22.1.0-2", - "architecture": "amd64" - }, - { - "name": "libipt2", - "version": "2.0.5-1", - "architecture": "amd64" - }, - { - "name": "libisl23", - "version": "0.24-2build1", - "architecture": "amd64" - }, - { - "name": "libitm1", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libjack-jackd2-0", - "version": "1.9.20~dfsg-1", - "architecture": "amd64" - }, - { - "name": "libjbig-dev", - "version": "2.1-3.1ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libjbig0", - "version": "2.1-3.1ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libjemalloc2", - "version": "5.2.1-4ubuntu1", - "architecture": "amd64" - }, - { - "name": "libjpeg-dev", - "version": "8c-2ubuntu10", - "architecture": "amd64" - }, - { - "name": "libjpeg-turbo8", - "version": "2.1.2-0ubuntu1", - "architecture": "amd64" - }, - { - "name": "libjpeg-turbo8-dev", - "version": "2.1.2-0ubuntu1", - "architecture": "amd64" - }, - { - "name": "libjpeg8", - "version": "8c-2ubuntu10", - "architecture": "amd64" - }, - { - "name": "libjpeg8-dev", - "version": "8c-2ubuntu10", - "architecture": "amd64" - }, - { - "name": "libjq1", - "version": "1.6-2.1ubuntu3.2", - "architecture": "amd64" - }, - { - "name": "libjs-events", - "version": "3.3.0+~3.0.0-2", - "architecture": "all" - }, - { - "name": "libjs-inherits", - "version": "2.0.4-4", - "architecture": "all" - }, - { - "name": "libjs-is-typedarray", - "version": "1.0.0-4", - "architecture": "all" - }, - { - "name": "libjs-jquery", - "version": "3.6.0+dfsg+~3.5.13-1", - "architecture": "all" - }, - { - "name": "libjs-jquery-ui", - "version": "1.13.1+dfsg-1", - "architecture": "all" - }, - { - "name": "libjs-typedarray-to-buffer", - "version": "4.0.0-2", - "architecture": "all" - }, - { - "name": "libjsoncpp25", - "version": "1.9.5-3", - "architecture": "amd64" - }, - { - "name": "libk5crypto3", - "version": "1.19.2-2ubuntu0.10", - "architecture": "amd64" - }, - { - "name": "libkeyutils1", - "version": "1.6.1-2ubuntu3", - "architecture": "amd64" - }, - { - "name": "libkrb5-3", - "version": "1.19.2-2ubuntu0.10", - "architecture": "amd64" - }, - { - "name": "libkrb5support0", - "version": "1.19.2-2ubuntu0.10", - "architecture": "amd64" - }, - { - "name": "liblapack-dev", - "version": "3.10.0-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "liblapack3", - "version": "3.10.0-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "liblcms2-2", - "version": "2.12~rc1-2ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libldap-2.5-0", - "version": "2.5.20+dfsg-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "liblept5", - "version": "1.82.0-3build1", - "architecture": "amd64" - }, - { - "name": "liblilv-0-0", - "version": "0.24.12-2", - "architecture": "amd64" - }, - { - "name": "libllvm15", - "version": "1:15.0.7-0ubuntu0.22.04.3", - "architecture": "amd64" - }, - { - "name": "liblqr-1-0", - "version": "0.4.2-2.1", - "architecture": "amd64" - }, - { - "name": "liblsan0", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libltdl-dev", - "version": "2.4.6-15build2", - "architecture": "amd64" - }, - { - "name": "libltdl7", - "version": "2.4.6-15build2", - "architecture": "amd64" - }, - { - "name": "liblua5.1-0", - "version": "5.1.5-8.1build4", - "architecture": "amd64" - }, - { - "name": "liblz4-1", - "version": "1.9.3-2build2", - "architecture": "amd64" - }, - { - "name": "liblzf1", - "version": "3.6-3", - "architecture": "amd64" - }, - { - "name": "liblzma-dev", - "version": "5.2.5-2ubuntu1.1", - "architecture": "amd64" - }, - { - "name": "liblzma5", - "version": "5.2.5-2ubuntu1.1", - "architecture": "amd64" - }, - { - "name": "libmagic-mgc", - "version": "1:5.41-3ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libmagic1", - "version": "1:5.41-3ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libmagickcore-6.q16-6", - "version": "8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5", - "architecture": "amd64" - }, - { - "name": "libmagickwand-6.q16-6", - "version": "8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5", - "architecture": "amd64" - }, - { - "name": "libmailutils8", - "version": "1:3.14-1", - "architecture": "amd64" - }, - { - "name": "libmariadb3", - "version": "1:10.6.23-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libmaxminddb0", - "version": "1.5.2-1build2", - "architecture": "amd64" - }, - { - "name": "libmd0", - "version": "1.0.4-1build1", - "architecture": "amd64" - }, - { - "name": "libmfx1", - "version": "22.3.0-1", - "architecture": "amd64" - }, - { - "name": "libmnl0", - "version": "1.0.4-3build2", - "architecture": "amd64" - }, - { - "name": "libmount1", - "version": "2.37.2-4ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "libmp3lame0", - "version": "3.100-3build2", - "architecture": "amd64" - }, - { - "name": "libmpc3", - "version": "1.2.1-2build1", - "architecture": "amd64" - }, - { - "name": "libmpdec3", - "version": "2.5.1-2build2", - "architecture": "amd64" - }, - { - "name": "libmpfr6", - "version": "4.1.0-3build3", - "architecture": "amd64" - }, - { - "name": "libmpg123-0", - "version": "1.29.3-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libmysofa1", - "version": "1.2.1~dfsg0-1", - "architecture": "amd64" - }, - { - "name": "libmysqlclient21", - "version": "8.0.46-0ubuntu0.22.04.4", - "architecture": "amd64" - }, - { - "name": "libncurses6", - "version": "6.3-2ubuntu0.3", - "architecture": "amd64" - }, - { - "name": "libncursesw6", - "version": "6.3-2ubuntu0.3", - "architecture": "amd64" - }, - { - "name": "libnettle8", - "version": "3.7.3-1build2", - "architecture": "amd64" - }, - { - "name": "libnghttp2-14", - "version": "1.43.0-1ubuntu0.4", - "architecture": "amd64" - }, - { - "name": "libnginx-mod-http-geoip2", - "version": "1.18.0-6ubuntu14.21", - "architecture": "amd64" - }, - { - "name": "libnginx-mod-http-image-filter", - "version": "1.18.0-6ubuntu14.21", - "architecture": "amd64" - }, - { - "name": "libnginx-mod-http-xslt-filter", - "version": "1.18.0-6ubuntu14.21", - "architecture": "amd64" - }, - { - "name": "libnginx-mod-mail", - "version": "1.18.0-6ubuntu14.21", - "architecture": "amd64" - }, - { - "name": "libnginx-mod-stream", - "version": "1.18.0-6ubuntu14.21", - "architecture": "amd64" - }, - { - "name": "libnginx-mod-stream-geoip2", - "version": "1.18.0-6ubuntu14.21", - "architecture": "amd64" - }, - { - "name": "libnl-3-200", - "version": "3.5.0-0.1", - "architecture": "amd64" - }, - { - "name": "libnl-3-dev", - "version": "3.5.0-0.1", - "architecture": "amd64" - }, - { - "name": "libnl-route-3-200", - "version": "3.5.0-0.1", - "architecture": "amd64" - }, - { - "name": "libnl-route-3-dev", - "version": "3.5.0-0.1", - "architecture": "amd64" - }, - { - "name": "libnode-dev", - "version": "12.22.9~dfsg-1ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "libnode72", - "version": "12.22.9~dfsg-1ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "libnorm1", - "version": "1.5.9+dfsg-2", - "architecture": "amd64" - }, - { - "name": "libnsl-dev", - "version": "1.3.0-2build2", - "architecture": "amd64" - }, - { - "name": "libnsl2", - "version": "1.3.0-2build2", - "architecture": "amd64" - }, - { - "name": "libntlm0", - "version": "1.6-4", - "architecture": "amd64" - }, - { - "name": "libnuma-dev", - "version": "2.0.14-3ubuntu2", - "architecture": "amd64" - }, - { - "name": "libnuma1", - "version": "2.0.14-3ubuntu2", - "architecture": "amd64" - }, - { - "name": "libogg0", - "version": "1.3.5-0ubuntu3", - "architecture": "amd64" - }, - { - "name": "libonig5", - "version": "6.9.7.1-2build1", - "architecture": "amd64" - }, - { - "name": "libopenal-data", - "version": "1:1.19.1-2build3", - "architecture": "all" - }, - { - "name": "libopenal1", - "version": "1:1.19.1-2build3", - "architecture": "amd64" - }, - { - "name": "libopenblas-dev", - "version": "0.3.20+ds-1", - "architecture": "amd64" - }, - { - "name": "libopenblas-pthread-dev", - "version": "0.3.20+ds-1", - "architecture": "amd64" - }, - { - "name": "libopenblas0", - "version": "0.3.20+ds-1", - "architecture": "amd64" - }, - { - "name": "libopenblas0-pthread", - "version": "0.3.20+ds-1", - "architecture": "amd64" - }, - { - "name": "libopenjp2-7", - "version": "2.4.0-6ubuntu0.5", - "architecture": "amd64" - }, - { - "name": "libopenmpi-dev", - "version": "4.1.2-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libopenmpi3", - "version": "4.1.2-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libopenmpt0", - "version": "0.6.1-1", - "architecture": "amd64" - }, - { - "name": "libopus0", - "version": "1.3.1-0.1build2", - "architecture": "amd64" - }, - { - "name": "libp11-kit0", - "version": "0.24.0-6ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libpam-modules", - "version": "1.4.0-11ubuntu2.8", - "architecture": "amd64" - }, - { - "name": "libpam-modules-bin", - "version": "1.4.0-11ubuntu2.8", - "architecture": "amd64" - }, - { - "name": "libpam-runtime", - "version": "1.4.0-11ubuntu2.8", - "architecture": "all" - }, - { - "name": "libpam0g", - "version": "1.4.0-11ubuntu2.8", - "architecture": "amd64" - }, - { - "name": "libpango-1.0-0", - "version": "1.50.6+ds-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libpangocairo-1.0-0", - "version": "1.50.6+ds-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libpangoft2-1.0-0", - "version": "1.50.6+ds-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libpcaudio0", - "version": "1.1-6build2", - "architecture": "amd64" - }, - { - "name": "libpciaccess0", - "version": "0.16-3", - "architecture": "amd64" - }, - { - "name": "libpcre2-8-0", - "version": "10.39-3ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libpcre3", - "version": "2:8.39-13ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libperl5.34", - "version": "5.34.0-3ubuntu1.9", - "architecture": "amd64" - }, - { - "name": "libpgm-5.3-0", - "version": "5.3.128~dfsg-2", - "architecture": "amd64" - }, - { - "name": "libpixman-1-0", - "version": "0.40.0-1ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libpmix-dev", - "version": "4.1.2-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libpmix2", - "version": "4.1.2-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "libpng-dev", - "version": "1.6.37-3ubuntu0.7", - "architecture": "amd64" - }, - { - "name": "libpng16-16", - "version": "1.6.37-3ubuntu0.7", - "architecture": "amd64" - }, - { - "name": "libpocketsphinx3", - "version": "0.8.0+real5prealpha+1-14ubuntu1", - "architecture": "amd64" - }, - { - "name": "libportaudio2", - "version": "19.6.0-1.1", - "architecture": "amd64" - }, - { - "name": "libpostproc55", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libpq5", - "version": "14.24-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libprocps8", - "version": "2:3.3.17-6ubuntu2.1", - "architecture": "amd64" - }, - { - "name": "libpsl5", - "version": "0.21.0-1.2build2", - "architecture": "amd64" - }, - { - "name": "libpsm-infinipath1", - "version": "3.3+20.604758e7-6.1", - "architecture": "amd64" - }, - { - "name": "libpsm2-2", - "version": "11.2.185-1", - "architecture": "amd64" - }, - { - "name": "libpulse0", - "version": "1:15.99.1+dfsg1-1ubuntu2.2", - "architecture": "amd64" - }, - { - "name": "libpython3-stdlib", - "version": "3.10.6-1~22.04.1", - "architecture": "amd64" - }, - { - "name": "libpython3.10", - "version": "3.10.12-1~22.04.18", - "architecture": "amd64" - }, - { - "name": "libpython3.10-minimal", - "version": "3.10.12-1~22.04.18", - "architecture": "amd64" - }, - { - "name": "libpython3.10-stdlib", - "version": "3.10.12-1~22.04.18", - "architecture": "amd64" - }, - { - "name": "libquadmath0", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "librabbitmq4", - "version": "0.10.0-1ubuntu2.2", - "architecture": "amd64" - }, - { - "name": "libraw1394-11", - "version": "2.1.2-2build2", - "architecture": "amd64" - }, - { - "name": "librdmacm1", - "version": "39.0-1", - "architecture": "amd64" - }, - { - "name": "libreadline8", - "version": "8.1.2-1", - "architecture": "amd64" - }, - { - "name": "librhash0", - "version": "1.4.2-1ubuntu1", - "architecture": "amd64" - }, - { - "name": "librsvg2-2", - "version": "2.52.5+dfsg-3ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "librtmp1", - "version": "2.4+20151223.gitfa8646d.1-2build4", - "architecture": "amd64" - }, - { - "name": "librubberband2", - "version": "2.0.0-2", - "architecture": "amd64" - }, - { - "name": "libsamplerate0", - "version": "0.2.2-1build1", - "architecture": "amd64" - }, - { - "name": "libsasl2-2", - "version": "2.1.27+dfsg2-3ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "libsasl2-modules-db", - "version": "2.1.27+dfsg2-3ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "libsdl2-2.0-0", - "version": "2.0.20+dfsg-2ubuntu1.22.04.1", - "architecture": "amd64" - }, - { - "name": "libseccomp2", - "version": "2.5.3-2ubuntu3~22.04.1", - "architecture": "amd64" - }, - { - "name": "libselinux1", - "version": "3.3-1build2", - "architecture": "amd64" - }, - { - "name": "libsemanage-common", - "version": "3.3-1build2", - "architecture": "all" - }, - { - "name": "libsemanage2", - "version": "3.3-1build2", - "architecture": "amd64" - }, - { - "name": "libsensors-config", - "version": "1:3.6.0-7ubuntu1", - "architecture": "all" - }, - { - "name": "libsensors5", - "version": "1:3.6.0-7ubuntu1", - "architecture": "amd64" - }, - { - "name": "libsepol2", - "version": "3.3-1build1", - "architecture": "amd64" - }, - { - "name": "libserd-0-0", - "version": "0.30.10-2", - "architecture": "amd64" - }, - { - "name": "libshine3", - "version": "3.1.1-2", - "architecture": "amd64" - }, - { - "name": "libsigsegv2", - "version": "2.13-1ubuntu3", - "architecture": "amd64" - }, - { - "name": "libslang2", - "version": "2.3.2-5build4", - "architecture": "amd64" - }, - { - "name": "libsmartcols1", - "version": "2.37.2-4ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "libsnappy1v5", - "version": "1.1.8-1build3", - "architecture": "amd64" - }, - { - "name": "libsndfile1", - "version": "1.0.31-2ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libsndio7.0", - "version": "1.8.1-1.1", - "architecture": "amd64" - }, - { - "name": "libsodium23", - "version": "1.0.18-1ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libsonic0", - "version": "0.2.0-11build1", - "architecture": "amd64" - }, - { - "name": "libsord-0-0", - "version": "0.16.8-2", - "architecture": "amd64" - }, - { - "name": "libsource-highlight-common", - "version": "3.1.9-4.1build2", - "architecture": "all" - }, - { - "name": "libsource-highlight4v5", - "version": "3.1.9-4.1build2", - "architecture": "amd64" - }, - { - "name": "libsoxr0", - "version": "0.1.3-4build2", - "architecture": "amd64" - }, - { - "name": "libspeex1", - "version": "1.2~rc1.2-1.1ubuntu3", - "architecture": "amd64" - }, - { - "name": "libsphinxbase3", - "version": "0.8+5prealpha+1-13build1", - "architecture": "amd64" - }, - { - "name": "libsqlite3-0", - "version": "3.37.2-2ubuntu0.8", - "architecture": "amd64" - }, - { - "name": "libsqlite3-dev", - "version": "3.37.2-2ubuntu0.8", - "architecture": "amd64" - }, - { - "name": "libsratom-0-0", - "version": "0.6.8-1", - "architecture": "amd64" - }, - { - "name": "libsrt1.4-gnutls", - "version": "1.4.4-4", - "architecture": "amd64" - }, - { - "name": "libss2", - "version": "1.46.5-2ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "libssh-4", - "version": "0.9.6-2ubuntu0.22.04.8", - "architecture": "amd64" - }, - { - "name": "libssh-gcrypt-4", - "version": "0.9.6-2ubuntu0.22.04.8", - "architecture": "amd64" - }, - { - "name": "libssh2-1", - "version": "1.10.0-3ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libssl-dev", - "version": "3.0.2-0ubuntu1.30", - "architecture": "amd64" - }, - { - "name": "libssl3", - "version": "3.0.2-0ubuntu1.30", - "architecture": "amd64" - }, - { - "name": "libstd-rust-1.75", - "version": "1.75.0+dfsg0ubuntu1~bpo0-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libstd-rust-dev", - "version": "1.75.0+dfsg0ubuntu1~bpo0-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libstdc++-11-dev", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libstdc++6", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libswresample3", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libswscale5", - "version": "7:4.4.2-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "libsystemd0", - "version": "249.11-0ubuntu3.22", - "architecture": "amd64" - }, - { - "name": "libtasn1-6", - "version": "4.18.0-4ubuntu0.2", - "architecture": "amd64" - }, - { - "name": "libtcl8.6", - "version": "8.6.12+dfsg-1build1", - "architecture": "amd64" - }, - { - "name": "libtesseract4", - "version": "4.1.1-2.1build1", - "architecture": "amd64" - }, - { - "name": "libthai-data", - "version": "0.1.29-1build1", - "architecture": "all" - }, - { - "name": "libthai0", - "version": "0.1.29-1build1", - "architecture": "amd64" - }, - { - "name": "libtheora0", - "version": "1.1.1+dfsg.1-15ubuntu4", - "architecture": "amd64" - }, - { - "name": "libtiff-dev", - "version": "4.3.0-6ubuntu0.13", - "architecture": "amd64" - }, - { - "name": "libtiff5", - "version": "4.3.0-6ubuntu0.13", - "architecture": "amd64" - }, - { - "name": "libtiffxx5", - "version": "4.3.0-6ubuntu0.13", - "architecture": "amd64" - }, - { - "name": "libtinfo6", - "version": "6.3-2ubuntu0.3", - "architecture": "amd64" - }, - { - "name": "libtirpc-common", - "version": "1.3.2-2ubuntu0.1", - "architecture": "all" - }, - { - "name": "libtirpc-dev", - "version": "1.3.2-2ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libtirpc3", - "version": "1.3.2-2ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libtool", - "version": "2.4.6-15build2", - "architecture": "all" - }, - { - "name": "libtsan0", - "version": "11.4.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libtwolame0", - "version": "0.4.0-2build2", - "architecture": "amd64" - }, - { - "name": "libubsan1", - "version": "12.3.0-1ubuntu1~22.04.3", - "architecture": "amd64" - }, - { - "name": "libucl1", - "version": "1.03+repack-6", - "architecture": "amd64" - }, - { - "name": "libucx0", - "version": "1.12.1~rc2-1", - "architecture": "amd64" - }, - { - "name": "libudev1", - "version": "249.11-0ubuntu3.22", - "architecture": "amd64" - }, - { - "name": "libudfread0", - "version": "1.1.2-1", - "architecture": "amd64" - }, - { - "name": "libunistring2", - "version": "1.0-1", - "architecture": "amd64" - }, - { - "name": "libusb-1.0-0", - "version": "2:1.0.25-1ubuntu2", - "architecture": "amd64" - }, - { - "name": "libuuid1", - "version": "2.37.2-4ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "libuv1", - "version": "1.43.0-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libuv1-dev", - "version": "1.43.0-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libva-drm2", - "version": "2.14.0-1", - "architecture": "amd64" - }, - { - "name": "libva-x11-2", - "version": "2.14.0-1", - "architecture": "amd64" - }, - { - "name": "libva2", - "version": "2.14.0-1", - "architecture": "amd64" - }, - { - "name": "libvdpau1", - "version": "1.4-3build2", - "architecture": "amd64" - }, - { - "name": "libvidstab1.1", - "version": "1.1.0-2", - "architecture": "amd64" - }, - { - "name": "libvorbis0a", - "version": "1.3.7-1build2", - "architecture": "amd64" - }, - { - "name": "libvorbisenc2", - "version": "1.3.7-1build2", - "architecture": "amd64" - }, - { - "name": "libvorbisfile3", - "version": "1.3.7-1build2", - "architecture": "amd64" - }, - { - "name": "libvpx7", - "version": "1.11.0-2ubuntu2.5", - "architecture": "amd64" - }, - { - "name": "libwayland-client0", - "version": "1.20.0-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libwayland-cursor0", - "version": "1.20.0-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libwayland-egl1", - "version": "1.20.0-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libwayland-server0", - "version": "1.20.0-1ubuntu0.1", - "architecture": "amd64" - }, - { - "name": "libwebp-dev", - "version": "1.2.2-2ubuntu0.22.04.2", - "architecture": "amd64" - }, - { - "name": "libwebp7", - "version": "1.2.2-2ubuntu0.22.04.2", - "architecture": "amd64" - }, - { - "name": "libwebpdemux2", - "version": "1.2.2-2ubuntu0.22.04.2", - "architecture": "amd64" - }, - { - "name": "libwebpmux3", - "version": "1.2.2-2ubuntu0.22.04.2", - "architecture": "amd64" - }, - { - "name": "libwrap0", - "version": "7.6.q-31build2", - "architecture": "amd64" - }, - { - "name": "libx11-6", - "version": "2:1.7.5-1ubuntu0.3", - "architecture": "amd64" - }, - { - "name": "libx11-data", - "version": "2:1.7.5-1ubuntu0.3", - "architecture": "all" - }, - { - "name": "libx11-xcb1", - "version": "2:1.7.5-1ubuntu0.3", - "architecture": "amd64" - }, - { - "name": "libx264-163", - "version": "2:0.163.3060+git5db6aa6-2build1", - "architecture": "amd64" - }, - { - "name": "libx265-199", - "version": "3.5-2", - "architecture": "amd64" - }, - { - "name": "libxau6", - "version": "1:1.0.9-1build5", - "architecture": "amd64" - }, - { - "name": "libxcb-dri2-0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-dri3-0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-glx0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-present0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-randr0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-render0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-shape0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-shm0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-sync1", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb-xfixes0", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcb1", - "version": "1.14-3ubuntu3", - "architecture": "amd64" - }, - { - "name": "libxcursor1", - "version": "1:1.2.0-2build4", - "architecture": "amd64" - }, - { - "name": "libxdmcp6", - "version": "1:1.1.3-0ubuntu5", - "architecture": "amd64" - }, - { - "name": "libxext6", - "version": "2:1.3.4-1build1", - "architecture": "amd64" - }, - { - "name": "libxfixes3", - "version": "1:6.0.0-1", - "architecture": "amd64" - }, - { - "name": "libxi6", - "version": "2:1.8-1build1", - "architecture": "amd64" - }, - { - "name": "libxinerama1", - "version": "2:1.1.4-3", - "architecture": "amd64" - }, - { - "name": "libxkbcommon0", - "version": "1.4.0-1", - "architecture": "amd64" - }, - { - "name": "libxml2", - "version": "2.9.13+dfsg-1ubuntu0.14", - "architecture": "amd64" - }, - { - "name": "libxnvctrl0", - "version": "510.47.03-0ubuntu1.22.04.1", - "architecture": "amd64" - }, - { - "name": "libxpm4", - "version": "1:3.5.12-1ubuntu0.22.04.4", - "architecture": "amd64" - }, - { - "name": "libxrandr2", - "version": "2:1.5.2-1build1", - "architecture": "amd64" - }, - { - "name": "libxrender1", - "version": "1:0.9.10-1build4", - "architecture": "amd64" - }, - { - "name": "libxshmfence1", - "version": "1.3-1build4", - "architecture": "amd64" - }, - { - "name": "libxslt1.1", - "version": "1.1.34-4ubuntu0.22.04.5", - "architecture": "amd64" - }, - { - "name": "libxss1", - "version": "1:1.2.3-1build2", - "architecture": "amd64" - }, - { - "name": "libxtables12", - "version": "1.8.7-1ubuntu5.2", - "architecture": "amd64" - }, - { - "name": "libxv1", - "version": "2:1.0.11-1build2", - "architecture": "amd64" - }, - { - "name": "libxvidcore4", - "version": "2:1.3.7-1", - "architecture": "amd64" - }, - { - "name": "libxxf86vm1", - "version": "1:1.1.4-1build3", - "architecture": "amd64" - }, - { - "name": "libxxhash0", - "version": "0.8.1-1", - "architecture": "amd64" - }, - { - "name": "libzimg2", - "version": "3.0.3+ds1-1", - "architecture": "amd64" - }, - { - "name": "libzmq5", - "version": "4.3.4-2", - "architecture": "amd64" - }, - { - "name": "libzstd1", - "version": "1.4.8+dfsg-3build1", - "architecture": "amd64" - }, - { - "name": "libzvbi-common", - "version": "0.2.35-19", - "architecture": "all" - }, - { - "name": "libzvbi0", - "version": "0.2.35-19", - "architecture": "amd64" - }, - { - "name": "linux-libc-dev", - "version": "5.15.0-198.208", - "architecture": "amd64" - }, - { - "name": "login", - "version": "1:4.8.1-2ubuntu2.2", - "architecture": "amd64" - }, - { - "name": "logsave", - "version": "1.46.5-2ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "lsb-base", - "version": "11.1.0ubuntu4", - "architecture": "all" - }, - { - "name": "lto-disabled-list", - "version": "24", - "architecture": "all" - }, - { - "name": "lua-bitop", - "version": "1.0.2-5", - "architecture": "amd64" - }, - { - "name": "lua-cjson", - "version": "2.1.0+dfsg-2.1", - "architecture": "amd64" - }, - { - "name": "m4", - "version": "1.4.18-5ubuntu2", - "architecture": "amd64" - }, - { - "name": "mailutils", - "version": "1:3.14-1", - "architecture": "amd64" - }, - { - "name": "mailutils-common", - "version": "1:3.14-1", - "architecture": "all" - }, - { - "name": "make", - "version": "4.3-4.1build1", - "architecture": "amd64" - }, - { - "name": "mariadb-client", - "version": "1:10.6.23-0ubuntu0.22.04.1", - "architecture": "all" - }, - { - "name": "mariadb-client-10.6", - "version": "1:10.6.23-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "mariadb-client-core-10.6", - "version": "1:10.6.23-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "mariadb-common", - "version": "1:10.6.23-0ubuntu0.22.04.1", - "architecture": "all" - }, - { - "name": "mawk", - "version": "1.3.4.20200120-3", - "architecture": "amd64" - }, - { - "name": "media-types", - "version": "7.0.0", - "architecture": "all" - }, - { - "name": "mount", - "version": "2.37.2-4ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "mysql-common", - "version": "5.8+1.0.8", - "architecture": "all" - }, - { - "name": "nasm", - "version": "2.15.05-1", - "architecture": "amd64" - }, - { - "name": "ncurses-base", - "version": "6.3-2ubuntu0.3", - "architecture": "all" - }, - { - "name": "ncurses-bin", - "version": "6.3-2ubuntu0.3", - "architecture": "amd64" - }, - { - "name": "netbase", - "version": "6.3", - "architecture": "all" - }, - { - "name": "netcat-openbsd", - "version": "1.218-4ubuntu1", - "architecture": "amd64" - }, - { - "name": "nginx", - "version": "1.18.0-6ubuntu14.21", - "architecture": "amd64" - }, - { - "name": "nginx-common", - "version": "1.18.0-6ubuntu14.21", - "architecture": "all" - }, - { - "name": "nginx-core", - "version": "1.18.0-6ubuntu14.21", - "architecture": "amd64" - }, - { - "name": "node-abbrev", - "version": "1.1.1+~1.1.2-1", - "architecture": "all" - }, - { - "name": "node-agent-base", - "version": "6.0.2+~cs5.4.2-1", - "architecture": "all" - }, - { - "name": "node-ansi-regex", - "version": "5.0.1-1", - "architecture": "all" - }, - { - "name": "node-ansi-styles", - "version": "4.3.0+~4.2.0-1", - "architecture": "all" - }, - { - "name": "node-ansistyles", - "version": "0.1.3-5", - "architecture": "all" - }, - { - "name": "node-aproba", - "version": "2.0.0-2", - "architecture": "all" - }, - { - "name": "node-archy", - "version": "1.0.0-4", - "architecture": "all" - }, - { - "name": "node-are-we-there-yet", - "version": "3.0.0+~1.1.0-1", - "architecture": "all" - }, - { - "name": "node-asap", - "version": "2.0.6+~2.0.0-1", - "architecture": "all" - }, - { - "name": "node-balanced-match", - "version": "2.0.0-1", - "architecture": "all" - }, - { - "name": "node-brace-expansion", - "version": "2.0.1-1", - "architecture": "all" - }, - { - "name": "node-builtins", - "version": "4.0.0-1", - "architecture": "all" - }, - { - "name": "node-cacache", - "version": "15.0.5+~cs13.9.21-3", - "architecture": "all" - }, - { - "name": "node-chalk", - "version": "4.1.2-1", - "architecture": "all" - }, - { - "name": "node-chownr", - "version": "2.0.0-1", - "architecture": "all" - }, - { - "name": "node-cli-table", - "version": "0.3.11+~cs0.13.3-1", - "architecture": "all" - }, - { - "name": "node-clone", - "version": "2.1.2-3", - "architecture": "all" - }, - { - "name": "node-color-convert", - "version": "2.0.1-1", - "architecture": "all" - }, - { - "name": "node-color-name", - "version": "1.1.4+~1.1.1-2", - "architecture": "all" - }, - { - "name": "node-colors", - "version": "1.4.0-3", - "architecture": "all" - }, - { - "name": "node-columnify", - "version": "1.5.4+~1.5.1-1", - "architecture": "all" - }, - { - "name": "node-console-control-strings", - "version": "1.1.0-2", - "architecture": "all" - }, - { - "name": "node-copy-concurrently", - "version": "1.0.5-8", - "architecture": "all" - }, - { - "name": "node-core-util-is", - "version": "1.0.3-1", - "architecture": "all" - }, - { - "name": "node-debug", - "version": "4.3.2+~cs4.1.7-1", - "architecture": "all" - }, - { - "name": "node-decompress-response", - "version": "6.0.0-2", - "architecture": "all" - }, - { - "name": "node-defaults", - "version": "1.0.3+~1.0.3-1", - "architecture": "all" - }, - { - "name": "node-delegates", - "version": "1.0.0-3", - "architecture": "all" - }, - { - "name": "node-depd", - "version": "2.0.0-2", - "architecture": "all" - }, - { - "name": "node-encoding", - "version": "0.1.13-2", - "architecture": "all" - }, - { - "name": "node-end-of-stream", - "version": "1.4.4+~1.4.1-1", - "architecture": "all" - }, - { - "name": "node-err-code", - "version": "2.0.3+dfsg-3", - "architecture": "all" - }, - { - "name": "node-escape-string-regexp", - "version": "4.0.0-2", - "architecture": "all" - }, - { - "name": "node-events", - "version": "3.3.0+~3.0.0-2", - "architecture": "all" - }, - { - "name": "node-fancy-log", - "version": "1.3.3+~cs1.3.1-2", - "architecture": "all" - }, - { - "name": "node-fs-write-stream-atomic", - "version": "1.0.10-5", - "architecture": "all" - }, - { - "name": "node-fs.realpath", - "version": "1.0.0-2", - "architecture": "all" - }, - { - "name": "node-function-bind", - "version": "1.1.1+repacked+~1.0.3-1", - "architecture": "all" - }, - { - "name": "node-gauge", - "version": "4.0.2-1", - "architecture": "all" - }, - { - "name": "node-get-stream", - "version": "6.0.1-1", - "architecture": "all" - }, - { - "name": "node-glob", - "version": "7.2.1+~cs7.6.15-1", - "architecture": "all" - }, - { - "name": "node-got", - "version": "11.8.3+~cs58.7.37-1", - "architecture": "all" - }, - { - "name": "node-graceful-fs", - "version": "4.2.4+repack-1", - "architecture": "all" - }, - { - "name": "node-gyp", - "version": "8.4.1-1", - "architecture": "all" - }, - { - "name": "node-has-flag", - "version": "4.0.0-2", - "architecture": "all" - }, - { - "name": "node-has-unicode", - "version": "2.0.1-4", - "architecture": "all" - }, - { - "name": "node-hosted-git-info", - "version": "4.0.2-1", - "architecture": "all" - }, - { - "name": "node-https-proxy-agent", - "version": "5.0.0+~cs8.0.0-3", - "architecture": "all" - }, - { - "name": "node-iconv-lite", - "version": "0.6.3-2", - "architecture": "all" - }, - { - "name": "node-iferr", - "version": "1.0.2+~1.0.2-1", - "architecture": "all" - }, - { - "name": "node-imurmurhash", - "version": "0.1.4+dfsg+~0.1.1-1", - "architecture": "all" - }, - { - "name": "node-indent-string", - "version": "4.0.0-2", - "architecture": "all" - }, - { - "name": "node-inflight", - "version": "1.0.6-2", - "architecture": "all" - }, - { - "name": "node-inherits", - "version": "2.0.4-4", - "architecture": "all" - }, - { - "name": "node-ini", - "version": "2.0.1-1", - "architecture": "all" - }, - { - "name": "node-ip", - "version": "1.1.5+~1.1.0-1", - "architecture": "all" - }, - { - "name": "node-ip-regex", - "version": "4.3.0+~4.1.1-1", - "architecture": "all" - }, - { - "name": "node-is-typedarray", - "version": "1.0.0-4", - "architecture": "all" - }, - { - "name": "node-isarray", - "version": "2.0.5-3", - "architecture": "all" - }, - { - "name": "node-isexe", - "version": "2.0.0+~2.0.1-4", - "architecture": "all" - }, - { - "name": "node-json-buffer", - "version": "3.0.1-1", - "architecture": "all" - }, - { - "name": "node-json-parse-better-errors", - "version": "1.0.2+~cs3.3.1-1", - "architecture": "all" - }, - { - "name": "node-jsonparse", - "version": "1.3.1-10", - "architecture": "all" - }, - { - "name": "node-lowercase-keys", - "version": "2.0.0-2", - "architecture": "all" - }, - { - "name": "node-lru-cache", - "version": "6.0.0+~5.1.1-1", - "architecture": "all" - }, - { - "name": "node-mimic-response", - "version": "3.1.0-7", - "architecture": "all" - }, - { - "name": "node-minimatch", - "version": "3.1.1+~3.0.5-1", - "architecture": "all" - }, - { - "name": "node-minipass", - "version": "3.1.6+~cs8.7.18-1", - "architecture": "all" - }, - { - "name": "node-mkdirp", - "version": "1.0.4+~1.0.2-1", - "architecture": "all" - }, - { - "name": "node-move-concurrently", - "version": "1.0.1-4", - "architecture": "all" - }, - { - "name": "node-ms", - "version": "2.1.3+~cs0.7.31-2", - "architecture": "all" - }, - { - "name": "node-mute-stream", - "version": "0.0.8+~0.0.1-1", - "architecture": "all" - }, - { - "name": "node-negotiator", - "version": "0.6.2+~0.6.1-1", - "architecture": "all" - }, - { - "name": "node-nopt", - "version": "5.0.0-2", - "architecture": "all" - }, - { - "name": "node-normalize-package-data", - "version": "3.0.3+~2.4.1-1", - "architecture": "all" - }, - { - "name": "node-npm-bundled", - "version": "1.1.2-1", - "architecture": "all" - }, - { - "name": "node-npm-package-arg", - "version": "8.1.5-1", - "architecture": "all" - }, - { - "name": "node-npmlog", - "version": "6.0.1+~4.1.4-1", - "architecture": "all" - }, - { - "name": "node-object-assign", - "version": "4.1.1-6", - "architecture": "all" - }, - { - "name": "node-once", - "version": "1.4.0-4", - "architecture": "all" - }, - { - "name": "node-osenv", - "version": "0.1.5+~0.1.0-1", - "architecture": "all" - }, - { - "name": "node-p-cancelable", - "version": "2.1.1-1", - "architecture": "all" - }, - { - "name": "node-p-map", - "version": "4.0.0+~3.1.0+~3.0.1-1", - "architecture": "all" - }, - { - "name": "node-path-is-absolute", - "version": "2.0.0-2", - "architecture": "all" - }, - { - "name": "node-process-nextick-args", - "version": "2.0.1-2", - "architecture": "all" - }, - { - "name": "node-promise-inflight", - "version": "1.0.1+~1.0.0-1", - "architecture": "all" - }, - { - "name": "node-promise-retry", - "version": "2.0.1-2", - "architecture": "all" - }, - { - "name": "node-promzard", - "version": "0.3.0-2", - "architecture": "all" - }, - { - "name": "node-pump", - "version": "3.0.0-5", - "architecture": "all" - }, - { - "name": "node-quick-lru", - "version": "5.1.1-1", - "architecture": "all" - }, - { - "name": "node-read", - "version": "1.0.7-3", - "architecture": "all" - }, - { - "name": "node-read-package-json", - "version": "4.1.1-1", - "architecture": "all" - }, - { - "name": "node-readable-stream", - "version": "3.6.0+~cs3.0.0-1", - "architecture": "all" - }, - { - "name": "node-resolve", - "version": "1.20.0+~cs5.27.9-1", - "architecture": "all" - }, - { - "name": "node-retry", - "version": "0.13.1+~0.12.1-1", - "architecture": "all" - }, - { - "name": "node-rimraf", - "version": "3.0.2-1", - "architecture": "all" - }, - { - "name": "node-run-queue", - "version": "2.0.0-2", - "architecture": "all" - }, - { - "name": "node-safe-buffer", - "version": "5.2.1+~cs2.1.2-2", - "architecture": "all" - }, - { - "name": "node-semver", - "version": "7.3.5+~7.3.8-1", - "architecture": "all" - }, - { - "name": "node-set-blocking", - "version": "2.0.0-2", - "architecture": "all" - }, - { - "name": "node-signal-exit", - "version": "3.0.6+~3.0.1-1", - "architecture": "all" - }, - { - "name": "node-slash", - "version": "3.0.0-2", - "architecture": "all" - }, - { - "name": "node-slice-ansi", - "version": "5.0.0+~cs9.0.0-4", - "architecture": "all" - }, - { - "name": "node-spdx-correct", - "version": "3.1.1-2", - "architecture": "all" - }, - { - "name": "node-spdx-exceptions", - "version": "2.3.0-2", - "architecture": "all" - }, - { - "name": "node-spdx-expression-parse", - "version": "3.0.1+~3.0.1-1", - "architecture": "all" - }, - { - "name": "node-spdx-license-ids", - "version": "3.0.11-1", - "architecture": "all" - }, - { - "name": "node-ssri", - "version": "8.0.1-2", - "architecture": "all" - }, - { - "name": "node-string-decoder", - "version": "1.3.0-5", - "architecture": "all" - }, - { - "name": "node-string-width", - "version": "4.2.3+~cs13.2.3-1", - "architecture": "all" - }, - { - "name": "node-strip-ansi", - "version": "6.0.1-1", - "architecture": "all" - }, - { - "name": "node-supports-color", - "version": "8.1.1+~8.1.1-1", - "architecture": "all" - }, - { - "name": "node-tar", - "version": "6.1.11+ds1+~cs6.0.6-1", - "architecture": "all" - }, - { - "name": "node-text-table", - "version": "0.2.0-4", - "architecture": "all" - }, - { - "name": "node-time-stamp", - "version": "2.2.0-1", - "architecture": "all" - }, - { - "name": "node-typedarray-to-buffer", - "version": "4.0.0-2", - "architecture": "all" - }, - { - "name": "node-unique-filename", - "version": "1.1.1+ds-1", - "architecture": "all" - }, - { - "name": "node-util-deprecate", - "version": "1.0.2-3", - "architecture": "all" - }, - { - "name": "node-validate-npm-package-license", - "version": "3.0.4-2", - "architecture": "all" - }, - { - "name": "node-validate-npm-package-name", - "version": "3.0.0-4", - "architecture": "all" - }, - { - "name": "node-wcwidth.js", - "version": "1.0.2-1", - "architecture": "all" - }, - { - "name": "node-whatwg-fetch", - "version": "3.6.2-5", - "architecture": "all" - }, - { - "name": "node-which", - "version": "2.0.2+~cs1.3.2-2", - "architecture": "all" - }, - { - "name": "node-wide-align", - "version": "1.1.3-4", - "architecture": "all" - }, - { - "name": "node-wrappy", - "version": "1.0.2-2", - "architecture": "all" - }, - { - "name": "node-write-file-atomic", - "version": "3.0.3+~3.0.2-1", - "architecture": "all" - }, - { - "name": "node-yallist", - "version": "4.0.0+~4.0.1-1", - "architecture": "all" - }, - { - "name": "nodejs", - "version": "12.22.9~dfsg-1ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "npm", - "version": "8.5.1~ds-1", - "architecture": "all" - }, - { - "name": "ocl-icd-libopencl1", - "version": "2.2.14-3", - "architecture": "amd64" - }, - { - "name": "openmpi-bin", - "version": "4.1.2-2ubuntu1", - "architecture": "amd64" - }, - { - "name": "openmpi-common", - "version": "4.1.2-2ubuntu1", - "architecture": "all" - }, - { - "name": "openssh-client", - "version": "1:8.9p1-3ubuntu0.17", - "architecture": "amd64" - }, - { - "name": "openssl", - "version": "3.0.2-0ubuntu1.30", - "architecture": "amd64" - }, - { - "name": "passwd", - "version": "1:4.8.1-2ubuntu2.2", - "architecture": "amd64" - }, - { - "name": "patch", - "version": "2.7.6-7build2", - "architecture": "amd64" - }, - { - "name": "perl", - "version": "5.34.0-3ubuntu1.9", - "architecture": "amd64" - }, - { - "name": "perl-base", - "version": "5.34.0-3ubuntu1.9", - "architecture": "amd64" - }, - { - "name": "perl-modules-5.34", - "version": "5.34.0-3ubuntu1.9", - "architecture": "all" - }, - { - "name": "pkg-config", - "version": "0.29.2-1ubuntu3", - "architecture": "amd64" - }, - { - "name": "postfix", - "version": "3.6.4-1ubuntu1.4", - "architecture": "amd64" - }, - { - "name": "postgresql-client", - "version": "14+238", - "architecture": "all" - }, - { - "name": "postgresql-client-14", - "version": "14.24-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "postgresql-client-common", - "version": "238", - "architecture": "all" - }, - { - "name": "procps", - "version": "2:3.3.17-6ubuntu2.1", - "architecture": "amd64" - }, - { - "name": "python3", - "version": "3.10.6-1~22.04.1", - "architecture": "amd64" - }, - { - "name": "python3-distutils", - "version": "3.10.8-1~22.04", - "architecture": "all" - }, - { - "name": "python3-lib2to3", - "version": "3.10.8-1~22.04", - "architecture": "all" - }, - { - "name": "python3-minimal", - "version": "3.10.6-1~22.04.1", - "architecture": "amd64" - }, - { - "name": "python3-pip", - "version": "22.0.2+dfsg-1ubuntu0.7", - "architecture": "all" - }, - { - "name": "python3-pip-whl", - "version": "22.0.2+dfsg-1ubuntu0.7", - "architecture": "all" - }, - { - "name": "python3-pkg-resources", - "version": "59.6.0-1.2ubuntu0.22.04.3", - "architecture": "all" - }, - { - "name": "python3-setuptools", - "version": "59.6.0-1.2ubuntu0.22.04.3", - "architecture": "all" - }, - { - "name": "python3-setuptools-whl", - "version": "59.6.0-1.2ubuntu0.22.04.3", - "architecture": "all" - }, - { - "name": "python3-venv", - "version": "3.10.6-1~22.04.1", - "architecture": "amd64" - }, - { - "name": "python3-wheel", - "version": "0.37.1-2ubuntu0.22.04.1", - "architecture": "all" - }, - { - "name": "python3.10", - "version": "3.10.12-1~22.04.18", - "architecture": "amd64" - }, - { - "name": "python3.10-minimal", - "version": "3.10.12-1~22.04.18", - "architecture": "amd64" - }, - { - "name": "python3.10-venv", - "version": "3.10.12-1~22.04.18", - "architecture": "amd64" - }, - { - "name": "readline-common", - "version": "8.1.2-1", - "architecture": "all" - }, - { - "name": "redis-server", - "version": "5:6.0.16-1ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "redis-tools", - "version": "5:6.0.16-1ubuntu1.2", - "architecture": "amd64" - }, - { - "name": "rpcsvc-proto", - "version": "1.4.2-0ubuntu6", - "architecture": "amd64" - }, - { - "name": "rustc", - "version": "1.75.0+dfsg0ubuntu1~bpo0-0ubuntu0.22.04.1", - "architecture": "amd64" - }, - { - "name": "sed", - "version": "4.8-1ubuntu2.1", - "architecture": "amd64" - }, - { - "name": "sensible-utils", - "version": "0.0.17", - "architecture": "all" - }, - { - "name": "shared-mime-info", - "version": "2.1-2", - "architecture": "amd64" - }, - { - "name": "socat", - "version": "1.7.4.1-3ubuntu4", - "architecture": "amd64" - }, - { - "name": "sqlite3", - "version": "3.37.2-2ubuntu0.8", - "architecture": "amd64" - }, - { - "name": "ssl-cert", - "version": "1.1.2", - "architecture": "all" - }, - { - "name": "sudo", - "version": "1.9.9-1ubuntu2.7", - "architecture": "amd64" - }, - { - "name": "sysvinit-utils", - "version": "3.01-1ubuntu1", - "architecture": "amd64" - }, - { - "name": "tar", - "version": "1.34+dfsg-1ubuntu0.1.22.04.6", - "architecture": "amd64" - }, - { - "name": "tcl-expect", - "version": "5.45.4-2build1", - "architecture": "amd64" - }, - { - "name": "tcl8.6", - "version": "8.6.12+dfsg-1build1", - "architecture": "amd64" - }, - { - "name": "tesseract-ocr", - "version": "4.1.1-2.1build1", - "architecture": "amd64" - }, - { - "name": "tesseract-ocr-eng", - "version": "1:4.00~git30-7274cfa-1.1", - "architecture": "all" - }, - { - "name": "tesseract-ocr-osd", - "version": "1:4.00~git30-7274cfa-1.1", - "architecture": "all" - }, - { - "name": "tzdata", - "version": "2026c-0ubuntu0.22.04.1", - "architecture": "all" - }, - { - "name": "ubuntu-keyring", - "version": "2021.03.26", - "architecture": "all" - }, - { - "name": "ucf", - "version": "3.0043", - "architecture": "all" - }, - { - "name": "unzip", - "version": "6.0-26ubuntu3.2", - "architecture": "amd64" - }, - { - "name": "upx-ucl", - "version": "3.96-3", - "architecture": "amd64" - }, - { - "name": "usrmerge", - "version": "25ubuntu2", - "architecture": "all" - }, - { - "name": "util-linux", - "version": "2.37.2-4ubuntu3.6", - "architecture": "amd64" - }, - { - "name": "valgrind", - "version": "1:3.18.1-1ubuntu2", - "architecture": "amd64" - }, - { - "name": "wget", - "version": "1.21.2-2ubuntu1.5", - "architecture": "amd64" - }, - { - "name": "x11-common", - "version": "1:7.7+23ubuntu2", - "architecture": "all" - }, - { - "name": "xkb-data", - "version": "2.33-1", - "architecture": "all" - }, - { - "name": "xxd", - "version": "2:8.2.3995-1ubuntu2.36", - "architecture": "amd64" - }, - { - "name": "xz-utils", - "version": "5.2.5-2ubuntu1.1", - "architecture": "amd64" - }, - { - "name": "zip", - "version": "3.0-12build2", - "architecture": "amd64" - }, - { - "name": "zlib1g", - "version": "1:1.2.11.dfsg-2ubuntu9.2", - "architecture": "amd64" - }, - { - "name": "zlib1g-dev", - "version": "1:1.2.11.dfsg-2ubuntu9.2", - "architecture": "amd64" - } - ] - }, - "python_packages": [ - { - "name": "pip", - "version": "26.2.1", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/pip-26.2.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages", - "metadata_sha256": "3a561005822841f2c45f442f6c7a7505172c8c376c9fe274d876c8ac912968cb" - }, - { - "name": "setuptools", - "version": "84.0.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools-84.0.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages", - "metadata_sha256": "3ef2975718dd31cabdd5829455e9b868ca14dbf79ed8fed2de0af4e87347006e" - }, - { - "name": "autocommand", - "version": "2.2.2", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "3800d9b91dceea2065a6ed6279383362e97ac38b8e56b9343f404ee531860099" - }, - { - "name": "backports.tarfile", - "version": "1.2.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "8215c54ead77d9dc5a108a25c6bdc72b5999aa6f62c9499a440359412afa5a51" - }, - { - "name": "importlib_metadata", - "version": "8.7.1", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "a3e38b9ee4326289d4864704f30e299ee769e2309ce9f4a75f0de1a50ad0a356" - }, - { - "name": "jaraco.context", - "version": "6.1.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/jaraco_context-6.1.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "0435ebfc52055c5a9974ed20c171b6454383eaf9dbb1508814ba7ad97c59d712" - }, - { - "name": "jaraco.functools", - "version": "4.4.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/jaraco_functools-4.4.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "2e79da8dc3469924abe3ac8b22a3feb5692a79bf9f47bbc86b6535d618641849" - }, - { - "name": "jaraco.text", - "version": "4.0.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/jaraco.text-4.0.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "5c2fd09012c954f139b10624978d5335a654c34014cd06f6f466ca683dbc9c56" - }, - { - "name": "more-itertools", - "version": "10.8.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/more_itertools-10.8.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "6ab3515145abe58b067f087c867631cf4cf5d653fed81b9642ee12086c3904b8" - }, - { - "name": "packaging", - "version": "26.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/packaging-26.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "3362bb7d6a26da2962ba8daaa4785cd0bacac21aba908a1195cc8f59580a265a" - }, - { - "name": "platformdirs", - "version": "4.4.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/platformdirs-4.4.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "bbc5216d5f4c77bfbc57227264d52e66bccde71ccf79e75e1a6046d029d30223" - }, - { - "name": "tomli", - "version": "2.4.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/tomli-2.4.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "f5ac0a1f8fba908b4646cd655309e91aad969b6787616ac571ca462a3832ffce" - }, - { - "name": "wheel", - "version": "0.46.3", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/wheel-0.46.3.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "22910aa97ca89cbcc20a019e27fe31360b7929a4bd66ca0d310f99a44f6ccd35" - }, - { - "name": "zipp", - "version": "3.23.0", - "metadata_path": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor/zipp-3.23.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-python/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "bdd67d4d16cf0bf3b893e7d18cd3d2d774adb82f37ed985bc7770c607226b35b" - }, - { - "name": "aiofile", - "version": "3.12.3", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/aiofile-3.12.3.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "faaa3115c495ac1989aa6bda262b79a6c97e056c83e04afcfc71584a59e3ceb1" - }, - { - "name": "annotated-doc", - "version": "0.0.5", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/annotated_doc-0.0.5.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "8c24d70c5d9153d22123353a906042fd7603df2d15c2196290b0f8a962558c46" - }, - { - "name": "annotated-types", - "version": "0.8.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/annotated_types-0.8.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "614985b278f601b8ef863f82783b991cc3ada4b89f592eb71c7c48c5f2ef2298" - }, - { - "name": "anyio", - "version": "4.15.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/anyio-4.15.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "043aecb571af7189e8a6c528f5d8e32545f1b2cdfaaf761d51e6d5b67ea3ca81" - }, - { - "name": "attrs", - "version": "26.1.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/attrs-26.1.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "4cd40e690f23bf37cbcad34efd6758e062df1df07c86833f7e3ce95bf1fa38cc" - }, - { - "name": "Authlib", - "version": "1.8.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/authlib-1.8.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "cbe29efb9693e344288f0039d52650b3013a8d059da203839b57a3ee3e600253" - }, - { - "name": "backports.tarfile", - "version": "1.2.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/backports.tarfile-1.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "8215c54ead77d9dc5a108a25c6bdc72b5999aa6f62c9499a440359412afa5a51" - }, - { - "name": "beartype", - "version": "0.23.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/beartype-0.23.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "aebbf3622fcb9925ee3adccf588833742c34ba08d8ce6eda1b781a55619de57e" - }, - { - "name": "brotli", - "version": "1.2.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/brotli-1.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "f9d12d5184b5090b146b2e5f0d62931521b2b1435ea466433a239bb7c41fc962" - }, - { - "name": "cachetools", - "version": "7.2.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/cachetools-7.2.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "fe9b6190d89bc7715f1526e89f37d307b7c485bf4134043f76e464c216614a81" - }, - { - "name": "caio", - "version": "0.12.9", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/caio-0.12.9.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "705a75fcc747b2b3d886018a20311f91690238e62a9a9cb6f227ceaef25a3942" - }, - { - "name": "certifi", - "version": "2026.7.22", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/certifi-2026.7.22.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "ef5af1638fbb23676ac3c5777dfcfc2cd9c348fe4172ed5ba3d277655b248090" - }, - { - "name": "cffi", - "version": "2.1.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/cffi-2.1.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "558bafb9093a8e790175d9ecff9688382981d744877dad86fd6770db0f4dc918" - }, - { - "name": "charset-normalizer", - "version": "3.5.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/charset_normalizer-3.5.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "89ce6362bb7be88558f4be99a98f5d1b4da93d19cd0323e5ee0bac05cf883dfb" - }, - { - "name": "click", - "version": "8.5.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/click-8.5.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "e87bce0bd194de70dfb8e708e0a6b0483009f25611804eaf87bfeb63e6c20501" - }, - { - "name": "cryptography", - "version": "50.0.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/cryptography-50.0.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "047cfc71226409de4318b360aef15c63a2adf609731e3dcf7fe932f14ea042ee" - }, - { - "name": "cyclopts", - "version": "5.2.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/cyclopts-5.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "a1bcd1e587744ec6f5c5c64126ac03a03fc2468f7c91cd1c44572a5ac11dcb2a" - }, - { - "name": "dnspython", - "version": "2.9.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/dnspython-2.9.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "d25dbd09b39758cd5cebe518701012a6278731986cd384fc4a7f25e78f7de929" - }, - { - "name": "docstring_parser", - "version": "0.18.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/docstring_parser-0.18.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "cbc42027997fd4b194ae5fd064a4d1e57b92976941d0c26d369561a7c016a333" - }, - { - "name": "email-validator", - "version": "2.3.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/email_validator-2.3.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "2a97b81eefcd856bc80b0346f47fa2d800b9a438bf8f9231ae00fe931d5c9fbc" - }, - { - "name": "exceptiongroup", - "version": "1.3.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/exceptiongroup-1.3.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "81984a523a2f7a522ad12bea784a8bb85edec0805ebbd0fb4e350169a36dd802" - }, - { - "name": "fastapi", - "version": "0.143.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/fastapi-0.143.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "1bfa2ecf35ea529d68e56c195c5a4cee7864335d24bcc4a76cf40d7a71edc6e9" - }, - { - "name": "fastmcp", - "version": "3.4.8", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/fastmcp-3.4.8.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "12403b8d5b096f127eeafa743581daac19c2082eb4fb07e7a80afb225f67140f" - }, - { - "name": "fastmcp-slim", - "version": "3.4.8", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/fastmcp_slim-3.4.8.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "46d5a8316d3f1f17f507dcb89610f4b7bb46a2cc87f939a4c5b3693c09e71905" - }, - { - "name": "filelock", - "version": "4.1.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/filelock-4.1.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "f494bfbd4ce00128759bc0ff21e7b5cad77a6397902f53a5d0f4398292b6979f" - }, - { - "name": "fsspec", - "version": "2026.9.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/fsspec-2026.9.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "68f5a262767510638e9b1933b1493f2baadc9616fe1e696f62aedd59c8c0a37c" - }, - { - "name": "gradio", - "version": "6.30.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/gradio-6.30.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "a16c7d211a8564297ab299a661d72aabfd33d11cc317ac656461602f8a3e2933" - }, - { - "name": "gradio_client", - "version": "2.7.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/gradio_client-2.7.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "c379185aa00cd6e8b762e23dededf8e4f9c85853ae715ef29112323b551a6c31" - }, - { - "name": "griffelib", - "version": "2.3.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/griffelib-2.3.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "fd24a68ed08309718d5759b8de3b90392b5804240d94834e6455be110ead34b3" - }, - { - "name": "groovy", - "version": "0.1.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/groovy-0.1.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "4e9483c0c0f3c969f94e12c4484521260387742132520c23d7c8d19e20a99534" - }, - { - "name": "h11", - "version": "0.16.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/h11-0.16.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "28f326098ac09fcba79b8f180f96087c841fe2456215cb7b872a9c7d5cd19d64" - }, - { - "name": "hf-gradio", - "version": "0.4.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/hf_gradio-0.4.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "f3ae073ca654ea4a983162903f615d27c3c8880110a627f72097835950dd8263" - }, - { - "name": "hf-xet", - "version": "1.7.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/hf_xet-1.7.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "05975b1239f188bb418539f178ef68a693ea6824f20c30583a02eea94faf650a" - }, - { - "name": "httpcore", - "version": "1.0.9", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/httpcore-1.0.9.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "fe2d4fda6199128978779e0cf27f3c045c531863fcdd987eacc74f3a18d41c21" - }, - { - "name": "httpcore2", - "version": "2.13.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/httpcore2-2.13.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "37a0ea0674e98b7c3a1f99c17d9bb5457de27a0f93c8b6560c9d17d525139abb" - }, - { - "name": "httpx", - "version": "0.28.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/httpx-0.28.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "febb9b0f8f3e80d57c8199c304f35c4336e8581d1d18d7983c92766b82793b25" - }, - { - "name": "httpx-sse", - "version": "0.4.3", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/httpx_sse-0.4.3.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "d4c6d804ee5ac46e9b3b6595c27ab8ae2ba7cfb5f692c78b16ff463e4bd1a81e" - }, - { - "name": "httpx2", - "version": "2.13.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/httpx2-2.13.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "b75b03a003b5593e000907cf7239fcc3f688b8f17db4ecff883d11221ea988fc" - }, - { - "name": "huggingface_hub", - "version": "2.2.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/huggingface_hub-2.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "fec7fc2879fa91b7cbf7a21b1434087215d62869b2bc69fb59654c328d9a3d14" - }, - { - "name": "idna", - "version": "3.20", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/idna-3.20.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "dbd8c14c1e4ca1e0c9824a6dbc7cbbf78884f38eb52d91148cd3025f671e4b85" - }, - { - "name": "importlib_metadata", - "version": "9.0.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/importlib_metadata-9.0.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "1a90ba399de022d3528ad996c7a8593422207ccb13d27f062ad005f509e11500" - }, - { - "name": "jaraco.classes", - "version": "3.4.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jaraco.classes-3.4.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "2e6b102232edd45ae1bb8a6b4091fd40cf3201a6bb6fd4bc97c5e8cd765a44b8" - }, - { - "name": "jaraco.context", - "version": "6.1.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jaraco_context-6.1.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "f1b65b60aea229af54e09b17ae0036cf048fe4a6161fa2e7966a8ea5c2321491" - }, - { - "name": "jaraco.functools", - "version": "4.6.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jaraco_functools-4.6.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "6ed3cae5b8eef084c3c7b2385a0a8ac4c8155ab7c729212bea099bee69d5bd6c" - }, - { - "name": "jeepney", - "version": "0.9.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jeepney-0.9.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "b8e6c353e9aaed0ed0144029556417fda23b64f344e718331907054ba05b8c62" - }, - { - "name": "Jinja2", - "version": "3.1.6", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jinja2-3.1.6.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "68c5548fb67c4132a13898d9b31ec50c6bea2abdd915d921f214355c3a6499c8" - }, - { - "name": "jiter", - "version": "0.17.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jiter-0.17.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "738fc5b25c7cbaf81392886a95661322888c5691205b57a0975a1da1f62e3ea7" - }, - { - "name": "joserfc", - "version": "1.7.5", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/joserfc-1.7.5.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "17df62bbdc7212bbcda3144e72720a62fc34bbf76c573062939120738545250f" - }, - { - "name": "jsonref", - "version": "1.1.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jsonref-1.1.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "f98db3890394fba23912faab86ad8f70ed564fc8c885298b636b270f28453e43" - }, - { - "name": "jsonschema", - "version": "4.26.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jsonschema-4.26.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "05b189866ca98a96da3934bf6b83687ced3ff85325273b77e16b705f6d8b26d2" - }, - { - "name": "jsonschema-path", - "version": "0.5.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jsonschema_path-0.5.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "cd7e9a4426436980f099d826dbce8f61afa6603b496385fba9a9eb0ad59cdd48" - }, - { - "name": "jsonschema-specifications", - "version": "2025.9.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/jsonschema_specifications-2025.9.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "35abd41757f32b4ea24756920ded47b70173d77cbc052a5a6d3ab583b2e8d89d" - }, - { - "name": "keyring", - "version": "25.7.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/keyring-25.7.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "bd54de98fede6dc3e1f3cd89b4e37c95d8842a523bdbb9e52ab40edff1837163" - }, - { - "name": "markdown-it-py", - "version": "4.2.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/markdown_it_py-4.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "72c36ff516755443b1ecb61e17b2567a990230b49a504b0eb0c42d5f82448a9c" - }, - { - "name": "MarkupSafe", - "version": "3.0.4", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/markupsafe-3.0.4.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "66767d76388ece15d49d50dafb655891ef5d868715e7128e7f7d737a70b353c4" - }, - { - "name": "mcp", - "version": "1.30.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/mcp-1.30.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "3880c29896149862971af57942e3e5c0ad2a909696a66b9811c62f6e47e65111" - }, - { - "name": "mdurl", - "version": "0.1.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/mdurl-0.1.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "b53b29d48f499367053fda3c81e7ce27d2558380ebbf83e66023b02eb7ddd25d" - }, - { - "name": "more-itertools", - "version": "11.1.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/more_itertools-11.1.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "15588fd819d6d7f9d0ddc7b5283502d3512c5d1edadce573b78c1f0734055df0" - }, - { - "name": "numpy", - "version": "2.4.6", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/numpy-2.4.6.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "b082c52ccbe3b880bae177c35171b52ed6c947f3ad71e3762f2723f60a411de0" - }, - { - "name": "openai", - "version": "3.28.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/openai-3.28.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "2ccf7558861abb71955b3aabe0c62f8502fe9f3214da9889bcf0274d0eb6ec43" - }, - { - "name": "openapi-pydantic", - "version": "0.6.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/openapi_pydantic-0.6.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "e46a181161c62fa24d7d3d0ff2eaabea3a7b580ad7aa9f70d1f08bd129d46f49" - }, - { - "name": "openenv", - "version": "0.6.1.dev0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/openenv-0.6.1.dev0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "0922465a7ecb0740ea84e46fb45aa53080a203a86872d06810d42190c645a5dd" - }, - { - "name": "opentelemetry-api", - "version": "1.45.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/opentelemetry_api-1.45.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "5bc71e90cb421be92a43bf5ad5b0f25dccfa2a24ddceaa2877779879962a4c9e" - }, - { - "name": "orjson", - "version": "3.13.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/orjson-3.13.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "4b64a33cb3c47299ae9afe9919c67fb5159e89d086857a4fe74c727044c98612" - }, - { - "name": "packaging", - "version": "26.3", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/packaging-26.3.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "70fdb89fc4d4a9a043bf7372b8972bcc883fddff34ab55e9cf80d73875384763" - }, - { - "name": "pandas", - "version": "3.0.6", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pandas-3.0.6.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "c2e8c472e1f49c30b7b00dc1cde8b8ed384b1b6d85b4d5ffe163e800e71dbc61" - }, - { - "name": "pathable", - "version": "0.6.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pathable-0.6.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "c418727931012c2306cb8fa2726d044616c3178c1fc078ce182385dcf2b59922" - }, - { - "name": "pillow", - "version": "12.3.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pillow-12.3.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "8fc07146cab33ef7582361dab6eac596d340b03ec648f18217da7894f73838c8" - }, - { - "name": "pip", - "version": "24.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pip-24.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "90d11f277fd5868da679ee257c97656dde511c8aac7d025231407e6ce90839e2" - }, - { - "name": "platformdirs", - "version": "4.12.4", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/platformdirs-4.12.4.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "2418b715af2d19c99d62ebf721c2e02075f20479ac9c0557a06e119fdbe14a3f" - }, - { - "name": "py-key-value-aio", - "version": "0.4.6", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/py_key_value_aio-0.4.6.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "0c1af357b841bc3862e39543faa863346c487be9f2e2ffefba009e957a256bee" - }, - { - "name": "pycparser", - "version": "3.11", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pycparser-3.11.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "e3a74c846648bb55f4f907284b745e2003b87b96d9c9d17a8a50cf37804541c9" - }, - { - "name": "pydantic", - "version": "2.14.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pydantic-2.14.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "11c8967cbcd622677943be38b48a3931cc524250acd9d8c7a6386408099c4cf9" - }, - { - "name": "pydantic-settings", - "version": "2.15.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pydantic_settings-2.15.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "5ac12e408df62f1d4c7643146d9df04ace749f1fe5cf28b3b794be0b2834ca6d" - }, - { - "name": "pydantic_core", - "version": "2.50.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pydantic_core-2.50.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "d7f01d1f3be82b075af78fe6152a69edbb7708e4c56118b7c937641283516cbf" - }, - { - "name": "pydub", - "version": "0.25.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pydub-0.25.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "7f433cfd956d6e2628508f5e8d721e274dc9a3d03935b8bed15d5b56ab398989" - }, - { - "name": "Pygments", - "version": "2.21.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pygments-2.21.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "1dde075570136774c706bf0009183a793fe0ee262e4a5590cc6eff8453eedd43" - }, - { - "name": "PyJWT", - "version": "2.15.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pyjwt-2.15.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "1ea0c9f139b8c928276b3628af165955f6f764491448a6ad8f103cdcbb382da3" - }, - { - "name": "pyperclip", - "version": "1.11.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pyperclip-1.11.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "2493839e0751761f27d39aa6d5c5dfd1df839c45da8f328aba4ae4102868b825" - }, - { - "name": "python-dateutil", - "version": "2.9.0.post0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "a9d436da322be808332f98d88325998e87cb693a678a9969feb4cfad729a6e93" - }, - { - "name": "python-dotenv", - "version": "1.2.4", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/python_dotenv-1.2.4.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "87cfee6042412d48df1100ea7822684988c3f2b79de7a250f4717f4df3026d6f" - }, - { - "name": "python-multipart", - "version": "0.0.32", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/python_multipart-0.0.32.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "e9d399d7dea5eddf0e4d24b5c24687a82e7e50bf2c2b30f8f8a06a64d887dd86" - }, - { - "name": "pytz", - "version": "2026.5", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pytz-2026.5.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "4d20d16f6004b1d7f9b01a96f4d3eb462c0c2a8413d9aa878effe50a21535929" - }, - { - "name": "PyYAML", - "version": "6.0.3", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/pyyaml-6.0.3.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "03c3b415ed38d09faedc49360e930769b40c58f68585e6de00e2e4916a858d34" - }, - { - "name": "referencing", - "version": "0.37.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/referencing-0.37.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "c93b00e6ab1524fd60848376604c189a114374776475c25a31d57be47b29de6a" - }, - { - "name": "requests", - "version": "2.34.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/requests-2.34.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "8c384ba3e979480faae2859d3c5e6c1276dd2c3616e322e124d52c8cfc556f27" - }, - { - "name": "rich", - "version": "15.0.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/rich-15.0.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "fad34fc603fac4481bf81f8dd629492fc302c0ec31909c86644751512afb2e3b" - }, - { - "name": "rich-rst", - "version": "2.2.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/rich_rst-2.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "2cd1f39149e69bd94c4f1c30cb26c763e45689e6d6527b4c23afa1112c48f165" - }, - { - "name": "rpds-py", - "version": "2026.9.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/rpds_py-2026.9.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "5d72dca2e387c8d2b4180b68ee87c15b64751e059100a6db58891ec9995445c3" - }, - { - "name": "safehttpx", - "version": "0.1.7", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/safehttpx-0.1.7.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "5be3880c8660a8d390e6ed5c22360612f338d05cb25020e2f6ca1218a7e4f449" - }, - { - "name": "SecretStorage", - "version": "3.5.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/secretstorage-3.5.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "b98e3dc42ff7e9b1bacce60dac2662cd9965fad6e4469fc9483c9eb99998c367" - }, - { - "name": "semantic-version", - "version": "2.10.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/semantic_version-2.10.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "7414d469a569046b6a246bfb1f105aab1b7abfdc32a95253f15432ea30159aa6" - }, - { - "name": "setuptools", - "version": "79.0.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools-79.0.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "d3152caeb1486d143b30b1d41fffaaddb7ea95fdc9547ae1135ce697b1a420b5" - }, - { - "name": "shellingham", - "version": "1.5.4", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/shellingham-1.5.4.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "183d80220a37493262795739dd357cc5bb3f49bd390cc9198d5180e5451a07fa" - }, - { - "name": "six", - "version": "1.17.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/six-1.17.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "562042078c2752549f6d8a7c86dbc5dd708088a7be6d80672ec7b07100b72468" - }, - { - "name": "sniffio", - "version": "1.3.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/sniffio-1.3.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "0b318b57098edeccf585e60a889a6b6a7b5c4086f3a9aa62eff76a1d3cee12d9" - }, - { - "name": "sse-starlette", - "version": "3.5.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/sse_starlette-3.5.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "6dc401682bdae1a3e1f31b1c320b7f926c354643993840393875ebfc171c9014" - }, - { - "name": "starlette", - "version": "1.7.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/starlette-1.7.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "f7870fc19ab7c2e364887057340b9fb47e9bda74d24b06c58ca399494abfe019" - }, - { - "name": "tomli", - "version": "2.5.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/tomli-2.5.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "0d7d3b46cb99dac60216978cebca446f9ec3a21fd3e1f9650086a2e373654e27" - }, - { - "name": "tomli_w", - "version": "1.2.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/tomli_w-1.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "66e81ac2e41775b5ebddcfbb9f4ae77158e4c5739fd52d231e14f2fffda9c8de" - }, - { - "name": "tomlkit", - "version": "0.14.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/tomlkit-0.14.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "2404b6a8b042bad3dbd0e0d5c0009fffc351fc718cf77bc1d908b4ead77565b9" - }, - { - "name": "tqdm", - "version": "4.70.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/tqdm-4.70.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "a5da70b966afea3a759716041bad7187f2ece02c22348cf9e7c0a512bbf15f57" - }, - { - "name": "truststore", - "version": "0.10.4", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/truststore-0.10.4.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "509a7b67bff99f2d04f57251b5bdb761bd9429467e1cebc453b7f96be4108f5b" - }, - { - "name": "typer", - "version": "0.27.3", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/typer-0.27.3.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "fc2cbb86c4fd175326b63427e9a3fa13e79364d7333a945414d9c6ac80c0f0e4" - }, - { - "name": "typing-inspection", - "version": "0.4.4", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/typing_inspection-0.4.4.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "bad3d9e6342ef6750cf5128ec942327b8bebdce0b6e4d6f67cb15b27ae5118da" - }, - { - "name": "typing_extensions", - "version": "4.16.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/typing_extensions-4.16.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "b05084ca1d50879865178d9fff9fabeab61bdfb1f361bfbde95421ffc8f9be46" - }, - { - "name": "uncalled-for", - "version": "0.4.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/uncalled_for-0.4.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "45a21666ddfa8ca8d4e2423c05edaeaa7827686a3ae4fed82b24427854745c2f" - }, - { - "name": "urllib3", - "version": "2.8.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/urllib3-2.8.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "10898c620e8007c030e07fa5622b68358a43010025dfbd78a1cb797699de2bb4" - }, - { - "name": "uvicorn", - "version": "0.54.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/uvicorn-0.54.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "9399e5ddda3d26e842d6fb5420c38b0857aac568d53badbdc224b3a21339efa8" - }, - { - "name": "watchfiles", - "version": "1.3.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/watchfiles-1.3.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "1fba87d08d66f10f7515e4817abd4ac7f27abf3300cb33b7ad3f79762987a502" - }, - { - "name": "websockets", - "version": "17.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/websockets-17.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "0d5f1279d095e7ba84ef21614af0822dc500ccb2e51b7c3a19eda7159b2dade4" - }, - { - "name": "zipp", - "version": "4.1.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/zipp-4.1.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages", - "metadata_sha256": "3080f93de17d4bd784cd33afc0933db91c28cbec1cb444e1ffdfec5c7e0f5d90" - }, - { - "name": "autocommand", - "version": "2.2.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "3800d9b91dceea2065a6ed6279383362e97ac38b8e56b9343f404ee531860099" - }, - { - "name": "backports.tarfile", - "version": "1.2.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "8215c54ead77d9dc5a108a25c6bdc72b5999aa6f62c9499a440359412afa5a51" - }, - { - "name": "importlib_metadata", - "version": "8.0.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata-8.0.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "6a7b90effee1e09d5b484cdf7232016a43e2d9cc9543bcbb8e494b1ec05e1f59" - }, - { - "name": "inflect", - "version": "7.3.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/inflect-7.3.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "66030d634580651b3e53cc19895d9231f8d22aa06b327817c8332cfc20303308" - }, - { - "name": "jaraco.collections", - "version": "5.1.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/jaraco.collections-5.1.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "20c51a96236c0395f53b1f4c5d458e6a0721e51e16c1bff733b7aba76f5d06d8" - }, - { - "name": "jaraco.context", - "version": "5.3.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/jaraco.context-5.3.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "c43b60b897a3d2d37d8845c252fc44261d9aef171e21154111a9012d2afffed6" - }, - { - "name": "jaraco.functools", - "version": "4.0.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "8b86946900d7fa38dd1102b9c1ebe17a0cb1f09c8b7e29f61f2bda4a4dc51eca" - }, - { - "name": "jaraco.text", - "version": "3.12.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "03359d9ba56231f0ce3e840c7cb5a7db380141218949ccaa78ddbd4dcb965d52" - }, - { - "name": "more-itertools", - "version": "10.3.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "0453bdd0ef9f2cd89540ca63ee8212e73b73809514419dd3037d8fe471f737e0" - }, - { - "name": "packaging", - "version": "24.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/packaging-24.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "a211fceacea4e6621f4316364d2d0b7127c00de3856b8062082f9bc5957ea4db" - }, - { - "name": "platformdirs", - "version": "4.2.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/platformdirs-4.2.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "ce6b227b4d46d4cb57474c2022fe57a557933bb89daf4596bdf9b12ac296b869" - }, - { - "name": "tomli", - "version": "2.0.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/tomli-2.0.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "ccf0dc78a98fc0918b5ad67292b1e2c4bed65575a6246cd9d63c914f9942a0f2" - }, - { - "name": "typeguard", - "version": "4.3.0", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "cf675c1c0a744f08580855390de87cc77d676b312582e8d4cfdb5bb8fd298d21" - }, - { - "name": "typing_extensions", - "version": "4.12.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/typing_extensions-4.12.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "05e51021af1c9d86eb8d6c7e37c4cece733d5065b91a6d8389c5690ed440f16d" - }, - { - "name": "wheel", - "version": "0.45.1", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/wheel-0.45.1.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "98acfce07ee6ee3b31272cde21c4d53918936f434f315dfd2af3886211a09a30" - }, - { - "name": "zipp", - "version": "3.19.2", - "metadata_path": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor/zipp-3.19.2.dist-info/METADATA", - "installation_directory": "/opt/openenv-venv/lib/python3.11/site-packages/setuptools/_vendor", - "metadata_sha256": "508ae4fe43081c64b0b0a2828588b3a8cc3430c6693d1676662569400b0dfdb1" - }, - { - "name": "gyp", - "version": "0.1", - "metadata_path": "/usr/lib/python3/dist-packages/gyp-0.1.egg-info/PKG-INFO", - "installation_directory": "/usr/lib/python3/dist-packages", - "metadata_sha256": "6f37710f7052d223e38f2479a259ec91a0a7b3e23f52930dbc44a426347e074e" - }, - { - "name": "pip", - "version": "22.0.2", - "metadata_path": "/usr/lib/python3/dist-packages/pip-22.0.2.dist-info/METADATA", - "installation_directory": "/usr/lib/python3/dist-packages", - "metadata_sha256": "622c5ad0b2a4cb38d3d8de4940ee6a6038197264ece99e9d83851bc013724f60" - }, - { - "name": "setuptools", - "version": "59.6.0", - "metadata_path": "/usr/lib/python3/dist-packages/setuptools-59.6.0.egg-info/PKG-INFO", - "installation_directory": "/usr/lib/python3/dist-packages", - "metadata_sha256": "0be37c52b0344a35195f241358d75216d5c7ed2a8c649ec881d8134833f62c4f" - }, - { - "name": "wheel", - "version": "0.37.1", - "metadata_path": "/usr/lib/python3/dist-packages/wheel-0.37.1.egg-info/PKG-INFO", - "installation_directory": "/usr/lib/python3/dist-packages", - "metadata_sha256": "98a7ecf555108a00c0170c5e4b0ef56593a4f8db170e94278b8b67ae9222a4fb" - }, - { - "name": "altgraph", - "version": "0.17.5", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/altgraph-0.17.5.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "dc60641dba229a3aef09f764f562c38d908b930c92615af2e626af31d6ff19b5" - }, - { - "name": "async-timeout", - "version": "5.0.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/async_timeout-5.0.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "4550cd1083d820124a3ec8d38490da2915f587bf7ee1061036e04b4973c8b54f" - }, - { - "name": "bcrypt", - "version": "5.0.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/bcrypt-5.0.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "c95d417cb948eae765572db778d6f30daeb60d211b52b956be52c1088e9401d2" - }, - { - "name": "beautifulsoup4", - "version": "4.15.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/beautifulsoup4-4.15.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "b2f888103259f1607c85f3b1163be1bc49fc9941a3243c3b89a21075bfc6d4fb" - }, - { - "name": "biopython", - "version": "1.88", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/biopython-1.88.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "d8049c9ad2de2dc720ad57aba95e2ec1df148e8eaaa90285b99070cad0066ea3" - }, - { - "name": "blinker", - "version": "1.9.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/blinker-1.9.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "b8846233cc238db1e40ad6c2c93bdcb54dfb200664d2411ee64c4095dd5dbf30" - }, - { - "name": "certifi", - "version": "2026.7.22", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/certifi-2026.7.22.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "ef5af1638fbb23676ac3c5777dfcfc2cd9c348fe4172ed5ba3d277655b248090" - }, - { - "name": "cffi", - "version": "2.1.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/cffi-2.1.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "558bafb9093a8e790175d9ecff9688382981d744877dad86fd6770db0f4dc918" - }, - { - "name": "charset-normalizer", - "version": "3.5.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/charset_normalizer-3.5.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "89ce6362bb7be88558f4be99a98f5d1b4da93d19cd0323e5ee0bac05cf883dfb" - }, - { - "name": "click", - "version": "8.5.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/click-8.5.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "e87bce0bd194de70dfb8e708e0a6b0483009f25611804eaf87bfeb63e6c20501" - }, - { - "name": "cloudpickle", - "version": "3.1.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/cloudpickle-3.1.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "3d0263bfe9ee4f23b244bdcaff73acbe7a1957ebf82743b6ae42693adc48d721" - }, - { - "name": "contourpy", - "version": "1.3.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/contourpy-1.3.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "0d860f7cb8af8e85005c209499e0ca25da8515b4b67915ee8b88b8852c316c08" - }, - { - "name": "cryptography", - "version": "50.0.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/cryptography-50.0.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "047cfc71226409de4318b360aef15c63a2adf609731e3dcf7fe932f14ea042ee" - }, - { - "name": "cycler", - "version": "0.12.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/cycler-0.12.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "23289e19b76f1e01394227696e6af2b6cd1ce79e89731209bf9195148b18ed36" - }, - { - "name": "Cython", - "version": "3.3.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/cython-3.3.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "be89f94f60c36f2c8a311112be29389813e2022f299888676e8a59332b2b7b2f" - }, - { - "name": "exceptiongroup", - "version": "1.3.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/exceptiongroup-1.3.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "81984a523a2f7a522ad12bea784a8bb85edec0805ebbd0fb4e350169a36dd802" - }, - { - "name": "filelock", - "version": "3.32.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/filelock-3.32.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "2d80f43bd905689145c00b3133bc95895d654ced70a96a1802e9237e0d66599f" - }, - { - "name": "Flask", - "version": "3.1.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/flask-3.1.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "aa6760ed6f545704474d70733e4a63a7f1481e376973edc896a13d02a7224c7c" - }, - { - "name": "fonttools", - "version": "4.65.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/fonttools-4.65.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "767c772df5fec424631e48baa13cfa55498f4d7be9b41d1071b34bf52cc28fa8" - }, - { - "name": "fsspec", - "version": "2026.7.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/fsspec-2026.7.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "88b1657585de14e3bb82aa5278aa9595b30aa4ca74ead073d8950615c808099d" - }, - { - "name": "idna", - "version": "3.20", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/idna-3.20.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "dbd8c14c1e4ca1e0c9824a6dbc7cbbf78884f38eb52d91148cd3025f671e4b85" - }, - { - "name": "ImageIO", - "version": "2.38.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/imageio-2.38.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "c6c48046e1f02bdb44ee5a39b4702651bd27125977e227ef52cae60e7f20daab" - }, - { - "name": "iniconfig", - "version": "2.3.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/iniconfig-2.3.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "47c2c35d936f5c649d8074c6464719a42966a67b5cebad01e3e5784cf090cfb6" - }, - { - "name": "invoke", - "version": "3.0.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/invoke-3.0.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "3aa7e6bc583c04b62f77455f519b49be6529bf8ef165eb52022b0da7fac9d4ab" - }, - { - "name": "itsdangerous", - "version": "2.2.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/itsdangerous-2.2.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "d2b934fb56708a1b94e439f0255c0f5a8108e3258ec827b18a1dc9c991db9611" - }, - { - "name": "Jinja2", - "version": "3.1.6", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/jinja2-3.1.6.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "68c5548fb67c4132a13898d9b31ec50c6bea2abdd915d921f214355c3a6499c8" - }, - { - "name": "joblib", - "version": "1.6.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/joblib-1.6.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "c5fd6509906c5795fd6724d97bc1709d1f266b78aff92c0156d6cf5ad7c045e3" - }, - { - "name": "kiwisolver", - "version": "1.5.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/kiwisolver-1.5.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "f07b7b6c0c9c2a624c8a31f931e16712f2cf3490e7dfd51643d68e9d42d4b2c9" - }, - { - "name": "lxml", - "version": "6.1.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/lxml-6.1.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "aad89f8107bc74045b86c9b7f7c0984196102520dd7faed5e4e45693b7c315ef" - }, - { - "name": "MarkupSafe", - "version": "3.0.4", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/markupsafe-3.0.4.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "66767d76388ece15d49d50dafb655891ef5d868715e7128e7f7d737a70b353c4" - }, - { - "name": "matplotlib", - "version": "3.10.9", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/matplotlib-3.10.9.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "bea8a4672bbe4f26b7a4fe5bc5e5023a08c4fb7069cc951f39eef26a403c7ea6" - }, - { - "name": "mpmath", - "version": "1.3.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/mpmath-1.3.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "44b66ea444b9c0d19ae94815d356bf047ae6b680c19268b5c265687cd6a81406" - }, - { - "name": "networkx", - "version": "3.4.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/networkx-3.4.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "2e5265dda876ef3c44fefa9e9553499bc564c89a16c95e38bdaf9babc556d1d7" - }, - { - "name": "numpy", - "version": "2.2.6", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/numpy-2.2.6.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "22d648f53848429464ca643b40d73b49a920d47876fc77c395d4dca4e834904a" - }, - { - "name": "packaging", - "version": "26.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/packaging-26.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "70fdb89fc4d4a9a043bf7372b8972bcc883fddff34ab55e9cf80d73875384763" - }, - { - "name": "pandas", - "version": "2.3.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pandas-2.3.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "40ee953dc7ca155840b639a1881ff84578075187fce0ac20eeda55a7fa0d9a90" - }, - { - "name": "paramiko", - "version": "5.0.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/paramiko-5.0.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "94061b17f3d5e7fe935cc7d3bd01baed65533e43e2fcf39825e703d3629998f2" - }, - { - "name": "pillow", - "version": "12.3.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pillow-12.3.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "8fc07146cab33ef7582361dab6eac596d340b03ec648f18217da7894f73838c8" - }, - { - "name": "pluggy", - "version": "1.6.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pluggy-1.6.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "7438c35ee25a095eb7416f84b461c2d74425c5e734ad54c3912453c65244e01c" - }, - { - "name": "psycopg2-binary", - "version": "2.9.13", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/psycopg2_binary-2.9.13.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "a5267b4520191137e34589704162fce02cfd40efcfeb899c45187c7f6bfea7e5" - }, - { - "name": "pybind11", - "version": "3.1.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pybind11-3.1.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "b00ce3708f23fe41c44be8cd46545c9a16c91d9a3e1c51a4047ac683cebe060c" - }, - { - "name": "pycparser", - "version": "3.11", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pycparser-3.11.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "e3a74c846648bb55f4f907284b745e2003b87b96d9c9d17a8a50cf37804541c9" - }, - { - "name": "Pygments", - "version": "2.21.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pygments-2.21.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "1dde075570136774c706bf0009183a793fe0ee262e4a5590cc6eff8453eedd43" - }, - { - "name": "pyinstaller", - "version": "6.22.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pyinstaller-6.22.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "2991d3dcd53fe9966b8c16586322a7f9bbc564dd4752c190bd4fe8d6747f7046" - }, - { - "name": "pyinstaller-hooks-contrib", - "version": "2026.8", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pyinstaller_hooks_contrib-2026.8.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "686e63d76cb494d44c4533ed64a7d797970a1253493a4f875d39defc190396c4" - }, - { - "name": "PyNaCl", - "version": "1.6.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pynacl-1.6.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "143914f93191bef3bff7ba953dea6a38fb05f7f9e38e2a2e6ae31bd14ba81709" - }, - { - "name": "pyparsing", - "version": "3.3.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pyparsing-3.3.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "f2ca34052d720622d300023472ef8ae94fe5b57d69acbb28a8667f6dd0e13497" - }, - { - "name": "pyserial", - "version": "3.5", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pyserial-3.5.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "42a8ab7e94ef0b7baa7e94cdac65d6b9254c608476f630120c990007bf472943" - }, - { - "name": "pytest", - "version": "9.1.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pytest-9.1.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "c5d032518012789cabc870d46589aca3aeda36cf9fa4399ee88bda3d10438451" - }, - { - "name": "python-dateutil", - "version": "2.9.0.post0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/python_dateutil-2.9.0.post0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "a9d436da322be808332f98d88325998e87cb693a678a9969feb4cfad729a6e93" - }, - { - "name": "pytz", - "version": "2026.5", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pytz-2026.5.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "4d20d16f6004b1d7f9b01a96f4d3eb462c0c2a8413d9aa878effe50a21535929" - }, - { - "name": "PyYAML", - "version": "6.0.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/pyyaml-6.0.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "03c3b415ed38d09faedc49360e930769b40c58f68585e6de00e2e4916a858d34" - }, - { - "name": "redis", - "version": "8.1.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/redis-8.1.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "4668671cc6f1f9d6687255571a069e98f146dff48ba9840f38801b3e8cabba06" - }, - { - "name": "requests", - "version": "2.34.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/requests-2.34.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "8c384ba3e979480faae2859d3c5e6c1276dd2c3616e322e124d52c8cfc556f27" - }, - { - "name": "scikit-learn", - "version": "1.7.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/scikit_learn-1.7.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "a301770d816e5ef5e2a262886115f1e6002637324f3bfe73f92378897dea8c63" - }, - { - "name": "scipy", - "version": "1.15.3", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/scipy-1.15.3.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "c75caf32b67a13a9fc16aacf993a8bb883b7a69744ffe77cbbd4f3bfbad28f3d" - }, - { - "name": "setuptools", - "version": "78.1.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools-78.1.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "4444a6b549a8ebb02e1739f4375af7756c841f96f0c31077a183273c7462bd10" - }, - { - "name": "six", - "version": "1.17.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/six-1.17.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "562042078c2752549f6d8a7c86dbc5dd708088a7be6d80672ec7b07100b72468" - }, - { - "name": "soupsieve", - "version": "2.10", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/soupsieve-2.10.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "02ecd6c72d2fa0911bedfd99d53b2198e1bbf556f4606108819e8c19fdf32880" - }, - { - "name": "sympy", - "version": "1.14.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/sympy-1.14.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "b756c2fbfd5be05ac5bdb0ebca61f55618f30f633ed92d88a5687429313a7595" - }, - { - "name": "threadpoolctl", - "version": "3.7.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/threadpoolctl-3.7.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "09b19e721560cd12246402d44e53c1ede5194b8398ef60822f02cab86ccf8d1f" - }, - { - "name": "toml", - "version": "0.10.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/toml-0.10.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "9ff624b29bc48a177f4172c8659e74595485cf7ad9fe4ee340ff8e535594a566" - }, - { - "name": "tomli", - "version": "2.5.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/tomli-2.5.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "91899b0158243d859ca66a875d693bc98c2d979a52854b70d1ee0699f22b5d76" - }, - { - "name": "torch", - "version": "2.14.1+cpu", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/torch-2.14.1+cpu.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "a3fd232f82dcc389c6dab2665dfc17649c03ffb72cb641e96a76a0690177b918" - }, - { - "name": "torchvision", - "version": "0.29.1+cpu", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/torchvision-0.29.1+cpu.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "cb71db60eef9c79bf4e5285afaa79c922003fb33d89f998dddffc85986fce65c" - }, - { - "name": "typing_extensions", - "version": "4.16.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/typing_extensions-4.16.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "b05084ca1d50879865178d9fff9fabeab61bdfb1f361bfbde95421ffc8f9be46" - }, - { - "name": "tzdata", - "version": "2026.5", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/tzdata-2026.5.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "e0780e8b6dc8882ce87e871a9d4589d59cb05a0c2d64f58b1ba62cde1ee91f6a" - }, - { - "name": "urllib3", - "version": "2.8.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/urllib3-2.8.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "10898c620e8007c030e07fa5622b68358a43010025dfbd78a1cb797699de2bb4" - }, - { - "name": "Werkzeug", - "version": "3.1.9", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/werkzeug-3.1.9.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages", - "metadata_sha256": "9f04352e946ecb0883fbf379994c1cacf6720a124acdd7fd59029a889f4eebba" - }, - { - "name": "autocommand", - "version": "2.2.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/autocommand-2.2.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "3800d9b91dceea2065a6ed6279383362e97ac38b8e56b9343f404ee531860099" - }, - { - "name": "backports.tarfile", - "version": "1.2.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/backports.tarfile-1.2.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "8215c54ead77d9dc5a108a25c6bdc72b5999aa6f62c9499a440359412afa5a51" - }, - { - "name": "importlib_metadata", - "version": "8.0.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/importlib_metadata-8.0.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "6a7b90effee1e09d5b484cdf7232016a43e2d9cc9543bcbb8e494b1ec05e1f59" - }, - { - "name": "inflect", - "version": "7.3.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/inflect-7.3.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "66030d634580651b3e53cc19895d9231f8d22aa06b327817c8332cfc20303308" - }, - { - "name": "jaraco.collections", - "version": "5.1.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/jaraco.collections-5.1.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "20c51a96236c0395f53b1f4c5d458e6a0721e51e16c1bff733b7aba76f5d06d8" - }, - { - "name": "jaraco.context", - "version": "5.3.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/jaraco.context-5.3.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "c43b60b897a3d2d37d8845c252fc44261d9aef171e21154111a9012d2afffed6" - }, - { - "name": "jaraco.functools", - "version": "4.0.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/jaraco.functools-4.0.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "8b86946900d7fa38dd1102b9c1ebe17a0cb1f09c8b7e29f61f2bda4a4dc51eca" - }, - { - "name": "jaraco.text", - "version": "3.12.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/jaraco.text-3.12.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "03359d9ba56231f0ce3e840c7cb5a7db380141218949ccaa78ddbd4dcb965d52" - }, - { - "name": "more-itertools", - "version": "10.3.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/more_itertools-10.3.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "0453bdd0ef9f2cd89540ca63ee8212e73b73809514419dd3037d8fe471f737e0" - }, - { - "name": "packaging", - "version": "24.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/packaging-24.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "a211fceacea4e6621f4316364d2d0b7127c00de3856b8062082f9bc5957ea4db" - }, - { - "name": "platformdirs", - "version": "4.2.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/platformdirs-4.2.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "ce6b227b4d46d4cb57474c2022fe57a557933bb89daf4596bdf9b12ac296b869" - }, - { - "name": "tomli", - "version": "2.0.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/tomli-2.0.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "ccf0dc78a98fc0918b5ad67292b1e2c4bed65575a6246cd9d63c914f9942a0f2" - }, - { - "name": "typeguard", - "version": "4.3.0", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/typeguard-4.3.0.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "cf675c1c0a744f08580855390de87cc77d676b312582e8d4cfdb5bb8fd298d21" - }, - { - "name": "typing_extensions", - "version": "4.12.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/typing_extensions-4.12.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "05e51021af1c9d86eb8d6c7e37c4cece733d5065b91a6d8389c5690ed440f16d" - }, - { - "name": "wheel", - "version": "0.45.1", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/wheel-0.45.1.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "98acfce07ee6ee3b31272cde21c4d53918936f434f315dfd2af3886211a09a30" - }, - { - "name": "zipp", - "version": "3.19.2", - "metadata_path": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor/zipp-3.19.2.dist-info/METADATA", - "installation_directory": "/usr/local/lib/python3.10/dist-packages/setuptools/_vendor", - "metadata_sha256": "508ae4fe43081c64b0b0a2828588b3a8cc3430c6693d1676662569400b0dfdb1" - } - ], - "python_environment_configs": [ - { - "path": "/opt/openenv-venv/pyvenv.cfg", - "version_fields": { - "include-system-site-packages": "false", - "version": "3.11.16" - }, - "sha256": "578665659f30145c7e3f19e24dfd3948f138f51894d27153ad647cf13921c1fb" - } - ], - "sdk_requirements_lock": "requirements.lock", - "limitations": [ - "This records installed versions and metadata hashes, not complete source/wheel hashes for every dependency.", - "requirements.lock separately contains the SDK hash lock. The source component alone does not recreate the historical base image with all original package artifacts." - ], - "layer_members_inspected": 122330 -} diff --git a/components/tmax/Dockerfile b/components/tmax/Dockerfile deleted file mode 100644 index 0cfde5f6b0e2cd07b756d2ef45bb5919ebd802d0..0000000000000000000000000000000000000000 --- a/components/tmax/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM ghcr.io/bochencs/openenv-tmax@sha256:4272edf30108ae1734f70e389a1b5a18142bc4deceaa137953b8b708118534f4 -USER root -COPY config.json /opt/native-shell/config.json -COPY runtime/native_shell/backend.py /opt/native-shell/runtime/native_shell/backend.py diff --git a/components/tmax/LICENSE_SCOPE.json b/components/tmax/LICENSE_SCOPE.json deleted file mode 100644 index 4adf3be26fdbb1b84c8df2c342018ebb5478eb3b..0000000000000000000000000000000000000000 --- a/components/tmax/LICENSE_SCOPE.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "schema_version": 1, - "original_task_collection": { - "license": "ODC-BY-1.0", - "declared_by": "allenai/TMax-15K", - "scope": "Original TMax database and selected task data, as declared by the original dataset. The included license text defines its scope.", - "notice": "NOTICE.txt", - "license_text": "licenses/ODC-BY-1.0.txt", - "original_readme": "licenses/TMAX_DATASET_README.md" - }, - "harbor_conversion": { - "source": "TMaxxx/TMax-15K-Harbor", - "separate_license_declared": false, - "note": "Pinned converter metadata does not supply a separate license declaration. Original provenance is retained; no new license is assigned to converter-specific work." - }, - "local_adapter": { - "scope": "OpenEnv runtime, isolation, configuration, source metadata and packaging", - "note": "Local adaptation is identified separately from upstream source; this metadata does not assign it the dataset license." - }, - "dependencies": { - "scope": "Installed third-party system packages, Python packages and OpenEnv SDK", - "note": "Each dependency retains its existing license. Dataset licensing does not relicense installed dependencies. Retain license notices present in the offline image and use included dependency inventories for versions.", - "inventory": "DEPENDENCIES.json", - "sdk_hash_lock": "requirements.lock" - } -} diff --git a/components/tmax/NOTICE.txt b/components/tmax/NOTICE.txt deleted file mode 100644 index dd78c373d6bc0971c122737b68d4d1830d27cbd5..0000000000000000000000000000000000000000 --- a/components/tmax/NOTICE.txt +++ /dev/null @@ -1,42 +0,0 @@ -Six original TMax training tasks - -Original task collection: Allen Institute for AI (Ai2), allenai/TMax-15K -Revision: e3ded940596cc611c9815684ba51a7e8ee0cffc9 -https://huggingface.co/datasets/allenai/TMax-15K/tree/e3ded940596cc611c9815684ba51a7e8ee0cffc9 - -Harbor packaging: TMaxxx/TMax-15K-Harbor -Revision: 48a77eb0b017606c643ed905f96db41672914798 -https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798 - -The original dataset declares Open Data Commons Attribution License 1.0. -See licenses/ODC-BY-1.0.txt and LICENSE_SCOPE.json. The Harbor converter -has no separate license declaration in its pinned dataset metadata. -Existing third-party software retains its respective license. - -The original dataset README states that the dataset is intended for research -and educational use in accordance with Ai2 Responsible Use Guidelines, and -that it includes Gemini 3.1 Pro outputs subject to Google's Terms of Service. -The exact original README, including these links and citation, is preserved -in licenses/TMAX_DATASET_README.md. - -Please cite: -Hamish Ivison, Junjie Oscar Yin, Rulin Shao, Teng Xiao, Nathan Lambert, -and Hannaneh Hajishirzi. Tmax: A simple recipe for terminal agents. 2026. -https://arxiv.org/abs/2606.23321 - -Instructions and checker files are preserved byte-for-byte from the pinned -Harbor archive. Inputs are materialized from the original task setup. -Original environment files and task metadata are retained under upstream/. -For task_000260_7b7cc286, the existing runtime task.toml uses an offline -network setting; its exact original counterpart is retained under upstream/. -TASKS.json records the source and runtime mappings. - -This component adds a shared OpenEnv interface and isolated execution. -The adapter restores original pristine-file permissions between episodes -before protecting inputs and removes workspace symlinks without following -their targets. These changes concern episode lifecycle and packaging. - -Teacher rollouts, model answers, local CPU control programs and research -reports are excluded. Original reference information inside published -checkers and setup scripts is retained for provenance and scoring; it is -not exposed to the actor as an answer source. diff --git a/components/tmax/SOURCE.json b/components/tmax/SOURCE.json deleted file mode 100644 index d65e9b8bf31f13c39e25512176f3f87e82cde86d..0000000000000000000000000000000000000000 --- a/components/tmax/SOURCE.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "schema_version": 1, - "component": "tmax-six-original-tasks", - "source_dataset": { - "id": "TMaxxx/TMax-15K-Harbor", - "revision": "48a77eb0b017606c643ed905f96db41672914798", - "url": "https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798", - "archive": "tasks.zip", - "archive_sha256": "dc93985e031e14b5c5777f03345bf777b4fb0dfad7b38bbd9c6d952a540c4b9a", - "archive_bytes": 85837408, - "separate_converter_license_declared_in_pinned_metadata": false - }, - "original_dataset": { - "id": "allenai/TMax-15K", - "revision": "e3ded940596cc611c9815684ba51a7e8ee0cffc9", - "authors": "Allen Institute for AI (Ai2); Hamish Ivison, Junjie Oscar Yin, Rulin Shao, Teng Xiao, Nathan Lambert, Hannaneh Hajishirzi", - "url": "https://huggingface.co/datasets/allenai/TMax-15K/tree/e3ded940596cc611c9815684ba51a7e8ee0cffc9", - "declared_license": "ODC-BY-1.0", - "license_text": "licenses/ODC-BY-1.0.txt", - "dataset_readme": "licenses/TMAX_DATASET_README.md", - "dataset_readme_sha256": "0e66e8816b8f2b4a17d37ec7abc5b8ca5708bae9d71d2c5323d8666d7e7ffa1d", - "upstream_notice": "The original dataset README states research and educational use in accordance with Ai2 Responsible Use Guidelines, and that included Gemini 3.1 Pro outputs are subject to Google Terms of Service." - }, - "task_ids": [ - "task_000663_dff2c340", - "task_005684_3c8594a3", - "task_008998_ae4cbe72", - "task_008667_2151f271", - "task_000260_7b7cc286", - "task_000056_f726766b" - ], - "task_data_scope": "Six fixed original tasks. No generated variants.", - "instruction_and_checker_provenance": "Frozen instructions and test files are checked byte-for-byte against tasks.zip at the pinned Harbor revision. This claim is relative to the Harbor conversion, not a separate full byte comparison with the Ai2 archive.", - "input_provenance": "Frozen task inputs are outputs of the original task setup. They are materialized runtime assets, not direct archive members. The original environment source is retained under upstream//environment/; TASKS.json gives hashes and mappings.", - "upstream_copies": "upstream// contains exact archived environment files and task.toml. These files document original setup and are not executed by the frozen runtime.", - "adaptations": [ - "A shared OpenEnv interface selects among six fixed task IDs and exposes exec/finish actions.", - "Actor and verifier execute under separate user identities; private source and pristine assets are supervisor-owned.", - "The adapter restores original pristine permissions between episodes before protecting immutable inputs, and removes workspace symlinks without following their targets.", - "Runtime inputs are pre-materialized for offline execution; original task setup scripts are retained as source.", - "For task_000260_7b7cc286 only, the existing runtime task.toml changes allow_internet=true to network_mode=\"no-network\" and appends a newline. Its original task.toml is retained under upstream/. Instruction, input and checker semantics are preserved.", - "Commands and verifier execution have 90-second limits. After 64 commands, a separate finish request performs grading; further exec requests do not execute commands." - ], - "license_scope": "LICENSE_SCOPE.json", - "inventory": "../../SOURCE_LOCK.json", - "tasks": "TASKS.json", - "dependency_notes": "Installed versions: DEPENDENCIES.json. SDK environment: requirements.lock.", - "dependency_inventory": "DEPENDENCIES.json" -} diff --git a/components/tmax/TASKS.json b/components/tmax/TASKS.json deleted file mode 100644 index d4438ee9ac7462d7d63931062887ed033def359b..0000000000000000000000000000000000000000 --- a/components/tmax/TASKS.json +++ /dev/null @@ -1,424 +0,0 @@ -{ - "schema_version": 1, - "fixed_original_task_count": 6, - "selection": "reset chooses a task_id from the six entries; the task definitions and materialized inputs are fixed", - "adapter_limits": { - "max_actions": 64, - "command_timeout_sec": 90, - "output_limit_bytes": 65536, - "verifier_timeout_cap_sec": 90, - "finish_after_command_budget": "separate_request" - }, - "tasks": [ - { - "task_id": "task_000663_dff2c340", - "description": "database reliability engineer managing backups", - "domain": "data_querying", - "skill_type": "Result Processing", - "workspace": "/home/user", - "instruction": "tasks/task_000663_dff2c340/source/instruction.md", - "instruction_sha256": "feae25374139b4b1d8ec9759d553c591841d9330a071217f46a2e464bd32bbd7", - "original_task_metadata": { - "path": "upstream/task_000663_dff2c340/task.toml", - "sha256": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a" - }, - "runtime_task_metadata": { - "path": "tasks/task_000663_dff2c340/source/task.toml", - "sha256": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a", - "matches_upstream_bytes": true, - "changes": [] - }, - "original_setup": { - "path": "upstream/task_000663_dff2c340/environment/post_install.sh", - "sha256": "a449c18295cee8a3e7ed0c958fe219cbed2d2a8e7fdad924f2679444b3377b94" - }, - "original_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "cpus": 1, - "memory_mb": 2048, - "allow_internet": true - }, - "runtime_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 90, - "cpus": 1, - "memory_mb": 2048 - }, - "inputs": [ - { - "path": "tasks/task_000663_dff2c340/pristine/backup_catalog.db", - "container_path": "/home/user/backup_catalog.db", - "sha256": "170911a153d00eb0f037ca56a2cbd10d4aa2b7a418e25a0f1df58b1c77589788", - "editable": false, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_000663_dff2c340/environment/post_install.sh" - } - ], - "editable_directories": [], - "outputs": [ - "/home/user/restore_plan.json" - ], - "grading": { - "mode": "file-output", - "kind": "pytest", - "checker": "tasks/task_000663_dff2c340/source/tests/test_final_state.py", - "checker_sha256": "7a273b9bf8bc61eeec1b8dda674b5f6ba5356abbfd923b413b09d2584c1ef72f", - "original_launcher": "tasks/task_000663_dff2c340/source/tests/test.sh", - "original_launcher_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "executes_learner_code": false, - "reward": "1 if the unchanged original assertions pass; 0 otherwise" - }, - "source_archive_prefix": "tasks.zip!/task_000663_dff2c340/", - "input_materialization": "Original Python fixture body extracted unchanged from original post_install.sh and run at its original absolute paths in the compatible preinstalled base; package installation commands were omitted." - }, - { - "task_id": "task_005684_3c8594a3", - "description": "compliance officer auditing systems", - "domain": "data_querying", - "skill_type": "Graph Processing", - "workspace": "/home/user", - "instruction": "tasks/task_005684_3c8594a3/source/instruction.md", - "instruction_sha256": "f4eee4e0643fcfb7399df10e1947ec9dbda28c74bacf307167f443506268f583", - "original_task_metadata": { - "path": "upstream/task_005684_3c8594a3/task.toml", - "sha256": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2" - }, - "runtime_task_metadata": { - "path": "tasks/task_005684_3c8594a3/source/task.toml", - "sha256": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2", - "matches_upstream_bytes": true, - "changes": [] - }, - "original_setup": { - "path": "upstream/task_005684_3c8594a3/environment/post_install.sh", - "sha256": "b431517fec535c62b42b517f9212cbb1e9cf80bdf883a55c02bfba08f0d4c404" - }, - "original_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "cpus": 1, - "memory_mb": 2048, - "allow_internet": true - }, - "runtime_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 90, - "cpus": 1, - "memory_mb": 2048 - }, - "inputs": [ - { - "path": "tasks/task_005684_3c8594a3/pristine/compliance_audit.db", - "container_path": "/home/user/compliance_audit.db", - "sha256": "9fe1c89ee823f133d35dea66840ecb7f87d599487524b7aa1d6371e8f664058e", - "editable": false, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_005684_3c8594a3/environment/post_install.sh" - } - ], - "editable_directories": [], - "outputs": [ - "/home/user/audit_report.json" - ], - "grading": { - "mode": "file-output", - "kind": "pytest", - "checker": "tasks/task_005684_3c8594a3/source/tests/test_final_state.py", - "checker_sha256": "495630c7ede4e75ef5644c1ee5b69f04969a4059ef094787c19a3014734d3cf2", - "original_launcher": "tasks/task_005684_3c8594a3/source/tests/test.sh", - "original_launcher_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "executes_learner_code": false, - "reward": "1 if the unchanged original assertions pass; 0 otherwise" - }, - "source_archive_prefix": "tasks.zip!/task_005684_3c8594a3/", - "input_materialization": "Original Python fixture body extracted unchanged from original post_install.sh and run at its original absolute paths in the compatible preinstalled base; package installation commands were omitted." - }, - { - "task_id": "task_008998_ae4cbe72", - "description": "backup administrator archiving data", - "domain": "file_operations", - "skill_type": "File I/O", - "workspace": "/home/user", - "instruction": "tasks/task_008998_ae4cbe72/source/instruction.md", - "instruction_sha256": "f81f86b07681931baabdba313cc4e988c01bff7a1f1d83349dfa939cdaa20669", - "original_task_metadata": { - "path": "upstream/task_008998_ae4cbe72/task.toml", - "sha256": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9" - }, - "runtime_task_metadata": { - "path": "tasks/task_008998_ae4cbe72/source/task.toml", - "sha256": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9", - "matches_upstream_bytes": true, - "changes": [] - }, - "original_setup": { - "path": "upstream/task_008998_ae4cbe72/environment/post_install.sh", - "sha256": "26dfa63d063430c2370144b8e30c1f905dde4e2722403c1e8131a5a84e2d5e69" - }, - "original_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "cpus": 1, - "memory_mb": 2048, - "allow_internet": true - }, - "runtime_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 90, - "cpus": 1, - "memory_mb": 2048 - }, - "inputs": [ - { - "path": "tasks/task_008998_ae4cbe72/pristine/robot_dump.log.gz", - "container_path": "/home/user/robot_dump.log.gz", - "sha256": "909d2e964c0831d8af91b722b4424ed829c261d6b7db1a95180d8a809527ddaf", - "editable": false, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_008998_ae4cbe72/environment/post_install.sh" - } - ], - "editable_directories": [], - "outputs": [ - "/home/user/archived_gcode", - "/home/user/critical_errors.csv" - ], - "grading": { - "mode": "file-output", - "kind": "pytest", - "checker": "tasks/task_008998_ae4cbe72/source/tests/test_final_state.py", - "checker_sha256": "e03b84ca0519367e5f86b7b3a3231afa5209b1971431497699200099035f5014", - "original_launcher": "tasks/task_008998_ae4cbe72/source/tests/test.sh", - "original_launcher_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "executes_learner_code": false, - "reward": "1 if the unchanged original assertions pass; 0 otherwise" - }, - "source_archive_prefix": "tasks.zip!/task_008998_ae4cbe72/", - "input_materialization": "Original Python fixture body extracted unchanged from original post_install.sh and run at its original absolute paths in the compatible preinstalled base; package installation commands were omitted." - }, - { - "task_id": "task_008667_2151f271", - "description": "data engineer building ETL pipelines", - "domain": "data_querying", - "skill_type": "Result Processing", - "workspace": "/home/user", - "instruction": "tasks/task_008667_2151f271/source/instruction.md", - "instruction_sha256": "50d1d10121dfa3b565842fd10f2589ceb91b4459126787af7793cec9cc0d06b1", - "original_task_metadata": { - "path": "upstream/task_008667_2151f271/task.toml", - "sha256": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897" - }, - "runtime_task_metadata": { - "path": "tasks/task_008667_2151f271/source/task.toml", - "sha256": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897", - "matches_upstream_bytes": true, - "changes": [] - }, - "original_setup": { - "path": "upstream/task_008667_2151f271/environment/post_install.sh", - "sha256": "3a777366c4b998e6368627f4775a73cea29fdbdc9991daedfb13244153c17841" - }, - "original_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "cpus": 1, - "memory_mb": 2048, - "allow_internet": true - }, - "runtime_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 90, - "cpus": 1, - "memory_mb": 2048 - }, - "inputs": [ - { - "path": "tasks/task_008667_2151f271/pristine/data/financial.db", - "container_path": "/home/user/data/financial.db", - "sha256": "d6b5039ee32f3a43069245984c8fe5a9689028a9aac06e26a64017c54bd11976", - "editable": false, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_008667_2151f271/environment/post_install.sh" - }, - { - "path": "tasks/task_008667_2151f271/pristine/data/transactions.jsonl", - "container_path": "/home/user/data/transactions.jsonl", - "sha256": "629b28471809f802c58831d100315b83012c0066df3b265a2d379a19e61a2262", - "editable": false, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_008667_2151f271/environment/post_install.sh" - } - ], - "editable_directories": [], - "outputs": [ - "/home/user/output/fraud_cycles.json" - ], - "grading": { - "mode": "file-output", - "kind": "pytest", - "checker": "tasks/task_008667_2151f271/source/tests/test_final_state.py", - "checker_sha256": "cb73fd0ab1765768ebfecc50054ba13c143cc51be201127515eb495904ddf9e6", - "original_launcher": "tasks/task_008667_2151f271/source/tests/test.sh", - "original_launcher_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "executes_learner_code": false, - "reward": "1 if the unchanged original assertions pass; 0 otherwise" - }, - "source_archive_prefix": "tasks.zip!/task_008667_2151f271/", - "input_materialization": "Original Python fixture body extracted unchanged from original post_install.sh and run at its original absolute paths in the compatible preinstalled base; package installation commands were omitted." - }, - { - "task_id": "task_000260_7b7cc286", - "description": "developer inheriting an unfamiliar codebase", - "domain": "debugging", - "skill_type": "Data Processing", - "workspace": "/home/user", - "instruction": "tasks/task_000260_7b7cc286/source/instruction.md", - "instruction_sha256": "79c9fd4e4d41524db109d90b0415a4f0a2b9d24bf690fa8d7340ce3cb5ce0975", - "original_task_metadata": { - "path": "upstream/task_000260_7b7cc286/task.toml", - "sha256": "483c9171d3e67bec029d9b88cee24d554fa9310a61ec47940312be5f2951bc30" - }, - "runtime_task_metadata": { - "path": "tasks/task_000260_7b7cc286/source/task.toml", - "sha256": "d36c49060b4ddbca3b13a5aa98cf5b195c07bff725b91107f58a087ec4325423", - "matches_upstream_bytes": false, - "changes": [ - "allow_internet = true replaced with network_mode = \"no-network\"", - "terminal newline appended" - ] - }, - "original_setup": { - "path": "upstream/task_000260_7b7cc286/environment/post_install.sh", - "sha256": "ba40e8bc5a20718d686892069c073ee96760685a32fe3291f2f6fbb630a7ae03" - }, - "original_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "cpus": 1, - "memory_mb": 2048, - "allow_internet": true - }, - "runtime_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 90, - "cpus": 1, - "memory_mb": 2048 - }, - "inputs": [ - { - "path": "tasks/task_000260_7b7cc286/pristine/pipeline/find_threshold.sh", - "container_path": "/home/user/pipeline/find_threshold.sh", - "sha256": "a6c4cf2043d8642babb9b546096b3f559a375b59d54a43efebd57e9728466184", - "editable": true, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_000260_7b7cc286/environment/post_install.sh" - }, - { - "path": "tasks/task_000260_7b7cc286/pristine/pipeline/process.sh", - "container_path": "/home/user/pipeline/process.sh", - "sha256": "4631f1f805e6b826a796502ed5d94e676b3061cf448f2f9225116395aa3bb13b", - "editable": true, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_000260_7b7cc286/environment/post_install.sh" - }, - { - "path": "tasks/task_000260_7b7cc286/pristine/pipeline/serialize.sh", - "container_path": "/home/user/pipeline/serialize.sh", - "sha256": "f3ae2df41978712dbffe58665a9582e3d0951f211c5cca5ece9f536225d28ba8", - "editable": true, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_000260_7b7cc286/environment/post_install.sh" - }, - { - "path": "tasks/task_000260_7b7cc286/source/external/app/video.mp4", - "container_path": "/app/video.mp4", - "sha256": "3c04251fe92c30d29ac4d887608f4385176e3bda932594437f82b08a5b348938", - "editable": false, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_000260_7b7cc286/environment/post_install.sh" - } - ], - "editable_directories": [ - "/home/user/pipeline" - ], - "outputs": [ - "/home/user/output.json" - ], - "grading": { - "mode": "file-output", - "kind": "pytest", - "checker": "tasks/task_000260_7b7cc286/source/tests/test_final_state.py", - "checker_sha256": "aae204101d5c024a0b5cbda42fa686e7d2928fd9be3ad55fd14314b2502182a5", - "original_launcher": "tasks/task_000260_7b7cc286/source/tests/test.sh", - "original_launcher_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "executes_learner_code": false, - "reward": "1 if the unchanged original assertions pass; 0 otherwise" - }, - "source_archive_prefix": "tasks.zip!/task_000260_7b7cc286/", - "input_materialization": "Original post_install.sh generated the video and three pipeline scripts in the existing science base. Pipeline bytes independently match their original shell heredocs. The frozen video hash is the recorded original-setup build output." - }, - { - "task_id": "task_000056_f726766b", - "description": "data scientist fitting models", - "domain": "scientific_computing", - "skill_type": "Algorithmic", - "workspace": "/home/user", - "instruction": "tasks/task_000056_f726766b/source/instruction.md", - "instruction_sha256": "714f780883970365cfffe408e2c76e75f499005f87551fc84b55d79368e77197", - "original_task_metadata": { - "path": "upstream/task_000056_f726766b/task.toml", - "sha256": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0" - }, - "runtime_task_metadata": { - "path": "tasks/task_000056_f726766b/source/task.toml", - "sha256": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0", - "matches_upstream_bytes": true, - "changes": [] - }, - "original_setup": { - "path": "upstream/task_000056_f726766b/environment/post_install.sh", - "sha256": "70d52288d5c9a7d23bbd63fb086a7f886961a1335632cc6efb892572d197563b" - }, - "original_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "cpus": 1, - "memory_mb": 2048, - "allow_internet": true - }, - "runtime_limits": { - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 90, - "cpus": 1, - "memory_mb": 2048 - }, - "inputs": [ - { - "path": "tasks/task_000056_f726766b/source/external/app/vibration_data.wav", - "container_path": "/app/vibration_data.wav", - "sha256": "eab8396a1b533f70468039f8ac1b5fe9927faf4ded578172ec932ef7bf2af22a", - "editable": false, - "origin": "materialized_from_original_post_install", - "setup_path": "upstream/task_000056_f726766b/environment/post_install.sh" - } - ], - "editable_directories": [], - "outputs": [ - "/home/user/parameters.json" - ], - "grading": { - "mode": "file-output", - "kind": "pytest", - "checker": "tasks/task_000056_f726766b/source/tests/test_final_state.py", - "checker_sha256": "327c5346a779a44e27ef0cbd9f107e863d599fc6e47f95f248eaec03c15117c4", - "original_launcher": "tasks/task_000056_f726766b/source/tests/test.sh", - "original_launcher_sha256": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "executes_learner_code": false, - "reward": "1 if the unchanged original assertions pass; 0 otherwise" - }, - "source_archive_prefix": "tasks.zip!/task_000056_f726766b/", - "input_materialization": "The original post_install.sh data generator produced the frozen vibration WAV in the retained science runtime; the frozen WAV hash matches the reviewed base-image policy." - } - ] -} diff --git a/components/tmax/config.json b/components/tmax/config.json deleted file mode 100644 index 4493792f93e837363c4c0055fb510338f0e9fc2f..0000000000000000000000000000000000000000 --- a/components/tmax/config.json +++ /dev/null @@ -1,244 +0,0 @@ -{ - "tasks": [ - { - "id": "task_000663_dff2c340", - "source": "/opt/native-shell/tasks/task_000663_dff2c340/source", - "pristine_workspace": "/opt/native-shell/tasks/task_000663_dff2c340/pristine", - "workspace": "/home/user", - "inputs": [ - "/home/user/backup_catalog.db" - ], - "outputs": [ - "/home/user/restore_plan.json" - ], - "editable": [], - "external_inputs": {}, - "grading_mode": "file-output", - "grader": { - "kind": "pytest", - "test_file": "test_final_state.py", - "executes_learner_code": false - }, - "python": "/usr/bin/python3", - "cpus": 1, - "memory_mb": 2048, - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "source_sha256": { - "instruction.md": "feae25374139b4b1d8ec9759d553c591841d9330a071217f46a2e464bd32bbd7", - "task.toml": "85d17b0b5f2f018805d139044cedadeda55cc93406e9d7b548b28fc6aa8ae30a", - "tests/test.sh": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "tests/test_final_state.py": "7a273b9bf8bc61eeec1b8dda674b5f6ba5356abbfd923b413b09d2584c1ef72f" - }, - "pristine_sha256": { - "backup_catalog.db": "170911a153d00eb0f037ca56a2cbd10d4aa2b7a418e25a0f1df58b1c77589788" - }, - "pristine_permissions": { - "backup_catalog.db": 420 - } - }, - { - "id": "task_005684_3c8594a3", - "source": "/opt/native-shell/tasks/task_005684_3c8594a3/source", - "pristine_workspace": "/opt/native-shell/tasks/task_005684_3c8594a3/pristine", - "workspace": "/home/user", - "inputs": [ - "/home/user/compliance_audit.db" - ], - "outputs": [ - "/home/user/audit_report.json" - ], - "editable": [], - "external_inputs": {}, - "grading_mode": "file-output", - "grader": { - "kind": "pytest", - "test_file": "test_final_state.py", - "executes_learner_code": false - }, - "python": "/usr/bin/python3", - "cpus": 1, - "memory_mb": 2048, - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "source_sha256": { - "instruction.md": "f4eee4e0643fcfb7399df10e1947ec9dbda28c74bacf307167f443506268f583", - "task.toml": "5fc0da5f24b16f866fbc354cfc7cb148a17d353dff3b263c1c6caf94bf30b6a2", - "tests/test.sh": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "tests/test_final_state.py": "495630c7ede4e75ef5644c1ee5b69f04969a4059ef094787c19a3014734d3cf2" - }, - "pristine_sha256": { - "compliance_audit.db": "9fe1c89ee823f133d35dea66840ecb7f87d599487524b7aa1d6371e8f664058e" - }, - "pristine_permissions": { - "compliance_audit.db": 420 - } - }, - { - "id": "task_008998_ae4cbe72", - "source": "/opt/native-shell/tasks/task_008998_ae4cbe72/source", - "pristine_workspace": "/opt/native-shell/tasks/task_008998_ae4cbe72/pristine", - "workspace": "/home/user", - "inputs": [ - "/home/user/robot_dump.log.gz" - ], - "outputs": [ - "/home/user/archived_gcode", - "/home/user/critical_errors.csv" - ], - "editable": [], - "external_inputs": {}, - "grading_mode": "file-output", - "grader": { - "kind": "pytest", - "test_file": "test_final_state.py", - "executes_learner_code": false - }, - "python": "/usr/bin/python3", - "cpus": 1, - "memory_mb": 2048, - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "source_sha256": { - "instruction.md": "f81f86b07681931baabdba313cc4e988c01bff7a1f1d83349dfa939cdaa20669", - "task.toml": "c8ff58ad07c30c2da028625be23e41319f95e22524944c9d37de2ec255428cd9", - "tests/test.sh": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "tests/test_final_state.py": "e03b84ca0519367e5f86b7b3a3231afa5209b1971431497699200099035f5014" - }, - "pristine_sha256": { - "robot_dump.log.gz": "909d2e964c0831d8af91b722b4424ed829c261d6b7db1a95180d8a809527ddaf" - }, - "pristine_permissions": { - "robot_dump.log.gz": 420 - } - }, - { - "id": "task_008667_2151f271", - "source": "/opt/native-shell/tasks/task_008667_2151f271/source", - "pristine_workspace": "/opt/native-shell/tasks/task_008667_2151f271/pristine", - "workspace": "/home/user", - "inputs": [ - "/home/user/data/financial.db", - "/home/user/data/transactions.jsonl" - ], - "outputs": [ - "/home/user/output/fraud_cycles.json" - ], - "editable": [], - "external_inputs": {}, - "grading_mode": "file-output", - "grader": { - "kind": "pytest", - "test_file": "test_final_state.py", - "executes_learner_code": false - }, - "python": "/usr/bin/python3", - "cpus": 1, - "memory_mb": 2048, - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "source_sha256": { - "instruction.md": "50d1d10121dfa3b565842fd10f2589ceb91b4459126787af7793cec9cc0d06b1", - "task.toml": "d45954c25df30184144533cbf3ad4160377f627db5b926c3bbc9186327067897", - "tests/test.sh": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "tests/test_final_state.py": "cb73fd0ab1765768ebfecc50054ba13c143cc51be201127515eb495904ddf9e6" - }, - "pristine_sha256": { - "data/financial.db": "d6b5039ee32f3a43069245984c8fe5a9689028a9aac06e26a64017c54bd11976", - "data/transactions.jsonl": "629b28471809f802c58831d100315b83012c0066df3b265a2d379a19e61a2262" - }, - "pristine_permissions": { - "data": 493, - "data/financial.db": 420, - "data/transactions.jsonl": 420 - } - }, - { - "id": "task_000260_7b7cc286", - "source": "/opt/native-shell/tasks/task_000260_7b7cc286/source", - "pristine_workspace": "/opt/native-shell/tasks/task_000260_7b7cc286/pristine", - "workspace": "/home/user", - "inputs": [ - "/app/video.mp4" - ], - "outputs": [ - "/home/user/output.json" - ], - "editable": [ - "/home/user/pipeline" - ], - "external_inputs": { - "/app/video.mp4": "/opt/native-shell/tasks/task_000260_7b7cc286/source/external/app/video.mp4" - }, - "grading_mode": "file-output", - "grader": { - "kind": "pytest", - "test_file": "test_final_state.py", - "executes_learner_code": false - }, - "python": "/usr/bin/python3", - "cpus": 1, - "memory_mb": 2048, - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "source_sha256": { - "external/app/video.mp4": "3c04251fe92c30d29ac4d887608f4385176e3bda932594437f82b08a5b348938", - "instruction.md": "79c9fd4e4d41524db109d90b0415a4f0a2b9d24bf690fa8d7340ce3cb5ce0975", - "task.toml": "d36c49060b4ddbca3b13a5aa98cf5b195c07bff725b91107f58a087ec4325423", - "tests/test.sh": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "tests/test_final_state.py": "aae204101d5c024a0b5cbda42fa686e7d2928fd9be3ad55fd14314b2502182a5" - }, - "pristine_sha256": { - "pipeline/find_threshold.sh": "a6c4cf2043d8642babb9b546096b3f559a375b59d54a43efebd57e9728466184", - "pipeline/process.sh": "4631f1f805e6b826a796502ed5d94e676b3061cf448f2f9225116395aa3bb13b", - "pipeline/serialize.sh": "f3ae2df41978712dbffe58665a9582e3d0951f211c5cca5ece9f536225d28ba8" - }, - "pristine_permissions": { - "pipeline": 493, - "pipeline/find_threshold.sh": 511, - "pipeline/serialize.sh": 511, - "pipeline/process.sh": 511 - } - }, - { - "id": "task_000056_f726766b", - "source": "/opt/native-shell/tasks/task_000056_f726766b/source", - "pristine_workspace": "/opt/native-shell/tasks/task_000056_f726766b/pristine", - "workspace": "/home/user", - "inputs": [ - "/app/vibration_data.wav" - ], - "outputs": [ - "/home/user/parameters.json" - ], - "editable": [], - "external_inputs": { - "/app/vibration_data.wav": "/opt/native-shell/tasks/task_000056_f726766b/source/external/app/vibration_data.wav" - }, - "grading_mode": "file-output", - "grader": { - "kind": "pytest", - "test_file": "test_final_state.py", - "executes_learner_code": false - }, - "python": "/usr/bin/python3", - "cpus": 1, - "memory_mb": 2048, - "agent_timeout_sec": 600.0, - "verifier_timeout_sec": 120.0, - "source_sha256": { - "external/app/vibration_data.wav": "eab8396a1b533f70468039f8ac1b5fe9927faf4ded578172ec932ef7bf2af22a", - "instruction.md": "714f780883970365cfffe408e2c76e75f499005f87551fc84b55d79368e77197", - "task.toml": "e36405ea22dc2679124b64c5e8d7f3c52fb3cfa9f529d4694e26532db5b341d0", - "tests/test.sh": "3ae0ce20b61928cc7f524ea6fb43ed55d3df32a9a87834825518d2397e31672e", - "tests/test_final_state.py": "327c5346a779a44e27ef0cbd9f107e863d599fc6e47f95f248eaec03c15117c4" - }, - "pristine_sha256": {}, - "pristine_permissions": {} - } - ], - "private_root": "/opt/native-shell/private", - "max_actions": 64, - "command_timeout_sec": 90, - "output_limit_bytes": 65536 -} diff --git a/components/tmax/licenses/ODC-BY-1.0.txt b/components/tmax/licenses/ODC-BY-1.0.txt deleted file mode 100644 index a12f30e302933f0f2db88e7ce93186a34b9535fd..0000000000000000000000000000000000000000 --- a/components/tmax/licenses/ODC-BY-1.0.txt +++ /dev/null @@ -1,428 +0,0 @@ -# ODC Attribution License (ODC-By) - -### Preamble - -The Open Data Commons Attribution License is a license agreement -intended to allow users to freely share, modify, and use this Database -subject only to the attribution requirements set out in Section 4. - -Databases can contain a wide variety of types of content (images, -audiovisual material, and sounds all in the same database, for example), -and so this license only governs the rights over the Database, and not -the contents of the Database individually. Licensors may therefore wish -to use this license together with another license for the contents. - -Sometimes the contents of a database, or the database itself, can be -covered by other rights not addressed here (such as private contracts, -trademark over the name, or privacy rights / data protection rights -over information in the contents), and so you are advised that you may -have to consult other documents or clear other rights before doing -activities not covered by this License. - ------- - -The Licensor (as defined below) - -and - -You (as defined below) - -agree as follows: - -### 1.0 Definitions of Capitalised Words - -"Collective Database" - Means this Database in unmodified form as part -of a collection of independent databases in themselves that together are -assembled into a collective whole. A work that constitutes a Collective -Database will not be considered a Derivative Database. - -"Convey" - As a verb, means Using the Database, a Derivative Database, -or the Database as part of a Collective Database in any way that enables -a Person to make or receive copies of the Database or a Derivative -Database. Conveying does not include interaction with a user through a -computer network, or creating and Using a Produced Work, where no -transfer of a copy of the Database or a Derivative Database occurs. - -"Contents" - The contents of this Database, which includes the -information, independent works, or other material collected into the -Database. For example, the contents of the Database could be factual -data or works such as images, audiovisual material, text, or sounds. - -"Database" - A collection of material (the Contents) arranged in a -systematic or methodical way and individually accessible by electronic -or other means offered under the terms of this License. - -"Database Directive" - Means Directive 96/9/EC of the European -Parliament and of the Council of 11 March 1996 on the legal protection -of databases, as amended or succeeded. - -"Database Right" - Means rights resulting from the Chapter III ("sui -generis") rights in the Database Directive (as amended and as transposed -by member states), which includes the Extraction and Re-utilisation of -the whole or a Substantial part of the Contents, as well as any similar -rights available in the relevant jurisdiction under Section 10.4. - -"Derivative Database" - Means a database based upon the Database, and -includes any translation, adaptation, arrangement, modification, or any -other alteration of the Database or of a Substantial part of the -Contents. This includes, but is not limited to, Extracting or -Re-utilising the whole or a Substantial part of the Contents in a new -Database. - -"Extraction" - Means the permanent or temporary transfer of all or a -Substantial part of the Contents to another medium by any means or in -any form. - -"License" - Means this license agreement and is both a license of rights -such as copyright and Database Rights and an agreement in contract. - -"Licensor" - Means the Person that offers the Database under the terms -of this License. - -"Person" - Means a natural or legal person or a body of persons -corporate or incorporate. - -"Produced Work" - a work (such as an image, audiovisual material, text, -or sounds) resulting from using the whole or a Substantial part of the -Contents (via a search or other query) from this Database, a Derivative -Database, or this Database as part of a Collective Database. - -"Publicly" - means to Persons other than You or under Your control by -either more than 50% ownership or by the power to direct their -activities (such as contracting with an independent consultant). - -"Re-utilisation" - means any form of making available to the public all -or a Substantial part of the Contents by the distribution of copies, by -renting, by online or other forms of transmission. - -"Substantial" - Means substantial in terms of quantity or quality or a -combination of both. The repeated and systematic Extraction or -Re-utilisation of insubstantial parts of the Contents may amount to the -Extraction or Re-utilisation of a Substantial part of the Contents. - -"Use" - As a verb, means doing any act that is restricted by copyright -or Database Rights whether in the original medium or any other; and -includes without limitation distributing, copying, publicly performing, -publicly displaying, and preparing derivative works of the Database, as -well as modifying the Database as may be technically necessary to use it -in a different mode or format. - -"You" - Means a Person exercising rights under this License who has not -previously violated the terms of this License with respect to the -Database, or who has received express permission from the Licensor to -exercise rights under this License despite a previous violation. - -Words in the singular include the plural and vice versa. - -### 2.0 What this License covers - -2.1. Legal effect of this document. This License is: - - a. A license of applicable copyright and neighbouring rights; - - b. A license of the Database Right; and - - c. An agreement in contract between You and the Licensor. - -2.2 Legal rights covered. This License covers the legal rights in the -Database, including: - - a. Copyright. Any copyright or neighbouring rights in the Database. - The copyright licensed includes any individual elements of the - Database, but does not cover the copyright over the Contents - independent of this Database. See Section 2.4 for details. Copyright - law varies between jurisdictions, but is likely to cover: the Database - model or schema, which is the structure, arrangement, and organisation - of the Database, and can also include the Database tables and table - indexes; the data entry and output sheets; and the Field names of - Contents stored in the Database; - - b. Database Rights. Database Rights only extend to the Extraction and - Re-utilisation of the whole or a Substantial part of the Contents. - Database Rights can apply even when there is no copyright over the - Database. Database Rights can also apply when the Contents are removed - from the Database and are selected and arranged in a way that would - not infringe any applicable copyright; and - - c. Contract. This is an agreement between You and the Licensor for - access to the Database. In return you agree to certain conditions of - use on this access as outlined in this License. - -2.3 Rights not covered. - - a. This License does not apply to computer programs used in the making - or operation of the Database; - - b. This License does not cover any patents over the Contents or the - Database; and - - c. This License does not cover any trademarks associated with the - Database. - -2.4 Relationship to Contents in the Database. The individual items of -the Contents contained in this Database may be covered by other rights, -including copyright, patent, data protection, privacy, or personality -rights, and this License does not cover any rights (other than Database -Rights or in contract) in individual Contents contained in the Database. -For example, if used on a Database of images (the Contents), this -License would not apply to copyright over individual images, which could -have their own separate licenses, or one single license covering all of -the rights over the images. - -### 3.0 Rights granted - -3.1 Subject to the terms and conditions of this License, the Licensor -grants to You a worldwide, royalty-free, non-exclusive, terminable (but -only under Section 9) license to Use the Database for the duration of -any applicable copyright and Database Rights. These rights explicitly -include commercial use, and do not exclude any field of endeavour. To -the extent possible in the relevant jurisdiction, these rights may be -exercised in all media and formats whether now known or created in the -future. - -The rights granted cover, for example: - - a. Extraction and Re-utilisation of the whole or a Substantial part of - the Contents; - - b. Creation of Derivative Databases; - - c. Creation of Collective Databases; - - d. Creation of temporary or permanent reproductions by any means and - in any form, in whole or in part, including of any Derivative - Databases or as a part of Collective Databases; and - - e. Distribution, communication, display, lending, making available, or - performance to the public by any means and in any form, in whole or in - part, including of any Derivative Database or as a part of Collective - Databases. - -3.2 Compulsory license schemes. For the avoidance of doubt: - - a. Non-waivable compulsory license schemes. In those jurisdictions in - which the right to collect royalties through any statutory or - compulsory licensing scheme cannot be waived, the Licensor reserves - the exclusive right to collect such royalties for any exercise by You - of the rights granted under this License; - - b. Waivable compulsory license schemes. In those jurisdictions in - which the right to collect royalties through any statutory or - compulsory licensing scheme can be waived, the Licensor waives the - exclusive right to collect such royalties for any exercise by You of - the rights granted under this License; and, - - c. Voluntary license schemes. The Licensor waives the right to collect - royalties, whether individually or, in the event that the Licensor is - a member of a collecting society that administers voluntary licensing - schemes, via that society, from any exercise by You of the rights - granted under this License. - -3.3 The right to release the Database under different terms, or to stop -distributing or making available the Database, is reserved. Note that -this Database may be multiple-licensed, and so You may have the choice -of using alternative licenses for this Database. Subject to Section -10.4, all other rights not expressly granted by Licensor are reserved. - -### 4.0 Conditions of Use - -4.1 The rights granted in Section 3 above are expressly made subject to -Your complying with the following conditions of use. These are important -conditions of this License, and if You fail to follow them, You will be -in material breach of its terms. - -4.2 Notices. If You Publicly Convey this Database, any Derivative -Database, or the Database as part of a Collective Database, then You -must: - - a. Do so only under the terms of this License; - - b. Include a copy of this License or its Uniform Resource Identifier (URI) - with the Database or Derivative Database, including both in the - Database or Derivative Database and in any relevant documentation; - - c. Keep intact any copyright or Database Right notices and notices - that refer to this License; and - - d. If it is not possible to put the required notices in a particular - file due to its structure, then You must include the notices in a - location (such as a relevant directory) where users would be likely to - look for it. - -4.3 Notice for using output (Contents). Creating and Using a Produced -Work does not require the notice in Section 4.2. However, if you -Publicly Use a Produced Work, You must include a notice associated with -the Produced Work reasonably calculated to make any Person that uses, -views, accesses, interacts with, or is otherwise exposed to the Produced -Work aware that Content was obtained from the Database, Derivative -Database, or the Database as part of a Collective Database, and that it -is available under this License. - - a. Example notice. The following text will satisfy notice under - Section 4.3: - - Contains information from DATABASE NAME which is made available - under the ODC Attribution License. - -DATABASE NAME should be replaced with the name of the Database and a -hyperlink to the location of the Database. "ODC Attribution License" -should contain a hyperlink to the URI of the text of this License. If -hyperlinks are not possible, You should include the plain text of the -required URI's with the above notice. - -4.4 Licensing of others. You may not sublicense the Database. Each time -You communicate the Database, the whole or Substantial part of the -Contents, or any Derivative Database to anyone else in any way, the -Licensor offers to the recipient a license to the Database on the same -terms and conditions as this License. You are not responsible for -enforcing compliance by third parties with this License, but You may -enforce any rights that You have over a Derivative Database. You are -solely responsible for any modifications of a Derivative Database made -by You or another Person at Your direction. You may not impose any -further restrictions on the exercise of the rights granted or affirmed -under this License. - -### 5.0 Moral rights - -5.1 Moral rights. This section covers moral rights, including any rights -to be identified as the author of the Database or to object to treatment -that would otherwise prejudice the author's honour and reputation, or -any other derogatory treatment: - - a. For jurisdictions allowing waiver of moral rights, Licensor waives - all moral rights that Licensor may have in the Database to the fullest - extent possible by the law of the relevant jurisdiction under Section - 10.4; - - b. If waiver of moral rights under Section 5.1 a in the relevant - jurisdiction is not possible, Licensor agrees not to assert any moral - rights over the Database and waives all claims in moral rights to the - fullest extent possible by the law of the relevant jurisdiction under - Section 10.4; and - - c. For jurisdictions not allowing waiver or an agreement not to assert - moral rights under Section 5.1 a and b, the author may retain their - moral rights over certain aspects of the Database. - -Please note that some jurisdictions do not allow for the waiver of moral -rights, and so moral rights may still subsist over the Database in some -jurisdictions. - -### 6.0 Fair dealing, Database exceptions, and other rights not affected - -6.1 This License does not affect any rights that You or anyone else may -independently have under any applicable law to make any use of this -Database, including without limitation: - - a. Exceptions to the Database Right including: Extraction of Contents - from non-electronic Databases for private purposes, Extraction for - purposes of illustration for teaching or scientific research, and - Extraction or Re-utilisation for public security or an administrative - or judicial procedure. - - b. Fair dealing, fair use, or any other legally recognised limitation - or exception to infringement of copyright or other applicable laws. - -6.2 This License does not affect any rights of lawful users to Extract -and Re-utilise insubstantial parts of the Contents, evaluated -quantitatively or qualitatively, for any purposes whatsoever, including -creating a Derivative Database (subject to other rights over the -Contents, see Section 2.4). The repeated and systematic Extraction or -Re-utilisation of insubstantial parts of the Contents may however amount -to the Extraction or Re-utilisation of a Substantial part of the -Contents. - -### 7.0 Warranties and Disclaimer - -7.1 The Database is licensed by the Licensor "as is" and without any -warranty of any kind, either express, implied, or arising by statute, -custom, course of dealing, or trade usage. Licensor specifically -disclaims any and all implied warranties or conditions of title, -non-infringement, accuracy or completeness, the presence or absence of -errors, fitness for a particular purpose, merchantability, or otherwise. -Some jurisdictions do not allow the exclusion of implied warranties, so -this exclusion may not apply to You. - -### 8.0 Limitation of liability - -8.1 Subject to any liability that may not be excluded or limited by law, -the Licensor is not liable for, and expressly excludes, all liability -for loss or damage however and whenever caused to anyone by any use -under this License, whether by You or by anyone else, and whether caused -by any fault on the part of the Licensor or not. This exclusion of -liability includes, but is not limited to, any special, incidental, -consequential, punitive, or exemplary damages such as loss of revenue, -data, anticipated profits, and lost business. This exclusion applies -even if the Licensor has been advised of the possibility of such -damages. - -8.2 If liability may not be excluded by law, it is limited to actual and -direct financial loss to the extent it is caused by proved negligence on -the part of the Licensor. - -### 9.0 Termination of Your rights under this License - -9.1 Any breach by You of the terms and conditions of this License -automatically terminates this License with immediate effect and without -notice to You. For the avoidance of doubt, Persons who have received the -Database, the whole or a Substantial part of the Contents, Derivative -Databases, or the Database as part of a Collective Database from You -under this License will not have their licenses terminated provided -their use is in full compliance with this License or a license granted -under Section 4.8 of this License. Sections 1, 2, 7, 8, 9 and 10 will -survive any termination of this License. - -9.2 If You are not in breach of the terms of this License, the Licensor -will not terminate Your rights under it. - -9.3 Unless terminated under Section 9.1, this License is granted to You -for the duration of applicable rights in the Database. - -9.4 Reinstatement of rights. If you cease any breach of the terms and -conditions of this License, then your full rights under this License -will be reinstated: - - a. Provisionally and subject to permanent termination until the 60th - day after cessation of breach; - - b. Permanently on the 60th day after cessation of breach unless - otherwise reasonably notified by the Licensor; or - - c. Permanently if reasonably notified by the Licensor of the - violation, this is the first time You have received notice of - violation of this License from the Licensor, and You cure the - violation prior to 30 days after your receipt of the notice. - -9.5 Notwithstanding the above, Licensor reserves the right to release -the Database under different license terms or to stop distributing or -making available the Database. Releasing the Database under different -license terms or stopping the distribution of the Database will not -withdraw this License (or any other license that has been, or is -required to be, granted under the terms of this License), and this -License will continue in full force and effect unless terminated as -stated above. - -### 10.0 General - -10.1 If any provision of this License is held to be invalid or -unenforceable, that must not affect the validity or enforceability of -the remainder of the terms and conditions of this License and each -remaining provision of this License shall be valid and enforced to the -fullest extent permitted by law. - -10.2 This License is the entire agreement between the parties with -respect to the rights granted here over the Database. It replaces any -earlier understandings, agreements or representations with respect to -the Database. - -10.3 If You are in breach of the terms of this License, You will not be -entitled to rely on the terms of this License or to complain of any -breach by the Licensor. - -10.4 Choice of law. This License takes effect in and will be governed by -the laws of the relevant jurisdiction in which the License terms are -sought to be enforced. If the standard suite of rights granted under -applicable copyright law and Database Rights in the relevant -jurisdiction includes additional rights not granted under this License, -these additional rights are granted in this License in order to meet the -terms of this License. diff --git a/components/tmax/licenses/TMAX_DATASET_README.md b/components/tmax/licenses/TMAX_DATASET_README.md deleted file mode 100644 index 1dc1a90390a455355e7f0853edd7068f9d538a8a..0000000000000000000000000000000000000000 --- a/components/tmax/licenses/TMAX_DATASET_README.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -license: odc-by -language: -- en ---- - -![image](https://cdn-uploads.huggingface.co/production/uploads/62608fc2ffe8827cb1d89f9f/XMW9_q0GCubxzTOgdsb4K.png) -

- 💻 Code · - 🤗 Models & Data · - 📜 Paper · - 📓 Blog -

- -> [!NOTE] -> For full information, go check out the Tmax paper [here](https://arxiv.org/abs/2606.23321). - -# TMax 15k - Open Instruct - -This is the dataset we used to train [Tmax 9b](https://huggingface.co/allenai/tmax-9b) (and our other tmax models). -This release contains general details on the data. -In general, this is a collection of roughly 15k RL environment instances. -For details on how we generated this dataset and its makeup, please see our paper! - -**You can find a version of this dataset ready for training [here](https://huggingface.co/datasets/allenai/tmax-15k-open-instruct)!** - -## License - -This dataset is licensed under ODC-BY. -It is intended for research and educational use in accordance with Ai2's [Responsible Use Guidelines](https://allenai.org/responsible-use). -The data includes outputs generated using Gemini 3.1 Pro, which are subject to Google's [Terms of Service](https://policies.google.com/terms). - -## Citation - -If you use our model or data, please cite our paper: -``` -@misc{ivison2026tmaxsimplerecipeterminal, - title={Tmax: A simple recipe for terminal agents}, - author={Hamish Ivison and Junjie Oscar Yin and Rulin Shao and Teng Xiao and Nathan Lambert and Hannaneh Hajishirzi}, - year={2026}, - eprint={2606.23321}, - archivePrefix={arXiv}, - primaryClass={cs.CL}, - url={https://arxiv.org/abs/2606.23321}, -} -``` \ No newline at end of file diff --git a/components/tmax/requirements.lock b/components/tmax/requirements.lock deleted file mode 100644 index 6189c5eb255896cb59d46277f7acbd81419398ef..0000000000000000000000000000000000000000 --- a/components/tmax/requirements.lock +++ /dev/null @@ -1,110 +0,0 @@ -aiofile==3.12.3 --hash=sha256:5c1bcc9e929c50834608e8cc1a4cc1d7503eb60c15a535b779fd39e2f372c017 -annotated-doc==0.0.5 --hash=sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101 -annotated-types==0.8.0 --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 -anyio==4.15.1 --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101 -attrs==26.1.0 --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 -authlib==1.8.0 --hash=sha256:88aebbd9af6757e14e912d5dc007ae1dc1f3e27e3b2152ce7c552ee2c3b3c121 -backports.tarfile==1.2.0 --hash=sha256:77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34 -beartype==0.23.0 --hash=sha256:a88b85be516c064d4de2b42045a258a43be97bce5cbc18b777f332027c0979f7 -brotli==1.2.0 --hash=sha256:40d918bce2b427a0c4ba189df7a006ac0c7277c180aee4617d99e9ccaaf59e6a -cachetools==7.2.1 --hash=sha256:63aa53dfe7473c10cccdd5a01dedf76ef2c4b73a58840d9396e7d0752cbdac3b -caio==0.12.9 --hash=sha256:bf12d4f014b2a33e642ed7905b5787656ede2fc24be21f7c086826ff0d32cec3 -certifi==2026.7.22 --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775 -cffi==2.1.1 --hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 -charset-normalizer==3.5.2 --hash=sha256:211d5a3eb6af8f513b8d4ca19a8c1b7accab1b5f0d3175f9826b03c1a920dc1f -click==8.5.0 --hash=sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360 -cryptography==50.0.2 --hash=sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856 -cyclopts==5.2.0 --hash=sha256:5da2a5d65164e03008621fc4795946b88a722b881398b5dfa58afa6218342cff -dnspython==2.9.0 --hash=sha256:9a4aedb833c3c1b49214d04d44d3032ab7a9135f7c1d29a549b4ff78fd82fda9 -docstring-parser==0.18.0 --hash=sha256:b3fcbed555c47d8479be0796ef7e19c2670d428d72e96da63f3a40122860374b -email-validator==2.3.0 --hash=sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4 -exceptiongroup==1.3.1 --hash=sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598 -fastapi==0.143.0 --hash=sha256:3e9395fd35276425b61b516a31fdd7c77fe2af83e41b4da22e30696fb1304c5d -fastmcp==3.4.8 --hash=sha256:ab4e8abe6c9d50b110f367e8c29f82b90c1478ac9180be61af10354f84f0ad8c -fastmcp-slim==3.4.8 --hash=sha256:e72c6b74e90c5dcdc8f58087fbdf213636d8b5d339384a498de1c5df6fc037a7 -filelock==4.1.0 --hash=sha256:2ce9818e3e2d8f284c1a964414447ef148d42a5fd5e2a477a7118e574b293ec1 -fsspec==2026.9.0 --hash=sha256:8dd6e646e99ea382bd85f97a45e6b526a442d79423a7dc673f1e2756d05fcb5f -gradio==6.30.0 --hash=sha256:aae3aa81ec9f44e55781b498ad2ba12b117aa512e8d2bb0ef3e52af7f2ee6305 -gradio-client==2.7.2 --hash=sha256:12c9d2d940df28eb8dce58eef61f5e808265ad87bbbca53704d1330aa701e5e2 -griffelib==2.3.2 --hash=sha256:8e710afededd5607f95bf3c8ccc175ee306e7084459faf27b9f9f44ef2a7a274 -groovy==0.1.2 --hash=sha256:7f7975bab18c729a257a8b1ae9dcd70b7cafb1720481beae47719af57c35fa64 -h11==0.16.0 --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 -hf-gradio==0.4.1 --hash=sha256:76b8cb8be6abe62d74c1ad2d35b42f0629db89aa9e1a8d033cecfe7c856eeab3 -hf-xet==1.7.0 --hash=sha256:2814a6e999d13464c4d679b788cc5d784eb5a4edfc638a31f10e9a11ab531ef8 -httpcore==1.0.9 --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55 -httpcore2==2.13.1 --hash=sha256:e1e05d4f25f7d7d496bfb96748f6f4b67657b03da069b3a68c36069f3db73d0a -httpx==0.28.1 --hash=sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad -httpx-sse==0.4.3 --hash=sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc -httpx2==2.13.1 --hash=sha256:6dff50fabc270ee5fd25d845d0b078ed20564579744d6d962850975996d2f9a4 -huggingface-hub==2.2.0 --hash=sha256:1667f145dc56dc210d60966069397df9ecfca9607a5d43db88b308c89dae56b3 -idna==3.20 --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c -importlib-metadata==9.0.1 --hash=sha256:bba5600596a7e21f3eef53281cf28d6a5195634d2f2b78ff9501a3272c6eaab0 -jaraco.classes==3.4.0 --hash=sha256:f662826b6bed8cace05e7ff873ce0f9283b5c924470fe664fff1c2f00f581790 -jaraco.context==6.1.2 --hash=sha256:bf8150b79a2d5d91ae48629d8b427a8f7ba0e1097dd6202a9059f29a36379535 -jaraco.functools==4.6.0 --hash=sha256:99e3dc0060c5cbe8fcd1cdb36258e2a65ca40f1566b2033b12abb1bb44dd3c30 -jeepney==0.9.0 --hash=sha256:97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683 -jinja2==3.1.6 --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 -jiter==0.17.0 --hash=sha256:5888fe5abc1ca2fa834a3e1b4c7ef0dcece286a7d7e95a609ef0934b777b9fc9 -joserfc==1.7.5 --hash=sha256:add2c2c84e8373b084d526a8b53daba5d7a513a118cd2dcd9fc9f979d0922159 -jsonref==1.1.0 --hash=sha256:590dc7773df6c21cbf948b5dac07a72a251db28b0238ceecce0a2abfa8ec30a9 -jsonschema==4.26.0 --hash=sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce -jsonschema-path==0.5.0 --hash=sha256:2790a070bc7abb08ea3dbe4d340ece4efadf639223001f020c7503229ba068e2 -jsonschema-specifications==2025.9.1 --hash=sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe -keyring==25.7.0 --hash=sha256:be4a0b195f149690c166e850609a477c532ddbfbaed96a404d4e43f8d5e2689f -markdown-it-py==4.2.0 --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a -markupsafe==3.0.4 --hash=sha256:6da83a088f8ef93b2d483a8232a4dbf4d69d3d8496b568a03c56becac43e1808 -mcp==1.30.0 --hash=sha256:666edb5009503e1047c9d60346a756f94b261f05cc2625f23d41c728ffc484d0 -mdurl==0.1.2 --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 -more-itertools==11.1.0 --hash=sha256:4b65538ae22f6fed0ce4874efd317463a7489796a0939fa66824dd542125a192 -numpy==2.4.6 --hash=sha256:89cd468399cfd2504718f0ba50e410dca55a170b61a02ad92bb18c8a65186e93 -openai==3.28.0 --hash=sha256:1ea40a084ffe2f9f16fd3bea6e870f757853b536b18d8e737c518ef849a2920c -openapi-pydantic==0.6.0 --hash=sha256:8bd6d548a250da37db96f461bcd52b3468e8834ad7d6db14b00a6b2ebbd163a3 -openenv==0.6.1.dev0 --hash=sha256:93a5781b64e2f174f17fff40a558d43745a7f4e48a8b247363da4f27906be53a -opentelemetry-api==1.45.1 --hash=sha256:b31553efa588ae44bc306f863c785c5333a9ecc091248c6ee68b4b6c87fdedfb -orjson==3.13.0 --hash=sha256:89bcf2d4bc6c9a7e1763c8cf534f38712e66b76a0fefda7fb7785462f0d635e4 -packaging==26.3 --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c -pandas==3.0.6 --hash=sha256:47121f9571503f724c9b93e297ab6254ac99c77adf5e9ed085ea419fd585c258 -pathable==0.6.0 --hash=sha256:82c4ca6c98c502ad12e0d4e9779b6210afee93c38990988c8c5d1b49bdcdf566 -pillow==12.3.0 --hash=sha256:23d27a3e0307ec2244cc51e7287b919aa68d097504ebe19df4e76a98a3eea5bd -platformdirs==4.12.4 --hash=sha256:78bfb9db2a8471ed7eebe3c3c932da413911042994e699b384fbb4493fa872d7 -py-key-value-aio==0.4.6 --hash=sha256:820b30c7959fc738ea3d00160cdb10cd258f51e38737b2add530defeea1ded77 -pycparser==3.11 --hash=sha256:51d5a8ba2be0bbe440b99d2112604c95bbbc3c2748a64260186c541e1729cd80 -pydantic==2.14.0 --hash=sha256:15fab1bea6f1dc5003b54fc2ecab230c1fd1dbade2acd4addc52d81e32416d4b -pydantic-core==2.50.0 --hash=sha256:ac223ea031905319a64d0df116979ae438b42d6265862a3d63c9f9808c2905a7 -pydantic-settings==2.15.0 --hash=sha256:0ba092c291c94baceb5eff768aa0d56400a457585bc0175925a5a5510303da42 -pydub==0.25.1 --hash=sha256:65617e33033874b59d87db603aa1ed450633288aefead953b30bded59cb599a6 -pygments==2.21.0 --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 -pyjwt==2.15.1 --hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193 -pyperclip==1.11.0 --hash=sha256:299403e9ff44581cb9ba2ffeed69c7aa96a008622ad0c46cb575ca75b5b84273 -python-dateutil==2.9.0.post0 --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 -python-dotenv==1.2.4 --hash=sha256:42269a8a5b3fd54ffa6f3d84b18abed50064717576b4ecf03dc4a55d8aa04fdc -python-multipart==0.0.32 --hash=sha256:ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23 -pytz==2026.5 --hash=sha256:e658af3757f9e26a9d25dd2aff38335acd92bc9104f890a894b2c1ba28311b03 -pyyaml==6.0.3 --hash=sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d -referencing==0.37.0 --hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231 -requests==2.34.2 --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 -rich==15.0.0 --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb -rich-rst==2.2.0 --hash=sha256:1ea1c43813dc4a8d86475fce27ffb74e0ada3d4656c9f8130ba2a59868055fe9 -rpds-py==2026.9.1 --hash=sha256:136a1c3fe4402b7008bc81cb62ee538481795b61a7e83df88dff3b3f02b726ff -safehttpx==0.1.7 --hash=sha256:c4f4a162db6993464d7ca3d7cc4af0ffc6515a606dfd220b9f82c6945d869cde -secretstorage==3.5.0 --hash=sha256:0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137 -semantic-version==2.10.0 --hash=sha256:de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177 -shellingham==1.5.4 --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 -six==1.17.0 --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 -sniffio==1.3.1 --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 -sse-starlette==3.5.0 --hash=sha256:3e6e1070df3f0f5d9cea81496de92dbb72f6721871d99748ece67441dd8b7997 -starlette==1.7.0 --hash=sha256:67f8e99895493dd2911a03f11314af6ceebeae4e704bb9f43dfc6a9db151c93e -tomli==2.5.0 --hash=sha256:d7e369fd63331746182360977b1892bfc215476a30d61612d732425311639f56 -tomli-w==1.2.0 --hash=sha256:188306098d013b691fcadc011abd66727d3c414c571bb01b1a174ba8c983cf90 -tomlkit==0.14.0 --hash=sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680 -tqdm==4.70.1 --hash=sha256:c293e525e6fef9c20e8728fd4612df02a0aa31bb5fe91ecd93e123b1b7bffa73 -truststore==0.10.4 --hash=sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981 -typer==0.27.3 --hash=sha256:e50022f28b82a86313e54501317a1db64bf8f8d036ff8cfe5ca7e47675454aff -typing-extensions==4.16.0 --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 -typing-inspection==0.4.4 --hash=sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147 -uncalled-for==0.4.1 --hash=sha256:b611b38879d9fe5088297e7bb28f2ddd12d2d73dad933d93da107fb63eb4058e -urllib3==2.8.0 --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 -uvicorn==0.54.0 --hash=sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf -watchfiles==1.3.0 --hash=sha256:b5768b49e426fd5b550b012c866db347cdf15c398ef98dc557b6e6b72fa74cd1 -websockets==17.2 --hash=sha256:376a693697ddb695ea282ead76060f4847f90e564b12b4389f2c7589e6fadb9e -zipp==4.1.1 --hash=sha256:8979f52d874162f485ff2981e3891f3a3317b7a3dd43ff1e1775b9304f307a9c diff --git a/components/tmax/runtime/common/__init__.py b/components/tmax/runtime/common/__init__.py deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/common/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/components/tmax/runtime/common/contracts.py b/components/tmax/runtime/common/contracts.py deleted file mode 100644 index b33d03fd3c21f3b117be3a4664274c109ac6fa9d..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/common/contracts.py +++ /dev/null @@ -1,7 +0,0 @@ - -from copy import deepcopy - -ACTION_SCHEMA = {'type': 'object', 'description': 'Return one action object per reply, then wait for its observation. To finish, send {"op":"finish"}. A command is a JSON string: encode newlines as \\n and internal double quotes as \\". Do not wrap the object in prose, Markdown, or tags.', 'examples': [{'op': 'finish'}], 'oneOf': [{'properties': {'op': {'const': 'exec'}, 'command': {'type': 'string'}}, 'required': ['op', 'command'], 'additionalProperties': False}, {'properties': {'op': {'const': 'call'}, 'tool': {'type': 'string'}, 'arguments': {'type': 'object'}}, 'required': ['op', 'tool', 'arguments'], 'additionalProperties': False}, {'properties': {'op': {'const': 'finish'}}, 'required': ['op'], 'additionalProperties': False}]} - -def observation_payload(task_id, message, data=None, reward=0.0, done=False): - return {"task_id": str(task_id), "message": str(message), "data": {} if data is None else data, "reward": reward, "done": bool(done), "metadata": {}} diff --git a/components/tmax/runtime/common/http_routes.py b/components/tmax/runtime/common/http_routes.py deleted file mode 100644 index a3ab94f85fc92d044895d022d16d4659be018d8b..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/common/http_routes.py +++ /dev/null @@ -1,64 +0,0 @@ - -from threading import RLock -from contextlib import asynccontextmanager -from copy import deepcopy -from fastapi import HTTPException -from pydantic import ValidationError -from starlette.concurrency import run_in_threadpool -from openenv.core.env_server.serialization import serialize_observation -from openenv.core.env_server.types import ResetRequest,ResetResponse,StepRequest,StepResponse -from .models import ArenaAction - - -def install_persistent_http_routes(app,env,conflict_error=None): - lock=RLock() - app.router.routes=[route for route in app.router.routes if getattr(route,'path',None) not in {'/reset','/step','/state'}] - - def reset_sync(request): - with lock: - return ResetResponse(**serialize_observation(env.reset(**request.model_dump(exclude_unset=True)))) - - def step_sync(request): - with lock: - action=ArenaAction.model_validate(request.action) - return StepResponse(**serialize_observation(env.step(action,timeout_s=request.timeout_s))) - - def state_sync(): - with lock: - value=env.state - return value.model_copy(deep=True) if hasattr(value,'model_copy') else deepcopy(value) - - @app.post('/reset',response_model=ResetResponse) - async def reset(request:ResetRequest): - try:return await run_in_threadpool(reset_sync,request) - except (ValueError,IndexError) as exc:raise HTTPException(status_code=400,detail=str(exc)) from exc - except Exception as exc: - if conflict_error is not None and isinstance(exc,conflict_error): - raise HTTPException(status_code=409,detail=str(exc)) from exc - raise - - @app.post('/step',response_model=StepResponse) - async def step(request:StepRequest): - try:return await run_in_threadpool(step_sync,request) - except (ValueError,ValidationError) as exc:raise HTTPException(status_code=422,detail=str(exc)) from exc - - @app.get('/state') - async def state(): - return await run_in_threadpool(state_sync) - - def shutdown(): - with lock:env.close() - - - - - original_lifespan=app.router.lifespan_context - - @asynccontextmanager - async def lifespan(application): - async with original_lifespan(application) as state: - try:yield state - finally:await run_in_threadpool(shutdown) - - app.router.lifespan_context=lifespan - return lock diff --git a/components/tmax/runtime/common/models.py b/components/tmax/runtime/common/models.py deleted file mode 100644 index b862e2d3259ab1c55bbb46e6423587b742dbcc51..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/common/models.py +++ /dev/null @@ -1,54 +0,0 @@ - -from copy import deepcopy -import math -from typing import Any, Literal -import jsonschema -from openenv.core.env_server.types import Action, Observation -from pydantic import ConfigDict, Field, model_serializer, model_validator -from .contracts import ACTION_SCHEMA - - -class ArenaAction(Action): - model_config=ConfigDict(extra='forbid',frozen=True,validate_assignment=False) - op: Literal['exec', 'call', 'finish'] - command: str | None = None - tool: str | None = None - arguments: dict[str, Any] | None = None - - @model_validator(mode='before') - @classmethod - def exact_contract(cls, value): - if isinstance(value, cls): - return value - def finite(item): - if isinstance(item,float) and not math.isfinite(item): - raise ValueError('Non-finite JSON number') - if isinstance(item,dict): - for part in item.values():finite(part) - elif isinstance(item,list): - for part in item:finite(part) - finite(value) - try: - jsonschema.Draft202012Validator(ACTION_SCHEMA).validate(value) - except jsonschema.ValidationError as exc: - raise ValueError(exc.message) from exc - return value - - @classmethod - def __get_pydantic_json_schema__(cls, core_schema, handler): - return deepcopy(ACTION_SCHEMA) - - def action_payload(self): - if self.op=='exec':return {'op':'exec','command':self.command} - if self.op=='call':return {'op':'call','tool':self.tool,'arguments':self.arguments} - return {'op':'finish'} - - @model_serializer - def canonical_serialization(self): - return self.action_payload() - - -class ArenaObservation(Observation): - task_id: str = '' - message: str = '' - data: dict[str, Any] = Field(default_factory=dict) diff --git a/components/tmax/runtime/native_shell/__init__.py b/components/tmax/runtime/native_shell/__init__.py deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/components/tmax/runtime/native_shell/actor_launcher.py b/components/tmax/runtime/native_shell/actor_launcher.py deleted file mode 100644 index 82e7bd183e0e328163d12ef3fb049c14737c8978..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/actor_launcher.py +++ /dev/null @@ -1,117 +0,0 @@ - -import argparse -import ctypes -import errno -import os -import resource -import sys - - -def deny_actor_network(): - - - - - - lib = ctypes.CDLL("libseccomp.so.2", use_errno=True) - lib.seccomp_init.argtypes = [ctypes.c_uint32] - lib.seccomp_init.restype = ctypes.c_void_p - lib.seccomp_syscall_resolve_name.argtypes = [ctypes.c_char_p] - lib.seccomp_syscall_resolve_name.restype = ctypes.c_int - lib.seccomp_rule_add.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_int, ctypes.c_uint] - lib.seccomp_rule_add.restype = ctypes.c_int - lib.seccomp_load.argtypes = [ctypes.c_void_p] - lib.seccomp_load.restype = ctypes.c_int - lib.seccomp_release.argtypes = [ctypes.c_void_p] - context = lib.seccomp_init(0x7FFF0000) - if not context: - raise RuntimeError("seccomp_init failed") - blocked = ("socket", "socketpair", "connect", "bind", "listen", "accept", "accept4", - "sendto", "sendmsg", "sendmmsg", "recvfrom", "recvmsg", "recvmmsg", - "shutdown", "getsockname", "getpeername", "setsockopt", "getsockopt", - - "io_uring_setup", "io_uring_register", "io_uring_enter") - try: - for name in blocked: - number = lib.seccomp_syscall_resolve_name(name.encode()) - if number < 0: - raise RuntimeError("Required syscall could not be resolved: " + name) - rc = lib.seccomp_rule_add(context, 0x00050000 | errno.EPERM, number, 0) - if rc: - raise OSError(-rc, "seccomp rule: " + name) - rc = lib.seccomp_load(context) - if rc: - raise OSError(-rc, "seccomp_load") - finally: - lib.seccomp_release(context) - - -def enter(uid, gid, cwd, status_fd, memory_mb, cpus, nproc): - if sys.platform != "linux" or os.geteuid() != 0 or uid <= 0 or gid <= 0: - raise RuntimeError("A Linux root supervisor and non-root actor IDs are required") - libc = ctypes.CDLL(None, use_errno=True) - if libc.prctl(38, 1, 0, 0, 0): - raise OSError(ctypes.get_errno(), "PR_SET_NO_NEW_PRIVS") - if libc.prctl(47, 4, 0, 0, 0): - raise OSError(ctypes.get_errno(), "PR_CAP_AMBIENT_CLEAR_ALL") - if libc.prctl(8, 0, 0, 0, 0): - raise OSError(ctypes.get_errno(), "PR_SET_KEEPCAPS") - os.setgroups([]) - os.setresgid(gid, gid, gid) - os.setresuid(uid, uid, uid) - if os.getresuid() != (uid, uid, uid) or os.getresgid() != (gid, gid, gid): - raise RuntimeError("Actor identity change did not take effect") - if libc.prctl(4, 0, 0, 0, 0): - raise OSError(ctypes.get_errno(), "PR_SET_DUMPABLE") - os.chdir(cwd) - os.umask(0o077) - resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) - resource.setrlimit(resource.RLIMIT_FSIZE, (16 * 1024 * 1024,) * 2) - resource.setrlimit(resource.RLIMIT_NOFILE, (128, 128)) - resource.setrlimit(resource.RLIMIT_NPROC, (nproc, nproc)) - resource.setrlimit(resource.RLIMIT_AS, (memory_mb * 1024 * 1024,) * 2) - allowed = sorted(os.sched_getaffinity(0)) - os.sched_setaffinity(0, allowed[:cpus]) - deny_actor_network() - state = dict(line.split(":", 1) for line in open("/proc/self/status") if ":" in line) - if state["NoNewPrivs"].strip() != "1" or int(state["CapEff"].strip(), 16): - raise RuntimeError("Actor still has effective capabilities or lacks no_new_privs") - if state["Seccomp"].strip() != "2": - raise RuntimeError("Actor seccomp filter did not become active") - os.write(status_fd, b"ready") - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("--uid", type=int, required=True) - parser.add_argument("--gid", type=int, required=True) - parser.add_argument("--cwd", required=True) - parser.add_argument("--status-fd", type=int, required=True) - parser.add_argument('--memory-mb', type=int, required=True) - parser.add_argument('--cpus', type=int, required=True) - parser.add_argument('--nproc', type=int, default=32) - parser.add_argument("argv", nargs=argparse.REMAINDER) - args = parser.parse_args() - argv = args.argv[1:] if args.argv[:1] == ["--"] else args.argv - if not argv: - parser.error("A command is required") - try: - if not 128 <= args.memory_mb <= 16384 or not 1 <= args.cpus <= 2 or not 1 <= args.nproc <= 64: - raise ValueError('Invalid actor resource bounds') - enter(args.uid, args.gid, args.cwd, args.status_fd, args.memory_mb, args.cpus, args.nproc) - except Exception as exc: - os.write(args.status_fd, ("error:" + str(exc)).encode()[:2048]) - raise - finally: - os.close(args.status_fd) - - env = {"PATH": "/usr/local/bin:/usr/bin:/bin", "HOME": args.cwd, - "TMPDIR": args.cwd + "/.actor_tmp", "LANG": "C.UTF-8", - "LC_ALL": "C.UTF-8", "PYTHONDONTWRITEBYTECODE": "1", - "OPENBLAS_NUM_THREADS": str(args.cpus), "OMP_NUM_THREADS": str(args.cpus), - "MKL_NUM_THREADS": str(args.cpus), "NUMEXPR_NUM_THREADS": str(args.cpus)} - os.execvpe(argv[0], argv, env) - - -if __name__ == "__main__": - main() diff --git a/components/tmax/runtime/native_shell/backend.py b/components/tmax/runtime/native_shell/backend.py deleted file mode 100644 index 4e0045f0dd17aa0a5806f92739409c8260211725..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/backend.py +++ /dev/null @@ -1,274 +0,0 @@ - - - - - -import hashlib -import json -import math -import os -from pathlib import Path -import shutil -import signal -import subprocess -import sys -from threading import Lock, RLock -import time -from uuid import uuid4 - -from common.contracts import ACTION_SCHEMA, observation_payload -from .guard import Guard, GuardError, InvalidOutput, Policy, ordinary - -_lease = Lock() - - -class RuntimeUnavailable(RuntimeError): - pass - - -def sha256(path): - return hashlib.sha256(Path(path).read_bytes()).hexdigest() - - -def clear_contents(path): - path = Path(path) - if path.is_symlink(): - raise RuntimeUnavailable('Trusted root was replaced by a symlink') - path.mkdir(parents=True, exist_ok=True) - for child in path.iterdir(): - if child.is_symlink(): - child.unlink() - elif child.is_dir(): - shutil.rmtree(child) - else: - child.unlink() - - -class ShellBackend: - def __init__(self, config_path=None): - self.config_path=Path(config_path or os.environ.get('NATIVE_SHELL_CONFIG','/opt/native-shell/config.json')) - self.config=json.loads(self.config_path.read_text()) - self.tasks={item['id']:item for item in self.config['tasks']} - if not self.tasks: - raise ValueError('No prepared tasks') - if len({task['workspace'] for task in self.tasks.values()})!=1: - raise ValueError('One runtime image must use one original workspace root') - for task in self.tasks.values(): - if task.get('grading_mode') != 'file-output': - raise ValueError('Learner-code graders are not supported by the file-output guard') - if task['grader']['kind'] not in ('pytest', 'original-shell'): - raise ValueError('Unreviewed grader kind') - if task['grader'].get('executes_learner_code') is not False: - raise ValueError('Explicit file-output grader review is required') - work=Path(task['workspace']) - if str(work) not in ('/app','/workdir','/home/user'): - raise ValueError('Workspace must be an explicitly supported original task root') - if not (128 <= task['memory_mb'] <= 16384 and 1 <= task['cpus'] <= 2): - raise ValueError('Resources exceed the reviewed Arena bounds') - self.lock=RLock() - self.owns_lease=False - self.guard=None - self.task=None - self.final=None - self.failed=False - self.episode_id=None - self.step_count=0 - self.started=0.0 - - def _private_root(self): - return Path(self.config.get('private_root','/opt/native-shell/private')) - - def _check_task_sources(self,task): - root=Path(task['source']) - actual={str(path.relative_to(root)) for path in root.rglob('*') if path.is_file()} - if actual!=set(task['source_sha256']) or any(path.is_symlink() for path in root.rglob('*')): - raise RuntimeUnavailable('Pinned original source tree membership changed') - for relative,digest in task['source_sha256'].items(): - path=root/relative - if path.is_symlink() or not path.is_file() or sha256(path)!=digest: - raise RuntimeUnavailable('Pinned original task source changed') - pristine=Path(task['pristine_workspace']) - if {str(path.relative_to(pristine)) for path in pristine.rglob('*') if path.is_file()}!=set(task['pristine_sha256']): - raise RuntimeUnavailable('Pristine input tree membership changed') - for relative,digest in task['pristine_sha256'].items(): - path=pristine/relative - if path.is_symlink() or not path.is_file() or sha256(path)!=digest: - raise RuntimeUnavailable('Pristine task input changed') - - def reset(self,*,task_id=None,index=None,split='train',seed=None,episode_id=None,**kwargs): - with self.lock: - if sys.platform!='linux' or os.geteuid()!=0 or os.environ.get('ARENA_DEDICATED_CONTAINER')!='1': - raise RuntimeUnavailable('Use a dedicated disposable Linux container with a root supervisor') - if split!='train': - raise ValueError('Unknown split') - if task_id is None: - selected=0 if index is None else index - if type(selected) is not int or not 0<=selected=self.config.get('max_actions',64): - return self._finish() - if len(action['command'].encode())>1048576: - raise ValueError('Command exceeds the transport limit') - limit=min(float(timeout_s or self.config.get('command_timeout_sec',120)),remaining, - self.config.get('command_timeout_sec',120)) - result=self.guard.run_actor(action['command'],timeout=max(.01,limit), - output_limit=self.config.get('output_limit_bytes',65536)) - self.step_count+=1 - exhausted=self.step_count>=self.config.get('max_actions',64) - result.update(actions_remaining=max(0,self.config.get('max_actions',64)-self.step_count),finish_required=exhausted) - return observation_payload(self.task['id'],'Command completed. Finish to grade.' if exhausted else 'Command completed.',result) - - def _finish(self): - try: - return self._finish_impl() - except Exception: - self.failed=True - self.guard.stop_actor() - raise - finally: - if self.owns_lease: - self.owns_lease=False - _lease.release() - - def _finish_impl(self): - try: - self.guard.freeze() - except InvalidOutput: - self.guard.stop_actor() - self.final=observation_payload(self.task['id'],'Output violates the published regular-file boundary.', - {'status':'invalid_output'},reward=0.0,done=True) - return self.final - - - - grader=self.task['grader'] - python=self.task['python'] - verifier_timeout=min(90.0,float(self.task['verifier_timeout_sec'])) - private=self._private_root()/'episode' - verifier_tmp=private/'tmp';verifier_tmp.mkdir(mode=0o700) - if grader['kind']=='pytest': - command=[python,'-I','-B','-m','pytest','-c','/dev/null','--confcutdir=/tests', - '--rootdir=/tests','--import-mode=importlib','-p','no:cacheprovider', - '/tests/'+grader['test_file'],'-q'] - else: - command=['/bin/bash','--noprofile','--norc','/tests/'+grader['script']] - command=[python,'-I','-B',str(Path(__file__).with_name('verifier_launcher.py')), - '--cpus',str(self.task['cpus']),'--memory-mb',str(self.task['memory_mb']), - '--wall-seconds',str(verifier_timeout),'--',*command] - env={'PATH':'/usr/local/bin:/usr/bin:/bin','HOME':'/root','LANG':'C.UTF-8','LC_ALL':'C.UTF-8', - 'PYTHONDONTWRITEBYTECODE':'1','PYTHONNOUSERSITE':'1','PYTEST_DISABLE_PLUGIN_AUTOLOAD':'1', - 'OPENBLAS_NUM_THREADS':str(self.task['cpus']),'OMP_NUM_THREADS':str(self.task['cpus']), - 'TMPDIR':str(verifier_tmp)} - process=subprocess.Popen(command,cwd='/tests',env=env,stdin=subprocess.DEVNULL, - stdout=subprocess.PIPE,stderr=subprocess.PIPE,start_new_session=True) - try: - stdout,stderr=process.communicate(timeout=verifier_timeout) - except subprocess.TimeoutExpired: - os.killpg(process.pid,signal.SIGKILL);process.communicate() - raise RuntimeUnavailable('Original verifier exceeded its time limit') - self.guard.check_integrity() - (private/'verifier-result.json').write_text(json.dumps({'return_code':process.returncode, - 'stdout':stdout.decode(errors='replace')[-262144:],'stderr':stderr.decode(errors='replace')[-262144:]},indent=2)+'\n') - if grader['kind']=='pytest': - if process.returncode not in (0,1): - raise RuntimeUnavailable('Original pytest did not produce a valid score') - reward=float(process.returncode==0) - else: - if process.returncode!=0: - raise RuntimeUnavailable('Original grader script failed') - try:reward=float(Path('/logs/verifier/reward.txt').read_text().strip()) - except (OSError,ValueError) as exc:raise RuntimeUnavailable('Original grader produced no numeric score') from exc - if not math.isfinite(reward) or not 0<=reward<=1: - raise RuntimeUnavailable('Original grader produced an invalid score') - self.final=observation_payload(self.task['id'],'Original verifier completed.', - {'status':'verified','step_count':self.step_count},reward=reward,done=True) - return self.final - - @property - def state(self): - return {'episode_id':self.episode_id,'step_count':self.step_count,'task_id':self.task['id'] if self.task else None, - 'done':self.final is not None or self.failed,'infrastructure_failed':self.failed} - - def close(self): - with self.lock: - if self.owns_lease: - try: - if self.guard is not None:self.guard.stop_actor() - finally: - self.guard=None;self.task=None;self.final=None;self.episode_id=None;self.failed=False - self.owns_lease=False;_lease.release() diff --git a/components/tmax/runtime/native_shell/environment.py b/components/tmax/runtime/native_shell/environment.py deleted file mode 100644 index c5bd72d364747be79eb618ee2f0a042ceba972ea..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/environment.py +++ /dev/null @@ -1,46 +0,0 @@ - -from openenv.core.env_server.interfaces import Environment -from openenv.core.env_server.types import State, EnvironmentMetadata -from common.models import ArenaAction, ArenaObservation -from .backend import ShellBackend - - -class NativeHarborEnvironment(Environment): - SUPPORTS_CONCURRENT_SESSIONS = False - - def __init__(self): - super().__init__() - self.backend=ShellBackend() - - def reset(self,**kwargs): - return ArenaObservation.model_validate(self.backend.reset(**kwargs)) - - def step(self,action,timeout_s=None,**kwargs): - value=action.action_payload() if isinstance(action,ArenaAction) else ArenaAction.model_validate(action).action_payload() - return ArenaObservation.model_validate(self.backend.step(value,timeout_s=timeout_s)) - - @property - def state(self): - return State.model_validate(self.backend.state) - - def close(self): - self.backend.close() - - def get_metadata(self): - return EnvironmentMetadata(name='native_harbor',version='0.1.0',description='Original Harbor tasks with offline dependencies and private file-output grading.') - - def list_splits(self): - return ['train'] - - def list_tasks(self,split): - if split!='train':raise ValueError('Unknown split') - return [{'id':key,'index':index} for index,key in enumerate(self.backend.tasks)] - - def num_tasks(self,split): - return len(self.list_tasks(split)) - - def get_task(self,split,index): - return self.list_tasks(split)[index] - - def get_task_range(self,split,start=None,stop=None): - return self.list_tasks(split)[start:stop] diff --git a/components/tmax/runtime/native_shell/guard.py b/components/tmax/runtime/native_shell/guard.py deleted file mode 100644 index 22d92442be74beefa1c4ef9b21be0f55a12df800..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/guard.py +++ /dev/null @@ -1,309 +0,0 @@ - - - - - -from dataclasses import dataclass -import hashlib -import json -import os -from pathlib import Path -import selectors -import signal -import stat -import subprocess -import sys -import time - - -try: - from .process_scope import current_scope -except ImportError: - from process_scope import current_scope - - -class GuardError(RuntimeError): - pass - - -class InvalidOutput(GuardError): - pass - - -def ordinary(path): - path = Path(path) - for current in [path, *path.parents]: - if current.is_symlink(): - raise GuardError(f"Symlink is forbidden in guarded path: {current}") - st = path.lstat() - if not (stat.S_ISREG(st.st_mode) or stat.S_ISDIR(st.st_mode)): - raise GuardError(f"Special filesystem object: {path}") - if stat.S_ISREG(st.st_mode) and st.st_nlink != 1: - raise GuardError(f"Hard-linked file: {path}") - return st - - -def descendants(path): - - pending = [(Path(path), 0)] - seen = 0 - while pending: - current, depth = pending.pop() - seen += 1 - if depth > 32 or seen > 4096: - raise GuardError("Guarded tree exceeds prototype depth/file limits") - st = ordinary(current) - yield current - if stat.S_ISDIR(st.st_mode): - pending.extend((child, depth + 1) for child in sorted(current.iterdir(), reverse=True)) - - -def record(path): - st = ordinary(path) - result = {"uid": st.st_uid, "gid": st.st_gid, "mode": stat.S_IMODE(st.st_mode), - "dev": st.st_dev, "inode": st.st_ino, - "kind": "directory" if stat.S_ISDIR(st.st_mode) else "file"} - if stat.S_ISREG(st.st_mode): - h = hashlib.sha256() - with open(path, "rb") as stream: - for block in iter(lambda: stream.read(65536), b""): - h.update(block) - result.update(size=st.st_size, nlink=st.st_nlink, sha256=h.hexdigest()) - return result - - -@dataclass(frozen=True) -class Policy: - workspace: Path - inputs: tuple[Path, ...] - private_paths: tuple[Path, ...] - output_paths: tuple[Path, ...] - editable_paths: tuple[Path, ...] = () - private_write_dirs: tuple[Path, ...] = (Path("/logs/verifier"),) - uid: int = 2000 - gid: int = 2000 - state_dir: Path = Path("/opt/guard-private") - memory_mb: int = 2048 - cpus: int = 1 - nproc: int = 32 - actor_python: str = '/usr/local/bin/python3' - - -class Guard: - def __init__(self, policy): - if sys.platform != "linux" or os.geteuid() != 0: - raise GuardError("Guard requires a dedicated Linux root supervisor") - self.policy = policy - self.scope = current_scope() - self.records = {} - self.closed_trees = {} - self.phase = "new" - - @staticmethod - def check_runtime_paths(): - - - for path in [Path(sys.executable).resolve(), Path("/bin/bash").resolve(), - Path("/usr/local/bin"), Path("/usr/bin")]: - for item in [path, *path.parents]: - st = item.stat() - if st.st_uid != 0 or st.st_mode & 0o022: - raise GuardError(f"Untrusted runtime lookup path: {item}") - - def _protect_parents(self, path): - - - for parent in [Path(path).parent, *Path(path).parent.parents]: - st = ordinary(parent) - if st.st_uid != 0 or st.st_gid != 0: - os.chown(parent, 0, 0) - mode = stat.S_IMODE(st.st_mode) - if mode & 0o022: - os.chmod(parent, mode | stat.S_ISVTX) - - def _seal(self, path, private=False): - objects = list(descendants(path)) - for current in objects: - st = ordinary(current) - os.chown(current, 0, 0) - directory = stat.S_ISDIR(st.st_mode) - os.chmod(current, (0o700 if directory else 0o600) if private else - (0o555 if directory or st.st_mode & 0o111 else 0o444)) - self._protect_parents(path) - for current in objects: - self.records[str(current)] = record(current) - if Path(path).is_dir(): - self.closed_trees[str(path)] = sorted(str(x) for x in objects) - - def prepare(self): - if self.phase != "new": - raise GuardError("Guard preparation is single use") - p = self.policy - self.check_runtime_paths() - if p.uid <= 0 or p.gid <= 0: - raise GuardError("Actor IDs must be non-root") - if not p.workspace.is_absolute() or str(p.workspace) in ("/", "/tmp", "/home"): - raise GuardError("Unsafe workspace") - ordinary(p.workspace) - os.chown(p.workspace, 0, 0) - os.chmod(p.workspace, 0o1777) - self._protect_parents(p.workspace) - for editable in p.editable_paths: - if not editable.is_relative_to(p.workspace): - raise GuardError("Editable paths must be inside the workspace") - for item in descendants(editable): - st = ordinary(item) - os.chown(item, p.uid, p.gid) - os.chmod(item, 0o700 if stat.S_ISDIR(st.st_mode) or st.st_mode & 0o111 else 0o600) - tmp = p.workspace / ".actor_tmp" - if tmp.exists(): - raise GuardError("Actor temporary directory must start absent") - tmp.mkdir(mode=0o700) - os.chown(tmp, p.uid, p.gid) - p.state_dir.mkdir(parents=True, exist_ok=True) - os.chown(p.state_dir, 0, 0) - os.chmod(p.state_dir, 0o700) - self._protect_parents(p.state_dir) - for item in p.inputs: - self._seal(item) - for item in p.private_paths: - self._seal(item, private=True) - for item in p.private_write_dirs: - item.mkdir(parents=True, exist_ok=True) - ordinary(item) - os.chown(item, 0, 0) - os.chmod(item, 0o700) - self._protect_parents(item) - self.records[str(item)] = record(item) - - for item in (*p.inputs, *p.private_paths, p.state_dir, p.workspace): - for ancestor in Path(item).parents: - self.records.setdefault(str(ancestor), record(ancestor)) - self.records[str(p.workspace)] = record(p.workspace) - (p.state_dir / "input_manifest.json").write_text(json.dumps(self.records, indent=2)) - self.phase = "actor" - self.check_integrity() - - def check_integrity(self): - for path, before in self.records.items(): - if record(path) != before: - raise GuardError(f"Protected input or parent changed: {path}") - for root, before in self.closed_trees.items(): - if sorted(str(x) for x in descendants(root)) != before: - raise GuardError(f"Protected directory membership changed: {root}") - - def stop_actor(self): - return self.scope.stop_uid(self.policy.uid) - - def run_actor(self, command, timeout=10, output_limit=65536): - if self.phase != "actor": - raise GuardError("Actor phase is closed") - self.check_integrity() - read_fd, write_fd = os.pipe() - launcher = Path(__file__).with_name("actor_launcher.py") - argv = [self.policy.actor_python, "-I", str(launcher), "--uid", str(self.policy.uid), - "--gid", str(self.policy.gid), "--cwd", str(self.policy.workspace), - '--memory-mb', str(self.policy.memory_mb), '--cpus', str(self.policy.cpus), - '--nproc', str(self.policy.nproc), - "--status-fd", str(write_fd), "--", "/bin/bash", "--noprofile", "--norc", "-c", command] - process = subprocess.Popen(argv, env={"PATH": "/usr/local/bin:/usr/bin:/bin"}, - stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - pass_fds=(write_fd,), start_new_session=True) - identity = self.scope.track_child(process.pid) - os.close(write_fd) - selector = selectors.DefaultSelector() - for stream in [process.stdout, process.stderr]: - os.set_blocking(stream.fileno(), False) - selector.register(stream, selectors.EVENT_READ) - output = {process.stdout: bytearray(), process.stderr: bytearray()} - reason = "completed" - deadline = time.monotonic() + timeout - try: - while selector.get_map(): - rss_kib = self.scope.rss_kib(self.policy.uid) - if rss_kib > self.policy.memory_mb * 1024: - reason = 'aggregate_rss_limit' - self.stop_actor() - process.kill() - break - if time.monotonic() > deadline: - reason = "command_timeout" - self.stop_actor() - process.kill() - break - for key, _ in selector.select(0.05): - data = os.read(key.fileobj.fileno(), 65536) - if not data: - selector.unregister(key.fileobj) - continue - remaining = output_limit - sum(len(v) for v in output.values()) - output[key.fileobj].extend(data[:max(remaining, 0)]) - if len(data) > remaining: - reason = "output_limit" - self.stop_actor() - process.kill() - break - if reason != "completed": - break - process.wait(timeout=3) - status = os.read(read_fd, 2048) - if status != b"ready": - raise GuardError("Actor isolation failed: " + status.decode(errors="replace")) - finally: - selector.close() - os.close(read_fd) - process.stdout.close() - process.stderr.close() - if process.poll() is None: - self.stop_actor() - process.kill() - process.wait() - self.scope.untrack_child(identity) - self.scope.reap_uid(self.policy.uid) - self.check_integrity() - return {"return_code": process.returncode, "reason": reason, - "stdout": output[process.stdout].decode(errors="replace"), - "stderr": output[process.stderr].decode(errors="replace")} - - def freeze(self): - if self.phase != "actor": - raise GuardError("Can only freeze an active actor phase") - self.stop_actor() - self.check_integrity() - try: - total = 0 - for path in self.policy.output_paths: - if not path.is_relative_to(self.policy.workspace): - raise GuardError("Output path is outside workspace") - if not os.path.lexists(path): - continue - for item in descendants(path): - st = ordinary(item) - if stat.S_ISREG(st.st_mode): - total += st.st_size - if st.st_size > 16 * 1024 * 1024 or total > 64 * 1024 * 1024: - raise GuardError("Output artifact exceeds prototype limits") - os.chown(item, 0, 0) - os.chmod(item, 0o555 if stat.S_ISDIR(st.st_mode) else 0o444) - except GuardError as exc: - raise InvalidOutput(str(exc)) from exc - self.phase = "frozen" - - def run_verifier(self, script, timeout=30): - if self.phase != "frozen": - raise GuardError("Freeze actor before grading") - self.check_integrity() - script = Path(script) - if str(script) not in self.records or self.records[str(script)]["uid"] != 0: - raise GuardError("Verifier was not sealed as a private trusted file") - env = {"PATH": "/usr/local/bin:/usr/bin:/bin", "HOME": "/root", "LANG": "C.UTF-8", - "LC_ALL": "C.UTF-8", "PYTHONDONTWRITEBYTECODE": "1", - "PYTHONNOUSERSITE": "1", "PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1", - "PYTEST_ADDOPTS": "-p no:cacheprovider"} - result = subprocess.run(["/bin/bash", "--noprofile", "--norc", str(script)], - cwd=script.parent, env=env, stdin=subprocess.DEVNULL, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=timeout) - self.check_integrity() - return {"return_code": result.returncode, - "stdout": result.stdout.decode(errors="replace"), - "stderr": result.stderr.decode(errors="replace")} diff --git a/components/tmax/runtime/native_shell/launch_service.py b/components/tmax/runtime/native_shell/launch_service.py deleted file mode 100644 index 09f9fbe8804c60947c33e427c1f3e4583190157b..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/launch_service.py +++ /dev/null @@ -1,51 +0,0 @@ - -import argparse -import json -import os -from pathlib import Path -import subprocess -import time -import urllib.request - - -class RejectRedirects(urllib.request.HTTPRedirectHandler): - def redirect_request(self,*args,**kwargs): - raise RuntimeError('Redirects are forbidden for the local readiness probe') - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('--python',default='/opt/openenv-venv/bin/python') - parser.add_argument('--config',default='/opt/native-shell/config.json') - args=parser.parse_args() - if os.geteuid()!=0:raise PermissionError('Only the trusted supervisor may launch this service') - opener=urllib.request.build_opener(urllib.request.ProxyHandler({}),RejectRedirects()) - url='http://127.0.0.1:8000/metadata' - def ready(): - try: - with opener.open(url,timeout=2) as response: - return json.load(response).get('name')=='native_harbor' - except Exception:return False - if ready(): - print(json.dumps({'status':'already_running','base_url':'http://127.0.0.1:8000'}));return - private=Path('/opt/native-shell/private');private.mkdir(parents=True,exist_ok=True);private.chmod(0o700) - log=private/'service.log' - env={'PATH':'/usr/local/bin:/usr/bin:/bin','HOME':'/root','LANG':'C.UTF-8','LC_ALL':'C.UTF-8', - 'PYTHONPATH':'/opt/native-shell/runtime','PYTHONDONTWRITEBYTECODE':'1','PYTHONUNBUFFERED':'1', - 'NATIVE_SHELL_CONFIG':args.config,'ARENA_DEDICATED_CONTAINER':'1','ENABLE_WEB_INTERFACE':'false', - 'OPENENV_MODE':'simulation','GRADIO_ANALYTICS_ENABLED':'false','HF_HUB_OFFLINE':'1'} - with log.open('w') as stream: - process=subprocess.Popen([args.python,'-m','native_shell.server'],env=env,stdin=subprocess.DEVNULL, - stdout=stream,stderr=subprocess.STDOUT,start_new_session=True) - (private/'service.pid').write_text(str(process.pid)+'\n') - deadline=time.monotonic()+90 - while time.monotonic()= 2: - return {'signaled': len(signaled), 'reaped': reaped} - else: - quiet = 0 - for record in live: - fd = self._open_checked_pidfd(record, uid) - if fd is None: - continue - try: - try: - signal.pidfd_send_signal(fd, signal.SIGKILL, None, 0) - signaled.add(record.identity) - except ProcessLookupError: - pass - except OSError as error: - raise ProcessScopeError('Could not stop a learner process') from error - finally: - os.close(fd) - reaped += self.reap_uid(uid) - if time.monotonic() >= deadline: - raise ProcessScopeError('Could not stop all scoped learner processes') - time.sleep(0.02) - - -_current_scope = None -_current_lock = threading.Lock() - - -def current_scope(): - global _current_scope - with _current_lock: - if _current_scope is None or _current_scope.owner.pid != os.getpid(): - _current_scope = ProcessScope() - return _current_scope diff --git a/components/tmax/runtime/native_shell/server.py b/components/tmax/runtime/native_shell/server.py deleted file mode 100644 index 9aa1e83e6fd7dee697f3cb101d47495737dcdd7c..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/server.py +++ /dev/null @@ -1,14 +0,0 @@ - -from openenv.core.env_server.http_server import create_app -from common.models import ArenaAction, ArenaObservation -from .environment import NativeHarborEnvironment - -app=create_app(NativeHarborEnvironment,ArenaAction,ArenaObservation,env_name='native_harbor',max_concurrent_envs=1) - - -def main(): - import uvicorn - uvicorn.run(app,host='0.0.0.0',port=8000,log_level='warning') - - -if __name__=='__main__':main() diff --git a/components/tmax/runtime/native_shell/verifier_launcher.py b/components/tmax/runtime/native_shell/verifier_launcher.py deleted file mode 100644 index 9d5a1bdd65d608c8e7b046a13008f69b977256be..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/verifier_launcher.py +++ /dev/null @@ -1,26 +0,0 @@ - -import argparse -import math -import os -import resource - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('--cpus',type=int,required=True) - parser.add_argument('--memory-mb',type=int,required=True) - parser.add_argument('--wall-seconds',type=float,required=True) - parser.add_argument('argv',nargs=argparse.REMAINDER) - args=parser.parse_args() - argv=args.argv[1:] if args.argv[:1]==['--'] else args.argv - if not argv or not 1<=args.cpus<=2 or not 128<=args.memory_mb<=16384: - raise ValueError('Invalid verifier resource configuration') - os.sched_setaffinity(0,sorted(os.sched_getaffinity(0))[:args.cpus]) - resource.setrlimit(resource.RLIMIT_AS,(args.memory_mb*1024*1024,)*2) - resource.setrlimit(resource.RLIMIT_CORE,(0,0)) - resource.setrlimit(resource.RLIMIT_CPU,(math.ceil(args.wall_seconds*args.cpus)+1,)*2) - os.umask(0o077) - os.execvpe(argv[0],argv,os.environ) - - -if __name__=='__main__':main() diff --git a/components/tmax/runtime/native_shell/wire_client.py b/components/tmax/runtime/native_shell/wire_client.py deleted file mode 100644 index fffc56ab1420b816a2fcfe0a6e1b00040f039dfd..0000000000000000000000000000000000000000 --- a/components/tmax/runtime/native_shell/wire_client.py +++ /dev/null @@ -1,150 +0,0 @@ - -import argparse -import base64 -import json -import math -import os -import sys -import urllib.error -import urllib.parse -import urllib.request - - -class WireProtocolError(RuntimeError): - pass - - -class RejectRedirects(urllib.request.HTTPRedirectHandler): - def redirect_request(self,request,fp,code,message,headers,new_url): - raise WireProtocolError('Redirects are forbidden for the local OpenEnv transport') - - -def _constant(value): - raise WireProtocolError('Non-finite JSON number: '+value) - - -def _unique(pairs): - result={} - for key,value in pairs: - if key in result:raise WireProtocolError('Duplicate JSON key') - result[key]=value - return result - - -def _finite(value): - if isinstance(value,float) and not math.isfinite(value): - raise WireProtocolError('Non-finite wire value') - if isinstance(value,dict): - for item in value.values():_finite(item) - elif isinstance(value,list): - for item in value:_finite(item) - - -def loads(raw): - value=json.loads(raw,parse_constant=_constant,object_pairs_hook=_unique) - _finite(value) - return value - - -def validate_envelope(value,*,require_done=False): - if not isinstance(value,dict) or not isinstance(value.get('observation'),dict): - raise WireProtocolError('Missing SDK observation object') - observation=value['observation'] - if (set(observation)!={'task_id','message','data','metadata'} or - not isinstance(observation['task_id'],str) or not isinstance(observation['message'],str) or - not isinstance(observation['data'],dict) or not isinstance(observation['metadata'],dict)): - raise WireProtocolError('Observation does not match the common public contract') - if type(value.get('done')) is not bool: - raise WireProtocolError('SDK done must be a JSON boolean') - reward=value.get('reward') - if reward is not None and (type(reward) not in (int,float) or not math.isfinite(reward) or not 0<=reward<=1): - raise WireProtocolError('SDK reward is not a finite number in [0,1]') - if require_done and (not value['done'] or reward is None): - raise WireProtocolError('Finish did not return a terminal numeric score') - _finite(value) - return value - - -class WireClient: - def __init__(self,base_url='http://127.0.0.1:8000',timeout=330): - if os.geteuid()!=0: - raise PermissionError('Wire client is reserved for the trusted supervisor') - url=urllib.parse.urlsplit(base_url) - if url.scheme!='http' or url.hostname not in ('127.0.0.1','localhost','::1') or url.username or url.password or url.query or url.fragment or url.path not in ('','/'): - raise ValueError('Only an unauthenticated local server is allowed') - self.ws_url='ws://'+url.netloc+'/ws' - self.timeout=timeout - self.connection=None - - def close(self): - if self.connection is not None: - from websockets.exceptions import ConnectionClosedOK - connection,self.connection=self.connection,None - try: - connection.send('{"type":"close"}') - connection.recv(timeout=min(self.timeout,10)) - raise WireProtocolError('OpenEnv session did not close') - except ConnectionClosedOK: - pass - finally: - connection.close() - - def _request(self,kind,payload): - from websockets.sync.client import connect - if self.connection is None: - if kind!='reset':raise WireProtocolError('Reset before stepping') - self.connection=connect(self.ws_url,proxy=None,open_timeout=min(self.timeout,30),max_size=2*1024*1024) - body=json.dumps({'type':kind,'data':payload},ensure_ascii=False,allow_nan=False,separators=(',',':')) - try: - self.connection.send(body) - response=loads(self.connection.recv(timeout=self.timeout)) - if response.get('type')!='observation': - raise WireProtocolError('OpenEnv error: '+json.dumps(response.get('data',{}),ensure_ascii=False)) - result=validate_envelope(response['data']) - return result - except BaseException: - self.close() - raise - - def reset(self,**kwargs): - return self._request('reset',kwargs) - - def step(self,action): - return self._request('step',action) - - def finish(self): - return validate_envelope(self.step({'op':'finish'}),require_done=True) - - def __enter__(self): - return self - - def __exit__(self,*args): - self.close() - - -def main(): - parser=argparse.ArgumentParser() - parser.add_argument('operation',choices=['episode']) - parser.add_argument('--payload-base64',required=True) - parser.add_argument('--url',default='http://127.0.0.1:8000') - parser.add_argument('--timeout',type=float,default=330) - args=parser.parse_args() - payload=loads(base64.b64decode(args.payload_base64,validate=True)) - if not isinstance(payload,dict) or set(payload)-{'reset','actions'}: - raise WireProtocolError('Expected reset and actions') - actions=payload.get('actions',[]) - if not isinstance(actions,list):raise WireProtocolError('Actions must be a list') - with WireClient(args.url,args.timeout) as client: - result=client.reset(**payload.get('reset',{})) - for action in actions: - if result['done']:break - result=client.step(action) - if not result['done']:result=client.finish() - print(json.dumps(result,ensure_ascii=False,allow_nan=False,separators=(',',':'))) - - -if __name__=='__main__': - try:main() - except Exception as exc: - print(type(exc).__name__+': '+str(exc),file=sys.stderr) - raise SystemExit(1) diff --git a/components/tmax/tasks/task_000056_f726766b/source/external/app/vibration_data.wav b/components/tmax/tasks/task_000056_f726766b/source/external/app/vibration_data.wav deleted file mode 100644 index 7717c74e84f396da840882ff5ff8d6dfe4ecc7fa..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000056_f726766b/source/external/app/vibration_data.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eab8396a1b533f70468039f8ac1b5fe9927faf4ded578172ec932ef7bf2af22a -size 40058 diff --git a/components/tmax/tasks/task_000056_f726766b/source/instruction.md b/components/tmax/tasks/task_000056_f726766b/source/instruction.md deleted file mode 100644 index 592f2242850a2217bc910b2177ad30f0847f0b8f..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000056_f726766b/source/instruction.md +++ /dev/null @@ -1,20 +0,0 @@ -You are a data scientist analyzing the acoustic signature of a dual-mass vibration system (coupled damped oscillators) for predictive maintenance. We have a recording of the system's vibrations after an impulse excitation, located at `/app/vibration_data.wav`. - -The system is governed by the following system of ODEs: -m1 * x1''(t) + c1 * x1'(t) + (k1 + k2) * x1(t) - k2 * x2(t) = 0 -m2 * x2''(t) + c2 * x2'(t) + (k2 + k3) * x2(t) - k2 * x1(t) = 0 - -We know: -- m1 = 1.0 kg -- m2 = 1.5 kg -- Initial conditions: x1(0) = 1.0, x2(0) = 0.0, x1'(0) = 0.0, x2'(0) = 0.0. -- The audio recording in `/app/vibration_data.wav` represents the displacement of the first mass, `x1(t)`, sampled at 1000 Hz for 10 seconds. - -Your task: -1. Load and process the audio signal using spectral analysis (e.g., FFT) to obtain initial estimates for the system's eigenfrequencies and damping ratios. -2. Use numerical ODE solving (e.g., `scipy.integrate.solve_ivp`) combined with an optimization routine to fit the model to the observed `x1(t)` data to extract the unknown parameters: `c1`, `c2`, `k1`, `k2`, `k3`. -3. Beware: Due to the high correlation between the coupling stiffness `k2` and the individual stiffnesses, the Jacobian during standard nonlinear least-squares fitting (e.g., Levenberg-Marquardt) will likely become near-singular. You will need to implement a robust fitting strategy (such as Tikhonov regularization, bounds, or alternative optimization methods) to achieve convergence. -4. Perform convergence testing to ensure your ODE solver tolerances are strict enough to not bias the optimization. -5. Save the best-fit parameters in a JSON file at `/home/user/parameters.json` with the following exact keys: `"c1"`, `"c2"`, `"k1"`, `"k2"`, `"k3"`. The values must be floats. - -Your Python scripts and any virtual environment should be managed within `/home/user/`. \ No newline at end of file diff --git a/components/tmax/tasks/task_000056_f726766b/source/task.toml b/components/tmax/tasks/task_000056_f726766b/source/task.toml deleted file mode 100644 index e93b8d4e92f8de07b15763d5955577543e6ce421..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000056_f726766b/source/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_000056_f726766b" -description = "data scientist fitting models" - -[metadata] -source = "v2" -base_image = "intricate" -domain = "scientific_computing" -skill_type = "Algorithmic" -primitive_skills = ["Scientific environment management", "Convergence testing", "Fourier transforms and spectral analysis", "ODE/PDE numerical solving"] -task_complexity = "intricate task (multi-stage workflow combining (a) environment setup or package configuration, (b) primary implementation across multiple files or languages, (c) iterative refinement against a quantitative or adversarial verifier, and (d) a final integration step. Expect 30-60 commands.)" -command_complexity = "bash and code (shell commands and writing/running scripts in Python, Perl, Ruby, etc.)" -scenario = "data scientist fitting models" -language = "Python" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/tasks/task_000056_f726766b/source/tests/test.sh b/components/tmax/tasks/task_000056_f726766b/source/tests/test.sh deleted file mode 100644 index 07fecc53c9aa50a6979ec252bb27ed9b8c5831b3..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000056_f726766b/source/tests/test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -mkdir -p /logs/verifier - -cd /tests -python3 -m pytest test_final_state.py -v 2>&1 | tee /logs/verifier/test-stdout.txt -TEST_EXIT=${PIPESTATUS[0]} - -if [ $TEST_EXIT -eq 0 ]; then - echo 1 > /logs/verifier/reward.txt -else - echo 0 > /logs/verifier/reward.txt -fi - -exit 0 diff --git a/components/tmax/tasks/task_000056_f726766b/source/tests/test_final_state.py b/components/tmax/tasks/task_000056_f726766b/source/tests/test_final_state.py deleted file mode 100644 index 3f41630bbb1c4c3dbd4677ae88a335f7c799be16..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000056_f726766b/source/tests/test_final_state.py +++ /dev/null @@ -1,81 +0,0 @@ -# test_final_state.py - -import os -import json -import numpy as np -import scipy.io.wavfile as wav -from scipy.integrate import solve_ivp -import pytest - -def test_parameters_json_exists(): - """Test that the parameters.json file exists.""" - file_path = "/home/user/parameters.json" - assert os.path.exists(file_path), f"File not found: {file_path}" - assert os.path.isfile(file_path), f"Path is not a file: {file_path}" - -def test_parameters_keys(): - """Test that the parameters.json file has the correct keys and float values.""" - file_path = "/home/user/parameters.json" - assert os.path.exists(file_path), f"File not found: {file_path}" - - with open(file_path, "r") as f: - try: - params = json.load(f) - except json.JSONDecodeError: - pytest.fail(f"File {file_path} is not valid JSON.") - - expected_keys = {"c1", "c2", "k1", "k2", "k3"} - assert set(params.keys()) == expected_keys, f"JSON keys must be exactly {expected_keys}, found {set(params.keys())}." - - for k in expected_keys: - assert isinstance(params[k], (int, float)), f"Parameter {k} must be a number, found {type(params[k])}." - -def test_model_fit_mse(): - """Test that the simulated x1(t) with the estimated parameters matches the audio data with MSE <= 1e-4.""" - file_path = "/home/user/parameters.json" - assert os.path.exists(file_path), f"File not found: {file_path}" - - with open(file_path, "r") as f: - params = json.load(f) - - c1 = float(params["c1"]) - c2 = float(params["c2"]) - k1 = float(params["k1"]) - k2 = float(params["k2"]) - k3 = float(params["k3"]) - - # Load audio data - audio_path = "/app/vibration_data.wav" - assert os.path.exists(audio_path), f"Audio file missing: {audio_path}" - - sample_rate, x1_audio_data = wav.read(audio_path) - assert sample_rate == 1000, f"Expected sample rate 1000, got {sample_rate}" - assert len(x1_audio_data) == 10000, f"Expected 10000 samples, got {len(x1_audio_data)}" - - # Simulate ODE - def system(t, y): - x1, x2, v1, v2 = y - m1, m2 = 1.0, 1.5 - - a1 = (-c1*v1 - (k1+k2)*x1 + k2*x2) / m1 - a2 = (-c2*v2 - (k2+k3)*x2 + k2*x1) / m2 - return [v1, v2, a1, a2] - - t_span = (0, 10) - t_eval = np.linspace(0, 10, 10000, endpoint=False) - y0 = [1.0, 0.0, 0.0, 0.0] - - sol = solve_ivp(system, t_span, y0, t_eval=t_eval, method='Radau', rtol=1e-8, atol=1e-8) - - assert sol.success, "ODE simulation failed with the provided parameters." - - x1_simulated = sol.y[0] - - # Ensure types match for MSE calculation - x1_audio_data = x1_audio_data.astype(np.float64) - x1_simulated = x1_simulated.astype(np.float64) - - mse = np.mean((x1_simulated - x1_audio_data) ** 2) - - threshold = 1e-4 - assert mse <= threshold, f"MSE {mse:.3e} is greater than threshold {threshold:.3e}. Model fit is not accurate enough." \ No newline at end of file diff --git a/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/find_threshold.sh b/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/find_threshold.sh deleted file mode 100644 index 61aa3f2441be0e96260ba6e93757518ff7b0f076..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/find_threshold.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# ISODATA thresholding -FILE=$1 -T=128 -T_PREV=0 - -# BUG: bash integer arithmetic used for float comparison, or bad convergence logic -while true; do - DIFF=$(echo "$T - $T_PREV" | bc | awk '{if ($1 < 0) print -$1; else print $1}') - CONVERGED=$(awk -v diff="$DIFF" 'BEGIN { if(diff < 0.01) print 1; else print 0 }') - - if [ "$CONVERGED" -eq 1 ]; then - break - fi - T_PREV=$T - - # Calculate means (stubbed out actual image processing for brevity, assume awk does it) - # The bug is that they might truncate - RES=$(convert "$FILE" -format "%[fx:mean*255]" info:) - # Fake update for the sake of the exercise - T=$(awk -v t="$T" -v m="$RES" 'BEGIN { print (t + m) / 2 }') -done -echo "$T" diff --git a/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/process.sh b/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/process.sh deleted file mode 100644 index c97a2b278a1c72c1e98a7cb24cdafdb30e9502ab..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/process.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -VIDEO=$1 -OUTPUT=$2 - -mkdir -p /tmp/frames -ffmpeg -i "$VIDEO" -vf "format=gray" /tmp/frames/frame_%04d.jpg 2>/dev/null - -TITLE=$(ffprobe -v quiet -show_entries format_tags=title -of default=noprint_wrappers=1:nokey=1 "$VIDEO") - -THRESHOLDS="" -for f in /tmp/frames/*.jpg; do - # extract histogram - HIST=$(convert "$f" -format %c histogram:info:- | awk '{print $1}') - T=$(./find_threshold.sh "$f") - THRESHOLDS="$THRESHOLDS $T" -done - -./serialize.sh "$TITLE" "$THRESHOLDS" > "$OUTPUT" diff --git a/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/serialize.sh b/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/serialize.sh deleted file mode 100644 index 0ce61e053576c23cc9c6e3c81ee9785763435bbb..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000260_7b7cc286/pristine/pipeline/serialize.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -TITLE=$1 -THRESHOLDS=$2 - -# BUG: Doesn't escape TITLE -echo "{" -echo " \"title\": \"$TITLE\"," -echo " \"frame_thresholds\": [" -FIRST=1 -for T in $THRESHOLDS; do - if [ $FIRST -eq 1 ]; then - echo " $T" - FIRST=0 - else - echo " ,$T" - fi -done -echo " ]" -echo "}" diff --git a/components/tmax/tasks/task_000260_7b7cc286/source/external/app/video.mp4 b/components/tmax/tasks/task_000260_7b7cc286/source/external/app/video.mp4 deleted file mode 100644 index 21def51123d5277c6da5904b5cfc85407c37893c..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000260_7b7cc286/source/external/app/video.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3c04251fe92c30d29ac4d887608f4385176e3bda932594437f82b08a5b348938 -size 7671 diff --git a/components/tmax/tasks/task_000260_7b7cc286/source/instruction.md b/components/tmax/tasks/task_000260_7b7cc286/source/instruction.md deleted file mode 100644 index a650c72b910621929ec8ae89b4df33afa087e30c..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000260_7b7cc286/source/instruction.md +++ /dev/null @@ -1,15 +0,0 @@ -You have inherited an old, pure-Bash video data processing codebase located in `/home/user/pipeline/`. The previous developer tried to implement a custom video frame analysis tool that calculates an adaptive threshold for frame intensities and outputs a serialized JSON report. - -However, the pipeline is currently broken and produces malformed data, or gets stuck in infinite loops. Your goal is to debug and fix the bash scripts so that they correctly process the provided video at `/app/video.mp4` and output a valid JSON file to `/home/user/output.json`. - -Here are the specific issues you need to track down and fix: -1. **Convergence Failure**: `find_threshold.sh` uses an iterative algorithm (similar to ISODATA) to find a threshold for frame intensities. It's supposed to converge when the threshold changes by less than 0.01 between iterations. However, it either exits on the first iteration or loops forever due to a bug in how Bash or `awk` evaluates the convergence condition. -2. **Floating-Point Precision**: `extract_metrics.sh` uses `awk` to calculate the average intensity of frames. There is a precision or rounding bug causing the output to truncate to integers or lose significant digits, drastically reducing the accuracy of the metric. -3. **Encoding and Serialization**: The final output is generated in `serialize.sh`. It extracts the video title metadata using `ffprobe` and constructs a JSON file. The video title contains special characters (quotes, backslashes) that are not being properly escaped, resulting in invalid JSON output. - -To complete the task: -1. Fix the scripts in `/home/user/pipeline/`. -2. Run `./process.sh /app/video.mp4 /home/user/output.json`. -3. The final JSON must be perfectly valid and contain an array of `frame_thresholds`. - -Our automated testing suite will parse `/home/user/output.json` and calculate the Mean Squared Error (MSE) between your calculated frame thresholds and the ground truth. Your output must be valid JSON, and the MSE must be less than `0.05`. \ No newline at end of file diff --git a/components/tmax/tasks/task_000260_7b7cc286/source/task.toml b/components/tmax/tasks/task_000260_7b7cc286/source/task.toml deleted file mode 100644 index e778ce9185124df4cd3d16479d307fc59615b754..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000260_7b7cc286/source/task.toml +++ /dev/null @@ -1,28 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_000260_7b7cc286" -description = "developer inheriting an unfamiliar codebase" - -[metadata] -source = "v2" -base_image = "intricate" -domain = "debugging" -skill_type = "Data Processing" -primitive_skills = ["Floating-point precision repair", "Encoding and serialization troubleshooting", "Convergence failure repair"] -task_complexity = "intricate task (multi-stage workflow combining (a) environment setup or package configuration, (b) primary implementation across multiple files or languages, (c) iterative refinement against a quantitative or adversarial verifier, and (d) a final integration step. Expect 30-60 commands.)" -command_complexity = "bash-only (shell built-ins, coreutils, and standard CLI tools)" -scenario = "developer inheriting an unfamiliar codebase" -language = "Bash" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -network_mode = "no-network" - diff --git a/components/tmax/tasks/task_000260_7b7cc286/source/tests/test.sh b/components/tmax/tasks/task_000260_7b7cc286/source/tests/test.sh deleted file mode 100644 index 07fecc53c9aa50a6979ec252bb27ed9b8c5831b3..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000260_7b7cc286/source/tests/test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -mkdir -p /logs/verifier - -cd /tests -python3 -m pytest test_final_state.py -v 2>&1 | tee /logs/verifier/test-stdout.txt -TEST_EXIT=${PIPESTATUS[0]} - -if [ $TEST_EXIT -eq 0 ]; then - echo 1 > /logs/verifier/reward.txt -else - echo 0 > /logs/verifier/reward.txt -fi - -exit 0 diff --git a/components/tmax/tasks/task_000260_7b7cc286/source/tests/test_final_state.py b/components/tmax/tasks/task_000260_7b7cc286/source/tests/test_final_state.py deleted file mode 100644 index 7eb55932fa73653a8e746238fbd25f313e576b18..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000260_7b7cc286/source/tests/test_final_state.py +++ /dev/null @@ -1,55 +0,0 @@ -# test_final_state.py -import json -import os -import subprocess -import tempfile -import glob -import numpy as np -import pytest - -def test_output_json_valid_and_correct(): - output_path = "/home/user/output.json" - assert os.path.isfile(output_path), f"{output_path} does not exist. Did you run the pipeline?" - - try: - with open(output_path, "r") as f: - data = json.load(f) - except json.JSONDecodeError as e: - pytest.fail(f"Output is not valid JSON: {e}") - - assert "title" in data, "JSON missing 'title' key." - assert "frame_thresholds" in data, "JSON missing 'frame_thresholds' key." - - expected_title = r'Test "Video" \ Data' - assert data["title"] == expected_title, f"Title is incorrect. Expected: {expected_title}, Got: {data['title']}" - - agent_arr = np.array(data["frame_thresholds"], dtype=float) - - # Re-derive the golden reference by running the same extraction and mean calculation - with tempfile.TemporaryDirectory() as tmpdir: - subprocess.run( - ["ffmpeg", "-i", "/app/video.mp4", "-vf", "format=gray", os.path.join(tmpdir, "frame_%04d.jpg")], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - check=True - ) - - frames = sorted(glob.glob(os.path.join(tmpdir, "*.jpg"))) - assert len(frames) > 0, "Failed to extract frames from video for ground truth calculation." - - golden = [] - for f in frames: - res = subprocess.run( - ["convert", f, "-format", "%[fx:mean*255]", "info:"], - capture_output=True, - text=True, - check=True - ) - golden.append(float(res.stdout.strip())) - - golden_arr = np.array(golden, dtype=float) - - assert len(agent_arr) == len(golden_arr), f"Expected {len(golden_arr)} thresholds, got {len(agent_arr)}" - - mse = np.mean((agent_arr - golden_arr)**2) - assert mse <= 0.05, f"MSE of frame_thresholds is {mse:.4f}, which is > 0.05 threshold." \ No newline at end of file diff --git a/components/tmax/tasks/task_000663_dff2c340/pristine/backup_catalog.db b/components/tmax/tasks/task_000663_dff2c340/pristine/backup_catalog.db deleted file mode 100644 index 4ced75ef5e8d24fc084d71c889addd293d594656..0000000000000000000000000000000000000000 Binary files a/components/tmax/tasks/task_000663_dff2c340/pristine/backup_catalog.db and /dev/null differ diff --git a/components/tmax/tasks/task_000663_dff2c340/source/instruction.md b/components/tmax/tasks/task_000663_dff2c340/source/instruction.md deleted file mode 100644 index d11a95e12f7d1e13e3cb5c8dea2055daa6051385..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000663_dff2c340/source/instruction.md +++ /dev/null @@ -1,27 +0,0 @@ -You are a Database Reliability Engineer (DBRE) tasked with managing and restoring databases from complex backup chains. A critical failure has occurred on the `auth_prod` database, and you need to determine the exact sequence of backups to restore to recover the system to the latest possible state right before the crash. - -The crash occurred at precisely `'2023-10-27 14:00:00'`. - -You have a SQLite database at `/home/user/backup_catalog.db` that contains the metadata for all backup jobs across the cluster. The database has a single table: -`backups(id TEXT PRIMARY KEY, db_name TEXT, backup_type TEXT, parent_id TEXT, timestamp TEXT, size_mb INTEGER, duration_sec INTEGER)` - -A valid restoration chain always starts with a `FULL` backup and follows a sequence of `INC` (incremental) backups linked by the `parent_id` field (where an incremental backup's `parent_id` points to the `id` of the preceding backup in the chain). - -Your task is to write a Python script that: -1. Uses a recursive SQL query (CTE) to traverse the backup hierarchy and identify the correct restoration chain for `auth_prod`. -2. Filters the chain so that it only includes backups completed *before* the crash timestamp (`2023-10-27 14:00:00`). -3. Selects the single chain that gets the database as close to the crash time as possible. -4. Calculates the `total_size_mb` and `total_duration_sec` for this entire chain. -5. Projects the result into a JSON file located at `/home/user/restore_plan.json`. - -The JSON file must have exactly this structure: -```json -{ - "db_name": "auth_prod", - "target_time": "2023-10-27 14:00:00", - "chain": ["id_of_full_backup", "id_of_inc_1", "id_of_inc_2", "..."], - "total_size_mb": 1234, - "total_duration_sec": 567 -} -``` -*Note: The `chain` array must be ordered chronologically from the FULL backup to the final incremental backup.* \ No newline at end of file diff --git a/components/tmax/tasks/task_000663_dff2c340/source/task.toml b/components/tmax/tasks/task_000663_dff2c340/source/task.toml deleted file mode 100644 index 984812efa3bdb6f20f1c0bee3da121d04e717a16..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000663_dff2c340/source/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_000663_dff2c340" -description = "database reliability engineer managing backups" - -[metadata] -source = "legacy" -base_image = "" -domain = "data_querying" -skill_type = "Result Processing" -primitive_skills = ["Knowledge graph pattern matching", "Recursive and hierarchical queries", "Result sorting, pagination, and filtering", "Window functions and analytical aggregation", "Graph projection and materialization"] -task_complexity = "short task (a few shell commands focused on the core task)" -command_complexity = "bash and code (shell commands and writing/running scripts in Python, Perl, Ruby, etc.)" -scenario = "database reliability engineer managing backups" -language = "Python" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/tasks/task_000663_dff2c340/source/tests/test.sh b/components/tmax/tasks/task_000663_dff2c340/source/tests/test.sh deleted file mode 100644 index 07fecc53c9aa50a6979ec252bb27ed9b8c5831b3..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000663_dff2c340/source/tests/test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -mkdir -p /logs/verifier - -cd /tests -python3 -m pytest test_final_state.py -v 2>&1 | tee /logs/verifier/test-stdout.txt -TEST_EXIT=${PIPESTATUS[0]} - -if [ $TEST_EXIT -eq 0 ]; then - echo 1 > /logs/verifier/reward.txt -else - echo 0 > /logs/verifier/reward.txt -fi - -exit 0 diff --git a/components/tmax/tasks/task_000663_dff2c340/source/tests/test_final_state.py b/components/tmax/tasks/task_000663_dff2c340/source/tests/test_final_state.py deleted file mode 100644 index 613a740cdbf46eb8912ac5c37184504c58f578a5..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_000663_dff2c340/source/tests/test_final_state.py +++ /dev/null @@ -1,91 +0,0 @@ -# test_final_state.py - -import os -import json -import sqlite3 -import pytest - -DB_PATH = '/home/user/backup_catalog.db' -JSON_PATH = '/home/user/restore_plan.json' -TARGET_TIME = '2023-10-27 14:00:00' -TARGET_DB = 'auth_prod' - -def get_expected_chain(): - conn = sqlite3.connect(DB_PATH) - c = conn.cursor() - - query = """ - WITH RECURSIVE chain AS ( - SELECT - id, - id AS root_id, - timestamp AS last_timestamp, - size_mb, - duration_sec, - id AS path - FROM backups - WHERE db_name = ? AND backup_type = 'FULL' AND timestamp < ? - - UNION ALL - - SELECT - b.id, - c.root_id, - b.timestamp, - c.size_mb + b.size_mb, - c.duration_sec + b.duration_sec, - c.path || ',' || b.id - FROM backups b - JOIN chain c ON b.parent_id = c.id - WHERE b.timestamp < ? - ) - SELECT path, size_mb, duration_sec, last_timestamp - FROM chain - ORDER BY last_timestamp DESC - LIMIT 1; - """ - - c.execute(query, (TARGET_DB, TARGET_TIME, TARGET_TIME)) - result = c.fetchone() - conn.close() - - if result: - path_str, size_mb, duration_sec, _ = result - return { - "db_name": TARGET_DB, - "target_time": TARGET_TIME, - "chain": path_str.split(','), - "total_size_mb": size_mb, - "total_duration_sec": duration_sec - } - return None - -def test_json_file_exists(): - assert os.path.exists(JSON_PATH), f"The expected output file {JSON_PATH} does not exist." - assert os.path.isfile(JSON_PATH), f"The path {JSON_PATH} is not a file." - -def test_json_contents(): - expected_data = get_expected_chain() - assert expected_data is not None, "Could not compute expected chain from the database." - - with open(JSON_PATH, 'r') as f: - try: - actual_data = json.load(f) - except json.JSONDecodeError: - pytest.fail(f"The file {JSON_PATH} does not contain valid JSON.") - - assert "db_name" in actual_data, "Missing 'db_name' in JSON output." - assert actual_data["db_name"] == expected_data["db_name"], f"Expected db_name '{expected_data['db_name']}', got '{actual_data['db_name']}'." - - assert "target_time" in actual_data, "Missing 'target_time' in JSON output." - assert actual_data["target_time"] == expected_data["target_time"], f"Expected target_time '{expected_data['target_time']}', got '{actual_data['target_time']}'." - - assert "chain" in actual_data, "Missing 'chain' in JSON output." - assert isinstance(actual_data["chain"], list), "'chain' must be a list of backup IDs." - assert actual_data["chain"] == expected_data["chain"], f"Expected chain {expected_data['chain']}, got {actual_data['chain']}." - - assert "total_size_mb" in actual_data, "Missing 'total_size_mb' in JSON output." - assert actual_data["total_size_mb"] == expected_data["total_size_mb"], f"Expected total_size_mb {expected_data['total_size_mb']}, got {actual_data['total_size_mb']}." - - assert "total_duration_sec" in actual_data, "Missing 'total_duration_sec' in JSON output." - assert actual_data["total_duration_sec"] == expected_data["total_duration_sec"], f"Expected total_duration_sec {expected_data['total_duration_sec']}, got {actual_data['total_duration_sec']}." \ No newline at end of file diff --git a/components/tmax/tasks/task_005684_3c8594a3/pristine/compliance_audit.db b/components/tmax/tasks/task_005684_3c8594a3/pristine/compliance_audit.db deleted file mode 100644 index d9a7ed4773be0a49a1f3cd1a1fa957cbfe552d20..0000000000000000000000000000000000000000 Binary files a/components/tmax/tasks/task_005684_3c8594a3/pristine/compliance_audit.db and /dev/null differ diff --git a/components/tmax/tasks/task_005684_3c8594a3/source/instruction.md b/components/tmax/tasks/task_005684_3c8594a3/source/instruction.md deleted file mode 100644 index f537f4b208a4c25a750ee29a4adb985fc96f675d..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_005684_3c8594a3/source/instruction.md +++ /dev/null @@ -1,23 +0,0 @@ -You are acting as a compliance officer auditing an internal corporate network. We have an undocumented SQLite database located at `/home/user/compliance_audit.db` containing employee records, internal communications, systems, and access logs. - -Your objective is to identify the most central employees in the communication network and determine the latest highly sensitive system each of these key individuals has accessed. - -Please perform the following steps: -1. **Reverse Engineer the Schema**: Inspect `/home/user/compliance_audit.db` to understand its table structure. There are tables for employees, communications (a directed graph of messages), systems, and system access logs. -2. **Graph Analytics**: Using Python and the `networkx` library, build a directed graph from the communications table. The `sender_id` should be the source, and `receiver_id` should be the target. Calculate the PageRank of each employee. Use `networkx.pagerank(G, alpha=0.85, max_iter=100)`. -3. **Window Functions & Aggregation**: Identify the Top 3 employees with the highest PageRank scores. For these 3 employees, use a SQL Window Function (e.g., `ROW_NUMBER()`) to query the database and find the *most recently accessed* system that is marked with a sensitivity level of 'High'. -4. **Format Conversion & Export**: Export the results to a JSON file at `/home/user/audit_report.json`. - -The output JSON must be an array of objects, sorted in descending order of PageRank score. If there's a tie in PageRank, sort by employee_id ascending. The JSON should have exactly this format: -```json -[ - { - "employee_id": 1, - "employee_name": "Alice Smith", - "pagerank_score": 0.3512, - "latest_high_risk_system": "Financial_Ledger" - }, - ... -] -``` -*Note: Round the `pagerank_score` to exactly 4 decimal places.* \ No newline at end of file diff --git a/components/tmax/tasks/task_005684_3c8594a3/source/task.toml b/components/tmax/tasks/task_005684_3c8594a3/source/task.toml deleted file mode 100644 index ad3b002b504b8279b36b6cf9578c3dc82a1ccb18..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_005684_3c8594a3/source/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_005684_3c8594a3" -description = "compliance officer auditing systems" - -[metadata] -source = "legacy" -base_image = "" -domain = "data_querying" -skill_type = "Graph Processing" -primitive_skills = ["Data model reverse engineering", "Graph analytics (centrality, clustering)", "Query result export and format conversion", "Window functions and analytical aggregation", "Knowledge graph pattern matching"] -task_complexity = "moderate task (several commands across setup, implementation, and verification)" -command_complexity = "bash and code (shell commands and writing/running scripts in Python, Perl, Ruby, etc.)" -scenario = "compliance officer auditing systems" -language = "Python" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/tasks/task_005684_3c8594a3/source/tests/test.sh b/components/tmax/tasks/task_005684_3c8594a3/source/tests/test.sh deleted file mode 100644 index 07fecc53c9aa50a6979ec252bb27ed9b8c5831b3..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_005684_3c8594a3/source/tests/test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -mkdir -p /logs/verifier - -cd /tests -python3 -m pytest test_final_state.py -v 2>&1 | tee /logs/verifier/test-stdout.txt -TEST_EXIT=${PIPESTATUS[0]} - -if [ $TEST_EXIT -eq 0 ]; then - echo 1 > /logs/verifier/reward.txt -else - echo 0 > /logs/verifier/reward.txt -fi - -exit 0 diff --git a/components/tmax/tasks/task_005684_3c8594a3/source/tests/test_final_state.py b/components/tmax/tasks/task_005684_3c8594a3/source/tests/test_final_state.py deleted file mode 100644 index f82ad961a5daabbea96c2c873551887e0368bd71..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_005684_3c8594a3/source/tests/test_final_state.py +++ /dev/null @@ -1,118 +0,0 @@ -# test_final_state.py - -import os -import json -import sqlite3 -import pytest - -DB_PATH = '/home/user/compliance_audit.db' -REPORT_PATH = '/home/user/audit_report.json' - -def compute_pagerank(nodes, edges, alpha=0.85, max_iter=100): - """Computes PageRank exactly as networkx.pagerank does by default.""" - N = len(nodes) - if N == 0: - return {} - - pr = {n: 1.0 / N for n in nodes} - out_degree = {n: 0 for n in nodes} - for u, v in edges: - out_degree[u] += 1 - - for _ in range(max_iter): - new_pr = {n: (1.0 - alpha) / N for n in nodes} - dangling_sum = sum(pr[n] for n in nodes if out_degree[n] == 0) - dangling_dist = alpha * dangling_sum / N - - for n in nodes: - new_pr[n] += dangling_dist - - for u, v in edges: - new_pr[v] += alpha * pr[u] / out_degree[u] - - pr = new_pr - - return pr - -def test_audit_report_exists(): - assert os.path.exists(REPORT_PATH), f"Report file {REPORT_PATH} is missing." - assert os.path.isfile(REPORT_PATH), f"{REPORT_PATH} is not a file." - -def test_audit_report_content(): - assert os.path.exists(DB_PATH), f"Database {DB_PATH} missing, cannot verify report." - - # 1. Recompute the expected truth from the database - conn = sqlite3.connect(DB_PATH) - cur = conn.cursor() - - # Get employees - cur.execute("SELECT emp_id, name FROM employees") - employees = {row[0]: row[1] for row in cur.fetchall()} - - # Get communications - cur.execute("SELECT sender_id, receiver_id FROM communications") - edges = cur.fetchall() - - # Compute PageRank - pr_scores = compute_pagerank(list(employees.keys()), edges) - - # Sort to find top 3 - sorted_emps = sorted(pr_scores.items(), key=lambda x: (-x[1], x[0])) - top_3 = sorted_emps[:3] - - # Get latest high risk system for top 3 - expected_results = [] - for emp_id, pr in top_3: - cur.execute(''' - SELECT s.sys_name - FROM access_logs a - JOIN systems s ON a.sys_id = s.sys_id - WHERE a.emp_id = ? AND s.sensitivity = 'High' - ORDER BY a.access_time DESC - LIMIT 1 - ''', (emp_id,)) - row = cur.fetchone() - sys_name = row[0] if row else None - - expected_results.append({ - "employee_id": emp_id, - "employee_name": employees[emp_id], - "pagerank_score": round(pr, 4), - "latest_high_risk_system": sys_name - }) - - conn.close() - - # 2. Read and validate the student's JSON - try: - with open(REPORT_PATH, 'r') as f: - student_data = json.load(f) - except json.JSONDecodeError: - pytest.fail(f"{REPORT_PATH} is not valid JSON.") - - assert isinstance(student_data, list), "JSON output must be a list of objects." - assert len(student_data) == 3, f"Expected exactly 3 records, got {len(student_data)}." - - # 3. Compare student's output to expected - for i, expected in enumerate(expected_results): - student_record = student_data[i] - - assert "employee_id" in student_record, f"Record {i} missing 'employee_id'" - assert "employee_name" in student_record, f"Record {i} missing 'employee_name'" - assert "pagerank_score" in student_record, f"Record {i} missing 'pagerank_score'" - assert "latest_high_risk_system" in student_record, f"Record {i} missing 'latest_high_risk_system'" - - assert student_record["employee_id"] == expected["employee_id"], \ - f"Expected employee_id {expected['employee_id']} at rank {i+1}, got {student_record['employee_id']}" - - assert student_record["employee_name"] == expected["employee_name"], \ - f"Expected employee_name '{expected['employee_name']}', got '{student_record['employee_name']}'" - - assert student_record["latest_high_risk_system"] == expected["latest_high_risk_system"], \ - f"Expected system '{expected['latest_high_risk_system']}', got '{student_record['latest_high_risk_system']}'" - - # Check PageRank with a small tolerance for float math differences - expected_pr = expected["pagerank_score"] - student_pr = student_record["pagerank_score"] - assert abs(student_pr - expected_pr) <= 0.005, \ - f"PageRank score for {expected['employee_name']} is {student_pr}, expected ~{expected_pr}" \ No newline at end of file diff --git a/components/tmax/tasks/task_008667_2151f271/pristine/data/financial.db b/components/tmax/tasks/task_008667_2151f271/pristine/data/financial.db deleted file mode 100644 index 18d27e16cf626a2cbaae4851c16f0112178520c8..0000000000000000000000000000000000000000 Binary files a/components/tmax/tasks/task_008667_2151f271/pristine/data/financial.db and /dev/null differ diff --git a/components/tmax/tasks/task_008667_2151f271/pristine/data/transactions.jsonl b/components/tmax/tasks/task_008667_2151f271/pristine/data/transactions.jsonl deleted file mode 100644 index fc75c221c07b53fc325724541ddc74a7de58d886..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008667_2151f271/pristine/data/transactions.jsonl +++ /dev/null @@ -1,10 +0,0 @@ -{"tx_id": "t1", "from_account": "a1", "to_account": "a3", "amount": 100.0, "currency": "USD"} -{"tx_id": "t2", "from_account": "a3", "to_account": "a4", "amount": 150.0, "currency": "USD"} -{"tx_id": "t3", "from_account": "a4", "to_account": "a2", "amount": 200.0, "currency": "USD"} -{"tx_id": "t4", "from_account": "a5", "to_account": "a6", "amount": 500.0, "currency": "USD"} -{"tx_id": "t5", "from_account": "a6", "to_account": "a7", "amount": 300.0, "currency": "USD"} -{"tx_id": "t6", "from_account": "a7", "to_account": "a5", "amount": 400.0, "currency": "USD"} -{"tx_id": "t7", "from_account": "a1", "to_account": "a5", "amount": 50.0, "currency": "USD"} -{"tx_id": "t8", "from_account": "a3", "to_account": "a6", "amount": 20.0, "currency": "USD"} -{"tx_id": "t9", "from_account": "a2", "to_account": "a3", "amount": 10.0, "currency": "USD"} -{"tx_id": "t10", "from_account": "a3", "to_account": "a2", "amount": 10.0, "currency": "USD"} diff --git a/components/tmax/tasks/task_008667_2151f271/source/instruction.md b/components/tmax/tasks/task_008667_2151f271/source/instruction.md deleted file mode 100644 index bf6e0582d1920ce00c79c8d7c1d0dc0e156498ce..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008667_2151f271/source/instruction.md +++ /dev/null @@ -1,44 +0,0 @@ -You are a data engineer investigating a series of complex financial transactions that resemble transaction deadlocks or circular money laundering schemes. Your data is split across a relational database (SQLite) and NoSQL exports (JSON Lines). - -You need to build an ETL and analytics script that maps these distinct data sources together, models them as a graph, and identifies fraudulent cycle patterns. - -**Data Sources:** -1. **Relational Database**: `/home/user/data/financial.db` (SQLite3) - - Table `users`: `user_id` (TEXT), `name` (TEXT) - - Table `accounts`: `account_id` (TEXT), `user_id` (TEXT) - *(Note: A single user can own multiple accounts.)* - -2. **NoSQL Export**: `/home/user/data/transactions.jsonl` - - A JSON Lines file where each line is a transaction. - - Format: `{"tx_id": "t1", "from_account": "a1", "to_account": "a2", "amount": 100.0, "currency": "USD"}` - -**Your Objective:** -Write a script in the language of your choice that processes this data to find all circular transaction chains of length exactly 3 at the **user level**. - -A user-level 3-cycle occurs when: -User A sends money to User B. -User B sends money to User C. -User C sends money to User A. -*(Note: These transfers can occur across any accounts owned by these users. Ensure A, B, and C are distinct users.)* - -For each 3-cycle found: -1. Identify the three users involved by their `name`. -2. Calculate the total aggregate `amount` of the transactions that make up this specific cycle (the sum of the A->B, B->C, and C->A transactions). If multiple transactions exist between the same accounts, treat each distinct 3-transaction combination that forms a cycle as a separate cycle. - -**Output Requirements:** -Create a JSON file at `/home/user/output/fraud_cycles.json`. -The file should contain a single JSON array of objects, where each object represents a detected 3-cycle. -Format: -```json -[ - { - "users": ["Alice", "Bob", "Charlie"], - "total_amount": 450.5 - } -] -``` -- The `users` array in each object **must be sorted alphabetically** (e.g., `["Alice", "Bob", "Charlie"]`). -- The outer JSON array of cycles must be **sorted by `total_amount` in descending order**. If there's a tie, sort by the first username in the `users` array alphabetically. -- Eliminate duplicate cycles (i.e., A->B->C->A is the same cycle as B->C->A->B, it should only appear once in the final output). - -Ensure the output directory exists before writing the file. \ No newline at end of file diff --git a/components/tmax/tasks/task_008667_2151f271/source/task.toml b/components/tmax/tasks/task_008667_2151f271/source/task.toml deleted file mode 100644 index c683fe584207aea717358d58793c010d23d7666c..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008667_2151f271/source/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_008667_2151f271" -description = "data engineer building ETL pipelines" - -[metadata] -source = "legacy" -base_image = "" -domain = "data_querying" -skill_type = "Result Processing" -primitive_skills = ["NoSQL aggregation pipelines", "Query-to-pipeline chaining", "Schema analysis and relationship mapping", "Graph analytics (centrality, clustering)", "Cross-representation mapping (relational, document, graph)"] -task_complexity = "complex task (many commands spanning multiple phases: dependency installation, code writing, configuration, building, and testing)" -command_complexity = "bash, code, and system services (shell commands, scripts, package installation, service configuration, networking, and containers)" -scenario = "data engineer building ETL pipelines" -language = "any (model's choice)" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/tasks/task_008667_2151f271/source/tests/test.sh b/components/tmax/tasks/task_008667_2151f271/source/tests/test.sh deleted file mode 100644 index 07fecc53c9aa50a6979ec252bb27ed9b8c5831b3..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008667_2151f271/source/tests/test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -mkdir -p /logs/verifier - -cd /tests -python3 -m pytest test_final_state.py -v 2>&1 | tee /logs/verifier/test-stdout.txt -TEST_EXIT=${PIPESTATUS[0]} - -if [ $TEST_EXIT -eq 0 ]; then - echo 1 > /logs/verifier/reward.txt -else - echo 0 > /logs/verifier/reward.txt -fi - -exit 0 diff --git a/components/tmax/tasks/task_008667_2151f271/source/tests/test_final_state.py b/components/tmax/tasks/task_008667_2151f271/source/tests/test_final_state.py deleted file mode 100644 index a4be9959ddb4b5b91a1ac0e6d4afb58d3565c28b..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008667_2151f271/source/tests/test_final_state.py +++ /dev/null @@ -1,91 +0,0 @@ -# test_final_state.py - -import os -import sqlite3 -import json -import pytest - -def get_expected_cycles(): - db_path = '/home/user/data/financial.db' - jsonl_path = '/home/user/data/transactions.jsonl' - - if not os.path.isfile(db_path) or not os.path.isfile(jsonl_path): - return [] - - # Load users and accounts - conn = sqlite3.connect(db_path) - c = conn.cursor() - - users = {} - for row in c.execute('SELECT user_id, name FROM users'): - users[row[0]] = row[1] - - accounts = {} - for row in c.execute('SELECT account_id, user_id FROM accounts'): - accounts[row[0]] = row[1] - - conn.close() - - # Load transactions - transactions = [] - with open(jsonl_path, 'r') as f: - for line in f: - if line.strip(): - tx = json.loads(line) - from_u = accounts.get(tx['from_account']) - to_u = accounts.get(tx['to_account']) - if from_u and to_u: - transactions.append({ - 'tx_id': tx['tx_id'], - 'from_user': from_u, - 'to_user': to_u, - 'amount': tx['amount'] - }) - - cycles = {} - # Find 3-cycles - for t1 in transactions: - for t2 in transactions: - if t1['to_user'] == t2['from_user']: - for t3 in transactions: - if t2['to_user'] == t3['from_user'] and t3['to_user'] == t1['from_user']: - u1, u2, u3 = t1['from_user'], t2['from_user'], t3['from_user'] - if len({u1, u2, u3}) == 3: - tx_set = frozenset([t1['tx_id'], t2['tx_id'], t3['tx_id']]) - if tx_set not in cycles: - total_amount = t1['amount'] + t2['amount'] + t3['amount'] - user_names = sorted([users[u1], users[u2], users[u3]]) - cycles[tx_set] = { - "users": user_names, - "total_amount": total_amount - } - - result = list(cycles.values()) - result.sort(key=lambda x: (-x['total_amount'], x['users'][0])) - return result - -def test_fraud_cycles_output(): - output_path = '/home/user/output/fraud_cycles.json' - assert os.path.isfile(output_path), f"Output file {output_path} does not exist." - - with open(output_path, 'r') as f: - try: - output_data = json.load(f) - except json.JSONDecodeError: - pytest.fail(f"Output file {output_path} is not valid JSON.") - - assert isinstance(output_data, list), "Output JSON must be a list of objects." - - expected_data = get_expected_cycles() - - assert len(output_data) == len(expected_data), f"Expected {len(expected_data)} cycles, found {len(output_data)}." - - for i, (actual, expected) in enumerate(zip(output_data, expected_data)): - assert "users" in actual, f"Cycle at index {i} missing 'users' key." - assert "total_amount" in actual, f"Cycle at index {i} missing 'total_amount' key." - - assert isinstance(actual["users"], list), f"'users' at index {i} must be a list." - assert actual["users"] == expected["users"], f"Expected users {expected['users']} at index {i}, got {actual['users']}. Make sure they are sorted alphabetically." - - assert isinstance(actual["total_amount"], (int, float)), f"'total_amount' at index {i} must be a number." - assert abs(actual["total_amount"] - expected["total_amount"]) < 1e-6, f"Expected total_amount {expected['total_amount']} at index {i}, got {actual['total_amount']}." \ No newline at end of file diff --git a/components/tmax/tasks/task_008998_ae4cbe72/pristine/robot_dump.log.gz b/components/tmax/tasks/task_008998_ae4cbe72/pristine/robot_dump.log.gz deleted file mode 100644 index 69ab00f76d4c3a106f231fd55110feb524c43626..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008998_ae4cbe72/pristine/robot_dump.log.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:909d2e964c0831d8af91b722b4424ed829c261d6b7db1a95180d8a809527ddaf -size 261 diff --git a/components/tmax/tasks/task_008998_ae4cbe72/source/instruction.md b/components/tmax/tasks/task_008998_ae4cbe72/source/instruction.md deleted file mode 100644 index 676014f05d78706bf9510faec15971d4f194eb66..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008998_ae4cbe72/source/instruction.md +++ /dev/null @@ -1,15 +0,0 @@ -You are a backup administrator for a high-tech manufacturing facility. Periodically, the central manufacturing server dumps a combined telemetry, log, and job-instruction stream into a highly compressed archive. You need to process the latest daily dump, extract critical error alerts for the monitoring system, and archive the proprietary manufacturing instructions (GCode) into a dedicated directory. - -The dump file is located at `/home/user/robot_dump.log.gz`. -It is a gzipped text file containing mixed data: standard log lines, critical errors, and inline multi-line GCode blocks. - -Your task is to write a Python script (or use bash shell commands) to process this compressed stream *without* fully decompressing it to disk first (assume it would normally be too large for disk storage, so process it as a stream). - -Perform the following operations: -1. Create a directory called `/home/user/archived_gcode/`. -2. Scan the compressed stream. Whenever you encounter a line that is exactly `[GCODE_START]`, capture all subsequent lines until you hit a line that is exactly `[GCODE_END]`. -3. Save each captured GCode block into the `/home/user/archived_gcode/` directory. Name them sequentially as `job_1.gcode`, `job_2.gcode`, `job_3.gcode`, etc., based on the order they appear in the stream. Do not include the `[GCODE_START]` and `[GCODE_END]` tags in the output files. -4. Concurrently, identify any log lines that contain the exact string ` CRITICAL `. Extract the timestamp (which is always the first word on the line) and the rest of the message following ` CRITICAL `. -5. Save these critical logs into `/home/user/critical_errors.csv`. The format must be exactly `TIMESTAMP,MESSAGE` (e.g., if the line is `2023-10-24T10:05:00 CRITICAL Axis X limit switch hit`, the CSV line should be `2023-10-24T10:05:00,Axis X limit switch hit`). - -Ensure the final `.csv` and `.gcode` files are written exactly as specified. \ No newline at end of file diff --git a/components/tmax/tasks/task_008998_ae4cbe72/source/task.toml b/components/tmax/tasks/task_008998_ae4cbe72/source/task.toml deleted file mode 100644 index 0039c86263050c505a10d7014e3d493c344c1fdc..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008998_ae4cbe72/source/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_008998_ae4cbe72" -description = "backup administrator archiving data" - -[metadata] -source = "legacy" -base_image = "" -domain = "file_operations" -skill_type = "File I/O" -primitive_skills = ["Standard stream redirection and piping", "Text transformation with sed/awk/vim", "Domain-specific format parsing (GCode, ELF, WAL)", "Format conversion between file types", "Compressed stream processing"] -task_complexity = "short task (a few shell commands focused on the core task)" -command_complexity = "bash and code (shell commands and writing/running scripts in Python, Perl, Ruby, etc.)" -scenario = "backup administrator archiving data" -language = "Python" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/tasks/task_008998_ae4cbe72/source/tests/test.sh b/components/tmax/tasks/task_008998_ae4cbe72/source/tests/test.sh deleted file mode 100644 index 07fecc53c9aa50a6979ec252bb27ed9b8c5831b3..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008998_ae4cbe72/source/tests/test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -mkdir -p /logs/verifier - -cd /tests -python3 -m pytest test_final_state.py -v 2>&1 | tee /logs/verifier/test-stdout.txt -TEST_EXIT=${PIPESTATUS[0]} - -if [ $TEST_EXIT -eq 0 ]; then - echo 1 > /logs/verifier/reward.txt -else - echo 0 > /logs/verifier/reward.txt -fi - -exit 0 diff --git a/components/tmax/tasks/task_008998_ae4cbe72/source/tests/test_final_state.py b/components/tmax/tasks/task_008998_ae4cbe72/source/tests/test_final_state.py deleted file mode 100644 index 65b742ef5fe222b0598ab7e38471330d12f919aa..0000000000000000000000000000000000000000 --- a/components/tmax/tasks/task_008998_ae4cbe72/source/tests/test_final_state.py +++ /dev/null @@ -1,77 +0,0 @@ -# test_final_state.py -import os -import gzip -import pytest - -DUMP_PATH = "/home/user/robot_dump.log.gz" -GCODE_DIR = "/home/user/archived_gcode" -CSV_PATH = "/home/user/critical_errors.csv" - -def get_expected_data(): - expected_csv_lines = [] - expected_gcode_blocks = [] - - with gzip.open(DUMP_PATH, 'rt') as f: - in_gcode = False - current_gcode = [] - for line in f: - stripped = line.strip() - - # Handle GCode blocks - if stripped == "[GCODE_START]": - in_gcode = True - current_gcode = [] - continue - elif stripped == "[GCODE_END]": - in_gcode = False - expected_gcode_blocks.append("\n".join(current_gcode)) - continue - - if in_gcode: - current_gcode.append(stripped) - - # Handle CRITICAL logs - if " CRITICAL " in line: - # The timestamp is the first word, the message is everything after " CRITICAL " - parts = line.split(" CRITICAL ", 1) - if len(parts) == 2: - timestamp = parts[0].split()[0] - message = parts[1].strip() - expected_csv_lines.append(f"{timestamp},{message}") - - return expected_csv_lines, expected_gcode_blocks - -def test_archived_gcode_directory_exists(): - assert os.path.exists(GCODE_DIR), f"Directory {GCODE_DIR} does not exist." - assert os.path.isdir(GCODE_DIR), f"{GCODE_DIR} is not a directory." - -def test_critical_errors_csv(): - expected_csv_lines, _ = get_expected_data() - - assert os.path.exists(CSV_PATH), f"CSV file {CSV_PATH} does not exist." - assert os.path.isfile(CSV_PATH), f"{CSV_PATH} is not a file." - - with open(CSV_PATH, 'r') as f: - actual_lines = [line.strip() for line in f if line.strip()] - - assert actual_lines == expected_csv_lines, "The contents of the CSV file do not match the expected critical errors." - -def test_gcode_files(): - _, expected_gcode_blocks = get_expected_data() - - assert os.path.exists(GCODE_DIR) and os.path.isdir(GCODE_DIR), f"Directory {GCODE_DIR} is missing." - - actual_files = [f for f in os.listdir(GCODE_DIR) if os.path.isfile(os.path.join(GCODE_DIR, f))] - expected_filenames = [f"job_{i+1}.gcode" for i in range(len(expected_gcode_blocks))] - - # Check that the exact expected files are present - assert set(actual_files) == set(expected_filenames), f"Expected files {expected_filenames} in {GCODE_DIR}, but found {actual_files}." - - for i, expected_block in enumerate(expected_gcode_blocks): - filename = f"job_{i+1}.gcode" - filepath = os.path.join(GCODE_DIR, filename) - - with open(filepath, 'r') as f: - actual_content = f.read().strip() - - assert actual_content == expected_block, f"The contents of {filename} do not match the expected GCode block." \ No newline at end of file diff --git a/components/tmax/upstream/task_000056_f726766b/environment/Dockerfile b/components/tmax/upstream/task_000056_f726766b/environment/Dockerfile deleted file mode 100644 index c4ce78856003ee649c2ad1cf6ce8fb3e98da9ebc..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000056_f726766b/environment/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM ubuntu:22.04 - -ENV DEBIAN_FRONTEND=noninteractive -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -ENV GOPATH=/home/user/go -ENV PATH=/home/user/go/bin:/home/user/.cargo/bin:$PATH - -COPY base_install.sh /tmp/base_install.sh -RUN bash /tmp/base_install.sh && rm /tmp/base_install.sh - -COPY ["_fixtures/app/fixtures/audio.wav", "/app/fixtures/audio.wav"] -COPY ["_fixtures/app/fixtures/audio.label.txt", "/app/fixtures/audio.label.txt"] - -COPY post_install.sh /tmp/post_install.sh -RUN bash /tmp/post_install.sh && rm /tmp/post_install.sh diff --git a/components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.label.txt b/components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.label.txt deleted file mode 100644 index 9ecf271983f3ae6d3519c5a189b10c5c576db411..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.label.txt +++ /dev/null @@ -1 +0,0 @@ -660 \ No newline at end of file diff --git a/components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.wav b/components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.wav deleted file mode 100644 index 4758671dcff5ae49793a3591b5de7da560018988..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000056_f726766b/environment/_fixtures/app/fixtures/audio.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f55a8eec263c9be975b2adccdda6a07c680109b851a89f55779f14076aaa30d5 -size 16044 diff --git a/components/tmax/upstream/task_000056_f726766b/environment/base_install.sh b/components/tmax/upstream/task_000056_f726766b/environment/base_install.sh deleted file mode 100644 index 6f46bd16f3a6b39dcfafd163103e93ac46dcf046..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000056_f726766b/environment/base_install.sh +++ /dev/null @@ -1,69 +0,0 @@ -apt-get update && apt-get install -y --no-install-recommends \ - python3 python3-pip python3-venv \ - coreutils findutils gawk sed grep \ - curl wget git \ - build-essential gcc g++ make cmake \ - pkg-config autoconf automake libtool \ - nodejs npm \ - sqlite3 libsqlite3-dev \ - valgrind gdb \ - jq \ - sudo \ - golang-go \ - rustc cargo \ - nasm \ - ffmpeg \ - tesseract-ocr tesseract-ocr-eng \ - upx-ucl binutils file xxd \ - libjpeg-dev libpng-dev libtiff-dev libwebp-dev \ - libfreetype6-dev liblapack-dev libopenblas-dev \ - imagemagick \ - espeak espeak-ng libespeak-ng-dev \ - redis-server redis-tools \ - nginx \ - netcat-openbsd socat \ - openmpi-bin libopenmpi-dev \ - postgresql-client mariadb-client \ - postfix mailutils \ - expect inotify-tools \ - unzip zip xz-utils \ - && rm -rf /var/lib/apt/lists/* - - # Core scientific Python stack — picks CPU-only torch via the dedicated - # PyPI index URL to avoid pulling the ~2 GB CUDA wheels. - # - # Includes a small set of common build / packaging / domain-specific - # helpers that v2 task deltas frequently invoke: - # * pyinstaller — compile Python → standalone binary - # (caught by smoke: tasks asking the agent to package a CLI tool) - # * cython — C extension building from Python sources - # * pybind11 / cffi — C/C++ FFI for fixture-shipped binaries - # * sympy — symbolic math for metric_threshold verifiers - # * networkx — graph algorithms (debugging / scientific tasks) - # * cryptography — crypto / security tasks beyond pure stdlib - pip3 install --no-cache-dir \ - pytest \ - flask requests pyyaml toml \ - numpy scipy scikit-learn pandas \ - Pillow imageio matplotlib \ - biopython \ - beautifulsoup4 lxml \ - pyinstaller cython pybind11 cffi \ - sympy networkx cryptography \ - redis psycopg2-binary pyserial paramiko - - pip3 install --no-cache-dir \ - --index-url https://download.pytorch.org/whl/cpu \ - torch torchvision - - # NOTE on the agent loop: rl_data.generator.vanillux_solver runs the - # mini-swe-agent-style harness ENTIRELY ON THE HOST (in our solver - # process). Only bash actions cross into this container via - # InteractiveContainerEnvironment.exec(). That means this SIF only - # needs bash + the build/ML/RE deps installed above — no swe-agent - # CLI, no Python 3.11 venv, no extra ~200 MB layer. As a bonus, the - # vanillux harness now also works on every legacy per-domain base - # SIF without modification. - - useradd -m -s /bin/bash user || true - chmod 755 /home/user \ No newline at end of file diff --git a/components/tmax/upstream/task_000056_f726766b/environment/post_install.sh b/components/tmax/upstream/task_000056_f726766b/environment/post_install.sh deleted file mode 100644 index d4c526bb8862f0f1dd5037e369e62333672ba4b3..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000056_f726766b/environment/post_install.sh +++ /dev/null @@ -1,36 +0,0 @@ -apt-get update && apt-get install -y python3 python3-pip - pip3 install pytest numpy scipy - - mkdir -p /app - cat << 'EOF' > /tmp/generate_data.py -import numpy as np -import scipy.io.wavfile as wav -from scipy.integrate import solve_ivp -import os - -def system(t, y): - x1, x2, v1, v2 = y - m1, m2 = 1.0, 1.5 - c1, c2 = 0.5, 0.8 - k1, k2, k3 = 50.0, 20.0, 45.0 - - a1 = (-c1*v1 - (k1+k2)*x1 + k2*x2) / m1 - a2 = (-c2*v2 - (k2+k3)*x2 + k2*x1) / m2 - return [v1, v2, a1, a2] - -t_span = (0, 10) -t_eval = np.linspace(0, 10, 10000, endpoint=False) -y0 = [1.0, 0.0, 0.0, 0.0] - -sol = solve_ivp(system, t_span, y0, t_eval=t_eval, method='Radau', rtol=1e-8, atol=1e-8) -x1_signal = sol.y[0].astype(np.float32) - -os.makedirs('/app', exist_ok=True) -wav.write('/app/vibration_data.wav', 1000, x1_signal) -EOF - - python3 /tmp/generate_data.py - rm /tmp/generate_data.py - - useradd -m -s /bin/bash user || true - chmod -R 777 /home/user \ No newline at end of file diff --git a/components/tmax/upstream/task_000056_f726766b/task.toml b/components/tmax/upstream/task_000056_f726766b/task.toml deleted file mode 100644 index e93b8d4e92f8de07b15763d5955577543e6ce421..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000056_f726766b/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_000056_f726766b" -description = "data scientist fitting models" - -[metadata] -source = "v2" -base_image = "intricate" -domain = "scientific_computing" -skill_type = "Algorithmic" -primitive_skills = ["Scientific environment management", "Convergence testing", "Fourier transforms and spectral analysis", "ODE/PDE numerical solving"] -task_complexity = "intricate task (multi-stage workflow combining (a) environment setup or package configuration, (b) primary implementation across multiple files or languages, (c) iterative refinement against a quantitative or adversarial verifier, and (d) a final integration step. Expect 30-60 commands.)" -command_complexity = "bash and code (shell commands and writing/running scripts in Python, Perl, Ruby, etc.)" -scenario = "data scientist fitting models" -language = "Python" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/upstream/task_000260_7b7cc286/environment/Dockerfile b/components/tmax/upstream/task_000260_7b7cc286/environment/Dockerfile deleted file mode 100644 index f065a05a47adc9fb0c197e14262600f4655e12ed..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000260_7b7cc286/environment/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM ubuntu:22.04 - -ENV DEBIAN_FRONTEND=noninteractive -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -ENV GOPATH=/home/user/go -ENV PATH=/home/user/go/bin:/home/user/.cargo/bin:$PATH - -COPY base_install.sh /tmp/base_install.sh -RUN bash /tmp/base_install.sh && rm /tmp/base_install.sh - -COPY ["_fixtures/app/fixtures/video.mp4", "/app/fixtures/video.mp4"] -COPY ["_fixtures/app/fixtures/video.label.txt", "/app/fixtures/video.label.txt"] - -COPY post_install.sh /tmp/post_install.sh -RUN bash /tmp/post_install.sh && rm /tmp/post_install.sh diff --git a/components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.label.txt b/components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.label.txt deleted file mode 100644 index 9a037142aa3c1b4c490e1a38251620f113465330..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.label.txt +++ /dev/null @@ -1 +0,0 @@ -10 \ No newline at end of file diff --git a/components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.mp4 b/components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.mp4 deleted file mode 100644 index 3a3882d1b37412d585419535181526b2feae5bf9..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000260_7b7cc286/environment/_fixtures/app/fixtures/video.mp4 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bf759113108b136ec3b5fa507d035c1e66ac243b52da09fa07ab58566ee27f58 -size 3342 diff --git a/components/tmax/upstream/task_000260_7b7cc286/environment/base_install.sh b/components/tmax/upstream/task_000260_7b7cc286/environment/base_install.sh deleted file mode 100644 index 6f46bd16f3a6b39dcfafd163103e93ac46dcf046..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000260_7b7cc286/environment/base_install.sh +++ /dev/null @@ -1,69 +0,0 @@ -apt-get update && apt-get install -y --no-install-recommends \ - python3 python3-pip python3-venv \ - coreutils findutils gawk sed grep \ - curl wget git \ - build-essential gcc g++ make cmake \ - pkg-config autoconf automake libtool \ - nodejs npm \ - sqlite3 libsqlite3-dev \ - valgrind gdb \ - jq \ - sudo \ - golang-go \ - rustc cargo \ - nasm \ - ffmpeg \ - tesseract-ocr tesseract-ocr-eng \ - upx-ucl binutils file xxd \ - libjpeg-dev libpng-dev libtiff-dev libwebp-dev \ - libfreetype6-dev liblapack-dev libopenblas-dev \ - imagemagick \ - espeak espeak-ng libespeak-ng-dev \ - redis-server redis-tools \ - nginx \ - netcat-openbsd socat \ - openmpi-bin libopenmpi-dev \ - postgresql-client mariadb-client \ - postfix mailutils \ - expect inotify-tools \ - unzip zip xz-utils \ - && rm -rf /var/lib/apt/lists/* - - # Core scientific Python stack — picks CPU-only torch via the dedicated - # PyPI index URL to avoid pulling the ~2 GB CUDA wheels. - # - # Includes a small set of common build / packaging / domain-specific - # helpers that v2 task deltas frequently invoke: - # * pyinstaller — compile Python → standalone binary - # (caught by smoke: tasks asking the agent to package a CLI tool) - # * cython — C extension building from Python sources - # * pybind11 / cffi — C/C++ FFI for fixture-shipped binaries - # * sympy — symbolic math for metric_threshold verifiers - # * networkx — graph algorithms (debugging / scientific tasks) - # * cryptography — crypto / security tasks beyond pure stdlib - pip3 install --no-cache-dir \ - pytest \ - flask requests pyyaml toml \ - numpy scipy scikit-learn pandas \ - Pillow imageio matplotlib \ - biopython \ - beautifulsoup4 lxml \ - pyinstaller cython pybind11 cffi \ - sympy networkx cryptography \ - redis psycopg2-binary pyserial paramiko - - pip3 install --no-cache-dir \ - --index-url https://download.pytorch.org/whl/cpu \ - torch torchvision - - # NOTE on the agent loop: rl_data.generator.vanillux_solver runs the - # mini-swe-agent-style harness ENTIRELY ON THE HOST (in our solver - # process). Only bash actions cross into this container via - # InteractiveContainerEnvironment.exec(). That means this SIF only - # needs bash + the build/ML/RE deps installed above — no swe-agent - # CLI, no Python 3.11 venv, no extra ~200 MB layer. As a bonus, the - # vanillux harness now also works on every legacy per-domain base - # SIF without modification. - - useradd -m -s /bin/bash user || true - chmod 755 /home/user \ No newline at end of file diff --git a/components/tmax/upstream/task_000260_7b7cc286/environment/post_install.sh b/components/tmax/upstream/task_000260_7b7cc286/environment/post_install.sh deleted file mode 100644 index 7acc511b803baefbc4d90a70fe0fbe535ebacdf3..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000260_7b7cc286/environment/post_install.sh +++ /dev/null @@ -1,83 +0,0 @@ -apt-get update && apt-get install -y python3 python3-pip ffmpeg imagemagick bc gawk -pip3 install pytest numpy - -mkdir -p /app -# Generate a test video -ffmpeg -f lavfi -i testsrc=duration=1:size=320x240:rate=10 -metadata title="Test \"Video\" \\ Data" /app/video.mp4 - -mkdir -p /home/user/pipeline - -cat << 'EOF' > /home/user/pipeline/process.sh -#!/bin/bash -VIDEO=$1 -OUTPUT=$2 - -mkdir -p /tmp/frames -ffmpeg -i "$VIDEO" -vf "format=gray" /tmp/frames/frame_%04d.jpg 2>/dev/null - -TITLE=$(ffprobe -v quiet -show_entries format_tags=title -of default=noprint_wrappers=1:nokey=1 "$VIDEO") - -THRESHOLDS="" -for f in /tmp/frames/*.jpg; do - # extract histogram - HIST=$(convert "$f" -format %c histogram:info:- | awk '{print $1}') - T=$(./find_threshold.sh "$f") - THRESHOLDS="$THRESHOLDS $T" -done - -./serialize.sh "$TITLE" "$THRESHOLDS" > "$OUTPUT" -EOF - -cat << 'EOF' > /home/user/pipeline/find_threshold.sh -#!/bin/bash -# ISODATA thresholding -FILE=$1 -T=128 -T_PREV=0 - -# BUG: bash integer arithmetic used for float comparison, or bad convergence logic -while true; do - DIFF=$(echo "$T - $T_PREV" | bc | awk '{if ($1 < 0) print -$1; else print $1}') - CONVERGED=$(awk -v diff="$DIFF" 'BEGIN { if(diff < 0.01) print 1; else print 0 }') - - if [ "$CONVERGED" -eq 1 ]; then - break - fi - T_PREV=$T - - # Calculate means (stubbed out actual image processing for brevity, assume awk does it) - # The bug is that they might truncate - RES=$(convert "$FILE" -format "%[fx:mean*255]" info:) - # Fake update for the sake of the exercise - T=$(awk -v t="$T" -v m="$RES" 'BEGIN { print (t + m) / 2 }') -done -echo "$T" -EOF - -cat << 'EOF' > /home/user/pipeline/serialize.sh -#!/bin/bash -TITLE=$1 -THRESHOLDS=$2 - -# BUG: Doesn't escape TITLE -echo "{" -echo " \"title\": \"$TITLE\"," -echo " \"frame_thresholds\": [" -FIRST=1 -for T in $THRESHOLDS; do - if [ $FIRST -eq 1 ]; then - echo " $T" - FIRST=0 - else - echo " ,$T" - fi -done -echo " ]" -echo "}" -EOF - -chmod +x /home/user/pipeline/*.sh - -useradd -m -s /bin/bash user || true -chmod -R 777 /home/user -chmod -R 777 /app \ No newline at end of file diff --git a/components/tmax/upstream/task_000260_7b7cc286/task.toml b/components/tmax/upstream/task_000260_7b7cc286/task.toml deleted file mode 100644 index 9948aee18b894f097cb45eb35e151df0f0758b5e..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000260_7b7cc286/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_000260_7b7cc286" -description = "developer inheriting an unfamiliar codebase" - -[metadata] -source = "v2" -base_image = "intricate" -domain = "debugging" -skill_type = "Data Processing" -primitive_skills = ["Floating-point precision repair", "Encoding and serialization troubleshooting", "Convergence failure repair"] -task_complexity = "intricate task (multi-stage workflow combining (a) environment setup or package configuration, (b) primary implementation across multiple files or languages, (c) iterative refinement against a quantitative or adversarial verifier, and (d) a final integration step. Expect 30-60 commands.)" -command_complexity = "bash-only (shell built-ins, coreutils, and standard CLI tools)" -scenario = "developer inheriting an unfamiliar codebase" -language = "Bash" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/upstream/task_000663_dff2c340/environment/Dockerfile b/components/tmax/upstream/task_000663_dff2c340/environment/Dockerfile deleted file mode 100644 index 215bdf6b86910b66101b0f0f2932be01779d1502..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000663_dff2c340/environment/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM ubuntu:22.04 - -ENV DEBIAN_FRONTEND=noninteractive - -COPY post_install.sh /tmp/post_install.sh -RUN bash /tmp/post_install.sh && rm /tmp/post_install.sh diff --git a/components/tmax/upstream/task_000663_dff2c340/environment/post_install.sh b/components/tmax/upstream/task_000663_dff2c340/environment/post_install.sh deleted file mode 100644 index 4c0cae1ede0ce6d4ca23bf2880315e49f3af0e0c..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000663_dff2c340/environment/post_install.sh +++ /dev/null @@ -1,54 +0,0 @@ -apt-get update && apt-get install -y python3 python3-pip - pip3 install pytest - - useradd -m -s /bin/bash user || true - - cat << 'EOF' > /tmp/setup_db.py -import sqlite3 -import os - -db_path = '/home/user/backup_catalog.db' -os.makedirs(os.path.dirname(db_path), exist_ok=True) -conn = sqlite3.connect(db_path) -c = conn.cursor() - -c.execute(''' - CREATE TABLE backups ( - id TEXT PRIMARY KEY, - db_name TEXT, - backup_type TEXT, - parent_id TEXT, - timestamp TEXT, - size_mb INTEGER, - duration_sec INTEGER - ) -''') - -backups_data = [ - # Chain 1 for auth_prod (Old, superseded) - ('bkp_01', 'auth_prod', 'FULL', None, '2023-10-20 00:00:00', 950, 180), - ('bkp_02', 'auth_prod', 'INC', 'bkp_01', '2023-10-21 00:00:00', 100, 20), - - # Chain 2 for auth_prod (The correct active chain) - ('bkp_10', 'auth_prod', 'FULL', None, '2023-10-26 00:00:00', 1000, 200), - ('bkp_11', 'other_db', 'FULL', None, '2023-10-26 01:00:00', 5000, 800), - ('bkp_12', 'auth_prod', 'INC', 'bkp_10', '2023-10-26 12:00:00', 200, 40), - ('bkp_14', 'auth_prod', 'INC', 'bkp_12', '2023-10-27 00:00:00', 300, 60), - ('bkp_18', 'auth_prod', 'INC', 'bkp_14', '2023-10-27 12:00:00', 50, 15), - - # Backup after the crash - ('bkp_20', 'auth_prod', 'INC', 'bkp_18', '2023-10-28 00:00:00', 100, 30), - - # Another full backup for auth_prod taken after crash - ('bkp_25', 'auth_prod', 'FULL', None, '2023-10-28 12:00:00', 1200, 220) -] - -c.executemany('INSERT INTO backups VALUES (?, ?, ?, ?, ?, ?, ?)', backups_data) -conn.commit() -conn.close() -EOF - - python3 /tmp/setup_db.py - rm /tmp/setup_db.py - - chmod -R 777 /home/user \ No newline at end of file diff --git a/components/tmax/upstream/task_000663_dff2c340/task.toml b/components/tmax/upstream/task_000663_dff2c340/task.toml deleted file mode 100644 index 984812efa3bdb6f20f1c0bee3da121d04e717a16..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_000663_dff2c340/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_000663_dff2c340" -description = "database reliability engineer managing backups" - -[metadata] -source = "legacy" -base_image = "" -domain = "data_querying" -skill_type = "Result Processing" -primitive_skills = ["Knowledge graph pattern matching", "Recursive and hierarchical queries", "Result sorting, pagination, and filtering", "Window functions and analytical aggregation", "Graph projection and materialization"] -task_complexity = "short task (a few shell commands focused on the core task)" -command_complexity = "bash and code (shell commands and writing/running scripts in Python, Perl, Ruby, etc.)" -scenario = "database reliability engineer managing backups" -language = "Python" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/upstream/task_005684_3c8594a3/environment/Dockerfile b/components/tmax/upstream/task_005684_3c8594a3/environment/Dockerfile deleted file mode 100644 index 215bdf6b86910b66101b0f0f2932be01779d1502..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_005684_3c8594a3/environment/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM ubuntu:22.04 - -ENV DEBIAN_FRONTEND=noninteractive - -COPY post_install.sh /tmp/post_install.sh -RUN bash /tmp/post_install.sh && rm /tmp/post_install.sh diff --git a/components/tmax/upstream/task_005684_3c8594a3/environment/post_install.sh b/components/tmax/upstream/task_005684_3c8594a3/environment/post_install.sh deleted file mode 100644 index 40410cf9bb187d2d89d1a326f3be166ef6c89904..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_005684_3c8594a3/environment/post_install.sh +++ /dev/null @@ -1,73 +0,0 @@ -apt-get update && apt-get install -y python3 python3-pip - pip3 install pytest networkx - - useradd -m -s /bin/bash user || true - - cat << 'EOF' > /home/user/setup_db.py -import sqlite3 -import os - -db_path = '/home/user/compliance_audit.db' -if os.path.exists(db_path): - os.remove(db_path) - -conn = sqlite3.connect(db_path) -cur = conn.cursor() - -# Create tables -cur.execute('''CREATE TABLE employees (emp_id INTEGER PRIMARY KEY, name TEXT)''') -cur.execute('''CREATE TABLE communications (msg_id INTEGER PRIMARY KEY, sender_id INTEGER, receiver_id INTEGER, timestamp TEXT)''') -cur.execute('''CREATE TABLE systems (sys_id INTEGER PRIMARY KEY, sys_name TEXT, sensitivity TEXT)''') -cur.execute('''CREATE TABLE access_logs (log_id INTEGER PRIMARY KEY, emp_id INTEGER, sys_id INTEGER, access_time TEXT)''') - -# Insert employees -employees = [ - (1, 'Alice Central'), - (2, 'Bob Broker'), - (3, 'Charlie Clerk'), - (4, 'Diana Director'), - (5, 'Evan Employee') -] -cur.executemany('INSERT INTO employees VALUES (?, ?)', employees) - -# Insert communications -comms = [ - (1, 2, 1, '2023-01-01'), - (2, 3, 1, '2023-01-02'), - (3, 4, 1, '2023-01-03'), - (4, 5, 1, '2023-01-04'), - (5, 1, 2, '2023-01-05'), - (6, 3, 2, '2023-01-06'), - (7, 4, 2, '2023-01-07'), - (8, 5, 3, '2023-01-08') -] -cur.executemany('INSERT INTO communications VALUES (?, ?, ?, ?)', comms) - -# Insert systems -systems = [ - (101, 'Trading_Engine', 'High'), - (102, 'HR_Portal', 'Low'), - (103, 'Vault_DB', 'High'), - (104, 'Cafeteria_Menu', 'Low') -] -cur.executemany('INSERT INTO systems VALUES (?, ?, ?)', systems) - -# Insert access logs -logs = [ - (1, 1, 101, '2023-10-01 10:00:00'), - (2, 1, 102, '2023-10-02 11:00:00'), - (3, 1, 103, '2023-10-03 09:00:00'), - (4, 2, 101, '2023-10-01 08:00:00'), - (5, 3, 103, '2023-09-01 08:00:00'), - (6, 3, 101, '2023-09-15 08:00:00') -] -cur.executemany('INSERT INTO access_logs VALUES (?, ?, ?, ?)', logs) - -conn.commit() -conn.close() -EOF - - python3 /home/user/setup_db.py - rm /home/user/setup_db.py - - chmod -R 777 /home/user \ No newline at end of file diff --git a/components/tmax/upstream/task_005684_3c8594a3/task.toml b/components/tmax/upstream/task_005684_3c8594a3/task.toml deleted file mode 100644 index ad3b002b504b8279b36b6cf9578c3dc82a1ccb18..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_005684_3c8594a3/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_005684_3c8594a3" -description = "compliance officer auditing systems" - -[metadata] -source = "legacy" -base_image = "" -domain = "data_querying" -skill_type = "Graph Processing" -primitive_skills = ["Data model reverse engineering", "Graph analytics (centrality, clustering)", "Query result export and format conversion", "Window functions and analytical aggregation", "Knowledge graph pattern matching"] -task_complexity = "moderate task (several commands across setup, implementation, and verification)" -command_complexity = "bash and code (shell commands and writing/running scripts in Python, Perl, Ruby, etc.)" -scenario = "compliance officer auditing systems" -language = "Python" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/upstream/task_008667_2151f271/environment/Dockerfile b/components/tmax/upstream/task_008667_2151f271/environment/Dockerfile deleted file mode 100644 index 215bdf6b86910b66101b0f0f2932be01779d1502..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_008667_2151f271/environment/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM ubuntu:22.04 - -ENV DEBIAN_FRONTEND=noninteractive - -COPY post_install.sh /tmp/post_install.sh -RUN bash /tmp/post_install.sh && rm /tmp/post_install.sh diff --git a/components/tmax/upstream/task_008667_2151f271/environment/post_install.sh b/components/tmax/upstream/task_008667_2151f271/environment/post_install.sh deleted file mode 100644 index 17258f50b39cd2b8bb08762951d86812ba8fc36f..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_008667_2151f271/environment/post_install.sh +++ /dev/null @@ -1,74 +0,0 @@ -apt-get update && apt-get install -y python3 python3-pip - pip3 install pytest - - useradd -m -s /bin/bash user || true - - mkdir -p /home/user/data - mkdir -p /home/user/output - - cat << 'EOF' > /tmp/setup.py -import sqlite3 -import json -import os - -os.makedirs('/home/user/data', exist_ok=True) -os.makedirs('/home/user/output', exist_ok=True) - -# Create SQLite DB -conn = sqlite3.connect('/home/user/data/financial.db') -c = conn.cursor() -c.execute('CREATE TABLE users (user_id TEXT PRIMARY KEY, name TEXT)') -c.execute('CREATE TABLE accounts (account_id TEXT PRIMARY KEY, user_id TEXT)') - -users = [ - ('u1', 'Alice'), - ('u2', 'Bob'), - ('u3', 'Charlie'), - ('u4', 'Diana'), - ('u5', 'Eve'), - ('u6', 'Frank') -] - -accounts = [ - ('a1', 'u1'), ('a2', 'u1'), # Alice has two accounts - ('a3', 'u2'), - ('a4', 'u3'), - ('a5', 'u4'), - ('a6', 'u5'), - ('a7', 'u6') -] - -c.executemany('INSERT INTO users VALUES (?, ?)', users) -c.executemany('INSERT INTO accounts VALUES (?, ?)', accounts) -conn.commit() -conn.close() - -# Create JSON Lines -transactions = [ - # Cycle 1: Alice (a1) -> Bob (a3) -> Charlie (a4) -> Alice (a2) - {"tx_id": "t1", "from_account": "a1", "to_account": "a3", "amount": 100.0, "currency": "USD"}, - {"tx_id": "t2", "from_account": "a3", "to_account": "a4", "amount": 150.0, "currency": "USD"}, - {"tx_id": "t3", "from_account": "a4", "to_account": "a2", "amount": 200.0, "currency": "USD"}, - - # Cycle 2: Diana (a5) -> Eve (a6) -> Frank (a7) -> Diana (a5) - {"tx_id": "t4", "from_account": "a5", "to_account": "a6", "amount": 500.0, "currency": "USD"}, - {"tx_id": "t5", "from_account": "a6", "to_account": "a7", "amount": 300.0, "currency": "USD"}, - {"tx_id": "t6", "from_account": "a7", "to_account": "a5", "amount": 400.0, "currency": "USD"}, - - # Noise / Dead ends - {"tx_id": "t7", "from_account": "a1", "to_account": "a5", "amount": 50.0, "currency": "USD"}, - {"tx_id": "t8", "from_account": "a3", "to_account": "a6", "amount": 20.0, "currency": "USD"}, - # 2-Cycle (not a 3-cycle) - {"tx_id": "t9", "from_account": "a2", "to_account": "a3", "amount": 10.0, "currency": "USD"}, - {"tx_id": "t10", "from_account": "a3", "to_account": "a2", "amount": 10.0, "currency": "USD"} -] - -with open('/home/user/data/transactions.jsonl', 'w') as f: - for tx in transactions: - f.write(json.dumps(tx) + '\n') -EOF - - python3 /tmp/setup.py - rm /tmp/setup.py - - chmod -R 777 /home/user \ No newline at end of file diff --git a/components/tmax/upstream/task_008667_2151f271/task.toml b/components/tmax/upstream/task_008667_2151f271/task.toml deleted file mode 100644 index c683fe584207aea717358d58793c010d23d7666c..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_008667_2151f271/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_008667_2151f271" -description = "data engineer building ETL pipelines" - -[metadata] -source = "legacy" -base_image = "" -domain = "data_querying" -skill_type = "Result Processing" -primitive_skills = ["NoSQL aggregation pipelines", "Query-to-pipeline chaining", "Schema analysis and relationship mapping", "Graph analytics (centrality, clustering)", "Cross-representation mapping (relational, document, graph)"] -task_complexity = "complex task (many commands spanning multiple phases: dependency installation, code writing, configuration, building, and testing)" -command_complexity = "bash, code, and system services (shell commands, scripts, package installation, service configuration, networking, and containers)" -scenario = "data engineer building ETL pipelines" -language = "any (model's choice)" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/components/tmax/upstream/task_008998_ae4cbe72/environment/Dockerfile b/components/tmax/upstream/task_008998_ae4cbe72/environment/Dockerfile deleted file mode 100644 index 215bdf6b86910b66101b0f0f2932be01779d1502..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_008998_ae4cbe72/environment/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM ubuntu:22.04 - -ENV DEBIAN_FRONTEND=noninteractive - -COPY post_install.sh /tmp/post_install.sh -RUN bash /tmp/post_install.sh && rm /tmp/post_install.sh diff --git a/components/tmax/upstream/task_008998_ae4cbe72/environment/post_install.sh b/components/tmax/upstream/task_008998_ae4cbe72/environment/post_install.sh deleted file mode 100644 index c6b5b640e21c642ddcb450c769974100593975ae..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_008998_ae4cbe72/environment/post_install.sh +++ /dev/null @@ -1,33 +0,0 @@ -apt-get update && apt-get install -y python3 python3-pip - pip3 install pytest - - useradd -m -s /bin/bash user || true - mkdir -p /home/user - - python3 -c ' -import gzip -import os - -log_data = """2023-10-24T10:00:00 INFO System started -2023-10-24T10:01:00 INFO Loading job -[GCODE_START] -G28 -G1 X10 Y10 F1000 -M104 S200 -[GCODE_END] -2023-10-24T10:02:00 INFO Job finished -2023-10-24T10:05:00 CRITICAL Axis X limit switch hit -2023-10-24T10:06:00 INFO Recovering -[GCODE_START] -G90 -G1 Z10 F500 -[GCODE_END] -2023-10-24T10:10:00 CRITICAL Temperature runaway on extruder 1 -2023-10-24T10:11:00 INFO System halted -""" - -with gzip.open("/home/user/robot_dump.log.gz", "wt") as f: - f.write(log_data) -' - - chmod -R 777 /home/user \ No newline at end of file diff --git a/components/tmax/upstream/task_008998_ae4cbe72/task.toml b/components/tmax/upstream/task_008998_ae4cbe72/task.toml deleted file mode 100644 index 0039c86263050c505a10d7014e3d493c344c1fdc..0000000000000000000000000000000000000000 --- a/components/tmax/upstream/task_008998_ae4cbe72/task.toml +++ /dev/null @@ -1,27 +0,0 @@ -schema_version = "1.1" - -[task] -name = "tmax/task_008998_ae4cbe72" -description = "backup administrator archiving data" - -[metadata] -source = "legacy" -base_image = "" -domain = "file_operations" -skill_type = "File I/O" -primitive_skills = ["Standard stream redirection and piping", "Text transformation with sed/awk/vim", "Domain-specific format parsing (GCode, ELF, WAL)", "Format conversion between file types", "Compressed stream processing"] -task_complexity = "short task (a few shell commands focused on the core task)" -command_complexity = "bash and code (shell commands and writing/running scripts in Python, Perl, Ruby, etc.)" -scenario = "backup administrator archiving data" -language = "Python" - -[agent] -timeout_sec = 600.0 - -[verifier] -timeout_sec = 120.0 - -[environment] -cpus = 1 -memory_mb = 2048 -allow_internet = true diff --git a/prepare_source_tree.py b/prepare_source_tree.py deleted file mode 100644 index 2c86df12955777d4ee86b9fefc0344682391509b..0000000000000000000000000000000000000000 --- a/prepare_source_tree.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 - -import argparse -import json -from pathlib import Path -import sys - - -sys.dont_write_bytecode = True -from validate_dataset import validate - - -def prepare(root): - result = validate(root) - missing = result["missing_empty_directories"] - for name in missing: - directory = root / name - if directory.is_symlink() or directory.exists(): - raise ValueError("Directory changed after validation: " + name) - - - directory.mkdir() - after = validate(root) - if after["missing_empty_directories"]: - raise ValueError("Source tree still has missing declared empty directories") - return {"status": "pass", "created_empty_directories": missing, - "missing_empty_directories": [], "network_actions_performed": False} - - -def main(): - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("--root", type=Path, default=Path(__file__).resolve().parent) - args = parser.parse_args() - try: - result = prepare(args.root.resolve()) - except (ValueError, KeyError, IndexError, TypeError, OSError) as error: - print(json.dumps({"status": "fail", "error": str(error)}, ensure_ascii=False), file=sys.stderr) - return 1 - print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/tasks.jsonl b/tasks.jsonl index a0f2731598e814c6feb5824148d5f54477737d78..f3d2dfc9edaeb1982e4b9214505aee67273626bd 100644 --- a/tasks.jsonl +++ b/tasks.jsonl @@ -1,11 +1,13 @@ -{"task_id":"awm-accounting-1-invoice","split":"train","component":"awm","domain":"office-white-collar","behavior":"Business entity lookup, invoice creation, discount and tax calculations, and parent-child line items","skill_family":"business_api","source_dataset":"Snowflake/AgentWorldModel-1K","source_revision":"dde80a0283fe781bdc51656bce57063dc5650213","source_url":"https://huggingface.co/datasets/Snowflake/AgentWorldModel-1K/tree/dde80a0283fe781bdc51656bce57063dc5650213","source_record":"gen_tasks.jsonl#scenario=accounting_1;tasks[1]","reward":"Unchanged original pure-code state verifier, binary 0/1.","instance_policy":"Fixed original request and pristine database copied at reset.","original_instruction":"components/awm/private/tasks/awm-accounting-1-invoice/SOURCE.json","original_instruction_json_pointer":"/task","original_instruction_sha256":"a08b48d978d8a70cfea5c6e871d079622fc99ac8438fb38d6d6816bdfa399c99"} -{"task_id":"incident-3","component":"loui","split":"train","domain":"software-engineering","skill_family":"code_repair","source_dataset":"Louistiti/openenv-python-repair","source_revision":"f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad","source_url":"https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad/v3","original_instruction":"components/loui/tasks/incident-3/instruction.md","original_instruction_sha256":"682c7db0f0911e85174652574349fbe957c1cc235a68d224c569e405d9674452","behavior":"Repair event ordering, sliding windows and reset handling","reward":"Original mean of per-behavior-group pass fractions.","instance_policy":"Original task generator; default seed 0, explicit reset seed supported."} -{"task_id":"task_008667_2151f271","component":"tmax","domain":"finance-economics","behavior":"Cross-account ownership mapping, transaction cycle detection, and deduplication","split":"train","source_dataset":"TMaxxx/TMax-15K-Harbor","source_revision":"48a77eb0b017606c643ed905f96db41672914798","source_url":"https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798","skill_family":"database_workflows","reward":"Unchanged original binary success reward; 0 or 1.","instance_policy":"One fixed original train instance per task_id; no random question substitution.","original_instruction":"components/tmax/tasks/task_008667_2151f271/source/instruction.md","original_instruction_sha256":"50d1d10121dfa3b565842fd10f2589ceb91b4459126787af7793cec9cc0d06b1"} -{"task_id":"construct-mc-costas-array-l3-s0","component":"math","domain":"mathematics-or-formal-reasoning","behavior":"Implementing constructive constraints and complete validation","split":"train","source_dataset":"amphora/MathConstructOptimize-Envs-harbor","source_revision":"66cd5c87d51113c76faaef1b05397f1a6282a0f7","source_url":"https://huggingface.co/datasets/amphora/MathConstructOptimize-Envs-harbor/tree/66cd5c87d51113c76faaef1b05397f1a6282a0f7","skill_family":"constraint_construction","reward":"Unchanged original binary success reward; 0 or 1.","instance_policy":"One fixed original train instance per task_id; no random question substitution.","original_instruction":"components/math/upstream/construct-mc-costas-array-l3-s0/instruction.md","original_instruction_sha256":"88e4a26e71d8483fbc89627210e4ed07f6dfef0fb16ce3e6d31e84a04bd050f9"} -{"task_id":"task_000260_7b7cc286","component":"tmax","domain":"media-content-production","behavior":"Frame-by-frame video analysis and structured output","split":"train","source_dataset":"TMaxxx/TMax-15K-Harbor","source_revision":"48a77eb0b017606c643ed905f96db41672914798","source_url":"https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798","skill_family":"media_analysis","reward":"Unchanged original binary success reward; 0 or 1.","instance_policy":"One fixed original train instance per task_id; no random question substitution.","original_instruction":"components/tmax/tasks/task_000260_7b7cc286/source/instruction.md","original_instruction_sha256":"79c9fd4e4d41524db109d90b0415a4f0a2b9d24bf690fa8d7340ce3cb5ce0975"} -{"task_id":"task_000663_dff2c340","component":"tmax","domain":"office-white-collar","behavior":"Backup restoration dependencies, time boundaries, and resource aggregation","split":"train","source_dataset":"TMaxxx/TMax-15K-Harbor","source_revision":"48a77eb0b017606c643ed905f96db41672914798","source_url":"https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798","skill_family":"database_workflows","reward":"Unchanged original binary success reward; 0 or 1.","instance_policy":"One fixed original train instance per task_id; no random question substitution.","original_instruction":"components/tmax/tasks/task_000663_dff2c340/source/instruction.md","original_instruction_sha256":"feae25374139b4b1d8ec9759d553c591841d9330a071217f46a2e464bd32bbd7"} -{"task_id":"pdbthink-s09-7ba4aa076b6bb5633953","component":"pdbthink","domain":"natural-science","behavior":"Coordinate extraction and oriented geometry classification without tools","split":"train","source_dataset":"open-athena/pdbthink-coordinate-tasks","source_revision":"3734406cb97b1702844319f9a5d860cbbf8fe660","source_url":"https://huggingface.co/datasets/open-athena/pdbthink-coordinate-tasks/tree/3734406cb97b1702844319f9a5d860cbbf8fe660","skill_family":"tool_free_geometry","reward":"Unchanged original binary success reward; 0 or 1.","instance_policy":"One fixed original train instance per task_id; no random question substitution.","original_instruction":"upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md","computational_tools":false,"original_instruction_sha256":"21dc586748f23a8630118831399e1c40d62443444d454bf6f5e7f60ba334b06f"} -{"task_id":"expression-3","component":"loui","split":"train","domain":"software-engineering","skill_family":"code_repair","source_dataset":"Louistiti/openenv-python-repair","source_revision":"f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad","source_url":"https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad/v3","original_instruction":"components/loui/tasks/expression-3/instruction.md","original_instruction_sha256":"09ef2d8fc856ca3dc5662c279df705e9accc827f4472dc34758ffe769d116128","behavior":"Repair tokenization, operator precedence and unary expressions","reward":"Original mean of per-behavior-group pass fractions.","instance_policy":"Original task generator; default seed 0, explicit reset seed supported."} -{"task_id":"task_000056_f726766b","component":"tmax","domain":"industrial-physical-systems","behavior":"Waveform system identification, numerical fitting, and result verification","split":"train","source_dataset":"TMaxxx/TMax-15K-Harbor","source_revision":"48a77eb0b017606c643ed905f96db41672914798","source_url":"https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798","skill_family":"system_identification","reward":"Unchanged original binary success reward; 0 or 1.","instance_policy":"One fixed original train instance per task_id; no random question substitution.","original_instruction":"components/tmax/tasks/task_000056_f726766b/source/instruction.md","original_instruction_sha256":"714f780883970365cfffe408e2c76e75f499005f87551fc84b55d79368e77197"} -{"task_id":"task_005684_3c8594a3","component":"tmax","domain":"office-white-collar","behavior":"Communication graph computation, database joins, and sensitive access checks","split":"train","source_dataset":"TMaxxx/TMax-15K-Harbor","source_revision":"48a77eb0b017606c643ed905f96db41672914798","source_url":"https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798","skill_family":"database_workflows","reward":"Unchanged original binary success reward; 0 or 1.","instance_policy":"One fixed original train instance per task_id; no random question substitution.","original_instruction":"components/tmax/tasks/task_005684_3c8594a3/source/instruction.md","original_instruction_sha256":"f4eee4e0643fcfb7399df10e1947ec9dbda28c74bacf307167f443506268f583"} -{"task_id":"task_008998_ae4cbe72","component":"tmax","domain":"industrial-physical-systems","behavior":"State parsing from compressed manufacturing logs and consistent multi-file output","split":"train","source_dataset":"TMaxxx/TMax-15K-Harbor","source_revision":"48a77eb0b017606c643ed905f96db41672914798","source_url":"https://huggingface.co/datasets/TMaxxx/TMax-15K-Harbor/tree/48a77eb0b017606c643ed905f96db41672914798","skill_family":"stream_parsing","reward":"Unchanged original binary success reward; 0 or 1.","instance_policy":"One fixed original train instance per task_id; no random question substitution.","original_instruction":"components/tmax/tasks/task_008998_ae4cbe72/source/instruction.md","original_instruction_sha256":"f81f86b07681931baabdba313cc4e988c01bff7a1f1d83349dfa939cdaa20669"} +{"component":"dnakhla","task_id":"off3_ar_recon-L1","domain":"office-white-collar","split":"train","skill_family":"accounts_receivable","behavior":"Reconcile invoices, credits and payments in files.","source_dataset":"dnakhla/terminal-desk","source_revision":"08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_url":"https://huggingface.co/datasets/dnakhla/terminal-desk/tree/08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_record":"components/dnakhla/SOURCE_MANIFEST.json","instance_policy":"Original random generation at reset; client seed does not select the instance.","reward":"Original artifact grader: all required checks must pass.","original_task_definition":"components/dnakhla/upstream/terminal_desk/families/office3.py","original_task_definition_sha256":"1926c4a6e600cabb4cd35fab9528b4e4d55ef4adc1623b7229ac356ef28c987b"} +{"component":"metaharness","task_id":"office_reconciliation-d2","domain":"office-white-collar","split":"train","skill_family":"contact_reconciliation","behavior":"Merge contact records using the original precedence rules.","source_dataset":"ruv/metaharness-arena-tasks","source_revision":"c359366240115bfb24d2edae807c8e52ed5b39f0","source_url":"https://huggingface.co/datasets/ruv/metaharness-arena-tasks/tree/c359366240115bfb24d2edae807c8e52ed5b39f0","source_record":"components/metaharness/SOURCE.json","instance_policy":"Original explicit seed or original random generation when seed is absent.","reward":"Original component scoring, capped below full credit for incomplete answers.","original_task_definition":"components/metaharness/upstream/arena_env/tasks.py","original_task_definition_sha256":"94e29b6d884302f57e9440591cca5c07350cc4eb47d9e4e9f7a27689c519b781","original_public_instances":"components/metaharness/upstream/tasks.selected.jsonl"} +{"component":"audit","task_id":"auth-05","domain":"cybersecurity","split":"train","skill_family":"authentication_audit","behavior":"Find the qualifying successful login from limited log queries.","source_dataset":"NoeFlandre/audit-trail","source_revision":"f821596324c2d3f29130ebc7054a22c6bd5559d4","source_url":"https://huggingface.co/datasets/NoeFlandre/audit-trail/tree/f821596324c2d3f29130ebc7054a22c6bd5559d4","source_record":"components/audit/SOURCE.json","instance_policy":"Original fixed task seed and log; client seed does not alter the instance.","reward":"Original normalized exact answer: 0 or 1.","original_instruction":"components/audit/tasks/auth-05/instruction.md","original_instruction_sha256":"e58b70774d5f729ae49c59cb82c019972e889b7353dabe1d6b9eefc085993119"} +{"component":"dnakhla","task_id":"off3_meeting_slot-L2","domain":"office-white-collar","split":"train","skill_family":"meeting_scheduling","behavior":"Find a valid meeting slot using time zones and availability.","source_dataset":"dnakhla/terminal-desk","source_revision":"08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_url":"https://huggingface.co/datasets/dnakhla/terminal-desk/tree/08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_record":"components/dnakhla/SOURCE_MANIFEST.json","instance_policy":"Original random generation at reset; client seed does not select the instance.","reward":"Original artifact grader: all required checks must pass.","original_task_definition":"components/dnakhla/upstream/terminal_desk/families/office3.py","original_task_definition_sha256":"1926c4a6e600cabb4cd35fab9528b4e4d55ef4adc1623b7229ac356ef28c987b"} +{"component":"loui","task_id":"expression-3","domain":"software-engineering","split":"train","skill_family":"expression_repair","behavior":"Repair tokenization, precedence and unary expression handling.","source_dataset":"Louistiti/openenv-python-repair","source_revision":"f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad","source_url":"https://huggingface.co/datasets/Louistiti/openenv-python-repair/tree/f82d0dabb0da9b1b913ef95f89f54c7a8f39d0ad","source_record":"components/loui/SOURCE.json","instance_policy":"Original generator with default seed 0 and original explicit seed behavior.","reward":"Original mean of pass fractions across behavior groups.","original_instruction":"components/loui/tasks/expression-3/instruction.md","original_instruction_sha256":"09ef2d8fc856ca3dc5662c279df705e9accc827f4472dc34758ffe769d116128"} +{"component":"metaharness","task_id":"media_timeline-d2","domain":"media-content-production","split":"train","skill_family":"media_timeline","behavior":"Construct a timeline from edit instructions.","source_dataset":"ruv/metaharness-arena-tasks","source_revision":"c359366240115bfb24d2edae807c8e52ed5b39f0","source_url":"https://huggingface.co/datasets/ruv/metaharness-arena-tasks/tree/c359366240115bfb24d2edae807c8e52ed5b39f0","source_record":"components/metaharness/SOURCE.json","instance_policy":"Original explicit seed or original random generation when seed is absent.","reward":"Original component scoring, capped below full credit for incomplete answers.","original_task_definition":"components/metaharness/upstream/arena_env/tasks.py","original_task_definition_sha256":"94e29b6d884302f57e9440591cca5c07350cc4eb47d9e4e9f7a27689c519b781","original_public_instances":"components/metaharness/upstream/tasks.selected.jsonl"} +{"component":"dnakhla","task_id":"off3_ar_recon-L2","domain":"office-white-collar","split":"train","skill_family":"accounts_receivable","behavior":"Apply reconciliation rules with aliases and corrections.","source_dataset":"dnakhla/terminal-desk","source_revision":"08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_url":"https://huggingface.co/datasets/dnakhla/terminal-desk/tree/08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_record":"components/dnakhla/SOURCE_MANIFEST.json","instance_policy":"Original random generation at reset; client seed does not select the instance.","reward":"Original artifact grader: all required checks must pass.","original_task_definition":"components/dnakhla/upstream/terminal_desk/families/office3.py","original_task_definition_sha256":"1926c4a6e600cabb4cd35fab9528b4e4d55ef4adc1623b7229ac356ef28c987b"} +{"component":"metaharness","task_id":"security_triage-d2","domain":"cybersecurity","split":"train","skill_family":"security_triage","behavior":"Apply the original incident triage rules.","source_dataset":"ruv/metaharness-arena-tasks","source_revision":"c359366240115bfb24d2edae807c8e52ed5b39f0","source_url":"https://huggingface.co/datasets/ruv/metaharness-arena-tasks/tree/c359366240115bfb24d2edae807c8e52ed5b39f0","source_record":"components/metaharness/SOURCE.json","instance_policy":"Original explicit seed or original random generation when seed is absent.","reward":"Original component scoring, capped below full credit for incomplete answers.","original_task_definition":"components/metaharness/upstream/arena_env/tasks.py","original_task_definition_sha256":"94e29b6d884302f57e9440591cca5c07350cc4eb47d9e4e9f7a27689c519b781","original_public_instances":"components/metaharness/upstream/tasks.selected.jsonl"} +{"component":"audit","task_id":"ledger-01","domain":"finance-economics","split":"train","skill_family":"ledger_audit","behavior":"Identify a duplicate debit while excluding reversed transactions.","source_dataset":"NoeFlandre/audit-trail","source_revision":"f821596324c2d3f29130ebc7054a22c6bd5559d4","source_url":"https://huggingface.co/datasets/NoeFlandre/audit-trail/tree/f821596324c2d3f29130ebc7054a22c6bd5559d4","source_record":"components/audit/SOURCE.json","instance_policy":"Original fixed task seed and log; client seed does not alter the instance.","reward":"Original normalized exact answer: 0 or 1.","original_instruction":"components/audit/tasks/ledger-01/instruction.md","original_instruction_sha256":"141f54a8f1dc40c48f5a691cb2cdc9b15e8f3c029c7c3d500b8f8a054e82152b"} +{"component":"dnakhla","task_id":"off3_pdf_xlsx_diff-L1","domain":"office-white-collar","split":"train","skill_family":"cross_format_comparison","behavior":"Compare records from PDF and spreadsheet inputs.","source_dataset":"dnakhla/terminal-desk","source_revision":"08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_url":"https://huggingface.co/datasets/dnakhla/terminal-desk/tree/08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_record":"components/dnakhla/SOURCE_MANIFEST.json","instance_policy":"Original random generation at reset; client seed does not select the instance.","reward":"Original artifact grader: all required checks must pass.","original_task_definition":"components/dnakhla/upstream/terminal_desk/families/office3.py","original_task_definition_sha256":"1926c4a6e600cabb4cd35fab9528b4e4d55ef4adc1623b7229ac356ef28c987b"} +{"component":"metaharness","task_id":"math_route-d2","domain":"mathematics-or-formal-reasoning","split":"train","skill_family":"constrained_route","behavior":"Find a route under the original graph constraints.","source_dataset":"ruv/metaharness-arena-tasks","source_revision":"c359366240115bfb24d2edae807c8e52ed5b39f0","source_url":"https://huggingface.co/datasets/ruv/metaharness-arena-tasks/tree/c359366240115bfb24d2edae807c8e52ed5b39f0","source_record":"components/metaharness/SOURCE.json","instance_policy":"Original explicit seed or original random generation when seed is absent.","reward":"Original component scoring, capped below full credit for incomplete answers.","original_task_definition":"components/metaharness/upstream/arena_env/tasks.py","original_task_definition_sha256":"94e29b6d884302f57e9440591cca5c07350cc4eb47d9e4e9f7a27689c519b781","original_public_instances":"components/metaharness/upstream/tasks.selected.jsonl"} +{"component":"dnakhla","task_id":"sci3_kinetics_fit-L1","domain":"natural-science","split":"train","skill_family":"kinetics_fitting","behavior":"Filter measurements and fit the original kinetics model.","source_dataset":"dnakhla/terminal-desk","source_revision":"08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_url":"https://huggingface.co/datasets/dnakhla/terminal-desk/tree/08fab0beb50b665b42f0ac73840f03140f4ad1c9","source_record":"components/dnakhla/SOURCE_MANIFEST.json","instance_policy":"Original random generation at reset; client seed does not select the instance.","reward":"Original artifact grader: all required checks must pass.","original_task_definition":"components/dnakhla/upstream/terminal_desk/families/science3.py","original_task_definition_sha256":"59477a1f9d38dbe5607f6432b4f8538342eec93faeed09bb6c9cb1402980c9a1"} +{"component":"metaharness","task_id":"science_calibration-d2","domain":"natural-science","split":"train","skill_family":"science_calibration","behavior":"Calculate calibrated measurements from input files.","source_dataset":"ruv/metaharness-arena-tasks","source_revision":"c359366240115bfb24d2edae807c8e52ed5b39f0","source_url":"https://huggingface.co/datasets/ruv/metaharness-arena-tasks/tree/c359366240115bfb24d2edae807c8e52ed5b39f0","source_record":"components/metaharness/SOURCE.json","instance_policy":"Original explicit seed or original random generation when seed is absent.","reward":"Original component scoring, capped below full credit for incomplete answers.","original_task_definition":"components/metaharness/upstream/arena_env/tasks.py","original_task_definition_sha256":"94e29b6d884302f57e9440591cca5c07350cc4eb47d9e4e9f7a27689c519b781","original_public_instances":"components/metaharness/upstream/tasks.selected.jsonl"} diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile deleted file mode 100644 index 7ee01e59572bf261b5295558556ca028a49c69cb..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/environment/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM python:3.12-slim-bookworm@sha256:392307d22300de8b5986851a12d9176dfc0fc073e65bf6523ebd7dcbeb23564e -WORKDIR /app -RUN mkdir -p /logs/verifier diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md deleted file mode 100644 index d4483093ee4de2f83e9d02d41514be79a4b34fb6..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/instruction.md +++ /dev/null @@ -1,112 +0,0 @@ -You will be given one or more molecular structures and a question about them. -Answer using only the information supplied in the prompt. Do not use tools or -external resources. - -Protein residues are identified as :. For example, A:V22 is valine 22 in chain A. When asked for a -residue, use exactly this format. When asked for a list, return a comma-separated -list. Do not include additional residues. - -Place the machine-readable answer after FINAL: using the format requested by -the question. You may reason before the final answer, but only the FINAL field -will be scored. - -You are given one molecular structure. - -The structure is given below in PDB format. Only coordinate records are included; there are no header, annotation, connectivity or secondary-structure records, hydrogens have been removed, and B-factors are zero. -The coordinates have been rigidly rotated and translated; distances and angles are unchanged. - -Structure: -ATOM 1 N GLU B 482 -11.015 5.737 -3.681 1.00 0.00 N -ATOM 2 CA GLU B 482 -10.112 6.819 -3.302 1.00 0.00 C -ATOM 3 C GLU B 482 -8.676 6.522 -3.712 1.00 0.00 C -ATOM 4 O GLU B 482 -8.415 5.604 -4.492 1.00 0.00 O -ATOM 5 CB GLU B 482 -10.172 7.065 -1.794 1.00 0.00 C -ATOM 6 CG GLU B 482 -11.534 7.482 -1.277 1.00 0.00 C -ATOM 7 CD GLU B 482 -11.484 7.942 0.167 1.00 0.00 C -ATOM 8 OE1 GLU B 482 -10.473 7.657 0.848 1.00 0.00 O -ATOM 9 OE2 GLU B 482 -12.453 8.593 0.618 1.00 0.00 O -ATOM 10 N GLU B 483 -7.747 7.311 -3.181 1.00 0.00 N -ATOM 11 CA GLU B 483 -6.329 7.040 -3.361 1.00 0.00 C -ATOM 12 C GLU B 483 -5.775 6.378 -2.107 1.00 0.00 C -ATOM 13 O GLU B 483 -5.752 6.971 -1.022 1.00 0.00 O -ATOM 14 CB GLU B 483 -5.555 8.319 -3.676 1.00 0.00 C -ATOM 15 CG GLU B 483 -4.112 8.068 -4.079 1.00 0.00 C -ATOM 16 CD GLU B 483 -3.996 7.239 -5.347 1.00 0.00 C -ATOM 17 OE1 GLU B 483 -3.520 6.083 -5.264 1.00 0.00 O -ATOM 18 OE2 GLU B 483 -4.379 7.745 -6.426 1.00 0.00 O -ATOM 19 N PHE B 484 -5.343 5.135 -2.260 1.00 0.00 N -ATOM 20 CA PHE B 484 -4.799 4.376 -1.148 1.00 0.00 C -ATOM 21 C PHE B 484 -3.332 4.072 -1.363 1.00 0.00 C -ATOM 22 O PHE B 484 -2.960 3.445 -2.349 1.00 0.00 O -ATOM 23 CB PHE B 484 -5.578 3.077 -0.953 1.00 0.00 C -ATOM 24 CG PHE B 484 -7.033 3.293 -0.684 1.00 0.00 C -ATOM 25 CD1 PHE B 484 -7.456 3.741 0.561 1.00 0.00 C -ATOM 26 CD2 PHE B 484 -7.978 3.084 -1.677 1.00 0.00 C -ATOM 27 CE1 PHE B 484 -8.801 3.956 0.817 1.00 0.00 C -ATOM 28 CE2 PHE B 484 -9.328 3.300 -1.429 1.00 0.00 C -ATOM 29 CZ PHE B 484 -9.739 3.734 -0.180 1.00 0.00 C -ATOM 30 N GLU B 485 -2.505 4.527 -0.434 1.00 0.00 N -ATOM 31 CA GLU B 485 -1.085 4.249 -0.489 1.00 0.00 C -ATOM 32 C GLU B 485 -0.786 3.106 0.466 1.00 0.00 C -ATOM 33 O GLU B 485 -0.545 3.326 1.654 1.00 0.00 O -ATOM 34 CB GLU B 485 -0.269 5.489 -0.132 1.00 0.00 C -ATOM 35 CG GLU B 485 -0.581 6.703 -0.989 1.00 0.00 C -ATOM 36 CD GLU B 485 0.455 7.799 -0.845 1.00 0.00 C -ATOM 37 OE1 GLU B 485 1.548 7.515 -0.312 1.00 0.00 O -ATOM 38 OE2 GLU B 485 0.174 8.942 -1.266 1.00 0.00 O -ATOM 39 N LEU B 486 -0.819 1.882 -0.046 1.00 0.00 N -ATOM 40 CA LEU B 486 -0.627 0.725 0.817 1.00 0.00 C -ATOM 41 C LEU B 486 0.840 0.573 1.188 1.00 0.00 C -ATOM 42 O LEU B 486 1.734 0.793 0.363 1.00 0.00 O -ATOM 43 CB LEU B 486 -1.147 -0.549 0.150 1.00 0.00 C -ATOM 44 CG LEU B 486 -2.592 -0.494 -0.351 1.00 0.00 C -ATOM 45 CD1 LEU B 486 -3.034 -1.846 -0.871 1.00 0.00 C -ATOM 46 CD2 LEU B 486 -3.546 -0.009 0.757 1.00 0.00 C -ATOM 47 N LEU B 487 1.076 0.201 2.441 1.00 0.00 N -ATOM 48 CA LEU B 487 2.417 0.020 2.964 1.00 0.00 C -ATOM 49 C LEU B 487 2.593 -1.453 3.285 1.00 0.00 C -ATOM 50 O LEU B 487 2.361 -1.898 4.408 1.00 0.00 O -ATOM 51 CB LEU B 487 2.645 0.885 4.197 1.00 0.00 C -ATOM 52 CG LEU B 487 2.381 2.376 3.978 1.00 0.00 C -ATOM 53 CD1 LEU B 487 2.501 3.145 5.286 1.00 0.00 C -ATOM 54 CD2 LEU B 487 3.332 2.935 2.934 1.00 0.00 C -ATOM 55 N ILE B 488 2.974 -2.196 2.258 1.00 0.00 N -ATOM 56 CA ILE B 488 3.053 -3.641 2.303 1.00 0.00 C -ATOM 57 C ILE B 488 4.380 -4.028 1.683 1.00 0.00 C -ATOM 58 O ILE B 488 4.646 -3.679 0.536 1.00 0.00 O -ATOM 59 CB ILE B 488 1.889 -4.293 1.531 1.00 0.00 C -ATOM 60 CG1 ILE B 488 0.551 -3.936 2.190 1.00 0.00 C -ATOM 61 CG2 ILE B 488 2.072 -5.804 1.441 1.00 0.00 C -ATOM 62 CD1 ILE B 488 -0.653 -4.277 1.325 1.00 0.00 C -ATOM 63 N SEP B 489 5.227 -4.719 2.434 1.00 0.00 N -ATOM 64 CA SEP B 489 6.527 -5.113 1.887 1.00 0.00 C -ATOM 65 CB SEP B 489 7.503 -5.398 3.017 1.00 0.00 C -ATOM 66 OG SEP B 489 6.940 -6.405 3.816 1.00 0.00 O -ATOM 67 C SEP B 489 6.415 -6.360 1.009 1.00 0.00 C -ATOM 68 O SEP B 489 5.361 -6.991 0.942 1.00 0.00 O -ATOM 69 P SEP B 489 8.038 -7.289 4.557 1.00 0.00 P -ATOM 70 O1P SEP B 489 9.234 -7.617 3.531 1.00 0.00 O -ATOM 71 O2P SEP B 489 7.337 -8.665 4.988 1.00 0.00 O -ATOM 72 O3P SEP B 489 8.643 -6.479 5.796 1.00 0.00 O -ATOM 73 N ASN B 490 7.513 -6.718 0.350 1.00 0.00 N -ATOM 74 CA ASN B 490 7.547 -7.901 -0.513 1.00 0.00 C -ATOM 75 C ASN B 490 7.997 -9.176 0.194 1.00 0.00 C -ATOM 76 O ASN B 490 8.071 -9.231 1.420 1.00 0.00 O -ATOM 77 CB ASN B 490 8.457 -7.654 -1.715 1.00 0.00 C -ATOM 78 CG ASN B 490 7.733 -6.991 -2.861 1.00 0.00 C -ATOM 79 OD1 ASN B 490 6.726 -6.311 -2.662 1.00 0.00 O -ATOM 80 ND2 ASN B 490 8.235 -7.191 -4.074 1.00 0.00 N -ATOM 81 N SER B 491 8.291 -10.201 -0.597 1.00 0.00 N -ATOM 82 CA SER B 491 8.723 -11.489 -0.068 1.00 0.00 C -ATOM 83 C SER B 491 10.244 -11.587 -0.037 1.00 0.00 C -ATOM 84 O SER B 491 10.941 -10.868 -0.755 1.00 0.00 O -ATOM 85 CB SER B 491 8.136 -12.633 -0.900 1.00 0.00 C -ATOM 86 OG SER B 491 8.574 -13.894 -0.426 1.00 0.00 O -TER 87 SER B 491 -END - -Question: Classify the chi1 side-chain rotamer of residue B:F484. Chi1 is the N-CA-CB-CG dihedral angle, normalised to [-180, 180) degrees. Answer g+ for 0 <= chi1 < 120, t for chi1 >= 120 or chi1 < -120, and g- for -120 <= chi1 < 0. - -Answer with exactly one of the listed categories. -Example: FINAL: g+ diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/prompt.json b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/prompt.json deleted file mode 100644 index a3a6b04bf4dce64e28483c4094ab7b2e4021ee19..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/prompt.json +++ /dev/null @@ -1 +0,0 @@ -{"system_prompt": "You will be given one or more molecular structures and a question about them.\nAnswer using only the information supplied in the prompt. Do not use tools or\nexternal resources.\n\nProtein residues are identified as :. For example, A:V22 is valine 22 in chain A. When asked for a\nresidue, use exactly this format. When asked for a list, return a comma-separated\nlist. Do not include additional residues.\n\nPlace the machine-readable answer after FINAL: using the format requested by\nthe question. You may reason before the final answer, but only the FINAL field\nwill be scored.", "user_prompt": "You are given one molecular structure.\n\nThe structure is given below in PDB format. Only coordinate records are included; there are no header, annotation, connectivity or secondary-structure records, hydrogens have been removed, and B-factors are zero.\nThe coordinates have been rigidly rotated and translated; distances and angles are unchanged.\n\nStructure:\nATOM 1 N GLU B 482 -11.015 5.737 -3.681 1.00 0.00 N\nATOM 2 CA GLU B 482 -10.112 6.819 -3.302 1.00 0.00 C\nATOM 3 C GLU B 482 -8.676 6.522 -3.712 1.00 0.00 C\nATOM 4 O GLU B 482 -8.415 5.604 -4.492 1.00 0.00 O\nATOM 5 CB GLU B 482 -10.172 7.065 -1.794 1.00 0.00 C\nATOM 6 CG GLU B 482 -11.534 7.482 -1.277 1.00 0.00 C\nATOM 7 CD GLU B 482 -11.484 7.942 0.167 1.00 0.00 C\nATOM 8 OE1 GLU B 482 -10.473 7.657 0.848 1.00 0.00 O\nATOM 9 OE2 GLU B 482 -12.453 8.593 0.618 1.00 0.00 O\nATOM 10 N GLU B 483 -7.747 7.311 -3.181 1.00 0.00 N\nATOM 11 CA GLU B 483 -6.329 7.040 -3.361 1.00 0.00 C\nATOM 12 C GLU B 483 -5.775 6.378 -2.107 1.00 0.00 C\nATOM 13 O GLU B 483 -5.752 6.971 -1.022 1.00 0.00 O\nATOM 14 CB GLU B 483 -5.555 8.319 -3.676 1.00 0.00 C\nATOM 15 CG GLU B 483 -4.112 8.068 -4.079 1.00 0.00 C\nATOM 16 CD GLU B 483 -3.996 7.239 -5.347 1.00 0.00 C\nATOM 17 OE1 GLU B 483 -3.520 6.083 -5.264 1.00 0.00 O\nATOM 18 OE2 GLU B 483 -4.379 7.745 -6.426 1.00 0.00 O\nATOM 19 N PHE B 484 -5.343 5.135 -2.260 1.00 0.00 N\nATOM 20 CA PHE B 484 -4.799 4.376 -1.148 1.00 0.00 C\nATOM 21 C PHE B 484 -3.332 4.072 -1.363 1.00 0.00 C\nATOM 22 O PHE B 484 -2.960 3.445 -2.349 1.00 0.00 O\nATOM 23 CB PHE B 484 -5.578 3.077 -0.953 1.00 0.00 C\nATOM 24 CG PHE B 484 -7.033 3.293 -0.684 1.00 0.00 C\nATOM 25 CD1 PHE B 484 -7.456 3.741 0.561 1.00 0.00 C\nATOM 26 CD2 PHE B 484 -7.978 3.084 -1.677 1.00 0.00 C\nATOM 27 CE1 PHE B 484 -8.801 3.956 0.817 1.00 0.00 C\nATOM 28 CE2 PHE B 484 -9.328 3.300 -1.429 1.00 0.00 C\nATOM 29 CZ PHE B 484 -9.739 3.734 -0.180 1.00 0.00 C\nATOM 30 N GLU B 485 -2.505 4.527 -0.434 1.00 0.00 N\nATOM 31 CA GLU B 485 -1.085 4.249 -0.489 1.00 0.00 C\nATOM 32 C GLU B 485 -0.786 3.106 0.466 1.00 0.00 C\nATOM 33 O GLU B 485 -0.545 3.326 1.654 1.00 0.00 O\nATOM 34 CB GLU B 485 -0.269 5.489 -0.132 1.00 0.00 C\nATOM 35 CG GLU B 485 -0.581 6.703 -0.989 1.00 0.00 C\nATOM 36 CD GLU B 485 0.455 7.799 -0.845 1.00 0.00 C\nATOM 37 OE1 GLU B 485 1.548 7.515 -0.312 1.00 0.00 O\nATOM 38 OE2 GLU B 485 0.174 8.942 -1.266 1.00 0.00 O\nATOM 39 N LEU B 486 -0.819 1.882 -0.046 1.00 0.00 N\nATOM 40 CA LEU B 486 -0.627 0.725 0.817 1.00 0.00 C\nATOM 41 C LEU B 486 0.840 0.573 1.188 1.00 0.00 C\nATOM 42 O LEU B 486 1.734 0.793 0.363 1.00 0.00 O\nATOM 43 CB LEU B 486 -1.147 -0.549 0.150 1.00 0.00 C\nATOM 44 CG LEU B 486 -2.592 -0.494 -0.351 1.00 0.00 C\nATOM 45 CD1 LEU B 486 -3.034 -1.846 -0.871 1.00 0.00 C\nATOM 46 CD2 LEU B 486 -3.546 -0.009 0.757 1.00 0.00 C\nATOM 47 N LEU B 487 1.076 0.201 2.441 1.00 0.00 N\nATOM 48 CA LEU B 487 2.417 0.020 2.964 1.00 0.00 C\nATOM 49 C LEU B 487 2.593 -1.453 3.285 1.00 0.00 C\nATOM 50 O LEU B 487 2.361 -1.898 4.408 1.00 0.00 O\nATOM 51 CB LEU B 487 2.645 0.885 4.197 1.00 0.00 C\nATOM 52 CG LEU B 487 2.381 2.376 3.978 1.00 0.00 C\nATOM 53 CD1 LEU B 487 2.501 3.145 5.286 1.00 0.00 C\nATOM 54 CD2 LEU B 487 3.332 2.935 2.934 1.00 0.00 C\nATOM 55 N ILE B 488 2.974 -2.196 2.258 1.00 0.00 N\nATOM 56 CA ILE B 488 3.053 -3.641 2.303 1.00 0.00 C\nATOM 57 C ILE B 488 4.380 -4.028 1.683 1.00 0.00 C\nATOM 58 O ILE B 488 4.646 -3.679 0.536 1.00 0.00 O\nATOM 59 CB ILE B 488 1.889 -4.293 1.531 1.00 0.00 C\nATOM 60 CG1 ILE B 488 0.551 -3.936 2.190 1.00 0.00 C\nATOM 61 CG2 ILE B 488 2.072 -5.804 1.441 1.00 0.00 C\nATOM 62 CD1 ILE B 488 -0.653 -4.277 1.325 1.00 0.00 C\nATOM 63 N SEP B 489 5.227 -4.719 2.434 1.00 0.00 N\nATOM 64 CA SEP B 489 6.527 -5.113 1.887 1.00 0.00 C\nATOM 65 CB SEP B 489 7.503 -5.398 3.017 1.00 0.00 C\nATOM 66 OG SEP B 489 6.940 -6.405 3.816 1.00 0.00 O\nATOM 67 C SEP B 489 6.415 -6.360 1.009 1.00 0.00 C\nATOM 68 O SEP B 489 5.361 -6.991 0.942 1.00 0.00 O\nATOM 69 P SEP B 489 8.038 -7.289 4.557 1.00 0.00 P\nATOM 70 O1P SEP B 489 9.234 -7.617 3.531 1.00 0.00 O\nATOM 71 O2P SEP B 489 7.337 -8.665 4.988 1.00 0.00 O\nATOM 72 O3P SEP B 489 8.643 -6.479 5.796 1.00 0.00 O\nATOM 73 N ASN B 490 7.513 -6.718 0.350 1.00 0.00 N\nATOM 74 CA ASN B 490 7.547 -7.901 -0.513 1.00 0.00 C\nATOM 75 C ASN B 490 7.997 -9.176 0.194 1.00 0.00 C\nATOM 76 O ASN B 490 8.071 -9.231 1.420 1.00 0.00 O\nATOM 77 CB ASN B 490 8.457 -7.654 -1.715 1.00 0.00 C\nATOM 78 CG ASN B 490 7.733 -6.991 -2.861 1.00 0.00 C\nATOM 79 OD1 ASN B 490 6.726 -6.311 -2.662 1.00 0.00 O\nATOM 80 ND2 ASN B 490 8.235 -7.191 -4.074 1.00 0.00 N\nATOM 81 N SER B 491 8.291 -10.201 -0.597 1.00 0.00 N\nATOM 82 CA SER B 491 8.723 -11.489 -0.068 1.00 0.00 C\nATOM 83 C SER B 491 10.244 -11.587 -0.037 1.00 0.00 C\nATOM 84 O SER B 491 10.941 -10.868 -0.755 1.00 0.00 O\nATOM 85 CB SER B 491 8.136 -12.633 -0.900 1.00 0.00 C\nATOM 86 OG SER B 491 8.574 -13.894 -0.426 1.00 0.00 O\nTER 87 SER B 491\nEND\n\nQuestion: Classify the chi1 side-chain rotamer of residue B:F484. Chi1 is the N-CA-CB-CG dihedral angle, normalised to [-180, 180) degrees. Answer g+ for 0 <= chi1 < 120, t for chi1 >= 120 or chi1 < -120, and g- for -120 <= chi1 < 0.\n\nAnswer with exactly one of the listed categories.\nExample: FINAL: g+\n"} \ No newline at end of file diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/task.toml b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/task.toml deleted file mode 100644 index 111084f704c60819f6b3bd249e65c400b80425c9..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/task.toml +++ /dev/null @@ -1,22 +0,0 @@ -schema_version = "1.4" -[task] -name = "open-athena/pdbthink-s09-7ba4aa076b6bb5633953" -version = "1.3.0" -description = "Tool-free protein coordinate interpretation: S09" -authors = [{name = "Open Athena"}] -keywords = ["protein", "coordinate-reasoning", "no-tools", "S09"] -[metadata] -family = "S09" -task_track = "coordinate_reasoning" -requires_tool_free_runner = true -answer_path = "/app/answer.txt" -reward = "exact_correct" -[agent] -timeout_sec = 7200 -[verifier] -timeout_sec = 60 -[environment] -cpus = 1 -memory_mb = 512 -storage_mb = 1024 -network_mode = "no-network" diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py deleted file mode 100644 index 5e0495cb114e72c83fe317c202aa1b870049adc3..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/__init__.py +++ /dev/null @@ -1,74 +0,0 @@ -"""Deterministic answer parsing and scoring.""" - -from __future__ import annotations - -from typing import Any - -from .parse import ( - AnswerFormatError, - ParsedAnswer, - canonical_atom, - canonical_pair, - canonical_residue, - extract_final, - looks_like_refusal, - parse_answer, -) -from .scorers import SCORING_VERSION, score_answer, set_scores - -__all__ = [ - "AnswerFormatError", - "ParsedAnswer", - "canonical_atom", - "canonical_pair", - "canonical_residue", - "extract_final", - "looks_like_refusal", - "parse_answer", - "score_answer", - "score_response", - "set_scores", -] - - -def score_response( - raw_response: str, - answer_schema: str, - gold_answer: dict[str, Any], - *, - parameters: dict[str, Any] | None = None, - truncated: bool = False, - provider_refusal: bool = False, -) -> dict[str, Any]: - """Parse and score one raw model response end to end. - - Returns ``{"parsed": ..., "score": ..., "format_error": ..., "refusal": ...}``. - Malformed, refused and truncated answers score zero and are reported under - their own failure category (section 12). ``provider_refusal`` covers an - explicit terminal API signal even when partial text happens to parse. - - ``format_error`` and ``refusal`` are mutually exclusive. Both score zero, but - they are opposite events: a refusal is a model saying the question cannot be - answered from what it was given, which on a context-only control is the - correct response; a format error is a model failing to say anything the - scorer can read. Counting a refusal under both made a model that declines - to guess look like one that cannot write an answer. - """ - parameters = parameters or {} - parsed = parse_answer(raw_response, answer_schema, parameters) - refusal = provider_refusal or ( - parsed.format_error and looks_like_refusal(raw_response) - ) - result = score_answer(answer_schema, gold_answer, parsed, parameters) - if truncated or provider_refusal: - result = {**result, "score": 0.0, "correct": False} - if truncated: - result["truncated"] = True - return { - "scoring_version": SCORING_VERSION, - "parsed": parsed.as_dict(), - "score": result, - "format_error": bool(parsed.format_error and not refusal), - "refusal": bool(refusal), - "truncated": bool(truncated), - } diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py deleted file mode 100644 index a75ee7d22a8cd9e97700b510cb070ddfb401b128..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/parse.py +++ /dev/null @@ -1,383 +0,0 @@ -"""Parsing and canonicalisation of model answers (specification section 7). - -Only the ``FINAL`` field is scored. The parser is deliberately forgiving about -harmless surface variation (whitespace, markdown emphasis, trailing full stops, -case) and deliberately strict about content: an answer that names extra items, -uses the wrong separator or omits the field scores zero and is reported as a -format error. -""" - -from __future__ import annotations - -import re -from dataclasses import dataclass, field -from typing import Any - -# Only horizontal whitespace is allowed around the marker: a class containing -# `\s` would swallow the newline of a bare ``FINAL`` line and mistake the first -# field of a multi-field answer for a single-line answer. -FINAL_PATTERN = re.compile( - r"(?im)^[^\S\n]*[*_`#>]*[^\S\n]*final\b[*_`]*[^\S\n]*(:)?[*_`]*[^\S\n]*(.*)$" -) -FIELD_PATTERN = re.compile(r"^[^\S\n]*[*_`]*([A-Za-z][A-Za-z0-9_ \-]*?)[*_`]*[^\S\n]*:[^\S\n]*(.*)$") -RESIDUE_PATTERN = re.compile(r"^([A-Za-z0-9])[:\s]+([A-Za-z])[\s]*(-?\d+)$") -ATOM_PATTERN = re.compile(r"^([A-Za-z0-9])[:\s]+([A-Za-z])[\s]*(-?\d+)[:\s]+([A-Za-z0-9']{1,4})$") -# Non-greedy component name so ``M:ZN501`` parses as ZN/501 and ``L:L2401`` as -# L/2401 -- either way the parse is deterministic and round-trips the renderer. -ENTITY_PATTERN = re.compile(r"^([A-Za-z0-9])[:\s]+([A-Za-z][A-Za-z0-9]{0,2}?)[\s]*(-?\d+)$") -NUMBER_PATTERN = re.compile(r"[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?") - -PAIR_SEPARATOR = "--" -PATH_SEPARATOR = "->" - -#: A residue left on the marker line that is only a label, e.g. the "Answer:" of -#: "### Final Answer:". Requires the trailing colon, so real one-word answers -#: such as `helix` or `yes` are never mistaken for a label. -LABEL_ONLY = re.compile(r"^[A-Za-z][A-Za-z ]*:$") - -#: Phrases that mark a response as a declared inability to answer rather than a -#: malformed one. The two are different events and are counted separately: a -#: model that says the question cannot be answered from what it was given has -#: understood the task, and one that emits an unparseable answer has not. -#: -#: The second group covers a model declining a context-only control, where "this -#: cannot be determined from the information supplied" is the epistemically -#: correct response and the benchmark should record it as such. -REFUSAL_MARKERS = ( - "i cannot", "i can't", "i am unable", "i'm unable", "cannot answer", - "as an ai", "i do not have access", "i don't have access", "unable to determine", - "insufficient information to answer", - "cannot be determined", "can't be determined", "can not be determined", - "cannot be established", "not determinable", "impossible to determine", - "no coordinates", "not enough information", "insufficient information", -) - - -class AnswerFormatError(ValueError): - """The model output did not contain a parseable FINAL answer.""" - - -@dataclass -class ParsedAnswer: - """Result of parsing one model response.""" - - raw_final: str = "" - fields: dict[str, str] = field(default_factory=dict) - value: Any = None - format_error: bool = False - error: str = "" - - def as_dict(self) -> dict[str, Any]: - return { - "raw_final": self.raw_final, - "fields": self.fields, - "value": self.value, - "format_error": self.format_error, - "error": self.error, - } - - -# --------------------------------------------------------------------------- # -# Locating the FINAL block -# --------------------------------------------------------------------------- # - -def strip_markup(text: str) -> str: - out = text.strip() - out = out.strip("`") - out = re.sub(r"\*\*(.*?)\*\*", r"\1", out) - out = re.sub(r"^[*_`\s]+|[*_`\s]+$", "", out) - out = out.rstrip(".") - return out.strip() - - -def extract_final(text: str) -> tuple[str, dict[str, str]]: - """Return ``(inline_value, fields)`` for the last FINAL block in ``text``. - - A single-line answer yields a non-empty ``inline_value``. A multi-field - answer yields ``fields`` keyed by lowercase field name. - """ - if not text: - raise AnswerFormatError("empty response") - matches = list(FINAL_PATTERN.finditer(text)) - if not matches: - raise AnswerFormatError("no FINAL field found") - match = matches[-1] - inline = strip_markup(match.group(2) or "") - lines = text[match.end():].splitlines() - - # Continuation lines for long single-line lists that wrapped. The split - # leaves an empty first element for the newline itself, so skip it. - if inline and inline.endswith(","): - continuation = list(lines) - while continuation and not continuation[0].strip(): - continuation.pop(0) - for line in continuation: - candidate = strip_markup(line) - if not candidate: - break - inline = f"{inline} {candidate}".strip() - if not inline.endswith(","): - break - - fields: dict[str, str] = {} - if not inline: - for line in lines: - if not line.strip(): - if fields: - break - continue - field_match = FIELD_PATTERN.match(line) - if not field_match: - break - key = field_match.group(1).strip().lower().replace(" ", "_") - if len(key) == 1: - break # `A:V22` is a residue identifier, not a named field - fields[key] = strip_markup(field_match.group(2)) - # A marker followed by nothing usable on its own line: take the next - # non-empty line as the value. Models routinely write "Final answer:" and - # put the value underneath, and the specification's own multi-field layout - # already places answers on the lines after the marker. This does not widen - # what counts as an answer -- text elsewhere in the response is still - # ignored, and a non-answer on that line still fails to canonicalise. - if not fields and (not inline or LABEL_ONLY.match(inline)): - for line in lines: - candidate = strip_markup(line) - if candidate: - inline = candidate - break - - if not inline and not fields: - raise AnswerFormatError("FINAL field is empty") - return inline, fields - - -def looks_like_refusal(text: str) -> bool: - lowered = (text or "").lower() - return any(marker in lowered for marker in REFUSAL_MARKERS) - - -# --------------------------------------------------------------------------- # -# Canonicalisation of individual tokens -# --------------------------------------------------------------------------- # - -def canonical_residue(token: str) -> str: - """``a: v 22`` -> ``A:V22``; raises for anything that is not a residue id. - - Chain identifiers are upper-cased. The dataset builder rejects any rendering - whose chains differ only by case, so this cannot merge distinct chains. - """ - text = strip_markup(token).replace(" ", "") - match = RESIDUE_PATTERN.match(text) - if match: - return f"{match.group(1).upper()}:{match.group(2).upper()}{int(match.group(3))}" - entity = ENTITY_PATTERN.match(text) - if entity: - return f"{entity.group(1).upper()}:{entity.group(2).upper()}{int(entity.group(3))}" - raise AnswerFormatError(f"not a residue identifier: {token!r}") - - -def canonical_atom(token: str) -> str: - text = strip_markup(token).replace(" ", "") - match = ATOM_PATTERN.match(text) - if not match: - raise AnswerFormatError(f"not an atom identifier: {token!r}") - return ( - f"{match.group(1).upper()}:{match.group(2).upper()}{int(match.group(3))}" - f":{match.group(4).upper()}" - ) - - -def canonical_pair(token: str) -> str: - """Unordered residue pair, canonicalised to sorted ``A--B`` form.""" - text = strip_markup(token) - parts = [p for p in re.split(r"--+|\s+--\s+|—|–", text) if p.strip()] - if len(parts) != 2: - raise AnswerFormatError(f"not a residue pair: {token!r}") - a, b = (canonical_residue(parts[0]), canonical_residue(parts[1])) - first, second = sorted((a, b)) - return f"{first}{PAIR_SEPARATOR}{second}" - - -def split_list(text: str) -> list[str]: - """Split a comma or semicolon separated list, tolerating ``and``/newlines.""" - cleaned = strip_markup(text) - if not cleaned or cleaned.lower() in ("none", "no residues", "empty", "n/a", "-"): - return [] - cleaned = re.sub(r"\band\b", ",", cleaned, flags=re.IGNORECASE) - parts = re.split(r"[,;\n]+", cleaned) - return [p.strip() for p in parts if p.strip()] - - -def canonical_residue_set(text: str) -> list[str]: - return sorted({canonical_residue(p) for p in split_list(text)}) - - -def canonical_pair_set(text: str) -> list[str]: - return sorted({canonical_pair(p) for p in split_list(text)}) - - -def canonical_string_set(text: str) -> list[str]: - return sorted({strip_markup(p).upper() for p in split_list(text) if strip_markup(p)}) - - -def canonical_category(text: str, allowed: list[str] | None = None) -> str: - cleaned = re.sub(r"\s+", " ", strip_markup(text)).strip().lower() - if allowed is None: - return cleaned - lookup = {a.lower(): a for a in allowed} - if cleaned in lookup: - return lookup[cleaned] - # Tolerate a model that answers with the option in a longer sentence. - for option in sorted(allowed, key=len, reverse=True): - if re.search(rf"\b{re.escape(option.lower())}\b", cleaned): - return option - raise AnswerFormatError(f"category {text!r} is not one of {allowed}") - - -def canonical_boolean(text: str) -> bool: - cleaned = strip_markup(text).lower() - if cleaned in ("yes", "y", "true", "t"): - return True - if cleaned in ("no", "n", "false", "f"): - return False - raise AnswerFormatError(f"not a boolean: {text!r}") - - -def canonical_choice(text: str, options: list[str] | None = None) -> str: - cleaned = strip_markup(text).upper() - match = re.match(r"^\(?([A-Z])\)?\b", cleaned) - if not match: - raise AnswerFormatError(f"not a multiple-choice letter: {text!r}") - letter = match.group(1) - if options and letter not in [o.upper() for o in options]: - raise AnswerFormatError(f"option {letter!r} is not among {options}") - return letter - - -def canonical_number(text: str) -> float: - cleaned = strip_markup(text).replace("Å", "").replace("angstrom", "").strip() - match = NUMBER_PATTERN.search(cleaned) - if not match: - raise AnswerFormatError(f"no number found in {text!r}") - return float(match.group(0)) - - -def canonical_integer(text: str) -> int: - value = canonical_number(text) - if abs(value - round(value)) > 1e-9: - raise AnswerFormatError(f"not an integer: {text!r}") - return int(round(value)) - - -def canonical_triple(text: str) -> list[float]: - cleaned = strip_markup(text).replace("(", " ").replace(")", " ").replace("[", " ").replace("]", " ") - numbers = NUMBER_PATTERN.findall(cleaned) - if len(numbers) != 3: - raise AnswerFormatError(f"expected three numbers, found {len(numbers)} in {text!r}") - return [float(n) for n in numbers] - - -def canonical_path(text: str) -> list[str]: - cleaned = strip_markup(text) - parts = [p for p in re.split(r"->|→", cleaned) if p.strip()] - if len(parts) < 2: - raise AnswerFormatError(f"not an ordered path: {text!r}") - return [canonical_residue(p) for p in parts] - - -# --------------------------------------------------------------------------- # -# Schema dispatch -# --------------------------------------------------------------------------- # - -def parse_answer(text: str, answer_schema: str, parameters: dict[str, Any] | None = None) -> ParsedAnswer: - """Parse a raw model response into the canonical form for ``answer_schema``.""" - parameters = parameters or {} - try: - inline, fields = extract_final(text) - except AnswerFormatError as exc: - return ParsedAnswer(format_error=True, error=str(exc)) - - parsed = ParsedAnswer(raw_final=inline or _fields_repr(fields), fields=fields) - try: - parsed.value = _dispatch(answer_schema, inline, fields, parameters) - except AnswerFormatError as exc: - parsed.format_error = True - parsed.error = str(exc) - return parsed - - -def _fields_repr(fields: dict[str, str]) -> str: - return "\n".join(f"{k}: {v}" for k, v in fields.items()) - - -def _dispatch( - schema: str, inline: str, fields: dict[str, str], parameters: dict[str, Any] -) -> Any: - if schema == "string_set": - return canonical_string_set(inline) - if schema == "integer": - return canonical_integer(inline) - if schema == "numeric_triple": - return canonical_triple(inline) - if schema == "distance": - return canonical_number(inline) - if schema == "atom": - return canonical_atom(inline) - if schema == "residue": - return canonical_residue(inline) - if schema == "residue_set": - return canonical_residue_set(inline) - if schema == "residue_pair": - return canonical_pair(inline) - if schema == "residue_pair_set": - return canonical_pair_set(inline) - if schema == "category": - return canonical_category(inline, parameters.get("categories")) - if schema == "boolean": - return canonical_boolean(inline) - if schema == "multiple_choice": - return canonical_choice(inline, parameters.get("options")) - if schema == "ordered_path": - return canonical_path(inline) - if schema == "two_interaction_sets": - return _parse_two_sets(inline, fields) - if schema == "multi_field": - return _parse_multi_field(fields, parameters) - raise AnswerFormatError(f"unknown answer schema {schema!r}") - - -def _parse_two_sets(inline: str, fields: dict[str, str]) -> dict[str, list[str]]: - source = dict(fields) - if inline and not source: - # Tolerate "gained: ...; lost: ..." on one line. - for chunk in re.split(r";|\|", inline): - m = FIELD_PATTERN.match(chunk.strip()) - if m: - source[m.group(1).strip().lower()] = m.group(2) - missing = [k for k in ("gained", "lost") if k not in source] - if missing: - raise AnswerFormatError(f"missing required field(s) {missing}") - return { - "gained": canonical_pair_set(source["gained"]), - "lost": canonical_pair_set(source["lost"]), - } - - -def _parse_multi_field(fields: dict[str, str], parameters: dict[str, Any]) -> dict[str, Any]: - spec: dict[str, str] = parameters.get("field_schemas") or {} - if not spec: - raise AnswerFormatError("multi_field answers require a field_schemas parameter") - missing = [name for name in spec if name not in fields] - if missing: - raise AnswerFormatError(f"missing required field(s) {missing}") - out: dict[str, Any] = {} - errors: list[str] = [] - for name, sub_schema in spec.items(): - try: - out[name] = _dispatch(sub_schema, fields[name], {}, parameters.get(name, {})) - except AnswerFormatError as exc: - out[name] = None - errors.append(f"{name}: {exc}") - if errors and len(errors) == len(spec): - raise AnswerFormatError("; ".join(errors)) - return out diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py deleted file mode 100644 index f541597e6f7d19ecf5993fa7ac5a9b8cea4e2554..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/coordinate_scoring/scorers.py +++ /dev/null @@ -1,173 +0,0 @@ -"""Deterministic scorers (specification section 12). - -No scorer consults a language model. Every scorer returns a dictionary with a -primary ``score`` in [0, 1] plus the secondary metrics the report needs. -""" - -from __future__ import annotations - -from fractions import Fraction -from math import isfinite -from typing import Any - -from .parse import ParsedAnswer, canonical_pair, canonical_residue - -DEFAULT_DISTANCE_TOLERANCE = 0.02 # A.4 -DEFAULT_COORDINATE_TOLERANCE = 0.001 # section 8, P03 -SCORING_VERSION = "1.1.0" - - -def numeric_error(predicted: float, expected: float) -> Fraction | float: - """Compare parsed decimal values without binary subtraction at the boundary.""" - if not isfinite(predicted): - return float("inf") - return abs(Fraction(str(predicted)) - Fraction(str(expected))) - - -def set_scores(gold: list[str], predicted: list[str]) -> dict[str, Any]: - """Set F1 (primary) and exact-set accuracy (strict secondary).""" - gold_set, pred_set = set(gold), set(predicted) - true_positive = len(gold_set & pred_set) - precision = true_positive / len(pred_set) if pred_set else (1.0 if not gold_set else 0.0) - recall = true_positive / len(gold_set) if gold_set else (1.0 if not pred_set else 0.0) - f1 = 0.0 if (precision + recall) == 0 else 2 * precision * recall / (precision + recall) - if not gold_set and not pred_set: - precision = recall = f1 = 1.0 - return { - "score": f1, - "f1": f1, - "precision": precision, - "recall": recall, - "exact_set": float(gold_set == pred_set), - "correct": bool(gold_set == pred_set), - "n_gold": len(gold_set), - "n_predicted": len(pred_set), - "missing": sorted(gold_set - pred_set), - "spurious": sorted(pred_set - gold_set), - } - - -def score_answer( - answer_schema: str, - gold: dict[str, Any], - parsed: ParsedAnswer, - parameters: dict[str, Any] | None = None, -) -> dict[str, Any]: - """Score one parsed answer against its gold label.""" - parameters = parameters or {} - if parsed.format_error or parsed.value is None: - return { - "score": 0.0, - "correct": False, - "format_error": True, - "error": parsed.error or "unparseable answer", - } - - predicted = parsed.value - if answer_schema in ("residue", "atom", "category", "multiple_choice"): - expected = gold["value"] - correct = str(predicted) == str(expected) - return {"score": float(correct), "correct": correct, "predicted": predicted, "gold": expected} - - if answer_schema == "boolean": - expected = bool(gold["value"]) - correct = bool(predicted) == expected - return {"score": float(correct), "correct": correct, "predicted": predicted, "gold": expected} - - if answer_schema == "integer": - expected = int(gold["value"]) - correct = int(predicted) == expected - return {"score": float(correct), "correct": correct, "predicted": predicted, "gold": expected} - - if answer_schema == "distance": - tolerance = float(parameters.get("tolerance", DEFAULT_DISTANCE_TOLERANCE)) - expected = float(gold["value"]) - error = numeric_error(float(predicted), expected) - correct = error <= Fraction(str(tolerance)) - return { - "score": float(correct), - "correct": correct, - "absolute_error": float(error), - "tolerance": tolerance, - "predicted": predicted, - "gold": expected, - } - - if answer_schema == "numeric_triple": - tolerance = float(parameters.get("tolerance", DEFAULT_COORDINATE_TOLERANCE)) - expected = [float(v) for v in gold["value"]] - errors = [numeric_error(float(p), e) for p, e in zip(predicted, expected)] - within = [e <= Fraction(str(tolerance)) for e in errors] - correct = all(within) - return { - "score": float(correct), - "correct": correct, - "component_errors": [float(e) for e in errors], - "components_within_tolerance": sum(within), - "tolerance": tolerance, - "predicted": predicted, - "gold": expected, - } - - if answer_schema == "residue_pair": - expected = canonical_pair(gold["value"]) - correct = predicted == expected - return {"score": float(correct), "correct": correct, "predicted": predicted, "gold": expected} - - if answer_schema in ("string_set", "residue_set", "residue_pair_set"): - expected = list(gold["value"]) - out = set_scores(expected, list(predicted)) - out.update({"predicted": sorted(predicted), "gold": sorted(expected)}) - return out - - if answer_schema == "ordered_path": - expected = [canonical_residue(v) for v in gold["value"]] - exact = list(predicted) == expected - positions = sum( - 1 for a, b in zip(predicted, expected) if a == b - ) / max(len(expected), 1) - return { - "score": float(exact), - "correct": exact, - "per_position": positions, - "predicted": list(predicted), - "gold": expected, - } - - if answer_schema == "two_interaction_sets": - gained = set_scores(list(gold.get("gained", [])), list(predicted.get("gained", []))) - lost = set_scores(list(gold.get("lost", [])), list(predicted.get("lost", []))) - mean = (gained["score"] + lost["score"]) / 2.0 - return { - "score": mean, - "correct": bool(gained["correct"] and lost["correct"]), - "gained": gained, - "lost": lost, - "exact_set": float(gained["correct"] and lost["correct"]), - } - - if answer_schema == "multi_field": - return _score_multi_field(gold, predicted, parameters) - - raise ValueError(f"no scorer for answer schema {answer_schema!r}") - - -def _score_multi_field( - gold: dict[str, Any], predicted: dict[str, Any], parameters: dict[str, Any] -) -> dict[str, Any]: - fields = gold.get("fields") or {} - per_field: dict[str, Any] = {} - for name, spec in fields.items(): - sub_schema = spec["schema"] - sub_gold = {k: v for k, v in spec.items() if k != "schema"} - value = predicted.get(name) - sub_parsed = ParsedAnswer(value=value, format_error=value is None) - per_field[name] = score_answer( - sub_schema, sub_gold, sub_parsed, parameters.get(name, {}) - ) - scores = [v["score"] for v in per_field.values()] - return { - "score": sum(scores) / len(scores) if scores else 0.0, - "correct": all(v["correct"] for v in per_field.values()) if per_field else False, - "fields": per_field, - } diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json deleted file mode 100644 index f7274de0ee8ddf65774fdc867c170efb34d81572..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/gold.json +++ /dev/null @@ -1 +0,0 @@ -{"answer_schema": "category", "definition_version": "v1.0.0", "gold_answer": {"value": "g-"}, "parameters": {"atom4": "CG", "categories": ["g+", "t", "g-"], "residue": "B:F484"}, "reward": "exact_correct", "scoring_version": "1.1.0", "version": "1.1.0"} \ No newline at end of file diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh deleted file mode 100644 index cdba8796c64e2d36448c41092163144f8da304eb..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -set -eu -python /tests/verify.py diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml deleted file mode 100644 index 07563b64a6afac2846c2f50ad59df56f79887254..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verifier.toml +++ /dev/null @@ -1,6 +0,0 @@ -version = "1.1.0" -mode = "pdbthink-coordinate" -scoring_version = "1.1.0" -answer_path = "/app/answer.txt" -contract = "/tests/gold.json" -reward = "exact_correct" diff --git a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py b/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py deleted file mode 100644 index c8da25a86cba2b415036d0a6975a7d9dc2c8cf26..0000000000000000000000000000000000000000 --- a/upstream/pdbthink/pdbthink-s09-7ba4aa076b6bb5633953/tests/verify.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Run only after the model response has been saved by the host harness.""" -import json -import os -from pathlib import Path -from coordinate_scoring import score_response - -def verify(root=Path("/tests"), answer=Path("/app/answer.txt"), output=Path("/logs/verifier")): - output.mkdir(parents=True, exist_ok=True) - (output / "reward.txt").write_text("0\n") - contract = json.loads((root / "gold.json").read_text()) - raw = answer.read_text() if answer.exists() and answer.stat().st_size <= 8000000 else "" - status_path = answer.with_name("answer_status.json") - status = json.loads(status_path.read_text()) if status_path.exists() else {} - outcome = score_response(raw, contract["answer_schema"], contract["gold_answer"], - parameters=contract["parameters"], truncated=status.get("truncated", False), - provider_refusal=status.get("provider_refusal", False)) - tool_violation = bool(status.get("tool_events", [])) - reward = float(outcome["score"].get("correct", False) and not tool_violation) - details = {"reward": reward, "partial_credit": outcome["score"]["score"], - "tool_violation": tool_violation, "outcome": outcome} - (output / "details.json").write_text(json.dumps(details, indent=2)) - (output / "reward.txt").write_text(str(reward) + "\n") - return details - -if __name__ == "__main__": - verify(Path(os.environ.get("PDBTHINK_TEST_ROOT", "/tests")), - Path(os.environ.get("PDBTHINK_ANSWER", "/app/answer.txt")), - Path(os.environ.get("PDBTHINK_REWARD_DIR", "/logs/verifier"))) diff --git a/validate_dataset.py b/validate_dataset.py index 1914169f584ba8f7583e84a68001bd2da7fe7233..fdeb6ed2193096804801025333a3b389d3ede390 100644 --- a/validate_dataset.py +++ b/validate_dataset.py @@ -1,202 +1,23 @@ -#!/usr/bin/env python3 - -import argparse import hashlib import json -from pathlib import Path, PurePosixPath -import re -import sys - - -def digest(path): - result = hashlib.sha256() - with path.open("rb") as stream: - for chunk in iter(lambda: stream.read(1024 * 1024), b""): - result.update(chunk) - return result.hexdigest() - - -def require(condition, message): - if not condition: - raise ValueError(message) - - -def relative_file(root, name): - require(isinstance(name, str) and name, "Empty or non-string path") - path = PurePosixPath(name) - require(not path.is_absolute() and ".." not in path.parts - and "\\" not in name and str(path) == name, - "Unsafe or non-canonical relative path: " + name) - target = root / name - require(target.is_file(), "Missing file: " + name) - require(not any((root / PurePosixPath(*path.parts[:i])).is_symlink() - for i in range(1, len(path.parts) + 1)), - "Symlink is outside the frozen inventory policy: " + name) - return target - - -def load(root, name): - return json.loads(relative_file(root, name).read_text(encoding="utf-8")) - - -def pointer(document, value): - require(value.startswith("/"), "JSON pointer must begin with /") - for part in value[1:].split("/"): - part = part.replace("~1", "/").replace("~0", "~") - document = document[int(part)] if isinstance(document, list) else document[part] - return document - - -def validate(root): - manifest = load(root, "MANIFEST.json") - lock = load(root, "SOURCE_LOCK.json") - registration = load(root, "REGISTRATION.json") - rows = [json.loads(line) for line in relative_file(root, "tasks.jsonl") - .read_text(encoding="utf-8").splitlines() if line.strip()] - expected = manifest["files"] - found = set() - for path in root.rglob("*"): - require(not path.is_symlink(), "Unexpected symlink: " + str(path.relative_to(root))) - if path.is_file(): - found.add(path.relative_to(root).as_posix()) - require(found == set(expected) | {"MANIFEST.json", "SHA256SUMS"}, - "Inventory mismatch; extra=" + str(sorted(found - set(expected) - - {"MANIFEST.json", "SHA256SUMS"})) + "; missing=" - + str(sorted(set(expected) - found))) - actual_hashes = {} - for name, entry in expected.items(): - path = relative_file(root, name) - actual_hashes[name] = digest(path) - require(actual_hashes[name] == entry["sha256"], "Inventory SHA mismatch: " + name) - require(path.stat().st_size == entry["bytes"], "Inventory size mismatch: " + name) - - checksum_rows = {} - for line in relative_file(root, "SHA256SUMS").read_text(encoding="utf-8").splitlines(): - match = re.fullmatch(r"([0-9a-f]{64}) (.+)", line) - require(match is not None, "Malformed SHA256SUMS line") - value, name = match.groups() - require(name not in checksum_rows, "Duplicate checksum path: " + name) - checksum_rows[name] = value - require(checksum_rows == {**actual_hashes, "MANIFEST.json": digest(root / "MANIFEST.json")}, - "SHA256SUMS must cover every manifest entry and MANIFEST.json") - - record_ids = {item["id"] for item in lock["reviewed_records"]} - require(len(record_ids) == len(lock["reviewed_records"]), "Duplicate reviewed record ID") - for item in lock["reviewed_records"]: - require(re.fullmatch(r"[0-9a-f]{64}", item["sha256"]) is not None, - "Invalid review record SHA: " + item["id"]) - for name, entry in lock["files"].items(): - require(name in actual_hashes, "Source lock file missing from inventory: " + name) - require(actual_hashes[name] == entry["sha256"], "Reviewed source SHA mismatch: " + name) - require(expected[name]["bytes"] == entry["bytes"], "Reviewed source size mismatch: " + name) - require(entry["reviewed_record"] in record_ids, "Unknown source review record: " + name) - source = entry.get("source", {}) - for key in ("sha256", "byte_equal_source_sha256"): - if source.get(key) is not None: - require(source[key] == entry["sha256"], "Upstream byte identity mismatch: " + name) - if source.get("byte_equal") is True: - require(source["upstream_sha256"] == entry["sha256"], - "Original archive member SHA mismatch: " + name) - for name in found: - if name.startswith(("components/", "upstream/")): - require(name in lock["files"], "Component file has no reviewed source lock: " + name) - missing_empty_directories = [] - for item in lock.get("required_directories", []): - path = PurePosixPath(item["path"]) - require(not path.is_absolute() and ".." not in path.parts, - "Unsafe required directory path") - directory = root / path - if not directory.exists() and not directory.is_symlink() and item.get("empty"): - missing_empty_directories.append(item["path"]) - continue - require(directory.is_dir() and not directory.is_symlink(), - "Missing required directory: " + item["path"]) - if item.get("empty"): - require(not any(directory.iterdir()), "Expected empty directory: " + item["path"]) - - ids = [row["task_id"] for row in rows] - require(ids == registration["selected_task_ids"], "Task order differs from REGISTRATION.json") - require(ids == lock["selected_task_ids"], "Task order differs from SOURCE_LOCK.json") - require(len(ids) == len(set(ids)) == registration["selected_count"] == 11, - "Expected exactly 11 unique selected task IDs") - require(manifest["selected_task_count"] == len(ids), "Manifest selected count mismatch") - families = {row["skill_family"] for row in rows} - require(len(families) == registration["skill_family_count"] and len(families) >= 6, - "Capability family count mismatch") - require(all(sum(row["skill_family"] == family for row in rows) <= 3 - for family in families), "One narrow capability family exceeds three registrations") - - runtime_tasks = {} - runtime_entries = {} - for component, mapping in lock["runtime_registries"].items(): - config = load(root, mapping["path"]) - available = [item[mapping["id_field"]] for item in pointer(config, mapping["tasks_pointer"])] - require(len(available) == len(set(available)), "Duplicate runtime ID: " + component) - runtime_tasks[component] = set(available) - runtime_entries[component] = {item[mapping["id_field"]]: item - for item in pointer(config, mapping["tasks_pointer"])} - selected = {row["task_id"] for row in rows if row["component"] == component} - require(selected <= set(available), "Selected task absent from runtime: " + component) - extras = set(registration["unregistered_available_tasks"].get(component, [])) - require(set(available) - selected == extras, "Unregistered runtime task mismatch: " + component) - require(set(runtime_tasks) == {row["component"] for row in rows}, "Component registry mismatch") - - for row in rows: - require(row["split"] == "train", "Non-train task: " + row["task_id"]) - require("target_evidence" not in row, "Research evidence field in public task registration") - origin = lock["source_revisions"][row["component"]] - require(row["source_dataset"] == origin["repository"] - and row["source_revision"] == origin["revision"], - "Source revision mismatch: " + row["task_id"]) - name = row["original_instruction"] - path = relative_file(root, name) - require(name in lock["files"], "Instruction missing from source lock: " + name) - if "original_instruction_json_pointer" in row: - json_pointer = row["original_instruction_json_pointer"] - value = pointer(json.loads(path.read_text(encoding="utf-8")), json_pointer) - require(isinstance(value, str), "Instruction JSON field is not a string") - value_hash = hashlib.sha256(value.encode("utf-8")).hexdigest() - field_lock = lock["instruction_fields"][name + "#" + json_pointer] - require(value_hash == field_lock["sha256"], "Original instruction field SHA mismatch") - else: - value_hash = actual_hashes[name] - require(value_hash == row["original_instruction_sha256"], - "Registered original instruction SHA mismatch: " + row["task_id"]) - mapping = lock["runtime_registries"][row["component"]] - if "instruction_sha256_pointer" in mapping: - runtime_entry = runtime_entries[row["component"]][row["task_id"]] - require(pointer(runtime_entry, mapping["instruction_sha256_pointer"]) == value_hash, - "Runtime task-to-instruction binding mismatch: " + row["task_id"]) - if row["component"] == "awm": - require(json.loads(path.read_text(encoding="utf-8"))["task_id"] == row["task_id"], - "AWM source task binding mismatch") - - for reference, entry in lock["instruction_fields"].items(): - name, json_pointer = reference.split("#", 1) - value = pointer(load(root, name), json_pointer) - require(hashlib.sha256(value.encode("utf-8")).hexdigest() == entry["sha256"], - "Original instruction field changed: " + reference) - require(digest(root / "schema.json") == lock["schema_sha256"], "Shared schema SHA mismatch") - return {"status": "pass", "selected_tasks": len(ids), "capability_families": len(families), - "components": len(runtime_tasks), "source_locked_files": len(lock["files"]), - "inventory_files": len(found), "unregistered_backups": sum(len(v) for v in - registration["unregistered_available_tasks"].values()), - "missing_empty_directories": sorted(missing_empty_directories), - "scope": "offline inventory, reviewed source hashes and registration mapping only"} - - -def main(): - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("--root", type=Path, default=Path(__file__).resolve().parent) - args = parser.parse_args() - try: - result = validate(args.root.resolve()) - except (ValueError, KeyError, IndexError, TypeError, OSError) as error: - print(json.dumps({"status": "fail", "error": str(error)}, ensure_ascii=False), file=sys.stderr) - return 1 - print(json.dumps(result, ensure_ascii=False, indent=2)) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) +from pathlib import Path + +root = Path(__file__).resolve().parent +manifest = json.loads((root / 'MANIFEST.json').read_text())['files'] +actual = {p.relative_to(root).as_posix() for p in root.rglob('*') if p.is_file() and p.name not in {'MANIFEST.json', 'SHA256SUMS'}} +assert actual == set(manifest) +for name, record in manifest.items(): + path = root / name + assert not path.is_symlink() and path.stat().st_size == record['bytes'] + assert hashlib.sha256(path.read_bytes()).hexdigest() == record['sha256'], name +rows = [json.loads(line) for line in (root / 'tasks.jsonl').read_text().splitlines()] +assert len(rows) == 13 and len({row['task_id'] for row in rows}) == 13 +assert {row['component'] for row in rows} == {'dnakhla', 'metaharness', 'loui', 'audit'} +for row in rows: + for field in ['source_record', 'original_instruction', 'original_task_definition', 'original_public_instances']: + if field in row: + assert row[field] in manifest + for field in ['original_instruction', 'original_task_definition']: + if field in row: + assert manifest[row[field]]['sha256'] == row[field + '_sha256'] +print(json.dumps({'passed': True, 'tasks': len(rows), 'components': 4, 'files': len(manifest)}))