From 2818eb6f2343ef75bed10346790ce819332c6038 Mon Sep 17 00:00:00 2001 From: Chris R Date: Fri, 6 Nov 2026 13:28:23 +1100 Subject: [PATCH] Expose exact H25 resource contracts and adopted adapter sources Retain source-only and conditional review boundaries. Resolve the concrete readable-input gap after complete source assembly; no execution or complete-fit claim. AI assistance: OpenAI Codex and ChatGPT Pro. --- .../.gitattributes | 1 + .../LICENSE-APACHE-2.0.txt | 201 ++ .../LICENSE-CPYTHON.txt | 279 +++ .../MANIFEST.json | 108 ++ .../PREDECESSOR-NOTICE.md | 7 + .../PROVENANCE.json | 76 + .../README.md | 32 + .../RECONCILIATION.md | 13 + .../REUSE-DECISIONS.json | 232 +++ .../SHA256SUMS | 15 + .../bill-and-resource.json | 99 + .../control-union-census-index.json | 499 +++++ .../data-adapters.py.txt | 1664 +++++++++++++++++ .../model-fit-dispositions.json | 644 +++++++ .../model-source-fit-review.json | 133 ++ .../native-packet.py.txt | 346 ++++ 16 files changed, 4349 insertions(+) create mode 100644 research/h25-resource-contract-readable-inputs/.gitattributes create mode 100644 research/h25-resource-contract-readable-inputs/LICENSE-APACHE-2.0.txt create mode 100644 research/h25-resource-contract-readable-inputs/LICENSE-CPYTHON.txt create mode 100644 research/h25-resource-contract-readable-inputs/MANIFEST.json create mode 100644 research/h25-resource-contract-readable-inputs/PREDECESSOR-NOTICE.md create mode 100644 research/h25-resource-contract-readable-inputs/PROVENANCE.json create mode 100644 research/h25-resource-contract-readable-inputs/README.md create mode 100644 research/h25-resource-contract-readable-inputs/RECONCILIATION.md create mode 100644 research/h25-resource-contract-readable-inputs/REUSE-DECISIONS.json create mode 100644 research/h25-resource-contract-readable-inputs/SHA256SUMS create mode 100644 research/h25-resource-contract-readable-inputs/bill-and-resource.json create mode 100644 research/h25-resource-contract-readable-inputs/control-union-census-index.json create mode 100644 research/h25-resource-contract-readable-inputs/data-adapters.py.txt create mode 100644 research/h25-resource-contract-readable-inputs/model-fit-dispositions.json create mode 100644 research/h25-resource-contract-readable-inputs/model-source-fit-review.json create mode 100644 research/h25-resource-contract-readable-inputs/native-packet.py.txt diff --git a/research/h25-resource-contract-readable-inputs/.gitattributes b/research/h25-resource-contract-readable-inputs/.gitattributes new file mode 100644 index 0000000000..fa1385d99a --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/.gitattributes @@ -0,0 +1 @@ +* -text diff --git a/research/h25-resource-contract-readable-inputs/LICENSE-APACHE-2.0.txt b/research/h25-resource-contract-readable-inputs/LICENSE-APACHE-2.0.txt new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/LICENSE-APACHE-2.0.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/h25-resource-contract-readable-inputs/LICENSE-CPYTHON.txt b/research/h25-resource-contract-readable-inputs/LICENSE-CPYTHON.txt new file mode 100644 index 0000000000..f26bcf4d2d --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/LICENSE-CPYTHON.txt @@ -0,0 +1,279 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see https://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see https://opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +Python software and documentation are licensed under the +Python Software Foundation License Version 2. + +Starting with Python 3.8.6, examples, recipes, and other code in +the documentation are dual licensed under the PSF License Version 2 +and the Zero-Clause BSD license. + +Some software incorporated into Python is under different licenses. +The licenses are listed with code falling under that license. + + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION +---------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/research/h25-resource-contract-readable-inputs/MANIFEST.json b/research/h25-resource-contract-readable-inputs/MANIFEST.json new file mode 100644 index 0000000000..de17e327d6 --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/MANIFEST.json @@ -0,0 +1,108 @@ +{ + "files": [ + { + "path": ".gitattributes", + "bytes": 8, + "sha256": "705fd4d6451a31d36b3df7de96f83f30ac976c9b4a6d1e51671d8e2f33e2d0da", + "git_blob": "fa1385d99a319b43c06f5309d1aae9fdd3adea46", + "git_mode": "100644" + }, + { + "path": "LICENSE-APACHE-2.0.txt", + "bytes": 11357, + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "git_mode": "100644" + }, + { + "path": "LICENSE-CPYTHON.txt", + "bytes": 13936, + "sha256": "3b2f81fe21d181c499c59a256c8e1968455d6689d269aa85373bfb6af41da3bf", + "git_blob": "f26bcf4d2de6eb136e31006ca3ab447d5e488adf", + "git_mode": "100644" + }, + { + "path": "PREDECESSOR-NOTICE.md", + "bytes": 1375, + "sha256": "327fcdce33b509f5773c77f1a8d54ea8c650e9f42cb780810d0608fe5e715c1b", + "git_blob": "2b2f477f93012252bb88b3d38975015e2206ae66", + "git_mode": "100644" + }, + { + "path": "PROVENANCE.json", + "bytes": 3846, + "sha256": "4cda22bfb87b3572d85de41e69bfbd7c49c260558c15ab9902a1c9aa941dbd4f", + "git_blob": "7a0b63b7fecab754bf09ee6832ddeb1a33320141", + "git_mode": "100644" + }, + { + "path": "README.md", + "bytes": 4530, + "sha256": "2562cdcdd0938e79c88eb64da4843dd53a0f700a88c9036c94b17de72b20792c", + "git_blob": "474daa9c17b23e7fbb09978e599cce1539a5ea8f", + "git_mode": "100644" + }, + { + "path": "RECONCILIATION.md", + "bytes": 3191, + "sha256": "4c07436b7d48e71382e07857856755ab821d84c3dbc148fd968b90060891d0ad", + "git_blob": "8c739dfbfeea129824cce22e4c69679909b5595e", + "git_mode": "100644" + }, + { + "path": "REUSE-DECISIONS.json", + "bytes": 10569, + "sha256": "edacafc0244e111a36268b0969673aec3dd3ccf468f354aa746760d36f5d583b", + "git_blob": "8de952898221970df48056fc7531116ccaa1f9ab", + "git_mode": "100644" + }, + { + "path": "bill-and-resource.json", + "bytes": 11377, + "sha256": "61109d429c4d78df3ec55e65a5c4879c58342c49a8ac4fe30f3892ecc117570d", + "git_blob": "5bff5a11aeae9ff243b3ce42c2d93cb1b5e7b785", + "git_mode": "100644" + }, + { + "path": "control-union-census-index.json", + "bytes": 14515, + "sha256": "f17ac66cf3c0d239bb62fbd918d7190321dbc4195bc58f8fcf492631509aabea", + "git_blob": "8aec416c91763574945d909c4d6e56220241c619", + "git_mode": "100644" + }, + { + "path": "data-adapters.py.txt", + "bytes": 103903, + "sha256": "18679fd1eb6ae99c4b375756511427c26718f77674c2d8fcc490e25ceb47cba5", + "git_blob": "33a9042bfcce6e4fed7fb439f5cf1c3e9f1e0e97", + "git_mode": "100644" + }, + { + "path": "model-fit-dispositions.json", + "bytes": 20005, + "sha256": "bdf68ff81d29208acbdcfdb628813431ab3a14313f8048f09d301249a17a1468", + "git_blob": "596020382e408e538b1c02d22014b73ce52a928e", + "git_mode": "100644" + }, + { + "path": "model-source-fit-review.json", + "bytes": 7040, + "sha256": "8cffbacbaf405bb6d062078310baa69ffc38d737acf123c69f9eae25492900dc", + "git_blob": "eea5d1c54732731c7445153ed3739457f781c707", + "git_mode": "100644" + }, + { + "path": "native-packet.py.txt", + "bytes": 24096, + "sha256": "8e9298cfbf44cedd07868dc1624631d7ce73d78c48c4eec1fca15d3640076dab", + "git_blob": "1d4f3d67f20cc82a7f63c54dd12639ad883ed30c", + "git_mode": "100644" + } + ], + "excludes": [ + "MANIFEST.json", + "SHA256SUMS" + ], + "input_body_count": 6, + "claims": "Exact source transport and dependency reconciliation only; no full fit or replay." +} diff --git a/research/h25-resource-contract-readable-inputs/PREDECESSOR-NOTICE.md b/research/h25-resource-contract-readable-inputs/PREDECESSOR-NOTICE.md new file mode 100644 index 0000000000..2b2f477f93 --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/PREDECESSOR-NOTICE.md @@ -0,0 +1,7 @@ +New packaging and analysis: Chris R / Clear1nsight, with substantial OpenAI Codex assistance, Apache-2.0. + +Preserved H25 source/review lineage includes PR6029 (e05aad954689d0ee21baff19b4674f1fcb2e838f), PR6321 (ca9d90e93dc495e1e5e5ef6d271ff1e4f089cd0c), separate PR6316/6317 contributions, unpaidmoon with substantial Cursor Grok assistance for PR6339 (608ad23adc6c01264c8195daf7f18e29c17464a7), PR6346 (abff67b31fa781e950c82d95eccb6f168950943c), PR6347 (59140439e7f791876159e2f3838f1dead2e54953), and PR6351 (1e9db2d08be4551ffe0bcfc573574851530eb4ca). Exact refreshed metadata is in UPSTREAM-AND-OVERLAP.json. + +Retain Douglas R. Colkitt and the original CrocSwap circuit/network/native/verification contributors, and every notice in the byte-exact source objects and inherited upstream license. Retain Sjoerd Mullender and Jeffrey Yasskin's attribution in the CPython Fraction reference. CPython material retains its PSF and predecessor license terms; LICENSE-CPYTHON.txt is the complete license at CPython v3.12.15. + +Substantial ChatGPT Pro consultation and OpenAI Codex/GPT-6.1-sol Max implementation and distinct-agent review assistance is disclosed. Agent agreement is independent AI source review, without independent human, proof-kernel, native or runtime acceptance. Predecessor performance results and archival merges are not transferred to this source-only result. diff --git a/research/h25-resource-contract-readable-inputs/PROVENANCE.json b/research/h25-resource-contract-readable-inputs/PROVENANCE.json new file mode 100644 index 0000000000..7a0b63b7fe --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/PROVENANCE.json @@ -0,0 +1,76 @@ +{ + "schema": "h25-readable-resource-inputs-v1", + "canonical_main": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "assembly_head": "57cd3615df4c7ada2300ba7295d410ba705c9280", + "selected_graph_head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "scope": "Exact existing source/review transport; no target execution or complete fit credit", + "original_investigation": "https://github.com/CrocSwap/integer-mult-bounds/pull/6321", + "direct_predecessor": "https://github.com/CrocSwap/integer-mult-bounds/pull/6752", + "files": [ + { + "file": "control-union-census-index.json", + "bytes": 14515, + "sha256": "f17ac66cf3c0d239bb62fbd918d7190321dbc4195bc58f8fcf492631509aabea", + "git_blob": "8aec416c91763574945d909c4d6e56220241c619", + "original_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/full-control-union-feasibility-v1/CENSUS-INDEX.json", + "original_mode": "0o444", + "archive_mode": "100644" + }, + { + "file": "model-source-fit-review.json", + "bytes": 7040, + "sha256": "8cffbacbaf405bb6d062078310baa69ffc38d737acf123c69f9eae25492900dc", + "git_blob": "eea5d1c54732731c7445153ed3739457f781c707", + "original_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/REVIEW.json", + "original_mode": "0o444", + "archive_mode": "100644" + }, + { + "file": "model-fit-dispositions.json", + "bytes": 20005, + "sha256": "bdf68ff81d29208acbdcfdb628813431ab3a14313f8048f09d301249a17a1468", + "git_blob": "596020382e408e538b1c02d22014b73ce52a928e", + "original_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/FIT-DISPOSITIONS.json", + "original_mode": "0o444", + "archive_mode": "100644" + }, + { + "file": "bill-and-resource.json", + "bytes": 11377, + "sha256": "61109d429c4d78df3ec55e65a5c4879c58342c49a8ac4fe30f3892ecc117570d", + "git_blob": "5bff5a11aeae9ff243b3ce42c2d93cb1b5e7b785", + "original_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/cache-epoch-products-v5/BILL-AND-RESOURCE.json", + "original_mode": "0o444", + "archive_mode": "100644" + }, + { + "file": "native-packet.py.txt", + "bytes": 24096, + "sha256": "8e9298cfbf44cedd07868dc1624631d7ce73d78c48c4eec1fca15d3640076dab", + "git_blob": "1d4f3d67f20cc82a7f63c54dd12639ad883ed30c", + "original_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/s03-final-source-adoption-20261104T1137Z/implementation/selected-images/8e9298cfbf44cedd07868dc1624631d7ce73d78c48c4eec1fca15d3640076dab.py", + "original_mode": "0o444", + "archive_mode": "100644" + }, + { + "file": "data-adapters.py.txt", + "bytes": 103903, + "sha256": "18679fd1eb6ae99c4b375756511427c26718f77674c2d8fcc490e25ceb47cba5", + "git_blob": "33a9042bfcce6e4fed7fb439f5cf1c3e9f1e0e97", + "original_path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/s03-final-source-adoption-20261104T1137Z/implementation/selected-images/18679fd1eb6ae99c4b375756511427c26718f77674c2d8fcc490e25ceb47cba5.py", + "original_mode": "0o444", + "archive_mode": "100644" + } + ], + "source_inputs_bytes": 180936, + "new_code_bodies": 0, + "target_imports": 0, + "target_controls": 0, + "compiler_or_native_operations": 0, + "source_assembly_repeated": false, + "scientific_runs": 0, + "complete_resource_bill": false, + "normal_fit": false, + "optimized_fit": false, + "physical_outside_costs": "OPEN_NOT_ZERO" +} diff --git a/research/h25-resource-contract-readable-inputs/README.md b/research/h25-resource-contract-readable-inputs/README.md new file mode 100644 index 0000000000..474daa9c17 --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/README.md @@ -0,0 +1,32 @@ +# Readable H25 workload and resource inputs + +This contribution exposes six exact existing source/review records needed to reconcile a complete H25 resource bill. It resolves a concrete source-access limitation in the Pro consultation after complete source assembly was accepted in [PR #6752](https://github.com/CrocSwap/integer-mult-bounds/pull/6752). It adds readable inputs, not a completed numerical bill or an execution result. + +The original investigation is [PR #6321](https://github.com/CrocSwap/integer-mult-bounds/pull/6321); the fixed benchmark is [PR #6029](https://github.com/CrocSwap/integer-mult-bounds/pull/6029). Direct predecessors are the adopted graph [#6715](https://github.com/CrocSwap/integer-mult-bounds/pull/6715), readable full callers [#6744](https://github.com/CrocSwap/integer-mult-bounds/pull/6744), ordinary caller/preparation [#6588](https://github.com/CrocSwap/integer-mult-bounds/pull/6588), and accepted retention source [#6736](https://github.com/CrocSwap/integer-mult-bounds/pull/6736). + +## Contents and meaning + +- `control-union-census-index.json`: historical bounded feasibility index. Its counts and unresolved-name observations belong to that snapshot; they are not a new complete-control denominator or a claim that later identity repairs are absent. +- `model-source-fit-review.json` and `model-fit-dispositions.json`: exact prior source-fit review and conditional bounds, with their unresolved journal, graph, memory and elapsed-cost obligations preserved. +- `bill-and-resource.json`: the existing C01-C15 cost decomposition. It is input to reconciliation, not proof of complete current workload fit. +- `native-packet.py.txt` and `data-adapters.py.txt`: the exact adopted inner bodies. They are inert source text and are not imported or executed by this contribution. + +`PROVENANCE.json` binds every retained input to its original byte count, SHA-256 and Git blob. The final two bodies and the bill also have published archive locators in the acquisition map of #6752. The review records' identities were already referenced by the published original criteria; this contribution supplies their readable bodies and the associated fit dispositions. Original files and all earlier negative evidence remain unchanged. + +## Verified boundary and next dependency + +The selected retention command profile still names normal/optimized `DATAaudit --finite-only` jobs. That mechanism is reusable within its accepted source scope; those jobs do not establish fit of the complete adopted workload. The selected registry/opening owner is distinct from the separate manual financial service. The complete scientific arms require assertions enabled, while applicable optimized control/refusal operations remain required. + +The next task is to reconcile the complete selected workload, owned action/process lifetimes, original oracles, inherited resource limits and exclusive cost terms in the existing production bill interface. Complete numerical bounds, actual current runtime/owner/native qualification, normal and optimized fit, and performance remain open. A timeout ceiling is not a measured duration, and installed source bytes are not simultaneous memory use. + +## Validation and reproduction + +All six input bodies were read as opaque bytes, matched against their independently retained expected SHA-256 values and copied without decoding archives, importing target modules, compiling, creating runtime inputs, running controls or replaying science. Read the supplied records against their pinned predecessors and run `sha256sum -c SHA256SUMS` for package byte integrity. There is no scientific replay hook. No complete-fit, performance, theorem or frontier claim follows from this export. + +## Credit + +Chris R / Clear1nsight, with substantial OpenAI Codex and ChatGPT Pro assistance. Preserve Douglas R. Colkitt and all original source/native/compiler and third-party contributors, the predecessor notices, and original review authors identified in the records. AI source review is not independent human or proof-kernel acceptance. Apache-2.0; source-specific notices remain applicable. + +## Open next questions + +Can the complete required workload be covered by justified resource bounds in the existing composed bill, with every cold setup, independent oracle, failure retirement, capture/readback and final tail charged once? The supplied conditional and historical records must first be reconciled with the adopted current bodies; unresolved terms remain unknown and prevent positive fit acceptance. diff --git a/research/h25-resource-contract-readable-inputs/RECONCILIATION.md b/research/h25-resource-contract-readable-inputs/RECONCILIATION.md new file mode 100644 index 0000000000..8c739dfbfe --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/RECONCILIATION.md @@ -0,0 +1,13 @@ +# Complete-workload resource reconciliation + +The complete source assembly in [#6752](https://github.com/CrocSwap/integer-mult-bounds/pull/6752) is an accepted predecessor. This review does not reconstruct it. The existing selected retention profile still names two `DATAaudit --finite-only` jobs. Reusing its source mechanism is appropriate; treating that selected two-job plan as the complete workload is not. + +The production path in [#6736](https://github.com/CrocSwap/integer-mult-bounds/pull/6736) selects the genuine original registry/opening owner. The separate manual financial service [#6709](https://github.com/CrocSwap/integer-mult-bounds/pull/6709) and its acquisition diagnostic [#6711](https://github.com/CrocSwap/integer-mult-bounds/pull/6711) are not automatic prerequisites for this owner. Current physical ownership, opening, native and runtime facts remain later admission requirements. + +The retained [#6588 orchestrator](https://github.com/CrocSwap/integer-mult-bounds/blob/ff7df8391c3bb3f5518ce43682ba4c1e41380e3e/research/h25-fresh-sc-constructor/successor-v26/implementation/caller/original/parent_orchestration_v2.py.txt) admits unit observations with both family-completion fields false, while its finite completion transition requires them true. Its unchanged unit route does not supply complete-family acceptance. This blocks that route to full scientific execution; it does not prove that later scientific acceptance is required before static resource accounting. Completion flags and original oracles must remain unchanged. + +The [adopted full images](https://github.com/CrocSwap/integer-mult-bounds/pull/6744) require assertions enabled. Applicable optimized controls and refusal cases remain required; running full scientific images with `-O` would violate their contract. The retained full receiver also expects older driver/lanes bindings, so selecting it unchanged for the adopted images needs a compatibility review. + +The existing composed-controller bill interface is the owning accounting boundary to adapt. Its outside and per-case categories, failure retirement, capture/readback and final tails must all be retained. A proposed invoice that allocates 180 seconds to each of two serial Roots cannot fit a single 180-second enclosing reservation even before mandatory positive overhead. That refutes that invoice, not every potentially faster complete implementation. The selected OS profile's inherited 256 MiB address-space cap must also be accounted for separately from the 1 GiB sampled-memory ceiling; a child cannot assume that requesting the latter removes a lower inherited limit. + +The six supplied records resolve the exact input-access gap reported by the completed Pro source review. Historical census/model conclusions retain their original context. The next check must bind every required workload operation to an exact source, mode, charging owner, multiplicity, oracle, branch/lifetime and justified resource bound. Unknown terms prevent a complete bill, and a static bill does not establish actual normal or optimized fit. No target process, unchanged control, compiler, native action or scientific run was launched for this contribution. diff --git a/research/h25-resource-contract-readable-inputs/REUSE-DECISIONS.json b/research/h25-resource-contract-readable-inputs/REUSE-DECISIONS.json new file mode 100644 index 0000000000..8de9528982 --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/REUSE-DECISIONS.json @@ -0,0 +1,232 @@ +{ + "schema": "resource-plan-reuse-decisions-v1", + "canonical_main": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "scope": "Task-bound current PR source/dependency reconciliation; metadata-only where explicitly marked. No complete bill, fit or global absence claim.", + "search_coverage": [ + { + "query": "repo:CrocSwap/integer-mult-bounds is:pr \"H25\" \"resource\"", + "total": 15, + "fetched": 15, + "page_size": 100, + "pages": 1, + "incomplete_results": false, + "all_states": true, + "all_authors": true + }, + { + "query": "repo:CrocSwap/integer-mult-bounds is:pr \"H25\" \"full-fit\"", + "total": 3, + "fetched": 3, + "page_size": 100, + "pages": 1, + "incomplete_results": false, + "all_states": true, + "all_authors": true + }, + { + "query": "repo:CrocSwap/integer-mult-bounds is:pr \"full_driver\"", + "total": 0, + "fetched": 0, + "page_size": 100, + "pages": 1, + "incomplete_results": false, + "all_states": true, + "all_authors": true + }, + { + "query": "repo:CrocSwap/integer-mult-bounds is:pr \"production_issuer\"", + "total": 0, + "fetched": 0, + "page_size": 100, + "pages": 1, + "incomplete_results": false, + "all_states": true, + "all_authors": true + }, + { + "query": "repo:CrocSwap/integer-mult-bounds is:pr \"parent_authority\"", + "total": 0, + "fetched": 0, + "page_size": 100, + "pages": 1, + "incomplete_results": false, + "all_states": true, + "all_authors": true + } + ], + "reviewed_PRs": [ + { + "number": 6752, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6752", + "head": "57cd3615df4c7ada2300ba7295d410ba705c9280", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Archive complete source payload assembly and independent readback", + "decision": "reuse", + "reason": "Accepted complete source assembly and per-path readback; no reconstruction or unchanged constructor-control rerun. This archive does not price or execute the remaining workload.", + "source_inspection": "Accepted local export/provenance and full current changed-file inventory" + }, + { + "number": 6744, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6744", + "head": "1ac58a84b725bd6f17eec66727edc877c49c7e66", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Expose adopted H25 full callers and original criteria as readable text", + "decision": "reuse", + "reason": "Exact readable distinct full baseline/candidate and original criteria. Full candidate directly rejects optimized scientific calls; body hashes remain distinct.", + "source_inspection": "Actual candidate body at exact head" + }, + { + "number": 6588, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6588", + "head": "ff7df8391c3bb3f5518ce43682ba4c1e41380e3e", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Prepare source-bound full callers with separate execution-mode plans", + "decision": "adapt", + "reason": "Retain genuine caller ownership/error ordering and full scientific receiver. The unit-control path cannot by itself satisfy _refresh_mode's complete-family predicate. That later reachability condition must not automatically be imposed on static billing.", + "source_inspection": "Actual selected orchestrator, unit receiver and full receiver bodies at exact head" + }, + { + "number": 6715, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6715", + "head": "dc34598c22e2ef43ae7e11fc1d8c14de3915cf89", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Archive adopted H25 source graph and frozen selection", + "decision": "reuse", + "reason": "Exact adopted 71 role recipes and 100 command-DATA records; source roles, command records, actual process forest and original controls remain distinct domains.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6736, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6736", + "head": "0f2a86fa9ef0daf760b77c662a5b762e17848598", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Complete H25 automatic-retention source contract", + "decision": "adapt", + "reason": "Retain accepted retention mechanisms and selected snapshot_round/assess_round/validate_opening_binding owner route. Complete workload bindings/current runtime inputs remain separate.", + "source_inspection": "Actual selected funding and owner source at exact head" + }, + { + "number": 6709, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6709", + "head": "24417a34746985dd110d70a42b2b863b96963c12", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Implement fixed manual financial meter and once-only own settlement source", + "decision": "review-only", + "reason": "Manual financial namespace and once-only settlement differ from the selected retention production route. No automatic dependency or replacement.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6711, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6711", + "head": "b505c6cf6121d1fc12cfa4baf3093305dae0ba07", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Add bootstrap acquisition driver and retain the HEAD_ABSENT diagnostic", + "decision": "review-only", + "reason": "Historical HEAD_ABSENT diagnostic belongs to a different financial namespace; does not prove selected production owner absence.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6732, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6732", + "head": "dd058d2990d3a98692553018387ec19eaf474b42", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Record finite GNU-time source contract and readable retention inputs", + "decision": "reuse", + "reason": "Finite GNU-time source parsing/retention boundaries; no transfer to complete runtime/whole-cost qualification without exact command/context binding.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6029, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6029", + "head": "e05aad954689d0ee21baff19b4674f1fcb2e838f", + "state": "closed", + "merged": true, + "author": "Clear1nsight", + "title": "Reduce complete H25 bookkeeping time by 21%", + "decision": "reuse", + "reason": "Fixed completed historical baseline and original literal scientific equality/controls; its older baseline comparison is not a new gain.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6339, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6339", + "head": "608ad23adc6c01264c8195daf7f18e29c17464a7", + "state": "closed", + "merged": true, + "author": "unpaidmoon", + "title": "Cursor/h25 g12 identity cleanup 5d9d", + "decision": "review-only", + "reason": "Primary-preserving known-close predecessor. Preserve source/lifetime assumptions and regression history if actual affected code is changed.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6346, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6346", + "head": "abff67b31fa781e950c82d95eccb6f168950943c", + "state": "open", + "merged": false, + "author": "Clear1nsight", + "title": "Repair bounded G12 custody cleanup and publication-size checks", + "decision": "review-only", + "reason": "Bounded custody cleanup and publication-size controls; no universal pre-catch guarantee.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6745, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6745", + "head": "50027f6de434a8d936871a1b3f776f04d47cd3e2", + "state": "open", + "merged": false, + "author": "ToikY", + "title": "research: audit guard-passing direct compiler invoice faults", + "decision": "not relevant", + "reason": "Other contributor's actual integer compile_counts invoice-fault audit; unrelated to H25 runtime/action billing.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6751, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6751", + "head": "5927ac1aa8aa9914c025e6b9e3ecf37e1f8daa0e", + "state": "open", + "merged": false, + "author": "ToikY", + "title": "research: review literal retained-record inverse and caller guards", + "decision": "not relevant", + "reason": "Other contributor's literal retained-record inverse/caller guard review for PR6546; different mathematical object.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + }, + { + "number": 6754, + "url": "https://github.com/CrocSwap/integer-mult-bounds/pull/6754", + "head": "97dfa98b90982da88945f17dfaffed3e5f3f6991", + "state": "open", + "merged": false, + "author": "ToikY", + "title": "Review causal fiber certificate and retained capacity", + "decision": "not relevant", + "reason": "Other contributor's conditional causal recovery-capacity certificate; does not bind H25 process/resource effects.", + "source_inspection": "Named public metadata/source lineage; no new complete code audit claimed" + } + ], + "gaps": [ + "The selected production carrier still names two finite-prefix jobs; a complete action projection and bounds remain required.", + "Newly readable historical records retain their prior negative/conditional scope.", + "Actual runtime and complete mode-fit evidence remain unexecuted." + ] +} diff --git a/research/h25-resource-contract-readable-inputs/SHA256SUMS b/research/h25-resource-contract-readable-inputs/SHA256SUMS new file mode 100644 index 0000000000..d92175e56a --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/SHA256SUMS @@ -0,0 +1,15 @@ +705fd4d6451a31d36b3df7de96f83f30ac976c9b4a6d1e51671d8e2f33e2d0da .gitattributes +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE-APACHE-2.0.txt +3b2f81fe21d181c499c59a256c8e1968455d6689d269aa85373bfb6af41da3bf LICENSE-CPYTHON.txt +14295e7e30a4b3ca490d26f2a4d49ec4b54206d4bcb687f71b651225595eed4e MANIFEST.json +327fcdce33b509f5773c77f1a8d54ea8c650e9f42cb780810d0608fe5e715c1b PREDECESSOR-NOTICE.md +4cda22bfb87b3572d85de41e69bfbd7c49c260558c15ab9902a1c9aa941dbd4f PROVENANCE.json +2562cdcdd0938e79c88eb64da4843dd53a0f700a88c9036c94b17de72b20792c README.md +4c07436b7d48e71382e07857856755ab821d84c3dbc148fd968b90060891d0ad RECONCILIATION.md +edacafc0244e111a36268b0969673aec3dd3ccf468f354aa746760d36f5d583b REUSE-DECISIONS.json +61109d429c4d78df3ec55e65a5c4879c58342c49a8ac4fe30f3892ecc117570d bill-and-resource.json +f17ac66cf3c0d239bb62fbd918d7190321dbc4195bc58f8fcf492631509aabea control-union-census-index.json +18679fd1eb6ae99c4b375756511427c26718f77674c2d8fcc490e25ceb47cba5 data-adapters.py.txt +bdf68ff81d29208acbdcfdb628813431ab3a14313f8048f09d301249a17a1468 model-fit-dispositions.json +8cffbacbaf405bb6d062078310baa69ffc38d737acf123c69f9eae25492900dc model-source-fit-review.json +8e9298cfbf44cedd07868dc1624631d7ce73d78c48c4eec1fca15d3640076dab native-packet.py.txt diff --git a/research/h25-resource-contract-readable-inputs/bill-and-resource.json b/research/h25-resource-contract-readable-inputs/bill-and-resource.json new file mode 100644 index 0000000000..5bff5a11ae --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/bill-and-resource.json @@ -0,0 +1,99 @@ +{ + "V4_fixed_source_costs": { + "fit": "OPEN: no wall/CPU/RSS or1GiB fit claim from finite channels or source counts.", + "new_cases": "Six additive independently contextualized cold source controls; role and CLI raw-journal paths separate; four restoration variants.30 declared fault image files plus authoring/inverse/source copies incur full assembly/hash/copy/startup/current-check/traceback/custody cost. No cost hidden by sharing runtime epoch/owner.", + "old_costs": "ALL155/212/24 and43 previous bodies, public V8/native/current-source/caller/Fraction/kernel/trace/ordered output costs retained.", + "per_actual_CLI": "Two3-key raw channels inner+outer, fixed argv_error/outer_retirement_error keys and local A pointer, plus existing P/S/R/common record. Allocated before both arms inside original cleanup scope. Original pre-arm argv pointer retained by identity.", + "per_suite": "Two3-key source-owned raw channels, role_retirement_error and emergency_retirement_error slots. Allocated before _build and active authority. R and J traceback/frames remain retained; original pending/registry disposal unchanged.", + "restoration_path": "Exact old assignment in independent protected try; delivered A catch/disarm/retirement. No production retry or new native primitive.", + "retirement_path": "Constant dictionary writes/selects and raw caller-slot transfer/ACK; same original retire/disarm counts and one-shot native close. Optional journal remains direct original append; catch raw J added. No native/current-source checks removed." + }, + "V5_delta_costs": { + "CLI": "Started bit in both normal allocated channels: +2 entries. Same original arms/argv/runpy/disarm/retire calls; no journal/current native validation removed.", + "Suite": "Four4-key channels vs predecessor two3-key channels: +2 dicts/+10 entries; five extra fixed error pointer fields. Actual constructor failure before source build uses existing acquisition owner disposition.", + "controls": "3 additional cold actual-main/STOP source cases with original native/factory/finite/current/public controls and cleanup costs.15 distinct fixed fault-image files, source guard/assembly/hash/copy/inverse/qualification costs. Absent-record case includes two actual original metadata-retire attempts and explicit consumed replay negative, no borrowed epoch/owner or saved PASS.", + "errors": "AllP/A/S/R/J objects and traceback/Label/Checks/native-owner/source-graph frames retained through proper parent ownership; fixed storage is not free retained memory.", + "fit": "OPEN; no wall/CPU/RSS/1GiB or funding fit derived from finite metadata count.", + "main": "One4-key outer record, two raw local pointers and one additional existing _EXECUTION dict binding before body. Protected outer catch/current scope checks and fixed R/J handoff writes; original safe outer retirement still attempted." + }, + "actual_new_executions": 0, + "aggregate_peak1GiB_proved": false, + "all_costs_funded": false, + "caps": { + "RSS_bytes": 1073741824, + "Root_seconds": 180, + "global_seconds": 2400 + }, + "finite_retention_object_bound": { + "committed_records": "K<=85196 under pinned expected full-source count, or source-scoped early private retirement at configured metadata capacity with complete public V8 continuation.", + "current_byte_bound": "M_add<=M_fixed+MaxDictIndex(K)+K*(MaxNativeIdInt64+MaxTuple7)+MaxPending1+PeakSourceCompilationTemporaries. Max sizes must be supplied by exact independently qualified allocator/object/runtime profile; current aggregate1GiB fit remains false.", + "new_heap_objects_per_committed_label": "At most one native id integer and one fixed7field record tuple; registry dict table budgeted separately. No new basis dict, vector list or key tuple.", + "retirement_dominance": "Enrollment after original successful store; no metadata survives role-finally/error/public-escape retirement. This policy introduces no weakref/finalizer callback or new ambient lifetime premise.", + "tentative_records": "At most1; original returned Label already on constructor/store stack." + }, + "gain_claimed": false, + "implementation_costs_added": [ + "New bootstrap captures full authority/source helper roots plus explicit EpochLedger class; old prefixes and all loaded source graphs remain current.", + "Per cold_check additionally refresh every registered source product graph; no saved source/native PASS.", + "Actual pre-control driver_entry graph/record is retained even in finite/baseline arms and billed there.", + "Original factory outputs + OriginalGraph + per-product/class/function/lookup/cell/default/attribute snapshots + current typed15 slot chains.", + "Source parsing/deepcopy/compilation and strict whole-source/code inverse reconstruction for12 actual product roles and native bind clone; concurrent old/new AST/code/result/proof graphs retained.", + "Each active original constructor performs current checks before constructor and H; E0 called once; exactly2 ordinary basis/key loads; one pending dict, id key and fixed7-field committed tuple.", + "Every private request has nonce/request dict/registered operand tuple/stage set/entry+exit signature tuples/current source/native checks; old literal key/member/store, native probes, kernel/trace/Fraction checks remain.", + "On unsupported mapping/hooks, public call/reentry, capacity or lifetime end: metadata retirement; subsequent signature view calls real Owner._data and original old validation counters.", + "New guard subclass/base checks, final raw allocation graph, actual caller token and first/secondary/error traceback custody retained.", + "32 additional source-control cases require genuine cold fixtures/raw/oracles/cleanup and full cost ownership; N20 additionally repeats all old155 if separately selected. No testing cost disappears.", + "Whole source packet construction/assembly/validation/copying/startup, full common baseline/control costs and parent recording overhead remain to be paid under unchanged caps." + ], + "logical_quantities": { + "K": "At most1+distinct production node-label cache keys+distinct target keys in closed admitted source; expected reference gives85196. Unknown/current mismatch retires private mode and continues full V8, not science failure/case omission.", + "Q": "Every original verify_labels and forward/reverse verify_role_frames label/residual request; derive from actual source loops/control coverage, not guessed from native call counts.", + "extra_retained_Label_basis_key_bytes": "zero extension beyond original successful-store ownership during closed epoch; tentative1 only while original constructor/store stack already retains Label. Errors/public escape/lastrole clear registry before old owners release.", + "native_counts": "Original238685 complement/59959 Gram expectation and all ordered events remain actual full-output gates.", + "new_peak_bytes": "fixed_bundle_origin_products+dict_index(K)+K*(native_id_integer+7field_record_tuple)+one_tentative_record+old/new concurrent compilation/capture temporaries", + "normalization_count": "Exactly original constructor normalizations; no second echelon/sort or normalized key duplication." + }, + "my_runtime_delta": 0, + "native_helper_obviated": false, + "new_costs": [ + "Versioned authority bundle, OriginalGraph/source AST/code admission, all typed factories/products/class/global ledger preparation/projection/final graph and complete strict inverse/code comparisons.", + "All3 genuine constructor-site contexts, one actual original normalization, two construction-time literal field loads(basis/key), one tentative record, original store-success commit and failure release.", + "K registry id/7field tuple records/dict-index allocation; no basis/key/vector duplication; all strong refs source-scoped by original stores and explicit retirement.", + "Q actual private method/prepare/finish/current source+native checks and private key-component identity checks; original native probes remain at entry/exit.", + "Every public observer/retirement/fallback path including complete V8 continuation after unsupported/context/capacity cases; all actual new counters and metadata outputs.", + "All new N01-N24 and P01-P08 controls and full qualified caller/source/native/resource/output equality; no amortized missing setup or cleanup." + ], + "new_weakref_callbacks": 0, + "parent_snapshot": { + "charged_seconds": 929.8861859179706, + "our_added_target_seconds": 0, + "records": 156 + }, + "resource_terms_added": { + "failure": "First primary and secondary objects, append-only secondary list where possible, uncertainty booleans and retained tracebacks can keep source AST/Label/operand frames alive. No zero extra error-memory or MemoryError equivalence claim.", + "fixed": "Embedded source code/modules, duplicated legacy/new exports, CoreOrigin/Factory/Driver graphs, product proof AST strings, original module bytes and all product code/factory closures; actual allocator profile required.", + "global_fit": "OPEN; no byte/time fit inferred from finite K or source object count.", + "per_label": "K<=85196 extra dictionary index + native id integer + fixed7 tuple. Actual Label/basis/key pointers, no basis/key copy; enrollment follows actual original everything/cache store.", + "per_request": "One nonce, request dict, bounded1/2 operand registration tuple, stage/views set, signature2 tuples and original ticket/authority state; all actual temporary/GC costs included." + }, + "retained_costs": [ + "All genuine cold Root/children/copies/source/native/header/FFI/current ownership checks and actual complete original control union.", + "All public V8 current data reads/_canonical/collision probes/authority/error/callback behavior and all155/212/24/native/reference controls.", + "Every original arithmetic kernel call, ordered rank/complement observation, independent Fraction work, original full outputs/witness/custody and native teardown/late-last." + ], + "runtime_seconds_measured": null, + "schema": "h25-cache-products-source-bill-v5", + "source_contract_resource_policy": "No extra science/child/action cap. Private metadata has declared finite capacity and explicit retirement/V8 continuation; full aggregate resource/funding qualification still required before actual construction/launch. No memory-reduction claim.", + "unchanged_caps": { + "RSS_bytes": 1073741824, + "Root_seconds": 180, + "global_seconds": 2400 + }, + "v3_additive_costs": [ + "Complete arm/CLI protected helper and source-owned common cleanup record in both arms; P/S/R objects and all caller/retirement/error frames retained before formatting.", + "Exact native namespace key scan/census/binding and finite phase/serial/error-MRO checks at every current entry, no cached PASS.", + "43 source bodies plus all variant/context expansions; fresh cold ownership per class/instance/CLI variant. Body count is not a complete funded command schedule.", + "Fixed Python source control image IO/parsing/hash/cold assembly; actual original arms/disarm/retirement and all native/helper/control/current-profile costs remain.", + "Baseline/private enclosing measurements, all source admissions/inverses/cleanup/custody/parent costs and actual allocator/high-water memory must still be qualified." + ] +} diff --git a/research/h25-resource-contract-readable-inputs/control-union-census-index.json b/research/h25-resource-contract-readable-inputs/control-union-census-index.json new file mode 100644 index 0000000000..8aec416c91 --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/control-union-census-index.json @@ -0,0 +1,499 @@ +{ + "authority_index": { + "path": "control/AGENT-TASK-INDEX-native-fields-v73.json", + "sha256": "22c9c5f6f37b50fa3298f61c4556ace46d69b8fbfaa18614ac4a3e10361a42c5" + }, + "component_bodyless151": [ + "epoch-old/O01", + "epoch-old/O02", + "epoch-v4/C01", + "epoch-v4/C02", + "epoch-v4/C05", + "epoch-v4/C06", + "epoch-v4/C07", + "epoch-v4/C08", + "epoch-v4/C09", + "epoch-v4/C10", + "epoch-v4/C11", + "epoch-v4/C12", + "epoch-v5/V5-C01", + "epoch-v5/V5-C03", + "epoch-writer/W02", + "epoch-writer/W06", + "epoch-writer/W07", + "epoch-writer/W08", + "epoch-writer/W09", + "epoch-writer/W10", + "epoch-writer/W12", + "parent-old/P01", + "parent-old/P03", + "parent-old/P04", + "parent-old/P06", + "parent-old/P07", + "parent-old/P08", + "parent-old/P09", + "parent-old/P10", + "parent-old/P11", + "parent-old/P12", + "parent-old/P14", + "parent-old/P15", + "parent-old/P16", + "parent-old/P17", + "parent-old/P18", + "parent-v2/B01-02", + "parent-v2/B01-05", + "parent-v2/B01-06", + "parent-v2/B01-08", + "parent-v2/B01-09", + "parent-v2/B01-12", + "parent-v2/B01-13", + "parent-v2/B02-03", + "parent-v2/B02-04", + "parent-v2/SELECT-01", + "variant/V02", + "variant/V03", + "variant/V04", + "variant/V05", + "variant/V06", + "variant/V07", + "variant/V08", + "variant/V09", + "variant/V10", + "variant/V11", + "variant/V12", + "variant/V13", + "variant/V14", + "variant/V19", + "variant/V20", + "variant/V21", + "variant/V23", + "variant/V24", + "variant/V25", + "variant/V31", + "policy-old/P01", + "policy-old/P02", + "policy-old/P03", + "policy-old/P04", + "policy-old/P05", + "policy-old/P06", + "policy-old/P07", + "policy-old/P08", + "policy-old/P09", + "policy-old/P10", + "policy-old/P11", + "policy-old/P12", + "policy-old/P13", + "policy-old/P14", + "policy-old/P15", + "policy-old/P16", + "policy-old/P17", + "policy-old/P18", + "policy-old/P19", + "policy-old/P20", + "policy-old/P21", + "policy-old/P22", + "policy-old/P23", + "policy-old/P24", + "policy-v2/P25", + "policy-v2/P26", + "policy-v2/P27", + "policy-v2/P28", + "policy-v2/P29", + "policy-v2/P30", + "policy-v2/P31", + "policy-v2/P32", + "policy-v2/P33", + "policy-v2/P34", + "policy-v2/P35", + "policy-domain/D02", + "policy-domain/D03", + "policy-domain/D04", + "policy-domain/D05", + "policy-domain/D06", + "policy-domain/D07", + "policy-domain/D08", + "policy-domain/D09", + "policy-domain/D10", + "policy-domain/D11", + "policy-domain/D12", + "policy-domain/D13", + "policy-domain/D14", + "policy-domain/D15", + "policy-domain/D16", + "policy-domain/D17", + "policy-domain/D18", + "policy-domain/D19", + "policy-domain/D20", + "policy-b01/B01-P01", + "policy-b01/B01-N01", + "policy-b01/B01-N04", + "policy-b01/B01-N05", + "policy-b01/B01-N06", + "replay/RP02", + "replay/RP03", + "replay/RP04", + "replay/RP06", + "replay/RP07", + "replay/RP08", + "replay/RP09", + "replay/RP10", + "replay/RP11", + "replay/RP12", + "replay/RP13", + "replay/RP14", + "replay/RP15", + "replay/RP16", + "replay/RP17", + "replay/RP18", + "replay/RP19", + "replay/RP20", + "replay/RP24", + "replay/RP25", + "replay/RP26", + "replay/RP27", + "replay/RP28", + "replay/RP30", + "replay/RP31", + "replay/RP32" + ], + "component_partial61": [ + "epoch-old/O03", + "epoch-old/O04", + "epoch-old/O05", + "epoch-old/O06", + "epoch-old/O07", + "epoch-v4/C03", + "epoch-v4/C04", + "epoch-v5/V5-C02", + "epoch-v5/V5-C04", + "epoch-v5/V5-C05", + "epoch-journal/J01", + "epoch-journal/J02", + "epoch-journal/J03", + "epoch-journal/J04", + "epoch-journal/J05", + "epoch-journal/J06", + "epoch-journal/J07", + "epoch-journal/J08", + "epoch-journal/J09", + "epoch-journal/J10", + "epoch-writer/W01", + "epoch-writer/W03", + "epoch-writer/W04", + "epoch-writer/W05", + "epoch-writer/W11", + "parent-old/P02", + "parent-old/P05", + "parent-old/P13", + "parent-v2/B01-01", + "parent-v2/B01-03", + "parent-v2/B01-04", + "parent-v2/B01-07", + "parent-v2/B01-10", + "parent-v2/B01-11", + "parent-v2/B01-14", + "parent-v2/B02-01", + "parent-v2/B02-02", + "parent-v2/B02-05", + "variant/V01", + "variant/V15", + "variant/V16", + "variant/V17", + "variant/V18", + "variant/V22", + "variant/V26", + "variant/V27", + "variant/V28", + "variant/V29", + "variant/V30", + "variant/V32", + "variant/V33", + "policy-v2/P36", + "policy-domain/D01", + "policy-b01/B01-N02", + "policy-b01/B01-N03", + "replay/RP01", + "replay/RP05", + "replay/RP21", + "replay/RP22", + "replay/RP23", + "replay/RP29" + ], + "counts": { + "bodyless": 151, + "complete_finite": false, + "component_families": 212, + "component_partial_families": 61, + "component_units": 86, + "fullscience": 0, + "gain": false, + "group_spec_counts": { + "elf34_gap_obligations": 34, + "elf41_inputs": 41, + "fixture77": 77, + "full202": 202, + "header_builder_v1": 34, + "header_builder_v2": 23, + "header_builder_v3": 40, + "header_collector": 48, + "header_custody_v3": 116, + "header_host": 50, + "header_role_v4": 14, + "header_role_v5": 73, + "header_role_v6": 21, + "model99": 99, + "model_prior_faultCLI": 9, + "model_raw_v4": 6, + "model_zero23": 23, + "native24": 24, + "orchestration_replay32": 32, + "orchestration_v2": 59, + "orchestration_v3": 17 + }, + "new_field_builds": 0 + }, + "data_readback": { + "bytes": 103993, + "path": "outputs/h25-data-handling-20261028/review/full-control-union-feasibility-v1/READBACK.json", + "sha256": "6a3a91967f642d61e6869540db4e1d8b70c681c93dabaf41f2d60049190b63b6" + }, + "decision": "SOURCE_ROUTE_INCOMPLETE_NO_EXECUTION_OR_FIT_OR_GAIN", + "detailed_inventory": { + "bytes": 2288386, + "path": "outputs/h25-data-handling-20261028/review/full-control-union-feasibility-v1/INVENTORY.json", + "sha256": "2e30f6d2b62edc0e02b8a8721c331a7e989cb5ac569bf3aeaa3300af4d820322" + }, + "groups": { + "elf34_gap_obligations": { + "count": 34, + "pointer": "/groups/elf34_gap_obligations", + "source_documents": [ + "integration-drafts/native-fields-v1/controls/ELF-34-GAP-MATRIX-v3.json" + ] + }, + "elf41_inputs": { + "count": 41, + "pointer": "/groups/elf41_inputs", + "source_documents": [ + "areas/field-elf-gap-inputs-v1/COST-BILL.json" + ] + }, + "fixture77": { + "count": 77, + "pointer": "/groups/fixture77", + "source_documents": [ + "areas/field-history-fixture-elf-v2/FIXED-CONTROL-VECTORS.json" + ] + }, + "full202": { + "count": 202, + "pointer": "/groups/full202", + "source_documents": [ + "integration-drafts/native-fields-v1/controls/ELF-202-COVERAGE-v2.json" + ] + }, + "header_builder_v1": { + "count": 34, + "pointer": "/groups/header_builder_v1", + "source_documents": [ + "areas/field-header-profile-builder-v1/ADDITIVE-CONTROL-RECIPES.json" + ] + }, + "header_builder_v2": { + "count": 23, + "pointer": "/groups/header_builder_v2", + "source_documents": [ + "areas/field-header-profile-builder-v2/ADDITIVE-CONTROL-RECIPES.json" + ] + }, + "header_builder_v3": { + "count": 40, + "pointer": "/groups/header_builder_v3", + "source_documents": [ + "areas/field-header-profile-builder-v3/ADDITIVE-CONTROL-RECIPES.json" + ] + }, + "header_collector": { + "count": 48, + "pointer": "/groups/header_collector", + "source_documents": [ + "areas/field-header-metadata-collector-v2/INHERITED-COLLECTOR-SPECIFICATIONS-v1.json" + ] + }, + "header_custody_v3": { + "count": 116, + "pointer": "/groups/header_custody_v3", + "source_documents": [ + "areas/field-header-metadata-collector-v2/INHERITED-CUSTODY-RECIPES-v3.json" + ] + }, + "header_host": { + "count": 50, + "pointer": "/groups/header_host", + "source_documents": [ + "areas/field-header-metadata-collector-v2/ADDITIVE-HOST-CONSUMER-SPECIFICATIONS.json" + ] + }, + "header_role_v4": { + "count": 14, + "pointer": "/groups/header_role_v4", + "source_documents": [ + "areas/field-header-role-profile-v6/preserved-v5/PRESERVED-V4-CONTROL-RECIPES.json" + ] + }, + "header_role_v5": { + "count": 73, + "pointer": "/groups/header_role_v5", + "source_documents": [ + "areas/field-header-role-profile-v6/preserved-v5/ADDITIVE-CONTROL-RECIPES.json" + ] + }, + "header_role_v6": { + "count": 21, + "pointer": "/groups/header_role_v6", + "source_documents": [ + "areas/field-header-role-profile-v6/ADDITIVE-CONTROL-RECIPES.json" + ] + }, + "model99": { + "count": 99, + "pointer": "/groups/model99", + "source_documents": [ + "areas/field-elf-gap-model-harness-v4/CASE-CONTINUITY-V4.json" + ] + }, + "model_prior_faultCLI": { + "count": 9, + "pointer": "/groups/model_prior_faultCLI", + "source_documents": [ + "areas/field-elf-gap-model-harness-v4/ADDITIVE-REPAIR-CONTROLS.json" + ] + }, + "model_raw_v4": { + "count": 6, + "pointer": "/groups/model_raw_v4", + "source_documents": [ + "areas/field-elf-gap-model-harness-v4/SOURCE-CONTROL-OBLIGATIONS-V4.json" + ] + }, + "model_zero23": { + "count": 23, + "pointer": "/groups/model_zero23", + "source_documents": [ + "areas/field-elf-gap-model-harness-v4/ZERO-SOURCE-CONTROL-OBLIGATIONS.json" + ] + }, + "native24": { + "count": 24, + "pointer": "/groups/native24", + "source_documents": [ + "integration-drafts/native-fields-v1/controls/REQUIRED-GUARDED-CASES-v1.json" + ] + }, + "orchestration_replay32": { + "count": 32, + "pointer": "/groups/orchestration_replay32", + "source_documents": [ + "areas/field-parent-orchestration-v3/PREDECESSOR-PRESERVED-REPLAY-CONTROLS.json" + ] + }, + "orchestration_v2": { + "count": 59, + "pointer": "/groups/orchestration_v2", + "source_documents": [ + "areas/field-parent-orchestration-v3/PREDECESSOR-ADDITIVE-CONTROL-SPECS.json" + ] + }, + "orchestration_v3": { + "count": 17, + "pointer": "/groups/orchestration_v3", + "source_documents": [ + "areas/field-parent-orchestration-v3/ADDITIVE-CONTROL-SPECS.json" + ] + } + }, + "json_pointers": { + "batching_contract": "/reviewed_batching_route_requirements", + "caller_export_guard_gates": "/required_caller_export_guard_gates", + "components": "/component212", + "original_control_source_IDs": "/original_source_groups", + "original_unexpanded_names": "/unexpanded_original_requirement_identities", + "precise_trust_dispositions": "/trust_reachability_dispositions", + "source_cost_bills": "/cost_sources", + "source_witnesses": "/source_witnesses" + }, + "new_findings": [ + "Current unit receipt path requiresFalse scope flags but finite transition requiresTrue; complete-family driver/aggregator absent.", + "Conditional existing one-action/unit strategy:26fixed+86current+151atleast1new=263>256modeactionlimit, excludes other additions.", + "V3 orchestration public independent review rejects B07 stale runtime inverse templates and B08 typedJSONexpansiondomain.", + "V3 cost/open gate bill still references old67/44/168component generation; newer86/61/151not integrated.", + "OriginalE04andseparatelegacyE04areindependentpaidlanes;99not98." + ], + "next_safe_actions": [ + "Exact public source resolution for three original names.", + "Source-only B07/B08,V15 and V4 RAW successors/reviews.", + "Source-owned full-scenario/caller aggregation and safe sequential batching contract preserving separate real child processes, all source/independent/warm-cold checks and costs.", + "Complete exact physical delivery/ownership/resource/reservation feasibility before any parent execution." + ], + "no_dedup_or_waiver": true, + "original_source_group_case_counts": { + "close_model_controls_v5": 2, + "collector_controls_v1": 12, + "elf_controls_v1": 65, + "elf_extended_controls_v2": 110, + "loader_model_controls_v1": 33, + "loader_model_controls_v3": 53, + "native_field_controls_v1": 52, + "projection_model_controls_v5": 11, + "provider_controls_v1": 26, + "transport_controls_v1": 14 + }, + "receipt_scope": { + "R3": "99 case model branch normal/O independently accepted1c44ed; legacy/H02 raw secondary identity limitation; no V4 PASS transfer", + "fullscience": 0, + "gain": false, + "new_field_builds": 0 + }, + "report": { + "bytes": 15181, + "path": "outputs/h25-data-handling-20261028/review/full-control-union-feasibility-v1/REPORT.md", + "sha256": "5e8c7488550fe39c8b0954fd443a0a530da734c4d8a4ec083decf116dc940826" + }, + "resource_screen": { + "all151_missing_and_partial_scenarios_costs_additional": true, + "both_modes": { + "builds": 254, + "root_processes": 310 + }, + "cap_seconds": 2400, + "charged_seconds": 843.6901823099704, + "conditional_action_capacity_obstruction": { + "conclusion": "Same one-action/unit strategy cannot fit max256 even before other additions; changing aggregation/source bounds requires independent source/cost approval and cannot omit checks.", + "conditional_minimum": 263, + "current_max_actions_per_mode": 256, + "current_one_action_per_86unit_rows": 86, + "if_at_least_one_new_unit_per_missing_family": 151, + "required_fixed_rows_per_mode": 26 + }, + "known_component_and_core_lower_bound_per_mode": { + "builds": 127, + "root_processes": 155 + }, + "no_native_failure_PASS_from_source_recipe": true, + "remaining_seconds": 1556.3098176900296, + "root_seconds": 180, + "rss_bytes": 1073741824, + "time_cpu_rss_io_and_fit": null + }, + "schema": "h25-small-control-universe-index-v1", + "source_manifest": { + "bytes": 26374, + "path": "outputs/h25-data-handling-20261028/review/full-control-union-feasibility-v1/SOURCE-PINS.json", + "sha256": "4f0ddc15e501178aa3551c5cd28bba6b2c93309424265fab1f27c7651b77d51b" + }, + "unresolved_original_names": [ + "original24", + "R01-R10", + "C01-C10-G0" + ] +} diff --git a/research/h25-resource-contract-readable-inputs/data-adapters.py.txt b/research/h25-resource-contract-readable-inputs/data-adapters.py.txt new file mode 100644 index 0000000000..33a9042bfc --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/data-adapters.py.txt @@ -0,0 +1,1664 @@ +"""Source-only draft for parent-reviewed data-handling integration. + +Installed only by the parent into a new immutable stage. Original adapters and +reference modules are independent. Every helper/control import and scientific +operation below runs only inside the parent-owned serial guarded process. +""" +import hashlib +import json +import os +from pathlib import Path, PurePosixPath +import stat +import sys +from types import ModuleType + +import adapters +import native_packet + +# Final V8 author census is configured only after the source packet freezes. +EXPECTED_CACHE_TRANSCRIPT_RECORDS = 155 +EXPECTED_V7_CONSUMER_CASES = ('source-before-native', 'source-before-trace', 'builtin-before-native', 'builtin-shadow-and-key-cleanup', 'row-calling-environment-full-and-light', 'row-key-first-error-and-cleanup', 'actual-row-native-observation', 'cold-_code_named-code', 'cold-_code_named-defaults', 'cold-_code_named-globals', 'cold-_check_factory_environment-code', 'cold-_check_factory_environment-defaults', 'cold-_check_factory_environment-globals', 'final-class-__init__-code', 'final-class-__init__-defaults', 'final-class-__init__-closure', 'final-class-check-code', 'final-class-check-defaults', 'final-class-check-closure', 'final-class-check_backend-code', 'final-class-check_backend-defaults', 'final-class-check_backend-closure', 'unregistered-final-subclass', 'restored-final-class-binds') +EXPECTED_V8_CALLER_CASES = ('cold-dispatcher-code', 'cold-dispatcher-defaults', 'cold-dispatcher-kwdefaults', 'cold-dispatcher-closure', 'runtime-dispatcher-code', 'runtime-dispatcher-defaults', 'runtime-dispatcher-kwdefaults', 'runtime-dispatcher-closure', 'runtime-collector-code', 'runtime-collector-defaults', 'runtime-collector-kwdefaults', 'runtime-collector-closure') +EXPECTED_AUTHORITY_CONTROL_CASES = ('A1-authority-entry-and-helper-fields', 'A2-caller-dispatcher-fields', 'A3-every-owned-module-helper', 'A4-registered-product-methods-and-closure-helpers', 'A5-foreign-key-failure-disposal', 'A6-runtime-child-dispatcher-and-helper-fields') + +DATA_CONTROL_STATUS = { + 'construction': 'PASS', + 'serialization': 'SERIALIZATION_FINITE_PASS', + 'cache_validity': 'PASS', + 'cold_authority': 'PASS', + 'rank_metadata': 'AREA6_METADATA_HELPER_CONTROLS_PASS', + 'rank_native': 'NATIVE_OBSERVATION_DIFFERENTIAL_CONTROLS_PASS', + 'inventory': 'INVENTORY_DIFFERENTIAL_CONTROLS_PASS', + 'combined_composition': 'BOUNDED_COMBINED_COMPOSITION_PASS', + 'cache_reference_v3': 'PASS', + 'native_initial_tcb': 'NATIVE_INITIAL_TCB_CONTROLS_PASS', + **native_packet.CONTROL_STATUS, +} +_MODULES = ( + ('construction', 'areas/construction/construction_v2.py', '_h25_data_construction'), + ('construction_controls', 'areas/construction/construction_controls_v2.py', '_h25_data_construction_controls'), + ('serializer', 'areas/serialization/bounded_serialization.py', 'bounded_serialization'), + ('serialization_controls', 'areas/serialization/serialization_controls.py', '_h25_data_serialization_controls'), + ('cache', 'areas/cache-validity/cache_contract_v8.py', '_h25_data_cache'), + ('cache_controls', 'areas/cache-validity/cache_controls_v8.py', '_h25_data_cache_controls'), + ('cold_authority_controls', 'areas/cache-validity/cold_authority_controls_v7.py', '_h25_data_cold_authority_controls'), + ('cache_reference', 'areas/cache-validity/cache_contract_v3.py', '_h25_data_cache_reference'), + ('cache_reference_controls', 'areas/cache-validity/cache_controls_v3.py', '_h25_data_cache_reference_controls'), + ('rows', 'integration/row_interner_v3.py', '_h25_data_rows'), + ('row_derivation', 'integration/derive_row_bind_v3.py', '_h25_data_private_row_derivation'), + ('digests', 'areas/hashing-traces/digest_snapshot.py', '_h25_data_digests'), + ('metadata_controls', 'areas/hashing-traces/metadata_controls.py', '_h25_data_metadata_controls'), + ('native_controls', 'areas/hashing-traces/native_observation_controls.py', '_h25_data_native_controls'), + ('inventory_controls', 'areas/hashing-traces/inventory_controls.py', '_h25_data_inventory_controls'), + ('derive_backend', 'integration/derive_backend.py', '_h25_data_backend_derivation'), + ('composition_controls', 'integration/composition_controls.py', '_h25_data_composition_controls'), +) + +_CONTROL_CONTRACT = {'cache_counts': {'binding_rejections': 12, + 'cases': 29, + 'requests': 71, + 'source_admission_rejections': 2, + 'tamper_rejections': 1, + 'unsupported_rejections': 2}, + 'construction_normal_names': ['complete-constructor-h8', + 'complete-constructor-h9', + 'exact-add-0', + 'exact-add-1', + 'exact-add-2', + 'exact-add-3', + 'exact-add-4', + 'exact-add-5', + 'exact-add-6', + 'exact-add-7', + 'exact-add-8', + 'exact-add-9', + 'exact-add-10', + 'overlap-assertion-matching-mode', + 'negative-index', + 'index-outside', + 'none-index', + 'float-index', + 'bool-index', + 'unhashable-kind', + 'mask-callback', + 'index-callback', + 'kind-callback', + 'support-callback', + 'lookup-callback', + 'unarmed-construction-remains-incremental', + 'retired-complete-index-and-private-snapshot', + 'resumed-run-loses-frozen-tail-qualification', + 'resumed-duplicate-restores-same-dictionary', + 'reinitialized-run-loses-qualification-h8', + 'retired-object-literal-reinitialization-h8', + 'reinitialized-run-loses-qualification-h9', + 'retired-object-literal-reinitialization-h9', + 'reinitialized-run-loses-qualification-h7', + 'retired-object-literal-reinitialization-h7', + 'resumption-restores-original-index-after-graph-edits', + 'lookup-entry-mutation', + 'lookup-replacement', + 'snapshot-binding', + 'double-finalize', + 'wrong-finalizer', + 'factory-rejects-changed-original-add', + 'factory-rejects-source-builtin-shadow', + 'seal-rejects-late-add-replacement', + 'scope-cannot-be-rearmed', + 'hook-bearing-constructor-trace', + 'hook-bearing-constructor-profile', + 'hook-bearing-constructor-gc', + 'hook-bearing-constructor-thread', + 'hook-bearing-constructor-signal', + 'hook-bearing-constructor-monitoring', + 'invalid-dimension-original-assertion', + 'malformed-complete-index-before-clear', + 'generic-subclass-add-fallback', + 'factory-rejects-original-defaults', + 'factory-rejects-original-code', + 'factory-rejects-original-helper', + 'factory-rejects-original-descriptor', + 'owner-rejects-changed-wrapper-defaults', + 'public-total-helper-restores-before-add', + 'p1-original-authentication-and-final-wrapper-composition'], + 'construction_optimized_names': ['complete-constructor-h8', + 'complete-constructor-h9', + 'exact-add-0', + 'exact-add-1', + 'exact-add-2', + 'exact-add-3', + 'exact-add-4', + 'exact-add-5', + 'exact-add-6', + 'exact-add-7', + 'exact-add-8', + 'exact-add-9', + 'exact-add-10', + 'overlap-assertion-matching-mode', + 'negative-index', + 'index-outside', + 'none-index', + 'float-index', + 'bool-index', + 'unhashable-kind', + 'mask-callback', + 'index-callback', + 'kind-callback', + 'support-callback', + 'lookup-callback', + 'unarmed-construction-remains-incremental', + 'retired-complete-index-and-private-snapshot', + 'resumed-run-loses-frozen-tail-qualification', + 'resumed-duplicate-restores-same-dictionary', + 'reinitialized-run-loses-qualification-h8', + 'retired-object-literal-reinitialization-h8', + 'reinitialized-run-loses-qualification-h9', + 'retired-object-literal-reinitialization-h9', + 'reinitialized-run-loses-qualification-h7', + 'retired-object-literal-reinitialization-h7', + 'resumption-restores-original-index-after-graph-edits', + 'lookup-entry-mutation', + 'lookup-replacement', + 'snapshot-binding', + 'double-finalize', + 'wrong-finalizer', + 'factory-rejects-changed-original-add', + 'factory-rejects-source-builtin-shadow', + 'seal-rejects-late-add-replacement', + 'scope-cannot-be-rearmed', + 'hook-bearing-constructor-trace', + 'hook-bearing-constructor-profile', + 'hook-bearing-constructor-gc', + 'hook-bearing-constructor-thread', + 'hook-bearing-constructor-signal', + 'hook-bearing-constructor-monitoring', + 'malformed-complete-index-before-clear', + 'generic-subclass-add-fallback', + 'factory-rejects-original-defaults', + 'factory-rejects-original-code', + 'factory-rejects-original-helper', + 'factory-rejects-original-descriptor', + 'owner-rejects-changed-wrapper-defaults', + 'public-total-helper-restores-before-add', + 'p1-original-authentication-and-final-wrapper-composition'], + 'inventory_cases': [['valid', 'value'], + ['list-pins', 'value'], + ['wrong-digest', 'error'], + ['missing', 'error'], + ['extra', 'error'], + ['extra-nonexact', 'value'], + ['symlink', 'error'], + ['root-symlink', 'error'], + ['changed-mode', 'value'], + ['fresh-call-after-mutation', 'error'], + ['restored', 'value']], + 'rank_guard_mutation_names': ['__code__', + '__defaults__', + '__kwdefaults__', + '_LEN', + '_GET', + '_MAX_ENTRIES', + 'make_row_interner', + 'make_runtime_guard', + 'builtin/len', + 'builtin/int', + 'cell/exact_int', + 'cell/exact_tuple', + 'cell/exact_type', + 'cell/get', + 'cell/length', + 'cell/max_entries', + 'cell/max_rows', + 'cell/max_value', + 'cell/missing', + 'cell/table', + 'empty-cell'], + 'serialization_names': ['ordinary', + 'empty', + 'rows-1', + 'rows-1023', + 'rows-1024', + 'rows-1025', + 'rows-2048', + 'byte-bound-169', + 'byte-bound-170', + 'byte-bound-171', + 'scalars-unicode-wide', + 'wide-unlimited', + 'wide-digit-error', + 'interned-rank-rows', + 'depth-30', + 'depth-33', + 'circular', + 'callback-list', + 'callback-dict', + 'callback-error', + 'int-subclass', + 'unsupported-object', + 'malformed-result', + 'malformed-witness', + 'malformed-rank', + 'nonstring-supported-keys', + 'expected-result_sha256', + 'expected-exact_witness_sha256', + 'expected-rank_trace_sha256', + 'expected-rank_call_count', + 'expected-rank_distinct_matrix_count', + 'failure-stage_create', + 'failure-stage_open', + 'failure-stage_write', + 'failure-stage_flush', + 'failure-stage_after_close', + 'failure-stage_hash', + 'failure-final_open-result.json', + 'failure-final_write-result.json', + 'failure-final_flush-result.json', + 'failure-final_after_close-result.json', + 'failure-final_open-witness.json', + 'failure-final_write-witness.json', + 'failure-final_flush-witness.json', + 'failure-final_after_close-witness.json', + 'failure-final_open-rank-trace.json', + 'failure-final_write-rank-trace.json', + 'failure-final_flush-rank-trace.json', + 'failure-final_after_close-rank-trace.json', + 'short-final-0', + 'short-final-1', + 'copy-corrupt-content', + 'stage-mutated-size', + 'copy-read-error', + 'copy-hash-error', + 'cleanup-unlink-error', + 'cleanup-rmdir-error', + 'primary-plus-close-error', + 'primary-plus-manifest-error', + 'drift-reference_global', + 'drift-json_default', + 'drift-expected_value', + 'drift-effective_builtin', + 'drift-json_global_shadow', + 'drift-keyword_default', + 'exit-json-drift', + 'fallback-exit-json-drift', + 'existing-finals', + 'state-mutation-between-writes', + 'path-subclass-fallback']} + + +def need(condition, message): + if not condition: + raise RuntimeError(message) + + +def _relative(name): + need(type(name) is str, 'Stage path must be exact text') + path = PurePosixPath(name) + need(bool(path.parts) and not path.is_absolute() and '..' not in path.parts and + '\\' not in name and path.as_posix() == name, 'Noncanonical stage path: ' + name) + return name + + +def _row(path): + need(path.is_file() and not path.is_symlink(), 'Missing or symlinked data source: ' + str(path)) + hasher = hashlib.sha256() + with path.open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + hasher.update(block) + return {'sha256': hasher.hexdigest(), 'mode': stat.S_IMODE(path.stat().st_mode)} + + +def _manifest(root): + path = root / 'STAGE.json' + need(path.is_file() and not path.is_symlink(), 'Missing regular data stage manifest') + manifest = json.loads(path.read_bytes()) + need(manifest.get('schema') == 'h25-data-handling-immutable-stage-v1' and + type(manifest.get('files')) is dict, 'Wrong immutable data stage contract') + for name in manifest['files']: + _relative(name) + return manifest + + +def custody(root): + """Fresh complete new helper/control/integration source census and hashes.""" + manifest = _manifest(root) + selected = {name for name in manifest['files'] + if (name.startswith(('areas/', 'integration/')) or '/' not in name) + and Path(name).suffix in ('.py', '.c')} + actual = set() + for path in root.iterdir(): + need(not path.is_symlink(), 'Symlink in stage root: ' + str(path)) + if path.is_file() and path.suffix in ('.py', '.c'): + actual.add(path.name) + for directory in (root / 'areas', root / 'integration'): + need(directory.is_dir() and not directory.is_symlink(), 'Missing regular new source directory') + for path in directory.rglob('*'): + need(not path.is_symlink(), 'Symlink in new data source tree: ' + str(path)) + if path.is_file() and path.suffix in ('.py', '.c'): + actual.add(path.relative_to(root).as_posix()) + need(actual == selected, 'Complete new data source census changed') + need({name for _, name, _ in _MODULES} | {'integration/full_driver.py', 'integration/scientific_driver.py', 'integration/data_adapters.py', + 'integration/native_packet.py', 'integration/probe_binding_v3.py', + 'integration/guarded_adapters_v4.py', 'areas/cache-validity/cold_authority_v7.py'} <= selected, + 'Required data-handling source missing from stage') + result = {} + for name in sorted(selected): + observed = _row(root / name) + need(observed == manifest['files'][name], 'New data source custody failed: ' + name) + result[name] = observed + return result + + +def _load(root, relative, name, source_custody): + need(relative in source_custody and _row(root / relative) == source_custody[relative], + 'Fresh data import custody failed: ' + relative) + return adapters.load(root / relative, name) + + +def prepare(root, backend, comparison, extensions, arm, source_custody, packet, *, + authority, cold_caller_descriptor, integration_handles, backend_handle, adapters_handle, setup_handle, + factory_environment, preloaded_cache): + """Both arms load/pay the same complete controls; production installation differs.""" + need(arm in ('baseline', 'candidate'), 'Unsupported data arm') + # Preserve the original preceding field evaluations before source dispatch. + _prepared_backend_source = Path(backend.__file__) + _prepared_comparison_source = Path(comparison.__file__) + _prepared_set_adapter = extensions['set_adapter'] + # BEGIN evaluated dispatch arguments data_adapters:366 + _ca_args = (backend_handle,) + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:366 + # BEGIN caller admission data_adapters:366 + _ca_desc = cold_caller_descriptor + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:366 + _prepared_backend_source_pin = _ca_dispatch(6, *_ca_args, **_ca_kwargs)[2] + state = {'arm': arm, 'enabled': arm == 'candidate', 'controls': {}, + 'construction_binding': None, 'cache_binding': None, 'row_helper': None, + 'writer': None, 'writer_handle': None, 'backend_derivation': None, + 'runtime_before': None, 'runtime_after': None, 'final_receipt': None, + 'backend_source': _prepared_backend_source, + 'comparison_source': _prepared_comparison_source, 'set_adapter': _prepared_set_adapter, + 'native_packet': packet, 'authority': authority, 'authority_handles': {}, + 'cold_caller_descriptor': cold_caller_descriptor, + 'early_authority_handles': tuple(sorted(integration_handles.items())), + 'cold_authority_input_census': None, + 'backend_handle': backend_handle, 'adapters_handle': adapters_handle, + 'setup_handle': setup_handle, 'backend_source_pin': _prepared_backend_source_pin, + 'factory_environment': factory_environment, 'cache_teardown_attempted': False, + 'cache_teardown_receipt': None, 'cache_teardown_stop': None, 'cleanup_errors': []} + state['owned_states'] = [state] + for key, relative, name in _MODULES: + need(relative in source_custody and _row(root / relative) == source_custody[relative], + 'Fresh data authority import custody failed: ' + relative) + if key == 'cache': + need(type(preloaded_cache) is tuple and len(preloaded_cache) == 2, + 'The original early cache module/handle pair is required') + state[key], state['authority_handles'][key] = preloaded_cache + # BEGIN evaluated dispatch arguments data_adapters:389 + _ca_args = (state['authority_handles'][key],) + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:389 + # BEGIN caller admission data_adapters:389 + _ca_desc = cold_caller_descriptor + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:389 + admitted = _ca_dispatch(6, *_ca_args, **_ca_kwargs) + need(admitted[0] is state[key] and admitted[1] == str(root / relative) and + admitted[2] == source_custody[relative]['sha256'], + 'The early cache module differs from the actual immutable stage') + else: + # BEGIN evaluated dispatch arguments data_adapters:394 + _ca_args = (str(root / relative), source_custody[relative]['sha256'], name) + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:394 + # BEGIN caller admission data_adapters:394 + _ca_desc = cold_caller_descriptor + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:394 + state[key], state['authority_handles'][key] = _ca_dispatch(0, *_ca_args, **_ca_kwargs) + return state + + +def isolated_state(prototype, arm): + """Independent mutable scope for bounded controls; code modules may be shared.""" + need(arm in ('baseline', 'candidate'), 'Unsupported isolated data arm') + state = {'arm': arm, 'enabled': arm == 'candidate', 'controls': {}, + 'construction_binding': None, 'cache_binding': None, 'row_helper': None, + 'writer': None, 'writer_handle': None, 'backend_derivation': None, + 'runtime_before': None, 'runtime_after': None, 'final_receipt': None, + 'backend_source': prototype['backend_source'], + 'comparison_source': prototype['comparison_source'], 'set_adapter': prototype['set_adapter']} + state.update({'native_packet': prototype['native_packet'], 'owned_states': prototype['owned_states'], + 'authority': prototype['authority'], 'authority_handles': prototype['authority_handles'], + 'cold_caller_descriptor': prototype['cold_caller_descriptor'], + 'adapters_handle': prototype['adapters_handle'], 'setup_handle': prototype['setup_handle'], + 'backend_source_pin': prototype['backend_source_pin'], 'backend_handle': None, + 'factory_environment': None, + 'cache_teardown_attempted': False, 'cache_teardown_receipt': None, + 'cache_teardown_stop': None, 'cleanup_errors': []}) + state['owned_states'].append(state) + for key, _, _ in _MODULES: + if key in prototype: + state[key] = prototype[key] + return state + + +def require_execution_contract(arm, finite_only): + native_packet.require_execution_contract(arm, finite_only) + + +def _backend(state, suffix): + return adapters.load(state['backend_source'], '_h25_data_backend_' + suffix) + +def _authority_backend(state, suffix): + # Initial stdlib provenance belongs to the original early authority. This + # later fresh backend is raw source-loaded before its scientific exposure. + # BEGIN evaluated dispatch arguments data_adapters:433 + _ca_args = (str(state['backend_source']), state['backend_source_pin'], '_h25_data_authority_backend_' + suffix) + _ca_kwargs = {'kind': 'backend'} + # END evaluated dispatch arguments data_adapters:433 + # BEGIN caller admission data_adapters:433 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if state['authority'] is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:433 + return _ca_dispatch(0, *_ca_args, **_ca_kwargs) + + + +def capture_factory_environment(state, backend, backend_handle): + """Authenticate each fresh backend before its own scientific exposure.""" + packet = state['native_packet'] + # BEGIN evaluated dispatch arguments data_adapters:441 + _ca_args = (state['authority_handles']['cache'], 'capture_backend_factory_environment', backend) + _ca_kwargs = {'cold_authority': state['authority'], 'cold_caller_descriptor': state['cold_caller_descriptor'], 'backend_handle': backend_handle, 'cache_handle': state['authority_handles']['cache'], 'bootstrap_root': packet['bootstrap_root'], 'bootstrap_capability': packet['bootstrap_capability'], 'bootstrap_api': packet['bootstrap_api']} + # END evaluated dispatch arguments data_adapters:441 + # BEGIN caller admission data_adapters:441 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if state['authority'] is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:441 + return _ca_dispatch(1, *_ca_args, **_ca_kwargs) + + + +def _check_controls(state, *, include_late=False): + controls = state['controls'] + expected_status = {name: status for name, status in DATA_CONTROL_STATUS.items() + if include_late or name != 'bootstrap_late'} + need(set(controls) == set(expected_status), 'Complete data control union missing') + for name, expected in expected_status.items(): + need(type(controls[name]) is dict and controls[name].get('status') == expected, + 'Data control did not pass: ' + name) + expected_names = _CONTROL_CONTRACT['construction_optimized_names' if sys.flags.optimize else 'construction_normal_names'] + construction = controls['construction'] + need(construction.get('schema') == 'h25-construction-controls-v2' and + construction.get('cases') == len(expected_names) and + construction.get('optimized') is bool(sys.flags.optimize) and + [row['name'] for row in construction.get('controls', [])] == expected_names and + all(row['status'] == 'PASS' for row in construction['controls']), + 'Exact construction control census changed') + serialization = controls['serialization'] + need(serialization.get('case_count') == 70 and serialization.get('optimization') == sys.flags.optimize and + [row['case'] for row in serialization.get('cases', [])] == _CONTROL_CONTRACT['serialization_names'], + 'Exact serialization control census changed') + cache_counts = dict(_CONTROL_CONTRACT['cache_counts'], cases=30, requests=74) + cache = controls['cache_validity'] + need(cache.get('counts') == cache_counts and + type(EXPECTED_CACHE_TRANSCRIPT_RECORDS) is int and + cache.get('transcript_record_count') == EXPECTED_CACHE_TRANSCRIPT_RECORDS and + cache.get('native_consumer_case_count') == 10 and + cache.get('native_consumer_cases') == [ + 'empty-first-result-authority', 'offhash-foreign-key', 'offhash-value-resize', + 'eligible-native-exit-unsupported', 'provider-function-binding', + 'binding-inspect-code', 'binding-inspect-defaults', 'isolated-module-close', + 'teardown-validation-rejection', 'teardown-attempted-native-accounting-rejection'], + 'Exact retained native-consumer control census changed') + need(cache.get('v6_consumer_case_count') == 18 and + len(cache.get('v6_consumer_cases', [])) == 18, 'Exact additive v6 control count changed') + need(type(EXPECTED_V7_CONSUMER_CASES) is tuple and + cache.get('v7_consumer_case_count') == len(EXPECTED_V7_CONSUMER_CASES) and + cache.get('v7_consumer_cases') == list(EXPECTED_V7_CONSUMER_CASES), + 'Exact additive V7 control census is unconfigured or changed') + need(type(EXPECTED_V8_CALLER_CASES) is tuple and + cache.get('v8_caller_case_count') == len(EXPECTED_V8_CALLER_CASES) and + cache.get('v8_caller_cases') == list(EXPECTED_V8_CALLER_CASES), + 'Exact additive V8 caller control census is unconfigured or changed') + authority_controls = controls['cold_authority'] + authority_rows = authority_controls.get('records', []) + need(authority_controls.get('schema') == 'h25-cold-authority-controls-v7' and + type(EXPECTED_AUTHORITY_CONTROL_CASES) is tuple and + authority_controls.get('expected_records') == authority_controls.get('observed_record_count') == len(authority_rows) == 6 and + [row['case'] for row in authority_rows] == list(EXPECTED_AUTHORITY_CONTROL_CASES) and + all(type(row['expected_cases']) is int and type(row['observed_cases']) is int and + row['expected_cases'] == row['observed_cases'] for row in authority_rows) and + authority_controls.get('expected_subcases') == authority_controls.get('observed_subcases') == + sum(row['observed_cases'] for row in authority_rows) and + authority_controls.get('scientific_calls') == authority_controls.get('native_private_calls') == 0, + 'Exact cold authority grouped and derived subcase census changed') + metadata_native = controls['native_metadata'] + need(metadata_native.get('schema') == 'h25-native-metadata-controls-v3' and + metadata_native.get('observed_record_count') == len(metadata_native.get('records', [])) == 16 and + metadata_native.get('native_lifecycle_before') == metadata_native.get('native_lifecycle_after'), + 'Exact additive native metadata control census changed') + need(controls['cache_reference_v3'].get('counts') == cache_counts, + 'Separate bounded v3 reference control census changed') + initial_tcb = controls['native_initial_tcb'] + need(initial_tcb.get('schema') == 'h25-native-tcb-controls-v1' and + len(initial_tcb.get('records', [])) == 5 and initial_tcb.get('expected_records') == 5 and + initial_tcb.get('scientific_calls') == 0 and initial_tcb.get('probe_native_imports') == 0, + 'Initial native TCB control census changed') + native_controls = controls['native_probe'] + need(native_controls.get('records') == 62 and + native_controls['direct'].get('inspection_calls') == 58 and + len(native_controls['direct'].get('records', [])) == 60 and + len(native_controls.get('disarmed', [])) == 1 and len(native_controls.get('bounds', [])) == 1, + 'Native metadata direct/fixture census changed') + need(len(controls['bootstrap_preload'].get('records', [])) == 21 and + controls['bootstrap_preload'].get('scientific_calls') == 0, 'Bootstrap preload census changed') + if include_late: + need(state['native_packet']['late_completed'] is True and + len(controls['bootstrap_late'].get('records', [])) == 1, 'Bootstrap late-last census changed') + metadata = controls['rank_metadata'] + rows, guard, digests = metadata['rows'], metadata['guard'], metadata['digests'] + need(rows['status'] == 'ROW_METADATA_CONTROLS_PASS' and rows['event_fixture_count'] == 8 and + rows['unsupported_cases'] == 9 and rows['table_cap_tested'] == 4096 and rows['callback_events'] == [], + 'Exact immutable-row control census changed') + need(guard['status'] == 'OBSERVATION_GUARD_CONTROLS_PASS' and guard['base_check_calls'] == 43 and + len(guard['mutations']) == 21 and + {row[0] for row in guard['mutations']} == set(_CONTROL_CONTRACT['rank_guard_mutation_names']), + 'Exact observation-guard control census changed') + need(digests['status'] == 'DIGEST_SNAPSHOT_CONTROLS_PASS' and + digests['declared_fixture_bytes'] == 2097172 and digests['same_snapshot_sha_calls'] == 3 and + digests['stream_request_bytes'] == [1048576] * 4 and + digests['read_once_same_snapshot'] is True and digests['fresh_after_mutation'] is True, + 'Exact same-call digest control census changed') + native = controls['rank_native'] + need(native['rank_events'] == 17 and len(native['outcomes']) == 18 and + native['callbacks'] == ['basis.values', 'basis.values'] and + native['counters'] == {'complement_native': 0, 'complement_fallback': 0, + 'gram_native': 14, 'gram_fallback': 4}, + 'Exact native observation control census changed') + need([list(row) for row in controls['inventory']['cases']] == _CONTROL_CONTRACT['inventory_cases'], + 'Exact inventory control census changed') + composition = controls['combined_composition'] + need(composition['height'] == 8 and composition['optimized'] == sys.flags.optimize and + composition['arms'] == ['baseline', 'candidate'] and + set(composition['files']) == {'result.json', 'witness.json', 'rank-trace.json', 'complements.json'} and + composition['production_writer_expected_unchanged'] is True and + composition['production_writer_executed'] is False and composition['full_h25_gate_passed'] is False, + 'Exact bounded composition scope changed') + + +def run_controls(state, native, output, phases, reference_driver, candidate_inventory, extensions): + """Isolated backends: production's finalized class/owner state is untouched.""" + controls = state['controls'] + controls.update(state['native_packet']['controls']) + controls['construction'] = phases.call( + 'data_construction_controls', state['construction_controls'].run_controls, + _backend(state, 'construction_controls'), state['set_adapter'], state['construction']) + comparison = adapters.load(state['comparison_source'], '_h25_data_comparison_controls') + controls['serialization'] = phases.call( + 'data_serialization_controls', state['serialization_controls'].run_controls, + comparison, output / 'serialization-controls') + controls['cache_reference_v3'] = phases.call( + 'data_cache_reference_v3_controls', state['cache_reference_controls'].run_controls, + _backend(state, 'cache_reference_controls'), native, state['cache_reference']) + packet = state['native_packet'] + cache_backend, cache_backend_handle = _authority_backend(state, 'cache_controls') + cache_environment = capture_factory_environment(state, cache_backend, cache_backend_handle) + # BEGIN evaluated dispatch arguments data_adapters:576 + _ca_args = (state['setup_handle'], 'trace_entries', state['authority'], extensions) + _ca_kwargs = {'cold_caller_descriptor': state['cold_caller_descriptor']} + # END evaluated dispatch arguments data_adapters:576 + # BEGIN caller admission data_adapters:576 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if state['authority'] is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:576 + cache_trace_entries = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments data_adapters:579 + _ca_args = (state['setup_handle'], 'compose_guard_stack', state['authority'], cache_backend, cache_backend_handle, extensions['authority_handles']['guard_adapter'], state['adapters_handle'], cache_trace_entries) + _ca_kwargs = {'cold_caller_descriptor': state['cold_caller_descriptor']} + # END evaluated dispatch arguments data_adapters:579 + # BEGIN caller admission data_adapters:579 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if state['authority'] is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:579 + _ca_dispatch(1, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments data_adapters:585 + _ca_args = (state['authority_handles']['cache_controls'], 'run_controls', cache_backend, native, state['cache'], packet['extension_path'], packet['extension_sha256']) + _ca_kwargs = {'bootstrap_root': packet['bootstrap_root'], 'bootstrap_capability': packet['bootstrap_capability'], 'bootstrap_api': packet['bootstrap_api'], 'cold_authority': state['authority'], 'cold_caller_descriptor': state['cold_caller_descriptor'], 'cache_handle': state['authority_handles']['cache'], 'backend_handle': cache_backend_handle, 'row_handle': state['authority_handles']['rows'], 'row_producer_handle': state['authority_handles']['row_derivation'], 'factory_environment': cache_environment} + # END evaluated dispatch arguments data_adapters:585 + # BEGIN caller admission data_adapters:585 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if state['authority'] is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:585 + controls['cache_validity'] = phases.call('data_cache_controls', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + controls['rank_metadata'] = phases.call( + 'data_rank_metadata_controls', state['metadata_controls'].run_controls, + state['rows'], state['digests'], output / 'digest-controls') + reference_backend = _backend(state, 'rank_reference') + candidate_backend = _backend(state, 'rank_candidate') + phases.call('data_control_backend_derivation', state['derive_backend'].install, candidate_backend) + reference_module = reference_backend.load_source('_h25_data_rank_reference') + candidate_module = candidate_backend.load_source('_h25_data_rank_candidate') + reference_calls, candidate_calls = [], [] + helper = state['rows'].make_row_interner() + candidate_backend.RuntimeGuard = state['rows'].make_runtime_guard(candidate_backend.RuntimeGuard, helper) + reference_binding = reference_backend.bind(reference_module, native, reference_calls) + candidate_binding = candidate_backend.bind(candidate_module, native, candidate_calls, rank_row_intern=helper) + reference = {'module': reference_module, 'binding': reference_binding, 'rank_calls': reference_calls} + candidate = {'module': candidate_module, 'binding': candidate_binding, 'rank_calls': candidate_calls} + controls['rank_native'] = phases.call( + 'data_rank_native_controls', state['native_controls'].run_bound_controls, reference, candidate, helper) + reference_inventory = adapters.load(reference_driver, '_h25_data_inventory_reference').inventory + controls['inventory'] = phases.call( + 'data_inventory_controls', state['inventory_controls'].run_controls, + reference_inventory, candidate_inventory, output / 'inventory-controls') + controls['combined_composition'] = phases.call( + 'data_combined_composition_controls', state['composition_controls'].run_controls, + sys.modules[__name__], state, extensions, native, comparison, phases, output / 'composition-controls') + # Generic authority controls use only already registered original products + # plus one fresh metadata-only row helper. Final cache/private row products + # retain their separate V8 consumer controls. + # BEGIN evaluated dispatch arguments data_adapters:621 + _ca_args = (state['authority_handles']['rows'], 'make_row_interner') + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:621 + # BEGIN caller admission data_adapters:621 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if state['authority'] is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:621 + authority_row_helper = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + authority_products = tuple(extensions['authority_product_cases']) + ( + ('fresh-row-helper', authority_row_helper, state['authority_handles']['rows'], + 'make_row_interner', (), {}),) + authority_modules = [('production-backend', state['backend_handle']), + ('cache-control-backend', cache_backend_handle)] + authority_modules.extend(('composition-backend-' + str(index), owned['backend_handle']) + for index, owned in enumerate(state['owned_states'][1:])) + authority_modules.extend(('early-' + name, handle) for name, handle in state['early_authority_handles']) + authority_modules.extend(('setup-' + name, handle) for name, handle in sorted(extensions['authority_handles'].items())) + authority_modules.extend(('data-' + name, handle) for name, handle in sorted(state['authority_handles'].items())) + unique_modules, seen_handles = [], set() + for label, handle in authority_modules: + if id(handle) not in seen_handles: + unique_modules.append((label, handle)) + seen_handles.add(id(handle)) + authority_modules = tuple(unique_modules) + # BEGIN evaluated dispatch arguments data_adapters:639 + _ca_args = (state['authority_handles']['cold_authority_controls'], 'run_controls', state['authority'], state['cold_caller_descriptor'], authority_modules, authority_products) + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:639 + # BEGIN caller admission data_adapters:639 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if state['authority'] is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:639 + controls['cold_authority'] = phases.call('data_cold_authority_controls', _ca_dispatch, 1, *_ca_args, **_ca_kwargs) + state['cold_authority_input_census'] = { + 'module_labels': [label for label, _ in authority_modules], + 'module_handle_count': len(authority_modules), + 'product_labels': [row[0] for row in authority_products], + 'product_count': len(authority_products), + 'product_scope': 'Original P2 guard and trace class plus fresh row helper; final cache/private/final-row controls remain in V8.'} + _check_controls(state) + return controls + + +def _runtime_images(writer): + """Fresh bounded hash reads of actual interpreter/JSON runtime file paths. + + This records file custody, not a claim about arbitrary process memory. The + writer separately checks live module/class/function bindings at entry/exit. + """ + paths = {'python_executable': Path(sys.executable).resolve()} + modules = {} + for owner, _, _ in writer._h25_serialization_bindings: + if type(owner) is ModuleType and owner.__name__ in ('json', 'json.encoder', '_json'): + modules[owner.__name__] = owner + need(set(modules) == {'json', 'json.encoder', '_json'}, 'Actual JSON runtime module census changed') + for name, module in modules.items(): + need(type(module.__file__) is str, 'JSON runtime path missing') + paths[name] = Path(module.__file__).resolve() + result = {} + for name, path in sorted(paths.items()): + need(path.is_file() and not path.is_symlink(), 'JSON runtime image missing') + before = path.stat() + hasher, count = hashlib.sha256(), 0 + with path.open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + count += len(block) + hasher.update(block) + after = path.stat() + identity = lambda value: (value.st_dev, value.st_ino, value.st_mode, value.st_size, + value.st_mtime_ns, value.st_ctime_ns) + need(identity(before) == identity(after) and count == before.st_size, 'JSON runtime image changed while read') + result[name] = {'path': str(path), 'sha256': hasher.hexdigest(), 'bytes': count, + 'mode': stat.S_IMODE(after.st_mode)} + return result + + +def install_circuit(state, extensions, module, comparison): + """Original P1/cache/construction admission precedes every class mutation.""" + if not state['enabled']: + adapters.install_set(extensions, module) + state['writer'] = comparison.write_scientific + state['writer_handle'] = state['writer'] + return + p1 = state['set_adapter'].bind_verify_map(module) + construction = state['construction'].bind_construction(module) + packet = state['native_packet'] + # BEGIN evaluated dispatch arguments data_adapters:694 + _ca_args = (state['authority_handles']['cache'], 'prepare_cache_contract', module, packet['extension_path'], packet['extension_sha256']) + _ca_kwargs = {'bootstrap_root': packet['bootstrap_root'], 'bootstrap_capability': packet['bootstrap_capability'], 'bootstrap_api': packet['bootstrap_api'], 'factory_environment': state['factory_environment']} + # END evaluated dispatch arguments data_adapters:694 + # BEGIN caller admission data_adapters:694 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if state['authority'] is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:694 + cache = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + # Register ownership before any class mutation/writer setup can fail. + state['cache_binding'] = cache + original_checks_init = module.Checks.__init__ + capture_checks = p1['owner'].capture_checks + + def captured_checks(self, *args, **kwargs): + result = original_checks_init(self, *args, **kwargs) + capture_checks(self) + return result + + module.Checks.verify_map = p1['verify_map'] + module.ComplexSideCircuit.add = construction['add'] + module.ComplexSideCircuit.__init__ = construction['wrap_constructor']( + construction['original_init'], p1['owner'].capture_c) + module.Checks.__init__ = captured_checks + module.Checks.residual_ok = cache['residual_ok'] + module.Checks.label_ok = cache['label_ok'] + extensions['set_binding'] = p1 + state['construction_binding'], state['cache_binding'] = construction, cache + writer = state['serializer'].make_writer( + comparison.write_scientific, comparison.canonical, comparison.EXPECTED, comparison.require) + need(writer._h25_serialization_faults_enabled is False, 'Production serializer contains test faults') + state['writer'] = state['writer_handle'] = writer + state['runtime_before'] = _runtime_images(writer) + + +def bind_native(state, backend, module, native, rank_calls, complement): + """Call only after every CS/Checks/phase/observer wrapper is final.""" + authority, handles = state['authority'], state['authority_handles'] + if not state['enabled']: + # BEGIN evaluated dispatch arguments data_adapters:729 + _ca_args = (state['backend_handle'], 'bind', module, native, rank_calls, complement) + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:729 + # BEGIN caller admission data_adapters:729 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:729 + return _ca_dispatch(1, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments data_adapters:730 + _ca_args = (handles['rows'], 'make_row_interner') + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:730 + # BEGIN caller admission data_adapters:730 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:730 + helper = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + state['row_helper'] = helper + # BEGIN evaluated dispatch arguments data_adapters:732 + _ca_args = (handles['cache'], 'compose_runtime_guard', backend.RuntimeGuard, state['cache_binding']) + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:732 + # BEGIN caller admission data_adapters:732 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:732 + cache_guard = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments data_adapters:734 + _ca_args = (handles['rows'], 'make_cache_runtime_guard', cache_guard, helper) + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:734 + # BEGIN caller admission data_adapters:734 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:734 + final_guard = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments data_adapters:735 + _ca_args = (state['backend_handle'], final_guard) + _ca_kwargs = {} + # END evaluated dispatch arguments data_adapters:735 + # BEGIN caller admission data_adapters:735 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:735 + _ca_dispatch(5, *_ca_args, **_ca_kwargs) + # BEGIN evaluated dispatch arguments data_adapters:736 + _ca_args = (handles['cache'], 'bind_cache_backend', backend, module, native, state['cache_binding'], state['factory_environment']) + _ca_kwargs = {'row_producer_handle': handles['row_derivation'], 'row_handle': handles['rows'], 'rank_row_intern': helper, 'final_guard': final_guard, 'rank_calls': rank_calls, 'complement_trace': complement} + # END evaluated dispatch arguments data_adapters:736 + # BEGIN caller admission data_adapters:736 + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = _ca_p[0], _ca_p[1], _ca_p[2] + _ca_error, _ca_value_error, _ca_zip = _ca_p[7], _ca_p[8], _ca_p[18] + _ca_dispatch, _ca_record = _ca_desc[2], _ca_desc[3] + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + # END caller admission data_adapters:736 + result = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + state['backend_derivation'] = state['cache_binding']['owner'].binding_derivation + return result + + +def seal(state): + if state['enabled']: + state['construction_binding']['owner'].seal() + + +def arm(state, extensions): + if state['enabled']: + # Fresh Fraction/source/class check immediately before optimized + # construction; the original later P1 check remains unchanged. + need(extensions['set_binding']['owner']._fresh(), 'Fresh original P1 environment required before construction') + state['construction_binding']['owner'].arm_cli() + adapters.arm(extensions) + + +def scientific_writer(state): + need(state['writer'] is state['writer_handle'], 'Scientific writer binding changed') + return state['writer_handle'] + + +def finite_receipt(state): + _check_controls(state, include_late=True) + return {'schema': 'h25-data-handling-v2', 'enabled': state['enabled'], 'arm': state['arm'], + 'controls': state['controls'], 'full_caller_run': False, + 'cold_authority_input_census': state['cold_authority_input_census'], + 'full_candidate_admission': False, + 'native_packet': native_packet.receipt(state['native_packet']), + 'cache_teardown_stops': [item['cache_teardown_stop'] for item in state['owned_states'] + if item['cache_teardown_stop'] is not None], + 'admission_hold': 'Final cache V8 complete cost and caller equality are unqualified; source/execution/funding gates remain separate'} + + +def finish(state, binding): + """After exact outputs and original source checks; cleanup remains timed.""" + _check_controls(state) + binding['runtime_guard'].check() + if not state['enabled']: + result = {'schema': 'h25-data-handling-v2', 'enabled': False, 'arm': 'baseline', + 'controls': state['controls'], 'full_caller_run': True} + else: + writer = scientific_writer(state) + need(writer._h25_serialization_faults_enabled is False and + type(writer.last_operation) is dict and + writer.last_operation.get('status') == 'BOUNDED_SERIALIZATION_PASS', + 'Complete candidate did not use the bounded scientific writer') + state['runtime_after'] = _runtime_images(writer) + need(state['runtime_after'] == state['runtime_before'], 'JSON runtime image custody changed') + construction = state['construction_binding']['owner'].finish() + cache = teardown_cache(state) + need(cache['teardowns'] == 1 and cache['current_authority_entries'] == 0, + 'Cache private state cleanup incomplete') + result = {'schema': 'h25-data-handling-v2', 'enabled': True, 'arm': 'candidate', + 'controls': state['controls'], 'full_caller_run': True, + 'construction': construction, 'cache_validity': cache, + 'serialization': writer.last_operation, + 'rank_observation': {'native_success_only': True, 'collector': 'exact built-in list', + 'table_entry_cap': 4096, 'rank_answers_cached': False}, + 'backend_derivation': state['backend_derivation'], + 'serialization_runtime_files': state['runtime_before']} + result['cold_authority_input_census'] = state['cold_authority_input_census'] + state['final_receipt'] = result + return result + + +def transport(root, baseline, output): + """Original bounded historical artifact transport; no scientific imports.""" + need(sys.flags.optimize == 0, 'Transport requires original assertions enabled') + output = output.resolve() + need(not output.exists() and not output.is_relative_to(root), 'Fresh external transport evidence required') + original_before = adapters.custody(root, 'all') + data_before = custody(root) + manifest = _manifest(root) + baseline_names = {name for name in manifest['files'] if name.startswith('baseline/')} + need(baseline_names, 'Historical transport closure absent') + before = {} + for name in sorted(baseline_names): + observed = _row(root / name) + need(observed == manifest['files'][name], 'Historical transport stage custody failed: ' + name) + before[name] = observed + checker_path = baseline / 'check_artifacts.py' + checker_name = checker_path.relative_to(root).as_posix() + need(checker_name in before and _row(checker_path) == before[checker_name], + 'Fresh historical checker source admission failed') + checker = adapters.load(checker_path, '_h25_data_historical_transport') + old_argv = sys.argv + try: + sys.argv = [str(checker_path)] + checker.main() + finally: + sys.argv = old_argv + for name, expected in before.items(): + need(_row(root / name) == expected, 'Historical transport closure changed: ' + name) + need(adapters.custody(root, 'all') == original_before and custody(root) == data_before, + 'Transport integration source custody changed') + need(_manifest(root) == manifest, 'Transport stage manifest changed') + output.mkdir(parents=True) + receipt = {'schema': 'h25-data-handling-transport-v1', 'status': 'H25_DATA_HANDLING_TRANSPORT_PASS', + 'mode': 'transport', 'optimized': sys.flags.optimize, + 'historical_checker_sha256': before[checker_name]['sha256'], + 'scientific_cli_run': False, 'native_build_run': False, + 'new_source_custody': original_before, 'data_source_custody': data_before} + (output / 'receipt.json').write_text(json.dumps(receipt, indent=2, sort_keys=True) + '\n') + print(json.dumps(receipt, sort_keys=True)) + return receipt + + +def teardown_cache(state): + """Exactly one terminal attempt; retain actual owner's diagnostic on failure.""" + if state['cache_binding'] is None: + return None + need(not state['native_packet']['late_started'], 'Cache teardown forbidden after late audit control') + need(not state['cache_teardown_attempted'], 'Cache teardown already attempted') + state['cache_teardown_attempted'] = True + owner = state['cache_binding']['owner'] + try: + receipt = owner.teardown() + except BaseException: + # Copy only the JSON-ready diagnostic; never manufacture missing counters. + try: + state['cache_teardown_stop'] = owner.teardown_stop + except BaseException as diagnostic_error: + state['cleanup_errors'].append({'stage': 'read-owner-teardown-stop', + 'type': type(diagnostic_error).__name__}) + raise + state['cache_teardown_receipt'] = receipt + return receipt + + +def cleanup_owned(state): + """Failure-path cleanup, preserving primary exceptions and every STOP record.""" + if state is None or state['native_packet']['late_started']: + return [] + errors = [] + for owned in reversed(state['owned_states']): + if owned['cache_binding'] is not None and not owned['cache_teardown_attempted']: + try: + teardown_cache(owned) + except BaseException as error: + item = {'type': type(error).__name__, 'message': str(error), + 'arm': owned['arm'], 'cache_teardown_stop': owned['cache_teardown_stop']} + owned['cleanup_errors'].append(item) + errors.append(item) + return errors + + +def finish_before_late(state): + """Finish every owner and native qualification before adding the late hook.""" + _check_controls(state) + errors = cleanup_owned(state) + need(not errors, 'Terminal native/cache cleanup failed; retained STOP diagnostics required') + need(all(owned['cache_binding'] is None or owned['cache_teardown_attempted'] + for owned in state['owned_states']), 'An owned native cache remains live') + native_packet.before_late(state['native_packet']) + + +def finish_late_last(state): + """No native/scientific API, guard, or owner call is permitted after this.""" + state['controls']['bootstrap_late'] = native_packet.late_last(state['native_packet']) + _check_controls(state, include_late=True) # Pure control-result validation only. + if state['final_receipt'] is not None: + state['final_receipt']['native_packet'] = native_packet.receipt(state['native_packet']) + return None + + +def stop_diagnostics(state): + """Pure recorded evidence, safe after the deliberately terminal late control.""" + if state is None: + return None + return {'controls_completed': sorted(state['controls']), + 'native_packet': native_packet.receipt(state['native_packet']), + 'owners': [{'arm': item['arm'], 'teardown_attempted': item['cache_teardown_attempted'], + 'teardown_receipt': item['cache_teardown_receipt'], + 'teardown_stop': item['cache_teardown_stop'], 'cleanup_errors': item['cleanup_errors']} + for item in state['owned_states']]} + + +# Appended to the unchanged legacy data adapter. Legacy install/bind/control APIs stay intact. +import types as _epoch_data_types + + +def _epoch_data_dispatch(state,descriptor,index,*args,**kwargs): + need(type(state) is dict and all(type(k) is str for k in state),'Epoch source state domain') + legacy=state['cold_caller_descriptor'];p=legacy[5];dispatch=legacy[2];record=legacy[3] + need(type(p) is tuple and len(p)==19 and p[0] is type and p[1] is _epoch_data_types.FunctionType and p[2] is id, + 'Epoch legacy native caller primitives') + if dispatch is not record[0] or type(dispatch) is not p[1]:raise RuntimeError('Epoch legacy dispatcher identity') + for (_,getter),expected in zip(p[4],record[1:7]): + if getter(dispatch,p[1]) is not expected:raise RuntimeError('Epoch legacy dispatcher fields') + for cell,expected in record[8]: + if p[6](cell,p[5]) is not expected:raise RuntimeError('Epoch legacy dispatcher cell') + dispatch(2) + # New authority dispatcher checks this exact immutable bootstrap transport at + # each invocation before target entry; the read is inside that closed scope. + authority=state['authority'];need(authority is legacy[1] and len(authority)==7,'Epoch legacy source tuple') + attrs=_epoch_data_types.FunctionType.__dict__['__dict__'].__get__(authority[0],_epoch_data_types.FunctionType) + bundle=attrs.get('_h25_epoch_bundle') + need(type(bundle) is tuple and len(bundle)==4 and bundle[0]=='h25-cold-authority-epoch-bundle-v1' and + bundle[1] is authority and bundle[3] is descriptor,'Epoch actual initial bundle transport') + p=descriptor[5];dispatch=descriptor[2];record=descriptor[3] + need(type(p) is tuple and len(p)==19 and p[0] is type and p[1] is _epoch_data_types.FunctionType and p[2] is id,'Epoch native caller primitives') + if dispatch is not record[0] or type(dispatch) is not p[1]:raise RuntimeError('Epoch dispatcher identity') + for (_,getter),expected in zip(p[4],record[1:7]): + if getter(dispatch,p[1]) is not expected:raise RuntimeError('Epoch dispatcher fields') + for cell,expected in record[8]: + if p[6](cell,p[5]) is not expected:raise RuntimeError('Epoch dispatcher cell') + return dispatch(index,*args,**kwargs) + + +def _epoch_cache_invoke(state,export,*args,**kwargs): + descriptor=state['cold_caller_descriptor'];p=descriptor[5];dispatch=descriptor[2];rec=descriptor[3] + need(type(export) is str and type(p) is tuple and p[0] is type and p[1] is _epoch_data_types.FunctionType and p[2] is id,'Epoch source cache export') + if dispatch is not rec[0] or type(dispatch) is not p[1]:raise RuntimeError('Epoch cache dispatcher identity') + for (_,getter),expected in zip(p[4],rec[1:7]): + if getter(dispatch,p[1]) is not expected:raise RuntimeError('Epoch cache dispatcher fields') + for cell,expected in rec[8]: + if p[6](cell,p[5]) is not expected:raise RuntimeError('Epoch cache dispatcher cell') + return dispatch(1,state['authority_handles']['cache'],export,*args,**kwargs) + + +def epoch_load(state,descriptor): + return _epoch_data_dispatch(state,descriptor,0,'load',state['backend_handle']) + + +def install_epoch_circuit(state,extensions,module,comparison,descriptor,load_ticket,context): + """New production-only export. All legacy isolated/control callers use install_circuit.""" + need(state['enabled'] is True,'Epoch candidate-owned installation only') + packet=state['native_packet'] + need(state['cache_binding'] is None and 'epoch_acquisition' not in state,'Epoch fresh acquisition disposition') + state['epoch_acquisition']={'phase':'BEFORE_ACQUISITION','prepared':None,'owner':None,'probe_binding':None, + 'close_attempted':False,'close_result':None,'primary':None,'secondary':None,'uncertain':False, + 'published':False,'origin_handle':None} + handle,p1,construction,cache=_epoch_data_dispatch(state,descriptor,0,'factories',load_ticket, + extensions['authority_handles']['set_adapter'],state['authority_handles']['construction'], + state['authority_handles']['cache'],(packet['extension_path'],packet['extension_sha256']), + {'bootstrap_root':packet['bootstrap_root'],'bootstrap_capability':packet['bootstrap_capability'], + 'bootstrap_api':packet['bootstrap_api'],'factory_environment':state['factory_environment']},context) + need(state['cache_binding'] is cache and state['epoch_acquisition']['prepared'] is cache,'Epoch continuous acquisition handoff') + suite=_epoch_data_dispatch(state,descriptor,1,handle,context) + state['epoch_suite']=suite;state['epoch_descriptor']=descriptor + _epoch_cache_invoke(state,'epoch_suite_call',suite,0) + original_checks_init=module.Checks.__init__ + capture_checks=p1['owner'].capture_checks + def captured_checks(self,*args,**kwargs): + result=original_checks_init(self,*args,**kwargs) + capture_checks(self) + return result + _epoch_cache_invoke(state,'epoch_suite_call',suite,1,'checks','verify_map','p1',p1['verify_map']) + _epoch_cache_invoke(state,'epoch_suite_call',suite,1,'circuit','add','construction_add',construction['add']) + _epoch_cache_invoke(state,'epoch_suite_call',suite,2) + _epoch_cache_invoke(state,'epoch_suite_call',suite,1,'checks','__init__','checks_capture',captured_checks) + _epoch_cache_invoke(state,'epoch_suite_call',suite,1,'checks','residual_ok','public_residual',cache['residual_ok']) + _epoch_cache_invoke(state,'epoch_suite_call',suite,1,'checks','label_ok','public_label',cache['label_ok']) + extensions['set_binding']=p1 + state['construction_binding'],state['cache_binding']=construction,cache + writer=state['serializer'].make_writer(comparison.write_scientific,comparison.canonical,comparison.EXPECTED,comparison.require) + need(writer._h25_serialization_faults_enabled is False,'Production serializer contains test faults') + state['writer']=state['writer_handle']=writer + state['runtime_before']=_runtime_images(writer) + return suite + + +def epoch_phase_wrap(state,phases,kind,owner,attribute,name): + suite=state['epoch_suite'] + return _epoch_cache_invoke(state,'epoch_suite_call',suite,3,phases,kind,owner,attribute,name) + + +def epoch_role_observer(state,function): + return _epoch_cache_invoke(state,'epoch_suite_call',state['epoch_suite'],1, + 'module','verify_role_frames','roles_observer',function) + + +def epoch_seal(state): + return _epoch_cache_invoke(state,'epoch_suite_call',state['epoch_suite'],5) + + +def epoch_arm(state,invocation_token): + return _epoch_cache_invoke(state,'epoch_suite_call',state['epoch_suite'],4,invocation_token) + + +def epoch_retire(state,reason,primary=None,secondary=None,restoration_error=None,error_channel=None,cleanup_scope=None): + if state is None:return None + record=state.get('epoch_acquisition') + if record is not None and primary is not None and record['primary'] is None:record['primary']=primary + if record is not None and restoration_error is not None and restoration_error is not primary: + if record['secondary'] is None:record['secondary']=restoration_error + record['uncertain']=True + if record is not None and secondary is not None and secondary is not primary: + if record['secondary'] is None:record['secondary']=secondary + record['uncertain']=True + suite=state.get('epoch_suite') + if suite is None:return None + if primary is not None and suite.primary_error is None:suite.primary_error=primary + if restoration_error is not None and restoration_error is not primary: + if suite.secondary_error is None:suite.secondary_error=restoration_error + suite.uncertain=True + if secondary is not None and secondary is not primary: + if suite.secondary_error is None:suite.secondary_error=secondary + suite.uncertain=True + try:suite.secondary.append(secondary) + except BaseException:pass + # Retirement is source-only plain metadata disposal, not a late native check. + cleanup=state.get('epoch_cli_cleanup') + scope=('outer' if error_channel is None else 'inner') if cleanup_scope is None else cleanup_scope + need(type(scope) is str and scope in ('inner','outer'),'Epoch exact retirement scope') + outer=scope=='outer' + if error_channel is not None:channel=error_channel + elif cleanup is not None:channel=cleanup['outer_retirement_channel' if outer else 'retirement_channel'] + else:channel=suite.outer_retirement_channel if outer else suite.inner_retirement_channel + try:return suite.retire_preserving(reason,primary,channel) + finally: + # Every declared attempt has its own channel and fixed R/J handoff. + # No ACKed channel is cleared, reused or inferred from journal growth. + if outer: + suite.outer_retirement_error=channel['error'];suite.outer_journal_error=channel['journal_error'] + else: + suite.inner_retirement_error=channel['error'];suite.inner_journal_error=channel['journal_error'] + if cleanup is not None and channel['error'] is not None: + name='outer_retirement_error' if outer else 'retirement_error' + if cleanup[name] is None:cleanup[name]=channel['error'] + cleanup['uncertain']=True + channel['acknowledged']=True + + + +def epoch_stop_diagnostics(state): + result=stop_diagnostics(state) + if state is not None and state.get('epoch_suite') is not None: + suite=state['epoch_suite'] + result=dict(result) + result['epoch']={'receipt':dict(suite.receipt),'active':suite.active,'terminal':suite.terminal, + 'pending':suite.pending is not None,'registry_entries':len(suite.registry), + 'secondary_types':[type(error).__name__ for error in suite.secondary], + 'uncertain':suite.uncertain,'primary_type':None if suite.primary_error is None else type(suite.primary_error).__name__, + 'first_secondary_type':None if suite.secondary_error is None else type(suite.secondary_error).__name__, + 'inner_retirement_type':None if suite.inner_retirement_error is None else type(suite.inner_retirement_error).__name__, + 'inner_journal_type':None if suite.inner_journal_error is None else type(suite.inner_journal_error).__name__, + 'outer_retirement_type':None if suite.outer_retirement_error is None else type(suite.outer_retirement_error).__name__, + 'outer_journal_type':None if suite.outer_journal_error is None else type(suite.outer_journal_error).__name__, + 'runtime_or_resource_admitted':False} + if state is not None and state.get('epoch_acquisition') is not None: + record=state['epoch_acquisition'];result=dict(result) + result['epoch_acquisition']={'phase':record['phase'],'published':record['published'], + 'close_attempted':record['close_attempted'],'uncertain':record['uncertain'], + 'primary_type':None if record['primary'] is None else type(record['primary']).__name__, + 'secondary_type':None if record['secondary'] is None else type(record['secondary']).__name__, + 'actual_close_result_retained':record['close_result'] is not None, + 'owner_acquisition_does_not_grant_provenance':True} + if state is not None and state.get('epoch_cli_cleanup') is not None: + record=state['epoch_cli_cleanup'];result=dict(result) + result['epoch_cli_cleanup']={'primary_type':None if record['primary'] is None else type(record['primary']).__name__, + 'argv_error_type':None if record['argv_error'] is None else type(record['argv_error']).__name__, + 'disarm_error_type':None if record['disarm_error'] is None else type(record['disarm_error']).__name__, + 'retirement_error_type':None if record['retirement_error'] is None else type(record['retirement_error']).__name__, + 'outer_retirement_error_type':None if record['outer_retirement_error'] is None else type(record['outer_retirement_error']).__name__, + 'retirement_journal_error_type':None if record['retirement_channel']['journal_error'] is None else type(record['retirement_channel']['journal_error']).__name__, + 'raw_retirement_acknowledged':record['retirement_channel']['acknowledged'], + 'uncertain':record['uncertain']} + return result + + +def epoch_driver_entry(authority,legacy_descriptor,epoch_descriptor,function,phase_class,invocation_token): + """Mint the initial driver record through the source-owned authority.""" + return _epoch_data_dispatch({'authority':authority,'cold_caller_descriptor':legacy_descriptor}, + epoch_descriptor,0,'driver_entry',function,phase_class,invocation_token) + + +def epoch_cleanup_owned(state): + """Pending/acquired owners remain on the original parent cleanup path.""" + if state is None or state['native_packet']['late_started']:return [] + errors=[] + for owned in reversed(state['owned_states']): + record=owned.get('epoch_acquisition') + if record is None or owned['cache_binding'] is None or owned['cache_teardown_attempted']:continue + record['close_attempted']=True;record['phase']='PARENT_CLOSE_ATTEMPTING' + try: + teardown_cache(owned) + except BaseException as secondary: + if record['secondary'] is None:record['secondary']=secondary + record['uncertain']=True;record['phase']='PARENT_CLOSE_FAILED' + # Retain the raw error before any evidence formatting/allocation. + item={'type':type(secondary).__name__,'arm':owned['arm'],'cache_teardown_stop':owned['cache_teardown_stop']} + owned['cleanup_errors'].append(item);errors.append(item) + else: + record['close_result']=owned['cache_teardown_receipt'];record['phase']='PARENT_TEARDOWN_RETURNED' + errors.extend(cleanup_owned(state)) # legacy owners; attempted epoch owner is skipped + return errors + + + +def bind_epoch_native(state, backend, module, native, rank_calls, complement): + """Call only after every CS/Checks/phase/observer wrapper is final.""" + need(state['enabled'] is True and state.get('epoch_suite') is not None, 'Epoch genuine candidate bind path required') + authority, handles = (state['authority'], state['authority_handles']) + if not state['enabled']: + _ca_args = (state['backend_handle'], 'bind', module, native, rank_calls, complement) + _ca_kwargs = {} + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + return _ca_dispatch(1, *_ca_args, **_ca_kwargs) + _ca_args = (handles['rows'], 'make_row_interner') + _ca_kwargs = {} + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + helper = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + state['row_helper'] = helper + _ca_args = (handles['cache'], 'compose_runtime_guard', backend.RuntimeGuard, state['cache_binding']) + _ca_kwargs = {} + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + cache_guard = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + cache_guard = _epoch_cache_invoke(state, 'compose_epoch_runtime_guard', cache_guard, state['epoch_suite']) + _ca_args = (handles['rows'], 'make_cache_runtime_guard', cache_guard, helper) + _ca_kwargs = {} + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + final_guard = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + _ca_args = (state['backend_handle'], final_guard) + _ca_kwargs = {} + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + _ca_dispatch(5, *_ca_args, **_ca_kwargs) + _ca_args = (handles['cache'], 'bind_epoch_cache_backend', backend, module, native, state['cache_binding'], state['factory_environment']) + _ca_kwargs = {'row_producer_handle': handles['row_derivation'], 'row_handle': handles['rows'], 'rank_row_intern': helper, 'final_guard': final_guard, 'rank_calls': rank_calls, 'complement_trace': complement, 'epoch_assembler': state['epoch_suite'].assembler} + _ca_desc = state['cold_caller_descriptor'] + _ca_p = _ca_desc[5] + _ca_type, _ca_function, _ca_id = (_ca_p[0], _ca_p[1], _ca_p[2]) + _ca_error, _ca_value_error, _ca_zip = (_ca_p[7], _ca_p[8], _ca_p[18]) + _ca_dispatch, _ca_record = (_ca_desc[2], _ca_desc[3]) + if authority is not _ca_desc[1] or _ca_dispatch is not _ca_record[0] or _ca_type(_ca_dispatch) is not _ca_function: + raise _ca_error('Cold authority caller dispatcher identity differs') + for (_ca_name, _ca_getter), _ca_expected in _ca_zip(_ca_p[4], _ca_record[1:7]): + if _ca_id(_ca_getter(_ca_dispatch, _ca_function)) != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher environment differs') + if _ca_record[4] is not None or _ca_record[5] is not None or _ca_record[7]: + raise _ca_error('Cold authority caller dispatcher defaults contract differs') + for _ca_cell, _ca_expected in _ca_record[8]: + try: + _ca_observed_id = _ca_id(_ca_p[6](_ca_cell, _ca_p[5])) + except _ca_value_error: + raise _ca_error('Cold authority caller dispatcher cell became empty') from None + if _ca_observed_id != _ca_id(_ca_expected): + raise _ca_error('Cold authority caller dispatcher cell differs') + result = _ca_dispatch(1, *_ca_args, **_ca_kwargs) + state['backend_derivation'] = state['cache_binding']['owner'].binding_derivation + return result diff --git a/research/h25-resource-contract-readable-inputs/model-fit-dispositions.json b/research/h25-resource-contract-readable-inputs/model-fit-dispositions.json new file mode 100644 index 0000000000..596020382e --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/model-fit-dispositions.json @@ -0,0 +1,644 @@ +{ + "V5_known_obstructions_removed_for_default_synthetic_contexts": true, + "conditional_byte_calculation": { + "R_one_upper": 328800, + "full_two_owner_upper": 2232512, + "host_wire_upper": 4005142 + }, + "decision": "FULL_FIT_INCONCLUSIVE_NO_EXECUTION", + "identities": { + "H02_row": "H6 = H3 +(S0+S1+78) +O +delta_H", + "journal": "J6 = J3 +2*(S0+S1+78) +O +delta_J", + "optimized_H02_row_requirement": "(S0+S1+78)+O+delta_H <=478785", + "optimized_journal_requirement": "2*(S0+S1+78)+O+delta_J <=195979", + "repetition": "Each fifth field is in direct journal and repeated once in H02 preceding-journal capture; full O is retained in H02 and again in genuine host final capture, not every synthetic artifact.", + "snapshot_enforced_only": "S_i<=262144 if encode succeeds; this is not evidence actual complete capture fits." + }, + "mode_context_NOT_transferred": { + "normal": { + "A21": [ + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1530, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-START", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1116 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2669, + "old_frame_filename_byte_lengths": [ + [ + [ + 190, + 190, + 185 + ] + ] + ], + "raw_index": 86, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1530, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-PLAN", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1116 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2668, + "old_frame_filename_byte_lengths": [ + [ + [ + 190, + 190, + 185 + ] + ] + ], + "raw_index": 87, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1530, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-INPUT", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1116 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2669, + "old_frame_filename_byte_lengths": [ + [ + [ + 190, + 190, + 185 + ] + ] + ], + "raw_index": 88, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1530, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-INVERSE", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1116 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2671, + "old_frame_filename_byte_lengths": [ + [ + [ + 190, + 190, + 185 + ] + ] + ], + "raw_index": 89, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1530, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-RAW", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1116 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2667, + "old_frame_filename_byte_lengths": [ + [ + [ + 190, + 190, + 185 + ] + ] + ], + "raw_index": 90, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1530, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-VALIDATION", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1116 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2674, + "old_frame_filename_byte_lengths": [ + [ + [ + 190, + 190, + 185 + ] + ] + ], + "raw_index": 91, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1530, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-END", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1116 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2667, + "old_frame_filename_byte_lengths": [ + [ + [ + 190, + 190, + 185 + ] + ] + ], + "raw_index": 92, + "trace_frame_counts": [ + [ + 3 + ] + ] + } + ], + "H02_raw_observed": 569487, + "H02_row_observed": 569740, + "H02_row_slack_NOT_fit": 478836, + "journal_observed_NOT_V6_bound": 1376441, + "journal_slack_NOT_fit": 196423, + "old_legacy_rows": [ + 49191, + 49191 + ], + "prefix70_observed": 564172, + "result_observed_encoded_bytes": 24345, + "result_shape": { + "depth": 6, + "integer_occurrences": 789, + "max_bytes_atom": 18, + "nodes": 2583, + "string_utf8_bytes": 15113 + }, + "small_stdout_observed": 797, + "small_stdout_shape": { + "depth": 2, + "integer_occurrences": 4, + "max_bytes_atom": 0, + "nodes": 68, + "string_utf8_bytes": 595 + } + }, + "optimized": { + "A21": [ + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1539, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-START", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1125 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2678, + "old_frame_filename_byte_lengths": [ + [ + [ + 193, + 193, + 188 + ] + ] + ], + "raw_index": 86, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1539, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-PLAN", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1125 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2677, + "old_frame_filename_byte_lengths": [ + [ + [ + 193, + 193, + 188 + ] + ] + ], + "raw_index": 87, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1539, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-INPUT", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1125 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2678, + "old_frame_filename_byte_lengths": [ + [ + [ + 193, + 193, + 188 + ] + ] + ], + "raw_index": 88, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1539, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-INVERSE", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1125 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2680, + "old_frame_filename_byte_lengths": [ + [ + [ + 193, + 193, + 188 + ] + ] + ], + "raw_index": 89, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1539, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-RAW", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1125 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2676, + "old_frame_filename_byte_lengths": [ + [ + [ + 193, + 193, + 188 + ] + ] + ], + "raw_index": 90, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1539, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-VALIDATION", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1125 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2683, + "old_frame_filename_byte_lengths": [ + [ + [ + 193, + 193, + 188 + ] + ] + ], + "raw_index": 91, + "trace_frame_counts": [ + [ + 3 + ] + ] + }, + { + "artifact_shape": { + "depth": 4, + "integer_occurrences": 8, + "max_bytes_atom": 1539, + "nodes": 105, + "string_utf8_bytes": 720 + }, + "id": "A21-pending-END", + "native_trace_shapes": [ + { + "depth": 5, + "integer_occurrences": 18, + "max_bytes_atom": 0, + "nodes": 90, + "string_utf8_bytes": 1125 + } + ], + "observed_artifact_bytes_NOT_TRANSFERRED": 2676, + "old_frame_filename_byte_lengths": [ + [ + [ + 193, + 193, + 188 + ] + ] + ], + "raw_index": 92, + "trace_frame_counts": [ + [ + 3 + ] + ] + } + ], + "H02_raw_observed": 569538, + "H02_row_observed": 569791, + "H02_row_slack_NOT_fit": 478785, + "journal_observed_NOT_V6_bound": 1376885, + "journal_slack_NOT_fit": 195979, + "old_legacy_rows": [ + 49194, + 49194 + ], + "prefix70_observed": 564214, + "result_observed_encoded_bytes": 24345, + "result_shape": { + "depth": 6, + "integer_occurrences": 789, + "max_bytes_atom": 18, + "nodes": 2583, + "string_utf8_bytes": 15113 + }, + "small_stdout_observed": 797, + "small_stdout_shape": { + "depth": 2, + "integer_occurrences": 4, + "max_bytes_atom": 0, + "nodes": 68, + "string_utf8_bytes": 595 + } + } + }, + "new_actual_observations": 0, + "no_execution_grant": true, + "per_cap": { + "16MiB_host_terminal_bytes": { + "assumptions": [ + "journal/result conditional bounds above", + "both snapshot encodes admitted<=262144", + "each original writer row bytes admitted<=65536,exact5records", + "each receipt<=1024encoded bytes by fixed11field source shape", + "per-owner metadata<=1024encoded bytes", + "successful final native trace<=65536,host fixed metadata<=4096" + ], + "bound": 4005142, + "decision": "CONDITIONAL_WIRE_BYTE_SUBBOUND_ONLY_NOT_FULL_FIT", + "node_depth_caveat": "Source native graphs are serialized in partial_nodes and snapshot plus completed trace products. This byte sub-bound does not prove200000nodes/32depth at the enclosing encode, graph success, or allocation/RSS fit." + }, + "1GiB_AS_RSS_and180_390_cost": { + "basis": "Multiple Python containers,private traceback/frame owners,encoded byteparts/joined buffers and pending records coexist. Wire lengths alone do not upper-bound allocator/RSS/CPU/wall. No measured V6 costs or fit.", + "decision": "UNPROVEN; SEPARATE_COMPLETE_RESOURCE_GATE" + }, + "1MiB_row_H02": { + "basis": "H02row must meet symbolic inequality above. It retains both new snapshots plus complete fullO; original R3row569740/569791 and slack478836/478785 are not a V6 upper bound.", + "decision": "INCONCLUSIVE" + }, + "1_5MiB_journal": { + "basis": "Optimized old slack195979; new required S_i/O unknown. The enforced262144snapshot cap permits a range far larger than this slack. No new global overflow or successful-fit proof follows.", + "decision": "INCONCLUSIVE_BLOCKING" + }, + "2MiB_actual_return": { + "basis": "Original model return shape/source predicates unchanged; counters vary but admitted128-bit representation bound used. Assumes original99-case return reached; proves no ability to reach it.", + "bound": 57483, + "decision": "CONDITIONALLY_FITS_UNCHANGED_RESULT_SHAPE" + }, + "2MiB_stdout_65536_queue_receipt": { + "basis": "Host success stdout and JSON queue receipt carry counts/digests/artifactsize,not fullO. Their original schema/control gates remain. Unexpected/late capture errors retain original2MiBcombined stream cap; no universal successful failure-reporting fit inferred.", + "decision": "SUCCESS_RECEIPT_SHAPE_BOUNDED; FAILURE_COMPLETENESS_AND_FULL_FIT_UNRESOLVED" + }, + "2MiB_typed_builder_return": { + "assumptions": [ + "119source-fixed labels<=64UTF8bytes", + "each raw row admitted within1MiB and journal within1572864", + "chunks<=65536", + "source integers<=128bits" + ], + "bound": 1588032, + "decision": "CONDITIONALLY_FITS_BYTES_IF_JOURNAL_AND_LABEL_CENSUS_ADMITTED", + "overhead_bound": 15168, + "scope": "Outer journal-as-DATA value bytes; not H02row/journal/payload admission." + }, + "512nodes_16depth_262144snapshot": { + "basis": "Actual held types, marker roots, error context graphs/native traces need source-proved bounds; R3 did not serialize held. Caps alone do not prove successful snapshots.", + "decision": "FAIL_CLOSED_CAPS_VERIFIED; SUCCESSFUL_FIT_UNPROVED" + }, + "65536_bytes_atom": { + "basis": "SyntheticNone omits unrelated O. Individual mandatory A21 full artifact and other default atom sizes still need a metadata/path/ID/event bound. R3 A21observed2667..2683 is context only; empty artifact forbidden.", + "decision": "V5_FORCED85K_PAYLOAD_REMOVED; WHOLE_FIT_PENDING" + }, + "mandatory_A21": { + "basis": "Seven pending cases still require full decoded data. New empty ownership field adds29encoded bytes to a successful same-shaped artifact before path/ID/trace/I-O deltas. The observed native graph is one object/threeframes; source null branch adds no call frame. Need bound on filename lengths and native integer widths/context shape, not old bytes transfer.", + "decision": "SOURCE_SHAPE_PRESERVED; SIZE_CONDITIONAL_UNRESOLVED" + } + }, + "schema": "h25-v6-independent-fit-dispositions-v1", + "source_domain_variation": { + "filenames": "Actual configured V6 source filenames not supplied yet. Bounds require their admitted UTF8 byte length P; R3 wire lengths cannot be copied.", + "integer_wire_upper": "128-bit source domain: at most42bytes per signed encoded integer,41for nonnegative ID. Rejection outside domain; no guessed observed ID width.", + "native_graph": "Expected current capture is small by source, but exact error/context/trace products were absent from R3. Bound proof or separately authorized capture diagnostic remains required." + }, + "symbolic_variables": { + "F_i": "Encoded fifth-field tuple wrapper plus snapshot =S_i+39bytes.", + "O": "Exact added full two-owner ownership field in H02 terminal; includes partial_nodes,snapshot,completed_native_error_snapshots,original receipt/writer rows and metadata.", + "S_i": "Exact complete encoded returned-ownership snapshot for normal/injected legacy invocation; no such actual post-writer graph exists in R3 data.", + "delta_H": "Analogous signed H02-row differences, excluding F0+F1 and explicit O.", + "delta_J": "All other signed V6-R3 journal differences: actual source paths/line offsets/native IDs/type IDs, new29-byte empty field in default artifacts, digit/chunk headers and altered fake partial-I/O event/counter totals." + } +} diff --git a/research/h25-resource-contract-readable-inputs/model-source-fit-review.json b/research/h25-resource-contract-readable-inputs/model-source-fit-review.json new file mode 100644 index 0000000000..eea5d1c547 --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/model-source-fit-review.json @@ -0,0 +1,133 @@ +{ + "actual_R3_context_not_transferred": { + "bytes": 12568, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/DATA-CONTEXT.json", + "sha256": "11d4694b00b8b1cf57d8a5e649ed579341c412dead4bf1facf82f69c3f7f0f3c" + }, + "actual_stage_approval": false, + "all41inverse_rows_verified": true, + "ancestor_inverse_rows": 36, + "audit_source": { + "bytes": 22377, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/passive_source_fit_audit.py", + "sha256": "691cc53dbf9a146989d431850f296afe7bf4a3626de2fd7cff4e624391037eaa" + }, + "author483checks_treated_as_DATA_only": true, + "binding_audit": { + "bytes": 4415, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/LEAF-BINDING-AUDIT.json", + "sha256": "91f9775153f007f5fa1f92a7b8d95084e1ae7b0cc2278832afd97a05b5bc8951" + }, + "blocking_fit_findings": [ + "No admitted complete upper bound for new S0/S1/O/delta_J/delta_H within195979optimized journal slack and478785H02row slack.", + "R3did not retain actual post-writer held ownership; enforced snapshot caps alone do not prove successful capture/wholefit.", + "Node/depth, all default artifact atoms, complete RSS/address/CPU/wall fit remain open." + ], + "blocking_source_findings": [], + "cases_per_mode": 99, + "checks": 882, + "checks_failed": 0, + "conditional_subbounds_bytes": { + "actual_model_return_if_original_shape_returned": 57483, + "host_wire_if_inner_admissions_and_stated_assumptions_hold": 4005142, + "outer_journal_value_if_J_admitted": 1588032 + }, + "conditions": { + "bytes": 2034, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/CONDITIONS.json", + "sha256": "3dba1027198183f80e41320873266e272a07e55d059e4b613fbd0a88484f2a2f" + }, + "controls_unexecuted_unfunded": { + "old": 23, + "raw": 6, + "scope": 4 + }, + "decision": "SOURCE_SCOPE_ACCEPTED_FULL_FIT_INCONCLUSIVE_NO_EXECUTION", + "diagnostic_next_action": { + "bytes": 5436, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/DIAGNOSTIC-CONTRACT.json", + "sha256": "76437ba14ee537f8b76de871b030c754cf1d5f500208c66377d518727d60e9fb" + }, + "fit_accepted": false, + "fit_decision": "FULL_FIT_INCONCLUSIVE_NO_EXECUTION", + "fit_dispositions": { + "bytes": 20005, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/FIT-DISPOSITIONS.json", + "sha256": "bdf68ff81d29208acbdcfdb628813431ab3a14313f8048f09d301249a17a1468" + }, + "grants_execution": false, + "hash_order": "Review/profile/binding and fit dispositions frozen before source-only leaf. Review does not hash leaf. Fit remains explicitly unresolved; all oldV5negative/no-grant artifacts preserved.", + "input_pin_checks": 331, + "mapped_modules": 24, + "minimal_next_action": "Parent may source-construct/review/fund the explicit one-shot diagnostic proposal; no new run is authorized. Then independent raw-data/domain upper bounds must close residual inequalities and all remaining paths before fullV6grant.", + "new_inverse_rows": 5, + "new_target_attempts": 0, + "operations": { + "network_browser_Git_stage_ledger_lock_mutations": 0, + "owned_mutations_only": true, + "source_AST_text_hash_JSON_and_existing_R3_DATA_only": true, + "target_model_parser_fixture_vector_codec_snapshot_helper_author_checker_calls": 0 + }, + "original_predicates_oracles_order_preserved": true, + "parent_checkpoint_unchanged": { + "conservative_seconds": 843.6901823099704, + "fullscience": 0, + "gain": false, + "records": 130 + }, + "pins": { + "host": { + "bytes": 128442, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/field-elf-gap-model-harness-v5/source_model_host_v5.py", + "sha256": "f64ea44b937da58fc7c3639975d367f81f61ac5b6abc99ff4e298f7f338c7dd2" + }, + "readback": { + "bytes": 9464, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/field-elf-gap-model-harness-v6/FINAL-READBACK.json", + "sha256": "8845abef9a15f7b8624612f450854054fea6fec3a0f8fb4cfea23e4fecdb3243" + }, + "readiness": { + "bytes": 8101, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/field-elf-gap-model-harness-v6/SOURCE-READINESS.json", + "sha256": "a7b801d776a9f6c75bec37c7e70d4698e335a39a9fc871b582d76b9dc4e298b5" + }, + "source_map": { + "bytes": 9684, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/field-elf-gap-model-harness-v6/SOURCE-MAP.json", + "sha256": "e54ff0c3bd8f84037e7d8a6fb8b8f323b06ee6c93f0ffc8bdf9e44422d765d95" + } + }, + "profile_scope": { + "bytes": 1621, + "mode": 292, + "path": "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/review/model-v6-source-fit-v1/PROFILE-SCOPE.json", + "sha256": "1caf61e9126e8f1db89f195aecb152c398aa0b1e7ad322bb175e9dd7fb5833ba" + }, + "residual_conditions": { + "H02_row": "H6 = H3 +(S0+S1+78) +O +delta_H", + "journal": "J6 = J3 +2*(S0+S1+78) +O +delta_J", + "optimized_H02_row_requirement": "(S0+S1+78)+O+delta_H <=478785", + "optimized_journal_requirement": "2*(S0+S1+78)+O+delta_J <=195979", + "repetition": "Each fifth field is in direct journal and repeated once in H02 preceding-journal capture; full O is retained in H02 and again in genuine host final capture, not every synthetic artifact.", + "snapshot_enforced_only": "S_i<=262144 if encode succeeds; this is not evidence actual complete capture fits." + }, + "reviewer": "/root/sol_model_r3_outcome_review", + "same_base_fixture_constructions_per_mode": 11, + "schema": "h25-v6-independent-source-fit-review-v1", + "shared_input_pins": 141, + "source_accepted": true, + "source_decision": "SOURCE_MODEL_HARNESS_APPROVED_ONLY", + "source_scope": "Exact V6 optional source-bound actual ownership packet plus unchanged V5host/22V4modules, precomparison raw ownership and conditional initial startup source profile.", + "subbound_scope": "These byte subbounds do not admit journal/H02/snapshot success, enclosing node/depth, RSS/cost or a99case execution.", + "unchanged_external_modules": 22 +} diff --git a/research/h25-resource-contract-readable-inputs/native-packet.py.txt b/research/h25-resource-contract-readable-inputs/native-packet.py.txt new file mode 100644 index 0000000000..1d4f3d67f2 --- /dev/null +++ b/research/h25-resource-contract-readable-inputs/native-packet.py.txt @@ -0,0 +1,346 @@ +"""Cold native metadata packet orchestration; source draft, all gates closed. + +This module is imported only after the pristine root and native TCB receipt. +The parent owns the outer process guard. No binary or runtime PASS is reused. +""" +import hashlib +import json +from pathlib import Path +import stat +import cold_build_evidence +import sysconfig + +import adapters + +BOOTSTRAP_ROOT_SHA256 = 'f5a2d33f2b4d3651f214156a0e7094c2bb516ce2d5ab7698d18c11f98f35dee0' +PROBE_PROVIDER_SHA256 = '9cbb7368f89e71d1e6cc46db5dc77efed3e03ed2a801c98c88fe316e4d9f3ef2' +BUILD_CONTRACT = {'compiler': ('/usr/bin/x86_64-linux-gnu-gcc-13',), + 'dependencies': (('/usr/bin/x86_64-linux-gnu-as', + '21aff249b692b5c31a44007491f922dcb49f41323e362c57d2ada3f52eddb7f0', + 745768), + ('/usr/bin/x86_64-linux-gnu-gcc-13', + '1b99826121ae6682a634e5efe09bd3e3df58ce58e0b28f849114ab5b89139c26', + 1023032), + ('/usr/bin/x86_64-linux-gnu-ld.bfd', + 'e9ceb054c12207970f2726dfc07e9a66b411602748628baf27399f02a9bbb31b', + 1359128), + ('/usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o', + '667ff5f1edc931d44d1f2bb44d313907aa274bcc207c0beff71a398335f0d29f', + 2752), + ('/usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o', + '9c8b2caad195193301ef072895dc89bea1d23371d4c19accd821debe27773063', + 1168), + ('/usr/lib/gcc/x86_64-linux-gnu/13/libgcc.a', + 'd9376c55f97863a4e5fbb6c6beca2591b319bf786f3a7ca56da8964c5662171f', + 3093656), + ('/usr/lib/gcc/x86_64-linux-gnu/13/libgcc_eh.a', + 'f853cbbf842ff8714cc8dd986e2fd5bb309d34d490b0707203223ee4d52c76bc', + 66708), + ('/usr/lib/gcc/x86_64-linux-gnu/13/libgcc_s.so', + '69a56a9993b7729b29b274e65016031c81f2397f176ed5ad44d59bd50425e0bd', + 132), + ('/usr/lib/x86_64-linux-gnu/crti.o', + '077ccb6c68db1794da3ee262c4a16a3c6f8e902845dd0829110ad4b7065e5aa3', + 1192), + ('/usr/lib/x86_64-linux-gnu/crtn.o', + 'a2266079f95b84ccc2162ebbf279bcd78858a748aa1882e0bdb912316c76a58f', + 760), + ('/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2', + 'c20a2dc8917c755f02b94049356320fe1f62ac7d9f8994731f807d9df39302da', + 236616), + ('/usr/lib/x86_64-linux-gnu/libbfd-2.42-system.so', + '11f084bc6ff5fc64e91c0b6422040fab1245419e7ff29560a95c1176ce1b9ff4', + 1479888), + ('/usr/lib/x86_64-linux-gnu/libc.so', + 'fe2a4ce2930fc6b3966aa987fae808375446c8d3823b8c21792e991aad9c75df', + 283), + ('/usr/lib/x86_64-linux-gnu/libc.so.6', + '3a15d66867d83762c7f2f1e37359cb8f6c5743edb369c65285cb0b1c4f7498bf', + 2129424), + ('/usr/lib/x86_64-linux-gnu/libc_nonshared.a', + '3341391290ddd596521a61152b4e2612f4625cc85f737d875b918f6cfb2b2786', + 5594), + ('/usr/lib/x86_64-linux-gnu/libctf.so.0.0.0', + '25c8f765c259d05b59a3dc3634d711912a7f5ce9be8a28ace081507b925b3ad1', + 220384), + ('/usr/lib/x86_64-linux-gnu/libgcc_s.so.1', + 'd93224d2b0dab4247598be683adca02f5cf00586f99c187579cd7e92058fb7cb', + 183024), + ('/usr/lib/x86_64-linux-gnu/libgmp.so.10.5.0', + '0ccdfb6d6f5c039465f6d002cf7e4c072d48ac6a2cffc8dd6c748dec31592804', + 534896), + ('/usr/lib/x86_64-linux-gnu/libisl.so.23.3.0', + 'db4f717fd1678b48e5dddea1cbdd2d239594a70b57e96d0923bfd9533351efa8', + 1863352), + ('/usr/lib/x86_64-linux-gnu/libjansson.so.4.14.0', + 'c49935a4b3ac599064281b1f257576087806d0dad7ec46f353bd983b052c5e26', + 64008), + ('/usr/lib/x86_64-linux-gnu/libm.so.6', + 'fce00b6f25f459cf4ae0b7fae4257909a1a8a86f9149e7c029a5d617baf1ccd0', + 952616), + ('/usr/lib/x86_64-linux-gnu/libmpc.so.3.3.1', + '91d2b2b0b794028c733431e01acc227ff39ee289384fdf22869c8b42ad3aaa3b', + 134440), + ('/usr/lib/x86_64-linux-gnu/libmpfr.so.6.2.1', + '2156351fa3dedd04a7381c6ac7a8a26efa2d6fb08b80f8a2d644ccdd653710ae', + 760464), + ('/usr/lib/x86_64-linux-gnu/libsframe.so.1.0.0', + '1693a2dbd77c909d279ae34aa9b5d8d08d97f116f8d0ed724063df11151b3c69', + 35168), + ('/usr/lib/x86_64-linux-gnu/libz.so.1.3', + 'f61677c7bdb7c2aa2a243ea781bfd16afcb361cede7b4ef76127a9d8eb9a5242', + 113000), + ('/usr/lib/x86_64-linux-gnu/libzstd.so.1.5.5', + '0a2128bc10841fb29e76d08d945864dfb0b6a66da5df6df5d8299197439e54bb', + 755864), + ('/usr/libexec/gcc/x86_64-linux-gnu/13/cc1', + '5d1679131184e2de4435b426eb264bf13472fe026db8e5c6bc97445814e8e2f4', + 30487984), + ('/usr/libexec/gcc/x86_64-linux-gnu/13/collect2', + '4d1f341ae5b763b513258ee2812422a45e063c30a2f1924a0cf63d3699f3a158', + 336056), + ('/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so', + '14469ff8498fca3871c29dbf678c2330123207fffb8308151314a08395309ddf', + 68296)), + 'extension_suffix': '.cpython-312-x86_64-linux-gnu.so', + 'include': '/usr/include/python3.12', + 'timeout_seconds': 15} +SOURCE_EXECUTION_CONTRACT = {'status': 'INDEPENDENT_SOURCE_AND_FINITE_EXECUTION_APPROVED', 'scope': 'Reviewed source and finite control union only. Actual configured stage and outer queue still require separate independent approval before any execution. This literal is not a runtime PASS or full-funding approval.', 'actual_stage_queue_approval_required': True, 'independent_source_and_route_reviews': {'review/predecessor-entry-execution-v1/REVIEW.json': '77bb53df13164d6aaf4445602ae6433632105f13f001133ea00135f86770a5d9', 'review/cold-authority-v7-source-v1/final-delta-v1/REVIEW.json': 'b474afae9b78464aac8385b4c892e343ddb0b92329ef5a3f630cb49d171cf0a7', 'review/cold-authority-v7-source-v1/control-oracle-v8-delta/REVIEW.json': '026bf7b55c6960c037131893c9af3184842238d2ea0ae7738bb7a3565f876f21', 'review/cold-authority-v7-source-v1/control-disposal-v9-delta/REVIEW.json': '63074555355c2f89d5f58904d62fbc05098e902fca8e6b052aa0f53faa568ea8', 'review/cache-validity-v8-source/REVIEW.json': 'bc9d08ed88f23bc7b90778e620bbfbd52ab3f6ab5c5de1f1c82e53b4e76f14e6', 'review/cache-validity-v8-source/control-oracle-v9-delta/REVIEW.json': '57df4c14ca3353b9d390b9f3126bbb99515e9ece4cdcecbf3104f81141262be4', 'review/combined-v2-log-repair-source/REVIEW.json': 'c4af401839798a5fe27720578eda54d2943373c938a0864efc4bd8bd252dbe1b', 'review/predecessor-installed-v1/REVIEW.json': 'f7ffc373721c818c15f5feed78d4776704af2945a712d8e4b3d503cfe21e05c7', 'review/cold-authority-scalar-vectors-v1/REVIEW.json': '157195cc4cbfcd11123ff692e370122465aece2f6dbbe64afe2dc2023f2f6a49', 'review/scalar-vector-diagnostic-v1-concrete/REVIEW.json': 'a2a21a7740a184ec80808d038c8230a5757c120c8a0077f4b9135d75cb71fa8d', 'review/authority-scalar-mechanism-v1-execution/REVIEW.json': '4620090d441a95b357afcf02c72effb3502bf0ef9dc719aa7c92596754793d7a'}, 'full_candidate_admission': False, 'scalar_reuse_scope': 'Observed scalar metadata reused only within one existing private callback-free interval; every independent expected comparison retained. Not a saved runtime PASS.', 'mechanism_diagnostic': '14 cases/19 scopes independently accepted; instrumented counts are not production timings. Existing complete live finite union still required.'} +FULL_EXECUTION_CONTRACT = {'activity': 'S03.08', 'approval_assertion': 'No complete caller-and-cost approval is asserted by this pending definition. Only a real independent complete original source/caller/cost acceptance may authorize the exact final status literal; configured approval never substitutes for current runtime predicates or measured fit.', 'caller_definition': {'bytes': 10515, 'path': '/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/cache-s0308-source-completion-v1/contracts/CALLER-EQUALITY-DEFINITION-v1.json', 'sha256': '4a11f90727c636bdbaaf683d1ac95aa9234324698fb594a7da92a92f6a45c7eb'}, 'complete_cost_definition': {'bytes': 9184, 'path': '/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/cache-s0308-source-completion-v1/contracts/COMPLETE-SYMBOLIC-COST-DEFINITION-v1.json', 'sha256': '6ab22ebb387f15f9a1fd91e257ecae649eb4b177af32d4652c2eaec061e3b48c'}, 'configuration_binding': 'Exact actual selected tuple is bound by existing immutable stage/Root/source maps and external independent review/installation metadata. No runtime approval loader or new trust service is added.', 'execution_authorized': False, 'native_source_profile_definition': {'bytes': 8040, 'path': '/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/areas/cache-s0308-source-completion-v1/contracts/NATIVE-SOURCE-PROFILE-DEFINITION-v1.json', 'sha256': 'bc444f4d844629691e9b16b0c5403cf680daacb5afc5748df983363b2bf259af'}, 'original_guard': {'approved_status_required': 'INDEPENDENT_COMPLETE_COST_AND_CALLER_APPROVED', 'condition': 'type(FULL_EXECUTION_CONTRACT) is dict and FULL_EXECUTION_CONTRACT.get(status)==INDEPENDENT_COMPLETE_COST_AND_CALLER_APPROVED', 'function': 'require_execution_contract'}, 'owner': {'attribute': 'FULL_EXECUTION_CONTRACT', 'module': 'driver.native_packet', 'predecessor': {'bytes': 21478, 'path': '/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/h25-data-handling-20261028/stages/combined-finite-v8/integration/native_packet.py', 'sha256': '6adbcd1dfeb77fb6da7ee8f725796b1bfdbf0a4f397ef23f3a266a6b89d55892'}}, 'runtime_observations': 0, 'schema': 'cache-s0308-typed-full-source-contract-v1', 'selected_caller_roles': ['FULL_BASELINE_NORMAL', 'FULL_CANDIDATE_NORMAL', 'P08_BODY_NORMAL', 'ABSENT_RECORD_NORMAL'], 'source_requirements': ['CP01', 'CP02', 'CP03', 'CP04', 'CP05', 'CP06', 'CP07', 'CP11', 'CP12', 'CP13', 'CP14', 'CP15'], 'status': 'INDEPENDENT_COMPLETE_COST_AND_CALLER_APPROVED'} + +# These names/counts are source-derived expectations, never observed results. +CONTROL_STATUS = { + 'native_probe': 'NATIVE_METADATA_CONTROLS_PASS', + 'bootstrap_preload': 'BOOTSTRAP_PRELOAD_CONTROLS_PASS', + 'bootstrap_late': 'BOOTSTRAP_LATE_CONTROL_PASS', + 'native_metadata': 'PASS', +} +_SOURCES = ( + ('production', 'dict_probe_v2.c', '_h25_dict_probe'), + ('watcher', 'probe_watcher_fixture.c', '_h25_probe_watch_fixture'), + ('bounds', 'probe_bounds_fixture_v2.c', '_h25_probe_bounds_fixture'), +) + + +def need(condition, message): + if not condition: + raise RuntimeError(message) + + +def require_execution_contract(arm, finite_only): + need(arm in ('baseline', 'candidate'), 'Unsupported combined arm') + need(type(SOURCE_EXECUTION_CONTRACT) is dict and + SOURCE_EXECUTION_CONTRACT.get('status') == 'INDEPENDENT_SOURCE_AND_FINITE_EXECUTION_APPROVED', + 'Combined v2 execution withheld: source/TCB/compiler/finite queue gates are not configured') + if not finite_only: + need(type(FULL_EXECUTION_CONTRACT) is dict and + FULL_EXECUTION_CONTRACT.get('status') == 'INDEPENDENT_COMPLETE_COST_AND_CALLER_APPROVED', + 'Both full arms withheld: cache V7 complete cost and full-caller equality remain unqualified; no historical factor or cached PASS applies') + + +def _file(path): + path = Path(path) + need(path.is_file() and not path.is_symlink(), 'Expected regular native source or binary') + before = path.stat() + digest, size = hashlib.sha256(), 0 + with path.open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + size += len(block) + need(size <= 64 * 1024 * 1024, 'Native build input/output exceeds source-reviewed file bound') + digest.update(block) + after = path.stat() + identity = lambda value: (value.st_dev, value.st_ino, value.st_mode, value.st_size, + value.st_mtime_ns, value.st_ctime_ns) + need(identity(before) == identity(after) and size == before.st_size, 'Native file changed during hash') + return {'sha256': digest.hexdigest(), 'bytes': size, 'mode': stat.S_IMODE(after.st_mode)} + + +def _source(root, relative, custody): + need(relative in custody, 'Native source absent from immutable stage custody') + row = _file(root / relative) + need({key: row[key] for key in ('sha256', 'mode')} == custody[relative], + 'Native source differs from immutable stage') + return row + + +def _fresh(packet): + need(not packet['late_started'], 'Native qualification is closed after late audit control') + api = packet['bootstrap_api'] + need(api[0]() == BOOTSTRAP_ROOT_SHA256, 'Actual bootstrap source changed') + return api[1](packet['bootstrap_capability'], PROBE_PROVIDER_SHA256) + + +def _preflight(packet): + _fresh(packet) + # Identity is checked immediately before the mutable root dispatch lookup. + packet['bootstrap_api'][0]() + return packet['bootstrap_root'].preflight(packet['bootstrap_capability']) + + +def _dependencies(): + need(type(BUILD_CONTRACT) is dict and + set(BUILD_CONTRACT) == {'compiler', 'dependencies', 'extension_suffix', 'include', 'timeout_seconds'}, + 'Cold compiler/header/link contract is not configured') + need(type(BUILD_CONTRACT['compiler']) is tuple and BUILD_CONTRACT['compiler'] and + all(type(arg) is str for arg in BUILD_CONTRACT['compiler']) and + Path(BUILD_CONTRACT['compiler'][0]).is_absolute(), 'Pinned compiler command required') + need(type(BUILD_CONTRACT['dependencies']) is tuple and BUILD_CONTRACT['dependencies'], + 'Pinned compiler/link dependency closure required') + rows = {} + for path, expected_sha, expected_size in BUILD_CONTRACT['dependencies']: + need(type(path) is str and Path(path).is_absolute(), 'Compiler dependency path must be absolute') + row = _file(path) + need(row['sha256'] == expected_sha and row['bytes'] == expected_size, + 'Cold compiler/link dependency identity differs') + rows[path] = row + need(BUILD_CONTRACT['compiler'][0] in rows, 'Compiler executable not in authenticated build closure') + return rows + + +def prepare(root, output, custody, bootstrap_root, bootstrap_capability, bootstrap_api): + """Build three cold modules before any original or new control is run.""" + root, output = Path(root), Path(output) + packet = {'bootstrap_root': bootstrap_root, 'bootstrap_capability': bootstrap_capability, + 'bootstrap_api': bootstrap_api, 'builds': {}, 'controls': {}, + 'late_started': False, 'late_completed': False, 'direct_close_stop': None} + _fresh(packet) + _source(root, 'integration/cold_build_evidence.py', custody) + before = _dependencies() + need(sysconfig.get_config_var('EXT_SUFFIX') == BUILD_CONTRACT['extension_suffix'] and + sysconfig.get_paths()['include'] == BUILD_CONTRACT['include'], + 'Native build Python suffix/header path differs') + need(type(BUILD_CONTRACT['timeout_seconds']) is int and + 1 <= BUILD_CONTRACT['timeout_seconds'] <= 90, 'Cold compiler timeout outside reviewed bound') + directory = output / 'cold-native-metadata' + need(not directory.exists(), 'Refusing any prior native metadata build directory') + directory.mkdir() + packet['preflight_before_build'] = _preflight(packet) + source_root = root / 'areas/cache-validity/probe-native' + sources_before = {filename: _source(root, 'areas/cache-validity/probe-native/' + filename, custody) + for _, filename, _ in _SOURCES} + for key, filename, module_name in _SOURCES: + target = directory / (module_name + BUILD_CONTRACT['extension_suffix']) + command = list(BUILD_CONTRACT['compiler']) + [ + '-shared', '-fPIC', '-O3', '-std=c11', '-Wall', '-Wextra', '-Werror', + '-I' + BUILD_CONTRACT['include'], str(source_root / filename), '-o', str(target)] + context = {'source': sources_before[filename], 'source_name': filename, + 'no_cached_binary': True, 'module_name': module_name, 'target': str(target)} + attempt = cold_build_evidence.run(command, directory, key, + BUILD_CONTRACT['timeout_seconds'], context) + receipt = {'command': command, 'returncode': attempt['returncode'], + 'stdout': attempt['logs']['stdout'], 'stderr': attempt['logs']['stderr'], + 'attempt_path': attempt['attempt_path'], 'attempt_journal_path': attempt['journal_path'], + 'process_policy': attempt['process_group_policy'], + 'source': sources_before[filename], 'source_name': filename, + 'no_cached_binary': True, 'module_name': module_name, 'path': str(target), + 'status': 'EXIT0_LOGS_STABLE_PENDING_FINAL_SOURCE_CUSTODY'} + (directory / (key + '-build.json')).write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') + need(attempt['returncode'] == 0, 'Cold metadata compilation failed; no retry') + receipt['binary'] = _file(target) + packet['builds'][key] = receipt + (directory / (key + '-build.json')).write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') + after = {filename: _source(root, 'areas/cache-validity/probe-native/' + filename, custody) + for _, filename, _ in _SOURCES} + need(sources_before == after and _dependencies() == before, 'Cold build source/compiler custody changed') + for key, receipt in packet['builds'].items(): + receipt['status'] = 'COLD_NATIVE_BUILD_SOURCE_CUSTODY_PASS' + (directory / (key + '-build.json')).write_text(json.dumps(receipt, sort_keys=True, indent=2) + '\n') + packet['compiler_dependencies'] = before + packet['preflight_after_build'] = _preflight(packet) + for key, filename in (('direct_controls', 'direct_controls.py'), + ('bootstrap_controls', 'bootstrap_controls_v2.py'), + ('metadata_controls', 'metadata_controls_v3.py')): + relative = 'areas/cache-validity/probe-native/' + filename + _source(root, relative, custody) + packet[key] = adapters.load(root / relative, '_h25_v2_' + key) + production = packet['builds']['production'] + packet['extension_path'] = production['path'] + packet['extension_sha256'] = production['binary']['sha256'] + return packet + + +def _arguments(packet): + return (packet['bootstrap_root'], packet['bootstrap_capability'], packet['bootstrap_api'], + packet['extension_path'], packet['extension_sha256'], PROBE_PROVIDER_SHA256) + + +def _raw_control(packet, key): + build = packet['builds'][key] + _fresh(packet) + packet['bootstrap_api'][0]() + return packet['bootstrap_root'].load_control_module( + packet['bootstrap_capability'], build['path'], build['binary']['sha256'], build['module_name']) + + +def run_controls(packet, phases): + """No scientific authority is shared with these distinct direct fixtures.""" + pre = phases.call('bootstrap_preload_controls', packet['bootstrap_controls'].run_preload_controls, + *_arguments(packet)) + need(pre.get('schema') == 'h25-bootstrap-preload-controls-v2' and + pre.get('expected_records') == 21 and len(pre.get('records', [])) == 21 and + pre.get('scientific_calls') == 0, 'Bootstrap preload control census differs') + pre['status'] = CONTROL_STATUS['bootstrap_preload'] + packet['controls']['bootstrap_preload'] = pre + metadata = phases.call('native_metadata_controls', packet['metadata_controls'].run_metadata_controls, + packet['bootstrap_root'], packet['bootstrap_capability'], + packet['bootstrap_api'], PROBE_PROVIDER_SHA256) + need(metadata.get('schema') == 'h25-native-metadata-controls-v3' and + metadata.get('status') == 'PASS' and metadata.get('expected_records') == 16 and + metadata.get('observed_record_count') == len(metadata.get('records', [])) == 16 and + metadata.get('native_lifecycle_before') == metadata.get('native_lifecycle_after') and + metadata.get('scientific_calls') == 0 and metadata.get('native_creations') == 0 and + metadata.get('native_checks') == 0 and metadata.get('native_inspections') == 0, + 'Native metadata control census or actual lifecycle continuity differs') + packet['controls']['native_metadata'] = metadata + direct = packet['direct_controls'] + disarmed = phases.call('native_disarmed_controls', direct.run_disarmed_controls, _raw_control(packet, 'production')) + bounds = phases.call('native_bounds_controls', direct.run_bounds_controls, _raw_control(packet, 'bounds')) + watcher = _raw_control(packet, 'watcher') + provider = _fresh(packet) + binding = packet['bootstrap_api'][2](packet['bootstrap_capability'], packet['extension_path'], packet['extension_sha256']) + captured_close = binding.close + try: + result = phases.call('native_direct_controls', direct.run_controls, provider, binding, watcher) + except BaseException: + try: + captured_close() + except BaseException as close_error: + packet['direct_close_stop'] = {'type': type(close_error).__name__, 'message': str(close_error)} + raise + need(result.get('schema') == 'h25-native-direct-control-results-v1' and + result.get('inspection_calls') == 58 and len(result.get('records', [])) == 60 and + result.get('scientific_imports') == 0 and result.get('scientific_arithmetic_calls') == 0 and + len(disarmed) == 1 and len(bounds) == 1, 'Native direct/fixture control census differs') + packet['controls']['native_probe'] = { + 'status': CONTROL_STATUS['native_probe'], 'direct': result, + 'disarmed': disarmed, 'bounds': bounds, 'records': len(result['records']) + len(disarmed) + len(bounds)} + return packet['controls'] + + +def before_late(packet): + """Last fresh native/root checks, after every cache owner is terminal.""" + provider = _fresh(packet) + need(not provider._OWNERS, 'Late control requires all admitted probe owners closed') + packet['final_native_diagnostics_before_late'] = packet['bootstrap_api'][3](packet['bootstrap_capability']) + packet['final_preflight_before_late'] = _preflight(packet) + + +def late_last(packet): + """The last native/scientific call. Caller may only write/check source afterward.""" + need(not packet['late_started'], 'Late bootstrap control may run only once') + packet['late_started'] = True + result = packet['bootstrap_controls'].run_late_control_last(*_arguments(packet)) + need(result.get('schema') == 'h25-bootstrap-late-control-v2' and len(result.get('records', [])) == 1, + 'Late bootstrap control census differs') + result['status'] = CONTROL_STATUS['bootstrap_late'] + packet['controls']['bootstrap_late'] = result + packet['late_completed'] = True + return result + + +def receipt(packet): + """Pure receipt assembly; deliberately no guards, provider, or native calls.""" + return {key: packet.get(key) for key in ( + 'builds', 'compiler_dependencies', 'preflight_before_build', 'preflight_after_build', + 'final_native_diagnostics_before_late', 'final_preflight_before_late', + 'late_started', 'late_completed', 'direct_close_stop')}