검증된 폰트와 파일 연결 후보를 통합
- 작성자
- 호시노 히나타
- 작성 시각
- 커밋
47cac6fe702b545389f075f2339df8c6889a8dd0
변경된 파일 78개
+2,769-7변경 내용이 커서 일부 파일의 Diff를 생략했어요. 생략한 파일은 파일 보기나 Raw로 확인할 수 있어요.
| @@ -0,0 +1,16 @@ | ||
| 1 | 추가: # This file is automatically @generated by Cargo. | |
| 2 | 추가: # It is not intended for manual editing. | |
| 3 | 추가: version = 4 | |
| 4 | 추가: | |
| 5 | 추가: [[package]] | |
| 6 | 추가: name = "libc" | |
| 7 | 추가: version = "0.2.191" | |
| 8 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 9 | 추가: checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" | |
| 10 | 추가: | |
| 11 | 추가: [[package]] | |
| 12 | 추가: name = "zipelo-file-publication" | |
| 13 | 추가: version = "0.1.0" | |
| 14 | 추가: dependencies = [ | |
| 15 | 추가: "libc", | |
| 16 | 추가: ] |
| @@ -0,0 +1,18 @@ | ||
| 1 | 추가: [package] | |
| 2 | 추가: name = "zipelo-file-publication" | |
| 3 | 추가: version = "0.1.0" | |
| 4 | 추가: edition = "2024" | |
| 5 | 추가: rust-version = "1.99" | |
| 6 | 추가: license = "MIT" | |
| 7 | 추가: publish = false | |
| 8 | 추가: autotests = false | |
| 9 | 추가: autoexamples = false | |
| 10 | 추가: autobenches = false | |
| 11 | 추가: | |
| 12 | 추가: [lib] | |
| 13 | 추가: doctest = false | |
| 14 | 추가: | |
| 15 | 추가: [target.'cfg(target_os = "linux")'.dependencies] | |
| 16 | 추가: libc = { version = "=0.2.191", default-features = false, features = ["std"] } | |
| 17 | 추가: | |
| 18 | 추가: [workspace] |
| @@ -0,0 +1,21 @@ | ||
| 1 | 추가: MIT License | |
| 2 | 추가: | |
| 3 | 추가: Copyright (c) 2026 Team-LJY contributors | |
| 4 | 추가: | |
| 5 | 추가: Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 6 | 추가: of this software and associated documentation files (the "Software"), to deal | |
| 7 | 추가: in the Software without restriction, including without limitation the rights | |
| 8 | 추가: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 9 | 추가: copies of the Software, and to permit persons to whom the Software is | |
| 10 | 추가: furnished to do so, subject to the following conditions: | |
| 11 | 추가: | |
| 12 | 추가: The above copyright notice and this permission notice shall be included in all | |
| 13 | 추가: copies or substantial portions of the Software. | |
| 14 | 추가: | |
| 15 | 추가: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 16 | 추가: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 17 | 추가: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 18 | 추가: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 19 | 추가: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 20 | 추가: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
| 21 | 추가: SOFTWARE. |
| @@ -0,0 +1,9 @@ | ||
| 1 | 추가: b38bcde0e0c7286f53254ecbc357a55a0b18e803fd7294dec1025fcb34eb6092 Cargo.lock | |
| 2 | 추가: e6d911fb2c215dcab367116b0eac2544a3e37abe0d69ba6f0323c0d0308b329d Cargo.toml | |
| 3 | 추가: 0714945e52a4d5b560c02c9a18478519f8c4e2572cbf87bd6d52adcfb2b63c62 LICENSE | |
| 4 | 추가: 83bd16a9177040f87f726c5ff9c0e14e7e3fc0096c743abe0d7b1b97ab1fc425 THIRD-PARTY-NOTICES.txt | |
| 5 | 추가: fc091b378311e5a5898f770b4a91317ada5d2daebbb3cfb795e1026736334161 contract.json | |
| 6 | 추가: 75757b6b770ea09d7b345ca3beaf3d75fdbbe7c792d00d3aec7465b9968ce4f5 dependencies.json | |
| 7 | 추가: 8304a9c37e8d0a2e21f6657483c58d28c23ba4a4c2ed9ae7e43d389d0f3c2bc3 src/lib.rs | |
| 8 | 추가: 75225159189cb2418b24c5e35c4db804dfe2f0171bf957f59578ae284f046d0c src/linux.rs | |
| 9 | 추가: 75ed00e7059990abe5c3ba7bc0aae87801e3ffa915824c900d09ed31a61f8159 static-validation.json |
| @@ -0,0 +1,208 @@ | ||
| 1 | 추가: libc 0.2.191 - MIT OR Apache-2.0 | |
| 2 | 추가: | |
| 3 | 추가: LICENSE-APACHE | |
| 4 | 추가: Apache License | |
| 5 | 추가: Version 2.0, January 2004 | |
| 6 | 추가: http://www.apache.org/licenses/ | |
| 7 | 추가: | |
| 8 | 추가: TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
| 9 | 추가: | |
| 10 | 추가: 1. Definitions. | |
| 11 | 추가: | |
| 12 | 추가: "License" shall mean the terms and conditions for use, reproduction, | |
| 13 | 추가: and distribution as defined by Sections 1 through 9 of this document. | |
| 14 | 추가: | |
| 15 | 추가: "Licensor" shall mean the copyright owner or entity authorized by | |
| 16 | 추가: the copyright owner that is granting the License. | |
| 17 | 추가: | |
| 18 | 추가: "Legal Entity" shall mean the union of the acting entity and all | |
| 19 | 추가: other entities that control, are controlled by, or are under common | |
| 20 | 추가: control with that entity. For the purposes of this definition, | |
| 21 | 추가: "control" means (i) the power, direct or indirect, to cause the | |
| 22 | 추가: direction or management of such entity, whether by contract or | |
| 23 | 추가: otherwise, or (ii) ownership of fifty percent (50%) or more of the | |
| 24 | 추가: outstanding shares, or (iii) beneficial ownership of such entity. | |
| 25 | 추가: | |
| 26 | 추가: "You" (or "Your") shall mean an individual or Legal Entity | |
| 27 | 추가: exercising permissions granted by this License. | |
| 28 | 추가: | |
| 29 | 추가: "Source" form shall mean the preferred form for making modifications, | |
| 30 | 추가: including but not limited to software source code, documentation | |
| 31 | 추가: source, and configuration files. | |
| 32 | 추가: | |
| 33 | 추가: "Object" form shall mean any form resulting from mechanical | |
| 34 | 추가: transformation or translation of a Source form, including but | |
| 35 | 추가: not limited to compiled object code, generated documentation, | |
| 36 | 추가: and conversions to other media types. | |
| 37 | 추가: | |
| 38 | 추가: "Work" shall mean the work of authorship, whether in Source or | |
| 39 | 추가: Object form, made available under the License, as indicated by a | |
| 40 | 추가: copyright notice that is included in or attached to the work | |
| 41 | 추가: (an example is provided in the Appendix below). | |
| 42 | 추가: | |
| 43 | 추가: "Derivative Works" shall mean any work, whether in Source or Object | |
| 44 | 추가: form, that is based on (or derived from) the Work and for which the | |
| 45 | 추가: editorial revisions, annotations, elaborations, or other modifications | |
| 46 | 추가: represent, as a whole, an original work of authorship. For the purposes | |
| 47 | 추가: of this License, Derivative Works shall not include works that remain | |
| 48 | 추가: separable from, or merely link (or bind by name) to the interfaces of, | |
| 49 | 추가: the Work and Derivative Works thereof. | |
| 50 | 추가: | |
| 51 | 추가: "Contribution" shall mean any work of authorship, including | |
| 52 | 추가: the original version of the Work and any modifications or additions | |
| 53 | 추가: to that Work or Derivative Works thereof, that is intentionally | |
| 54 | 추가: submitted to Licensor for inclusion in the Work by the copyright owner | |
| 55 | 추가: or by an individual or Legal Entity authorized to submit on behalf of | |
| 56 | 추가: the copyright owner. For the purposes of this definition, "submitted" | |
| 57 | 추가: means any form of electronic, verbal, or written communication sent | |
| 58 | 추가: to the Licensor or its representatives, including but not limited to | |
| 59 | 추가: communication on electronic mailing lists, source code control systems, | |
| 60 | 추가: and issue tracking systems that are managed by, or on behalf of, the | |
| 61 | 추가: Licensor for the purpose of discussing and improving the Work, but | |
| 62 | 추가: excluding communication that is conspicuously marked or otherwise | |
| 63 | 추가: designated in writing by the copyright owner as "Not a Contribution." | |
| 64 | 추가: | |
| 65 | 추가: "Contributor" shall mean Licensor and any individual or Legal Entity | |
| 66 | 추가: on behalf of whom a Contribution has been received by Licensor and | |
| 67 | 추가: subsequently incorporated within the Work. | |
| 68 | 추가: | |
| 69 | 추가: 2. Grant of Copyright License. Subject to the terms and conditions of | |
| 70 | 추가: this License, each Contributor hereby grants to You a perpetual, | |
| 71 | 추가: worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |
| 72 | 추가: copyright license to reproduce, prepare Derivative Works of, | |
| 73 | 추가: publicly display, publicly perform, sublicense, and distribute the | |
| 74 | 추가: Work and such Derivative Works in Source or Object form. | |
| 75 | 추가: | |
| 76 | 추가: 3. Grant of Patent License. Subject to the terms and conditions of | |
| 77 | 추가: this License, each Contributor hereby grants to You a perpetual, | |
| 78 | 추가: worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |
| 79 | 추가: (except as stated in this section) patent license to make, have made, | |
| 80 | 추가: use, offer to sell, sell, import, and otherwise transfer the Work, | |
| 81 | 추가: where such license applies only to those patent claims licensable | |
| 82 | 추가: by such Contributor that are necessarily infringed by their | |
| 83 | 추가: Contribution(s) alone or by combination of their Contribution(s) | |
| 84 | 추가: with the Work to which such Contribution(s) was submitted. If You | |
| 85 | 추가: institute patent litigation against any entity (including a | |
| 86 | 추가: cross-claim or counterclaim in a lawsuit) alleging that the Work | |
| 87 | 추가: or a Contribution incorporated within the Work constitutes direct | |
| 88 | 추가: or contributory patent infringement, then any patent licenses | |
| 89 | 추가: granted to You under this License for that Work shall terminate | |
| 90 | 추가: as of the date such litigation is filed. | |
| 91 | 추가: | |
| 92 | 추가: 4. Redistribution. You may reproduce and distribute copies of the | |
| 93 | 추가: Work or Derivative Works thereof in any medium, with or without | |
| 94 | 추가: modifications, and in Source or Object form, provided that You | |
| 95 | 추가: meet the following conditions: | |
| 96 | 추가: | |
| 97 | 추가: (a) You must give any other recipients of the Work or | |
| 98 | 추가: Derivative Works a copy of this License; and | |
| 99 | 추가: | |
| 100 | 추가: (b) You must cause any modified files to carry prominent notices | |
| 101 | 추가: stating that You changed the files; and | |
| 102 | 추가: | |
| 103 | 추가: (c) You must retain, in the Source form of any Derivative Works | |
| 104 | 추가: that You distribute, all copyright, patent, trademark, and | |
| 105 | 추가: attribution notices from the Source form of the Work, | |
| 106 | 추가: excluding those notices that do not pertain to any part of | |
| 107 | 추가: the Derivative Works; and | |
| 108 | 추가: | |
| 109 | 추가: (d) If the Work includes a "NOTICE" text file as part of its | |
| 110 | 추가: distribution, then any Derivative Works that You distribute must | |
| 111 | 추가: include a readable copy of the attribution notices contained | |
| 112 | 추가: within such NOTICE file, excluding those notices that do not | |
| 113 | 추가: pertain to any part of the Derivative Works, in at least one | |
| 114 | 추가: of the following places: within a NOTICE text file distributed | |
| 115 | 추가: as part of the Derivative Works; within the Source form or | |
| 116 | 추가: documentation, if provided along with the Derivative Works; or, | |
| 117 | 추가: within a display generated by the Derivative Works, if and | |
| 118 | 추가: wherever such third-party notices normally appear. The contents | |
| 119 | 추가: of the NOTICE file are for informational purposes only and | |
| 120 | 추가: do not modify the License. You may add Your own attribution | |
| 121 | 추가: notices within Derivative Works that You distribute, alongside | |
| 122 | 추가: or as an addendum to the NOTICE text from the Work, provided | |
| 123 | 추가: that such additional attribution notices cannot be construed | |
| 124 | 추가: as modifying the License. | |
| 125 | 추가: | |
| 126 | 추가: You may add Your own copyright statement to Your modifications and | |
| 127 | 추가: may provide additional or different license terms and conditions | |
| 128 | 추가: for use, reproduction, or distribution of Your modifications, or | |
| 129 | 추가: for any such Derivative Works as a whole, provided Your use, | |
| 130 | 추가: reproduction, and distribution of the Work otherwise complies with | |
| 131 | 추가: the conditions stated in this License. | |
| 132 | 추가: | |
| 133 | 추가: 5. Submission of Contributions. Unless You explicitly state otherwise, | |
| 134 | 추가: any Contribution intentionally submitted for inclusion in the Work | |
| 135 | 추가: by You to the Licensor shall be under the terms and conditions of | |
| 136 | 추가: this License, without any additional terms or conditions. | |
| 137 | 추가: Notwithstanding the above, nothing herein shall supersede or modify | |
| 138 | 추가: the terms of any separate license agreement you may have executed | |
| 139 | 추가: with Licensor regarding such Contributions. | |
| 140 | 추가: | |
| 141 | 추가: 6. Trademarks. This License does not grant permission to use the trade | |
| 142 | 추가: names, trademarks, service marks, or product names of the Licensor, | |
| 143 | 추가: except as required for reasonable and customary use in describing the | |
| 144 | 추가: origin of the Work and reproducing the content of the NOTICE file. | |
| 145 | 추가: | |
| 146 | 추가: 7. Disclaimer of Warranty. Unless required by applicable law or | |
| 147 | 추가: agreed to in writing, Licensor provides the Work (and each | |
| 148 | 추가: Contributor provides its Contributions) on an "AS IS" BASIS, | |
| 149 | 추가: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |
| 150 | 추가: implied, including, without limitation, any warranties or conditions | |
| 151 | 추가: of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |
| 152 | 추가: PARTICULAR PURPOSE. You are solely responsible for determining the | |
| 153 | 추가: appropriateness of using or redistributing the Work and assume any | |
| 154 | 추가: risks associated with Your exercise of permissions under this License. | |
| 155 | 추가: | |
| 156 | 추가: 8. Limitation of Liability. In no event and under no legal theory, | |
| 157 | 추가: whether in tort (including negligence), contract, or otherwise, | |
| 158 | 추가: unless required by applicable law (such as deliberate and grossly | |
| 159 | 추가: negligent acts) or agreed to in writing, shall any Contributor be | |
| 160 | 추가: liable to You for damages, including any direct, indirect, special, | |
| 161 | 추가: incidental, or consequential damages of any character arising as a | |
| 162 | 추가: result of this License or out of the use or inability to use the | |
| 163 | 추가: Work (including but not limited to damages for loss of goodwill, | |
| 164 | 추가: work stoppage, computer failure or malfunction, or any and all | |
| 165 | 추가: other commercial damages or losses), even if such Contributor | |
| 166 | 추가: has been advised of the possibility of such damages. | |
| 167 | 추가: | |
| 168 | 추가: 9. Accepting Warranty or Additional Liability. While redistributing | |
| 169 | 추가: the Work or Derivative Works thereof, You may choose to offer, | |
| 170 | 추가: and charge a fee for, acceptance of support, warranty, indemnity, | |
| 171 | 추가: or other liability obligations and/or rights consistent with this | |
| 172 | 추가: License. However, in accepting such obligations, You may act only | |
| 173 | 추가: on Your own behalf and on Your sole responsibility, not on behalf | |
| 174 | 추가: of any other Contributor, and only if You agree to indemnify, | |
| 175 | 추가: defend, and hold each Contributor harmless for any liability | |
| 176 | 추가: incurred by, or claims asserted against, such Contributor by reason | |
| 177 | 추가: of your accepting any such warranty or additional liability. | |
| 178 | 추가: | |
| 179 | 추가: END OF TERMS AND CONDITIONS | |
| 180 | 추가: | |
| 181 | 추가: | |
| 182 | 추가: LICENSE-MIT | |
| 183 | 추가: Copyright (c) The Rust Project Developers | |
| 184 | 추가: | |
| 185 | 추가: Permission is hereby granted, free of charge, to any | |
| 186 | 추가: person obtaining a copy of this software and associated | |
| 187 | 추가: documentation files (the "Software"), to deal in the | |
| 188 | 추가: Software without restriction, including without | |
| 189 | 추가: limitation the rights to use, copy, modify, merge, | |
| 190 | 추가: publish, distribute, sublicense, and/or sell copies of | |
| 191 | 추가: the Software, and to permit persons to whom the Software | |
| 192 | 추가: is furnished to do so, subject to the following | |
| 193 | 추가: conditions: | |
| 194 | 추가: | |
| 195 | 추가: The above copyright notice and this permission notice | |
| 196 | 추가: shall be included in all copies or substantial portions | |
| 197 | 추가: of the Software. | |
| 198 | 추가: | |
| 199 | 추가: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF | |
| 200 | 추가: ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | |
| 201 | 추가: TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | |
| 202 | 추가: PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | |
| 203 | 추가: SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | |
| 204 | 추가: CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |
| 205 | 추가: OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | |
| 206 | 추가: IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
| 207 | 추가: DEALINGS IN THE SOFTWARE. | |
| 208 | 추가: |
| @@ -0,0 +1,90 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "schema": 1, | |
| 3 | 추가: "package": "zipelo-file-publication", | |
| 4 | 추가: "status": "source-static-only", | |
| 5 | 추가: "base_head": "23b8d1c615f24f42469138fcc63e7fce7cda4f24", | |
| 6 | 추가: "scope": [ | |
| 7 | 추가: "experiments/rust-file-publication/" | |
| 8 | 추가: ], | |
| 9 | 추가: "tests_owner": "bugfix role; separate root tests path after API review", | |
| 10 | 추가: "api": { | |
| 11 | 추가: "entry": "Publication::new() -> (Publication, Cancellation); Publication::publish(self, Request, checkpoint) -> Report<E>", | |
| 12 | 추가: "input": "Immutable borrowed byte slice, absolute parent Path, single OsStr leaf, bounded Limits. No source-file access and no input validation/worker evidence.", | |
| 13 | 추가: "callbacks": [ | |
| 14 | 추가: "Opening (twice)", | |
| 15 | 추가: "Writing before each write", | |
| 16 | 추가: "Verifying before sync and every read, including EOF probe", | |
| 17 | 추가: "BeforeCommit after byte/metadata checks and procfs setup" | |
| 18 | 추가: ], | |
| 19 | 추가: "output": "Report { outcome, usage, cleanup }. Outcome::Committed requires private FileCommitReceipt obtained only after linkat returns zero. No caller bool, public receipt constructor, Default, or Deserialize.", | |
| 20 | 추가: "receipt": "Parent and file device/inode plus length. Caller retains requested leaf separately. Identities are observations, not permanent identities after inode reuse. No bytes/hash or archive validity claim." | |
| 21 | 추가: }, | |
| 22 | 추가: "limits": { | |
| 23 | 추가: "payload_bytes": 16777216, | |
| 24 | 추가: "scratch_bytes": 65536, | |
| 25 | 추가: "default_duration_seconds": 30, | |
| 26 | 추가: "max_duration_seconds": 300, | |
| 27 | 추가: "max_reserved_read_write_bytes": 134217728, | |
| 28 | 추가: "max_read_write_calls": 131072, | |
| 29 | 추가: "memory": "Borrow input without copying; fixed 64KiB scratch, bounded path allocations (parent<=4095 bytes, leaf<=255), at most 4 File handles. Does not bound caller's existing allocations, callbacks, allocator internals or filesystem/kernel memory.", | |
| 30 | 추가: "accounting": "Reserve full requested read/write length and one attempt before each syscall; never refund on short/zero/error/EOF. Actual transferred bytes separately counted. EOF probe reserves 1 byte. open/metadata/sync/link counters are adapter attempts; metadata is std File::metadata. lseek and close excluded from IO byte/call budgets; close attempts/failures in Cleanup.", | |
| 31 | 추가: "termination": "Cooperative elapsed-time check at checkpoints before commit. No hard deadline for callback, blocking syscall, sync or close. Postcommit sync/close are not interrupted by cancellation or elapsed limit. Per invocation usage; upper job layer must aggregate retries." | |
| 32 | 추가: }, | |
| 33 | 추가: "linux": { | |
| 34 | 추가: "parent": "Reject nonabsolute, empty/repeated/trailing components, dot/dotdot, NUL, oversized paths. Root '/' is lexical-valid but must pass owner/mode and filesystem checks. openat2 O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY and RESOLVE_NO_SYMLINKS; no fallback.", | |
| 35 | 추가: "trust": "fstat directory, effective UID owner, no group/other write bits. Only an exclusively managed destination directory with trusted same-UID actors is in scope. This is not an ACL, LSM, namespace, root or same-user adversary sandbox. No permission/security setting changes. Ancestors may move; no persistent pathname guarantee.", | |
| 36 | 추가: "filesystem": "fstatfs magic 0xef53 (ext family, not proof specifically ext4) or 0x58465342 (XFS) only. Unknown/network/overlay/tmpfs rejected before temp creation. Actual O_TMPFILE support still required. Source-only: no mounted filesystem support verified.", | |
| 37 | 추가: "temporary": "openat(held_parent, '.', O_TMPFILE|O_RDWR|O_CLOEXEC, 0600), without O_EXCL. fstat regular, nlink=0, euid owner, same st_dev. No named staging file.", | |
| 38 | 추가: "verification": "Bounded raw write with positive short-write accumulation; zero write is WriteZero. fsync_file before lseek and exact chunk readback/EOF check. Native errors including EINTR preserved without raw IO retries. Final fstat checks same identity, regular type, nlink=0 and length. Readback is not archive validation, security isolation or protection from privileged/same-UID fd manipulation.", | |
| 39 | 추가: "procfs": "openat2('/proc', O_PATH|O_DIRECTORY|O_CLOEXEC, RESOLVE_NO_SYMLINKS); fstatfs PROC_SUPER_MAGIC. Open numeric getpid()/fd relative to held proc root using BENEATH|NO_SYMLINKS|NO_XDEV. Keep all fds owned. Actual link source is numeric temp fd relative to proc fd directory with AT_SYMLINK_FOLLOW. Require trusted procfs for this PID namespace. No alternate /proc mount or launcher.", | |
| 40 | 추가: "commit": "linkat(held_proc_fd_directory, numeric_temp_fd, held_parent, leaf, AT_SYMLINK_FOLLOW) exactly once after CAS. Existing leaf of any kind, including symlink/directory, is EEXIST; never truncate, overwrite, merge, rename or delete. No fallback on EXDEV, ENOSYS, unsupported FS/procfs or other error.", | |
| 41 | 추가: "namespace": "Success belongs to held parent object and leaf at link return, not to the original parent pathname. Parent rename/replacement may cause commit into moved original directory; unlinked parent may fail. No postcheck can prove the original pathname persists; no later namespace stability claim." | |
| 42 | 추가: }, | |
| 43 | 추가: "cancellation": { | |
| 44 | 추가: "state": "Per-publication private Arc<AtomicU8>: Pending -> Cancelled by request CAS, or Pending -> Committing by commit CAS, then Finished at Publication drop. SeqCst defines a total decision order.", | |
| 45 | 추가: "before": "A cancellation CAS winning before begin_commit prevents linkat. Stop::Cancelled also stops before link. Callback(E) is returned unchanged, including when callback also requests cancellation. Native IO failures are returned before a later checkpoint and are not overwritten by cancellation.", | |
| 46 | 추가: "after": "Committing wins: requests return TooLate until publication drops; link syscall result preserved, no callbacks after CAS. Success cannot become cancelled and no unlink rollback exists. A late request after returned report is Finished.", | |
| 47 | 추가: "abandon": "Dropping unused Publication marks Finished without completion proof. Panic before commit unwinds RAII but returns no report; panic/abort and forced process death are not verified cleanup. Callback is trusted application code and may block or panic." | |
| 48 | 추가: }, | |
| 49 | 추가: "outcomes": { | |
| 50 | 추가: "NotCommitted": "All pre-link failures, including unsupported platform/filesystem, cancellation, original callback or IO error, and linkat EEXIST. Preserves errno without flattening to archive failure. This is an operation observation, not assertion that no other actor changed destination.", | |
| 51 | 추가: "CommitUncertain": "Any non-EEXIST linkat error is conservatively uncertain, including EXDEV/EINTR/ENOENT. Original io::Error retained, no receipt minted, no automatic retry/unlink. This deliberately overclassifies some definite failures pending later syscall-specific review.", | |
| 52 | 추가: "Committed": "linkat returned zero. Private file-layer receipt exists even if parent fsync or close fails. Not OS worker, archive validation or product Published success.", | |
| 53 | 추가: "durability": "File fsync failure is precommit failure. After link success, parent fsync success is FileAndParentSynced, otherwise ParentSyncFailed(original error). Two successful fsync returns are reported, not a guarantee against faulty storage or arbitrary crash recovery.", | |
| 54 | 추가: "cleanup": "All acquired fds are explicitly close'd once on every normal return. Order temporary, proc fd directory, proc root, parent. Fixed four-slot failures retain resource and original errno separately. Never retry close (including EINTR), never unlink any name. Unlinked O_TMPFILE normally ceases to exist after last reference, but successful close is not physical deletion proof; close failure is not reported as confirmed cleanup. Panic path uses File RAII with unobserved close errors." | |
| 55 | 추가: }, | |
| 56 | 추가: "diagnostics": "No stored full path, file content or raw byte Debug on Request/receipt/Report. Callback E and io::Error may carry caller-controlled data; consumers must redact rather than log raw Debug. No external transmission.", | |
| 57 | 추가: "validation": { | |
| 58 | 추가: "completed": [ | |
| 59 | 추가: "rustfmt syntax/format only", | |
| 60 | 추가: "locked/offline metadata and offline lock generation", | |
| 61 | 추가: "inline structural/static assertions and manifest hashes", | |
| 62 | 추가: "cached libc archive checksum, cached regular file equality and license texts" | |
| 63 | 추가: ], | |
| 64 | 추가: "not_performed": [ | |
| 65 | 추가: "Rust compile or typecheck", | |
| 66 | 추가: "tests/discovery", | |
| 67 | 추가: "publication/filesystem syscalls from candidate", | |
| 68 | 추가: "worker execution", | |
| 69 | 추가: "Windows", | |
| 70 | 추가: "GUI", | |
| 71 | 추가: "CVE/advisory audit" | |
| 72 | 추가: ], | |
| 73 | 추가: "future": "Synthetic files only in fresh task-owned directory on supported filesystem. Regression owner uses root tests/. Distinguish injected errors from real syscalls, parent replacement from persistence, EEXIST preservation, short/zero writes, verification mismatch, sync errors, cancellation/commit CAS order, late cancellation and close failures. Missing supported filesystem is unsupported, not authorization to mount/install/change environment." | |
| 74 | 추가: }, | |
| 75 | 추가: "references": [ | |
| 76 | 추가: "https://man7.org/linux/man-pages/man2/openat2.2.html", | |
| 77 | 추가: "https://man7.org/linux/man-pages/man2/open.2.html", | |
| 78 | 추가: "https://man7.org/linux/man-pages/man2/linkat.2.html", | |
| 79 | 추가: "https://man7.org/linux/man-pages/man2/fsync.2.html", | |
| 80 | 추가: "https://man7.org/linux/man-pages/man2/close.2.html" | |
| 81 | 추가: ], | |
| 82 | 추가: "preservation": [ | |
| 83 | 추가: "PR42/43/44/46 frozen", | |
| 84 | 추가: "C# unchanged", | |
| 85 | 추가: "No worker/execveat EACCES retry or bypass", | |
| 86 | 추가: "No folder publication or product UI", | |
| 87 | 추가: "No main merge", | |
| 88 | 추가: "No old evidence rewritten" | |
| 89 | 추가: ] | |
| 90 | 추가: } |
| @@ -0,0 +1,25 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "direct": [ | |
| 3 | 추가: { | |
| 4 | 추가: "name": "libc", | |
| 5 | 추가: "version": "0.2.191", | |
| 6 | 추가: "license": "MIT OR Apache-2.0", | |
| 7 | 추가: "target": "cfg(target_os = linux)", | |
| 8 | 추가: "features": [ | |
| 9 | 추가: "std" | |
| 10 | 추가: ], | |
| 11 | 추가: "default_features": false, | |
| 12 | 추가: "checksum": "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a", | |
| 13 | 추가: "cached_regular_files_verified": 452, | |
| 14 | 추가: "license_files": [ | |
| 15 | 추가: "LICENSE-APACHE", | |
| 16 | 추가: "LICENSE-MIT" | |
| 17 | 추가: ] | |
| 18 | 추가: } | |
| 19 | 추가: ], | |
| 20 | 추가: "transitive": [], | |
| 21 | 추가: "new_external_crate_versions": false, | |
| 22 | 추가: "reuse": "Existing rust-file-snapshot and rust-live-supervisor libc version; no snapshot dependency", | |
| 23 | 추가: "network_restore": false, | |
| 24 | 추가: "advisory_audit": "not performed; no vulnerability-free claim" | |
| 25 | 추가: } |
| @@ -0,0 +1,361 @@ | ||
| 1 | 추가: #![deny(unsafe_op_in_unsafe_fn)] | |
| 2 | 추가: | |
| 3 | 추가: //! 파일 계층의 단일 이름 게시만 담당함. | |
| 4 | 추가: //! 원래 경로 유지, 압축 검증, OS worker 실행과 원자적 입력 snapshot을 증명하지 않음. | |
| 5 | 추가: | |
| 6 | 추가: use std::{ | |
| 7 | 추가: ffi::OsStr, | |
| 8 | 추가: io, | |
| 9 | 추가: path::Path, | |
| 10 | 추가: sync::{ | |
| 11 | 추가: Arc, | |
| 12 | 추가: atomic::{AtomicU8, Ordering}, | |
| 13 | 추가: }, | |
| 14 | 추가: time::{Duration, Instant}, | |
| 15 | 추가: }; | |
| 16 | 추가: | |
| 17 | 추가: #[cfg(target_os = "linux")] | |
| 18 | 추가: mod linux; | |
| 19 | 추가: | |
| 20 | 추가: pub const MAX_BYTES: u64 = 16 * 1024 * 1024; | |
| 21 | 추가: pub const MAX_IO_BYTES: u64 = 128 * 1024 * 1024; | |
| 22 | 추가: pub const MAX_IO_CALLS: u64 = 131_072; | |
| 23 | 추가: pub const CHUNK_BYTES: usize = 65_536; | |
| 24 | 추가: const PENDING: u8 = 0; | |
| 25 | 추가: const CANCELLED: u8 = 1; | |
| 26 | 추가: const COMMITTING: u8 = 2; | |
| 27 | 추가: const FINISHED: u8 = 3; | |
| 28 | 추가: | |
| 29 | 추가: #[derive(Clone, Copy, Debug)] | |
| 30 | 추가: pub struct Limits { | |
| 31 | 추가: pub max_bytes: u64, | |
| 32 | 추가: pub max_io_bytes: u64, | |
| 33 | 추가: pub max_io_calls: u64, | |
| 34 | 추가: pub max_duration: Duration, | |
| 35 | 추가: } | |
| 36 | 추가: | |
| 37 | 추가: impl Default for Limits { | |
| 38 | 추가: fn default() -> Self { | |
| 39 | 추가: Self { | |
| 40 | 추가: max_bytes: MAX_BYTES, | |
| 41 | 추가: max_io_bytes: MAX_IO_BYTES, | |
| 42 | 추가: max_io_calls: MAX_IO_CALLS, | |
| 43 | 추가: max_duration: Duration::from_secs(30), | |
| 44 | 추가: } | |
| 45 | 추가: } | |
| 46 | 추가: } | |
| 47 | 추가: | |
| 48 | 추가: pub struct Request<'a> { | |
| 49 | 추가: pub parent: &'a Path, | |
| 50 | 추가: pub leaf: &'a OsStr, | |
| 51 | 추가: pub bytes: &'a [u8], | |
| 52 | 추가: pub limits: Limits, | |
| 53 | 추가: } | |
| 54 | 추가: | |
| 55 | 추가: #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] | |
| 56 | 추가: pub struct Usage { | |
| 57 | 추가: pub open_calls: u64, | |
| 58 | 추가: pub metadata_calls: u64, | |
| 59 | 추가: pub sync_calls: u64, | |
| 60 | 추가: pub link_calls: u64, | |
| 61 | 추가: pub read_calls: u64, | |
| 62 | 추가: pub write_calls: u64, | |
| 63 | 추가: pub reserved_io_bytes: u64, | |
| 64 | 추가: pub actual_read_bytes: u64, | |
| 65 | 추가: pub actual_written_bytes: u64, | |
| 66 | 추가: } | |
| 67 | 추가: | |
| 68 | 추가: #[derive(Clone, Copy, Debug, Eq, PartialEq)] | |
| 69 | 추가: pub enum Stage { | |
| 70 | 추가: Opening, | |
| 71 | 추가: Writing, | |
| 72 | 추가: Verifying, | |
| 73 | 추가: BeforeCommit, | |
| 74 | 추가: } | |
| 75 | 추가: | |
| 76 | 추가: #[derive(Clone, Copy, Debug)] | |
| 77 | 추가: pub struct Checkpoint { | |
| 78 | 추가: pub stage: Stage, | |
| 79 | 추가: pub offset: u64, | |
| 80 | 추가: pub length: u64, | |
| 81 | 추가: pub usage: Usage, | |
| 82 | 추가: } | |
| 83 | 추가: | |
| 84 | 추가: #[derive(Debug)] | |
| 85 | 추가: pub enum Stop<E> { | |
| 86 | 추가: Cancelled, | |
| 87 | 추가: Callback(E), | |
| 88 | 추가: } | |
| 89 | 추가: | |
| 90 | 추가: #[derive(Debug)] | |
| 91 | 추가: pub enum Error<E> { | |
| 92 | 추가: InvalidLimits, | |
| 93 | 추가: InvalidPath, | |
| 94 | 추가: LimitExceeded, | |
| 95 | 추가: DeadlineExceeded, | |
| 96 | 추가: Cancelled, | |
| 97 | 추가: Callback(E), | |
| 98 | 추가: UnsupportedPlatform, | |
| 99 | 추가: UnsupportedFilesystem, | |
| 100 | 추가: UntrustedParent, | |
| 101 | 추가: InvalidTemporaryFile, | |
| 102 | 추가: VerificationMismatch, | |
| 103 | 추가: Io { | |
| 104 | 추가: operation: &'static str, | |
| 105 | 추가: source: io::Error, | |
| 106 | 추가: }, | |
| 107 | 추가: } | |
| 108 | 추가: | |
| 109 | 추가: // 재사용이나 초기화 API를 제공하지 않는 작업별 취소 핸들임. | |
| 110 | 추가: #[derive(Clone)] | |
| 111 | 추가: pub struct Cancellation { | |
| 112 | 추가: state: Arc<AtomicU8>, | |
| 113 | 추가: } | |
| 114 | 추가: | |
| 115 | 추가: #[derive(Clone, Copy, Debug, Eq, PartialEq)] | |
| 116 | 추가: pub enum CancelDecision { | |
| 117 | 추가: Requested, | |
| 118 | 추가: AlreadyRequested, | |
| 119 | 추가: TooLate, | |
| 120 | 추가: Finished, | |
| 121 | 추가: } | |
| 122 | 추가: | |
| 123 | 추가: impl Cancellation { | |
| 124 | 추가: pub fn request(&self) -> CancelDecision { | |
| 125 | 추가: match self | |
| 126 | 추가: .state | |
| 127 | 추가: .compare_exchange(PENDING, CANCELLED, Ordering::SeqCst, Ordering::SeqCst) | |
| 128 | 추가: { | |
| 129 | 추가: Ok(_) => CancelDecision::Requested, | |
| 130 | 추가: Err(CANCELLED) => CancelDecision::AlreadyRequested, | |
| 131 | 추가: Err(COMMITTING) => CancelDecision::TooLate, | |
| 132 | 추가: Err(_) => CancelDecision::Finished, | |
| 133 | 추가: } | |
| 134 | 추가: } | |
| 135 | 추가: } | |
| 136 | 추가: | |
| 137 | 추가: pub struct Publication { | |
| 138 | 추가: state: Arc<AtomicU8>, | |
| 139 | 추가: } | |
| 140 | 추가: | |
| 141 | 추가: impl Publication { | |
| 142 | 추가: pub fn new() -> (Self, Cancellation) { | |
| 143 | 추가: let state = Arc::new(AtomicU8::new(PENDING)); | |
| 144 | 추가: ( | |
| 145 | 추가: Self { | |
| 146 | 추가: state: state.clone(), | |
| 147 | 추가: }, | |
| 148 | 추가: Cancellation { state }, | |
| 149 | 추가: ) | |
| 150 | 추가: } | |
| 151 | 추가: | |
| 152 | 추가: // 반환 receipt는 파일 이름 생성만 증명하며 내용의 업무상 유효성을 증명하지 않음. | |
| 153 | 추가: pub fn publish<E>( | |
| 154 | 추가: self, | |
| 155 | 추가: request: Request<'_>, | |
| 156 | 추가: mut checkpoint: impl FnMut(Checkpoint) -> Result<(), Stop<E>>, | |
| 157 | 추가: ) -> Report<E> { | |
| 158 | 추가: let mut run = Run { | |
| 159 | 추가: limits: request.limits, | |
| 160 | 추가: usage: Usage::default(), | |
| 161 | 추가: started: Instant::now(), | |
| 162 | 추가: state: &self.state, | |
| 163 | 추가: length: request.bytes.len() as u64, | |
| 164 | 추가: }; | |
| 165 | 추가: if let Err(error) = run.validate() { | |
| 166 | 추가: return Report { | |
| 167 | 추가: outcome: Outcome::NotCommitted(error), | |
| 168 | 추가: usage: run.usage, | |
| 169 | 추가: cleanup: Cleanup::empty(), | |
| 170 | 추가: }; | |
| 171 | 추가: } | |
| 172 | 추가: #[cfg(target_os = "linux")] | |
| 173 | 추가: { | |
| 174 | 추가: linux::publish(request, &mut run, &mut checkpoint) | |
| 175 | 추가: } | |
| 176 | 추가: #[cfg(not(target_os = "linux"))] | |
| 177 | 추가: { | |
| 178 | 추가: let _ = &mut checkpoint; | |
| 179 | 추가: Report { | |
| 180 | 추가: outcome: Outcome::NotCommitted(Error::UnsupportedPlatform), | |
| 181 | 추가: usage: run.usage, | |
| 182 | 추가: cleanup: Cleanup::empty(), | |
| 183 | 추가: } | |
| 184 | 추가: } | |
| 185 | 추가: } | |
| 186 | 추가: } | |
| 187 | 추가: | |
| 188 | 추가: impl Drop for Publication { | |
| 189 | 추가: fn drop(&mut self) { | |
| 190 | 추가: self.state.store(FINISHED, Ordering::SeqCst); | |
| 191 | 추가: } | |
| 192 | 추가: } | |
| 193 | 추가: | |
| 194 | 추가: #[derive(Clone, Copy, Debug, Eq, PartialEq)] | |
| 195 | 추가: pub struct Identity { | |
| 196 | 추가: device: u64, | |
| 197 | 추가: inode: u64, | |
| 198 | 추가: } | |
| 199 | 추가: | |
| 200 | 추가: impl Identity { | |
| 201 | 추가: pub fn device(&self) -> u64 { | |
| 202 | 추가: self.device | |
| 203 | 추가: } | |
| 204 | 추가: pub fn inode(&self) -> u64 { | |
| 205 | 추가: self.inode | |
| 206 | 추가: } | |
| 207 | 추가: } | |
| 208 | 추가: | |
| 209 | 추가: // 외부 생성자와 역직렬화를 제공하지 않음. | |
| 210 | 추가: pub struct FileCommitReceipt { | |
| 211 | 추가: parent: Identity, | |
| 212 | 추가: file: Identity, | |
| 213 | 추가: length: u64, | |
| 214 | 추가: } | |
| 215 | 추가: | |
| 216 | 추가: impl FileCommitReceipt { | |
| 217 | 추가: pub fn parent_identity(&self) -> Identity { | |
| 218 | 추가: self.parent | |
| 219 | 추가: } | |
| 220 | 추가: pub fn file_identity(&self) -> Identity { | |
| 221 | 추가: self.file | |
| 222 | 추가: } | |
| 223 | 추가: pub fn length(&self) -> u64 { | |
| 224 | 추가: self.length | |
| 225 | 추가: } | |
| 226 | 추가: } | |
| 227 | 추가: | |
| 228 | 추가: #[derive(Debug)] | |
| 229 | 추가: pub enum Durability { | |
| 230 | 추가: FileAndParentSynced, | |
| 231 | 추가: ParentSyncFailed(io::Error), | |
| 232 | 추가: } | |
| 233 | 추가: | |
| 234 | 추가: pub enum Outcome<E> { | |
| 235 | 추가: NotCommitted(Error<E>), | |
| 236 | 추가: // 링크 호출 실패의 원격 또는 파일시스템 부작용을 추측하지 않음. | |
| 237 | 추가: CommitUncertain { | |
| 238 | 추가: source: io::Error, | |
| 239 | 추가: }, | |
| 240 | 추가: Committed { | |
| 241 | 추가: receipt: FileCommitReceipt, | |
| 242 | 추가: durability: Durability, | |
| 243 | 추가: }, | |
| 244 | 추가: } | |
| 245 | 추가: | |
| 246 | 추가: #[derive(Clone, Copy, Debug, Eq, PartialEq)] | |
| 247 | 추가: pub enum Resource { | |
| 248 | 추가: TemporaryFile, | |
| 249 | 추가: ProcFdDirectory, | |
| 250 | 추가: ProcRoot, | |
| 251 | 추가: ParentDirectory, | |
| 252 | 추가: } | |
| 253 | 추가: | |
| 254 | 추가: #[derive(Debug)] | |
| 255 | 추가: pub struct CloseFailure { | |
| 256 | 추가: pub resource: Resource, | |
| 257 | 추가: pub source: io::Error, | |
| 258 | 추가: } | |
| 259 | 추가: | |
| 260 | 추가: #[derive(Debug)] | |
| 261 | 추가: pub struct Cleanup { | |
| 262 | 추가: pub attempted: u8, | |
| 263 | 추가: pub failures: [Option<CloseFailure>; 4], | |
| 264 | 추가: } | |
| 265 | 추가: | |
| 266 | 추가: impl Cleanup { | |
| 267 | 추가: fn empty() -> Self { | |
| 268 | 추가: Self { | |
| 269 | 추가: attempted: 0, | |
| 270 | 추가: failures: [None, None, None, None], | |
| 271 | 추가: } | |
| 272 | 추가: } | |
| 273 | 추가: | |
| 274 | 추가: // 성공한 close 호출만 뜻하며 물리 삭제나 저장 내구성 증거가 아님. | |
| 275 | 추가: pub fn all_close_calls_succeeded(&self) -> bool { | |
| 276 | 추가: self.failures.iter().all(Option::is_none) | |
| 277 | 추가: } | |
| 278 | 추가: } | |
| 279 | 추가: | |
| 280 | 추가: pub struct Report<E> { | |
| 281 | 추가: pub outcome: Outcome<E>, | |
| 282 | 추가: pub usage: Usage, | |
| 283 | 추가: pub cleanup: Cleanup, | |
| 284 | 추가: } | |
| 285 | 추가: | |
| 286 | 추가: struct Run<'a> { | |
| 287 | 추가: limits: Limits, | |
| 288 | 추가: usage: Usage, | |
| 289 | 추가: started: Instant, | |
| 290 | 추가: state: &'a AtomicU8, | |
| 291 | 추가: length: u64, | |
| 292 | 추가: } | |
| 293 | 추가: | |
| 294 | 추가: impl Run<'_> { | |
| 295 | 추가: fn validate<E>(&self) -> Result<(), Error<E>> { | |
| 296 | 추가: if self.limits.max_bytes > MAX_BYTES | |
| 297 | 추가: || self.limits.max_io_bytes > MAX_IO_BYTES | |
| 298 | 추가: || self.limits.max_io_calls > MAX_IO_CALLS | |
| 299 | 추가: || self.limits.max_duration.is_zero() | |
| 300 | 추가: || self.limits.max_duration > Duration::from_secs(300) | |
| 301 | 추가: { | |
| 302 | 추가: return Err(Error::InvalidLimits); | |
| 303 | 추가: } | |
| 304 | 추가: if self.length > self.limits.max_bytes { | |
| 305 | 추가: return Err(Error::LimitExceeded); | |
| 306 | 추가: } | |
| 307 | 추가: Ok(()) | |
| 308 | 추가: } | |
| 309 | 추가: | |
| 310 | 추가: fn check<E>( | |
| 311 | 추가: &self, | |
| 312 | 추가: stage: Stage, | |
| 313 | 추가: offset: usize, | |
| 314 | 추가: callback: &mut impl FnMut(Checkpoint) -> Result<(), Stop<E>>, | |
| 315 | 추가: ) -> Result<(), Error<E>> { | |
| 316 | 추가: match callback(Checkpoint { | |
| 317 | 추가: stage, | |
| 318 | 추가: offset: offset as u64, | |
| 319 | 추가: length: self.length, | |
| 320 | 추가: usage: self.usage, | |
| 321 | 추가: }) { | |
| 322 | 추가: Err(Stop::Callback(error)) => return Err(Error::Callback(error)), | |
| 323 | 추가: Err(Stop::Cancelled) => return Err(Error::Cancelled), | |
| 324 | 추가: Ok(()) => {} | |
| 325 | 추가: } | |
| 326 | 추가: if self.state.load(Ordering::SeqCst) == CANCELLED { | |
| 327 | 추가: return Err(Error::Cancelled); | |
| 328 | 추가: } | |
| 329 | 추가: if self.started.elapsed() >= self.limits.max_duration { | |
| 330 | 추가: return Err(Error::DeadlineExceeded); | |
| 331 | 추가: } | |
| 332 | 추가: Ok(()) | |
| 333 | 추가: } | |
| 334 | 추가: | |
| 335 | 추가: fn reserve<E>(&mut self, count: usize, write: bool) -> Result<(), Error<E>> { | |
| 336 | 추가: let total = self | |
| 337 | 추가: .usage | |
| 338 | 추가: .reserved_io_bytes | |
| 339 | 추가: .checked_add(count as u64) | |
| 340 | 추가: .ok_or(Error::LimitExceeded)?; | |
| 341 | 추가: if total > self.limits.max_io_bytes | |
| 342 | 추가: || self.usage.read_calls + self.usage.write_calls >= self.limits.max_io_calls | |
| 343 | 추가: { | |
| 344 | 추가: return Err(Error::LimitExceeded); | |
| 345 | 추가: } | |
| 346 | 추가: self.usage.reserved_io_bytes = total; | |
| 347 | 추가: if write { | |
| 348 | 추가: self.usage.write_calls += 1; | |
| 349 | 추가: } else { | |
| 350 | 추가: self.usage.read_calls += 1; | |
| 351 | 추가: } | |
| 352 | 추가: Ok(()) | |
| 353 | 추가: } | |
| 354 | 추가: | |
| 355 | 추가: fn begin_commit<E>(&self) -> Result<(), Error<E>> { | |
| 356 | 추가: self.state | |
| 357 | 추가: .compare_exchange(PENDING, COMMITTING, Ordering::SeqCst, Ordering::SeqCst) | |
| 358 | 추가: .map(|_| ()) | |
| 359 | 추가: .map_err(|_| Error::Cancelled) | |
| 360 | 추가: } | |
| 361 | 추가: } |
| @@ -0,0 +1,343 @@ | ||
| 1 | 추가: use super::*; | |
| 2 | 추가: use std::{ | |
| 3 | 추가: ffi::{CStr, CString}, | |
| 4 | 추가: fs::{File, Metadata}, | |
| 5 | 추가: mem::MaybeUninit, | |
| 6 | 추가: os::{ | |
| 7 | 추가: fd::{AsRawFd, FromRawFd, IntoRawFd, RawFd}, | |
| 8 | 추가: unix::{ffi::OsStrExt, fs::MetadataExt}, | |
| 9 | 추가: }, | |
| 10 | 추가: }; | |
| 11 | 추가: | |
| 12 | 추가: const NO_SYMLINKS: u64 = 0x04; | |
| 13 | 추가: const BENEATH: u64 = 0x08; | |
| 14 | 추가: const NO_XDEV: u64 = 0x01; | |
| 15 | 추가: | |
| 16 | 추가: #[repr(C)] | |
| 17 | 추가: struct OpenHow { | |
| 18 | 추가: flags: u64, | |
| 19 | 추가: mode: u64, | |
| 20 | 추가: resolve: u64, | |
| 21 | 추가: } | |
| 22 | 추가: | |
| 23 | 추가: #[derive(Default)] | |
| 24 | 추가: struct Handles { | |
| 25 | 추가: parent: Option<File>, | |
| 26 | 추가: temp: Option<File>, | |
| 27 | 추가: proc_root: Option<File>, | |
| 28 | 추가: proc_fds: Option<File>, | |
| 29 | 추가: } | |
| 30 | 추가: | |
| 31 | 추가: impl Handles { | |
| 32 | 추가: fn close_all(&mut self) -> Cleanup { | |
| 33 | 추가: let mut cleanup = Cleanup::empty(); | |
| 34 | 추가: for (resource, file) in [ | |
| 35 | 추가: (Resource::TemporaryFile, self.temp.take()), | |
| 36 | 추가: (Resource::ProcFdDirectory, self.proc_fds.take()), | |
| 37 | 추가: (Resource::ProcRoot, self.proc_root.take()), | |
| 38 | 추가: (Resource::ParentDirectory, self.parent.take()), | |
| 39 | 추가: ] { | |
| 40 | 추가: if let Some(file) = file { | |
| 41 | 추가: let fd = file.into_raw_fd(); | |
| 42 | 추가: let index = cleanup.attempted as usize; | |
| 43 | 추가: cleanup.attempted += 1; | |
| 44 | 추가: // 소유 fd를 한 번만 닫으며 Linux close 오류를 재시도하지 않음. | |
| 45 | 추가: if unsafe { libc::close(fd) } != 0 { | |
| 46 | 추가: cleanup.failures[index] = Some(CloseFailure { | |
| 47 | 추가: resource, | |
| 48 | 추가: source: io::Error::last_os_error(), | |
| 49 | 추가: }); | |
| 50 | 추가: } | |
| 51 | 추가: } | |
| 52 | 추가: } | |
| 53 | 추가: cleanup | |
| 54 | 추가: } | |
| 55 | 추가: } | |
| 56 | 추가: | |
| 57 | 추가: pub(super) fn publish<E>( | |
| 58 | 추가: request: Request<'_>, | |
| 59 | 추가: run: &mut Run<'_>, | |
| 60 | 추가: callback: &mut impl FnMut(Checkpoint) -> Result<(), Stop<E>>, | |
| 61 | 추가: ) -> Report<E> { | |
| 62 | 추가: let mut handles = Handles::default(); | |
| 63 | 추가: let outcome = match perform(request, run, callback, &mut handles) { | |
| 64 | 추가: Ok(outcome) => outcome, | |
| 65 | 추가: Err(error) => Outcome::NotCommitted(error), | |
| 66 | 추가: }; | |
| 67 | 추가: let cleanup = handles.close_all(); | |
| 68 | 추가: Report { | |
| 69 | 추가: outcome, | |
| 70 | 추가: usage: run.usage, | |
| 71 | 추가: cleanup, | |
| 72 | 추가: } | |
| 73 | 추가: } | |
| 74 | 추가: | |
| 75 | 추가: fn io_error<E>(operation: &'static str, source: io::Error) -> Error<E> { | |
| 76 | 추가: Error::Io { operation, source } | |
| 77 | 추가: } | |
| 78 | 추가: | |
| 79 | 추가: fn opened<E>(fd: libc::c_long, operation: &'static str) -> Result<File, Error<E>> { | |
| 80 | 추가: if fd < 0 { | |
| 81 | 추가: return Err(io_error(operation, io::Error::last_os_error())); | |
| 82 | 추가: } | |
| 83 | 추가: // 성공한 open 계열 호출의 새 fd 소유권을 정확히 한 번 인수함. | |
| 84 | 추가: Ok(unsafe { File::from_raw_fd(fd as RawFd) }) | |
| 85 | 추가: } | |
| 86 | 추가: | |
| 87 | 추가: fn open2<E>( | |
| 88 | 추가: dir: RawFd, | |
| 89 | 추가: path: &CStr, | |
| 90 | 추가: flags: i32, | |
| 91 | 추가: resolve: u64, | |
| 92 | 추가: run: &mut Run<'_>, | |
| 93 | 추가: ) -> Result<File, Error<E>> { | |
| 94 | 추가: let how = OpenHow { | |
| 95 | 추가: flags: flags as u64, | |
| 96 | 추가: mode: 0, | |
| 97 | 추가: resolve, | |
| 98 | 추가: }; | |
| 99 | 추가: run.usage.open_calls += 1; | |
| 100 | 추가: // NUL 종료 경로와 초기화한 구조체를 호출 동안 유지함. | |
| 101 | 추가: let fd = unsafe { | |
| 102 | 추가: libc::syscall( | |
| 103 | 추가: libc::SYS_openat2, | |
| 104 | 추가: dir, | |
| 105 | 추가: path.as_ptr(), | |
| 106 | 추가: &how as *const OpenHow, | |
| 107 | 추가: std::mem::size_of::<OpenHow>(), | |
| 108 | 추가: ) | |
| 109 | 추가: }; | |
| 110 | 추가: opened(fd, "openat2") | |
| 111 | 추가: } | |
| 112 | 추가: | |
| 113 | 추가: fn metadata<E>(file: &File, run: &mut Run<'_>) -> Result<Metadata, Error<E>> { | |
| 114 | 추가: run.usage.metadata_calls += 1; | |
| 115 | 추가: file.metadata().map_err(|error| io_error("fstat", error)) | |
| 116 | 추가: } | |
| 117 | 추가: | |
| 118 | 추가: fn filesystem<E>(file: &File, run: &mut Run<'_>) -> Result<u64, Error<E>> { | |
| 119 | 추가: let mut value = MaybeUninit::<libc::statfs>::uninit(); | |
| 120 | 추가: run.usage.metadata_calls += 1; | |
| 121 | 추가: // 성공한 fstatfs만 초기화된 구조체로 읽음. | |
| 122 | 추가: if unsafe { libc::fstatfs(file.as_raw_fd(), value.as_mut_ptr()) } != 0 { | |
| 123 | 추가: return Err(io_error("fstatfs", io::Error::last_os_error())); | |
| 124 | 추가: } | |
| 125 | 추가: Ok(unsafe { value.assume_init() }.f_type as u64) | |
| 126 | 추가: } | |
| 127 | 추가: | |
| 128 | 추가: fn identity(value: &Metadata) -> Identity { | |
| 129 | 추가: Identity { | |
| 130 | 추가: device: value.dev(), | |
| 131 | 추가: inode: value.ino(), | |
| 132 | 추가: } | |
| 133 | 추가: } | |
| 134 | 추가: | |
| 135 | 추가: fn paths<E>(request: &Request<'_>) -> Result<(CString, CString), Error<E>> { | |
| 136 | 추가: let parent = request.parent.as_os_str().as_bytes(); | |
| 137 | 추가: let leaf = request.leaf.as_bytes(); | |
| 138 | 추가: if parent.first() != Some(&b'/') | |
| 139 | 추가: || parent.len() > 4095 | |
| 140 | 추가: || (parent != b"/" | |
| 141 | 추가: && parent[1..] | |
| 142 | 추가: .split(|v| *v == b'/') | |
| 143 | 추가: .any(|v| v.is_empty() || v == b"." || v == b"..")) | |
| 144 | 추가: || leaf.is_empty() | |
| 145 | 추가: || leaf.len() > 255 | |
| 146 | 추가: || leaf == b"." | |
| 147 | 추가: || leaf == b".." | |
| 148 | 추가: || leaf.contains(&b'/') | |
| 149 | 추가: { | |
| 150 | 추가: return Err(Error::InvalidPath); | |
| 151 | 추가: } | |
| 152 | 추가: Ok(( | |
| 153 | 추가: CString::new(parent).map_err(|_| Error::InvalidPath)?, | |
| 154 | 추가: CString::new(leaf).map_err(|_| Error::InvalidPath)?, | |
| 155 | 추가: )) | |
| 156 | 추가: } | |
| 157 | 추가: | |
| 158 | 추가: fn perform<E>( | |
| 159 | 추가: request: Request<'_>, | |
| 160 | 추가: run: &mut Run<'_>, | |
| 161 | 추가: callback: &mut impl FnMut(Checkpoint) -> Result<(), Stop<E>>, | |
| 162 | 추가: handles: &mut Handles, | |
| 163 | 추가: ) -> Result<Outcome<E>, Error<E>> { | |
| 164 | 추가: let (parent_path, leaf) = paths(&request)?; | |
| 165 | 추가: run.check(Stage::Opening, 0, callback)?; | |
| 166 | 추가: handles.parent = Some(open2( | |
| 167 | 추가: libc::AT_FDCWD, | |
| 168 | 추가: &parent_path, | |
| 169 | 추가: libc::O_RDONLY | libc::O_DIRECTORY | libc::O_CLOEXEC | libc::O_NONBLOCK | libc::O_NOCTTY, | |
| 170 | 추가: NO_SYMLINKS, | |
| 171 | 추가: run, | |
| 172 | 추가: )?); | |
| 173 | 추가: let parent = handles.parent.as_ref().expect("owned parent"); | |
| 174 | 추가: let parent_meta = metadata(parent, run)?; | |
| 175 | 추가: // 유효 UID를 읽을 뿐 권한이나 신원을 변경하지 않음. | |
| 176 | 추가: let uid = unsafe { libc::geteuid() }; | |
| 177 | 추가: if !parent_meta.is_dir() || parent_meta.uid() != uid || parent_meta.mode() & 0o022 != 0 { | |
| 178 | 추가: return Err(Error::UntrustedParent); | |
| 179 | 추가: } | |
| 180 | 추가: match filesystem(parent, run)? { | |
| 181 | 추가: 0xef53 | 0x58465342 => {} | |
| 182 | 추가: _ => return Err(Error::UnsupportedFilesystem), | |
| 183 | 추가: } | |
| 184 | 추가: run.check(Stage::Opening, 0, callback)?; | |
| 185 | 추가: run.usage.open_calls += 1; | |
| 186 | 추가: // 고정 부모 아래 이름 없는 파일을 만들며 O_EXCL을 사용하지 않음. | |
| 187 | 추가: handles.temp = Some(opened( | |
| 188 | 추가: unsafe { | |
| 189 | 추가: libc::openat( | |
| 190 | 추가: parent.as_raw_fd(), | |
| 191 | 추가: c".".as_ptr(), | |
| 192 | 추가: libc::O_TMPFILE | libc::O_RDWR | libc::O_CLOEXEC, | |
| 193 | 추가: 0o600 as libc::mode_t, | |
| 194 | 추가: ) | |
| 195 | 추가: } as libc::c_long, | |
| 196 | 추가: "openat_tmpfile", | |
| 197 | 추가: )?); | |
| 198 | 추가: let temp = handles.temp.as_mut().expect("owned temporary file"); | |
| 199 | 추가: let initial = metadata(temp, run)?; | |
| 200 | 추가: if !initial.is_file() | |
| 201 | 추가: || initial.nlink() != 0 | |
| 202 | 추가: || initial.uid() != uid | |
| 203 | 추가: || initial.dev() != parent_meta.dev() | |
| 204 | 추가: { | |
| 205 | 추가: return Err(Error::InvalidTemporaryFile); | |
| 206 | 추가: } | |
| 207 | 추가: let mut offset = 0; | |
| 208 | 추가: while offset < request.bytes.len() { | |
| 209 | 추가: run.check(Stage::Writing, offset, callback)?; | |
| 210 | 추가: let end = (offset + CHUNK_BYTES).min(request.bytes.len()); | |
| 211 | 추가: run.reserve(end - offset, true)?; | |
| 212 | 추가: // 읽기 전용 입력 슬라이스의 유효 범위만 커널에 전달함. | |
| 213 | 추가: let result = unsafe { | |
| 214 | 추가: libc::write( | |
| 215 | 추가: temp.as_raw_fd(), | |
| 216 | 추가: request.bytes[offset..end].as_ptr().cast(), | |
| 217 | 추가: end - offset, | |
| 218 | 추가: ) | |
| 219 | 추가: }; | |
| 220 | 추가: if result < 0 { | |
| 221 | 추가: return Err(io_error("write", io::Error::last_os_error())); | |
| 222 | 추가: } | |
| 223 | 추가: let count = result as usize; | |
| 224 | 추가: run.usage.actual_written_bytes += count as u64; | |
| 225 | 추가: if count == 0 { | |
| 226 | 추가: return Err(io_error("write", io::Error::from(io::ErrorKind::WriteZero))); | |
| 227 | 추가: } | |
| 228 | 추가: offset += count; | |
| 229 | 추가: } | |
| 230 | 추가: run.check(Stage::Verifying, 0, callback)?; | |
| 231 | 추가: run.usage.sync_calls += 1; | |
| 232 | 추가: sync(temp).map_err(|error| io_error("fsync_file", error))?; | |
| 233 | 추가: // 소유한 임시 파일의 읽기 위치만 이동함. | |
| 234 | 추가: if unsafe { libc::lseek(temp.as_raw_fd(), 0, libc::SEEK_SET) } < 0 { | |
| 235 | 추가: return Err(io_error("lseek", io::Error::last_os_error())); | |
| 236 | 추가: } | |
| 237 | 추가: let mut scratch = [0_u8; CHUNK_BYTES]; | |
| 238 | 추가: offset = 0; | |
| 239 | 추가: while offset < request.bytes.len() { | |
| 240 | 추가: run.check(Stage::Verifying, offset, callback)?; | |
| 241 | 추가: let count = CHUNK_BYTES.min(request.bytes.len() - offset); | |
| 242 | 추가: run.reserve(count, false)?; | |
| 243 | 추가: let read = | |
| 244 | 추가: read_once(temp, &mut scratch[..count]).map_err(|error| io_error("read", error))?; | |
| 245 | 추가: run.usage.actual_read_bytes += read as u64; | |
| 246 | 추가: if read == 0 || scratch[..read] != request.bytes[offset..offset + read] { | |
| 247 | 추가: return Err(Error::VerificationMismatch); | |
| 248 | 추가: } | |
| 249 | 추가: offset += read; | |
| 250 | 추가: } | |
| 251 | 추가: run.check(Stage::Verifying, offset, callback)?; | |
| 252 | 추가: run.reserve(1, false)?; | |
| 253 | 추가: let extra = read_once(temp, &mut scratch[..1]).map_err(|error| io_error("read_eof", error))?; | |
| 254 | 추가: run.usage.actual_read_bytes += extra as u64; | |
| 255 | 추가: if extra != 0 { | |
| 256 | 추가: return Err(Error::VerificationMismatch); | |
| 257 | 추가: } | |
| 258 | 추가: let final_meta = metadata(temp, run)?; | |
| 259 | 추가: if identity(&final_meta) != identity(&initial) | |
| 260 | 추가: || !final_meta.is_file() | |
| 261 | 추가: || final_meta.nlink() != 0 | |
| 262 | 추가: || final_meta.len() != request.bytes.len() as u64 | |
| 263 | 추가: { | |
| 264 | 추가: return Err(Error::VerificationMismatch); | |
| 265 | 추가: } | |
| 266 | 추가: // procfs 연결 방식은 파일 계층용이며 worker 실행 우회가 아님. | |
| 267 | 추가: handles.proc_root = Some(open2( | |
| 268 | 추가: libc::AT_FDCWD, | |
| 269 | 추가: c"/proc", | |
| 270 | 추가: libc::O_PATH | libc::O_DIRECTORY | libc::O_CLOEXEC, | |
| 271 | 추가: NO_SYMLINKS, | |
| 272 | 추가: run, | |
| 273 | 추가: )?); | |
| 274 | 추가: let proc_root = handles.proc_root.as_ref().expect("owned proc root"); | |
| 275 | 추가: if filesystem(proc_root, run)? != 0x9fa0 { | |
| 276 | 추가: return Err(Error::UnsupportedFilesystem); | |
| 277 | 추가: } | |
| 278 | 추가: // 현재 프로세스의 숫자 경로를 사용해 self 심볼릭 링크를 피함. | |
| 279 | 추가: let pid = unsafe { libc::getpid() }; | |
| 280 | 추가: let proc_path = CString::new(format!("{pid}/fd")).map_err(|_| Error::InvalidPath)?; | |
| 281 | 추가: handles.proc_fds = Some(open2( | |
| 282 | 추가: proc_root.as_raw_fd(), | |
| 283 | 추가: &proc_path, | |
| 284 | 추가: libc::O_PATH | libc::O_DIRECTORY | libc::O_CLOEXEC, | |
| 285 | 추가: BENEATH | NO_SYMLINKS | NO_XDEV, | |
| 286 | 추가: run, | |
| 287 | 추가: )?); | |
| 288 | 추가: let proc_fds = handles.proc_fds.as_ref().expect("owned proc fd directory"); | |
| 289 | 추가: let fd_name = CString::new(temp.as_raw_fd().to_string()).map_err(|_| Error::InvalidPath)?; | |
| 290 | 추가: run.check(Stage::BeforeCommit, offset, callback)?; | |
| 291 | 추가: run.begin_commit()?; | |
| 292 | 추가: run.usage.link_calls += 1; | |
| 293 | 추가: // CAS 이후 callback 없이 소유 fd와 고정 부모 사이의 원자적 링크를 한 번 시도함. | |
| 294 | 추가: let linked = unsafe { | |
| 295 | 추가: libc::linkat( | |
| 296 | 추가: proc_fds.as_raw_fd(), | |
| 297 | 추가: fd_name.as_ptr(), | |
| 298 | 추가: parent.as_raw_fd(), | |
| 299 | 추가: leaf.as_ptr(), | |
| 300 | 추가: libc::AT_SYMLINK_FOLLOW, | |
| 301 | 추가: ) | |
| 302 | 추가: }; | |
| 303 | 추가: if linked != 0 { | |
| 304 | 추가: let source = io::Error::last_os_error(); | |
| 305 | 추가: if source.raw_os_error() == Some(libc::EEXIST) { | |
| 306 | 추가: return Err(io_error("linkat_conflict", source)); | |
| 307 | 추가: } | |
| 308 | 추가: return Ok(Outcome::CommitUncertain { source }); | |
| 309 | 추가: } | |
| 310 | 추가: let receipt = FileCommitReceipt { | |
| 311 | 추가: parent: identity(&parent_meta), | |
| 312 | 추가: file: identity(&initial), | |
| 313 | 추가: length: run.length, | |
| 314 | 추가: }; | |
| 315 | 추가: run.usage.sync_calls += 1; | |
| 316 | 추가: let durability = match sync(parent) { | |
| 317 | 추가: Ok(()) => Durability::FileAndParentSynced, | |
| 318 | 추가: Err(error) => Durability::ParentSyncFailed(error), | |
| 319 | 추가: }; | |
| 320 | 추가: Ok(Outcome::Committed { | |
| 321 | 추가: receipt, | |
| 322 | 추가: durability, | |
| 323 | 추가: }) | |
| 324 | 추가: } | |
| 325 | 추가: | |
| 326 | 추가: fn read_once(file: &File, buffer: &mut [u8]) -> io::Result<usize> { | |
| 327 | 추가: // 독점 대여한 버퍼의 길이 안에서만 읽으며 EINTR도 원형으로 반환함. | |
| 328 | 추가: let result = unsafe { libc::read(file.as_raw_fd(), buffer.as_mut_ptr().cast(), buffer.len()) }; | |
| 329 | 추가: if result < 0 { | |
| 330 | 추가: Err(io::Error::last_os_error()) | |
| 331 | 추가: } else { | |
| 332 | 추가: Ok(result as usize) | |
| 333 | 추가: } | |
| 334 | 추가: } | |
| 335 | 추가: | |
| 336 | 추가: fn sync(file: &File) -> io::Result<()> { | |
| 337 | 추가: // 소유 fd에 한 번만 fsync를 호출함. | |
| 338 | 추가: if unsafe { libc::fsync(file.as_raw_fd()) } == 0 { | |
| 339 | 추가: Ok(()) | |
| 340 | 추가: } else { | |
| 341 | 추가: Err(io::Error::last_os_error()) | |
| 342 | 추가: } | |
| 343 | 추가: } |
| @@ -0,0 +1,54 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "kind": "author source/static only", | |
| 3 | 추가: "commands": [ | |
| 4 | 추가: { | |
| 5 | 추가: "command": [ | |
| 6 | 추가: "rustfmt", | |
| 7 | 추가: "+1.99.1", | |
| 8 | 추가: "--edition", | |
| 9 | 추가: "2024", | |
| 10 | 추가: "experiments/rust-file-publication/src/lib.rs", | |
| 11 | 추가: "experiments/rust-file-publication/src/linux.rs" | |
| 12 | 추가: ], | |
| 13 | 추가: "exit_code": 0, | |
| 14 | 추가: "stdout_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | |
| 15 | 추가: "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | |
| 16 | 추가: }, | |
| 17 | 추가: { | |
| 18 | 추가: "command": [ | |
| 19 | 추가: "rustfmt", | |
| 20 | 추가: "+1.99.1", | |
| 21 | 추가: "--edition", | |
| 22 | 추가: "2024", | |
| 23 | 추가: "--check", | |
| 24 | 추가: "experiments/rust-file-publication/src/lib.rs", | |
| 25 | 추가: "experiments/rust-file-publication/src/linux.rs" | |
| 26 | 추가: ], | |
| 27 | 추가: "exit_code": 0, | |
| 28 | 추가: "stdout_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | |
| 29 | 추가: "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | |
| 30 | 추가: }, | |
| 31 | 추가: { | |
| 32 | 추가: "command": [ | |
| 33 | 추가: "cargo", | |
| 34 | 추가: "+1.99.1", | |
| 35 | 추가: "metadata", | |
| 36 | 추가: "--locked", | |
| 37 | 추가: "--offline", | |
| 38 | 추가: "--format-version", | |
| 39 | 추가: "1", | |
| 40 | 추가: "--manifest-path", | |
| 41 | 추가: "experiments/rust-file-publication/Cargo.toml" | |
| 42 | 추가: ], | |
| 43 | 추가: "exit_code": 0, | |
| 44 | 추가: "stdout_sha256": "22874e27b6910977181b21cc2fba7547531ae3ca782c86bab5dacd7f5017081b", | |
| 45 | 추가: "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | |
| 46 | 추가: } | |
| 47 | 추가: ], | |
| 48 | 추가: "structural_checks": "passed; syntax/shape assertions, not typecheck or runtime evidence", | |
| 49 | 추가: "rust_compile": false, | |
| 50 | 추가: "publication_executed": false, | |
| 51 | 추가: "regression_execution": false, | |
| 52 | 추가: "dependency_archive_and_source_check": "libc 0.2.191 checksum and 452 cached regular files matched", | |
| 53 | 추가: "limits": "No current advisory audit or filesystem support verification" | |
| 54 | 추가: } |
| @@ -0,0 +1,123 @@ | ||
| 1 | 추가: # This file is automatically @generated by Cargo. | |
| 2 | 추가: # It is not intended for manual editing. | |
| 3 | 추가: version = 4 | |
| 4 | 추가: | |
| 5 | 추가: [[package]] | |
| 6 | 추가: name = "block-buffer" | |
| 7 | 추가: version = "0.10.4" | |
| 8 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 9 | 추가: checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" | |
| 10 | 추가: dependencies = [ | |
| 11 | 추가: "generic-array", | |
| 12 | 추가: ] | |
| 13 | 추가: | |
| 14 | 추가: [[package]] | |
| 15 | 추가: name = "cfg-if" | |
| 16 | 추가: version = "1.0.5" | |
| 17 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 18 | 추가: checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" | |
| 19 | 추가: | |
| 20 | 추가: [[package]] | |
| 21 | 추가: name = "cpufeatures" | |
| 22 | 추가: version = "0.2.17" | |
| 23 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 24 | 추가: checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" | |
| 25 | 추가: dependencies = [ | |
| 26 | 추가: "libc", | |
| 27 | 추가: ] | |
| 28 | 추가: | |
| 29 | 추가: [[package]] | |
| 30 | 추가: name = "crypto-common" | |
| 31 | 추가: version = "0.1.7" | |
| 32 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 33 | 추가: checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" | |
| 34 | 추가: dependencies = [ | |
| 35 | 추가: "generic-array", | |
| 36 | 추가: "typenum", | |
| 37 | 추가: ] | |
| 38 | 추가: | |
| 39 | 추가: [[package]] | |
| 40 | 추가: name = "digest" | |
| 41 | 추가: version = "0.10.7" | |
| 42 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 43 | 추가: checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" | |
| 44 | 추가: dependencies = [ | |
| 45 | 추가: "block-buffer", | |
| 46 | 추가: "crypto-common", | |
| 47 | 추가: ] | |
| 48 | 추가: | |
| 49 | 추가: [[package]] | |
| 50 | 추가: name = "generic-array" | |
| 51 | 추가: version = "0.14.7" | |
| 52 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 53 | 추가: checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" | |
| 54 | 추가: dependencies = [ | |
| 55 | 추가: "typenum", | |
| 56 | 추가: "version_check", | |
| 57 | 추가: ] | |
| 58 | 추가: | |
| 59 | 추가: [[package]] | |
| 60 | 추가: name = "libc" | |
| 61 | 추가: version = "0.2.191" | |
| 62 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 63 | 추가: checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" | |
| 64 | 추가: | |
| 65 | 추가: [[package]] | |
| 66 | 추가: name = "sha2" | |
| 67 | 추가: version = "0.10.9" | |
| 68 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 69 | 추가: checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" | |
| 70 | 추가: dependencies = [ | |
| 71 | 추가: "cfg-if", | |
| 72 | 추가: "cpufeatures", | |
| 73 | 추가: "digest", | |
| 74 | 추가: ] | |
| 75 | 추가: | |
| 76 | 추가: [[package]] | |
| 77 | 추가: name = "typenum" | |
| 78 | 추가: version = "1.20.1" | |
| 79 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 80 | 추가: checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" | |
| 81 | 추가: | |
| 82 | 추가: [[package]] | |
| 83 | 추가: name = "version_check" | |
| 84 | 추가: version = "0.9.5" | |
| 85 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 86 | 추가: checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" | |
| 87 | 추가: | |
| 88 | 추가: [[package]] | |
| 89 | 추가: name = "zipelo-file-publication" | |
| 90 | 추가: version = "0.1.0" | |
| 91 | 추가: dependencies = [ | |
| 92 | 추가: "libc", | |
| 93 | 추가: ] | |
| 94 | 추가: | |
| 95 | 추가: [[package]] | |
| 96 | 추가: name = "zipelo-file-snapshot" | |
| 97 | 추가: version = "0.1.0" | |
| 98 | 추가: dependencies = [ | |
| 99 | 추가: "libc", | |
| 100 | 추가: "sha2", | |
| 101 | 추가: ] | |
| 102 | 추가: | |
| 103 | 추가: [[package]] | |
| 104 | 추가: name = "zipelo-gzip-file-job" | |
| 105 | 추가: version = "0.1.0" | |
| 106 | 추가: dependencies = [ | |
| 107 | 추가: "zipelo-file-publication", | |
| 108 | 추가: "zipelo-file-snapshot", | |
| 109 | 추가: "zipelo-memory-gzip-reader", | |
| 110 | 추가: ] | |
| 111 | 추가: | |
| 112 | 추가: [[package]] | |
| 113 | 추가: name = "zipelo-memory-gzip-reader" | |
| 114 | 추가: version = "0.1.0" | |
| 115 | 추가: dependencies = [ | |
| 116 | 추가: "zlib-rs", | |
| 117 | 추가: ] | |
| 118 | 추가: | |
| 119 | 추가: [[package]] | |
| 120 | 추가: name = "zlib-rs" | |
| 121 | 추가: version = "0.6.8" | |
| 122 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 123 | 추가: checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" |
| @@ -0,0 +1,20 @@ | ||
| 1 | 추가: [package] | |
| 2 | 추가: name = "zipelo-gzip-file-job" | |
| 3 | 추가: version = "0.1.0" | |
| 4 | 추가: edition = "2024" | |
| 5 | 추가: rust-version = "1.99" | |
| 6 | 추가: license = "MIT" | |
| 7 | 추가: publish = false | |
| 8 | 추가: autotests = false | |
| 9 | 추가: autoexamples = false | |
| 10 | 추가: autobenches = false | |
| 11 | 추가: | |
| 12 | 추가: [lib] | |
| 13 | 추가: doctest = false | |
| 14 | 추가: | |
| 15 | 추가: [dependencies] | |
| 16 | 추가: zipelo-file-snapshot = { path = "../rust-file-snapshot", version = "=0.1.0" } | |
| 17 | 추가: zipelo-memory-gzip-reader = { path = "../rust-memory-gzip-reader", version = "=0.1.0" } | |
| 18 | 추가: zipelo-file-publication = { path = "../rust-file-publication", version = "=0.1.0" } | |
| 19 | 추가: | |
| 20 | 추가: [workspace] |
| @@ -0,0 +1,21 @@ | ||
| 1 | 추가: MIT License | |
| 2 | 추가: | |
| 3 | 추가: Copyright (c) 2026 Team-LJY contributors | |
| 4 | 추가: | |
| 5 | 추가: Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 6 | 추가: of this software and associated documentation files (the "Software"), to deal | |
| 7 | 추가: in the Software without restriction, including without limitation the rights | |
| 8 | 추가: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 9 | 추가: copies of the Software, and to permit persons to whom the Software is | |
| 10 | 추가: furnished to do so, subject to the following conditions: | |
| 11 | 추가: | |
| 12 | 추가: The above copyright notice and this permission notice shall be included in all | |
| 13 | 추가: copies or substantial portions of the Software. | |
| 14 | 추가: | |
| 15 | 추가: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 16 | 추가: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 17 | 추가: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 18 | 추가: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 19 | 추가: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 20 | 추가: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
| 21 | 추가: SOFTWARE. |
| @@ -0,0 +1,10 @@ | ||
| 1 | 추가: a7c66f4a02cbae817a7147ce4c08d0b9a53e0e94b38fc6e66352bbd9b7709629 Cargo.lock | |
| 2 | 추가: 0a994efa506a648fdad3615a944f1d78c83ef2f5a23a6b2420e5e9dfaeb5e65c Cargo.toml | |
| 3 | 추가: 0714945e52a4d5b560c02c9a18478519f8c4e2572cbf87bd6d52adcfb2b63c62 LICENSE | |
| 4 | 추가: 3e2e572d0aa960ae002b6cdf3fb68008323d1e50b014d6ae2d3adf1845e7a3c3 THIRD-PARTY-NOTICES.txt | |
| 5 | 추가: 2b617a3792b520c421d4ac8f6dd8e95de7425303a3d8b134200419a8de07ba45 contract.json | |
| 6 | 추가: 52cfbf2e1363b604dc52b1a343b8f76589e920b71f1ac7564a7e413a0d3fe40d dependencies.json | |
| 7 | 추가: 01d5b0afef63b979c04fdcc6e7077915f00982dbfc44e3cbc84899c619c5c7d9 source-pins.json | |
| 8 | 추가: dad3309af8706359c1c34e6e1f56d5eb5f4ddf7f101d81f4621bbf9772592b45 src/lib.rs | |
| 9 | 추가: 07f98df13fe48edeef5a23905a2cb9c1d257066e97c7d413cd06a754d44b7b4b src/types.rs | |
| 10 | 추가: 274a8fb2ea9991633856fdda6802044e409bffe325af09372fa18e85e684b10c static-validation.json |
Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기| @@ -0,0 +1,127 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "schema": 1, | |
| 3 | 추가: "package": "zipelo-gzip-file-job", | |
| 4 | 추가: "status": "source-static-only", | |
| 5 | 추가: "branch": "features/rust-gzip-file-job", | |
| 6 | 추가: "base_head": "f7fc8cbece281e2f9a6374b4640ca4dd9d321fbc", | |
| 7 | 추가: "imported_head": "1c16f1bffd79129dc1dbd4df4f5a3433f1ccbf65", | |
| 8 | 추가: "scope": [ | |
| 9 | 추가: "experiments/rust-gzip-file-job/" | |
| 10 | 추가: ], | |
| 11 | 추가: "preservation": { | |
| 12 | 추가: "main_blobs": 305, | |
| 13 | 추가: "pr51_blobs": 239, | |
| 14 | 추가: "union_blobs": 331, | |
| 15 | 추가: "conflicts": 0, | |
| 16 | 추가: "rule": "Keep every inherited blob and mode, including all original C# and Rust source/test files. Add 26 PR51-only files unchanged and the new adapter only. No deletion, rewrites, or unrelated evidence imports.", | |
| 17 | 추가: "source_pins": "source-pins.json" | |
| 18 | 추가: }, | |
| 19 | 추가: "api": { | |
| 20 | 추가: "entry": "FileJob::new() -> (FileJob, Cancellation); FileJob::run(self, Request<'_>, observer) -> Report<E>", | |
| 21 | 추가: "request": "Explicit input Path, output parent Path, single output OsStr leaf, and three native Limits. No archive-derived destination names, global path state, UI, CLI, server or public product entry point.", | |
| 22 | 추가: "sequence": [ | |
| 23 | 추가: "Call native snapshot::capture once. On failure return Outcome::SnapshotFailed with the original snapshot::Failure<E>, including original cause and usage.", | |
| 24 | 추가: "Retain private snapshot identity/SHA256 observations. Consume its owned Vec into a Box<[u8]> without reopening the source pathname.", | |
| 25 | 추가: "Construct one gzip::Budget and call gzip::read once with selected=true. Native single-member header, DEFLATE, CRC32, ISIZE and exact EOF validation must all return successfully before publication.", | |
| 26 | 추가: "Return original gzip::Error<E> on decode failure; preserve budget.usage() even when the final failed charge followed the last checkpoint.", | |
| 27 | 추가: "Require selected output and its length to match native boundary.inflated_bytes. Adapter invariant failures have their own typed variants and never call publication.", | |
| 28 | 추가: "Borrow precisely the validated owned output Vec to the original one-shot publication::Publication::publish. Return its entire native Report<E> unchanged." | |
| 29 | 추가: ], | |
| 30 | 추가: "outputs": [ | |
| 31 | 추가: "Outcome::SnapshotFailed(snapshot::Failure<E>)", | |
| 32 | 추가: "Outcome::DecodeFailed(gzip::Error<E>)", | |
| 33 | 추가: "Outcome::AdapterFailed(AdapterFailure)", | |
| 34 | 추가: "Outcome::Publication(publication::Report<E>)" | |
| 35 | 추가: ], | |
| 36 | 추가: "observations": "SnapshotObservation and GzipObservation have private fields and no public constructor/Default/Deserialize. They are in-process observations, not authorization tokens or worker evidence. Snapshot SHA256 covers compressed captured bytes; GZip boundary CRC32 is not an output cryptographic hash.", | |
| 37 | 추가: "callbacks": "Checkpoint { event: native Snapshot/Decode/Publication checkpoint, usage: three native cumulative counters }. Caller Stop::Callback(E) retains E without formatting/boxing or replacement by a later cancellation/deadline. Stop::Cancelled maps to the reached native stage's cancellation. No synthetic postcommit/final observer callback.", | |
| 38 | 추가: "receipts": "No product Published state or job-wide success boolean. Outcome::Publication can contain NotCommitted, CommitUncertain or Committed with native durability and cleanup kept separate. Native private file receipt proves only observed file-layer commit." | |
| 39 | 추가: }, | |
| 40 | 추가: "budgets": { | |
| 41 | 추가: "policy": "One consumed FileJob, one call per native stage, no retries, no refunds or resets within a stage. Preserve each original accounting algorithm and units. A future caller creating a new job must aggregate retries externally; this API does not implement a retry/shared cross-job budget.", | |
| 42 | 추가: "ledger": "Usage { snapshot: snapshot::Usage, gzip: gzip::Usage, publication: publication::Usage }. Zero counters for unreached stages; outcome and optional observations distinguish reach/completion. Each field is copied from the native final report or owned Budget after its stage, including failures; do not sum unlike counters.", | |
| 43 | 추가: "snapshot": { | |
| 44 | 추가: "payload_bytes": 16777216, | |
| 45 | 추가: "reserved_read_bytes": 134217728, | |
| 46 | 추가: "read_calls": 131072, | |
| 47 | 추가: "default_seconds": 30, | |
| 48 | 추가: "max_seconds": 300, | |
| 49 | 추가: "mechanism": "Native reserve-before-read through capture plus compare pass; actual and compared bytes remain separate." | |
| 50 | 추가: }, | |
| 51 | 추가: "gzip": { | |
| 52 | 추가: "input_bytes": 16777216, | |
| 53 | 추가: "processed_bytes": 134217728, | |
| 54 | 추가: "selected_output_bytes": 16777216, | |
| 55 | 추가: "metadata_bytes": 1048576, | |
| 56 | 추가: "default_seconds": 300, | |
| 57 | 추가: "max_seconds": 300, | |
| 58 | 추가: "mechanism": "Same owned native Budget across header, inflate, output, CRC/size/trailing checks. Existing clamp-to-hard-cap semantics remain unchanged; input size is per invocation." | |
| 59 | 추가: }, | |
| 60 | 추가: "publication": { | |
| 61 | 추가: "payload_bytes": 16777216, | |
| 62 | 추가: "reserved_io_bytes": 134217728, | |
| 63 | 추가: "io_calls": 131072, | |
| 64 | 추가: "default_seconds": 30, | |
| 65 | 추가: "max_seconds": 300, | |
| 66 | 추가: "mechanism": "Native write/read/EOF reservation and actual transfer counters, sync/link/close accounting unchanged." | |
| 67 | 추가: }, | |
| 68 | 추가: "memory": "At handoff, captured input is at most 16 MiB and selected output at most 16 MiB, plus native bounded scratch/backend allocations. No extra Vec clone; Vec::into_boxed_slice may shrink/reallocate through the standard infallible allocator. Native try_reserve failures remain typed; allocator abort/panic, callback allocations, kernel/filesystem memory and process RSS are not fully bounded.", | |
| 69 | 추가: "elapsed": "Native per-stage clock starts on entry to that stage. No single whole-job deadline or hard syscall/callback/allocator cutoff. Postcommit sync and close are never interrupted or relabelled by elapsed/cancellation. Defaults sum to 360 seconds of cooperative stage limits, not a hard wall-clock promise." | |
| 70 | 추가: }, | |
| 71 | 추가: "cancellation": { | |
| 72 | 추가: "identity": "Every FileJob owns the original one-shot Publication gate from construction. All Cancellation clones refer to that gate and one private AtomicBool.", | |
| 73 | 추가: "order": "Cancellation::request first calls the original native CAS decision. Only Requested/AlreadyRequested sets the front-stage accepted flag; original Requested/AlreadyRequested/TooLate/Finished is returned unchanged.", | |
| 74 | 추가: "early": "Snapshot/decode observers run first to preserve original callback cause, then poll accepted cancellation. A racing accepted request may propagate after another cooperative checkpoint; publication's native gate was already cancelled and cannot commit.", | |
| 75 | 추가: "commit": "Original Pending->Cancelled versus Pending->Committing CAS remains authoritative. No new observer runs after native begin_commit. TooLate or Finished does not set a new cancellation flag or rewrite native outcomes.", | |
| 76 | 추가: "termination": "Dropping an unused Publication marks its gate Finished per original API; this is not proof of rollback, file cleanup, worker exit or cancellation as the returned cause.", | |
| 77 | 추가: "observer_stop": "Observer Stop::Cancelled is a local native stage stop, not an extra call to Cancellation::request. Original callback errors can win over a simultaneously accepted cancellation." | |
| 78 | 추가: }, | |
| 79 | 추가: "filesystem": { | |
| 80 | 추가: "behavior": "Reuse frozen Linux snapshot and single-file publication as implemented. Parent dirfd, O_TMPFILE, procfs linkat no-clobber, trusted parent and ext-family/XFS checks remain native. No weak fallback or overwrite.", | |
| 81 | 추가: "names": "Caller chooses explicit parent/leaf. GZip FNAME/FCOMMENT is never interpreted as a path, extension, command, or output name.", | |
| 82 | 추가: "uncertainty": "All native non-EEXIST link failures remain CommitUncertain; no automatic retry, unlink, rollback or claim that the target is absent. Successful link with failed parent sync remains Committed with ParentSyncFailed. Every original close failure remains in Cleanup.", | |
| 83 | 추가: "limits": "No original pathname persistence, coherent/atomic input snapshot, inotify history, output contents hash, durable physical deletion or crash-recovery proof.", | |
| 84 | 추가: "other_os": "No Windows implementation or substitute adapter. Reached native unsupported-platform errors are preserved." | |
| 85 | 추가: }, | |
| 86 | 추가: "dependencies": { | |
| 87 | 추가: "local": [ | |
| 88 | 추가: "../rust-file-snapshot", | |
| 89 | 추가: "../rust-memory-gzip-reader", | |
| 90 | 추가: "../rust-file-publication" | |
| 91 | 추가: ], | |
| 92 | 추가: "external": "Exactly the 11 existing locked registry packages; selected native features unchanged, no new registry version, process launcher, async runtime, UI or network dependency.", | |
| 93 | 추가: "ownership": "No inherited Cargo.toml, Cargo.lock, API, shared type or production source changed.", | |
| 94 | 추가: "audit": "Cache archive/SHA256 and 661 regular source files plus license bytes checked. Current advisory audit not performed; no vulnerability-free claim." | |
| 95 | 추가: }, | |
| 96 | 추가: "execution_boundary": { | |
| 97 | 추가: "completed": [ | |
| 98 | 추가: "Rustfmt syntax/format check on new source only", | |
| 99 | 추가: "Cargo 1.99.1 generate-lockfile --offline", | |
| 100 | 추가: "Cargo 1.99.1 metadata --locked --offline", | |
| 101 | 추가: "Inherited blob/mode/SHA256 comparison", | |
| 102 | 추가: "Dependency cache/hash/license comparison", | |
| 103 | 추가: "Read-only source/control-flow review" | |
| 104 | 추가: ], | |
| 105 | 추가: "not_completed": [ | |
| 106 | 추가: "Rust type checking", | |
| 107 | 추가: "Rust compilation or test discovery", | |
| 108 | 추가: "New module execution or end-to-end regression", | |
| 109 | 추가: "User file processing", | |
| 110 | 추가: "OS worker or sandbox isolation", | |
| 111 | 추가: "Product UI/Published integration", | |
| 112 | 추가: "Windows/Ubuntu 24.04 validation" | |
| 113 | 추가: ], | |
| 114 | 추가: "future_review": "Fix this source/manifest/remote head before separate compile/run authorization. Regression code belongs only in root tests/. Existing parent test evidence is not a run of this adapter.", | |
| 115 | 추가: "exclusions": [ | |
| 116 | 추가: "Folder extraction", | |
| 117 | 추가: "New format support", | |
| 118 | 추가: "Automatic repair", | |
| 119 | 추가: "Password handling", | |
| 120 | 추가: "Old-source edits", | |
| 121 | 추가: "GUI/VM", | |
| 122 | 추가: "Held memfd/execveat probes", | |
| 123 | 추가: "Publishing/releasing the product", | |
| 124 | 추가: "Main merge" | |
| 125 | 추가: ] | |
| 126 | 추가: } | |
| 127 | 추가: } |
| @@ -0,0 +1,231 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "schema": 1, | |
| 3 | 추가: "local_path_dependencies": [ | |
| 4 | 추가: "zipelo-file-snapshot 0.1.0", | |
| 5 | 추가: "zipelo-memory-gzip-reader 0.1.0", | |
| 6 | 추가: "zipelo-file-publication 0.1.0" | |
| 7 | 추가: ], | |
| 8 | 추가: "registry_packages": [ | |
| 9 | 추가: { | |
| 10 | 추가: "name": "block-buffer", | |
| 11 | 추가: "version": "0.10.4", | |
| 12 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 13 | 추가: "checksum": "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71", | |
| 14 | 추가: "dependencies": [ | |
| 15 | 추가: "generic-array" | |
| 16 | 추가: ], | |
| 17 | 추가: "cached_archive_and_source_verified": true, | |
| 18 | 추가: "regular_source_files_compared": 10, | |
| 19 | 추가: "license_files": [ | |
| 20 | 추가: { | |
| 21 | 추가: "path": "LICENSE-APACHE", | |
| 22 | 추가: "sha256": "a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5" | |
| 23 | 추가: }, | |
| 24 | 추가: { | |
| 25 | 추가: "path": "LICENSE-MIT", | |
| 26 | 추가: "sha256": "d5c22aa3118d240e877ad41c5d9fa232f9c77d757d4aac0c2f943afc0a95e0ef" | |
| 27 | 추가: } | |
| 28 | 추가: ] | |
| 29 | 추가: }, | |
| 30 | 추가: { | |
| 31 | 추가: "name": "cfg-if", | |
| 32 | 추가: "version": "1.0.5", | |
| 33 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 34 | 추가: "checksum": "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600", | |
| 35 | 추가: "cached_archive_and_source_verified": true, | |
| 36 | 추가: "regular_source_files_compared": 14, | |
| 37 | 추가: "license_files": [ | |
| 38 | 추가: { | |
| 39 | 추가: "path": "LICENSE-APACHE", | |
| 40 | 추가: "sha256": "a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2" | |
| 41 | 추가: }, | |
| 42 | 추가: { | |
| 43 | 추가: "path": "LICENSE-MIT", | |
| 44 | 추가: "sha256": "378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397" | |
| 45 | 추가: } | |
| 46 | 추가: ] | |
| 47 | 추가: }, | |
| 48 | 추가: { | |
| 49 | 추가: "name": "cpufeatures", | |
| 50 | 추가: "version": "0.2.17", | |
| 51 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 52 | 추가: "checksum": "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280", | |
| 53 | 추가: "dependencies": [ | |
| 54 | 추가: "libc" | |
| 55 | 추가: ], | |
| 56 | 추가: "cached_archive_and_source_verified": true, | |
| 57 | 추가: "regular_source_files_compared": 16, | |
| 58 | 추가: "license_files": [ | |
| 59 | 추가: { | |
| 60 | 추가: "path": "LICENSE-APACHE", | |
| 61 | 추가: "sha256": "a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5" | |
| 62 | 추가: }, | |
| 63 | 추가: { | |
| 64 | 추가: "path": "LICENSE-MIT", | |
| 65 | 추가: "sha256": "ae9baa7beea910273c2f384c2a6b721fb7bd02bda3436074a1072e4ee689f985" | |
| 66 | 추가: } | |
| 67 | 추가: ] | |
| 68 | 추가: }, | |
| 69 | 추가: { | |
| 70 | 추가: "name": "crypto-common", | |
| 71 | 추가: "version": "0.1.7", | |
| 72 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 73 | 추가: "checksum": "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a", | |
| 74 | 추가: "dependencies": [ | |
| 75 | 추가: "generic-array", | |
| 76 | 추가: "typenum" | |
| 77 | 추가: ], | |
| 78 | 추가: "cached_archive_and_source_verified": true, | |
| 79 | 추가: "regular_source_files_compared": 9, | |
| 80 | 추가: "license_files": [ | |
| 81 | 추가: { | |
| 82 | 추가: "path": "LICENSE-APACHE", | |
| 83 | 추가: "sha256": "a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5" | |
| 84 | 추가: }, | |
| 85 | 추가: { | |
| 86 | 추가: "path": "LICENSE-MIT", | |
| 87 | 추가: "sha256": "3521672491a3479422d5fe1aca6645dd2984090f85da6e5205abfb18fb7a6897" | |
| 88 | 추가: } | |
| 89 | 추가: ] | |
| 90 | 추가: }, | |
| 91 | 추가: { | |
| 92 | 추가: "name": "digest", | |
| 93 | 추가: "version": "0.10.7", | |
| 94 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 95 | 추가: "checksum": "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292", | |
| 96 | 추가: "dependencies": [ | |
| 97 | 추가: "block-buffer", | |
| 98 | 추가: "crypto-common" | |
| 99 | 추가: ], | |
| 100 | 추가: "cached_archive_and_source_verified": true, | |
| 101 | 추가: "regular_source_files_compared": 21, | |
| 102 | 추가: "license_files": [ | |
| 103 | 추가: { | |
| 104 | 추가: "path": "LICENSE-APACHE", | |
| 105 | 추가: "sha256": "a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5" | |
| 106 | 추가: }, | |
| 107 | 추가: { | |
| 108 | 추가: "path": "LICENSE-MIT", | |
| 109 | 추가: "sha256": "9e0dfd2dd4173a530e238cb6adb37aa78c34c6bc7444e0e10c1ab5d8881f63ba" | |
| 110 | 추가: } | |
| 111 | 추가: ] | |
| 112 | 추가: }, | |
| 113 | 추가: { | |
| 114 | 추가: "name": "generic-array", | |
| 115 | 추가: "version": "0.14.7", | |
| 116 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 117 | 추가: "checksum": "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a", | |
| 118 | 추가: "dependencies": [ | |
| 119 | 추가: "typenum", | |
| 120 | 추가: "version_check" | |
| 121 | 추가: ], | |
| 122 | 추가: "cached_archive_and_source_verified": true, | |
| 123 | 추가: "regular_source_files_compared": 16, | |
| 124 | 추가: "license_files": [ | |
| 125 | 추가: { | |
| 126 | 추가: "path": "LICENSE", | |
| 127 | 추가: "sha256": "c09aae9d3c77b531f56351a9947bc7446511d6b025b3255312d3e3442a9a7583" | |
| 128 | 추가: } | |
| 129 | 추가: ] | |
| 130 | 추가: }, | |
| 131 | 추가: { | |
| 132 | 추가: "name": "libc", | |
| 133 | 추가: "version": "0.2.191", | |
| 134 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 135 | 추가: "checksum": "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a", | |
| 136 | 추가: "cached_archive_and_source_verified": true, | |
| 137 | 추가: "regular_source_files_compared": 452, | |
| 138 | 추가: "license_files": [ | |
| 139 | 추가: { | |
| 140 | 추가: "path": "LICENSE-APACHE", | |
| 141 | 추가: "sha256": "62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a" | |
| 142 | 추가: }, | |
| 143 | 추가: { | |
| 144 | 추가: "path": "LICENSE-MIT", | |
| 145 | 추가: "sha256": "123a331b5dbf04c30097fa43b8f858bc85df671fe776de498d01f3d6b7c1f69e" | |
| 146 | 추가: } | |
| 147 | 추가: ] | |
| 148 | 추가: }, | |
| 149 | 추가: { | |
| 150 | 추가: "name": "sha2", | |
| 151 | 추가: "version": "0.10.9", | |
| 152 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 153 | 추가: "checksum": "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283", | |
| 154 | 추가: "dependencies": [ | |
| 155 | 추가: "cfg-if", | |
| 156 | 추가: "cpufeatures", | |
| 157 | 추가: "digest" | |
| 158 | 추가: ], | |
| 159 | 추가: "cached_archive_and_source_verified": true, | |
| 160 | 추가: "regular_source_files_compared": 31, | |
| 161 | 추가: "license_files": [ | |
| 162 | 추가: { | |
| 163 | 추가: "path": "LICENSE-APACHE", | |
| 164 | 추가: "sha256": "a9040321c3712d8fd0b09cf52b17445de04a23a10165049ae187cd39e5c86be5" | |
| 165 | 추가: }, | |
| 166 | 추가: { | |
| 167 | 추가: "path": "LICENSE-MIT", | |
| 168 | 추가: "sha256": "b4eb00df6e2a4d22518fcaa6a2b4646f249b3a3c9814509b22bd2091f1392ff1" | |
| 169 | 추가: } | |
| 170 | 추가: ] | |
| 171 | 추가: }, | |
| 172 | 추가: { | |
| 173 | 추가: "name": "typenum", | |
| 174 | 추가: "version": "1.20.1", | |
| 175 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 176 | 추가: "checksum": "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20", | |
| 177 | 추가: "cached_archive_and_source_verified": true, | |
| 178 | 추가: "regular_source_files_compared": 26, | |
| 179 | 추가: "license_files": [ | |
| 180 | 추가: { | |
| 181 | 추가: "path": "LICENSE", | |
| 182 | 추가: "sha256": "db11fec9946737df39ca3898d9cd8c10ec6f6c3a884a6802b0ad0b81b4e8f23a" | |
| 183 | 추가: }, | |
| 184 | 추가: { | |
| 185 | 추가: "path": "LICENSE-APACHE", | |
| 186 | 추가: "sha256": "516b24e051bf5630880ebbd55c40a25ce9552ebaf8970a53e8976eb70e522406" | |
| 187 | 추가: }, | |
| 188 | 추가: { | |
| 189 | 추가: "path": "LICENSE-MIT", | |
| 190 | 추가: "sha256": "a825bd853ab71619a4923d7b4311221427848070ff44d990da39b0b274c1683f" | |
| 191 | 추가: } | |
| 192 | 추가: ] | |
| 193 | 추가: }, | |
| 194 | 추가: { | |
| 195 | 추가: "name": "version_check", | |
| 196 | 추가: "version": "0.9.5", | |
| 197 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 198 | 추가: "checksum": "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a", | |
| 199 | 추가: "cached_archive_and_source_verified": true, | |
| 200 | 추가: "regular_source_files_compared": 13, | |
| 201 | 추가: "license_files": [ | |
| 202 | 추가: { | |
| 203 | 추가: "path": "LICENSE-APACHE", | |
| 204 | 추가: "sha256": "a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2" | |
| 205 | 추가: }, | |
| 206 | 추가: { | |
| 207 | 추가: "path": "LICENSE-MIT", | |
| 208 | 추가: "sha256": "b7e650f3fce5c53249d1cdc608b54df156a97edd636cf9d23498d0cfe7aec63e" | |
| 209 | 추가: } | |
| 210 | 추가: ] | |
| 211 | 추가: }, | |
| 212 | 추가: { | |
| 213 | 추가: "name": "zlib-rs", | |
| 214 | 추가: "version": "0.6.8", | |
| 215 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index", | |
| 216 | 추가: "checksum": "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112", | |
| 217 | 추가: "cached_archive_and_source_verified": true, | |
| 218 | 추가: "regular_source_files_compared": 53, | |
| 219 | 추가: "license_files": [ | |
| 220 | 추가: { | |
| 221 | 추가: "path": "LICENSE", | |
| 222 | 추가: "sha256": "e72111c52b7d96ebe25348dee19f0744f444d3c95ae6b1ecb6ccaecc5bce05ba" | |
| 223 | 추가: } | |
| 224 | 추가: ] | |
| 225 | 추가: } | |
| 226 | 추가: ], | |
| 227 | 추가: "new_external_versions": false, | |
| 228 | 추가: "feature_policy": "Existing sha2 std+force-soft, libc std (Linux), zlib-rs rust-allocator; no feature expansion", | |
| 229 | 추가: "network_restore": false, | |
| 230 | 추가: "advisories": "Current advisory audit not performed; source/hash/license verification only" | |
| 231 | 추가: } |
Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기| @@ -0,0 +1,212 @@ | ||
| 1 | 추가: #![forbid(unsafe_code)] | |
| 2 | 추가: | |
| 3 | 추가: //! 개발용 단일 GZip 파일 작업을 순서대로 연결함. | |
| 4 | 추가: //! OS worker 격리나 제품 게시 완료를 증명하지 않음. | |
| 5 | 추가: | |
| 6 | 추가: mod types; | |
| 7 | 추가: pub use types::*; | |
| 8 | 추가: pub use zipelo_file_publication as publication; | |
| 9 | 추가: pub use zipelo_file_snapshot as snapshot; | |
| 10 | 추가: pub use zipelo_memory_gzip_reader as gzip; | |
| 11 | 추가: | |
| 12 | 추가: use std::sync::{ | |
| 13 | 추가: Arc, | |
| 14 | 추가: atomic::{AtomicBool, Ordering}, | |
| 15 | 추가: }; | |
| 16 | 추가: | |
| 17 | 추가: // native commit gate를 먼저 결정하고 앞 단계의 협력적 취소에 전달함. | |
| 18 | 추가: #[derive(Clone)] | |
| 19 | 추가: pub struct Cancellation { | |
| 20 | 추가: native: publication::Cancellation, | |
| 21 | 추가: accepted: Arc<AtomicBool>, | |
| 22 | 추가: } | |
| 23 | 추가: | |
| 24 | 추가: impl Cancellation { | |
| 25 | 추가: pub fn request(&self) -> publication::CancelDecision { | |
| 26 | 추가: let decision = self.native.request(); | |
| 27 | 추가: if matches!( | |
| 28 | 추가: decision, | |
| 29 | 추가: publication::CancelDecision::Requested | publication::CancelDecision::AlreadyRequested | |
| 30 | 추가: ) { | |
| 31 | 추가: self.accepted.store(true, Ordering::SeqCst); | |
| 32 | 추가: } | |
| 33 | 추가: decision | |
| 34 | 추가: } | |
| 35 | 추가: | |
| 36 | 추가: fn observe<E>( | |
| 37 | 추가: &self, | |
| 38 | 추가: checkpoint: Checkpoint, | |
| 39 | 추가: observer: &mut impl FnMut(Checkpoint) -> Result<(), Stop<E>>, | |
| 40 | 추가: ) -> Result<(), Stop<E>> { | |
| 41 | 추가: // callback 원인을 취소 확인보다 먼저 보존함. | |
| 42 | 추가: observer(checkpoint)?; | |
| 43 | 추가: if self.accepted.load(Ordering::SeqCst) { | |
| 44 | 추가: return Err(Stop::Cancelled); | |
| 45 | 추가: } | |
| 46 | 추가: Ok(()) | |
| 47 | 추가: } | |
| 48 | 추가: } | |
| 49 | 추가: | |
| 50 | 추가: pub struct FileJob { | |
| 51 | 추가: publication: publication::Publication, | |
| 52 | 추가: cancellation: Cancellation, | |
| 53 | 추가: } | |
| 54 | 추가: | |
| 55 | 추가: impl FileJob { | |
| 56 | 추가: pub fn new() -> (Self, Cancellation) { | |
| 57 | 추가: let (publication, native) = publication::Publication::new(); | |
| 58 | 추가: let cancellation = Cancellation { | |
| 59 | 추가: native, | |
| 60 | 추가: accepted: Arc::new(AtomicBool::new(false)), | |
| 61 | 추가: }; | |
| 62 | 추가: ( | |
| 63 | 추가: Self { | |
| 64 | 추가: publication, | |
| 65 | 추가: cancellation: cancellation.clone(), | |
| 66 | 추가: }, | |
| 67 | 추가: cancellation, | |
| 68 | 추가: ) | |
| 69 | 추가: } | |
| 70 | 추가: | |
| 71 | 추가: // 한 번 소비하며 실패와 불명확한 게시를 자동 재시도하지 않음. | |
| 72 | 추가: pub fn run<E>( | |
| 73 | 추가: self, | |
| 74 | 추가: request: Request<'_>, | |
| 75 | 추가: mut observer: impl FnMut(Checkpoint) -> Result<(), Stop<E>>, | |
| 76 | 추가: ) -> Report<E> { | |
| 77 | 추가: let mut usage = Usage::default(); | |
| 78 | 추가: let captured = snapshot::capture( | |
| 79 | 추가: snapshot::Request { | |
| 80 | 추가: path: request.input, | |
| 81 | 추가: limits: request.limits.snapshot, | |
| 82 | 추가: }, | |
| 83 | 추가: |checkpoint| { | |
| 84 | 추가: usage.snapshot = checkpoint.usage; | |
| 85 | 추가: self.cancellation | |
| 86 | 추가: .observe( | |
| 87 | 추가: Checkpoint { | |
| 88 | 추가: event: Event::Snapshot(checkpoint), | |
| 89 | 추가: usage, | |
| 90 | 추가: }, | |
| 91 | 추가: &mut observer, | |
| 92 | 추가: ) | |
| 93 | 추가: .map_err(|stop| match stop { | |
| 94 | 추가: Stop::Cancelled => snapshot::Stop::Cancelled, | |
| 95 | 추가: Stop::Callback(error) => snapshot::Stop::Callback(error), | |
| 96 | 추가: }) | |
| 97 | 추가: }, | |
| 98 | 추가: ); | |
| 99 | 추가: let captured = match captured { | |
| 100 | 추가: Ok(value) => value, | |
| 101 | 추가: Err(failure) => { | |
| 102 | 추가: usage.snapshot = failure.usage; | |
| 103 | 추가: return Report { | |
| 104 | 추가: outcome: Outcome::SnapshotFailed(failure), | |
| 105 | 추가: usage, | |
| 106 | 추가: snapshot: None, | |
| 107 | 추가: decoded: None, | |
| 108 | 추가: }; | |
| 109 | 추가: } | |
| 110 | 추가: }; | |
| 111 | 추가: usage.snapshot = captured.usage(); | |
| 112 | 추가: let source = SnapshotObservation::from_capture(&captured); | |
| 113 | 추가: let mut budget = match gzip::Budget::new(request.limits.gzip) { | |
| 114 | 추가: Ok(value) => value, | |
| 115 | 추가: Err(failure) => { | |
| 116 | 추가: return Report { | |
| 117 | 추가: outcome: Outcome::DecodeFailed(gzip::Error::Reader(failure)), | |
| 118 | 추가: usage, | |
| 119 | 추가: snapshot: Some(source), | |
| 120 | 추가: decoded: None, | |
| 121 | 추가: }; | |
| 122 | 추가: } | |
| 123 | 추가: }; | |
| 124 | 추가: // 검증된 snapshot의 소유 bytes만 넘기며 원래 pathname을 다시 열지 않음. | |
| 125 | 추가: let decoded = gzip::read( | |
| 126 | 추가: gzip::Request { | |
| 127 | 추가: input: captured.into_bytes().into_boxed_slice(), | |
| 128 | 추가: selected: true, | |
| 129 | 추가: }, | |
| 130 | 추가: &mut budget, | |
| 131 | 추가: |checkpoint| { | |
| 132 | 추가: usage.gzip = checkpoint.usage; | |
| 133 | 추가: self.cancellation | |
| 134 | 추가: .observe( | |
| 135 | 추가: Checkpoint { | |
| 136 | 추가: event: Event::Decode(checkpoint), | |
| 137 | 추가: usage, | |
| 138 | 추가: }, | |
| 139 | 추가: &mut observer, | |
| 140 | 추가: ) | |
| 141 | 추가: .map_err(|stop| match stop { | |
| 142 | 추가: Stop::Cancelled => gzip::Stop::Cancelled, | |
| 143 | 추가: Stop::Callback(error) => gzip::Stop::Callback(error), | |
| 144 | 추가: }) | |
| 145 | 추가: }, | |
| 146 | 추가: ); | |
| 147 | 추가: // 마지막 checkpoint 뒤의 실패 과금도 원래 Budget에서 회수함. | |
| 148 | 추가: usage.gzip = budget.usage(); | |
| 149 | 추가: let decoded = match decoded { | |
| 150 | 추가: Ok(value) => value, | |
| 151 | 추가: Err(error) => { | |
| 152 | 추가: return Report { | |
| 153 | 추가: outcome: Outcome::DecodeFailed(error), | |
| 154 | 추가: usage, | |
| 155 | 추가: snapshot: Some(source), | |
| 156 | 추가: decoded: None, | |
| 157 | 추가: }; | |
| 158 | 추가: } | |
| 159 | 추가: }; | |
| 160 | 추가: let Some(bytes) = decoded.bytes else { | |
| 161 | 추가: return Report { | |
| 162 | 추가: outcome: Outcome::AdapterFailed(AdapterFailure::MissingSelectedOutput), | |
| 163 | 추가: usage, | |
| 164 | 추가: snapshot: Some(source), | |
| 165 | 추가: decoded: None, | |
| 166 | 추가: }; | |
| 167 | 추가: }; | |
| 168 | 추가: if bytes.len() as u64 != decoded.boundary.inflated_bytes { | |
| 169 | 추가: return Report { | |
| 170 | 추가: outcome: Outcome::AdapterFailed(AdapterFailure::SelectedLengthMismatch { | |
| 171 | 추가: expected: decoded.boundary.inflated_bytes, | |
| 172 | 추가: actual: bytes.len() as u64, | |
| 173 | 추가: }), | |
| 174 | 추가: usage, | |
| 175 | 추가: snapshot: Some(source), | |
| 176 | 추가: decoded: None, | |
| 177 | 추가: }; | |
| 178 | 추가: } | |
| 179 | 추가: let memory = GzipObservation::from_decode(decoded.boundary); | |
| 180 | 추가: let native = self.publication.publish( | |
| 181 | 추가: publication::Request { | |
| 182 | 추가: parent: request.output_parent, | |
| 183 | 추가: leaf: request.output_leaf, | |
| 184 | 추가: bytes: &bytes, | |
| 185 | 추가: limits: request.limits.publication, | |
| 186 | 추가: }, | |
| 187 | 추가: |checkpoint| { | |
| 188 | 추가: usage.publication = checkpoint.usage; | |
| 189 | 추가: self.cancellation | |
| 190 | 추가: .observe( | |
| 191 | 추가: Checkpoint { | |
| 192 | 추가: event: Event::Publication(checkpoint), | |
| 193 | 추가: usage, | |
| 194 | 추가: }, | |
| 195 | 추가: &mut observer, | |
| 196 | 추가: ) | |
| 197 | 추가: .map_err(|stop| match stop { | |
| 198 | 추가: Stop::Cancelled => publication::Stop::Cancelled, | |
| 199 | 추가: Stop::Callback(error) => publication::Stop::Callback(error), | |
| 200 | 추가: }) | |
| 201 | 추가: }, | |
| 202 | 추가: ); | |
| 203 | 추가: usage.publication = native.usage; | |
| 204 | 추가: // commit 뒤에는 callback, 취소 판정, 재시도와 rollback을 추가하지 않음. | |
| 205 | 추가: Report { | |
| 206 | 추가: outcome: Outcome::Publication(native), | |
| 207 | 추가: usage, | |
| 208 | 추가: snapshot: Some(source), | |
| 209 | 추가: decoded: Some(memory), | |
| 210 | 추가: } | |
| 211 | 추가: } | |
| 212 | 추가: } |
| @@ -0,0 +1,102 @@ | ||
| 1 | 추가: use crate::{gzip, publication, snapshot}; | |
| 2 | 추가: use std::{ffi::OsStr, path::Path}; | |
| 3 | 추가: | |
| 4 | 추가: #[derive(Clone, Copy, Debug, Default)] | |
| 5 | 추가: pub struct Limits { | |
| 6 | 추가: pub snapshot: snapshot::Limits, | |
| 7 | 추가: pub gzip: gzip::Limits, | |
| 8 | 추가: pub publication: publication::Limits, | |
| 9 | 추가: } | |
| 10 | 추가: | |
| 11 | 추가: pub struct Request<'a> { | |
| 12 | 추가: pub input: &'a Path, | |
| 13 | 추가: pub output_parent: &'a Path, | |
| 14 | 추가: pub output_leaf: &'a OsStr, | |
| 15 | 추가: pub limits: Limits, | |
| 16 | 추가: } | |
| 17 | 추가: | |
| 18 | 추가: // 서로 다른 단위와 원래 누적 카운터를 합산하거나 환불하지 않음. | |
| 19 | 추가: #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] | |
| 20 | 추가: pub struct Usage { | |
| 21 | 추가: pub snapshot: snapshot::Usage, | |
| 22 | 추가: pub gzip: gzip::Usage, | |
| 23 | 추가: pub publication: publication::Usage, | |
| 24 | 추가: } | |
| 25 | 추가: | |
| 26 | 추가: #[derive(Clone, Copy, Debug)] | |
| 27 | 추가: pub enum Event { | |
| 28 | 추가: Snapshot(snapshot::Checkpoint), | |
| 29 | 추가: Decode(gzip::Checkpoint), | |
| 30 | 추가: Publication(publication::Checkpoint), | |
| 31 | 추가: } | |
| 32 | 추가: | |
| 33 | 추가: #[derive(Clone, Copy, Debug)] | |
| 34 | 추가: pub struct Checkpoint { | |
| 35 | 추가: pub event: Event, | |
| 36 | 추가: pub usage: Usage, | |
| 37 | 추가: } | |
| 38 | 추가: | |
| 39 | 추가: #[derive(Debug)] | |
| 40 | 추가: pub enum Stop<E> { | |
| 41 | 추가: Cancelled, | |
| 42 | 추가: Callback(E), | |
| 43 | 추가: } | |
| 44 | 추가: | |
| 45 | 추가: #[derive(Clone, Copy, Debug, Eq, PartialEq)] | |
| 46 | 추가: pub enum AdapterFailure { | |
| 47 | 추가: MissingSelectedOutput, | |
| 48 | 추가: SelectedLengthMismatch { expected: u64, actual: u64 }, | |
| 49 | 추가: } | |
| 50 | 추가: | |
| 51 | 추가: // 원래 오류와 파일 계층의 게시/내구성/close 보고서를 그대로 보존함. | |
| 52 | 추가: pub enum Outcome<E> { | |
| 53 | 추가: SnapshotFailed(snapshot::Failure<E>), | |
| 54 | 추가: DecodeFailed(gzip::Error<E>), | |
| 55 | 추가: AdapterFailed(AdapterFailure), | |
| 56 | 추가: Publication(publication::Report<E>), | |
| 57 | 추가: } | |
| 58 | 추가: | |
| 59 | 추가: #[derive(Clone, Copy, Debug)] | |
| 60 | 추가: pub struct SnapshotObservation { | |
| 61 | 추가: identity: snapshot::Identity, | |
| 62 | 추가: sha256: [u8; 32], | |
| 63 | 추가: } | |
| 64 | 추가: | |
| 65 | 추가: impl SnapshotObservation { | |
| 66 | 추가: pub(crate) fn from_capture(value: &snapshot::FileSnapshot) -> Self { | |
| 67 | 추가: Self { | |
| 68 | 추가: identity: value.identity(), | |
| 69 | 추가: sha256: value.sha256(), | |
| 70 | 추가: } | |
| 71 | 추가: } | |
| 72 | 추가: | |
| 73 | 추가: pub fn identity(&self) -> snapshot::Identity { | |
| 74 | 추가: self.identity | |
| 75 | 추가: } | |
| 76 | 추가: | |
| 77 | 추가: pub fn sha256(&self) -> [u8; 32] { | |
| 78 | 추가: self.sha256 | |
| 79 | 추가: } | |
| 80 | 추가: } | |
| 81 | 추가: | |
| 82 | 추가: #[derive(Clone, Copy, Debug)] | |
| 83 | 추가: pub struct GzipObservation { | |
| 84 | 추가: boundary: gzip::Boundary, | |
| 85 | 추가: } | |
| 86 | 추가: | |
| 87 | 추가: impl GzipObservation { | |
| 88 | 추가: pub(crate) fn from_decode(boundary: gzip::Boundary) -> Self { | |
| 89 | 추가: Self { boundary } | |
| 90 | 추가: } | |
| 91 | 추가: | |
| 92 | 추가: pub fn boundary(&self) -> gzip::Boundary { | |
| 93 | 추가: self.boundary | |
| 94 | 추가: } | |
| 95 | 추가: } | |
| 96 | 추가: | |
| 97 | 추가: pub struct Report<E> { | |
| 98 | 추가: pub outcome: Outcome<E>, | |
| 99 | 추가: pub usage: Usage, | |
| 100 | 추가: pub snapshot: Option<SnapshotObservation>, | |
| 101 | 추가: pub decoded: Option<GzipObservation>, | |
| 102 | 추가: } |
| @@ -0,0 +1,256 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "commands": [ | |
| 3 | 추가: { | |
| 4 | 추가: "command": [ | |
| 5 | 추가: "rustfmt", | |
| 6 | 추가: "+1.99.1", | |
| 7 | 추가: "--edition", | |
| 8 | 추가: "2024", | |
| 9 | 추가: "src/lib.rs", | |
| 10 | 추가: "src/types.rs" | |
| 11 | 추가: ], | |
| 12 | 추가: "exit_code": 0, | |
| 13 | 추가: "stdout": "", | |
| 14 | 추가: "stderr": "" | |
| 15 | 추가: }, | |
| 16 | 추가: { | |
| 17 | 추가: "command": [ | |
| 18 | 추가: "rustfmt", | |
| 19 | 추가: "+1.99.1", | |
| 20 | 추가: "--check", | |
| 21 | 추가: "--edition", | |
| 22 | 추가: "2024", | |
| 23 | 추가: "src/lib.rs", | |
| 24 | 추가: "src/types.rs" | |
| 25 | 추가: ], | |
| 26 | 추가: "exit_code": 0, | |
| 27 | 추가: "stdout": "", | |
| 28 | 추가: "stderr": "" | |
| 29 | 추가: }, | |
| 30 | 추가: { | |
| 31 | 추가: "command": [ | |
| 32 | 추가: "cargo", | |
| 33 | 추가: "+1.99.1", | |
| 34 | 추가: "generate-lockfile", | |
| 35 | 추가: "--offline" | |
| 36 | 추가: ], | |
| 37 | 추가: "exit_code": 0, | |
| 38 | 추가: "stdout": "", | |
| 39 | 추가: "stderr": " Locking 14 packages to highest Rust 1.99 compatible versions\n" | |
| 40 | 추가: }, | |
| 41 | 추가: { | |
| 42 | 추가: "command": [ | |
| 43 | 추가: "cargo", | |
| 44 | 추가: "+1.99.1", | |
| 45 | 추가: "metadata", | |
| 46 | 추가: "--locked", | |
| 47 | 추가: "--offline", | |
| 48 | 추가: "--format-version", | |
| 49 | 추가: "1" | |
| 50 | 추가: ], | |
| 51 | 추가: "exit_code": 0, | |
| 52 | 추가: "stdout": null, | |
| 53 | 추가: "stderr": "" | |
| 54 | 추가: } | |
| 55 | 추가: ], | |
| 56 | 추가: "resolved_packages": [ | |
| 57 | 추가: { | |
| 58 | 추가: "name": "block-buffer", | |
| 59 | 추가: "version": "0.10.4", | |
| 60 | 추가: "license": "MIT OR Apache-2.0", | |
| 61 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 62 | 추가: }, | |
| 63 | 추가: { | |
| 64 | 추가: "name": "cfg-if", | |
| 65 | 추가: "version": "1.0.5", | |
| 66 | 추가: "license": "MIT OR Apache-2.0", | |
| 67 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 68 | 추가: }, | |
| 69 | 추가: { | |
| 70 | 추가: "name": "cpufeatures", | |
| 71 | 추가: "version": "0.2.17", | |
| 72 | 추가: "license": "MIT OR Apache-2.0", | |
| 73 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 74 | 추가: }, | |
| 75 | 추가: { | |
| 76 | 추가: "name": "crypto-common", | |
| 77 | 추가: "version": "0.1.7", | |
| 78 | 추가: "license": "MIT OR Apache-2.0", | |
| 79 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 80 | 추가: }, | |
| 81 | 추가: { | |
| 82 | 추가: "name": "digest", | |
| 83 | 추가: "version": "0.10.7", | |
| 84 | 추가: "license": "MIT OR Apache-2.0", | |
| 85 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 86 | 추가: }, | |
| 87 | 추가: { | |
| 88 | 추가: "name": "generic-array", | |
| 89 | 추가: "version": "0.14.7", | |
| 90 | 추가: "license": "MIT", | |
| 91 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 92 | 추가: }, | |
| 93 | 추가: { | |
| 94 | 추가: "name": "libc", | |
| 95 | 추가: "version": "0.2.191", | |
| 96 | 추가: "license": "MIT OR Apache-2.0", | |
| 97 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 98 | 추가: }, | |
| 99 | 추가: { | |
| 100 | 추가: "name": "sha2", | |
| 101 | 추가: "version": "0.10.9", | |
| 102 | 추가: "license": "MIT OR Apache-2.0", | |
| 103 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 104 | 추가: }, | |
| 105 | 추가: { | |
| 106 | 추가: "name": "typenum", | |
| 107 | 추가: "version": "1.20.1", | |
| 108 | 추가: "license": "MIT OR Apache-2.0", | |
| 109 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 110 | 추가: }, | |
| 111 | 추가: { | |
| 112 | 추가: "name": "version_check", | |
| 113 | 추가: "version": "0.9.5", | |
| 114 | 추가: "license": "MIT/Apache-2.0", | |
| 115 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 116 | 추가: }, | |
| 117 | 추가: { | |
| 118 | 추가: "name": "zipelo-file-publication", | |
| 119 | 추가: "version": "0.1.0", | |
| 120 | 추가: "license": "MIT", | |
| 121 | 추가: "source": null | |
| 122 | 추가: }, | |
| 123 | 추가: { | |
| 124 | 추가: "name": "zipelo-file-snapshot", | |
| 125 | 추가: "version": "0.1.0", | |
| 126 | 추가: "license": "MIT", | |
| 127 | 추가: "source": null | |
| 128 | 추가: }, | |
| 129 | 추가: { | |
| 130 | 추가: "name": "zipelo-gzip-file-job", | |
| 131 | 추가: "version": "0.1.0", | |
| 132 | 추가: "license": "MIT", | |
| 133 | 추가: "source": null | |
| 134 | 추가: }, | |
| 135 | 추가: { | |
| 136 | 추가: "name": "zipelo-memory-gzip-reader", | |
| 137 | 추가: "version": "0.1.0", | |
| 138 | 추가: "license": "MIT", | |
| 139 | 추가: "source": null | |
| 140 | 추가: }, | |
| 141 | 추가: { | |
| 142 | 추가: "name": "zlib-rs", | |
| 143 | 추가: "version": "0.6.8", | |
| 144 | 추가: "license": "Zlib", | |
| 145 | 추가: "source": "registry+https://github.com/rust-lang/crates.io-index" | |
| 146 | 추가: } | |
| 147 | 추가: ], | |
| 148 | 추가: "selected_features": { | |
| 149 | 추가: "block-buffer": [], | |
| 150 | 추가: "cfg-if": [], | |
| 151 | 추가: "cpufeatures": [], | |
| 152 | 추가: "crypto-common": [ | |
| 153 | 추가: "std" | |
| 154 | 추가: ], | |
| 155 | 추가: "digest": [ | |
| 156 | 추가: "alloc", | |
| 157 | 추가: "block-buffer", | |
| 158 | 추가: "core-api", | |
| 159 | 추가: "default", | |
| 160 | 추가: "std" | |
| 161 | 추가: ], | |
| 162 | 추가: "generic-array": [ | |
| 163 | 추가: "more_lengths" | |
| 164 | 추가: ], | |
| 165 | 추가: "libc": [ | |
| 166 | 추가: "std" | |
| 167 | 추가: ], | |
| 168 | 추가: "sha2": [ | |
| 169 | 추가: "force-soft", | |
| 170 | 추가: "std" | |
| 171 | 추가: ], | |
| 172 | 추가: "typenum": [], | |
| 173 | 추가: "version_check": [], | |
| 174 | 추가: "zipelo-file-publication": [], | |
| 175 | 추가: "zipelo-file-snapshot": [], | |
| 176 | 추가: "zipelo-gzip-file-job": [], | |
| 177 | 추가: "zipelo-memory-gzip-reader": [], | |
| 178 | 추가: "zlib-rs": [ | |
| 179 | 추가: "rust-allocator" | |
| 180 | 추가: ] | |
| 181 | 추가: }, | |
| 182 | 추가: "targets": [ | |
| 183 | 추가: { | |
| 184 | 추가: "kind": [ | |
| 185 | 추가: "lib" | |
| 186 | 추가: ], | |
| 187 | 추가: "crate_types": [ | |
| 188 | 추가: "lib" | |
| 189 | 추가: ], | |
| 190 | 추가: "name": "zipelo_gzip_file_job", | |
| 191 | 추가: "edition": "2024", | |
| 192 | 추가: "doc": true, | |
| 193 | 추가: "doctest": false, | |
| 194 | 추가: "test": true | |
| 195 | 추가: } | |
| 196 | 추가: ], | |
| 197 | 추가: "rust_compilation": false, | |
| 198 | 추가: "rust_execution": false, | |
| 199 | 추가: "network_restore": false, | |
| 200 | 추가: "source_checks": { | |
| 201 | 추가: "one_snapshot_call": true, | |
| 202 | 추가: "one_gzip_read_call": true, | |
| 203 | 추가: "one_gzip_budget": true, | |
| 204 | 추가: "one_publication_call": true, | |
| 205 | 추가: "source_to_decode_owned_handoff": true, | |
| 206 | 추가: "select_output": true, | |
| 207 | 추가: "publish_exact_owned_output": true, | |
| 208 | 추가: "final_native_budget_accounting": true, | |
| 209 | 추가: "native_final_usage_accounting": true, | |
| 210 | 추가: "native_publication_report_returned": true, | |
| 211 | 추가: "no_postcommit_observer": true, | |
| 212 | 추가: "callback_before_flag_poll": true, | |
| 213 | 추가: "native_cancel_before_front_flag": true, | |
| 214 | 추가: "no_dangerous_adapter_operations": true, | |
| 215 | 추가: "no_product_published_type": true, | |
| 216 | 추가: "no_inline_test_code": true, | |
| 217 | 추가: "no_source_path_reopen": true, | |
| 218 | 추가: "typed_stage_errors": true, | |
| 219 | 추가: "private_observation_fields": true | |
| 220 | 추가: }, | |
| 221 | 추가: "source_check_scope": "Syntax and structural assertions plus manual control-flow review; not Rust type checking or executed behavior.", | |
| 222 | 추가: "inherited_union_blob_mode_sha256_verified": 331, | |
| 223 | 추가: "local_path_dependency_input_files_verified": [ | |
| 224 | 추가: "experiments/rust-file-snapshot/Cargo.lock", | |
| 225 | 추가: "experiments/rust-file-snapshot/Cargo.toml", | |
| 226 | 추가: "experiments/rust-file-snapshot/LICENSE", | |
| 227 | 추가: "experiments/rust-file-snapshot/SHA256SUMS", | |
| 228 | 추가: "experiments/rust-file-snapshot/THIRD-PARTY-NOTICES.txt", | |
| 229 | 추가: "experiments/rust-file-snapshot/contract.json", | |
| 230 | 추가: "experiments/rust-file-snapshot/dependencies.json", | |
| 231 | 추가: "experiments/rust-file-snapshot/src/lib.rs", | |
| 232 | 추가: "experiments/rust-file-snapshot/src/linux.rs", | |
| 233 | 추가: "experiments/rust-memory-gzip-reader/Cargo.lock", | |
| 234 | 추가: "experiments/rust-memory-gzip-reader/Cargo.toml", | |
| 235 | 추가: "experiments/rust-memory-gzip-reader/LICENSE", | |
| 236 | 추가: "experiments/rust-memory-gzip-reader/SHA256SUMS", | |
| 237 | 추가: "experiments/rust-memory-gzip-reader/THIRD-PARTY-NOTICES.txt", | |
| 238 | 추가: "experiments/rust-memory-gzip-reader/contract.json", | |
| 239 | 추가: "experiments/rust-memory-gzip-reader/dependencies.json", | |
| 240 | 추가: "experiments/rust-memory-gzip-reader/src/budget.rs", | |
| 241 | 추가: "experiments/rust-memory-gzip-reader/src/lib.rs", | |
| 242 | 추가: "experiments/rust-file-publication/Cargo.lock", | |
| 243 | 추가: "experiments/rust-file-publication/Cargo.toml", | |
| 244 | 추가: "experiments/rust-file-publication/LICENSE", | |
| 245 | 추가: "experiments/rust-file-publication/SHA256SUMS", | |
| 246 | 추가: "experiments/rust-file-publication/THIRD-PARTY-NOTICES.txt", | |
| 247 | 추가: "experiments/rust-file-publication/contract.json", | |
| 248 | 추가: "experiments/rust-file-publication/dependencies.json", | |
| 249 | 추가: "experiments/rust-file-publication/src/lib.rs", | |
| 250 | 추가: "experiments/rust-file-publication/src/linux.rs", | |
| 251 | 추가: "experiments/rust-file-publication/static-validation.json" | |
| 252 | 추가: ], | |
| 253 | 추가: "cached_registry_source_files_verified": 661, | |
| 254 | 추가: "main_merge": false, | |
| 255 | 추가: "user_files_processed": false | |
| 256 | 추가: } |
| @@ -1,3 +1,6 @@ | ||
| 1 | 추가: #[path = "system_font.rs"] | |
| 2 | 추가: mod system_font; | |
| 3 | 추가: | |
| 1 | 4 | use eframe::egui::{self, Color32, FontData, FontDefinitions, FontFamily, FontId, TextStyle}; |
| 2 | 5 | use zipelo_ui_memory_app::{ |
| 3 | 6 | controller::{CloseState, Controller}, |
| @@ -155,8 +158,7 @@ impl eframe::App for App { | ||
| 155 | 158 | } |
| 156 | 159 | |
| 157 | 160 | fn main() -> eframe::Result { |
| 158 | 삭제: let font = std::fs::read("/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc") | |
| 159 | 삭제: .map_err(|e| eframe::Error::AppCreation(Box::new(e)))?; | |
| 161 | 추가: let font = system_font::load().map_err(|e| eframe::Error::AppCreation(Box::new(e)))?; | |
| 160 | 162 | eframe::run_native( |
| 161 | 163 | "Zipelo 합성 메모리 작업", |
| 162 | 164 | eframe::NativeOptions { |
| @@ -168,8 +170,8 @@ fn main() -> eframe::Result { | ||
| 168 | 170 | }, |
| 169 | 171 | Box::new(move |cc| { |
| 170 | 172 | let mut fonts = FontDefinitions::empty(); |
| 171 | 삭제: let mut data = FontData::from_owned(font); | |
| 172 | 삭제: data.index = 1; | |
| 173 | 추가: let mut data = FontData::from_owned(font.bytes); | |
| 174 | 추가: data.index = font.face_index; | |
| 173 | 175 | fonts.font_data.insert("noto-kr".into(), data.into()); |
| 174 | 176 | fonts |
| 175 | 177 | .families |
| @@ -0,0 +1,65 @@ | ||
| 1 | 추가: use std::io; | |
| 2 | 추가: | |
| 3 | 추가: pub(super) struct RuntimeFont { | |
| 4 | 추가: pub bytes: Vec<u8>, | |
| 5 | 추가: pub face_index: u32, | |
| 6 | 추가: } | |
| 7 | 추가: | |
| 8 | 추가: pub(super) fn load() -> io::Result<RuntimeFont> { | |
| 9 | 추가: platform::load() | |
| 10 | 추가: } | |
| 11 | 추가: | |
| 12 | 추가: #[cfg(target_os = "linux")] | |
| 13 | 추가: mod platform { | |
| 14 | 추가: use super::RuntimeFont; | |
| 15 | 추가: use std::io; | |
| 16 | 추가: | |
| 17 | 추가: pub(super) fn load() -> io::Result<RuntimeFont> { | |
| 18 | 추가: Ok(RuntimeFont { | |
| 19 | 추가: bytes: std::fs::read("/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc")?, | |
| 20 | 추가: face_index: 1, | |
| 21 | 추가: }) | |
| 22 | 추가: } | |
| 23 | 추가: } | |
| 24 | 추가: | |
| 25 | 추가: #[cfg(target_os = "windows")] | |
| 26 | 추가: mod platform { | |
| 27 | 추가: use super::RuntimeFont; | |
| 28 | 추가: use std::{io, path::PathBuf}; | |
| 29 | 추가: | |
| 30 | 추가: pub(super) fn load() -> io::Result<RuntimeFont> { | |
| 31 | 추가: let root = std::env::var_os("SystemRoot").ok_or_else(|| { | |
| 32 | 추가: io::Error::new( | |
| 33 | 추가: io::ErrorKind::NotFound, | |
| 34 | 추가: "Windows system directory is unavailable", | |
| 35 | 추가: ) | |
| 36 | 추가: })?; | |
| 37 | 추가: let root = PathBuf::from(root); | |
| 38 | 추가: if !root.is_absolute() | |
| 39 | 추가: || !matches!(root.components().next(), Some(std::path::Component::Prefix(prefix)) | |
| 40 | 추가: if matches!(prefix.kind(), std::path::Prefix::Disk(_))) | |
| 41 | 추가: { | |
| 42 | 추가: return Err(io::Error::new( | |
| 43 | 추가: io::ErrorKind::InvalidInput, | |
| 44 | 추가: "Windows system directory must be a local absolute drive path", | |
| 45 | 추가: )); | |
| 46 | 추가: } | |
| 47 | 추가: Ok(RuntimeFont { | |
| 48 | 추가: bytes: std::fs::read(root.join("Fonts").join("malgun.ttf"))?, | |
| 49 | 추가: face_index: 0, | |
| 50 | 추가: }) | |
| 51 | 추가: } | |
| 52 | 추가: } | |
| 53 | 추가: | |
| 54 | 추가: #[cfg(not(any(target_os = "linux", target_os = "windows")))] | |
| 55 | 추가: mod platform { | |
| 56 | 추가: use super::RuntimeFont; | |
| 57 | 추가: use std::io; | |
| 58 | 추가: | |
| 59 | 추가: pub(super) fn load() -> io::Result<RuntimeFont> { | |
| 60 | 추가: Err(io::Error::new( | |
| 61 | 추가: io::ErrorKind::Unsupported, | |
| 62 | 추가: "No Korean system font provider is available for this platform", | |
| 63 | 추가: )) | |
| 64 | 추가: } | |
| 65 | 추가: } |
| @@ -0,0 +1,3 @@ | ||
| 1 | 추가: fc7dd6d4bdc0d26553f7d44e545e799f5f2388ce4c9b21573ac3faf016fa9cd4 overlay.json | |
| 2 | 추가: ac7696f5dd7ae784ab0a59cc25f0f96794fbf0747bbd00a7419c801ce92a324c verify.py | |
| 3 | 추가: 8f3f5d2134f63739e3a4926d3ff9cd1f9c0f9a1ab3047ae38546cc4700c1cf59 static-validation.json |
| @@ -0,0 +1,84 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "schema": 1, | |
| 3 | 추가: "status": "source-static-only; Rust compile/run awaits fixed-head review", | |
| 4 | 추가: "branch": "features/python-gzip-fixture-compat", | |
| 5 | 추가: "base_head": "f7fc8cbece281e2f9a6374b4640ca4dd9d321fbc", | |
| 6 | 추가: "base_tree": "ab5574289f537a4028a3abf092e4634cb9b89282", | |
| 7 | 추가: "historical_sources": { | |
| 8 | 추가: "path": "tests/rust-integration-baseline/sources.json", | |
| 9 | 추가: "sha256": "d28874ea921a8027029f37bf35b64cb804c8e19345be893bc37a929d8b9dd932" | |
| 10 | 추가: }, | |
| 11 | 추가: "historical_metadata": [ | |
| 12 | 추가: { | |
| 13 | 추가: "path": "tests/rust-integration-baseline/sources.json", | |
| 14 | 추가: "mode": "100644", | |
| 15 | 추가: "type": "blob", | |
| 16 | 추가: "sha": "495e32eb6eb40a81d95935385b4c9bef01732692" | |
| 17 | 추가: }, | |
| 18 | 추가: { | |
| 19 | 추가: "path": "tests/rust-integration-baseline/run-plan.json", | |
| 20 | 추가: "mode": "100644", | |
| 21 | 추가: "type": "blob", | |
| 22 | 추가: "sha": "89eabfc1f19a402ab84666233a704e464288ec10" | |
| 23 | 추가: }, | |
| 24 | 추가: { | |
| 25 | 추가: "path": "tests/rust-integration-baseline/SHA256SUMS", | |
| 26 | 추가: "mode": "100644", | |
| 27 | 추가: "type": "blob", | |
| 28 | 추가: "sha": "e0e32c99b5401562a8abcc0a7ebe6335d82d8413" | |
| 29 | 추가: } | |
| 30 | 추가: ], | |
| 31 | 추가: "replacements": { | |
| 32 | 추가: "tests/rust-app-core-memory/generate_fixtures.py": { | |
| 33 | 추가: "before_git_blob": "9cffa6f45fa063fcc77d0b48796bb42a38e938a8", | |
| 34 | 추가: "before_sha256": "203566ae81a254f4006924b74a3433a18b465950e5f1c9acb69e807809643534", | |
| 35 | 추가: "after_git_blob": "f0e89ea50d7e6178a4e4f6d3e29e8af6c6f63640", | |
| 36 | 추가: "after_sha256": "a358a8480c9f3addfcf9ab7572f31858ce59828436a1765faa6e427cfb062e11" | |
| 37 | 추가: }, | |
| 38 | 추가: "tests/rust-app-core-memory/SHA256SUMS": { | |
| 39 | 추가: "before_git_blob": "d2545fab5e8472abe8a49f2ba491d02d9cf27278", | |
| 40 | 추가: "before_sha256": "9855466588a5a145c70d3db49ca0e372aeb20f0142520df318954b424884d95e", | |
| 41 | 추가: "after_git_blob": "278ee9a537cfe0777fb53f1227f95330dc6a1d04", | |
| 42 | 추가: "after_sha256": "0c8a155a9b14c886b3c46f002e35a6f795d7b5a815c8ea7ed87526d3574cff30" | |
| 43 | 추가: } | |
| 44 | 추가: }, | |
| 45 | 추가: "preservation": { | |
| 46 | 추가: "base_files": 305, | |
| 47 | 추가: "unchanged_base_files": 303, | |
| 48 | 추가: "all_rust_source_tests_unchanged": true, | |
| 49 | 추가: "fixtures_hex_json_unchanged": true, | |
| 50 | 추가: "native_static_check_unchanged": true, | |
| 51 | 추가: "historical_source_test_evidence_pins_unchanged": true, | |
| 52 | 추가: "no_check_removed_or_relaxed": true | |
| 53 | 추가: }, | |
| 54 | 추가: "generation": "Use stdlib GzipFile with empty filename, explicit mtime=0 and compression level=6; no header patching, expected byte changes, new dependency or raw encoder replacement.", | |
| 55 | 추가: "validation": "Compare full generated fixtures.hex and fixtures.json bytes against unchanged frozen originals on host Python3.14 and Ubuntu24 Python3.12; run the unchanged core static checker with the new core manifest hash. This is Python-only, not Rust execution.", | |
| 56 | 추가: "future_plan": { | |
| 57 | 추가: "historical_plan": "tests/rust-integration-baseline/run-plan.json", | |
| 58 | 추가: "overlay_application": "Materialize fixed base main then apply only these two replacements and this overlay directory; do not reinterpret historical pin files as the new candidate. Fix and verify the final PR head/tree separately before any Rust compile/run.", | |
| 59 | 추가: "headless_groups": [ | |
| 60 | 추가: 67, | |
| 61 | 추가: 11, | |
| 62 | 추가: 42, | |
| 63 | 추가: 150, | |
| 64 | 추가: 303, | |
| 65 | 추가: 31, | |
| 66 | 추가: 14, | |
| 67 | 추가: 72 | |
| 68 | 추가: ], | |
| 69 | 추가: "expected_total": 690, | |
| 70 | 추가: "test_names_and_expectations": "All eight original native contracts and Rust files unchanged", | |
| 71 | 추가: "first_failure_stop": true, | |
| 72 | 추가: "each_test_once_serially": true, | |
| 73 | 추가: "cargo_build_jobs": 1, | |
| 74 | 추가: "locked_offline": true, | |
| 75 | 추가: "rust_toolchain": "1.99.1", | |
| 76 | 추가: "no_host_targets_for_ubuntu24": true, | |
| 77 | 추가: "no_gui_worker_vm_or_real_data": true | |
| 78 | 추가: }, | |
| 79 | 추가: "limitations": [ | |
| 80 | 추가: "Empty filename/mtime/OS header policy is explicit; exact equality was checked only on the two recorded Python/zlib environments, not every future compressor version.", | |
| 81 | 추가: "No Rust type check/compile/discovery/runtime or Ubuntu24 kernel/desktop support claim.", | |
| 82 | 추가: "Previous static failures and all previous passed/failed execution records remain historical evidence." | |
| 83 | 추가: ] | |
| 84 | 추가: } |
| @@ -0,0 +1,196 @@ | ||
| 1 | 추가: { | |
| 2 | 추가: "schema": 1, | |
| 3 | 추가: "state": "python_static_checks_passed", | |
| 4 | 추가: "base_head": "f7fc8cbece281e2f9a6374b4640ca4dd9d321fbc", | |
| 5 | 추가: "base_tree": "ab5574289f537a4028a3abf092e4634cb9b89282", | |
| 6 | 추가: "modified_files": [ | |
| 7 | 추가: "tests/rust-app-core-memory/SHA256SUMS", | |
| 8 | 추가: "tests/rust-app-core-memory/generate_fixtures.py" | |
| 9 | 추가: ], | |
| 10 | 추가: "new_files": [ | |
| 11 | 추가: "tests/python-gzip-fixture-compat/overlay.json", | |
| 12 | 추가: "tests/python-gzip-fixture-compat/verify.py", | |
| 13 | 추가: "tests/python-gzip-fixture-compat/static-validation.json", | |
| 14 | 추가: "tests/python-gzip-fixture-compat/SHA256SUMS" | |
| 15 | 추가: ], | |
| 16 | 추가: "checks": [ | |
| 17 | 추가: { | |
| 18 | 추가: "environment": "host", | |
| 19 | 추가: "fixture_and_overlay_check": { | |
| 20 | 추가: "state": "passed", | |
| 21 | 추가: "scope": "Python-only fixture bytes/provenance and fixed overlay verification; no Rust compile/run", | |
| 22 | 추가: "base_head": "f7fc8cbece281e2f9a6374b4640ca4dd9d321fbc", | |
| 23 | 추가: "base_tree": "ab5574289f537a4028a3abf092e4634cb9b89282", | |
| 24 | 추가: "python": "3.14.4 (main, Aug 20 2026, 10:41:58) [GCC 15.2.0]", | |
| 25 | 추가: "zlib_runtime": "1.3.1", | |
| 26 | 추가: "base_paths_verified": 305, | |
| 27 | 추가: "unchanged_base_paths": 303, | |
| 28 | 추가: "changed_paths": [ | |
| 29 | 추가: "tests/rust-app-core-memory/SHA256SUMS", | |
| 30 | 추가: "tests/rust-app-core-memory/generate_fixtures.py" | |
| 31 | 추가: ], | |
| 32 | 추가: "fixtures_hex_sha256": "b57d63624622ad0d17a0902a48bf9a514d1cb67be99d87d831bca4984d485e37", | |
| 33 | 추가: "fixtures_json_sha256": "a1201119b4e74c9466affe0907025ae04ca24afb5d08aa55540fc42385cfe400", | |
| 34 | 추가: "exact_bytes_and_json_equal": true, | |
| 35 | 추가: "gzip_members_verified": 2, | |
| 36 | 추가: "inputs_unchanged": true, | |
| 37 | 추가: "rust_compiled": false, | |
| 38 | 추가: "rust_executed": false | |
| 39 | 추가: }, | |
| 40 | 추가: "unchanged_core_static_check": { | |
| 41 | 추가: "source_head": "23b8d1c615f24f42469138fcc63e7fce7cda4f24", | |
| 42 | 추가: "source_pins_verified": 69, | |
| 43 | 추가: "manifest_sha256": "0c8a155a9b14c886b3c46f002e35a6f795d7b5a815c8ea7ed87526d3574cff30", | |
| 44 | 추가: "declared": 67, | |
| 45 | 추가: "selected_registry_packages": null, | |
| 46 | 추가: "rust_compiled": false, | |
| 47 | 추가: "runtime_discovered": null, | |
| 48 | 추가: "runtime_executed": 0, | |
| 49 | 추가: "fixture_stdlib_verification": true, | |
| 50 | 추가: "inputs_unchanged": true | |
| 51 | 추가: }, | |
| 52 | 추가: "native_checker_helper_tests_passed": 9, | |
| 53 | 추가: "commands": [ | |
| 54 | 추가: { | |
| 55 | 추가: "argv": [ | |
| 56 | 추가: "/usr/bin/python3", | |
| 57 | 추가: "-B", | |
| 58 | 추가: "tests/python-gzip-fixture-compat/verify.py" | |
| 59 | 추가: ], | |
| 60 | 추가: "cwd": "/home/user/projects/zipelo/tests/python-gzip-fixture-compat/validation-host/c", | |
| 61 | 추가: "exit": 0, | |
| 62 | 추가: "duration_seconds": 0.06062793799992505, | |
| 63 | 추가: "stdout_sha256": "b26c95ea637656791de1d6649deaefd3e9e07b0a9bc12981c980abc522ab0675", | |
| 64 | 추가: "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | |
| 65 | 추가: "stdout_bytes": 812, | |
| 66 | 추가: "stderr_bytes": 0 | |
| 67 | 추가: }, | |
| 68 | 추가: { | |
| 69 | 추가: "argv": [ | |
| 70 | 추가: "/usr/bin/python3", | |
| 71 | 추가: "-B", | |
| 72 | 추가: "tests/rust-app-core-memory/static_check.py", | |
| 73 | 추가: "--manifest-sha256", | |
| 74 | 추가: "0c8a155a9b14c886b3c46f002e35a6f795d7b5a815c8ea7ed87526d3574cff30" | |
| 75 | 추가: ], | |
| 76 | 추가: "cwd": "/home/user/projects/zipelo/tests/python-gzip-fixture-compat/validation-host/c", | |
| 77 | 추가: "exit": 0, | |
| 78 | 추가: "duration_seconds": 0.05417774899979122, | |
| 79 | 추가: "stdout_sha256": "0808164c77bab6d10130b0d8a3213834c18ba9533191636d9b86bd5532554a9e", | |
| 80 | 추가: "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | |
| 81 | 추가: "stdout_bytes": 365, | |
| 82 | 추가: "stderr_bytes": 0 | |
| 83 | 추가: }, | |
| 84 | 추가: { | |
| 85 | 추가: "argv": [ | |
| 86 | 추가: "/usr/bin/python3", | |
| 87 | 추가: "-B", | |
| 88 | 추가: "tests/rust-app-core-memory/static_check_helper_tests.py" | |
| 89 | 추가: ], | |
| 90 | 추가: "cwd": "/home/user/projects/zipelo/tests/python-gzip-fixture-compat/validation-host/c", | |
| 91 | 추가: "exit": 0, | |
| 92 | 추가: "duration_seconds": 1.4344941700001073, | |
| 93 | 추가: "stdout_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | |
| 94 | 추가: "stderr_sha256": "3c6cc1a67560b93d5f5856c2df5b5461dd0bddc9437b09f34eda4e9c9e0336ec", | |
| 95 | 추가: "stdout_bytes": 0, | |
| 96 | 추가: "stderr_bytes": 1176 | |
| 97 | 추가: } | |
| 98 | 추가: ] | |
| 99 | 추가: }, | |
| 100 | 추가: { | |
| 101 | 추가: "environment": "ubuntu24", | |
| 102 | 추가: "fixture_and_overlay_check": { | |
| 103 | 추가: "state": "passed", | |
| 104 | 추가: "scope": "Python-only fixture bytes/provenance and fixed overlay verification; no Rust compile/run", | |
| 105 | 추가: "base_head": "f7fc8cbece281e2f9a6374b4640ca4dd9d321fbc", | |
| 106 | 추가: "base_tree": "ab5574289f537a4028a3abf092e4634cb9b89282", | |
| 107 | 추가: "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", | |
| 108 | 추가: "zlib_runtime": "1.3", | |
| 109 | 추가: "base_paths_verified": 305, | |
| 110 | 추가: "unchanged_base_paths": 303, | |
| 111 | 추가: "changed_paths": [ | |
| 112 | 추가: "tests/rust-app-core-memory/SHA256SUMS", | |
| 113 | 추가: "tests/rust-app-core-memory/generate_fixtures.py" | |
| 114 | 추가: ], | |
| 115 | 추가: "fixtures_hex_sha256": "b57d63624622ad0d17a0902a48bf9a514d1cb67be99d87d831bca4984d485e37", | |
| 116 | 추가: "fixtures_json_sha256": "a1201119b4e74c9466affe0907025ae04ca24afb5d08aa55540fc42385cfe400", | |
| 117 | 추가: "exact_bytes_and_json_equal": true, | |
| 118 | 추가: "gzip_members_verified": 2, | |
| 119 | 추가: "inputs_unchanged": true, | |
| 120 | 추가: "rust_compiled": false, | |
| 121 | 추가: "rust_executed": false | |
| 122 | 추가: }, | |
| 123 | 추가: "unchanged_core_static_check": { | |
| 124 | 추가: "source_head": "23b8d1c615f24f42469138fcc63e7fce7cda4f24", | |
| 125 | 추가: "source_pins_verified": 69, | |
| 126 | 추가: "manifest_sha256": "0c8a155a9b14c886b3c46f002e35a6f795d7b5a815c8ea7ed87526d3574cff30", | |
| 127 | 추가: "declared": 67, | |
| 128 | 추가: "selected_registry_packages": null, | |
| 129 | 추가: "rust_compiled": false, | |
| 130 | 추가: "runtime_discovered": null, | |
| 131 | 추가: "runtime_executed": 0, | |
| 132 | 추가: "fixture_stdlib_verification": true, | |
| 133 | 추가: "inputs_unchanged": true | |
| 134 | 추가: }, | |
| 135 | 추가: "native_checker_helper_tests_passed": 9, | |
| 136 | 추가: "commands": [ | |
| 137 | 추가: { | |
| 138 | 추가: "argv": [ | |
| 139 | 추가: "/usr/bin/python3", | |
| 140 | 추가: "-B", | |
| 141 | 추가: "tests/python-gzip-fixture-compat/verify.py" | |
| 142 | 추가: ], | |
| 143 | 추가: "cwd": "/work/g", | |
| 144 | 추가: "exit": 0, | |
| 145 | 추가: "duration_seconds": 0.06128367699966475, | |
| 146 | 추가: "stdout_sha256": "67dc65be2e5a781611c59af0a177b6e38b44e23c080f768c371fbe30630a23b2", | |
| 147 | 추가: "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | |
| 148 | 추가: "stdout_bytes": 810, | |
| 149 | 추가: "stderr_bytes": 0 | |
| 150 | 추가: }, | |
| 151 | 추가: { | |
| 152 | 추가: "argv": [ | |
| 153 | 추가: "/usr/bin/python3", | |
| 154 | 추가: "-B", | |
| 155 | 추가: "tests/rust-app-core-memory/static_check.py", | |
| 156 | 추가: "--manifest-sha256", | |
| 157 | 추가: "0c8a155a9b14c886b3c46f002e35a6f795d7b5a815c8ea7ed87526d3574cff30" | |
| 158 | 추가: ], | |
| 159 | 추가: "cwd": "/work/g", | |
| 160 | 추가: "exit": 0, | |
| 161 | 추가: "duration_seconds": 0.053824678000637505, | |
| 162 | 추가: "stdout_sha256": "0808164c77bab6d10130b0d8a3213834c18ba9533191636d9b86bd5532554a9e", | |
| 163 | 추가: "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | |
| 164 | 추가: "stdout_bytes": 365, | |
| 165 | 추가: "stderr_bytes": 0 | |
| 166 | 추가: }, | |
| 167 | 추가: { | |
| 168 | 추가: "argv": [ | |
| 169 | 추가: "/usr/bin/python3", | |
| 170 | 추가: "-B", | |
| 171 | 추가: "tests/rust-app-core-memory/static_check_helper_tests.py" | |
| 172 | 추가: ], | |
| 173 | 추가: "cwd": "/work/g", | |
| 174 | 추가: "exit": 0, | |
| 175 | 추가: "duration_seconds": 0.9235151720004069, | |
| 176 | 추가: "stdout_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", | |
| 177 | 추가: "stderr_sha256": "f0fc6f693c225d34e802724d0f1d8f5337aca98e654a75a79cd92f9452d252c6", | |
| 178 | 추가: "stdout_bytes": 0, | |
| 179 | 추가: "stderr_bytes": 1176 | |
| 180 | 추가: } | |
| 181 | 추가: ] | |
| 182 | 추가: } | |
| 183 | 추가: ], | |
| 184 | 추가: "unchanged_original_files": 303, | |
| 185 | 추가: "rust_source_test_files_unchanged": 53, | |
| 186 | 추가: "frozen_fixture_hex_json_unchanged": true, | |
| 187 | 추가: "original_native_static_checker_unchanged": true, | |
| 188 | 추가: "historical_manifest_source_pins_and_execution_logs_unchanged": true, | |
| 189 | 추가: "rust_expected_total_unchanged": 690, | |
| 190 | 추가: "rust_compile_discover_execute": false, | |
| 191 | 추가: "dependencies_changed": false, | |
| 192 | 추가: "installation_or_network_change": false, | |
| 193 | 추가: "remaining_owned_test_processes": [], | |
| 194 | 추가: "limits": "Exact equality recorded on Python3.14.4/zlib1.3.1 and Python3.12.3/zlib1.3 only. No proof of identical compression across every future Python/zlib release.", | |
| 195 | 추가: "future_gate": "Review fixed PR head/tree before a new Rust compile/run assignment; use this explicit overlay instead of rewriting historical pins." | |
| 196 | 추가: } |
| @@ -0,0 +1,114 @@ | ||
| 1 | 추가: import argparse | |
| 2 | 추가: import gzip | |
| 3 | 추가: import hashlib | |
| 4 | 추가: import json | |
| 5 | 추가: from pathlib import Path, PurePosixPath | |
| 6 | 추가: import runpy | |
| 7 | 추가: import stat | |
| 8 | 추가: import sys | |
| 9 | 추가: import zlib | |
| 10 | 추가: | |
| 11 | 추가: BASE_HEAD = "f7fc8cbece281e2f9a6374b4640ca4dd9d321fbc" | |
| 12 | 추가: BASE_TREE = "ab5574289f537a4028a3abf092e4634cb9b89282" | |
| 13 | 추가: CHANGED = { | |
| 14 | 추가: "tests/rust-app-core-memory/generate_fixtures.py", | |
| 15 | 추가: "tests/rust-app-core-memory/SHA256SUMS", | |
| 16 | 추가: } | |
| 17 | 추가: | |
| 18 | 추가: | |
| 19 | 추가: def require(condition, message): | |
| 20 | 추가: if not condition: | |
| 21 | 추가: raise RuntimeError(message) | |
| 22 | 추가: | |
| 23 | 추가: | |
| 24 | 추가: def git_hash(kind, data): | |
| 25 | 추가: return hashlib.sha1(kind.encode() + b" " + str(len(data)).encode() + b"\0" + data).hexdigest() | |
| 26 | 추가: | |
| 27 | 추가: | |
| 28 | 추가: def tree_hash(entries): | |
| 29 | 추가: tree = {} | |
| 30 | 추가: for item in entries: | |
| 31 | 추가: parts = PurePosixPath(item["path"]).parts | |
| 32 | 추가: node = tree | |
| 33 | 추가: for part in parts[:-1]: | |
| 34 | 추가: node = node.setdefault(part, {}) | |
| 35 | 추가: require(parts[-1] not in node, "중복 tree 경로임") | |
| 36 | 추가: node[parts[-1]] = (item["mode"], item["sha"]) | |
| 37 | 추가: | |
| 38 | 추가: def calculate(node): | |
| 39 | 추가: data = bytearray() | |
| 40 | 추가: for name, value in sorted(node.items(), key=lambda row: (row[0] + ("/" if isinstance(row[1], dict) else "")).encode()): | |
| 41 | 추가: mode, digest = ("40000", calculate(value)) if isinstance(value, dict) else value | |
| 42 | 추가: data.extend(mode.encode() + b" " + name.encode() + b"\0" + bytes.fromhex(digest)) | |
| 43 | 추가: return git_hash("tree", bytes(data)) | |
| 44 | 추가: | |
| 45 | 추가: return calculate(tree) | |
| 46 | 추가: | |
| 47 | 추가: | |
| 48 | 추가: def main(): | |
| 49 | 추가: require(__debug__ and not sys.flags.optimize, "최적화 모드에서는 검증할 수 없음") | |
| 50 | 추가: parser = argparse.ArgumentParser() | |
| 51 | 추가: parser.add_argument("--root", type=Path, default=Path(__file__).resolve().parents[2]) | |
| 52 | 추가: args = parser.parse_args() | |
| 53 | 추가: root = args.root.resolve() | |
| 54 | 추가: overlay_path = root / "tests/python-gzip-fixture-compat/overlay.json" | |
| 55 | 추가: overlay = json.loads(overlay_path.read_bytes()) | |
| 56 | 추가: require(overlay["base_head"] == BASE_HEAD and overlay["base_tree"] == BASE_TREE, "기준 head/tree 불일치") | |
| 57 | 추가: require(set(overlay["replacements"]) == CHANGED, "허용 변경 경로 불일치") | |
| 58 | 추가: source_manifest = root / overlay["historical_sources"]["path"] | |
| 59 | 추가: require(hashlib.sha256(source_manifest.read_bytes()).hexdigest() == overlay["historical_sources"]["sha256"], "과거 출처 pin 변경됨") | |
| 60 | 추가: entries = json.loads(source_manifest.read_bytes())["entries"] | |
| 61 | 추가: require(len(entries) == 302, "원본 출처 항목 수 불일치") | |
| 62 | 추가: entries = [{key: item[key] for key in ["path", "mode", "type", "sha"]} for item in entries] | |
| 63 | 추가: entries.extend(overlay["historical_metadata"]) | |
| 64 | 추가: require(len(entries) == len({item["path"] for item in entries}) == 305, "기준 tree 경로 수 불일치") | |
| 65 | 추가: require(tree_hash(entries) == BASE_TREE, "고정 원본 tree 불일치") | |
| 66 | 추가: before = {} | |
| 67 | 추가: for item in entries: | |
| 68 | 추가: relative = PurePosixPath(item["path"]) | |
| 69 | 추가: require(not relative.is_absolute() and ".." not in relative.parts and str(relative) == item["path"], "경로 이탈 거부함") | |
| 70 | 추가: path = root / relative | |
| 71 | 추가: require(path.is_file() and not path.is_symlink() and path.resolve().is_relative_to(root), "일반 파일 경로가 아님") | |
| 72 | 추가: require(stat.S_IMODE(path.stat().st_mode) == 0o644 and item["mode"] == "100644" and item["type"] == "blob", "고정 파일 mode 불일치") | |
| 73 | 추가: raw = path.read_bytes() | |
| 74 | 추가: replacement = overlay["replacements"].get(item["path"]) | |
| 75 | 추가: expected = item["sha"] | |
| 76 | 추가: if replacement is not None: | |
| 77 | 추가: require(replacement["before_git_blob"] == expected, "overlay 부모 pin 불일치") | |
| 78 | 추가: expected = replacement["after_git_blob"] | |
| 79 | 추가: require(hashlib.sha256(raw).hexdigest() == replacement["after_sha256"], "overlay SHA256 불일치") | |
| 80 | 추가: require(git_hash("blob", raw) == expected, "고정 blob 불일치: " + item["path"]) | |
| 81 | 추가: before[item["path"]] = hashlib.sha256(raw).hexdigest() | |
| 82 | 추가: fixture_dir = root / "tests/rust-app-core-memory" | |
| 83 | 추가: generated_hex, generated_json = runpy.run_path(str(fixture_dir / "generate_fixtures.py"))["build"]() | |
| 84 | 추가: require(generated_hex.encode() == (fixture_dir / "fixtures.hex").read_bytes(), "기존 fixture bytes와 다름") | |
| 85 | 추가: require(generated_json.encode() == (fixture_dir / "fixtures.json").read_bytes(), "기존 fixture JSON bytes와 다름") | |
| 86 | 추가: values = dict(line.split(" ", 1) for line in generated_hex.splitlines()) | |
| 87 | 추가: for name, payload in [("gzip_digits", b"123456789"), ("gzip_empty", b"")]: | |
| 88 | 추가: member = bytes.fromhex(values[name]) | |
| 89 | 추가: require(member[:10] == bytes.fromhex("1f8b08000000000000ff"), "고정 GZip header와 다름") | |
| 90 | 추가: require(gzip.decompress(member) == payload, "표준 GZip 해제 결과가 다름") | |
| 91 | 추가: for relative, digest in before.items(): | |
| 92 | 추가: require(hashlib.sha256((root / relative).read_bytes()).hexdigest() == digest, "검증 중 입력 변경됨") | |
| 93 | 추가: print(json.dumps({ | |
| 94 | 추가: "state": "passed", | |
| 95 | 추가: "scope": "Python-only fixture bytes/provenance and fixed overlay verification; no Rust compile/run", | |
| 96 | 추가: "base_head": BASE_HEAD, | |
| 97 | 추가: "base_tree": BASE_TREE, | |
| 98 | 추가: "python": sys.version, | |
| 99 | 추가: "zlib_runtime": zlib.ZLIB_RUNTIME_VERSION, | |
| 100 | 추가: "base_paths_verified": len(before), | |
| 101 | 추가: "unchanged_base_paths": len(before) - len(CHANGED), | |
| 102 | 추가: "changed_paths": sorted(CHANGED), | |
| 103 | 추가: "fixtures_hex_sha256": hashlib.sha256(generated_hex.encode()).hexdigest(), | |
| 104 | 추가: "fixtures_json_sha256": hashlib.sha256(generated_json.encode()).hexdigest(), | |
| 105 | 추가: "exact_bytes_and_json_equal": True, | |
| 106 | 추가: "gzip_members_verified": 2, | |
| 107 | 추가: "inputs_unchanged": True, | |
| 108 | 추가: "rust_compiled": False, | |
| 109 | 추가: "rust_executed": False, | |
| 110 | 추가: }, ensure_ascii=False)) | |
| 111 | 추가: | |
| 112 | 추가: | |
| 113 | 추가: if __name__ == "__main__": | |
| 114 | 추가: main() |
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | c2c9f8f2a077ff22fce09c3b9ff4ebefb0627a031e68fd7b1523a93315c3e922 delivery.rs |
| 6 | 6 | b57d63624622ad0d17a0902a48bf9a514d1cb67be99d87d831bca4984d485e37 fixtures.hex |
| 7 | 7 | a1201119b4e74c9466affe0907025ae04ca24afb5d08aa55540fc42385cfe400 fixtures.json |
| 8 | 삭제: 203566ae81a254f4006924b74a3433a18b465950e5f1c9acb69e807809643534 generate_fixtures.py | |
| 8 | 추가: a358a8480c9f3addfcf9ab7572f31858ce59828436a1765faa6e427cfb062e11 generate_fixtures.py | |
| 9 | 9 | 7f26dade709fd7b598739b6e01f56a619a481af6a1c10df881be04d3f5306b60 gzip.rs |
| 10 | 10 | 01282aa60ebb5137faf467ed81f28739c885b44563be57e37cf09a329a323062 main.rs |
| 11 | 11 | 4e2eeaa88b5c592fa9ec936e5b6cd8834c4685fc2104217b177620b1caec7cc6 send.rs |
| @@ -6,6 +6,13 @@ import tarfile | ||
| 6 | 6 | import zlib |
| 7 | 7 | |
| 8 | 8 | |
| 9 | 추가: def gzip_bytes(payload): | |
| 10 | 추가: archive = io.BytesIO() | |
| 11 | 추가: with gzip.GzipFile(filename="", mode="wb", compresslevel=6, fileobj=archive, mtime=0) as writer: | |
| 12 | 추가: writer.write(payload) | |
| 13 | 추가: return archive.getvalue() | |
| 14 | 추가: | |
| 15 | 추가: | |
| 9 | 16 | def build(): |
| 10 | 17 | payload = b"123456789" |
| 11 | 18 | archive = io.BytesIO() |
| @@ -18,8 +25,8 @@ def build(): | ||
| 18 | 25 | tar_bytes = archive.getvalue()[:2048] |
| 19 | 26 | values = { |
| 20 | 27 | "digits": payload, |
| 21 | 삭제: "gzip_digits": gzip.compress(payload, compresslevel=6, mtime=0), | |
| 22 | 삭제: "gzip_empty": gzip.compress(b"", compresslevel=6, mtime=0), | |
| 28 | 추가: "gzip_digits": gzip_bytes(payload), | |
| 29 | 추가: "gzip_empty": gzip_bytes(b""), | |
| 23 | 30 | "ustar_one": tar_bytes, |
| 24 | 31 | "ustar_sha256": hashlib.sha256(tar_bytes).digest(), |
| 25 | 32 | } |
| @@ -0,0 +1,24 @@ | ||
| 1 | 추가: # This file is automatically @generated by Cargo. | |
| 2 | 추가: # It is not intended for manual editing. | |
| 3 | 추가: version = 4 | |
| 4 | 추가: | |
| 5 | 추가: [[package]] | |
| 6 | 추가: name = "libc" | |
| 7 | 추가: version = "0.2.191" | |
| 8 | 추가: source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 9 | 추가: checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" | |
| 10 | 추가: | |
| 11 | 추가: [[package]] | |
| 12 | 추가: name = "zipelo-file-publication" | |
| 13 | 추가: version = "0.1.0" | |
| 14 | 추가: dependencies = [ | |
| 15 | 추가: "libc", | |
| 16 | 추가: ] | |
| 17 | 추가: | |
| 18 | 추가: [[package]] | |
| 19 | 추가: name = "zipelo-file-publication-regressions" | |
| 20 | 추가: version = "0.1.0" | |
| 21 | 추가: dependencies = [ | |
| 22 | 추가: "libc", | |
| 23 | 추가: "zipelo-file-publication", | |
| 24 | 추가: ] |
| @@ -0,0 +1,20 @@ | ||
| 1 | 추가: [package] | |
| 2 | 추가: name = "zipelo-file-publication-regressions" | |
| 3 | 추가: version = "0.1.0" | |
| 4 | 추가: edition = "2024" | |
| 5 | 추가: rust-version = "1.99" | |
| 6 | 추가: license = "MIT" | |
| 7 | 추가: publish = false | |
| 8 | 추가: autotests = false | |
| 9 | 추가: autoexamples = false | |
| 10 | 추가: autobenches = false | |
| 11 | 추가: | |
| 12 | 추가: [[test]] | |
| 13 | 추가: name = "publication_public_api" | |
| 14 | 추가: path = "main.rs" | |
| 15 | 추가: | |
| 16 | 추가: [dependencies] | |
| 17 | 추가: publication = { package = "zipelo-file-publication", path = "../../experiments/rust-file-publication" } | |
| 18 | 추가: libc = { version = "=0.2.191", default-features = false, features = ["std"] } | |
| 19 | 추가: | |
| 20 | 추가: [workspace] |
Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기Diff가 표시 한도를 넘어서 생략했어요.
Raw로 열기