diff --git a/research/early-duplicate-verify-rejection/CREDITS.md b/research/early-duplicate-verify-rejection/CREDITS.md new file mode 100644 index 0000000000..52868fd941 --- /dev/null +++ b/research/early-duplicate-verify-rejection/CREDITS.md @@ -0,0 +1,11 @@ +# Attribution and evidence boundaries + +ToikY, with substantial OpenAI Codex assistance, prepared this opt-in VERIFY-only repair candidate. The coordinator authored the patch and integration. A source-aware prototype/harness role built the genuine Git fixtures and ran the four cleared preclaim tooling calls, then authored the new harness. Separate policy, overlap/credit and metadata roles review the bounded result. There is no fresh-blind, independent-end-to-end, human or proof-kernel acceptance claim. + +- Douglas Colkitt: registered research-package runner and donation/replay governance. +- Tekalign: original committed research-package exporter. +- @aliromman, PR5728, verified head70441d90c78bdfc48aed772d2b45e05d5a38e4fb: duplicate committed-VERIFY and export-receipt rejection, typed receipt metadata and original regression tests. This package does not rediscover or repair that exporter guard. +- @aliromman, PR5726, verified head20bed137e8807376f3124dd6d03fc076e595b016: strict duplicate/nonfinite coordination metadata parsing. Coordination policy is distinct from the new VERIFY-only candidate. +- All contributors named in the unchanged vendor headers, root NOTICE and Apache-2.0 license retain credit. Their earlier suites and results are not rerun by this metadata role or counted as new scientific evidence. + +The same-byte original-tooling observation occurred after coordinator overlap clearance and before the public claim; its raw records remain preserved externally. The harness author performed one39.677-second diagnostic (144 source CLI outcomes); root inspected its raw receipt and code. Separate static policy and harness reviews share source context. Final delivery replay is reported separately in the PR/handoff. Registration/export consistency is tooling evidence, not supplier admission or mathematical acceptance. Shared-policy adoption, the legacy inventory, historical/platform coverage and all five selected assumptions remain open. diff --git a/research/early-duplicate-verify-rejection/LICENSE b/research/early-duplicate-verify-rejection/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/early-duplicate-verify-rejection/LICENSE @@ -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/early-duplicate-verify-rejection/NOTICE b/research/early-duplicate-verify-rejection/NOTICE new file mode 100644 index 0000000000..59d8e0cf31 --- /dev/null +++ b/research/early-duplicate-verify-rejection/NOTICE @@ -0,0 +1,415 @@ +A sharper exponent for integer multiplication +Copyright 2026 Douglas Colkitt + +This project includes unmodified source files from OpenAI's manuscript +"Integer multiplication below n log n" and its accompanying repository: +https://github.com/openai/math +Commit: adc7f1241b42e322a6451854ab7e4b4c146bf78a + +The original manuscript identifies OpenAI as its author. Its Apache-2.0 +license is retained at upstream/LICENSE. The exact source URLs and hashes +are recorded in upstream/manifest.json. Proposed modifications are supplied +as separate files under patches/; upstream source files remain unchanged. + +The original local research note, scripts, certificates, patches, and +documentation were prepared by Douglas Colkitt with assistance from OpenAI +Codex. The community release incorporates work by the contributors identified +in the notices below; it is not solely Douglas Colkitt's work. +This project is not an official OpenAI release or an OpenAI endorsement. + +Related contributions (not imported in this checkpoint): +Zhihao Chen (jacklightChen), PR #7, supplied an earlier ternary five-subset +motif, finite-alphabet transfer and a different compressed producer: +https://github.com/CrocSwap/integer-mult-bounds/pull/7 +The present checkpoint claims no priority for that motif. Related compressed +complex-network work was submitted by eumemic in PR #3: +https://github.com/CrocSwap/integer-mult-bounds/pull/3 +The pending contributions and their stronger bounds require their own review; +this notice does not represent adoption or verification of their claims. + +Additional community work, including parallel and superseded submissions, is +acknowledged in CONTRIBUTORS.md, with pinned submission metadata in +docs/research/contribution-snapshot.json. These acknowledgements do not imply +joint authorship of the checkpoint, incorporation of pending code, or verification +of submitted mathematical claims. Original source-specific notices remain in force. + +Community release (accepted by conditional maintainer audit): +The following original contributor notices apply to the imported PR #39 chain. +The preceding non-import statements describe the preserved 2^-30 checkpoint. + +Ternary five-subset construction and common-four-point resynthesis +Copyright 2026 Zhihao Chen (jacklightChen) + +This is Zhihao Chen's first submission of this specific construction to this +repository. Research, proof development, code and verification were prepared +with substantial assistance from GPT-6 Astra (OpenAI Codex), as identified by +the contributor. This is not independent review or an OpenAI endorsement. +Future research building on this contribution should explicitly acknowledge +Zhihao Chen (jacklightChen), cite the accompanying note and pull request, and +retain the preceding contributors' attribution. This notice records research +provenance; the repository's Apache-2.0 license remains unchanged. + +Dependencies retained from eumemic's Claude-assisted PRs #3 and #5: +https://github.com/CrocSwap/integer-mult-bounds/pull/3 +https://github.com/CrocSwap/integer-mult-bounds/pull/5 +PR #5 commit: d3d370c34937503bd3fa63c83d505a05e8e50893 +These include complex_circuit.py, complex_network.py, fast_gaussian.py, +their generators, construction notes and certificates. The Gaussian input +scaling proof is corrected in this derivative; see the modification notice below. +Aligned pairing also appears in Bortlesboat's PR #2. Retained totals and bank +sharing appear in dleen's PR #4 and cheaper retained centers in eumemic's PR #6. +Their results and ideas are credited separately from this new construction. + +Bulk recursion and controlled tensor basis, 8 October 2026 +Copyright 2026 icekylinx + +The new projector batching, controlled simultaneous basis, mixed-width tape +recursions, whole-residual complex recursion, and dependency-path precision +guard in the batched-23 proof package are contributed by icekylinx, developed +with substantial OpenAI GPT-6 Astra assistance. Review corrections and +repository integration were prepared with OpenAI Codex assistance. They build on the retained +PR #7 finite producers and the preceding contributions credited above. +The new package retains the repository's Apache-2.0 license and the original +authors' attribution. It is not an official OpenAI release or endorsement. + +Modification notice, 8 October 2026 (icekylinx): the retained fast Gaussian +proof now bounds shifted approximation error by F=2^ceil(1.14 alpha^2). +The P=34p precision budget and asymptotic exponent are unchanged. New batching +checks are integrated into make verify. Existing attribution and licenses +are retained. + +Partial-swap extension, 8 October 2026 +Copyright 2026 icekylinx + +The partial-swap framing, binary retained-total triple construction, +dependency-preserving positive labels and carrier reuse, unequal (25,23,57) +common basis, improved complex batching, and exact assembly are contributed +by icekylinx with substantial OpenAI GPT-6 Astra and Codex assistance. +This extension directly inherits PR #10, commit +62691e395a0458ce089a1c7b5d89e74291e95e29. The portable producer adapters +modify the retained paired-exclusion and shared-point implementations credited +above. The original licenses, attribution, and Gaussian correction are retained. + +Endpoint-gauge extension, 8 October 2026 +Copyright 2026 icekylinx + +The complementary auxiliary endpoint gauges, (32,30,40) controlled basis, +general nondegenerate binary phase residuals, retained-center complex producer, +updated path guard and exact assembly are contributed by icekylinx with +substantial OpenAI GPT-6 Astra and Codex assistance. This extension inherits +f2ab41aebad47861caf6316282c1793e5513845e and its PR #10 ancestry. New portable +adapters retain the paired-exclusion and shared-point contributions credited +above. Original licenses, notices and the Gaussian correction are retained. + +Structured-basis and semantic-bulk extension, 8 October 2026 +Copyright 2026 icekylinx + +The selected (32,30,36) bit construction, A1/A5 block refinements, fixed +middle-axis I+J profiles with bounded-minor CRT certificates, mixed dyadic +complex centers, complete data-front batching and circuit-specific assembly +are contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance. The immediate parent is ed90fd940279c336ebc45968631bdebfb087b505. + +The semantic/bulk compatibility argument, literal scalar charge, product row +stock and parameterization adapt Zhihao Chen (jacklightChen)'s PR #23, +commit 661ebabc1076c9f525d7ce4967c876b203fa9827. Translated complex endpoints +are adopted from the same contributor's PR #21, +commit 5ba6cf0bfb68f2be8d15610e7972207c50254d6a, following eumemic's source-frame +work and the earlier nested-basis contributions. + +Completed-child semantic precision, arbitrary-coordinate routing, phase-cell +Gaussian inversion and bulk tape transfer are credited to the RaD project +(hipotures), commit 45d9b60355872041f9275f77c057514def0d45bc, exposed through +PR #20 at 4f8d6c8272b5ff307a0da51df545ec3cd96a8b6e. Their selected proof +sources retain their separate CC0 license and original NOTICE under +references/semantic-bulk/rad20. The PR #23 source retains its recorded OpenAI +Codex assistance; RaD retains its recorded Codex and GPT-6.1-Sol Ultra +assistance. These are source attributions, not claims about this session's +runtime model. Related contributions by Rohan Arun and Aurel Prosz remain +acknowledged in the imported notices. No exclusive priority or additional +license condition is asserted. + +Copied retained-center extension, 8 October 2026 +Copyright 2026 icekylinx + +The copied retained-center schedule in both orientations, its complex-phase +transfer, the Wm-N+L rank budget, and the selected (25,23)/(28,28) composition +are contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance. This extension inherits PR #32 at +0ef3aeb61f55cc0b321ce6a0ef00acee25cefe52 and the preceding PR #10/#18/#24 work. + +The two-stage topology and paid copied-stream endpoint correction are due +to Aurel Prosz (Paureel), c82d09eb4781b68435e3fa3eb6beea72fa900fab, +through Zhihao Chen (jacklightChen)'s PR #29 unequal-axis composition, +9d963275075fa98f1da821e27757b238dafd6b3c. That source also credits Swapnil +Jain's two-stage development at ae405eb474d1486b2d8aef90139869f927f4836a. + +The contiguous corner method, incidence factorization and exact partition +certificates are due to Rohan Arun (PR #31), method commit +02f68f95369c39955c5ffcfddbd75cd83e26b305. The selected (25,23) certificate +specializes Dominik Scholz's parameterization (PR #33), +a499a345c040aa15b68e984a0904eadc485c7a7e. Their source notices and proof +snapshots are preserved in references/copied-centers. Historical OpenAI +Codex, GPT-6 Astra and Anthropic Claude Opus 5.5 assistance is credited to +the respective imported sources. Existing PR #21/#23 and RaD attribution, +licenses and the Gaussian correction remain in force. + +Copied centers with reversed (23,25) data corners, 2026-10-08 +Rohan Arun with substantial OpenAI Codex assistance supplies the composition, +exact dimension23 controls and cost/assembly integration. James Chang's PR34 +supplies the reversed boundary family; icekylinx's PR36 supplies copied retained +centers and the selected complex graph. The balanced assembly remains attributed +to RaD/hipotures and its PR34 specialization. Retain Dominik Scholz PR33, Rohan +Arun PR31, Zhihao Chen PR29/21/23, Paureel/Aurel Prosz, Swapnil Jain, icekylinx, +eumemic, Douglas Colkitt, OpenAI and all earlier notices and hypotheses. +This is not a claim of formal verification, new foundational rank identities, +global optimality or measured runtime speedup. + +Fixed middle basis with copied reversed corners (2026-10-08): +Rohan Arun, with substantial OpenAI Codex assistance. Composition and +simultaneous-basis proof retain icekylinx PR32/36, James Chang PR34, +Dominik Scholz PR35/38, Zhihao Chen, Paureel, Swapnil Jain, RaD/hipotures, +eumemic and all preceding attribution and licenses. See research/copied-fixed-reversed. + +Changed-graph composition with copied centers and fixed bases, 8 October 2026 +Prepared with OpenAI Codex assistance. +The new composition uses icekylinx PR36 copied centers and PR32 fixed-I+J +projectors/profiler, Dominik Scholz PR35 two fixed factors and CRT argument, +Zhihao Chen (jacklightChen) PR29/23 interfaces, Aurel Prosz (Paureel) and +Swapnil Jain's two-stage development, Rohan Arun PR25/31 corner methods, +Dominik Scholz PR33/38 dimension/composition work; James Chang (jamesyc) +PR34 reversed geometry and balanced transfer; Rohan Arun PR37/39/40 +reversed integration, modular data tests and both-fixed baseline; +RaD (hipotures) PR41 changed scalar DAGs, alternating point order and +independent role compiler; RaD balanced routing/bulk interfaces, and all +retained predecessors. +Complete attribution and the conditional proof boundary are recorded in +research/copied-fixed/PROOF.md; imported originals and source pins are retained. +Original Apache-2.0 and CC0 notices remain applicable. + +Community follow-up integration (PRs #49, #45 and #26), 8 October 2026: +Rohan Arun contributes weighted carrier matching and climbed summand/leave-one-out +orders (PRs #44/#47/#49), with Anthropic Claude assistance. The final construction +composes Chafik Boukhalfa's changed-graph checks, exact rational data recovery and +reordered exclusion sums (PRs #43/#46/#48, OpenAI Codex assistance) with RaD / +hipotures's alternating pair order and independent physical role compiler (#41). +All predecessor attribution and conditional proof interfaces remain in force. + +Alejandro Zarzuelo Urdiales contributes Gaussian parity and canonical arithmetic +proofs, finite tensor execution, profile precision accounting and mixed-center +reference checks (#45), with substantial OpenAI Codex assistance. See +research/gaussian-parity-synthesis/PROVENANCE.md for his full attribution. +Ryan S / princezuda contributes historical Lean certificate arithmetic, algebraic +frame/movement/guard lemmas and independent paired-circuit checks (#26). Original +source notices and historical snapshots are preserved. Neither formal package +claims a full formal proof of the multiplication algorithm or a new kappa. + +Joint frame compilation of skip-prefix strips + +The local compiler and exact finite witnesses were prepared by eumemic with +substantial OpenAI Codex assistance. Avi Eisenberg / ikeboy with Anthropic +Claude assistance supplied the unmodified PR #53 skip-prefix producer. +The pinned PR #48 pipeline is Chafik Boukhalfa's contribution, incorporating +Rohan Arun, RaD / hipotures, icekylinx, Dominik Scholz, James Chang, +Zhihao Chen, Aurel Prosz / Paureel, Swapnil Jain, eumemic, Douglas Colkitt, +OpenAI, David Harvey, Joris van der Hoeven and the earlier contributors +credited in the retained sources. See references/frame-compiler/pr48/NOTICE +and references/frame-compiler/pr53/NOTICE for their original attribution. +No authorship or review by those predecessors is claimed for this compiler. + +Joint dual-skip/frame-compiler composition (2026-10-08) +--------------------------------------------------- +Rohan Gupta / gupt1156 with Anthropic Claude assistance: PR55 dual-skip +scalar graph; original LICENSE and NOTICE are retained under +references/frame-compiler/pr55. eumemic with substantial OpenAI Codex +assistance: PR57 joint reversible frame compiler, serialized physical-word +replay and profile reconstruction. Chafik Boukhalfa with OpenAI Codex +assistance: this composition, independent integration and exact certificate. +Avi Eisenberg / ikeboy, Rohan Arun, RaD / hipotures, icekylinx, and all +predecessor authors retain the notices above and in pinned source files. +No original copyright or Apache-2.0 notice is removed. + +Ranked reclamation after the PR58 joint-dual composition (2026-10-08) +---------------------------------------------------------------- +Chafik Boukhalfa with OpenAI Codex assistance: prioritize retired physical +slots by descending current frame rank, retaining slot ID as the tie-breaker; +complete replay, exact profiles, comparison and adversarial controls. +The dedicated joint_dual_reclaim_compiler.py is derived from eumemic's PR57 +compiler. Its original shared compiler remains byte-identical. The PR55 +producer and all preceding attribution remain unchanged. The complete PR58 +comparison certificate and its original source/proof provenance are retained +under references/frame-compiler/pr58. + +Skip-prefix strip producer, 8 October 2026 +By Avi Eisenberg (ikeboy), with Anthropic Claude (Claude Opus 5.5) +assistance. The skip-prefix leave-one-out strip layout in +research/skip-strips/skip_graph.py is new. Everything else reuses Chafik +Boukhalfa's PR #43/#46/#48 research/copied-fixed pipeline, its verification +code, exact data recovery and support-order sorting, together with: +- Rohan Arun's PR #44 weighted carrier matching optimizer; +- RaD (hipotures) PR #41 alternating point order; +- every predecessor credited above. +Complete attribution and the conditional proof boundary are recorded in +research/skip-strips/PROOF.md. Original Apache-2.0 and CC0 notices remain +applicable. + +Local split-pair skip-prefix research continuation (2026-10-08) +Prepared with substantial OpenAI Codex assistance at the user's request. +New contribution: singleton/pair recursive partition refinement, finite summand +order and moment search, and verified composition with inherited paid clones. +Avi Eisenberg/ikeboy with Anthropic Claude assistance: PR53 skip-prefix strips. +Chafik Boukhalfa with OpenAI Codex assistance: PR54 original-envelope clone +specialization and PR43/46/48 checking interfaces. RaD/hipotures: PR51 +whole-chain/source-partition cloning and earlier producer/interfaces. +Rohan Arun: PR44 weighted matching and earlier fixed/reversed work, with all +stated historical AI assistance. All predecessor notices remain applicable. + +Original-envelope whole-chain clones on skip-prefix strips (research/skip-clones): +Chafik Boukhalfa, prepared with OpenAI Codex assistance. The complete-chain +source-partition clone operation is adapted from RaD / hipotures, PR #51, +with original envelopes retained here. The scalar base is Avi Eisenberg's +PR #53 skip-prefix layout, prepared with Anthropic Claude assistance. +All credited PR #43/#46/#48, PR #44 and earlier code/proof notices remain +in force. This extension is provided under the repository's Apache-2.0 terms. + +Community review checkpoint #50–#61, 8 October 2026 +Maintainer integration and independent arithmetic: Douglas Colkitt, with OpenAI Codex. +Avi Eisenberg / ikeboy: skip-prefix strip framework (#53), with Anthropic Claude. +Rohan Gupta / gupt1156: parallel order search (#50, stated Antigravity assistance) +and dual-suffix strips (#55, Anthropic Claude assistance). +Eumemic: equal-frame joint compilation and paid signal reclamation (#57), with Codex. +Chafik Boukhalfa: original-envelope paid clones (#54), composition (#58) and ranked +reclamation (#60), with Codex. Rohan Arun: order search (#52) and positive-frame +composition (#56), with Anthropic Claude and stated Codex validation assistance. +RaD / hipotures: enlarged frames, source partitions and paid whole-chain clones +(#51), with Codex. Rohan Garg / rohangar1: singleton/pair recursion and paid-clone +composition (#59), with Codex. Alejandro Zarzuelo Urdiales: exact parameter +refinement, scoped Lean arithmetic, matrix/parity and search tools (#61), with +his disclosed multi-tool and Codex assistance. +Parallel #50/#52 records are reviewed and credited without replacing the earlier +climbed-48 implementation; their exact commit history is retained. The separate +#51 witness is retained as research; its source-graph/negative-basis data proof +has not received the same full replay as #56's consumed compiler machinery. +See docs/research/community-round2-review.md for precise validation boundaries. +All earlier licenses, contributions and notices remain applicable. + +Interval strips and core-aware pair assembly + +The interval leave-one-out strips and the core-aware group-pair assembly in +research/pair-assembly were prepared by Avi Eisenberg / ikeboy with Anthropic +Claude assistance. They build on PR #53's skip-prefix pipeline and its +inherited PR #48 sources. The stacked witness in research/pair-assembly/frame +uses eumemic's PR #57 joint frame compiler unchanged; its driver and verifier +are adaptations of PR #57's skip_frame_compiler.py, skip_frame_compose.py and +verify_skip_frame.py. Original notices are retained. + +Stopped product-ring extension, 9 October 2026 +Copyright 2026 icekylinx + +The opposite-bank generic projector factorization, componentwise atom-ring +adapters, stopped recurrence and outer ordinary-interchange conversion, +aligned pair-star producer with rational centers, exact denominator-21 +grid and selected (23,23)/(24,24) composition are contributed by icekylinx +with substantial OpenAI GPT-6 Astra and Codex assistance. This extension +builds on merged PR #36, 11817ccacb564bb7f98789c20dc11d3fece207e3, and is +integrated on upstream main 56b66d58297deca1d7dd130247d720e960f77a37. + +The retained ordinary leaf uses the preceding projector, corner and +copied-center proofs. The selected two-stage topology retains Aurel Prosz +(Paureel), Swapnil Jain and Zhihao Chen's credits; the semantic assembly +retains PR #21/#23 and RaD's attribution. Paired producers, carrier matching, +original source notices and each imported license remain unchanged. + +Partial-gauge extension, 9 October 2026 +Copyright 2026 icekylinx + +The pair-first cube assembly, compatible backward frame enlargement, +partial source-gauge schedule and stopped whole-projector composition are +contributed by icekylinx with substantial OpenAI GPT-6 Astra and Codex +assistance, extending PR #104 at 948ce1510df750f4c18b96bdaef436a86f8bf834. + +The physical deferred bit word, reflected event accounting, fan-order +clarification and signed two-stage endpoint are adopted from Zhihao Chen +(jacklightChen), PR #97, e15350b66e4bf796153a68c240a6cc1b788abe3e, with +Codex assistance. Its deferred readouts, V leaves, lifted frames and frozen +witness originate in Swapnil Jain's 741e7aa078392553815df7926ee17ac5e25a8c38, +with the original Claude disclosure retained. Cyclic interval and core-aware +pair primitives build on Avi Eisenberg (ikeboy), PR #62, +ad0f25ff7b23cff7f08ad237c2254e6ecf74257e, with Anthropic Claude assistance. +Prior two-stage, copied-center, ordinary-leaf, semantic/bulk, routing and +precision credits remain in force. Imported source notices and licenses +are preserved under references/partial-gauge/; see SOURCES.json. + +Three-stage cover extension, 9 October 2026 +Copyright 2026 icekylinx + +The arbitrary-subspace Clifford frame theorem, three-stage Cayley geometry, +weighted q-adic GL cover, unit-lower weighted compiler, charged local-ring +fallback, uniform batching, internal row borrowing and exact composition +are contributed by icekylinx with substantial OpenAI GPT-6 Astra assistance. This +repository integration uses Codex assistance and extends +PR #115, cf60442983c153a3a0f5272ea4713f99eba13c86. + +The selected local complex DAG and support/label replay are adopted from +Copyright 2026 eumemic, PR #117, cbb05ce504d571546d9b7794c186a613c659c3bf, +with its original Apache-2.0 terms and Claude assistance disclosure. +The unchanged bit physical word retains Zhihao Chen (jacklightChen), +PR #97, and Swapnil Jain's underlying witness and assistance notices. +The prior opposite-bank, stopped ordinary-leaf, copied-center, topology, +semantic/bulk, precision and analytic credits remain applicable. +Original source notices and license bytes are preserved in +references/three-stage-cover/pr117/ and references/partial-gauge/. + +Paired-cube and shared-core extension, 9 October 2026 +Copyright 2026 icekylinx + +The paired-coordinate triple-cube identity, signed overlap channels, +original-source involution, coordinate-star centers, concrete frame/carrier +compiler, chronological source gauges, PR97 gauge-subset selection, +orthogonal cross-stage routing and exact supplier/assembly integration +are contributed by icekylinx with substantial OpenAI GPT-6 Astra assistance. +Repository integration uses Codex assistance and extends PR #130 at +6a9970a530119174507904e23592fd59ede19a5d. + +The substantial completed-core workspace-sharing principle is credited to +an664, PR #128, 530588a019b4a74f09180680c9e3961bf649ec89, with its reported +OpenAI Codex assistance. No source code, partition or serialized witness +from that PR is imported. The new routing and paired-motif integration +are described separately and claim no exclusive priority for broad sharing, +paired-coordinate, Fourier or carrier-matching ideas. + +Selected coarse queries restrict the retained eumemic PR #117 positive DAG; +its original Apache-2.0 and Claude assistance notices remain unchanged. +The bit word and original frames retain Zhihao Chen's PR #97 and Swapnil +Jain's frozen witness, notices and historical assistance disclosures. +Earlier generalized Clifford, three-stage, uniform weighted recursion, +ordinary-leaf, semantic/bulk, precision and analytic credits remain in force. +Source-specific license bytes are preserved under references/. + +October 9 recycled-bit integration: +DaysSky (#150), William Porter/hpst3r (#147), Thomas Marchand/Th0rgal (#146), +Rohan Gupta/gupt1156 (#148), James Chang/jamesyc (#124), SovereignSteak (#122). +The original notices and assistance disclosures are retained under research/, +including research/recycled-bit-integration/NOTICE. Andrew Barnes/Bortlesboat +(#101) repairs shared verifiers using rfu08's #64 counterexample. rfu08's +scoped finite and formal-transfer packages are included separately; they do +not establish the full multiplication theorem. Earlier and parallel credits +remain applicable. Douglas Colkitt integrated these with OpenAI Codex assistance. + +SovereignSteak PR151 independently supplies the matching gauge/recycling +composition and the selected 473/10^6 atom refinement; its original package +and assistance disclosure are retained under research/gauge-recycling/. + +October 9 coordinated-frame and completed-entrance-bank integration: +Dugongue PR186, 166a34d75e853e933855f0f7e940fe77c4bb6b8d, builds on +Chafik Boukhalfa/chafreaky's PR181, 7fb2194801e3a10f54772c7f0d5505035a4fc0ad, +and eumemic's PR168 v4, 4a3c769e5c5430e7114c4d3e099ff34664677f17. +The frozen package and prerequisite archive preserve all author, source-license +and assistance notices, including PR175's compiler optimization. DaysSky's +carrier closure, James Chang's terminal substitution and balanced assembly, +geckods' stopping refinements and all preceding framework credits remain. +Rohan Arun's PR185 bootstrap and chafreaky's PR182 bit refinement are reviewed +parallel contributions; their gains are not added to the selected witness. +Douglas Colkitt integrated the package and supplied the bank scheduling +supplement with OpenAI Codex assistance, under Apache-2.0. The all-size +interfaces remain conditional; finite verification is not full formalization. diff --git a/research/early-duplicate-verify-rejection/README.md b/research/early-duplicate-verify-rejection/README.md new file mode 100644 index 0000000000..bd227dc38b --- /dev/null +++ b/research/early-duplicate-verify-rejection/README.md @@ -0,0 +1,44 @@ +# Early duplicate-VERIFY rejection candidate + +This opt-in package proposes a narrow parser-policy alignment: reject duplicate object members in VERIFY.json during registered metadata validation and replay planning, as the existing committed exporter already does. The patch is retained as [STRICT-VERIFY.patch](STRICT-VERIFY.patch) with bounded tests on copied exact tooling in isolated synthetic Git repositories. Shared scripts, workflows and the selected record remain untouched. Adoption is a separate maintainer decision. + +The observed issue is an interpretation/exportability gap, not scientific false acceptance, a security escape or violation of a documented metadata-pass-guarantees-export promise. Export and metadata validity are already distinct predicates. A duplicate manifest is described as otherwise valid under the registered final-member predicates, rather than universally valid JSON metadata. + +## Observed boundary and bounded evidence + +Before the public claim, the coordinator preserved four actual calls of the unmodified canonical tooling: healthy metadata/export exits0/0, and duplicate-inputs metadata/export exits0/1. The duplicate calls used the same397-byte committed VERIFY and final inputs=[input.txt]. The earlier inputs=[missing.txt] member was ignored by the ordinary registered parser; the credited exporter rejected the exact bytes with `duplicate export JSON key: inputs`. No inert fixture command or mathematical/native workload was dispatched. The original raw observation records remain outside this package in session-02/prototype; this paragraph does not claim this metadata author reran them. + +The first new-harness replay passed on CPython3.12.14 in39.68seconds: nine committed fixture cases, 144 actual source CLI outcomes (100 accepted,44 rejected),28 inert marker dispatches, and nine temporary `git apply --check`/apply pairs. Each case tests original and patched readers under normal and optimized child Python (these inner modes are distinct from a separate outer optimized-harness replay) through metadata validation, planning, export and registered inert-marker dispatch. Four object-key forms (same-value, conflicting, escaped and nested) reject before dispatch in the patched readers. Positive controls retain behavior, including TASK/SOURCES final-member parsing and numeric extensions. The repeated-input-array limitation is demonstrated explicitly. The normalized outcome-table SHA256 is `bfdbc3acb6cc9e66ee8766654a9c196d9d2c8331039663516de610a0edff7562`. + +The first replay is a diagnostic, not a substitute for final registered replay, export/committed-byte checks, publication or hosted CI. Those delivery checks are recorded with the PR and handoff when observed. Every replay emits its full deterministic outcome table and package hashes; optional `--raw-context-out OUTSIDE_PACKAGE.json` also retains actual command arguments, times, streams, fixture heads and working-source phases. Source programs run only in synthetic repositories; exported fixtures use the same committed manifest bytes while the candidate runner patch is deliberately in the temporary working copy. + +## Scope and provenance + +[verify.py](verify.py) authenticates the three retained tooling/data files in [SOURCE-PINS.json](SOURCE-PINS.json), applies the patch to temporary copies and exercises actual CLI boundaries. The unchanged exporter is a comparison control. The complete original portable-replay card and explicit CHANGED/partial outcome are in [TASK.json](TASK.json). [SOURCES.json](SOURCES.json) pins the canonical catalogue, selected record, registered runner and exporter as provenance. Runtime vendored bytes are package-local; no external live inputs are declared. + +The change is VERIFY-only object-member rejection. It does not establish complete exportability parity: a unique-key manifest with `inputs=["input.txt","input.txt"]` can still pass registered validation/planning while export rejects the repeated list declaration. That separate list policy is intentionally outside this candidate. TASK/SOURCES parsing, catalogue-card/--print-card and other provenance readers, numeric policies and unrelated schemas are unchanged. Existing aliromman[PR5728](https://github.com/CrocSwap/integer-mult-bounds/pull/5728), verified head70441d90c78bdfc48aed772d2b45e05d5a38e4fb, already implements and tests duplicate committed-VERIFY export rejection; that guard and result are credited prior work. [PR5726](https://github.com/CrocSwap/integer-mult-bounds/pull/5726), head20bed137e8807376f3124dd6d03fc076e595b016, separately rejects ambiguous coordination metadata. No predecessor scientific suite is replayed or recounted as a new result. + +## Run the tooling fixtures + +Requires a POSIX host, CPython3.12, its standard library and a working Git CLI on PATH. macOS was observed locally; Windows is unqualified. No install step is supplied. The standalone harness creates its own temporary repositories and does not require the original repository's Git checkout or pending foreign Git objects. This is not a Git-free or empty-PATH replay claim. + +```sh +python3.12 -I -B research/early-duplicate-verify-rejection/verify.py +python3.12 -I -O -B research/early-duplicate-verify-rejection/verify.py +python3.12 -B scripts/research_package.py --package research/early-duplicate-verify-rejection +``` + +The two registered commands have180-second caps. Their dispatch is tooling-fixture execution, not a native or mathematical verifier replay. Registration's ready status supplies explicit opt-in commands; it does not supply scientific or adoption acceptance. + +## Adoption limits + +The legacy duplicate-manifest inventory, supported-platform matrix and historical regression suites are incomplete. Planner fixtures select the package through newly added package files; they test intake rejection and the matrix, not input-only invalidation causes, `--explain-plan` or `--github-output` sidecars. Positive fixture archives are compared byte-for-byte and their manifest payload/inventory inspected; full package export authentication is a separate delivery check. Child CLI process groups have bounded timeouts; the known inert marker has its own five-second registered cap and no children. This is not a general descendant-cleanup guarantee. The proposed planner rejects a duplicate-key VERIFY while reading it even when that package would otherwise be unselected, so inventory all registered manifests before shared adoption rather than checking only the current changed-package list. Changing shared replay controls can select every registered package; this package does not authorize or perform that rollout. The patch's source head must be refreshed and its policy approved before live adoption. Existing path, pin, timeout and command validation retain their authority; parser consistency does not authenticate a mathematical claim. All five selected assumptions remain, with no supplier, physical tariff, multiplier, kappa or frontier result. + +## Open next questions + +1. **Decide shared adoption after an inventory.** Review the patch and scan committed VERIFY manifests for duplicates without dispatching their commands. Record how existing ambiguous manifests would be handled. The blocker is the incomplete legacy inventory and maintainer policy decision. +2. **Validate an approved rollout at an exact head.** Refresh source pins, run the relevant existing onboarding/export tests and a separately budgeted platform fixture matrix. Historical/platform coverage and full shared-control CI fanout remain outside this candidate. + +## Credit + +Prepared for ToikY with substantial source-aware OpenAI Codex assistance. See [CREDITS.md](CREDITS.md), [NOTICE](NOTICE) and [LICENSE](LICENSE). Douglas Colkitt's runner, Tekalign's exporter and aliromman's5728/5726 strict-parser work retain attribution. AI role separation is not independent human or proof-kernel acceptance. diff --git a/research/early-duplicate-verify-rejection/SOURCE-PINS.json b/research/early-duplicate-verify-rejection/SOURCE-PINS.json new file mode 100644 index 0000000000..3b36458ba4 --- /dev/null +++ b/research/early-duplicate-verify-rejection/SOURCE-PINS.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "files": [ + { + "local_path": "vendor/research_package.py", + "source_repository": "CrocSwap/integer-mult-bounds", + "source_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "source_path": "scripts/research_package.py", + "git_blob": "091b4c8f58bac9a9580d76025b887dc5c873d05f", + "sha256": "e1256016e7f51827d04fa2179255989f639ae1d97afaa9c16265f85a0c6abd70", + "bytes": 52346, + "usage": "Exact registered metadata/planning tooling source; copied into isolated test fixtures." + }, + { + "local_path": "vendor/export_research_package.py", + "source_repository": "CrocSwap/integer-mult-bounds", + "source_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "source_path": "scripts/export_research_package.py", + "git_blob": "25b0a12a8073f589867ca7f2e564ea5ae011bdf5", + "sha256": "7126afaebff2328b8d64ba1ce992c497103820284f52d4590a558f97f13965fe", + "bytes": 12446, + "usage": "Exact existing exporter, including Ali Romman5728duplicate rejection; unchanged comparison control." + }, + { + "local_path": "vendor/agent-task-catalog.json", + "source_repository": "CrocSwap/integer-mult-bounds", + "source_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "source_path": "docs/research/agent-task-catalog.json", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81", + "bytes": 82822, + "usage": "Exact canonical catalogue data for genuine fixture provenance." + } + ], + "scope": "Exact tooling sources/data, not mathematical source-engine or supplier evidence." +} diff --git a/research/early-duplicate-verify-rejection/SOURCES.json b/research/early-duplicate-verify-rejection/SOURCES.json new file mode 100644 index 0000000000..946cf80d54 --- /dev/null +++ b/research/early-duplicate-verify-rejection/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "d59b5035e7b4cbaa9d688a1d32dd0d6eb79c466a", + "sha256": "9b8d0eea95b3bf0dfcb7938a732a6439b87a2685dec2a5ab9e525b3b34debbfa" + }, + { + "path": "scripts/research_package.py", + "usage": "provenance", + "git_blob": "091b4c8f58bac9a9580d76025b887dc5c873d05f", + "sha256": "e1256016e7f51827d04fa2179255989f639ae1d97afaa9c16265f85a0c6abd70" + }, + { + "path": "scripts/export_research_package.py", + "usage": "provenance", + "git_blob": "25b0a12a8073f589867ca7f2e564ea5ae011bdf5", + "sha256": "7126afaebff2328b8d64ba1ce992c497103820284f52d4590a558f97f13965fe" + } + ] +} diff --git a/research/early-duplicate-verify-rejection/STRICT-VERIFY.patch b/research/early-duplicate-verify-rejection/STRICT-VERIFY.patch new file mode 100644 index 0000000000..9c89c13a88 --- /dev/null +++ b/research/early-duplicate-verify-rejection/STRICT-VERIFY.patch @@ -0,0 +1,38 @@ +--- a/scripts/research_package.py ++++ b/scripts/research_package.py +@@ -27,6 +27,15 @@ + def require(ok, message): + if not ok: + raise ValueError(message) ++ ++ ++def unique_verify_keys(pairs): ++ # Existing exporter policy, credited to Ali Romman PR5728; VERIFY only. ++ values = {} ++ for key, value in pairs: ++ require(key not in values, "duplicate VERIFY.json key: " + key) ++ values[key] = value ++ return values + + + def canonical_relative_path(name): +@@ -393,7 +402,9 @@ + "package must be research/") + data = {} + for name in ("TASK.json", "SOURCES.json", "VERIFY.json"): +- data[name] = json.loads(relative_file(root, package + "/" + name).read_text(encoding="utf-8")) ++ raw = relative_file(root, package + "/" + name).read_text(encoding="utf-8") ++ hook = unique_verify_keys if name == "VERIFY.json" else dict ++ data[name] = json.loads(raw, object_pairs_hook=hook) + version = require_key(data[name], "schema_version", name) + require(version == 1, name + ".schema_version must be 1; found " + brief(version)) + task, sources, manifest = (data[n] for n in ("TASK.json", "SOURCES.json", "VERIFY.json")) +@@ -934,7 +945,7 @@ + for path, raw, sparse in planning_manifests(root, head_tracked): + sparse_count += sparse + package = path.parent.relative_to(root).as_posix() +- manifest = json.loads(raw.decode("utf-8")) ++ manifest = json.loads(raw.decode("utf-8"), object_pairs_hook=unique_verify_keys) + # Parse only for selection; validate fully in the isolated replay job. + inputs = manifest.get("inputs", []) + require(isinstance(inputs, list), "declare input paths for CI invalidation") diff --git a/research/early-duplicate-verify-rejection/TASK.json b/research/early-duplicate-verify-rejection/TASK.json new file mode 100644 index 0000000000..87a30c5049 --- /dev/null +++ b/research/early-duplicate-verify-rejection/TASK.json @@ -0,0 +1,85 @@ +{ + "schema_version": 1, + "task_id": "portable-replay", + "priority_revision": 8, + "base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "original_card": { + "id": "portable-replay", + "question": "Can one reproducible environment or artifact-comparison failure be repaired?", + "starting_points": [ + "research/gzip-container-reproducibility/README.md", + "docs/ci-verification.md" + ], + "methods": [ + "Reproduce one portability failure and add a minimal cross-environment fix.", + "Audit one canonical-payload comparison for omitted proof-relevant fields." + ], + "acceptance_gate": "Preserve immutable source hashes and proof-relevant content; a different compressed byte stream alone is not a mathematical mismatch.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Reproduce one specific mismatch or audit one canonical comparison for omitted proof-relevant fields.", + "bottleneck_link": "Portable exact checks prevent environment failures from blocking valid contributions.", + "allowed_variations": [ + "One interpreter/version mismatch or one payload field comparison." + ], + "scope_change_triggers": [ + "Removing immutable-source pins because generated compressed bytes differ." + ], + "overlap_terms": [ + "gzip container", + "reproducibility", + "canonical payload" + ] + }, + "scope_status": "changed", + "actual_scope": "An opt-in source-bound VERIFY-only early duplicate-object-key rejection patch for registered validation and planning, with isolated genuine-Git fixture evidence.", + "scope_change_reason": "The original artifact-portability card is narrowed to a current metadata/export interpretation mismatch; the existing exporter already rejects these duplicates, while registered validation and selection use final-member parsing.", + "scope_key": "verify-only-early-duplicate-rejection-at-7c49", + "seed": "4b92812e9cf2cd05bd75cbb615a6bf07", + "time_budget_minutes": 120, + "minimum_verification_minutes": 30, + "question": "Can copied exact registered validation/planning scripts reject duplicate VERIFY members before command dispatch, consistently with the existing committed exporter, while preserving unambiguous manifests?", + "success_rule": "Retain the exact canonical scripts and a minimal opt-in patch; reproduce the original same-committed-byte metadata/export difference and validate the patched copies with positive cases and explicit pre-dispatch rejection controls. Shared adoption is not a success condition of this package.", + "stop_rule": "Stop at the source-bound VERIFY-only repair candidate and bounded fixture outcome, retaining failures. No global runner/workflow change or rest-of-JSON/numeric/schema expansion. Science cutoff2026-11-06T16:51:21Z; reserve the final30minutes of this120-minute session for verification/handoff.", + "method": "Root authored the source patch; a source-aware implementation role authors a new stdlib/Git fixture harness; separate policy and metadata roles inspect scope and provenance. Exact original tooling sources are copied to temporary repositories and only those copied runners are patched. No independent-end-to-end or blind role claim.", + "bottleneck_link": "Earlier deterministic feedback on ambiguous replay manifests can prevent a late committed-export failure and clarify CI input-selection semantics without weakening immutable-source identity.", + "family_decision": "Tooling/parser-policy candidate only; no mathematical mechanism or selected-family expansion.", + "outcome": "partial", + "scientific_status": "TOOLING_FIXTURE_ONLY_NO_SCIENTIFIC_REPLAY", + "author": "ToikY", + "ai_assistance": "Substantial OpenAI Codex assistance through source-aware patch, fixture implementation, policy, overlap/credit and metadata roles. Preclaim tooling observation is disclosed; no independent human or formal-kernel acceptance.", + "credit": "Douglas Colkitt registered runner; Tekalign original exporter; aliromman PR5728 exact duplicate-VERIFY/export receipt rejection and PR5726 strict coordination JSON; all retained source headers, Apache license and notices. The exporter duplicate guard is prior work, not new here.", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19443668", + "overlap": "Fresh canonical main7c49/current guides, live hub/index and756open PR bodies checked by coordinator; exact5728/5726 bodies and diffs inspected. Hidden/unindexed work remains unknown. Prior source repairs and historical scientific work are excluded.", + "evidence": "PRECLAIM_OBSERVED: four actual original-tooling CLI calls gave healthy metadata/export0/0 and duplicate-manifest metadata/export0/1. The same397-byte committed duplicate-inputs VERIFY was accepted by metadata and rejected by export with duplicate export JSON key: inputs; no inert fixture command or mathematical/native workload was dispatched. Raw records are retained externally under session-02/prototype. New harness diagnostic: CPython3.12.14,39.677s,exit0;9 committed cases/144 source CLI outcomes/100 accepted/44 rejected/28 inert marker dispatches/9 temporary apply checks and applications. Outcome-table SHA256 bfdbc3acb6cc9e66ee8766654a9c196d9d2c8331039663516de610a0edff7562. Final registered replay/export/publication/hosted checks are distinct delivery observations recorded in PR/handoff, not presumed by this diagnostic.", + "remaining_obligations": [ + "The shared registered runner, exporter, workflows and selected record are unchanged; patch adoption is not granted.", + "Legacy duplicate VERIFY inventory, historical regression suites, supported-platform coverage and shared CI fanout remain incomplete.", + "This aligns VERIFY object-member rejection only, not complete exportability: repeated strings in one inputs list remain accepted by the registered paths and rejected by the exporter; that policy is intentionally outside scope.", + "The package changes only VERIFY unique-key intake and planning; TASK/SOURCES parsers and other JSON/numeric/schema policies are separate.", + "No mathematical/native/scientific predecessor workload, full multiplier, supplier admission or all-five-assumption discharge is established.", + "The proposed planner reads and rejects ambiguous manifests even for otherwise-unselected packages; inventory the complete registered legacy set before shared adoption. Catalogue-card/--print-card and other provenance readers are unchanged." + ], + "open_questions": [ + { + "question": "Should the VERIFY-only unique-key policy be adopted by the shared registered validator and planner?", + "why_it_matters": "The opt-in patch changes acceptance of ambiguous manifest bytes; live shared adoption selects every registered package and is a maintainer policy decision.", + "first_step": "Review STRICT-VERIFY.patch and inventory every committed registered VERIFY for duplicate object members without dispatching commands, including packages not otherwise selected; record an approved adoption and rollout policy. Keep repeated input-list elements and unrelated parsers separate.", + "blocked_by": "Legacy duplicate-manifest inventory and maintainer adoption decision are incomplete; the shared runner/workflows remain unchanged." + }, + { + "question": "Does the candidate preserve supported-platform and historical package behavior at an approved current source head?", + "why_it_matters": "The bounded synthetic Git fixtures do not establish every legacy package, host, Git version or shared CI path.", + "first_step": "After approving VERIFY-only rejection, refresh the exact runner/exporter source pins and run the relevant existing onboarding/export tests plus the approved platform fixture matrix in a separately budgeted integration.", + "blocked_by": "Historical suite/platform coverage and the potentially large shared-control CI fanout have not been completed in this scoped package." + } + ] +} diff --git a/research/early-duplicate-verify-rejection/VERIFY.json b/research/early-duplicate-verify-rejection/VERIFY.json new file mode 100644 index 0000000000..a0401fd995 --- /dev/null +++ b/research/early-duplicate-verify-rejection/VERIFY.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "144 actual source CLI outcomes over nine committed Git fixtures: original/patched metadata validation, planning, unchanged export and inert-marker dispatch; normal/optimized child Python; duplicate-key rejection before dispatch and explicit remaining input-array limitation. Source/patch authenticated; Git CLI and POSIX required; no scientific replay." + }, + { + "argv": [ + "{python}", + "-I", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Repeat the complete tooling-fixture harness under optimized Python, retaining explicit guard behavior and source authentication. Git CLI required; no scientific predecessor command is dispatched." + } + ] +} diff --git a/research/early-duplicate-verify-rejection/vendor/agent-task-catalog.json b/research/early-duplicate-verify-rejection/vendor/agent-task-catalog.json new file mode 100644 index 0000000000..3404fbdd5e --- /dev/null +++ b/research/early-duplicate-verify-rejection/vendor/agent-task-catalog.json @@ -0,0 +1,1281 @@ +{ + "schema_version": 1, + "priority_revision": 8, + "priority_log": "docs/research/research-priority-log.md", + "assessed_on": "2026-10-26", + "status": "Research suggestions, not reservations or assertions that these questions are unclaimed. Check current main and live PRs.", + "tracks": [ + { + "id": "bit-mechanisms", + "weight": 20, + "tasks": [ + { + "id": "bit-helper-contract", + "question": "Can a changed G20 helper path or independent-target split improve the complete BIT moment without losing its physical endpoint?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "research/g20-helper-split/README.md", + "research/g20-conjugation-admission/README.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A full boundary contract and paid profile; unchanged scalar counts alone are insufficient. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "First read #5679/#5708 and their audits as pending component proposals. Choose one uncovered helper group/cut on an exact word; compare arbitrary-input native action, targets, owned storage, both orientations and full signed bill. Stop if the gain is only a scalar count or repaid by lost targets. Do not rerun the frozen #5609 common-frame domain without changing its hypothesis.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "G20", + "helper split", + "5679", + "5708", + "independent target" + ], + "existing_checks": [ + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "bit-new-register-model", + "question": "Can an explicitly larger or nonabelian register model escape the scoped three-register obstruction?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/bit-three-register-lower-bound/README.md", + "certificates/selected-result.json", + "research/bit-gl3-mixed-targets-length10/README.md", + "docs/research/community-efficient1000-review.md" + ], + "methods": [ + "Construct the smallest exact identity in a newly specified legal operation alphabet.", + "Derive a target-specific relaxation bound for that same explicit alphabet." + ], + "acceptance_gate": "Name the changed hypothesis, all counted roles and a uniform identity; finite column tests alone do not certify it. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "First compare the alphabet, role count and length with the fully replayed #1974 census and #2027 mixed-root tariff. Identify a changed premise and a legal native implementation; then price one smallest completed instance before searching larger words.", + "bottleneck_link": "A small-width completed saving changes the bit primitive; a finite-address identity alone is insufficient.", + "allowed_variations": [ + "Choose a fixed larger register count or a specified nonabelian operation family." + ], + "scope_change_triggers": [ + "Remaining inside the already-excluded three-register abelian model.", + "Repeating the two-register GL3 census or a covered three-register length without changing a hypothesis; a formal group-algebra word without native conversion is a partial result." + ], + "overlap_terms": [ + "three-register", + "nonabelian", + "group algebra" + ] + }, + { + "id": "r437-carrier-integration", + "question": "Can the paid R437 two-window carrier improvement be admitted by the actual pooled compiler and physical caller?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/r437-two-window-carrier/README.md", + "research/r437-reverse-row-coefficient/README.md" + ], + "methods": [ + "Close one compiler/request, caller or precision/stock implication for the pinned paid exchange.", + "Falsify that exact interface with an arbitrary-dirty-state or chronology counterexample." + ], + "acceptance_gate": "Pin the complete source and destination contracts, exact paid and scalar deltas, and all remaining assumptions. A local moment gain is not a physical or all-size supplier admission.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Choose one unclaimed obligation: pooled compiler codebook/request alignment, actual physical caller, or precision/stock envelope using the already reported reverse coefficient. Pin the input and receiver, preserve dirty/source windows, and test one binding with a rejection control. Stop at unresolved dependencies; do not rederive the coefficient or quote the local moment as a completed bound.", + "bottleneck_link": "The exchange changes the paid profile; integration must establish that its gain survives the complete caller.", + "allowed_variations": [ + "One compiler rebind, one actual caller boundary, or one precision/stock implication." + ], + "scope_change_triggers": [ + "Ignoring added ADDs, retaining an obsolete reverse coefficient, or declaring global admission from the local histogram." + ], + "overlap_terms": [ + "R437", + "two-window carrier", + "4067", + "4147", + "pooled compiler", + "request alignment", + "reverse row coefficient" + ], + "existing_checks": [ + { + "scope": "PR #4067: source-bound two-window carrier with (2,2) to (1,3) paid exchange and fixed OQ4 host.", + "evidence": "research/r437-two-window-carrier/README.md", + "remaining": "Pooled compiler/request rebind, physical caller and precision/stock admission.", + "status": "author-checked", + "source_commit": "a95f11c52e3ca1e4c5171b3c20d8f4b0815aee2e", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4147: reverse row coefficient follow-up.", + "evidence": "research/r437-reverse-row-coefficient/README.md", + "remaining": "Use the exact coefficient in a caller-bound precision/stock proof rather than repeat the arithmetic.", + "status": "author-checked", + "source_commit": "72e7bb797adf82aeb525a399f56ab8adbab8e93c", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + } + ] + }, + { + "id": "complex-mechanisms", + "weight": 20, + "tasks": [ + { + "id": "p104-side-correction", + "question": "Can joint helper bases and a legal causal split improve the complete P104 productive/paid invoice?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "research/p104-helper-subspace-splits/README.md", + "research/dyadic-helper-channel-capacity/README.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Start with the selected #5599 emitted word and review pending #5718 distinct input/output bases plus #5717/#5719 coverage before claiming work. Pick one uncovered source word, helper group and cut region. Prove the arbitrary-input relation and legal entry/exit corrections, then compare full target and paid profiles. Reject if completion, owned lifetimes or consumer costs repay the gain. A static pairing rank alone is not a physical split.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "P104", + "helper basis", + "helper split", + "5718", + "dyadic capacity" + ], + "existing_checks": [ + { + "scope": "PR #4133: literal-slot defect", + "evidence": "research/p104-literal-slot-defect/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4136: uniform commutation gap", + "evidence": "research/p104-uniform-commutation-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4140: uniform encoding gap", + "evidence": "research/p104-uniform-encoding-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "evidence": "research/p104-source-chart-shortcut/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4154: fiber-tag seam mismatch", + "evidence": "research/p104-fiber-tag-seam/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "complex-rank-shape-decoder", + "question": "Can a legal decoder or coframe change improve the full signed moment, including changed helper targets?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "docs/research/recursive-invoice-preflight.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Price one complete changed itinerary with both paid and productive histograms. Check #5693/#5698 for overlap and their exact hypotheses before another coframe search. Use the signed invoice preflight where its boundary contract agrees; an inconclusive concave comparison is not a power crossing. Stop if an optimistic complete budget fails at the chosen target or native delivery remains unspecified.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "coframe", + "signed moment", + "5693", + "5698" + ], + "existing_checks": [ + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "complex-new-helper-inventory", + "question": "Can a changed helper inventory earn productive credit that survives completion, compilation and the actual caller?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Specify all arbitrary inputs, owned fields, restored outputs and a physically legal consumer. Compare complete P and T, including target debits and precision/stock costs. #5599 is a positive control for target refinement, not permission to split every helper for free. #5614 is a hypothetical compiler budget, not an emitted 145-split word. Stop at the first unpaid boundary or a failing optimistic full bill.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "productive helper", + "target refinement", + "5599", + "5614" + ], + "existing_checks": [ + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + } + ] + }, + { + "id": "recursive-interfaces", + "weight": 20, + "tasks": [ + { + "id": "joint-query-controller", + "question": "Can a changed query demand or caller remove real work while satisfying native chronology and restoration?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose an exact caller and a new demand/interface hypothesis. Read the scoped #5617/#5631/#5649/#5747 and #5720/#5745 objections before rebuilding an excluded schedule. Compare the complete matched source/consumer protocols including all retained helper outputs. For an active-mode injection, first check #5745: its canonical delivery claim repays the eight removed centre jobs. Audit that exact claim or change its channel/feedback hypothesis; do not repeat the same free-injection search. Stop if the full favorable budget fails or the required restored output is unobservable.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "query demand", + "active mode", + "5720", + "5745", + "5747", + "caller" + ], + "existing_checks": [ + { + "scope": "PR #4166: author-checked installed producer/service/return/bridge connection; native-component comparison loses.", + "evidence": "research/qq16-caller-install/README.md", + "remaining": "Complete matched physical protocol bill, or changed source-compatible demand/circuit; no affordable supplier yet.", + "status": "author-checked", + "source_commit": "0b082d22a0e9a442d264ab0633e35ef26c790630", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "centre-path-sharing", + "question": "Can a specified persistent boundary eliminate a repeated centre operation in the current caller?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Write a two-call input/output contract on the current source word, including arbitrary centre baselines and every later read. Price producer, retention, native alignment and restoration jointly. Historical 64-per-call and 1.90x figures are not current budgets. Stop if a missing consumer or restored-input obligation consumes the saving; reopen only with a changed legal boundary.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "centre path", + "persistent boundary", + "dirty recoding" + ], + "existing_checks": [ + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "coverage-law-change", + "question": "Can a completed call earn more independent productive target credit without an offsetting paid bill?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "A source-bound arbitrary-input identity and legal producer/consumer boundary with the complete paid and productive target invoice, including restoration, ownership, native alignment and extra charges. Price under the actual current model; historical ceiling.py assumptions must be established before use. A favorable optimistic relaxation keeps a route open but is not a completed supplier. A scoped local result remains useful; expansion requires the family-level budget gate.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Use #5599 as a completed positive control, then choose one uncovered cut/module beyond an applicable frozen exclusion. Derive independence, saturation and chronological availability rather than counting rational rank alone. Price target credits and all new jobs together, then check compiler and actual caller compatibility. Stop on a nonphysical credit or an unfavorable complete relaxation.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "target credit", + "helper split", + "coverage law" + ], + "existing_checks": [ + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "connector-alphabet-change", + "question": "Does one explicit extension of the connector alphabet offer a favorable completed budget?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/universal-connector-boundary/README.md", + "certificates/selected-result.json" + ], + "methods": [ + "Construct and charge a legal extra operation on a minimal instance.", + "Prove a target-specific bound after adding one specified operation family." + ], + "acceptance_gate": "State which fixed-alphabet premise changes and charge its implementation; do not declare it free. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "research/universal-connector-boundary/verify.py" + ], + "expected": "PASS_UNIVERSAL_CONNECTOR_BOUNDARY", + "inspect": "Reproduce the 945-pairing control, then read Exact interface to list the allowed calls.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Add exactly one legally priced operation and test a tiny dirty-input instance before enumerating larger cases.", + "bottleneck_link": "A new legal connector operation could change recursive interface cost; a larger census in the same alphabet is a separate side result.", + "allowed_variations": [ + "Choose one additional operation and a small source count for its first counterexample." + ], + "scope_change_triggers": [ + "Keeping the alphabet and only increasing the source count; record this as a changed assignment.", + "Extending a source-count census without naming a supplier/interface decision it could change; audit #2973 pruning concerns before relying on the affected predecessor exclusions." + ], + "overlap_terms": [ + "universal connector", + "source-toggle", + "connector alphabet" + ] + } + ] + }, + { + "id": "adversarial-audit", + "weight": 15, + "tasks": [ + { + "id": "selected-stock-envelope", + "question": "What explicit uniform stock envelope does the actual selected stopped producer supply at one bootstrap stage?", + "starting_points": [ + "research/selected-bootstrap-stock-audit/README.md", + "research/bootstrap-cutoff-time-space-split/README.md", + "certificates/selected-result.json", + "docs/research/community-efficient1000-review.md", + "research/stock-margin-chain/README.md" + ], + "methods": [ + "Derive a source-bound reserve recurrence at the actual selected atom widths, separating parent stock from completed inner borrowing.", + "Find an exact missing implication or counterexample to a proposed selected-stage stock envelope." + ], + "acceptance_gate": "Bind every coefficient and depth factor to the selected producer and state the width domain. Compare a proved envelope with the sufficient cutoff guard; a large numerical headroom or a historical m=120 coefficient is not a selected m=73 proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Choose one actual selected producer/stage and derive its parent reserve and depth coefficient from source. Check whether newer handoffs already cover that exact obligation. Stop with the missing implementation lemma if it cannot be bounded; do not rerun #2972 cutoff/headroom arithmetic as a new contribution.", + "bottleneck_link": "This reduces a concrete inherited implementation obligation without confusing unchanged kappa arithmetic with a completed theorem.", + "allowed_variations": [ + "One stage or one explicit reserve/depth implication.", + "An independently checked same-domain proof repair, retaining all remaining assumptions." + ], + "scope_change_triggers": [ + "Importing the historical 57604 or 252 allowance without a selected-producer binding.", + "Calling a conditional fit lemma a full outer-proof adoption.", + "Replacing an actual selected stock coefficient with cutoff comparisons or a conditional fit inequality." + ], + "overlap_terms": [ + "selected stock", + "stock envelope", + "bootstrap cutoff", + "1956", + "1965", + "1990", + "2972", + "stock-margin-chain", + "actual_stock_coefficient" + ], + "existing_checks": [ + { + "scope": "Retained stock audit identifies missing actual selected-stage coefficients; later cutoff-chain arithmetic does not supply them.", + "evidence": "docs/research/research-family-status.md#revision-6-handoffs-source-archives-awaiting-independent-validation", + "remaining": "Derive one actual reserve/depth coefficient from the selected producer.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + { + "id": "supplier-boundary-audit", + "question": "Does one changed supplier have complete source-bound native, caller, ordinary and outer admission coverage?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Pin the current sources and one obligation; the historical owner audit is an example, not evidence of a current bug.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one latest uncovered candidate and build a delta coverage map against the selected review. For P104, #5717 changes owned-lifetime assumptions and #5719 covers exact #5713 causal premises; neither automatically transfers to #5718. For BIT, #5679/#5708 need component admission and compatible outer use. Check controls and exact source identity before reuse; stop with one resolved gap or explicit remaining obligation. A heavy full replay requires a separate serial resource budget.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "supplier admission", + "5717", + "5719", + "5708", + "owned lifetime" + ], + "existing_checks": [ + { + "scope": "PR #4088: author-checked local words, native receipts, owner/phase fill and exact moment.", + "evidence": "research/staged544-mixed-fourth-entry/README.md", + "remaining": "Rebind and validate ordinary/outer admission with all four providers; full mixed release not established.", + "status": "author-checked", + "source_commit": "72d7efc181edb21806a878f174847c96dd410ab0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #3801: successor scatter-boundary decision package.", + "evidence": "research/scatter-boundary-decision/README.md", + "remaining": "Consult its exact acceptance scope before any new exporter audit; not proof of a selected failure.", + "status": "author-checked", + "source_commit": "911f8800ba7a4b03603ef62c5ffc6240e53cb5fd", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "uniform-transfer-audit", + "question": "Can one of the selected record's five inherited assumptions be proved at its actual caller?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Choose one assumption ID (native_all_columns, owned_erasure, compiler, precision_tape, analytic_recovery), one quantified implication and exact dependency closure. Check current handoffs, including #5625 row reentry and #5707 root-prefix lowering, without treating their partial scope as the whole theorem. Prove or falsify that implication with a caller-bound argument; stop at the chosen obligation. Finite tests or root digits do not discharge an all-size statement.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "census-pruning-audit", + "question": "Does the reported word-census parity-pruning error invalidate a specific exclusion we still rely on, and what bounded repair is justified?", + "starting_points": [ + "research/f7-weight-parity-census-correction/README.md", + "docs/research/research-family-status.md" + ], + "methods": [ + "Independently reconstruct the tiny counterexample and trace one affected exclusion to its exact pruning code.", + "Compare corrected and unpruned enumeration on a small exhaustive domain, then audit the changed pruning implication." + ], + "acceptance_gate": "Pin the old and proposed corrected engines, distinguish a disproved pruning rule from a disproved final bound, and state exactly which downstream exclusions need revalidation. #2973 is an author-checked source archive; neither its new f(7) claim nor all old conclusions are automatically accepted or rejected.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Reconstruct the eight prefix states of 01021323 and compare bit-0 versus Hamming-weight parity budgets independently. Trace the reported false prune to one pinned predecessor (#2542, #2634 or #2691), then test a small exhaustive domain. Stop after a source-impact handoff or corrected-prune proof; a full seven-label replay needs a separate resource budget and a named research decision it can change.", + "bottleneck_link": "An unsound exclusion can wrongly close a mechanism; correcting its dependency boundary is more useful than extending the same census.", + "allowed_variations": [ + "One predecessor pruning rule, one independently exhaustive small domain, or one downstream dependency audit." + ], + "scope_change_triggers": [ + "Launching a larger census before validating the prune and explaining which active decision it changes.", + "Treating a small-domain counterexample to the old rule as a counterexample to every reported seven-label bound." + ], + "overlap_terms": [ + "2973", + "2542", + "2634", + "2691", + "weight parity", + "bit-0", + "01021323", + "census pruning" + ] + } + ] + }, + { + "id": "independent-verification", + "weight": 10, + "tasks": [ + { + "id": "independent-moment", + "question": "Does a changed construction's serialized target/paid invoice independently support its claimed improvement?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "docs/research/recursive-invoice-preflight.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Demonstrate independence, source binding, positive cases and semantic failure controls. Name the existing checks and the missing coverage. More digits or another equivalent evaluation of an unchanged root is not by itself new verification coverage.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Independently recount one changed emitted word and its complete caller, importing no constructor or pricing engine. Include target losses, owned lifetimes, native orientation and extra charges. Check existing #5633/#5708/#5717/#5719 coverage to avoid duplicate audits and preserve its exact head. Stop after the chosen missing implication; a correct root alone is not supplier admission.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "invoice", + "signed moment", + "productive target", + "independent recount" + ], + "existing_checks": [ + { + "scope": "PR #4088: mixed local/owner/phase ledger and moment reported.", + "evidence": "research/staged544-mixed-fourth-entry/README.md", + "remaining": "Independent binding of changed construction to paid histogram, distinct from full admission.", + "status": "author-checked", + "source_commit": "72d7efc181edb21806a878f174847c96dd410ab0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4091: sharp pooled ceiling proposed for fixed THREE/FOUR words and inventory.", + "evidence": "research/staged-fourth-mixture-ceiling/README.md", + "remaining": "Validate dual, exhaustive pattern scope and exact source equivalence before applying to newer fills.", + "status": "author-checked", + "source_commit": "a29bdd8f56cd18b805917775cdec09ff935eddc4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4067: paid (2,2) to (1,3) exchange and fixed OQ4 host reported.", + "evidence": "research/r437-two-window-carrier/README.md", + "remaining": "Independent full cost delta; remaining caller/precision/stock obligations are separate.", + "status": "author-checked", + "source_commit": "a95f11c52e3ca1e4c5171b3c20d8f4b0815aee2e", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "formal-interface-lemma", + "question": "Can one uncovered interface implication be formalized with exact caller and certificate bindings?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/gate-operand-parity-lean/README.md", + "research/staged544-certified-endpoint/README.md", + "research/unconditional-batched-crt/README.md" + ], + "methods": [ + "Formalize a missing boundary lemma identified by the selected review.", + "Audit a formal theorem-to-certificate binding independently." + ], + "acceptance_gate": "State the exact formalized proposition and remaining assumptions; avoid duplicate arithmetic formalizations already present.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Write one missing statement with quantified hypotheses, actual caller and existing coverage. A compact-switch lemma is a candidate only after its mathematical contract is reviewed. Establish a bounded proof plan before a separately budgeted proof-assistant build; do not rerun large Lean jobs as orientation.", + "bottleneck_link": "A missing interface proof can reduce the conditional gap even if it does not change kappa.", + "allowed_variations": [ + "Narrow to one formal lemma or one theorem-to-certificate binding." + ], + "scope_change_triggers": [ + "Formalizing already-covered arithmetic and claiming the full multiplication theorem." + ], + "overlap_terms": [ + "hyperplane end", + "formal interface", + "Lean binding", + "3807", + "3857", + "4100", + "gate-operand-parity-lean", + "staged544-certified-endpoint", + "unconditional-batched-crt" + ], + "existing_checks": [ + { + "scope": "PR #3807: scoped gate-operand parity formalization.", + "evidence": "research/gate-operand-parity-lean/README.md", + "remaining": "Exact theorem-to-caller binding and genuinely uncovered interface lemmas.", + "status": "author-checked", + "source_commit": "4c3530f42a6abcc48e7a6bcffd6c901911dc8269", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #3857: certified real-power moment/endpoint arithmetic.", + "evidence": "research/staged544-certified-endpoint/README.md", + "remaining": "Uniform algorithmic implications, not another endpoint digit.", + "status": "author-checked", + "source_commit": "ef4315b8caa605e47a2515004845eb2d2ed71a86", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4100: compact-switch formalization proposed as future validation.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Audit the statement and assumptions before a formal proof campaign.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + } + ] + }, + { + "id": "verifier-engineering", + "weight": 8, + "tasks": [ + { + "id": "replay-runtime", + "question": "Can one measured replay bottleneck be sped up without dropping coverage?", + "starting_points": [ + "scripts/run_isolated_tests.py", + "scripts/verify_replay_coverage.py", + "certificates/selected-result.json" + ], + "methods": [ + "Profile one isolated replay and optimize the measured bottleneck.", + "Design source-bound reuse with explicit dependency invalidation and negative controls." + ], + "acceptance_gate": "Report before/after wall time on the same fixture, retained checks and invalidation behavior.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Measure one unchanged fixture, preserve check coverage, and test one optimization with invalidation controls.", + "bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.", + "allowed_variations": [ + "Profile one stage or design one source-bound cache boundary." + ], + "scope_change_triggers": [ + "Skipping coverage or comparing different fixtures to claim speedup." + ], + "overlap_terms": [ + "replay runtime", + "cache invalidation", + "isolated tests" + ] + }, + { + "id": "portable-replay", + "question": "Can one reproducible environment or artifact-comparison failure be repaired?", + "starting_points": [ + "research/gzip-container-reproducibility/README.md", + "docs/ci-verification.md" + ], + "methods": [ + "Reproduce one portability failure and add a minimal cross-environment fix.", + "Audit one canonical-payload comparison for omitted proof-relevant fields." + ], + "acceptance_gate": "Preserve immutable source hashes and proof-relevant content; a different compressed byte stream alone is not a mathematical mismatch.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Reproduce one specific mismatch or audit one canonical comparison for omitted proof-relevant fields.", + "bottleneck_link": "Portable exact checks prevent environment failures from blocking valid contributions.", + "allowed_variations": [ + "One interpreter/version mismatch or one payload field comparison." + ], + "scope_change_triggers": [ + "Removing immutable-source pins because generated compressed bytes differ." + ], + "overlap_terms": [ + "gzip container", + "reproducibility", + "canonical payload" + ] + } + ] + }, + { + "id": "consolidation", + "weight": 5, + "tasks": [ + { + "id": "overlap-receipt", + "question": "What exact content and credit of a small named PR set has already been retained?", + "starting_points": [ + "docs/research/pr-ledger.md", + "CONTRIBUTORS.md" + ], + "methods": [ + "Compare exact heads and retained artifacts to write a source-bound disposition receipt.", + "Audit an existing receipt for missing content or predecessor attribution." + ], + "acceptance_gate": "Separate complete integration, partial retention and changed heads; make no autonomous closures.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Compare that set to retained artifacts; produce a complete or explicitly partial disposition receipt.", + "bottleneck_link": "Reliable overlap evidence preserves credit and prevents repeated review of already-retained material.", + "allowed_variations": [ + "One small related PR family or one existing integration receipt." + ], + "scope_change_triggers": [ + "Treating matching titles or one shared blob as proof of full incorporation." + ], + "overlap_terms": [ + "overlap receipt", + "partial integration", + "attribution" + ] + }, + { + "id": "scope-navigation", + "question": "Can one misleading historical-current claim or missing research cross-reference be corrected?", + "starting_points": [ + "docs/research/current-status.md", + "docs/research/pr-ledger.md", + "certificates/selected-result.json" + ], + "methods": [ + "Trace one confusing path from onboarding to its authoritative source.", + "Index one tightly related family of obstructions with explicit excluded and open hypotheses." + ], + "acceptance_gate": "Produce evidence-backed navigation, preserve historical records and avoid a duplicate global survey.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Repair one confusing path or produce a scoped map of one related obstruction family.", + "bottleneck_link": "Clear navigation lowers entry cost for central research; a global survey without a concrete fix is not required.", + "allowed_variations": [ + "One historical-current ambiguity or one bounded family index." + ], + "scope_change_triggers": [ + "Rewriting frozen scientific packages just to change their historical wording." + ], + "overlap_terms": [ + "current status", + "historical checkpoint", + "scope navigation" + ] + } + ] + }, + { + "id": "incumbent-optimization", + "weight": 2, + "tasks": [ + { + "id": "selected-packing", + "question": "Is there meaningful uncovered packing headroom for an exact current word and boundary contract?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "docs/research/recursive-invoice-preflight.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Check live overlap and exact model/source binding first. Distinguish a chronological construction from a pooled optimum. State the applicable fixed-inventory ceiling and remaining headroom; changed words or interfaces require a new fully charged model. Do not launch a residual search without an explicit scope and time cap.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Derive or authenticate a ceiling for the exact current paid/target inventory before searching. Old #1240/#4091 caps do not constrain #5599 automatically. Require an unclaimed domain, time cap and useful complete margin. Stop at the applicable ceiling; change the word or boundary instead of adding seeds.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "T16", + "owner exchange", + "packing", + "4091", + "4088", + "staged-fourth-mixture-ceiling", + "staged544-mixed-fourth-entry" + ], + "existing_checks": [ + { + "scope": "PR #4091: pooled optimum at one-third staging for pinned fixed words; not a chronological fill.", + "evidence": "research/staged-fourth-mixture-ceiling/README.md", + "remaining": "Independent scope/source check; any residual optimization is explicitly bounded and optional.", + "status": "author-checked", + "source_commit": "a29bdd8f56cd18b805917775cdec09ff935eddc4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4088: later 1090-call literal fill improves the earlier 1080-call witness.", + "evidence": "research/staged544-mixed-fourth-entry/README.md", + "remaining": "Complete admission remains separate; old residual-bin instructions must not be copied blindly.", + "status": "author-checked", + "source_commit": "72d7efc181edb21806a878f174847c96dd410ab0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + { + "id": "scalar-to-moment", + "question": "Can a scalar/frame rewrite improve the complete signed moment through paid jobs, productive targets, or both?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "docs/research/recursive-invoice-preflight.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "Require a legal chronological rewrite and favorable complete signed target-minus-paid moment with all extra charges. Unchanged ADD counts or unchanged paid-call counts alone decide neither success nor failure. Compiler, native and outer admission remain separate obligations.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Construct one legal source-bound rewrite and compare complete before/after P and T. Charge restoration, source windows and owned helpers. A paid call need not disappear: a legal target split or rank redistribution may win. Stop if the signed moment is unchanged or the consumer repays the gain. Do not extend a scalar-only census on ADD counts.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "signed moment", + "target split", + "rank exchange", + "scalar rewrite" + ], + "existing_checks": [ + { + "scope": "PR #3998: consecutive A2 scalar contraction", + "evidence": "research/staged544-a2-graph-rewrite/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "389268a6b5e0373a3125d5c6fcd6995f4ea324f5", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4019: separated A2 sites with unchanged recursive histogram", + "evidence": "research/staged544-separated-a2/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "f408e09df300b575235f7f77f81948071397e16d", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4112: composition audit", + "evidence": "research/staged544-a2-composition-audit/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "205b7380656ba4b6316a8a493b1a3c679b8f7a0e", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4152: A1858 contraction audit", + "evidence": "research/staged544-a1858-contraction-audit/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "caaa14cde5962adc372fdca71f63d0f29e73c8b2", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + } + ] + } + ], + "selection_context": { + "refreshed_on": "2026-10-26", + "kappa": "62009/20000000", + "source_pr": 5599, + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "record": "certificates/selected-result.json", + "review": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "orientation_command": "python3 -B scripts/research_selected_baseline.py", + "scope": "Revision-8 strategic reassessment. PR5599 is selected and independently replayed under five inherited assumptions. Archived successor claims are not admissions. Compare complete signed target/paid moments and the current nine outer rows; no historical balanced-transfer cap is imposed." + } +} diff --git a/research/early-duplicate-verify-rejection/vendor/export_research_package.py b/research/early-duplicate-verify-rejection/vendor/export_research_package.py new file mode 100644 index 0000000000..25b0a12a80 --- /dev/null +++ b/research/early-duplicate-verify-rejection/vendor/export_research_package.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python3 +"""Export committed package bytes and explicit inputs; check bundles without Git. + +Tekalign, with substantial OpenAI Codex assistance. Apache-2.0. +""" +import argparse +from contextlib import closing +import hashlib +import io +import json +import ntpath +import os +from pathlib import Path +import re +import subprocess +import tarfile +import tempfile + +from research_package import canonical_relative_path, git, git_blobs, require + +ROOT = Path(__file__).resolve().parents[1] +RECEIPT = '.research-export.json' +FORMAT = 'research-package-export-v1' + + +def unique_json_keys(pairs): + result = {} + for key, value in pairs: + require(key not in result, 'duplicate export JSON key: ' + key) + result[key] = value + return result + + +def bundle_relative_path(name): + canonical_relative_path(name) + # A POSIX-relative name such as C:/file or C:file can discard the extraction + # directory on Windows. Apply the bundle policy on every producer/check host. + require(not ntpath.splitdrive(name)[0], 'drive-qualified export path: ' + name) + + +def inventory(root, package, ref, input_ref=None): + require(re.fullmatch(r'research/[a-z0-9][a-z0-9-]*', package), + 'package must be research/') + commit = git(root, 'rev-parse', '--verify', '--end-of-options', + ref + '^{commit}').decode('ascii').strip() + # Read declarations from the publication, never the working manifest. + with closing(git_blobs(root, [commit + ':' + package + '/VERIFY.json'])) as rows: + values = list(rows) + manifest = json.loads(values[0][1], object_pairs_hook=unique_json_keys) + require(isinstance(manifest, dict), 'VERIFY.json must be an object') + inputs = manifest.get('inputs') + require(isinstance(inputs, list), 'VERIFY.json inputs must be a list') + for name in inputs: + bundle_relative_path(name) + require(name != RECEIPT, 'reserved export path: ' + name) + require(len(inputs) == len(set(inputs)), 'duplicate declared input') + contexts = [(commit, [package, *inputs])] + if input_ref is not None: + require(all(name != package and not name.startswith(package + '/') for name in inputs), + 'separate input commit requires external declared inputs') + input_commit = git(root, 'rev-parse', '--verify', '--end-of-options', + input_ref + '^{commit}').decode('ascii').strip() + contexts = [(commit, [package]), (input_commit, inputs)] + records = [] + for tree, paths in contexts: + if paths: + records.extend(git(root, '--literal-pathspecs', 'ls-tree', '-r', '-z', '--full-tree', + tree, '--', *paths).split(b'\0')) + entries = {} + for record in filter(None, records): + header, raw_name = record.split(b'\t', 1) + mode, kind, obj = header.split() + name = raw_name.decode('utf-8') + bundle_relative_path(name) + require(mode in (b'100644', b'100755') and kind == b'blob', + 'non-regular committed file: ' + name) + require(name.startswith(package + '/') or name in inputs, + 'input must name one file, not a directory: ' + name) + entries[name] = (int(mode, 8) & 0o777, obj.decode('ascii')) + require(set(inputs) <= entries.keys(), 'missing declared input: ' + + ', '.join(sorted(set(inputs) - entries.keys()))) + require(package + '/VERIFY.json' in entries, 'missing committed manifest') + require_file_tree([*entries, RECEIPT]) + return commit, entries + + +def require_file_tree(names): + """Regular-file members cannot also be implicit directories for other files.""" + files = set(names) + for name in sorted(files): + for parent in canonical_relative_path(name).parents: + require(parent.as_posix() not in files, + 'file/directory collision: ' + parent.as_posix() + ' and ' + name) + + +def member(name, data, mode=0o644): + info = tarfile.TarInfo(name) + info.size = len(data) + info.mode = mode + # TarInfo defaults give zero timestamps/owners and empty owner names. + return info, io.BytesIO(data) + + +def export(root, package, ref, output, input_ref=None): + # Resolve a moving input ref once, before collecting either snapshot. + input_commit = (git(root, 'rev-parse', '--verify', '--end-of-options', + input_ref + '^{commit}').decode('ascii').strip() + if input_ref is not None else None) + commit, entries = inventory(root, package, ref, input_commit) + receipt = {'format': FORMAT, 'commit': commit, 'package': package, 'files': []} + if input_commit is not None: + receipt['input_commit'] = input_commit + output = Path(output) + require(not output.exists() and not output.is_symlink(), 'output already exists') + # Publish only after Git's final status and the archive close both succeed. + fd, name = tempfile.mkstemp(prefix='.research-export-', dir=output.parent) + try: + with os.fdopen(fd, 'wb') as stream, tarfile.open(fileobj=stream, mode='w', format=tarfile.PAX_FORMAT) as archive: + names = sorted(entries) + with closing(git_blobs(root, [entries[n][1] for n in names])) as rows: + for (obj, data), path in zip(rows, names): + mode, expected = entries[path] + require(obj == expected, 'Git blob mismatch: ' + path) + archive.addfile(*member(path, data, mode)) + receipt['files'].append({'path': path, 'mode': mode, 'size': len(data), + 'sha256': hashlib.sha256(data).hexdigest()}) + data = (json.dumps(receipt, sort_keys=True, indent=2) + '\n').encode('utf-8') + archive.addfile(*member(RECEIPT, data)) + # Both operations refuse an existing destination, including one created + # after the check above. Windows rename needs no hard-link permission; + # POSIX rename would overwrite, so retain link there. The staging file + # is in the destination directory and all writer handles are closed. + if os.name == 'nt': + os.rename(name, output) + else: + os.link(name, output) + finally: + Path(name).unlink(missing_ok=True) + return receipt + + +def check_declared_inputs(path, receipt, seen): + """Check the bundled manifest's file declarations without extraction or Git.""" + name = receipt['package'] + '/VERIFY.json' + with tarfile.open(path, mode='r:') as archive: + item = archive.getmember(name) + require(item.isfile() and item.size <= 16 * 1024 * 1024, + 'invalid or oversized bundled manifest') + with archive.extractfile(item) as stream: + raw = stream.read(16 * 1024 * 1024 + 1) + require(len(raw) == seen[name]['size'] and hashlib.sha256(raw).hexdigest() == seen[name]['sha256'], + 'bundled manifest changed during declaration check') + + def unique(pairs): + result = {} + for key, value in pairs: + require(key not in result, 'duplicate bundled manifest key: ' + key) + result[key] = value + return result + + manifest = json.loads(raw.decode('utf-8'), object_pairs_hook=unique) + require(isinstance(manifest, dict) and isinstance(manifest.get('inputs'), list), + 'bundled VERIFY.json needs an inputs list') + inputs = manifest['inputs'] + require(len(inputs) <= 100000, 'bundled input count exceeds 100000') + for entry in inputs: + bundle_relative_path(entry) + require(entry != RECEIPT, 'reserved declared input: ' + entry) + declared = set(inputs) + require(len(inputs) == len(declared), 'duplicate bundled input') + missing = declared - seen.keys() + require(not missing, 'missing bundled declared input: ' + ', '.join(sorted(missing))) + extra = {entry for entry in seen if not entry.startswith(receipt['package'] + '/') and entry not in declared} + require(not extra, 'undeclared external bundle file: ' + ', '.join(sorted(extra))) + return len(inputs) + + +def check_bundle(path, check_inputs=False): + """Check declared inventory, modes and payload hashes; never extract or execute.""" + seen, receipt = {}, None + with tarfile.open(path, mode='r:') as archive: + for item in archive: + bundle_relative_path(item.name) + require(item.isfile(), 'non-regular archive member: ' + item.name) + require(item.name not in seen, 'duplicate archive member: ' + item.name) + require(item.mode in (0o644, 0o755), 'unsupported mode: ' + item.name) + digest = hashlib.sha256() + with archive.extractfile(item) as data: + if item.name == RECEIPT: + require(item.size <= 16 * 1024 * 1024, 'oversized export receipt') + receipt = json.load(data, object_pairs_hook=unique_json_keys) + else: + for block in iter(lambda: data.read(1024 * 1024), b''): + digest.update(block) + seen[item.name] = {'path': item.name, 'mode': item.mode, 'size': item.size, + 'sha256': digest.hexdigest()} + require_file_tree(seen) + require(isinstance(receipt, dict) and receipt.get('format') == FORMAT, 'missing or invalid export receipt') + require(isinstance(receipt.get('commit'), str) and + re.fullmatch(r'(?:[0-9a-f]{40}|[0-9a-f]{64})', receipt['commit']), 'invalid commit label') + if 'input_commit' in receipt: + require(isinstance(receipt['input_commit'], str) and + re.fullmatch(r'(?:[0-9a-f]{40}|[0-9a-f]{64})', receipt['input_commit']), 'invalid input commit label') + require(isinstance(receipt.get('package'), str) and + re.fullmatch(r'research/[a-z0-9][a-z0-9-]*', receipt['package']), 'invalid package label') + files = receipt.get('files') + require(isinstance(files, list), 'invalid receipt files') + expected = {} + for row in files: + require(isinstance(row, dict), 'invalid receipt row') + require(type(row.get('size')) is int and row['size'] >= 0, 'invalid receipt size') + require(type(row.get('mode')) is int and row['mode'] in (0o644, 0o755), + 'invalid receipt mode') + name = row.get('path') + bundle_relative_path(name) + require(name != RECEIPT and name not in expected, 'duplicate or reserved receipt path') + expected[name] = row + del seen[RECEIPT] + require(seen == expected, 'bundle inventory, mode, size or SHA256 mismatch') + require(receipt['package'] + '/VERIFY.json' in seen, 'missing bundled manifest') + if check_inputs: + receipt = {**receipt, 'declared_inputs_checked': check_declared_inputs(path, receipt, seen)} + return receipt + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + commands = parser.add_subparsers(dest='command', required=True) + make = commands.add_parser('export') + make.add_argument('--package', required=True) + make.add_argument('--ref', default='HEAD') + make.add_argument('--input-ref', help='explicit commit for all external declared inputs; default: --ref') + make.add_argument('--output', type=Path, required=True) + check = commands.add_parser('check') + check.add_argument('archive', type=Path) + check.add_argument('--check-inputs', action='store_true', + help='also check bundled VERIFY.json input coverage; see docs/research/export-input-coverage.md') + args = parser.parse_args() + try: + result = (export(ROOT, args.package, args.ref, args.output, args.input_ref) if args.command == 'export' + else check_bundle(args.archive, args.check_inputs)) + except (OSError, ValueError, TypeError, KeyError, RecursionError, tarfile.TarError, subprocess.SubprocessError) as exc: + parser.exit(1, str(exc) + '\n') + print('PASS_RESEARCH_EXPORT ' + json.dumps({k: result[k] for k in ('commit', 'package')} | + {'files': len(result['files'])} | + ({'input_commit': result['input_commit']} if 'input_commit' in result else {}) | + ({'declared_inputs_checked': result['declared_inputs_checked']} + if 'declared_inputs_checked' in result else {}))) + + +if __name__ == '__main__': + main() diff --git a/research/early-duplicate-verify-rejection/vendor/research_package.py b/research/early-duplicate-verify-rejection/vendor/research_package.py new file mode 100644 index 0000000000..091b4c8f58 --- /dev/null +++ b/research/early-duplicate-verify-rejection/vendor/research_package.py @@ -0,0 +1,1053 @@ +#!/usr/bin/env python3 +"""Validate and replay explicitly registered research packages, never every verify.py. + +Douglas Colkitt, with OpenAI Codex assistance. Apache-2.0. +""" +import argparse +import errno +from contextlib import closing, contextmanager +from itertools import chain +import hashlib +import importlib.metadata +import json +import os +from pathlib import Path, PurePosixPath +import re +import signal +import stat +import subprocess +import sys +import tempfile +import threading + +ROOT = Path(__file__).resolve().parents[1] +GIT_BLOB_RESPONSE_TIMEOUT = 90 + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +def canonical_relative_path(name): + # Git's changed paths use one repository-relative POSIX spelling. Accepting + # aliases here would let a declared input evade the planner's exact match. + require(isinstance(name, str), "canonical relative path must be a string") + path = PurePosixPath(name) + require(bool(path.parts) and not path.is_absolute() and ".." not in path.parts + and "\\" not in name and path.as_posix() == name, + "use a canonical repository-relative POSIX path: " + name) + return path + + +def symlink_free_relative_path(root, name): + """Reject symlink/junction components without requiring a deleted input to exist. + + Git reports changes under the target's path, not a symlink alias declared + by its consumer. Inspect existing components below the repository root; + the checkout must remain stable during planning, validation and replay. + """ + parts = canonical_relative_path(name).parts + current = root + for part in parts: + current = current / part + try: + info = current.lstat() + except (FileNotFoundError, NotADirectoryError): + break + require(not stat.S_ISLNK(info.st_mode), "symlink in repository-relative path: " + name) + # Windows junctions have directory mode, not S_IFLNK. Inspect the same + # lstat result so even a dangling junction is rejected before traversal. + require(getattr(info, "st_reparse_tag", 0) != getattr(stat, "IO_REPARSE_TAG_MOUNT_POINT", None), + "junction in repository-relative path: " + name) + return root / name + + +def relative_file(root, name): + result = symlink_free_relative_path(root, name) + require(result.resolve().is_relative_to(root.resolve()) and result.is_file(), + "missing or external file: " + name) + return result + + +# Adapted from the package-local policy in +# research/t74-2530-source-partner-audit/audit_common.py (Apache-2.0). +# Keep repository configuration and linked-worktree .git discovery intact; +# inherited shell overrides must not choose a different repository or index. +_GIT_REDIRECT_VARS = frozenset(( + "GIT_DIR", "GIT_WORK_TREE", "GIT_INDEX_FILE", "GIT_OBJECT_DIRECTORY", + "GIT_ALTERNATE_OBJECT_DIRECTORIES", "GIT_NAMESPACE", "GIT_CEILING_DIRECTORIES", + "GIT_COMMON_DIR", "GIT_CONFIG_PARAMETERS", "GIT_CONFIG_COUNT", +)) +_GIT_CONFIG_PREFIXES = ("GIT_CONFIG_KEY_", "GIT_CONFIG_VALUE_") + + +def git_source_env(): + """Use cwd's repository and stored objects, without changing the parent. + + Git can ignore cwd when inherited selection variables point elsewhere. + Config-injection variables can also redirect worktree/index operations. + This policy is only for Git metadata/source subprocesses, not verifiers. + """ + env = {name: value for name, value in os.environ.items() + if name not in _GIT_REDIRECT_VARS and not name.startswith(_GIT_CONFIG_PREFIXES)} + # Replacement refs can report an original ID while returning other bytes. + env["GIT_NO_REPLACE_OBJECTS"] = "1" + return env + + +def git(root, *args): + return subprocess.run(["git", *args], cwd=root, env=git_source_env(), + capture_output=True, check=True).stdout + + +def tracked_input_paths(root): + """Use HEAD spelling, never case folding, filesystem resolution or the index. + + Staged/untracked files are not replay inputs until committed. NUL framing + preserves Git filenames containing whitespace, including CR and LF. + """ + raw = subprocess.run( + ["git", "ls-tree", "-r", "--name-only", "-z", "HEAD"], cwd=root, env=git_source_env(), + capture_output=True, check=True, timeout=30).stdout + return frozenset(name.decode("utf-8") for name in raw.split(b"\0") if name) + + +def require_tracked_input(name, paths): + canonical_relative_path(name) + require(name in paths, "use an exact Git-tracked input path from HEAD: " + name) + + +def git_source_rows(root, base, names): + """Read one pinned object at a time through one Git process; no persistent cache. + + Each request is consumed before the next is sent. This avoids pipe deadlocks + and retains the old one-blob memory bound, even for large source archives. + Newline paths and non-blob objects retain the legacy Git-show semantics. + The caller must close this generator if source validation fails mid-stream. + """ + with subprocess.Popen(["git", "cat-file", "--batch"], cwd=root, env=git_source_env(), + stdin=subprocess.PIPE, stdout=subprocess.PIPE, + stderr=subprocess.PIPE) as process: + try: + for name in names: + expression = base + ":" + name + if "\n" in expression or "\r" in expression: + yield git(root, "rev-parse", expression).decode().strip(), git(root, "show", expression) + continue + process.stdin.write(expression.encode("utf-8") + b"\n") + process.stdin.flush() + header = process.stdout.readline().rstrip(b"\n").split(b" ") + require(len(header) == 3 and re.fullmatch(rb"[0-9a-f]{40,64}", header[0]) + and header[2].isdigit(), "missing or invalid Git source: " + name) + size = int(header[2]) + payload = process.stdout.read(size) + require(len(payload) == size and process.stdout.read(1) == b"\n", + "truncated Git source: " + name) + if header[1] != b"blob": + payload = git(root, "show", expression) + yield header[0].decode("ascii"), payload + process.stdin.close() + code = process.wait(timeout=90) + require(code == 0, "Git source reader failed: " + process.stderr.read().decode("utf-8", errors="replace")) + finally: + if not process.stdin.closed: + process.stdin.close() + if process.poll() is None: + try: + process.wait(timeout=5) + except subprocess.TimeoutExpired: + process.kill() + process.wait() + + +class _UnsupportedNulBatch(Exception): + """Git rejected the initial NUL-mode request before yielding any source.""" + + +def _closed_stdin_error(error): + # Windows can report EINVAL instead of EPIPE when a child closes stdin. + # This classifies the pipe error only; the retry still requires exit 129. + return (isinstance(error, BrokenPipeError) + or (os.name == "nt" and error.errno == errno.EINVAL)) + + +def _stop_git_blob_process(process): + """Stop this reader's owned POSIX group even after its leader exits.""" + try: + if os.name == "posix": + # Reap an exited leader first: signaling a group containing only + # its unreaped zombie can report EPERM on macOS. A surviving + # descendant keeps the group alive after the leader is reaped. + process.poll() + os.killpg(process.pid, signal.SIGKILL) + else: + process.kill() + except ProcessLookupError: + pass + + +@contextmanager +def _git_blob_response_deadline(stop): + """Bound one response, excluding time spent by its consumer. + + On POSIX the reader owns a session: ordinary descendants retaining a pipe + are stopped with the leader. Escaped sessions and separate git() calls are + outside this contract; non-POSIX retains the direct-child deadline. + """ + expired = threading.Event() + + def terminate(): + expired.set() + stop() + + timer = threading.Timer(GIT_BLOB_RESPONSE_TIMEOUT, terminate) + timer.start() + try: + yield + finally: + timer.cancel() + timer.join() + if expired.is_set(): + raise subprocess.TimeoutExpired("git cat-file blob response", GIT_BLOB_RESPONSE_TIMEOUT) + + +def _git_blob_batch(root, specs, nul): + argv = ["git", "cat-file", "--batch"] + (["-z"] if nul else []) + # Usage diagnostics from the unsupported-option probe are expected. Avoid + # a second pipe that could block while we consume the framed stdout reply. + with subprocess.Popen(argv, cwd=root, env=git_source_env(), stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, + start_new_session=(os.name == "posix")) as process: + stopped = False + + def stop(): + nonlocal stopped + if not stopped: + _stop_git_blob_process(process) + stopped = True + + try: + for index, spec in enumerate(specs): + require("\0" not in spec, "invalid Git object request") + request = spec + if not nul and ("\n" in spec or "\r" in spec): + # Resolve one literal argument, never split a path into requests. + request = git(root, "rev-parse", "--verify", "--end-of-options", spec).decode("ascii").strip() + require(re.fullmatch(r"[0-9a-f]{40,64}", request), "invalid Git object ID") + with _git_blob_response_deadline(stop): + try: + process.stdin.write(request.encode("utf-8") + (b"\0" if nul else b"\n")) + process.stdin.flush() + except OSError as exc: + if not _closed_stdin_error(exc): + raise + header = b"" + else: + header = process.stdout.readline() + if nul and index == 0 and not header and process.wait(timeout=90) == 129: + raise _UnsupportedNulBatch(spec) + fields = header.rstrip(b"\n").split(b" ") + require(len(fields) == 3 and re.fullmatch(rb"[0-9a-f]{40,64}", fields[0]) + and fields[1] == b"blob" and fields[2].isdigit(), + "missing or non-blob Git source: " + spec) + size = int(fields[2]) + pinned = process.stdout.read(size) + require(len(pinned) == size and process.stdout.read(1) == b"\n", + "incomplete Git blob response: " + spec) + yield fields[0].decode("ascii"), pinned + process.stdin.close() + require(process.wait(timeout=90) == 0, "Git source reader failed") + finally: + # Terminate ordinary descendants before closing buffered pipes. This + # also covers successful leader exit and an early generator close. + if os.name == "posix": + stop() + # Option rejection can close stdin before our first write/flush. + try: + process.stdin.close() + except OSError as exc: + if not _closed_stdin_error(exc): + raise + process.stdout.close() + if process.poll() is None: + try: + process.wait(timeout=5) + except subprocess.TimeoutExpired: + process.kill() + process.wait() + + +def git_blobs(root, specs): + """Stream exact blobs, retaining the one-process NUL protocol on newer Git. + + Git without -z rejects it with usage status 129. Retry only before any + response, replaying the consumed first request through the line protocol. + The fallback resolves CR/LF paths to object IDs before requesting content. + The caller must close this iterator if validation stops before exhaustion. + """ + specs = iter(specs) + sentinel = object() + first = next(specs, sentinel) + if first is sentinel: + return + with closing(_git_blob_batch(root, chain((first,), specs), nul=True)) as rows: + try: + yield from rows + except _UnsupportedNulBatch as exc: + with closing(_git_blob_batch(root, chain((exc.args[0],), specs), nul=False)) as legacy: + yield from legacy + + +def meaningful(value): + return isinstance(value, str) and bool(value.strip()) and not re.search(r"\bTODO\b", value, re.I) + + +def brief(value): + text = json.dumps(value, ensure_ascii=True, sort_keys=True) + return text if len(text) <= 120 else text[:117] + "..." + + +def require_key(mapping, key, where, shape=None): + """Name the missing key and its expected shape instead of a bare KeyError.""" + require(isinstance(mapping, dict), + where + " must be a JSON object; found " + type(mapping).__name__ + ": " + brief(mapping)) + require(key in mapping, where + "." + key + " is missing" + + ("; expected " + shape if shape else "")) + return mapping[key] + + +def require_text(mapping, key, where, shape="a non-empty string without TODO"): + """Name the key and distinguish missing, wrong-shaped and weak values.""" + require(isinstance(mapping, dict), + where + " must be a JSON object; found " + type(mapping).__name__ + ": " + brief(mapping)) + require(key in mapping, where + "." + key + " is missing; expected " + shape) + value = mapping[key] + require(isinstance(value, str) and meaningful(value), + where + "." + key + " must be " + shape + "; found " + type(value).__name__ + ": " + brief(value)) + + +def card_differences(own, pinned): + """Name every key by which a TASK.json original_card differs from its pin.""" + if not isinstance(own, dict): + return "TASK.json original_card is " + type(own).__name__ + ", expected a JSON object" + details = [] + missing = [key for key in pinned if key not in own] + extra = [key for key in own if key not in pinned] + if missing: + details.append("missing keys: " + ", ".join(missing)) + if extra: + details.append("unexpected keys: " + ", ".join(extra)) + for key in (key for key in pinned if key in own and own[key] != pinned[key]): + details.append(key + " differs (TASK.json: " + brief(own[key]) + "; pinned: " + brief(pinned[key]) + ")") + return "; ".join(details) or "cards compare unequal without a key difference" + + +def source_pin(row, base): + """Resolve one SOURCES.json row to its exact Git object expression. + + Rows without an explicit pin keep the historical base_commit: form. + A file vendored from a pull-request head is pinned exactly with + head:<40-hex sha>:, so its bytes resolve at that commit, not at the + package base. An explicit but unparseable pin fails closed. + """ + name = row["path"] + pin = row.get("pin") + if pin is None: + return base + ":" + name + if pin == "base_commit:" + name: + return base + ":" + name + # Git filenames can contain LF; it is part of the exact path, not a delimiter. + match = re.fullmatch(r"head:([0-9a-f]{40}):(.+)", pin, re.DOTALL) if isinstance(pin, str) else None + if match is not None and match.group(2) == name: + return match.group(1) + ":" + name + raise ValueError("SOURCES.json pin for " + name + " is not a supported pin form: " + brief(pin) + + "; accepted pin forms are base_commit: and head:<40-hex sha>:") + + +def file_equals_bytes(path, expected): + """Compare a stable regular file exactly, with at most a 1 MiB buffer. + + Read the whole initial extent even after a mismatch, propagating I/O errors. + The caller retains responsibility for path validation and checkout stability. + """ + with path.open("rb") as stream: + size = os.fstat(stream.fileno()).st_size + capacity = min(1024 * 1024, max(1, size)) + buffer = bytearray(capacity) + actual = memoryview(buffer) + wanted = memoryview(expected) + matches = size == len(expected) + for offset in range(0, size, capacity): + count = stream.readinto(buffer) + assert 0 <= count <= capacity + if count != min(capacity, size - offset) or actual[:count] != wanted[offset:offset + count]: + matches = False + tail = stream.read(1) + return matches and not tail + + +def validate(root, package, check_pins=True): + parts = PurePosixPath(package).parts + require(len(parts) == 2 and parts[0] == "research" and re.fullmatch(r"[a-z0-9][a-z0-9-]*", parts[1]), + "package must be research/") + data = {} + for name in ("TASK.json", "SOURCES.json", "VERIFY.json"): + data[name] = json.loads(relative_file(root, package + "/" + name).read_text(encoding="utf-8")) + version = require_key(data[name], "schema_version", name) + require(version == 1, name + ".schema_version must be 1; found " + brief(version)) + task, sources, manifest = (data[n] for n in ("TASK.json", "SOURCES.json", "VERIFY.json")) + scope_status = require_key(task, "scope_status", "TASK.json", "unchanged, refined or changed") + require(scope_status in ("unchanged", "refined", "changed"), + "TASK.json.scope_status must be unchanged, refined or changed; found " + brief(scope_status)) + for field in ("actual_scope", "bottleneck_link", "stop_rule", "evidence", "author", "ai_assistance"): + require_text(task, field, "TASK.json") + if scope_status == "unchanged": + question = require_key(require_key(task, "original_card", "TASK.json", + "the pinned catalogue card object"), + "question", "TASK.json.original_card") + require(task["actual_scope"] == question, + "different wording/scope requires refined or changed plus a reason" + + " (TASK.json.actual_scope " + brief(task["actual_scope"]) + + " differs from TASK.json.original_card.question " + brief(question) + ")") + else: + require_text(task, "scope_change_reason", "TASK.json", + "a non-empty string without TODO explaining the scope refinement/change") + outcome = require_key(task, "outcome", "TASK.json", + "partial, completed, blocked or negative-result") + require(outcome in ("partial", "completed", "blocked", "negative-result"), + "TASK.json.outcome must be partial, completed, blocked or negative-result; found " + brief(outcome)) + questions = task.get("open_questions") + require(isinstance(questions, list), + "TASK.json.open_questions must be a list; found " + type(questions).__name__ + ": " + brief(questions)) + if not questions: + require_text(task, "no_open_questions_reason", "TASK.json", + "a non-empty string without TODO explaining an empty next-question list") + for position, question in enumerate(questions): + for field in ("question", "why_it_matters", "first_step", "blocked_by"): + require_text(question, field, "TASK.json.open_questions[" + str(position) + "]") + readme = relative_file(root, package + "/README.md").read_text(encoding="utf-8") + require("## Open next questions" in readme, "README.md needs an \"## Open next questions\" section") + status = require_key(manifest, "status", "VERIFY.json") + require(status == "ready", + "VERIFY.json.status must be \"ready\"; complete the draft before requesting replay; found " + brief(status)) + python = require_key(manifest, "python", "VERIFY.json") + require(python == "3.12", + "VERIFY.json.python must be \"3.12\" (generic replay currently uses Python 3.12); found " + brief(python)) + requirements = manifest.get("requirements", []) + require(isinstance(requirements, list), + "VERIFY.json.requirements must be a list of exact \"name==version\" pins; found " + + type(requirements).__name__ + ": " + brief(requirements)) + require(len(requirements) == len(set(requirements)), "VERIFY.json.requirements must not repeat a pin") + for item in requirements: + require(isinstance(item, str) + and re.fullmatch(r"(?:numpy|sympy|scipy)==[0-9]+(?:\.[0-9]+){1,2}", item), + "generic CI supports exact numpy/sympy/scipy pins; use a dedicated workflow for other environments" + + "; offending entry: " + brief(item)) + names = [item.split("==")[0] for item in requirements] + require(len(names) == len(set(names)), "declare only one version per dependency") + # Validation already treats an omitted list as empty; execution must receive + # that same default without rewriting the contributor's manifest on disk. + manifest["requirements"] = requirements + commands = manifest.get("commands") + require(isinstance(commands, list) and 1 <= len(commands) <= 8, + "VERIFY.json.commands must be a list of 1..8 explicit verification commands; found " + + type(commands).__name__ + ": " + brief(commands)) + total = 0 + for position, command in enumerate(commands): + path = "VERIFY.json.commands[" + str(position) + "]" + require(isinstance(command, dict), + path + " must be a JSON object; found " + type(command).__name__ + ": " + brief(command)) + argv = command.get("argv") + require(isinstance(argv, list) and len(argv) >= 2 and all(isinstance(a, str) for a in argv), + path + ".argv must be a list of at least 2 strings; found " + brief(argv)) + require(argv[0] == "{python}", path + ".argv must explicitly use {python}; no implicit shell") + require_text(command, "checks", path, "a non-empty string without TODO describing command coverage") + seconds = command.get("timeout_seconds") + require(type(seconds) is int, + path + ".timeout_seconds must be an integer number of seconds; found " + + type(seconds).__name__ + ": " + brief(seconds)) + require(1 <= seconds <= 600, + path + ".timeout_seconds " + str(seconds) + + (" exceeds the 600 s per-command cap" if seconds > 600 + else " is below the 1 s per-command minimum")) + total += seconds + require(total <= 1200, "declared replay budget " + str(total) + + " s (sum of timeout_seconds) exceeds the 1200 s total cap" + + "; use a dedicated job for larger checks") + inputs = manifest.get("inputs") + require(isinstance(inputs, list), + "VERIFY.json.inputs must be a list of canonical repository-relative paths; found " + + type(inputs).__name__ + ": " + brief(inputs)) + tracked = tracked_input_paths(root) + for name in inputs: + symlink_free_relative_path(root, name) + require_tracked_input(name, tracked) + relative_file(root, name) + files = require_key(sources, "files", "SOURCES.json") + require(files, "SOURCES.json.files is empty; declare the source inventory") + base = require_key(sources, "base_commit", "SOURCES.json", "a 40-64 hex string pinning an exact base commit") + require(isinstance(base, str) and re.fullmatch(r"[0-9a-f]{40,64}", base), + "SOURCES.json.base_commit must be a 40-64 hex string pinning an exact base commit; found " + brief(base)) + task_base = require_key(task, "base_commit", "TASK.json", + "a 40-64 hex string equal to SOURCES.json.base_commit") + require(task_base == base, "TASK.json.base_commit " + brief(task_base) + + " must equal SOURCES.json.base_commit " + brief(base)) + for row in files: + require(isinstance(row, dict) and isinstance(row.get("path"), str), + "SOURCES.json.files rows must be JSON objects with a string path; offending row: " + brief(row)) + require(row.get("usage") in ("input", "provenance"), + "SOURCES.json.files row " + row["path"] + " must declare usage \"input\" or \"provenance\"; found " + + brief(row.get("usage"))) + undeclared = sorted({r["path"] for r in sources["files"] if r["usage"] == "input"} - set(inputs)) + require(not undeclared, + "every SOURCES.json files row with usage \"input\" must also be declared in VERIFY.json inputs" + + " (they drive CI invalidation); undeclared: " + ", ".join(undeclared)) + if check_pins: + catalog_name = "docs/research/agent-task-catalog.json" + require(catalog_name in {r["path"] for r in sources["files"]}, + "SOURCES.json.files must pin the originating task catalogue " + catalog_name + + " (a provenance row pinned at base_commit)") + names = [r["path"] for r in sources["files"]] + for name in names: + p = PurePosixPath(name) + require(not p.is_absolute() and ".." not in p.parts, "invalid source path") + specs = [source_pin(row, sources["base_commit"]) for row in sources["files"]] + require(all(spec == sources["base_commit"] + ":" + catalog_name + for name, spec in zip(names, specs) if name == catalog_name), + "originating task catalogue must be pinned at base_commit") + with closing(git_blobs(root, specs)) as objects: + for index, (obj, pinned) in enumerate(objects): + row = sources["files"][index] + name = row["path"] + require(obj == row["git_blob"], "source blob provenance mismatch: " + name) + require(hashlib.sha256(pinned).hexdigest() == row["sha256"], "source SHA256 provenance mismatch: " + name) + if row["usage"] == "input": + require(file_equals_bytes(relative_file(root, name), pinned), "working source drift: " + name) + if name == catalog_name: + catalog = json.loads(pinned) + cards = [t for tr in catalog["tracks"] for t in tr["tasks"] if t["id"] == task["task_id"]] + require(len(cards) == 1, + "TASK.json task_id " + brief(task["task_id"]) + " matches " + str(len(cards)) + + " cards in pinned " + catalog_name + " at base_commit " + sources["base_commit"] + + "; need exactly one") + original_card = require_key(task, "original_card", "TASK.json", + "the pinned catalogue card object (copy --print-card output verbatim)") + if original_card != cards[0]: + raise ValueError("original card in TASK.json must equal the pinned catalogue card object exactly; " + "copy it verbatim from " + catalog_name + " at base_commit " + sources["base_commit"] + + ": " + card_differences(original_card, cards[0])) + return task, manifest + + +def catalogue_card(root, package, task_id): + """The exact original_card object a hand-authored TASK.json must copy. + + Reads the catalogue blob pinned at the package base commit, never the + working tree, because validate() compares original_card against that pin. + """ + sources = json.loads(relative_file(root, package + "/SOURCES.json").read_text(encoding="utf-8")) + name = "docs/research/agent-task-catalog.json" + rows = require_key(sources, "files", "SOURCES.json") + row = next((r for r in rows if isinstance(r, dict) and r.get("path") == name), None) + require(row is not None, "SOURCES.json.files must pin the originating task catalogue " + name) + base = require_key(sources, "base_commit", "SOURCES.json", "a 40-64 hex string pinning an exact base commit") + spec = source_pin(row, base) + require(spec == base + ":" + name, "originating task catalogue must be pinned at base_commit") + catalog = json.loads(git(root, "show", spec)) + cards = [t for tr in catalog["tracks"] for t in tr["tasks"] if t["id"] == task_id] + require(len(cards) == 1, + "task_id " + brief(task_id) + " matches " + str(len(cards)) + + " cards in pinned " + name + " at base_commit " + base + "; need exactly one") + return cards[0] + + +_WINDOWS_GATE = r""" +import ctypes +from ctypes import wintypes +import json +import subprocess +import sys +api = ctypes.WinDLL('kernel32', use_last_error=True) +api.OpenEventW.argtypes = [wintypes.DWORD, wintypes.BOOL, wintypes.LPCWSTR] +api.OpenEventW.restype = wintypes.HANDLE +api.WaitForSingleObject.argtypes = [wintypes.HANDLE, wintypes.DWORD] +api.WaitForSingleObject.restype = wintypes.DWORD +api.CloseHandle.argtypes = [wintypes.HANDLE] +api.CloseHandle.restype = wintypes.BOOL +event = api.OpenEventW(0x00100000, False, sys.argv[1]) +if not event: + raise ctypes.WinError(ctypes.get_last_error()) +try: + if api.WaitForSingleObject(event, 30000) != 0: + raise RuntimeError('replay ownership gate was not released') +finally: + api.CloseHandle(event) +# No verification command or descendant starts until the parent owns this job. +sys.exit(subprocess.call(json.loads(sys.argv[2]))) +""" + +def run_windows_command(argv, cwd, timeout, env): + """Own ordinary verification descendants even after their leader exits. + + The gated launcher joins a kill-on-close Job Object before it may spawn + the requested command. A late taskkill cannot recover an exited leader's + tree. Job handles are not inherited and breakaway is not enabled. + """ + import ctypes + from ctypes import wintypes + import time + import uuid + + class BasicLimits(ctypes.Structure): + _fields_ = [("ProcessTime", ctypes.c_int64), ("JobTime", ctypes.c_int64), + ("Flags", wintypes.DWORD), ("MinWorkingSet", ctypes.c_size_t), + ("MaxWorkingSet", ctypes.c_size_t), ("ActiveProcessLimit", wintypes.DWORD), + ("Affinity", ctypes.c_size_t), ("Priority", wintypes.DWORD), + ("Scheduling", wintypes.DWORD)] + + class IOCounts(ctypes.Structure): + _fields_ = [(name, ctypes.c_uint64) for name in + ("ReadOps", "WriteOps", "OtherOps", "ReadBytes", "WriteBytes", "OtherBytes")] + + class ExtendedLimits(ctypes.Structure): + _fields_ = [("Basic", BasicLimits), ("IO", IOCounts), + ("ProcessMemory", ctypes.c_size_t), ("JobMemory", ctypes.c_size_t), + ("PeakProcessMemory", ctypes.c_size_t), ("PeakJobMemory", ctypes.c_size_t)] + + class Accounting(ctypes.Structure): + _fields_ = [(name, ctypes.c_int64) for name in + ("UserTime", "KernelTime", "PeriodUserTime", "PeriodKernelTime")] + [ + (name, wintypes.DWORD) for name in + ("PageFaults", "TotalProcesses", "ActiveProcesses", "TerminatedProcesses")] + + api = ctypes.WinDLL("kernel32", use_last_error=True) + + def native(name, result, *arguments): + fn = getattr(api, name) + fn.restype, fn.argtypes = result, arguments + return fn + + handle, dword, boolean = wintypes.HANDLE, wintypes.DWORD, wintypes.BOOL + create_job = native("CreateJobObjectW", handle, ctypes.c_void_p, wintypes.LPCWSTR) + set_info = native("SetInformationJobObject", boolean, handle, ctypes.c_int, ctypes.c_void_p, dword) + assign = native("AssignProcessToJobObject", boolean, handle, handle) + terminate = native("TerminateJobObject", boolean, handle, wintypes.UINT) + query = native("QueryInformationJobObject", boolean, handle, ctypes.c_int, + ctypes.c_void_p, dword, ctypes.c_void_p) + create_event = native("CreateEventW", handle, ctypes.c_void_p, boolean, boolean, wintypes.LPCWSTR) + set_event = native("SetEvent", boolean, handle) + close = native("CloseHandle", boolean, handle) + + def checked(ok): + if not ok: + raise ctypes.WinError(ctypes.get_last_error()) + return ok + + job = checked(create_job(None, None)) + event, process, assigned = None, None, False + try: + limits = ExtendedLimits() + limits.Basic.Flags = 0x2000 # JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE + checked(set_info(job, 9, ctypes.byref(limits), ctypes.sizeof(limits))) + name = "Local\\research-replay-" + uuid.uuid4().hex + event = checked(create_event(None, True, False, name)) + # A name collision must not attach to an already-signaled event. + if ctypes.get_last_error() == 183: + raise ValueError("replay ownership gate name already exists") + process = subprocess.Popen( + # The gate itself must not run sitecustomize/PYTHONPATH startup + # code before ownership. The requested command retains env/argv. + # Windows accepts Unicode argv directly. ASCII JSON escaping can + # expand an otherwise valid command past its UTF-16 launch limit. + [sys.executable, "-I", "-S", "-c", _WINDOWS_GATE, name, + json.dumps(argv, ensure_ascii=False)], + cwd=cwd, env=env, start_new_session=True) + checked(assign(job, int(process._handle))) + assigned = True + checked(set_event(event)) + try: + return process.wait(timeout=timeout) + except subprocess.TimeoutExpired: + raise ValueError("verification timed out") from None + finally: + try: + if process is not None: + if assigned: + checked(terminate(job, 1)) + # Termination is asynchronous. Require the job to report + # no active processes before releasing its ownership handle. + deadline = time.monotonic() + 10 + while True: + state = Accounting() + checked(query(job, 1, ctypes.byref(state), ctypes.sizeof(state), None)) + if not state.ActiveProcesses: + break + if time.monotonic() >= deadline: + raise ValueError("verification process cleanup timed out") + time.sleep(0.01) + elif process.poll() is None: + # Assignment failed before the gate opened: no command child + # exists, so only this known gated launcher needs stopping. + process.kill() + process.wait(timeout=10) + finally: + try: + if event: + checked(close(event)) + finally: + checked(close(job)) + +def run_command(argv, cwd, timeout): + # Assertion checks must not disappear because of the caller's environment. + # Keep explicit manifest options (including deliberate -O controls) intact. + # PYTHONPATH precedes the standard library on a child's sys.path, so a stray + # same-named module could end a verifier with exit code 0 before any check. + env = os.environ.copy() + env.pop("PYTHONOPTIMIZE", None) + # Ambient inspection can turn a verifier exception into a successful REPL + # exit at terminal EOF. Keep explicit -i and the caller's stdin unchanged. + env.pop("PYTHONINSPECT", None) + env.pop("PYTHONPATH", None) + if os.name == "nt": + code = run_windows_command(argv, cwd, timeout, env) + require(code == 0, f"verification command exited {code}") + return + previous_handler = None + terminating = False + waiting = False + process = None + + def terminate(signum, frame): + nonlocal terminating + if not terminating: + terminating = True + # Only interrupt the protected wait. Launch/assignment and cleanup + # defer delivery; repeated signals cannot interrupt group cleanup. + if waiting: + raise SystemExit(128 + signum) + + # Own a group for POSIX cleanup of this command and its descendants. + try: + if (threading.current_thread() is threading.main_thread() + and signal.getsignal(signal.SIGTERM) == signal.SIG_DFL): + previous_handler = signal.SIG_DFL + signal.signal(signal.SIGTERM, terminate) + if terminating: + raise SystemExit(143) + process = subprocess.Popen(argv, cwd=cwd, env=env, start_new_session=True) + try: + try: + waiting = True + if terminating: + raise SystemExit(143) + code = process.wait(timeout=timeout) + finally: + waiting = False + except subprocess.TimeoutExpired: + raise ValueError("verification timed out") from None + require(code == 0, f"verification command exited {code}") + finally: + try: + if process is not None: + if hasattr(os, "killpg"): + # The leader may have exited while descendants hold its group. + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + elif process.poll() is None: + subprocess.run(["taskkill", "/F", "/T", "/PID", str(process.pid)], capture_output=True) + process.wait() + finally: + if previous_handler is not None: + signal.signal(signal.SIGTERM, previous_handler) + if terminating: + raise SystemExit(143) + + +def isolated_python_argv(argv, cache_directory): + """Place our cache option after interpreter flags, before the entry point. + + -B prevents writes, not reads of existing .pyc files. A fresh namespace + keeps preexisting source-adjacent and externally configured caches out of + this registered interpreter. It is not inherited by child interpreters. + """ + require(argv and argv[0] == sys.executable, "cache isolation requires the registered Python interpreter") + index = 1 + options = [argv[0]] + while index < len(argv): + option = argv[index] + if option in ("-", "--") or not option.startswith("-"): + break + if option == "--check-hash-based-pycs": + require(index + 1 < len(argv), "missing Python hash-cache option argument") + options.extend(argv[index:index + 2]) + index += 2 + continue + if option.startswith("--"): + options.append(option) + index += 1 + continue + # Python permits combined short flags, attached -c/-m payloads, and + # attached or separate -W/-X arguments. Stop scanning an option once + # its argument begins: letters inside that argument are not flags. + entry = False + consumed = 1 + replace_cache = False + for offset, flag in enumerate(option[1:], start=1): + if flag in "cm": + entry = True + break + if flag in "WX": + if offset == len(option) - 1: + require(index + 1 < len(argv), "missing Python interpreter option argument") + consumed = 2 + value = argv[index + 1] if consumed == 2 else option[offset + 1:] + if flag == "X" and value.split("=", 1)[0] == "pycache_prefix": + replace_cache = True + if offset > 1: + options.append(option[:offset]) + break + if entry: + break + if not replace_cache: + options.extend(argv[index:index + consumed]) + index += consumed + # CPython's effective prefix can use the first duplicate -X value even + # when sys._xoptions shows the last. Remove only earlier cache-prefix + # settings; script arguments remain untouched, even when spelled -X. + return [*options, "-X", "pycache_prefix=" + str(cache_directory), *argv[index:]] + + +def run_python_replay(argv, cwd, timeout): + with tempfile.TemporaryDirectory(prefix="research-replay-pycache-") as cache: + run_command(isolated_python_argv(argv, cache), cwd, timeout) + + +def run_package(root, package, install=False): + task, manifest = validate(root, package) + require(sys.version_info[:2] == (3, 12), "run replay with Python 3.12 (metadata check is version-independent)") + if install and manifest["requirements"]: + run_command([sys.executable, "-m", "pip", "install", "--disable-pip-version-check", *manifest["requirements"]], root, 300) + for requirement in manifest["requirements"]: + name, version = requirement.split("==") + require(importlib.metadata.version(name) == version, "dependency version mismatch: " + requirement) + # Coverage labels are UTF-8 metadata but a redirected Windows stdout may + # use cp1252. Escape unrepresentable display characters instead of aborting + # before replay. This changes only our stream, not child encoding or env. + if hasattr(sys.stdout, "reconfigure"): + sys.stdout.reconfigure(errors="backslashreplace") + for command in manifest["commands"]: + argv = [sys.executable if item == "{python}" else item.replace("{package}", package) for item in command["argv"]] + print("CHECK " + command["checks"], flush=True) + run_python_replay(argv, root, command["timeout_seconds"]) + print("PASS_REGISTERED_RESEARCH_PACKAGE " + package + " outcome=" + task["outcome"]) + + +def planning_manifests(root, tracked): + """Include deliberate sparse omissions without disguising deletions or drift. + + The fallback follows the chooser's PR3102 contract: one stage-zero regular + skip-worktree index entry must match the exact HEAD mode and blob. This is + declaration discovery only, not permission to replay absent package code. + """ + committed = {name for name in tracked + if name.startswith("research/") and name.count("/") == 2 + and name.endswith("/VERIFY.json")} + # Explicit scandir retains error detection; only an absent directory is OK. + try: + with os.scandir(root / "research") as entries: + local = {Path(entry.path) / "VERIFY.json" for entry in entries} + except FileNotFoundError: + local = set() + present, missing = {}, set() + for path in sorted(local | {root / name for name in committed}): + name = path.relative_to(root).as_posix() + symlink_free_relative_path(root, name) + try: + mode = path.lstat().st_mode + except (FileNotFoundError, NotADirectoryError): + if name in committed: + missing.add(name) + continue + require(stat.S_ISREG(mode), "non-regular replay manifest: " + name) + present[name] = path + fallback = {} + if missing: + indexed, objects = {}, {} + for record in git(root, "ls-files", "-t", "--stage", "-z", "--", "research").split(b"\0"): + if not record: + continue + header, raw_name = record.split(b"\t", 1) + name = raw_name.decode("utf-8") + if name in missing: + indexed.setdefault(name, []).append(header.split()) + for record in git(root, "ls-tree", "-r", "-z", "HEAD", "--", "research").split(b"\0"): + if not record: + continue + header, raw_name = record.split(b"\t", 1) + name = raw_name.decode("utf-8") + if name in missing: + objects[name] = header.split() + for name in sorted(missing): + metadata = objects.get(name, []) + require(len(metadata) == 3 and metadata[0] in (b"100644", b"100755") + and metadata[1] == b"blob" + and indexed.get(name) == [[b"S", metadata[0], metadata[2], b"0"]], + "missing replay manifest is not an unchanged sparse HEAD input: " + name + + "; materialize it or commit its intended deletion") + # A regular file occupying the package directory is not an omission. + require(not (root / name).parent.exists() or (root / name).parent.is_dir(), + "non-directory replay package: " + name) + names = sorted(missing) + with closing(git_blobs(root, [objects[n][2].decode("ascii") for n in names])) as rows: + for (oid, raw), name in zip(rows, names): + require(oid.encode("ascii") == objects[name][2], "sparse manifest blob mismatch: " + name) + fallback[name] = raw + # Preserve Path's component ordering: package "a" precedes "a-extra". + for name in sorted(present.keys() | fallback.keys(), key=lambda name: PurePosixPath(name).parts): + yield root / name, fallback[name] if name in fallback else present[name].read_bytes(), name in fallback + + +def plan_details(root, changed): + """One selection pass with exact causes; no replay or acceptance decision.""" + changed = set(changed) + # A removed input is absent from HEAD, including an old case-only rename + # spelling on case-insensitive filesystems. Git's exact changed paths remain + # eligible so its consumer is selected, rather than rejected or skipped. + head_tracked = tracked_input_paths(root) + tracked = head_tracked | changed + replay_changed = sorted(changed.intersection({ + "scripts/research_package.py", ".github/workflows/research-packages.yml", + ".github/workflows/research-package-batch.yml"})) + # Group literal Git paths once. Keep removed paths and exact spellings. + changed_packages = {} + for name in sorted(changed): + parts = name.split("/", 2) + if len(parts) == 3 and parts[0] == "research": + changed_packages.setdefault("/".join(parts[:2]), []).append(name) + packages = [] + sparse_count = 0 + # Planning requires a stable checkout; reuse only within this invocation. + validated_inputs = set() + for path, raw, sparse in planning_manifests(root, head_tracked): + sparse_count += sparse + package = path.parent.relative_to(root).as_posix() + manifest = json.loads(raw.decode("utf-8")) + # Parse only for selection; validate fully in the isolated replay job. + inputs = manifest.get("inputs", []) + require(isinstance(inputs, list), "declare input paths for CI invalidation") + for name in inputs: + if isinstance(name, str) and name in validated_inputs: + continue + # Do not require existence: a deleted input must still trigger replay. + symlink_free_relative_path(root, name) + require_tracked_input(name, tracked) + validated_inputs.add(name) + causes = { + "declared_inputs": sorted(changed.intersection(inputs)), + "package_files": changed_packages.get(package, []), + "shared_controls": replay_changed, + } + if any(causes.values()): + packages.append({"package": package, "causes": causes, + "manifest_sha256": hashlib.sha256(raw).hexdigest()}) + if sparse_count: + print(f"Planning includes {sparse_count} unchanged sparse manifests from HEAD; " + "materialize packages and inputs before replay.", file=sys.stderr) + return packages + + +def plan(root, changed): + return [row["package"] for row in plan_details(root, changed)] + + +def write_plan_explanation(path, base, head, changed, details): + """Publish a complete sidecar before stdout/GitHub matrix publication.""" + matched = {name for row in details for names in row["causes"].values() for name in names} + report = { + "schema_version": 1, "base": base, "head": head, + "mode": "all-tracked" if base is None else "commit-diff", + "scope": "Selection from working or authenticated sparse HEAD manifests, not replay or mathematical acceptance. " + "Manifest hashes bind the declarations read; checkout must remain stable.", + "changed_paths": sorted(set(changed) - {""}), "selected": details, + "unmatched_paths": sorted(set(changed) - matched - {""}), + } + fd, temporary = tempfile.mkstemp(prefix=".replay-plan-", dir=path.parent) + try: + with os.fdopen(fd, "w", encoding="utf-8") as stream: + json.dump(report, stream, indent=2) + stream.write("\n") + os.replace(temporary, path) + finally: + Path(temporary).unlink(missing_ok=True) + + +def replay_matrix(packages, batch_size=None): + """Retain the flat CLI format, or group complete coverage into bounded matrices.""" + if batch_size is None: + return {"include": [{"package": p} for p in packages]} + require(type(batch_size) is int and 1 <= batch_size <= 256, + "matrix batch size must be 1..256") + batches = [packages[i:i + batch_size] for i in range(0, len(packages), batch_size)] + require(len(batches) <= 256, + "more than 256 matrix batches required; no packages were truncated") + return {"include": [{"packages": batch} for batch in batches]} + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument("--package") + ap.add_argument("--check-only", action="store_true") + ap.add_argument("--print-card", metavar="TASK_ID", + help="print the exact pinned catalogue card object to copy into TASK.json original_card") + ap.add_argument("--install-deps", action="store_true", help="explicit opt-in to install manifest's allowed pinned dependencies") + ap.add_argument("--changed-since", help="plan affected opt-in packages relative to this Git commit") + ap.add_argument("--github-output", type=Path) + ap.add_argument("--explain-plan", type=Path, + help="write exact replay-selection causes to JSON; matrix output stays unchanged") + ap.add_argument("--matrix-batch-size", type=int, + help="group planned packages for bounded reusable-workflow matrices (1..256)") + args = ap.parse_args() + if args.explain_plan and (not args.changed_since or args.package or args.print_card): + ap.error("--explain-plan requires --changed-since without --package or --print-card") + if args.explain_plan and args.github_output and args.explain_plan.resolve() == args.github_output.resolve(): + ap.error("--explain-plan and --github-output must use different files") + try: + if args.print_card: + require(args.package, + "--print-card needs --package research/ to resolve its pinned catalogue") + sys.stdout.write(json.dumps(catalogue_card(ROOT, args.package, args.print_card), indent=2) + "\n") + elif args.changed_since: + if set(args.changed_since) == {"0"}: + base = None + changed = git(ROOT, "ls-files", "-z").decode().split("\0") + else: + base = git(ROOT, "rev-parse", "--verify", args.changed_since + "^{commit}").decode().strip() + # A rename must invalidate both the removed input and its new path. + changed = git(ROOT, "diff", "--no-renames", "--name-only", "-z", base, "HEAD").decode().split("\0") + details = plan_details(ROOT, changed) + packages = [row["package"] for row in details] + matrix = json.dumps(replay_matrix(packages, args.matrix_batch_size)) + if args.explain_plan: + head = git(ROOT, "rev-parse", "--verify", "HEAD^{commit}").decode().strip() + write_plan_explanation(args.explain_plan, base, head, changed, details) + print(matrix) + if args.github_output: + with args.github_output.open("a", encoding="utf-8") as out: + out.write(f"matrix={matrix}\ncount={len(packages)}\n") + elif args.package: + if args.check_only: + validate(ROOT, args.package) + print("PASS_PACKAGE_METADATA_AND_PINS (not a mathematical acceptance check)") + else: + run_package(ROOT, args.package, args.install_deps) + else: + ap.error("use --package, --print-card or --changed-since") + except (OSError, ValueError, KeyError, TypeError, subprocess.SubprocessError, importlib.metadata.PackageNotFoundError) as exc: + ap.exit(1, str(exc) + "\n") + + +if __name__ == "__main__": + main() diff --git a/research/early-duplicate-verify-rejection/verify.py b/research/early-duplicate-verify-rejection/verify.py new file mode 100644 index 0000000000..778c417cde --- /dev/null +++ b/research/early-duplicate-verify-rejection/verify.py @@ -0,0 +1,441 @@ +#!/usr/bin/env python3 +"""Source-bound opt-in VERIFY object-key regression; no live runner is patched. + +Prepared for ToikY with substantial OpenAI Codex assistance. Apache-2.0. +Canonical tooling credit: Douglas Colkitt, Tekalign, Ali Romman PR5728 and the +retained source/environment/exporter contributors. No scientific replay. +""" +import argparse +from datetime import datetime, timezone +import hashlib +import json +import os +from pathlib import Path +import shutil +import signal +import subprocess +import sys +import tarfile +import tempfile +import time + +P = Path(__file__).resolve().parent +BASE = '7c49fe32c55de02c2c873655c804b16e4c3fef0a' +PACKAGE = 'research/metadata-json-fixture' +PATCH_SHA = '8469283da97d727d8d6c160b70837ca11db213219f95818825771651b9b56f10' +PATCHED_SHA = '0fbefb2c648388b9b131d70c232d169e46a59762f95ae2957c1e187d590022e9' +EXPECTED = { + 'vendor/research_package.py': ('scripts/research_package.py', 52346, + 'e1256016e7f51827d04fa2179255989f639ae1d97afaa9c16265f85a0c6abd70', + '091b4c8f58bac9a9580d76025b887dc5c873d05f'), + 'vendor/export_research_package.py': ('scripts/export_research_package.py', 12446, + '7126afaebff2328b8d64ba1ce992c497103820284f52d4590a558f97f13965fe', + '25b0a12a8073f589867ca7f2e564ea5ae011bdf5'), + 'vendor/agent-task-catalog.json': ('docs/research/agent-task-catalog.json', 82822, + 'ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81', + '3404fbdd5e7529a0674eef26114b5071e4586cec'), +} +MARKER = b'INERT_FIXTURE_DISPATCH\n' +MARKER_PROGRAM = (b'from pathlib import Path\n' + b'Path(__file__).with_name("dispatch-marker.txt").write_bytes(' + + repr(MARKER).encode() + b')\n' + b'print("PASS_INERT_FIXTURE_MARKER")\n') +GLOBAL_SECONDS = 165 +CHILD_SECONDS = 20 + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + + +def git_blob(raw): + return hashlib.sha1(b'blob ' + str(len(raw)).encode() + b'\0' + raw).hexdigest() + + +def encoded(value): + return (json.dumps(value, sort_keys=True, separators=(',', ':'), + ensure_ascii=True, allow_nan=False) + '\n').encode() + + +def unique(pairs): + result = {} + for key, value in pairs: + need(key not in result, 'duplicate authenticated metadata key: ' + key) + result[key] = value + return result + + +def bad_number(value): + raise ValueError('non-integer authenticated metadata number: ' + value) + + +def authenticate(): + pin_raw = (P / 'SOURCE-PINS.json').read_bytes() + pins = json.loads(pin_raw, object_pairs_hook=unique, + parse_float=bad_number, parse_constant=bad_number) + need(type(pins.get('schema_version')) is int and pins['schema_version'] == 1, + 'source pin schema') + rows = pins.get('files') + need(type(rows) is list and len(rows) == len(EXPECTED), 'source pin inventory') + need({x.get('local_path') for x in rows} == set(EXPECTED), 'source pin paths') + data = {} + for row in rows: + local = row['local_path'] + source_path, size, digest, blob = EXPECTED[local] + need(row.get('source_commit') == BASE and row.get('source_path') == source_path + and row.get('source_repository') == 'CrocSwap/integer-mult-bounds', + 'source pin identity: ' + local) + need(type(row.get('bytes')) is int and row['bytes'] == size + and row.get('sha256') == digest and row.get('git_blob') == blob, + 'source pin value: ' + local) + raw = (P / local).read_bytes() + need(len(raw) == size and sha(raw) == digest and git_blob(raw) == blob, + 'source bytes: ' + local) + data[source_path] = raw + patch = (P / 'STRICT-VERIFY.patch').read_bytes() + need(len(patch) == 1742 and sha(patch) == PATCH_SHA, 'patch bytes') + return data, sha(pin_raw) + + +class Trial: + def __init__(self, root, context): + self.root = root + self.context = context + self.deadline = time.monotonic() + GLOBAL_SECONDS + self.env = {k: v for k, v in os.environ.items() if not k.startswith('GIT_')} + for key in ('PYTHONPATH', 'PYTHONHOME', 'PYTHONOPTIMIZE', 'PYTHONSTARTUP', + 'PYTHONINSPECT', 'PYTHONPYCACHEPREFIX'): + self.env.pop(key, None) + self.env.update(GIT_CONFIG_GLOBAL=os.devnull, GIT_CONFIG_NOSYSTEM='1', + GIT_TERMINAL_PROMPT='0', GIT_NO_REPLACE_OBJECTS='1', + PYTHONDONTWRITEBYTECODE='1', PYTHONIOENCODING='utf-8') + + def remaining(self): + seconds = self.deadline - time.monotonic() + need(seconds > 0, 'global tooling budget exhausted') + return min(CHILD_SECONDS, seconds) + + def git(self, *args): + command = ['git', '-c', 'maintenance.auto=false', '-c', 'gc.auto=0', *args] + completed = subprocess.run(command, cwd=self.root, env=self.env, + capture_output=True, timeout=self.remaining(), check=False) + need(completed.returncode == 0, + 'fixture Git failure: ' + completed.stderr.decode('utf-8', 'replace')) + return completed.stdout + + def command(self, argv, label): + start = datetime.now(timezone.utc).isoformat() + tick = time.perf_counter() + budget = self.remaining() + process = subprocess.Popen(argv, cwd=self.root, env=self.env, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + start_new_session=True) + try: + out, err = process.communicate(timeout=budget) + except subprocess.TimeoutExpired: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + out, err = process.communicate(timeout=3) + self.context['commands'].append({'label': label, 'argv': argv, + 'started_at': start, 'seconds': time.perf_counter() - tick, + 'returncode': process.returncode, 'timeout': True, + 'stdout': out.decode('utf-8', 'replace'), + 'stderr': err.decode('utf-8', 'replace')}) + raise ValueError('source command timeout: ' + label) + self.context['commands'].append({'label': label, 'argv': argv, + 'started_at': start, 'seconds': time.perf_counter() - tick, + 'returncode': process.returncode, 'timeout': False, + 'stdout': out.decode('utf-8', 'replace'), + 'stderr': err.decode('utf-8', 'replace')}) + return process.returncode, out, err + + +def write(root, name, raw): + target = root / name + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(raw) + + +def pretty(value): + return (json.dumps(value, indent=2, ensure_ascii=True) + '\n').encode() + + +def insert_before(raw, needle, inserted): + need(raw.count(needle) == 1, 'fixture insertion must be unique') + return raw.replace(needle, inserted + needle, 1) + + +def fixture_cases(task, sources, manifest): + task_raw, source_raw, verify_raw = map(pretty, (task, sources, manifest)) + base = {'task': task_raw, 'sources': source_raw, 'verify': verify_raw} + cases = [] + + def add(name, changes=None, duplicate_key=None, array_boundary=False): + value = dict(base) + if changes: + value.update(changes) + value.update(name=name, duplicate_key=duplicate_key, array_boundary=array_boundary) + cases.append(value) + + add('unambiguous') + inputs = b' "inputs": [\n' + add('same_value_inputs', {'verify': insert_before(verify_raw, inputs, + b' "inputs": ["input.txt"],\n')}, 'inputs') + add('conflicting_inputs', {'verify': insert_before(verify_raw, inputs, + b' "inputs": ["missing.txt"],\n')}, 'inputs') + add('escaped_inputs', {'verify': insert_before(verify_raw, inputs, + b' "inpu\\u0074s": ["missing.txt"],\n')}, 'inputs') + checks = b' "checks": "Inert marker only"' + add('nested_checks', {'verify': insert_before(verify_raw, checks, + b' "checks": "Earlier ignored description",\n')}, 'checks') + author = b' "author": "Metadata Fixture"' + add('TASK_policy_unchanged', {'task': insert_before(task_raw, author, + b' "author": "Earlier ignored author",\n')}) + usage = b' "usage": "provenance"' + add('SOURCES_policy_unchanged', {'sources': insert_before(source_raw, usage, + b' "usage": "Earlier ignored usage",\n')}) + numeric = dict(manifest) + numeric['extension'] = {'float': 0.5, 'nan': float('nan'), 'infinity': float('inf')} + add('numeric_extension_policy_unchanged', {'verify': pretty(numeric)}) + array = dict(manifest) + array['inputs'] = ['input.txt', 'input.txt'] + add('duplicate_input_array_remains_outside_patch', {'verify': pretty(array)}, + array_boundary=True) + need(len(cases) == 9, 'case count') + return cases + + +def classify(case, phase, operation, code, out, err, marker): + duplicate = case['duplicate_key'] + reject = duplicate is not None and (phase == 'patched' or operation == 'export') + if operation == 'export' and case['array_boundary']: + reject = True + if reject: + expected = ('duplicate declared input' if case['array_boundary'] else + ('duplicate export JSON key: ' if operation == 'export' else + 'duplicate VERIFY.json key: ') + duplicate) + need(code == 1 and out == b'' and err == (expected + '\n').encode(), + 'wrong rejection: ' + case['name'] + '/' + phase + '/' + operation) + need(marker is None, 'rejected case dispatched fixture command') + return {'verdict': 'rejected', 'diagnostic': expected} + need(code == 0 and err == b'', 'unexpected failure: ' + case['name'] + '/' + phase + '/' + operation) + if operation == 'validate': + need(out == b'PASS_PACKAGE_METADATA_AND_PINS (not a mathematical acceptance check)\n', + 'metadata positive marker') + semantic = {'marker': 'PASS_PACKAGE_METADATA_AND_PINS'} + elif operation == 'plan': + planned = json.loads(out, object_pairs_hook=unique) + need(planned == {'include': [{'package': PACKAGE}]}, 'planner selection changed') + semantic = planned + elif operation == 'export': + prefix = b'PASS_RESEARCH_EXPORT ' + need(out.startswith(prefix), 'export positive marker') + receipt = json.loads(out[len(prefix):], object_pairs_hook=unique) + need(set(receipt) == {'commit', 'package', 'files'} and receipt['package'] == PACKAGE + and type(receipt['files']) is int and receipt['files'] == 6, + 'export receipt shape') + semantic = {'marker': 'PASS_RESEARCH_EXPORT', 'package': PACKAGE, 'files': 6} + else: + expected = ('CHECK Inert marker only\nPASS_INERT_FIXTURE_MARKER\n' + 'PASS_REGISTERED_RESEARCH_PACKAGE ' + PACKAGE + ' outcome=partial\n').encode() + need(out == expected and marker == MARKER, 'positive dispatch marker') + semantic = {'marker': 'PASS_REGISTERED_RESEARCH_PACKAGE', 'inert_marker_written': True} + if operation != 'dispatch': + need(marker is None, 'non-dispatch operation executed fixture command') + return {'verdict': 'accepted', 'semantic_output': semantic} + + +def run_suite(data, context): + need(sys.version_info[:2] == (3, 12), 'harness requires Python3.12') + need(os.name == 'posix', 'bounded process-group harness currently qualified for POSIX only') + need(shutil.which('git') is not None, 'local Git executable required') + rows = [] + archive_equalities = [] + case_manifest = [] + with tempfile.TemporaryDirectory(prefix='verify-duplicate-fixture-') as tmp: + work = Path(tmp) + root = work / 'repo' + root.mkdir() + trial = Trial(root, context) + for name, raw in data.items(): + write(root, name, raw) + write(root, 'input.txt', b'harmless exported metadata fixture input\n') + trial.git('init', '-q') + for key, value in [('user.name', 'Metadata Fixture'), ('user.email', 'fixture@example.invalid'), + ('core.autocrlf', 'false'), ('commit.gpgsign', 'false'), + ('core.hooksPath', os.devnull)]: + trial.git('config', key, value) + trial.git('add', 'scripts', 'docs', 'input.txt') + trial.git('commit', '-qm', 'Synthetic base: exact canonical tooling/data') + base = trial.git('rev-parse', 'HEAD').decode().strip() + catalog = json.loads(data['docs/research/agent-task-catalog.json']) + cards = [item for track in catalog['tracks'] for item in track['tasks'] + if item['id'] == 'portable-replay'] + need(len(cards) == 1, 'one original portable card') + task = {'schema_version': 1, 'task_id': 'portable-replay', 'priority_revision': 8, + 'base_commit': base, 'original_card': cards[0], 'scope_status': 'changed', + 'actual_scope': 'Metadata-only synthetic fixture; no scientific claim.', + 'scope_change_reason': 'Compare registered and export interpretation on exact committed metadata.', + 'bottleneck_link': 'One reproducible metadata exportability boundary.', + 'stop_rule': 'Only bounded metadata and inert marker commands.', + 'outcome': 'partial', 'evidence': 'Local tooling fixture, not scientific acceptance.', + 'author': 'Metadata Fixture', 'ai_assistance': 'OpenAI Codex tooling regression fixture.', + 'open_questions': [{'question': 'Does exact metadata interpretation agree?', + 'why_it_matters': 'Decides only a tooling boundary.', + 'first_step': 'Use unchanged committed fixtures.', + 'blocked_by': 'No scientific implication is supplied.'}]} + sources = {'schema_version': 1, 'base_commit': base, 'files': []} + for name, usage in [('docs/research/agent-task-catalog.json', 'provenance'), ('input.txt', 'input')]: + raw = (root / name).read_bytes() + sources['files'].append({'path': name, 'usage': usage, + 'git_blob': git_blob(raw), 'sha256': sha(raw)}) + manifest = {'schema_version': 1, 'status': 'ready', 'python': '3.12', 'requirements': [], + 'commands': [{'argv': ['{python}', '-B', '{package}/verify.py'], + 'timeout_seconds': 5, 'checks': 'Inert marker only'}], + 'inputs': ['input.txt']} + write(root, PACKAGE + '/README.md', b'# Inert fixture\n\n## Open next questions\n\nMetadata interpretation only.\n') + write(root, PACKAGE + '/verify.py', MARKER_PROGRAM) + cases = fixture_cases(task, sources, manifest) + context['fixture_base'] = base + for case in cases: + write(root, 'scripts/research_package.py', data['scripts/research_package.py']) + for field, name in [('task', 'TASK.json'), ('sources', 'SOURCES.json'), ('verify', 'VERIFY.json')]: + write(root, PACKAGE + '/' + name, case[field]) + trial.git('add', PACKAGE) + trial.git('commit', '-qm', 'Fixture case ' + case['name']) + head = trial.git('rev-parse', 'HEAD').decode().strip() + context.setdefault('fixture_heads', {})[case['name']] = head + archive_reference = None + case_manifest.append({'case': case['name'], 'duplicate_key': case['duplicate_key'], + 'array_boundary': case['array_boundary']}) + for phase in ['original', 'patched']: + if phase == 'patched': + trial.git('apply', '--check', '--', str(P / 'STRICT-VERIFY.patch')) + context['git_apply_checks'] = context.get('git_apply_checks', 0) + 1 + trial.git('apply', '--', str(P / 'STRICT-VERIFY.patch')) + context['git_apply_applications'] = context.get('git_apply_applications', 0) + 1 + expected_runner = EXPECTED['vendor/research_package.py'][2] if phase == 'original' else PATCHED_SHA + need(sha((root / 'scripts/research_package.py').read_bytes()) == expected_runner, + 'source phase runner hash') + need(sha((root / 'scripts/export_research_package.py').read_bytes()) == + EXPECTED['vendor/export_research_package.py'][2], 'exporter changed') + for mode in ['normal', 'optimized']: + options = [sys.executable, '-W', 'error', '-B'] + if mode == 'optimized': + options.insert(1, '-O') + for operation in ['validate', 'plan', 'export', 'dispatch']: + marker_path = root / PACKAGE / 'dispatch-marker.txt' + need(not marker_path.exists(), 'leftover marker') + raw = (root / PACKAGE / 'VERIFY.json').read_bytes() + need(raw == trial.git('show', head + ':' + PACKAGE + '/VERIFY.json') == case['verify'], + 'working/committed manifest mismatch') + archive = work / (case['name'] + '-' + phase + '-' + mode + '.tar') + if operation == 'export': + argv = options + [str(root / 'scripts/export_research_package.py'), 'export', + '--package', PACKAGE, '--ref', head, '--output', str(archive)] + elif operation == 'plan': + argv = options + [str(root / 'scripts/research_package.py'), '--changed-since', base] + else: + argv = options + [str(root / 'scripts/research_package.py'), '--package', PACKAGE] + if operation == 'validate': + argv.append('--check-only') + label = '/'.join([case['name'], phase, mode, operation]) + code, out, err = trial.command(argv, label) + context['commands'][-1].update({ + 'fixture_head': head, 'manifest_sha256': sha(raw), + 'source_phase': phase, 'runner_sha256': expected_runner, + 'exporter_sha256': EXPECTED['vendor/export_research_package.py'][2], + 'working_runner_patch_intentional': phase == 'patched'}) + marker = marker_path.read_bytes() if marker_path.exists() else None + normalized = classify(case, phase, operation, code, out, err, marker) + if marker_path.exists(): + marker_path.unlink() + need((root / PACKAGE / 'VERIFY.json').read_bytes() == raw, + 'command mutated manifest') + need(sha((root / 'scripts/research_package.py').read_bytes()) == expected_runner, + 'command mutated source phase') + if operation == 'export': + if normalized['verdict'] == 'accepted': + archive_bytes = archive.read_bytes() + if archive_reference is None: + archive_reference = archive_bytes + else: + need(archive_bytes == archive_reference, 'matched export bytes changed') + with tarfile.open(archive, 'r:') as reader: + members = reader.getmembers() + need(len(members) == 7 and all(x.isfile() for x in members), + 'positive archive inventory') + need(reader.extractfile(PACKAGE + '/VERIFY.json').read() == raw, + 'archive manifest differs') + else: + need(not archive.exists(), 'rejected export left archive') + rows.append({'case': case['name'], 'source_phase': phase, 'mode': mode, + 'operation': operation, 'returncode': code, **normalized}) + archive_equalities.append({'case': case['name'], 'accepted_export_bytes_equal': + archive_reference is not None}) + write(root, 'scripts/research_package.py', data['scripts/research_package.py']) + need(trial.git('status', '--porcelain') == b'', 'unplanned fixture worktree changes') + need(not list(root.rglob('*.pyc')), 'fixture bytecode appeared') + need(len(rows) == 144, 'full outcome table count') + return {'cases': case_manifest, 'outcomes': rows, 'export_comparisons': archive_equalities} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__.split('\n')[0]) + parser.add_argument('--raw-context-out', type=Path, + help='optional explicit context receipt outside the package; omitted in CI') + args = parser.parse_args() + context_target = None + context = {'schema_version': 1, 'commands': [], + 'scope': 'Tiny tooling fixtures and inert marker only; no scientific replay.'} + try: + if args.raw_context_out is not None: + need(not args.raw_context_out.resolve().is_relative_to(P), 'context must be outside package') + context_target = args.raw_context_out + data, pin_sha = authenticate() + table = run_suite(data, context) + receipt = {'schema_version': 1, 'status': 'PASS_EARLY_DUPLICATE_VERIFY_REJECTION', + 'source_base': BASE, 'source_manifest_sha256': pin_sha, + 'source_sha256': {name: value[2] for name, value in EXPECTED.items()}, + 'patch_sha256': PATCH_SHA, 'candidate_runner_sha256': PATCHED_SHA, + 'fixture_cases': len(table['cases']), + 'actual_source_cli_commands': len(table['outcomes']), + 'accepted_outcomes': sum(x['verdict'] == 'accepted' for x in table['outcomes']), + 'rejected_outcomes': sum(x['verdict'] == 'rejected' for x in table['outcomes']), + 'inert_marker_dispatches': sum(x.get('semantic_output', {}).get( + 'inert_marker_written', False) for x in table['outcomes']), + 'git_apply_checks': context['git_apply_checks'], + 'git_apply_applications': context['git_apply_applications'], + 'source_phases': ['original', 'patched'], 'modes': ['normal', 'optimized'], + 'operations': ['validate', 'plan', 'export', 'dispatch'], + 'outcome_table_sha256': sha(encoded(table)), 'profile': table, + 'scope': 'VERIFY object-key early rejection only. TASK/SOURCES/numeric policies unchanged. ' + 'Duplicate input-array entries remain a demonstrated exportability limitation. ' + 'No metadataPASS-implies-export, security, scientific or global-inventory guarantee.', + 'execution_scope': 'POSIX process-group bounds; CPython3.12 and local Git; ' + 'no live/shared runner or workflow modified; source programs run only in fixtures.'} + package_hashes = {f.relative_to(P).as_posix(): sha(f.read_bytes()) + for f in sorted(P.rglob('*')) if f.is_file()} + receipt['package_sha256'] = package_hashes + context['status'] = receipt['status'] + print(json.dumps(receipt, sort_keys=True, separators=(',', ':'), ensure_ascii=True, allow_nan=False)) + except (OSError, ValueError, KeyError, TypeError, subprocess.SubprocessError) as error: + context['status'] = 'FAIL' + context['error'] = str(error) + print('FAIL_EARLY_DUPLICATE_VERIFY_REJECTION: ' + str(error), file=sys.stderr) + raise SystemExit(1) + finally: + if context_target is not None: + context_target.parent.mkdir(parents=True, exist_ok=True) + context_target.write_bytes(encoded(context)) + + +if __name__ == '__main__': + main()