team-ljyzipelo

공개

검증된 폰트와 파일 연결 후보를 통합

작성자
호시노 히나타
작성 시각
커밋
47cac6fe702b545389f075f2339df8c6889a8dd0
이 시점의 파일 보기

변경된 파일 78개

+2,769-7

변경 내용이 커서 일부 파일의 Diff를 생략했어요. 생략한 파일은 파일 보기나 Raw로 확인할 수 있어요.

추가experiments/rust-file-publication/Cargo.lock+16-0
@@ -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추가: ]
추가experiments/rust-file-publication/Cargo.toml+18-0
@@ -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]
추가experiments/rust-file-publication/LICENSE+21-0
@@ -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.
추가experiments/rust-file-publication/SHA256SUMS+9-0
@@ -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
추가experiments/rust-file-publication/THIRD-PARTY-NOTICES.txt+208-0
@@ -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추가:
추가experiments/rust-file-publication/contract.json+90-0
@@ -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추가: }
추가experiments/rust-file-publication/dependencies.json+25-0
@@ -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추가: }
추가experiments/rust-file-publication/src/lib.rs+361-0
@@ -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추가: }
추가experiments/rust-file-publication/src/linux.rs+343-0
@@ -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추가: }
추가experiments/rust-file-publication/static-validation.json+54-0
@@ -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추가: }
추가experiments/rust-gzip-file-job/Cargo.lock+123-0
@@ -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"
추가experiments/rust-gzip-file-job/Cargo.toml+20-0
@@ -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]
추가experiments/rust-gzip-file-job/LICENSE+21-0
@@ -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.
추가experiments/rust-gzip-file-job/SHA256SUMS+10-0
@@ -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
추가experiments/rust-gzip-file-job/THIRD-PARTY-NOTICES.txt

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가experiments/rust-gzip-file-job/contract.json+127-0
@@ -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추가: }
추가experiments/rust-gzip-file-job/dependencies.json+231-0
@@ -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추가: }
추가experiments/rust-gzip-file-job/source-pins.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가experiments/rust-gzip-file-job/src/lib.rs+212-0
@@ -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추가: }
추가experiments/rust-gzip-file-job/src/types.rs+102-0
@@ -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추가: }
추가experiments/rust-gzip-file-job/static-validation.json+256-0
@@ -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추가: }
수정experiments/rust-ui-memory-app/src/app.rs+6-4
@@ -1,3 +1,6 @@
1추가: #[path = "system_font.rs"]
2추가: mod system_font;
3추가:
14use eframe::egui::{self, Color32, FontData, FontDefinitions, FontFamily, FontId, TextStyle};
25use zipelo_ui_memory_app::{
36 controller::{CloseState, Controller},
@@ -155,8 +158,7 @@ impl eframe::App for App {
155158}
156159
157160fn 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)))?;
160162 eframe::run_native(
161163 "Zipelo 합성 메모리 작업",
162164 eframe::NativeOptions {
@@ -168,8 +170,8 @@ fn main() -> eframe::Result {
168170 },
169171 Box::new(move |cc| {
170172 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;
173175 fonts.font_data.insert("noto-kr".into(), data.into());
174176 fonts
175177 .families
추가experiments/rust-ui-memory-app/src/system_font.rs+65-0
@@ -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추가: }
추가tests/python-gzip-fixture-compat/SHA256SUMS+3-0
@@ -0,0 +1,3 @@
1추가: fc7dd6d4bdc0d26553f7d44e545e799f5f2388ce4c9b21573ac3faf016fa9cd4 overlay.json
2추가: ac7696f5dd7ae784ab0a59cc25f0f96794fbf0747bbd00a7419c801ce92a324c verify.py
3추가: 8f3f5d2134f63739e3a4926d3ff9cd1f9c0f9a1ab3047ae38546cc4700c1cf59 static-validation.json
추가tests/python-gzip-fixture-compat/overlay.json+84-0
@@ -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추가: }
추가tests/python-gzip-fixture-compat/static-validation.json+196-0
@@ -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추가: }
추가tests/python-gzip-fixture-compat/verify.py+114-0
@@ -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()
수정tests/rust-app-core-memory/SHA256SUMS+1-1
@@ -5,7 +5,7 @@
55c2c9f8f2a077ff22fce09c3b9ff4ebefb0627a031e68fd7b1523a93315c3e922 delivery.rs
66b57d63624622ad0d17a0902a48bf9a514d1cb67be99d87d831bca4984d485e37 fixtures.hex
77a1201119b4e74c9466affe0907025ae04ca24afb5d08aa55540fc42385cfe400 fixtures.json
8삭제: 203566ae81a254f4006924b74a3433a18b465950e5f1c9acb69e807809643534 generate_fixtures.py
8추가: a358a8480c9f3addfcf9ab7572f31858ce59828436a1765faa6e427cfb062e11 generate_fixtures.py
997f26dade709fd7b598739b6e01f56a619a481af6a1c10df881be04d3f5306b60 gzip.rs
101001282aa60ebb5137faf467ed81f28739c885b44563be57e37cf09a329a323062 main.rs
11114e2eeaa88b5c592fa9ec936e5b6cd8834c4685fc2104217b177620b1caec7cc6 send.rs
수정tests/rust-app-core-memory/generate_fixtures.py+9-2
@@ -6,6 +6,13 @@ import tarfile
66import zlib
77
88
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추가:
916def build():
1017 payload = b"123456789"
1118 archive = io.BytesIO()
@@ -18,8 +25,8 @@ def build():
1825 tar_bytes = archive.getvalue()[:2048]
1926 values = {
2027 "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""),
2330 "ustar_one": tar_bytes,
2431 "ustar_sha256": hashlib.sha256(tar_bytes).digest(),
2532 }
추가tests/rust-file-publication/Cargo.lock+24-0
@@ -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추가: ]
추가tests/rust-file-publication/Cargo.toml+20-0
@@ -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]
추가tests/rust-file-publication/SHA256SUMS

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/boundaries.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/concurrency.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/contract.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/control.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/main.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/models.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/namespace.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/paths.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/run-plan.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/source-pins.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/static_check.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/static_check_helper_tests.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-file-publication/support.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/Cargo.lock

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/Cargo.toml

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/SHA256SUMS

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/concurrency.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/contract.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/control.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/fixtures.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/invalid.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/limits.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/main.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/namespace.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/run-plan.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/source-pins.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/static_check.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/static_check_helper_tests.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/success.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-gzip-file-job/support.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/Cargo.lock

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/Cargo.toml

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/SHA256SUMS

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/contract.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/linux_loader.rs

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/review.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/run-plan.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/source-pins.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-font-regressions/static_check.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-fonts/SHA256SUMS

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-fonts/contract.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-ui-system-fonts/sources.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-verified-integration/SHA256SUMS

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-verified-integration/overlay.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-verified-integration/run-plan.json

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기
추가tests/rust-verified-integration/static_check.py

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기