team-ljyzipelo

공개

GZip 단일 파일 작업 후보를 추가함

작성자
시로사키 하나
작성 시각
커밋
4c6ae4b3a7ab12a992598e94e7b02f3a167fbbd4
이 시점의 파일 보기

변경된 파일 37개

+2,825-0

변경 내용이 커서 일부 파일의 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추가: }
추가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+15-0
@@ -0,0 +1,15 @@
1추가: 7c69de86f84acb7a335c713067ee49f8e094e4c74e6efcca10e0305fa63d5339 Cargo.lock
2추가: 713d89eb8e474cce49a1e2843aac8275a2aad664f7967d5ea959082eb659fc03 Cargo.toml
3추가: 60c29c5ff2d3373f80b72e23c0e8016cf13cc1fc579a5df399b1b0dda2636d69 boundaries.rs
4추가: 4534a3cb59cf7f34793ec12e84664eb8433dffaab2f2fd39657f764519a44793 concurrency.rs
5추가: 6b9a56f1c4c3cbbb4669e939da359929d77cd3fa2468191ba74611f5d1183d87 contract.json
6추가: 79c8db9a22758092d72aeba8fd9a067c0658aab62dceef117f556873b244313c control.rs
7추가: 883cced6a09c7bda45255c4b18829b64f9ac834dd00c28578daf9eb2430be02a main.rs
8추가: c04a1c5e83ab7dcbe5eda7a17e62e40ec15f0cfb1255b19cdca8ec18ea8b2a20 models.rs
9추가: 561d6d778a117dae3803a0c61fffcdc660fcd9b8e3732dec1df97e85e233e948 namespace.rs
10추가: 4b12d23abbbca10fd4efb863085292445357e85d118026cc4104ea035b0fdf9a paths.rs
11추가: 22db9550c49f73ac61efe27dd46a1a90ca7072fea0408c7134a217bdf2f561ff run-plan.json
12추가: 004d847ca5e258e461de570cb8f1c187b807c94457816f7756c1388531a37c6a source-pins.json
13추가: 856c0f14e3e8cab10dd626af85059983869dc822c3f951965090992a4725d52f static_check.py
14추가: 53a7bc6d4cadf3c69c13440d79288b424e9ac1f1873984fba550e7b78664a3f6 static_check_helper_tests.py
15추가: 57dcc3e198e0f7d35e61d134dd908be1d72cc2dba534ee2767452f94edab44ba support.rs
추가tests/rust-file-publication/boundaries.rs+230-0
@@ -0,0 +1,230 @@
1추가: use crate::support::*;
2추가: use publication::{
3추가: Error, Limits, MAX_BYTES, MAX_IO_BYTES, MAX_IO_CALLS, Publication, Request, Stop, Usage,
4추가: };
5추가: use std::{ffi::OsStr, path::Path, time::Duration};
6추가:
7추가: fn boundary(length: usize) {
8추가: let sandbox = Sandbox::new();
9추가: let bytes = pattern(length);
10추가: let before = bytes.clone();
11추가: let parent = sandbox.parent();
12추가: let report = publish(&parent, OsStr::new("output"), &bytes, Limits::default());
13추가: committed(report, &parent, OsStr::new("output"), &before);
14추가: assert_eq!(bytes, before);
15추가: sandbox.finish();
16추가: }
17추가:
18추가: #[test]
19추가: fn empty() {
20추가: boundary(0);
21추가: }
22추가: #[test]
23추가: fn one() {
24추가: boundary(1);
25추가: }
26추가: #[test]
27추가: fn chunk_minus_one() {
28추가: boundary(65_535);
29추가: }
30추가: #[test]
31추가: fn chunk() {
32추가: boundary(65_536);
33추가: }
34추가: #[test]
35추가: fn chunk_plus_one() {
36추가: boundary(65_537);
37추가: }
38추가: #[test]
39추가: fn maximum_minus_one() {
40추가: boundary(16_777_215);
41추가: }
42추가: #[test]
43추가: fn maximum() {
44추가: boundary(16_777_216);
45추가: }
46추가:
47추가: #[test]
48추가: fn invalid_limits_precede_paths_and_callback() {
49추가: for limits in [
50추가: Limits {
51추가: max_bytes: MAX_BYTES + 1,
52추가: ..Limits::default()
53추가: },
54추가: Limits {
55추가: max_io_bytes: MAX_IO_BYTES + 1,
56추가: ..Limits::default()
57추가: },
58추가: Limits {
59추가: max_io_calls: MAX_IO_CALLS + 1,
60추가: ..Limits::default()
61추가: },
62추가: Limits {
63추가: max_duration: Duration::ZERO,
64추가: ..Limits::default()
65추가: },
66추가: Limits {
67추가: max_duration: Duration::from_secs(301),
68추가: ..Limits::default()
69추가: },
70추가: ] {
71추가: let (task, cancel) = Publication::new();
72추가: let report = task.publish(
73추가: Request {
74추가: parent: Path::new("invalid"),
75추가: leaf: OsStr::new(""),
76추가: bytes: &[],
77추가: limits,
78추가: },
79추가: |_| -> Result<(), Stop<()>> { panic!("callback must not run") },
80추가: );
81추가: let (error, usage, closed) = not_committed(report);
82추가: assert!(matches!(error, Error::InvalidLimits));
83추가: assert_eq!(usage, Usage::default());
84추가: cleanup(&closed, 0);
85추가: assert_eq!(cancel.request(), publication::CancelDecision::Finished);
86추가: }
87추가: }
88추가:
89추가: #[test]
90추가: fn oversized_input_rejected_without_io() {
91추가: let bytes = pattern(MAX_BYTES as usize + 1);
92추가: let report = publish(
93추가: Path::new("invalid"),
94추가: OsStr::new("output"),
95추가: &bytes,
96추가: Limits::default(),
97추가: );
98추가: let (error, usage, closed) = not_committed(report);
99추가: assert!(matches!(error, Error::LimitExceeded));
100추가: assert_eq!(usage, Usage::default());
101추가: cleanup(&closed, 0);
102추가: }
103추가:
104추가: #[test]
105추가: fn zero_byte_limit_accepts_empty_with_exact_eof_budget() {
106추가: let sandbox = Sandbox::new();
107추가: let parent = sandbox.parent();
108추가: let limits = Limits {
109추가: max_bytes: 0,
110추가: max_io_bytes: 1,
111추가: max_io_calls: 1,
112추가: ..Limits::default()
113추가: };
114추가: committed(
115추가: publish(&parent, OsStr::new("output"), &[], limits),
116추가: &parent,
117추가: OsStr::new("output"),
118추가: &[],
119추가: );
120추가: sandbox.finish();
121추가: }
122추가:
123추가: #[test]
124추가: fn zero_byte_limit_rejects_payload_before_path_validation() {
125추가: let (error, usage, closed) = not_committed(publish(
126추가: Path::new("invalid"),
127추가: OsStr::new("output"),
128추가: b"x",
129추가: Limits {
130추가: max_bytes: 0,
131추가: ..Limits::default()
132추가: },
133추가: ));
134추가: assert!(matches!(error, Error::LimitExceeded));
135추가: assert_eq!(usage, Usage::default());
136추가: cleanup(&closed, 0);
137추가: }
138추가:
139추가: fn empty_budget(limits: Limits) {
140추가: let sandbox = Sandbox::new();
141추가: let (error, usage, closed) = not_committed(publish(
142추가: &sandbox.parent(),
143추가: OsStr::new("output"),
144추가: &[],
145추가: limits,
146추가: ));
147추가: assert!(matches!(error, Error::LimitExceeded));
148추가: assert_eq!(usage.open_calls, 2);
149추가: assert_eq!(usage.metadata_calls, 3);
150추가: assert_eq!(usage.sync_calls, 1);
151추가: assert_eq!(
152추가: usage.write_calls + usage.read_calls + usage.reserved_io_bytes + usage.link_calls,
153추가: 0
154추가: );
155추가: cleanup(&closed, 2);
156추가: assert!(names(&sandbox.parent()).is_empty());
157추가: sandbox.finish();
158추가: }
159추가:
160추가: #[test]
161추가: fn zero_io_budget_fails_eof_without_refund() {
162추가: empty_budget(Limits {
163추가: max_io_bytes: 0,
164추가: ..Limits::default()
165추가: });
166추가: }
167추가:
168추가: #[test]
169추가: fn zero_call_budget_is_valid_but_cannot_probe_eof() {
170추가: empty_budget(Limits {
171추가: max_io_calls: 0,
172추가: ..Limits::default()
173추가: });
174추가: }
175추가:
176추가: #[test]
177추가: fn exact_io_and_call_budget_includes_eof() {
178추가: let sandbox = Sandbox::new();
179추가: let parent = sandbox.parent();
180추가: let bytes = pattern(65_537);
181추가: let limits = Limits {
182추가: max_io_bytes: 131_075,
183추가: max_io_calls: 5,
184추가: ..Limits::default()
185추가: };
186추가: committed(
187추가: publish(&parent, OsStr::new("output"), &bytes, limits),
188추가: &parent,
189추가: OsStr::new("output"),
190추가: &bytes,
191추가: );
192추가: sandbox.finish();
193추가: }
194추가:
195추가: fn last_eof_limit(limits: Limits) {
196추가: let sandbox = Sandbox::new();
197추가: let (error, usage, closed) = not_committed(publish(
198추가: &sandbox.parent(),
199추가: OsStr::new("output"),
200추가: &pattern(65_537),
201추가: limits,
202추가: ));
203추가: assert!(matches!(error, Error::LimitExceeded));
204추가: assert_eq!(usage.write_calls, 2);
205추가: assert_eq!(usage.read_calls, 2);
206추가: assert_eq!(usage.reserved_io_bytes, 131_074);
207추가: assert_eq!(usage.actual_written_bytes, 65_537);
208추가: assert_eq!(usage.actual_read_bytes, 65_537);
209추가: assert_eq!(usage.link_calls, 0);
210추가: assert_eq!(usage.sync_calls, 1);
211추가: cleanup(&closed, 2);
212추가: assert!(names(&sandbox.parent()).is_empty());
213추가: sandbox.finish();
214추가: }
215추가:
216추가: #[test]
217추가: fn one_less_io_budget_stops_before_last_eof() {
218추가: last_eof_limit(Limits {
219추가: max_io_bytes: 131_074,
220추가: ..Limits::default()
221추가: });
222추가: }
223추가:
224추가: #[test]
225추가: fn one_less_call_budget_stops_before_last_eof() {
226추가: last_eof_limit(Limits {
227추가: max_io_calls: 4,
228추가: ..Limits::default()
229추가: });
230추가: }
추가tests/rust-file-publication/concurrency.rs+125-0
@@ -0,0 +1,125 @@
1추가: use crate::support::*;
2추가: use publication::{CancelDecision, Error, Limits, Outcome, Publication, Request, Stage, Stop};
3추가: use std::{ffi::OsStr, sync::mpsc, thread, time::Duration};
4추가:
5추가: const WAIT: Duration = Duration::from_secs(5);
6추가:
7추가: #[test]
8추가: fn two_prepared_publishers_have_exactly_one_complete_winner() {
9추가: let sandbox = Sandbox::new();
10추가: let parent = sandbox.parent();
11추가: let (ready_tx, ready_rx) = mpsc::sync_channel(2);
12추가: let (done_tx, done_rx) = mpsc::sync_channel(2);
13추가: let mut releases = Vec::new();
14추가: let mut handles = Vec::new();
15추가: for marker in [65_u8, 66_u8] {
16추가: let (release_tx, release_rx) = mpsc::sync_channel(1);
17추가: releases.push(release_tx);
18추가: let ready = ready_tx.clone();
19추가: let done = done_tx.clone();
20추가: let parent = parent.clone();
21추가: handles.push(thread::spawn(move || {
22추가: let bytes = vec![marker; 65_537];
23추가: let (task, cancel) = Publication::new();
24추가: let report = task.publish(
25추가: Request {
26추가: parent: &parent,
27추가: leaf: OsStr::new("output"),
28추가: bytes: &bytes,
29추가: limits: Limits::default(),
30추가: },
31추가: |point| {
32추가: if point.stage == Stage::BeforeCommit {
33추가: ready.send(marker).unwrap();
34추가: release_rx
35추가: .recv_timeout(WAIT)
36추가: .expect("게시 해제 신호 시간 초과");
37추가: }
38추가: Ok::<_, Stop<()>>(())
39추가: },
40추가: );
41추가: assert_eq!(cancel.request(), CancelDecision::Finished);
42추가: assert!(done.send((marker, report)).is_ok());
43추가: }));
44추가: }
45추가: drop(ready_tx);
46추가: drop(done_tx);
47추가: let mut ready = vec![
48추가: ready_rx.recv_timeout(WAIT).unwrap(),
49추가: ready_rx.recv_timeout(WAIT).unwrap(),
50추가: ];
51추가: ready.sort();
52추가: assert_eq!(ready, [65, 66]);
53추가: assert!(names(&parent).is_empty());
54추가: for release in releases {
55추가: release.send(()).unwrap();
56추가: }
57추가: let results = [
58추가: done_rx.recv_timeout(WAIT).unwrap(),
59추가: done_rx.recv_timeout(WAIT).unwrap(),
60추가: ];
61추가: for handle in handles {
62추가: handle.join().expect("게시 스레드 실패");
63추가: }
64추가: assert_eq!(
65추가: results
66추가: .iter()
67추가: .filter(|(_, r)| matches!(&r.outcome, Outcome::Committed { .. }))
68추가: .count(),
69추가: 1
70추가: );
71추가: for (marker, report) in results {
72추가: if matches!(&report.outcome, Outcome::Committed { .. }) {
73추가: committed(report, &parent, OsStr::new("output"), &vec![marker; 65_537]);
74추가: } else {
75추가: conflict(report, 65_537);
76추가: }
77추가: }
78추가: sandbox.finish();
79추가: }
80추가:
81추가: #[test]
82추가: fn acknowledged_cancellation_before_commit_prevents_link() {
83추가: let sandbox = Sandbox::new();
84추가: let parent = sandbox.parent();
85추가: let worker_parent = parent.clone();
86추가: let (task, cancel) = Publication::new();
87추가: let (ready_tx, ready_rx) = mpsc::sync_channel(1);
88추가: let (release_tx, release_rx) = mpsc::sync_channel(1);
89추가: let (done_tx, done_rx) = mpsc::sync_channel(1);
90추가: let handle = thread::spawn(move || {
91추가: let report = task.publish(
92추가: Request {
93추가: parent: &worker_parent,
94추가: leaf: OsStr::new("output"),
95추가: bytes: b"abc",
96추가: limits: Limits::default(),
97추가: },
98추가: |point| {
99추가: if point.stage == Stage::BeforeCommit {
100추가: ready_tx.send(()).unwrap();
101추가: release_rx
102추가: .recv_timeout(WAIT)
103추가: .expect("취소 확인 신호 시간 초과");
104추가: }
105추가: Ok::<_, Stop<()>>(())
106추가: },
107추가: );
108추가: assert!(done_tx.send(report).is_ok());
109추가: });
110추가: ready_rx.recv_timeout(WAIT).unwrap();
111추가: assert_eq!(cancel.request(), CancelDecision::Requested);
112추가: assert_eq!(cancel.request(), CancelDecision::AlreadyRequested);
113추가: release_tx.send(()).unwrap();
114추가: let report = done_rx.recv_timeout(WAIT).unwrap();
115추가: handle.join().expect("취소 스레드 실패");
116추가: let (error, usage, closed) = not_committed(report);
117추가: assert!(matches!(error, Error::Cancelled));
118추가: assert_eq!(usage.link_calls, 0);
119추가: assert_eq!(usage.actual_written_bytes, 3);
120추가: assert_eq!(usage.actual_read_bytes, 3);
121추가: cleanup(&closed, 4);
122추가: assert_eq!(cancel.request(), CancelDecision::Finished);
123추가: assert!(names(&parent).is_empty());
124추가: sandbox.finish();
125추가: }
추가tests/rust-file-publication/contract.json+164-0
@@ -0,0 +1,164 @@
1추가: {
2추가: "schema": "zipelo.file-publication.regressions.v1",
3추가: "source_head": "10dc446c90d3527437298cff270b26d2e196a748",
4추가: "source_manifest_sha256": "cc4e4cc64a8f3b537df554c7d2895ea3722fbfb0906f1ada767d5cf9b5d8bbc6",
5추가: "branch": "fix/rust-file-publication-regressions",
6추가: "scope": "Source/static candidate. Rust compilation, discovery and runtime have not been performed. Frozen production path dependency; no private access, include!, copied implementation or syscall interposition.",
7추가: "declared_test_count": 54,
8추가: "test_names": [
9추가: "boundaries::chunk",
10추가: "boundaries::chunk_minus_one",
11추가: "boundaries::chunk_plus_one",
12추가: "boundaries::empty",
13추가: "boundaries::exact_io_and_call_budget_includes_eof",
14추가: "boundaries::invalid_limits_precede_paths_and_callback",
15추가: "boundaries::maximum",
16추가: "boundaries::maximum_minus_one",
17추가: "boundaries::one",
18추가: "boundaries::one_less_call_budget_stops_before_last_eof",
19추가: "boundaries::one_less_io_budget_stops_before_last_eof",
20추가: "boundaries::oversized_input_rejected_without_io",
21추가: "boundaries::zero_byte_limit_accepts_empty_with_exact_eof_budget",
22추가: "boundaries::zero_byte_limit_rejects_payload_before_path_validation",
23추가: "boundaries::zero_call_budget_is_valid_but_cannot_probe_eof",
24추가: "boundaries::zero_io_budget_fails_eof_without_refund",
25추가: "concurrency::acknowledged_cancellation_before_commit_prevents_link",
26추가: "concurrency::two_prepared_publishers_have_exactly_one_complete_winner",
27추가: "control::callback_cancel_precedes_expired_deadline",
28추가: "control::callback_error_precedes_expired_deadline",
29추가: "control::callback_panic_has_no_report_or_named_output",
30추가: "control::callback_preserves_non_send_error_and_wins_over_cancel",
31추가: "control::cancel_after_first_chunk_preserves_reservations",
32추가: "control::cancel_before_commit_closes_four_handles_without_link",
33추가: "control::cancel_before_sync_preserves_written_usage",
34추가: "control::cancel_before_write_closes_anonymous_temp",
35추가: "control::cancel_first_opening_has_no_handles",
36추가: "control::cancel_second_opening_closes_parent",
37추가: "control::cancellation_after_return_preserves_committed_output",
38추가: "control::checkpoints_keep_output_absent_and_close_owned_descriptors",
39추가: "control::dropping_unused_publication_marks_finished_without_io",
40추가: "control::natural_elapsed_deadline_stops_before_open",
41추가: "control::pre_requested_cancel_is_idempotent_and_stops_before_open",
42추가: "models::constructed_cleanup_failures_are_never_all_successful",
43추가: "models::public_types_support_transfer_without_forging_receipts",
44추가: "namespace::destination_created_at_last_checkpoint_is_preserved",
45추가: "namespace::parent_replaced_after_open_commits_to_held_directory",
46추가: "namespace::parent_replaced_before_commit_keeps_receipt_on_old_parent",
47추가: "namespace::removed_parent_returns_uncertain_original_errno_without_receipt",
48추가: "paths::dangling_symlink_preserved",
49추가: "paths::existing_directory_and_child_preserved",
50추가: "paths::existing_fifo_preserved_without_opening_it",
51추가: "paths::existing_hard_links_preserved",
52추가: "paths::existing_regular_file_preserved",
53추가: "paths::existing_socket_preserved_without_accepting_connections",
54추가: "paths::existing_symlink_and_target_preserved",
55추가: "paths::invalid_leaf_forms_rejected_before_callback",
56추가: "paths::invalid_parent_forms_rejected_before_callback",
57추가: "paths::linux_backslash_and_colon_are_leaf_bytes",
58추가: "paths::maximum_leaf_length_is_supported",
59추가: "paths::missing_and_regular_parent_preserve_errno",
60추가: "paths::non_utf8_leaf_and_parent_are_supported",
61추가: "paths::parent_and_ancestor_symlinks_rejected",
62추가: "paths::root_parent_is_lexically_valid_without_opening_root"
63추가: ],
64추가: "evidence_classes": {
65추가: "boundaries::chunk": "real-file-public-api",
66추가: "boundaries::chunk_minus_one": "real-file-public-api",
67추가: "boundaries::chunk_plus_one": "real-file-public-api",
68추가: "boundaries::empty": "real-file-public-api",
69추가: "boundaries::exact_io_and_call_budget_includes_eof": "real-file-public-api",
70추가: "boundaries::invalid_limits_precede_paths_and_callback": "public-validation-no-file",
71추가: "boundaries::maximum": "real-file-public-api",
72추가: "boundaries::maximum_minus_one": "real-file-public-api",
73추가: "boundaries::one": "real-file-public-api",
74추가: "boundaries::one_less_call_budget_stops_before_last_eof": "real-file-public-api",
75추가: "boundaries::one_less_io_budget_stops_before_last_eof": "real-file-public-api",
76추가: "boundaries::oversized_input_rejected_without_io": "public-validation-no-file",
77추가: "boundaries::zero_byte_limit_accepts_empty_with_exact_eof_budget": "real-file-public-api",
78추가: "boundaries::zero_byte_limit_rejects_payload_before_path_validation": "public-validation-no-file",
79추가: "boundaries::zero_call_budget_is_valid_but_cannot_probe_eof": "real-file-public-api",
80추가: "boundaries::zero_io_budget_fails_eof_without_refund": "real-file-public-api",
81추가: "concurrency::acknowledged_cancellation_before_commit_prevents_link": "real-file-bounded-thread-handshake",
82추가: "concurrency::two_prepared_publishers_have_exactly_one_complete_winner": "real-file-bounded-thread-handshake",
83추가: "control::callback_cancel_precedes_expired_deadline": "natural-elapsed-callback-no-file",
84추가: "control::callback_error_precedes_expired_deadline": "natural-elapsed-callback-no-file",
85추가: "control::callback_panic_has_no_report_or_named_output": "real-file-callback-control",
86추가: "control::callback_preserves_non_send_error_and_wins_over_cancel": "real-file-callback-control",
87추가: "control::cancel_after_first_chunk_preserves_reservations": "real-file-callback-control",
88추가: "control::cancel_before_commit_closes_four_handles_without_link": "real-file-callback-control",
89추가: "control::cancel_before_sync_preserves_written_usage": "real-file-callback-control",
90추가: "control::cancel_before_write_closes_anonymous_temp": "real-file-callback-control",
91추가: "control::cancel_first_opening_has_no_handles": "real-file-callback-control",
92추가: "control::cancel_second_opening_closes_parent": "real-file-callback-control",
93추가: "control::cancellation_after_return_preserves_committed_output": "real-file-callback-control",
94추가: "control::checkpoints_keep_output_absent_and_close_owned_descriptors": "real-file-callback-control",
95추가: "control::dropping_unused_publication_marks_finished_without_io": "public-state-no-file",
96추가: "control::natural_elapsed_deadline_stops_before_open": "natural-elapsed-callback-no-file",
97추가: "control::pre_requested_cancel_is_idempotent_and_stops_before_open": "public-state-no-file",
98추가: "models::constructed_cleanup_failures_are_never_all_successful": "constructed-cleanup-value-only",
99추가: "models::public_types_support_transfer_without_forging_receipts": "compile-bound-assertions",
100추가: "namespace::destination_created_at_last_checkpoint_is_preserved": "real-file-checkpoint-namespace-mutation",
101추가: "namespace::parent_replaced_after_open_commits_to_held_directory": "real-file-checkpoint-namespace-mutation",
102추가: "namespace::parent_replaced_before_commit_keeps_receipt_on_old_parent": "real-file-checkpoint-namespace-mutation",
103추가: "namespace::removed_parent_returns_uncertain_original_errno_without_receipt": "real-file-checkpoint-namespace-mutation",
104추가: "paths::dangling_symlink_preserved": "real-file-public-api",
105추가: "paths::existing_directory_and_child_preserved": "real-file-public-api",
106추가: "paths::existing_fifo_preserved_without_opening_it": "real-file-public-api",
107추가: "paths::existing_hard_links_preserved": "real-file-public-api",
108추가: "paths::existing_regular_file_preserved": "real-file-public-api",
109추가: "paths::existing_socket_preserved_without_accepting_connections": "real-file-public-api",
110추가: "paths::existing_symlink_and_target_preserved": "real-file-public-api",
111추가: "paths::invalid_leaf_forms_rejected_before_callback": "public-validation-no-file",
112추가: "paths::invalid_parent_forms_rejected_before_callback": "public-validation-no-file",
113추가: "paths::linux_backslash_and_colon_are_leaf_bytes": "real-file-public-api",
114추가: "paths::maximum_leaf_length_is_supported": "real-file-public-api",
115추가: "paths::missing_and_regular_parent_preserve_errno": "real-file-public-api",
116추가: "paths::non_utf8_leaf_and_parent_are_supported": "real-file-public-api",
117추가: "paths::parent_and_ancestor_symlinks_rejected": "real-file-public-api",
118추가: "paths::root_parent_is_lexically_valid_without_opening_root": "public-validation-no-file"
119추가: },
120추가: "fixture_provenance": {
121추가: "inputs": "Only source-defined pattern(i)=(i*37+11)%251, fixed literals and bounded repeated bytes. No archive or user-file inputs.",
122추가: "paths": "Future approved runner exclusively creates mode-0700 tests/rust-file-publication/runs. Each case creates exclusive case-PID-counter and a mode-0700 parent. Tests may only publish/create/move/remove their own synthetic paths. No global cwd, environment, umask, permission or ownership changes.",
123추가: "special_files": "Synthetic FIFO through existing libc::mkfifo, unconnected local Unix socket, symlinks and hard links. No device nodes, mounts or system special-file writes.",
124추가: "filesystem": "Linux magic ef53 (ext family) or 58465342 (XFS), exclusively managed by effective UID. The current tests directory reports ef53 in read-only stat inspection; O_TMPFILE/linkat/fsync are unverified until execution. Unsupported environment must stop, not skip or silently fall back.",
125추가: "boundaries": [
126추가: 0,
127추가: 1,
128추가: 65535,
129추가: 65536,
130추가: 65537,
131추가: 16777215,
132추가: 16777216,
133추가: 16777217
134추가: ]
135추가: },
136추가: "acceptance": {
137추가: "committed": "Actual file-layer receipt, matching held parent/file identity and length, exact complete output bytes, nlink=1, no group/other permissions, two successful fsync returns and four reported closes. This is not worker, archive, product Published or crash-recovery proof.",
138추가: "accounting": "For normal full transfers: write calls ceil(N/65536), read calls ceil(N/65536)+1, reserved bytes 2*N+1, actual read/write N each, open 4, metadata 5, link 1. Conflict/uncertain link has sync 1; committed normal path sync 2. Checks cover observed full transfers, not proof all syscalls always transfer fully.",
139추가: "collision": "Existing regular file, directory child, symlink/target, dangling symlink, hard link, FIFO and Unix socket preserve identity/type/link count/size and applicable bytes. Late checkpoint insertion is also EEXIST. No overwrite/unlink/copy fallback.",
140추가: "concurrent_publishers": "Two real std threads both reach BeforeCommit before release; one complete payload and one native EEXIST. Winner not predetermined. Bounded independent channels replace unbounded Barrier. No OS worker or product isolation.",
141추가: "cancel": "Pre-request and repeated request; cancellation at each stage and after first chunk; acknowledged cancellation before commit via actual channel handshake has link_calls=0. Cancel after returned report is Finished and cannot remove output. Callback errors preserve non-Send Rc identity and beat simultaneous cancellation.",
142추가: "namespace": "Rename/replacement at second Opening and BeforeCommit publishes into held old directory and preserves the replacement parent's output. Removing the empty held parent at BeforeCommit expects CommitUncertain(ENOENT), no receipt, one link attempt and no retry.",
143추가: "cleanup": "Normal returns assert close attempt counts and no recorded close errors. /proc/self/fd inspection observes no remaining descriptors whose targets are below the owned sandbox; it does not independently identify every procfs descriptor or prove physical storage deletion. Anonymous temp names are never treated as named output.",
144추가: "failure_preservation": "Every assertion completes before explicit Sandbox::finish. No Drop cleanup. Any panic/error/timeout leaves synthetic paths for inspection and halts subsequent cases. finish verifies original directory identity and absence of owned-target fd references before removing only that case root.",
145추가: "panic": "One intentionally caught callback panic observes Finished, no output and no owned-target fd references. No Report exists; RAII close errors and procfs fd cleanup remain unverified.",
146추가: "models": "Constructed Cleanup failures test only value/API interpretation. EIO/EINTR values are synthetic, never actual close failures. all_close_calls_succeeded with attempted=0 is vacuously true, not work completion evidence.",
147추가: "deadline": "Three callback cases sleep 10 ms against 1 ms cooperative budget. Natural elapsed behavior only; no injected clock, hard I/O deadline or timing-race guarantee.",
148추가: "old_results": "PR48 a02146e1 72-pass evidence and existing 16 comparison failures/seven unverified results remain intact, outside this count."
149추가: },
150추가: "unverified": [
151추가: "Positive short/zero write, read short/zero/corruption/EINTR/EIO, lseek failure and allocator failure: no public raw-I/O injection boundary.",
152추가: "File fsync failure, parent fsync failure after successful link, close failure/EINTR and exact close order with actual failing syscalls. Constructed Cleanup values are not adapter evidence.",
153추가: "CancelDecision::TooLate inside Committing and cancellation in the final-check-to-CAS race. Public checkpoints do not occur after CAS; no artificial proof is inserted.",
154추가: "UntrustedParent from foreign UID or writable mode, hostile same-UID actors, ACL/LSM policies, procfs substitution, unsupported filesystem/kernel, EXDEV and arbitrary commit errors. No chown/chmod/mount/environment changes.",
155추가: "Opaque receipt constructor compile-fail tests, non-Linux runtime, Windows/VM, all-descriptor leaks, physical temp deletion, arbitrary crash consistency and original-path persistence.",
156추가: "OS worker launch/identity/EOF/reap, execveat EACCES retry/bypass, publication of real archives or product UI. Existing held probes stay deferred."
157추가: ],
158추가: "execution_plan": "run-plan.json",
159추가: "preserved_snapshot_evidence": {
160추가: "result-audit.json": "4fa9c54270af4a71f7cc0f8e5ece8ea89df11176b9fc5793bdbd8ef118437661",
161추가: "verification.json": "6ea314425b09266b1487ccecf5de4ebb2359f0875fe2d52c01eb32644e582658",
162추가: "evidence-sha256sums": "5cce3913aa81aec56196111ca023698272c75275414b61a9eec0b89dca886108"
163추가: }
164추가: }
추가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로 열기