team-ljyzipelo

공개

합성 메모리 작업 UI 후보를 추가함

작성자
호시노 히나타
작성 시각
커밋
d188493ff6b82f4aef4c648405be07316da36eb0
부모
23b8d1c
이 시점의 파일 보기

변경된 파일 22개

+1,969-0
추가experiments/rust-ui-memory-app/Cargo.lock

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

Raw로 열기
추가experiments/rust-ui-memory-app/Cargo.toml+30-0
@@ -0,0 +1,30 @@
1추가: [package]
2추가: name = "zipelo-ui-memory-app"
3추가: version = "0.1.0"
4추가: edition = "2024"
5추가: rust-version = "1.99"
6추가: license = "MIT"
7추가: publish = false
8추가: autotests = false
9추가:
10추가: [workspace]
11추가:
12추가: [lib]
13추가: doctest = false
14추가:
15추가: [features]
16추가: default = []
17추가: ui = ["dep:eframe"]
18추가:
19추가: [dependencies]
20추가: core_memory = { package = "zipelo-app-core-memory", path = "../rust-app-core-memory" }
21추가: eframe = { version = "=0.37.0", optional = true, default-features = false, features = ["accesskit", "clipboard", "glow", "system_fonts", "wayland", "x11"] }
22추가:
23추가: [[bin]]
24추가: name = "zipelo-ui-memory-app"
25추가: path = "src/app.rs"
26추가: required-features = ["ui"]
27추가:
28추가: [[test]]
29추가: name = "ui_memory"
30추가: path = "../../tests/rust-ui-memory-app/regressions.rs"
추가experiments/rust-ui-memory-app/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-ui-memory-app/THIRD-PARTY-NOTICES.txt+11-0
@@ -0,0 +1,11 @@
1추가: Zipelo 합성 메모리 UI 후보
2추가: 자체 코드: MIT. LICENSE에 원문을 포함함.
3추가: 직접 의존성: 고정 PR42의 zipelo-app-core-memory와 선택적 eframe 0.37.0임.
4추가: eframe feature: accesskit, clipboard, glow, system_fonts, wayland, x11임.
5추가: 기존 PR34 및 PR42 lock에 있는 package/version/checksum만 사용함.
6추가: 플랫폼별 선택 feature, SPDX license, 캐시 archive checksum, 라이선스 파일의 상대 경로와 SHA256은 tests/rust-ui-memory-app/dependencies.json에 기록함.
7추가: 원문 출처는 해당 checksum의 crates.io crate archive와 그 archive에서 풀린 registry source임.
8추가: Linux headless/GUI 빌드만 수행함. Windows GNU/MSVC는 선택 그래프 분석이며 빌드/실행을 뜻하지 않음.
9추가: 설치된 Noto CJK 폰트는 런타임 경로에서 읽으며 이 후보에 재배포하지 않음.
10추가: 이 기록은 최종 설치기/배포용 전체 고지를 완료했다는 뜻이 아님.
11추가: crate에 원문이 없는 GUI package의 고정 upstream 보충 원문은 기존 PR34에서 보존한 tests/rust-ui-memory-app/license-supplement.json을 사용함. 원래 URL과 원문을 그대로 보존하며 새로운 네트워크 조회를 하지 않음.
추가experiments/rust-ui-memory-app/src/app.rs+198-0
@@ -0,0 +1,198 @@
1추가: use eframe::egui::{self, Color32, FontData, FontDefinitions, FontFamily, FontId, TextStyle};
2추가: use zipelo_ui_memory_app::{
3추가: controller::{CloseState, Controller},
4추가: runtime::Action,
5추가: };
6추가:
7추가: #[derive(Default)]
8추가: struct App {
9추가: controller: Controller,
10추가: }
11추가:
12추가: impl eframe::App for App {
13추가: fn ui(&mut self, root: &mut egui::Ui, _frame: &mut eframe::Frame) {
14추가: self.controller.poll();
15추가: let ctx = root.ctx().clone();
16추가: if ctx.input(|i| i.viewport().close_requested()) {
17추가: self.controller.request_close();
18추가: if self.controller.close != CloseState::Allowed {
19추가: ctx.send_viewport_cmd(egui::ViewportCommand::CancelClose);
20추가: }
21추가: }
22추가: if self.controller.close == CloseState::Allowed {
23추가: ctx.send_viewport_cmd(egui::ViewportCommand::Close);
24추가: }
25추가: egui::Panel::top("actions").show(root, |ui| {
26추가: ui.heading("Zipelo 메모리 작업실");
27추가: ui.label("합성 입력 전용 / 파일 저장 미지원");
28추가: ui.horizontal_wrapped(|ui| {
29추가: for (label, action) in [
30추가: ("ZIP 생성", Action::Zip),
31추가: ("USTAR 목록과 내용", Action::Ustar),
32추가: ("GZip 검증과 내용", Action::Gzip),
33추가: ("합성 오류 확인", Action::InvalidGzip),
34추가: ] {
35추가: if ui
36추가: .add_enabled(
37추가: !self.controller.busy() && self.controller.close == CloseState::Open,
38추가: egui::Button::new(label),
39추가: )
40추가: .clicked()
41추가: {
42추가: self.controller.start(action);
43추가: }
44추가: }
45추가: if ui
46추가: .add_enabled(self.controller.busy(), egui::Button::new("취소 요청"))
47추가: .clicked()
48추가: {
49추가: self.controller.cancel();
50추가: }
51추가: if ui.button("닫기").clicked() {
52추가: self.controller.request_close();
53추가: }
54추가: });
55추가: });
56추가: egui::Panel::bottom("status").show(root, |ui| {
57추가: ui.label(self.controller.status_text());
58추가: if let Some(progress) = self.controller.progress {
59추가: ui.label(format!("{:?}: {}", progress.metric, progress.value));
60추가: }
61추가: ui.label("USTAR 내용 무결성 검증 정보는 제공되지 않음");
62추가: if self.controller.busy() {
63추가: ui.label("작업 스레드 종료 확인 전에는 다시 시작하거나 닫지 않습니다");
64추가: }
65추가: if let Some(error) = &self.controller.spawn_error {
66추가: ui.label(format!(
67추가: "작업 시작 실패: {}",
68추가: format!("{error:?}").chars().take(256).collect::<String>()
69추가: ));
70추가: }
71추가: if let Some(completion) = &self.controller.terminal {
72추가: if !completion.outcome.is_ok() || completion.delivery.is_some() {
73추가: let detail = match &completion.outcome {
74추가: zipelo_ui_memory_app::runtime::Outcome::Zip(t) => {
75추가: format!("{:?}", t.result().err())
76추가: }
77추가: zipelo_ui_memory_app::runtime::Outcome::Ustar(t) => {
78추가: format!("{:?}", t.result().err())
79추가: }
80추가: zipelo_ui_memory_app::runtime::Outcome::Gzip(t) => {
81추가: format!("{:?}", t.result().err())
82추가: }
83추가: };
84추가: ui.label(format!(
85추가: "반환 원인: {}",
86추가: detail.chars().take(512).collect::<String>()
87추가: ));
88추가: if let Some(fault) = completion.delivery {
89추가: ui.label(format!(
90추가: "UI 전달 원인: {:?}, 최초 누락 {}",
91추가: fault.kind, fault.first_missing_sequence
92추가: ));
93추가: }
94추가: }
95추가: }
96추가: });
97추가: egui::CentralPanel::default_margins().show(root, |ui| {
98추가: ui.columns(2, |columns| {
99추가: columns[0].heading("메모리 결과 목록");
100추가: let rows: Vec<String> = self
101추가: .controller
102추가: .rows()
103추가: .into_iter()
104추가: .map(str::to_owned)
105추가: .collect();
106추가: for (index, name) in rows.iter().enumerate() {
107추가: if columns[0]
108추가: .selectable_label(
109추가: self.controller.selected.is_some_and(|(_, _, i)| i == index),
110추가: name,
111추가: )
112추가: .clicked()
113추가: {
114추가: if let Some(task) = &self.controller.task {
115추가: self.controller
116추가: .select(task.id, self.controller.generation, index);
117추가: }
118추가: }
119추가: }
120추가: columns[1].heading("선택한 내용");
121추가: if let Some(bytes) = self.controller.selected_bytes() {
122추가: columns[1].label(format!("원본 {} bytes / 텍스트 최대 2048자", bytes.len()));
123추가: }
124추가: columns[1].label(self.controller.preview());
125추가: });
126추가: });
127추가: if self.controller.close == CloseState::Confirming {
128추가: egui::Window::new("작업 중 닫기")
129추가: .collapsible(false)
130추가: .resizable(false)
131추가: .show(&ctx, |ui| {
132추가: ui.label("취소를 요청하고 작업 스레드 종료를 기다릴까요?");
133추가: if ui.button("계속 열기").clicked() {
134추가: self.controller.keep_open();
135추가: }
136추가: if ui.button("취소 후 닫기").clicked() {
137추가: self.controller.confirm_close();
138추가: }
139추가: });
140추가: }
141추가: if self.controller.close == CloseState::Waiting {
142추가: egui::Window::new("종료 대기")
143추가: .collapsible(false)
144추가: .show(&ctx, |ui| {
145추가: ui.label("취소 요청은 전송됐습니다. 작업 종료를 기다립니다.");
146추가: if ui.button("닫기 철회").clicked() {
147추가: self.controller.keep_open();
148추가: }
149추가: });
150추가: }
151추가: if self.controller.busy() {
152추가: ctx.request_repaint_after(std::time::Duration::from_millis(30));
153추가: }
154추가: }
155추가: }
156추가:
157추가: fn main() -> eframe::Result {
158추가: let font = std::fs::read("/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc")
159추가: .map_err(|e| eframe::Error::AppCreation(Box::new(e)))?;
160추가: eframe::run_native(
161추가: "Zipelo 합성 메모리 작업",
162추가: eframe::NativeOptions {
163추가: renderer: eframe::Renderer::Glow,
164추가: viewport: egui::ViewportBuilder::default()
165추가: .with_inner_size([1060.0, 720.0])
166추가: .with_min_inner_size([760.0, 540.0]),
167추가: ..Default::default()
168추가: },
169추가: Box::new(move |cc| {
170추가: let mut fonts = FontDefinitions::empty();
171추가: let mut data = FontData::from_owned(font);
172추가: data.index = 1;
173추가: fonts.font_data.insert("noto-kr".into(), data.into());
174추가: fonts
175추가: .families
176추가: .insert(FontFamily::Proportional, vec!["noto-kr".into()]);
177추가: cc.egui_ctx.set_fonts(fonts);
178추가: cc.egui_ctx.set_visuals(egui::Visuals::light());
179추가: cc.egui_ctx.style_mut_of(egui::Theme::Light, |style| {
180추가: style
181추가: .text_styles
182추가: .insert(TextStyle::Body, FontId::proportional(18.0));
183추가: style
184추가: .text_styles
185추가: .insert(TextStyle::Button, FontId::proportional(18.0));
186추가: style
187추가: .text_styles
188추가: .insert(TextStyle::Heading, FontId::proportional(26.0));
189추가: style.visuals.panel_fill = Color32::WHITE;
190추가: style.visuals.override_text_color = Some(Color32::from_rgb(24, 39, 57));
191추가: style.visuals.selection.bg_fill = Color32::from_rgb(211, 230, 246);
192추가: style.spacing.item_spacing = egui::vec2(12.0, 10.0);
193추가: style.spacing.button_padding = egui::vec2(14.0, 10.0);
194추가: });
195추가: Ok(Box::<App>::default())
196추가: }),
197추가: )
198추가: }
추가experiments/rust-ui-memory-app/src/controller.rs+268-0
@@ -0,0 +1,268 @@
1추가: use crate::{
2추가: core,
3추가: runtime::{Action, Completion, DEFAULT_CAPACITY, Outcome, Task},
4추가: };
5추가:
6추가: #[derive(Clone, Copy, Debug, PartialEq, Eq)]
7추가: pub enum CloseState {
8추가: Open,
9추가: Confirming,
10추가: Waiting,
11추가: Allowed,
12추가: }
13추가:
14추가: #[derive(Clone, Copy, Debug, PartialEq, Eq)]
15추가: pub enum Status {
16추가: Idle,
17추가: Running,
18추가: CancelRequested,
19추가: Completed,
20추가: Cancelled,
21추가: NativeFailure,
22추가: DeliveryFailure,
23추가: Panicked,
24추가: }
25추가:
26추가: pub struct Controller {
27추가: pub task: Option<Task>,
28추가: receiver: Option<core::Receiver>,
29추가: pub terminal: Option<Completion>,
30추가: pub close: CloseState,
31추가: pub status: Status,
32추가: pub generation: u64,
33추가: pub progress: Option<core::Progress>,
34추가: pub delivery_error: Option<core::DeliveryError>,
35추가: pub selected: Option<(core::OperationId, u64, usize)>,
36추가: pub spawn_error: Option<crate::runtime::StartFailure>,
37추가: pub panic: Option<Box<dyn std::any::Any + Send>>,
38추가: }
39추가:
40추가: impl Default for Controller {
41추가: fn default() -> Self {
42추가: Self {
43추가: task: None,
44추가: receiver: None,
45추가: terminal: None,
46추가: close: CloseState::Open,
47추가: status: Status::Idle,
48추가: generation: 0,
49추가: progress: None,
50추가: delivery_error: None,
51추가: selected: None,
52추가: spawn_error: None,
53추가: panic: None,
54추가: }
55추가: }
56추가: }
57추가:
58추가: impl Controller {
59추가: pub fn busy(&self) -> bool {
60추가: self.task.as_ref().is_some_and(|task| !task.joined())
61추가: }
62추가: pub fn start(&mut self, action: Action) -> bool {
63추가: self.start_with(action, DEFAULT_CAPACITY)
64추가: }
65추가: pub fn start_with(&mut self, action: Action, capacity: usize) -> bool {
66추가: if self.busy() || self.close != CloseState::Open {
67추가: return false;
68추가: }
69추가: let Some(generation) = self.generation.checked_add(1) else {
70추가: return false;
71추가: };
72추가: let task = match Task::spawn(action, capacity) {
73추가: Ok(task) => task,
74추가: Err(error) => {
75추가: self.spawn_error = Some(error);
76추가: return false;
77추가: }
78추가: };
79추가: self.receiver = Some(core::Receiver::new(task.id));
80추가: self.task = Some(task);
81추가: self.generation = generation;
82추가: self.selected = None;
83추가: self.terminal = None;
84추가: self.delivery_error = None;
85추가: self.panic = None;
86추가: self.spawn_error = None;
87추가: self.progress = None;
88추가: self.status = Status::Running;
89추가: true
90추가: }
91추가: pub fn cancel(&mut self) -> bool {
92추가: if !self.busy() {
93추가: return false;
94추가: }
95추가: let first = self.task.as_ref().unwrap().cancellation.request();
96추가: if self.status == Status::Running {
97추가: self.status = Status::CancelRequested;
98추가: }
99추가: first
100추가: }
101추가: pub fn request_close(&mut self) {
102추가: if self.close == CloseState::Open {
103추가: self.close = if self.busy() {
104추가: CloseState::Confirming
105추가: } else {
106추가: CloseState::Allowed
107추가: };
108추가: }
109추가: }
110추가: pub fn keep_open(&mut self) {
111추가: if self.close != CloseState::Allowed {
112추가: self.close = CloseState::Open;
113추가: }
114추가: }
115추가: pub fn confirm_close(&mut self) {
116추가: if self.close == CloseState::Confirming {
117추가: self.close = if self.busy() {
118추가: CloseState::Waiting
119추가: } else {
120추가: CloseState::Allowed
121추가: };
122추가: self.cancel();
123추가: }
124추가: }
125추가: pub fn poll(&mut self) {
126추가: let Some(task) = self.task.as_mut() else {
127추가: return;
128추가: };
129추가: if let Some(events) = &task.events {
130추가: // 기본 큐 한도만큼만 처리하며 frame에서 수신을 기다리지 않음.
131추가: for event in events.try_iter().take(DEFAULT_CAPACITY) {
132추가: match event.validate(self.receiver.as_mut().unwrap()) {
133추가: Ok(core::Delivery::Accepted) => {
134추가: self.progress = event.progress().or(self.progress)
135추가: }
136추가: Ok(core::Delivery::IgnoredStale) => {}
137추가: Err(error) => {
138추가: self.delivery_error.get_or_insert(error);
139추가: task.cancellation.request();
140추가: }
141추가: }
142추가: }
143추가: }
144추가: if self.terminal.is_none() {
145추가: if let Some(done) = &task.completion {
146추가: self.terminal = done.try_recv().ok();
147추가: }
148추가: }
149추가: if let Some(join) = task.poll_join() {
150추가: match join {
151추가: Ok(Some(completion)) => self.terminal = Some(completion),
152추가: Ok(None) => {
153추가: if self.terminal.is_none() {
154추가: if let Some(done) = &task.completion {
155추가: self.terminal = done.try_recv().ok();
156추가: }
157추가: }
158추가: }
159추가: Err(panic) => {
160추가: self.panic = Some(panic);
161추가: self.status = Status::Panicked;
162추가: }
163추가: }
164추가: if let Some(events) = &task.events {
165추가: for event in events.try_iter() {
166추가: match event.validate(self.receiver.as_mut().unwrap()) {
167추가: Ok(core::Delivery::Accepted) => {
168추가: self.progress = event.progress().or(self.progress)
169추가: }
170추가: Ok(core::Delivery::IgnoredStale) => {}
171추가: Err(error) => {
172추가: self.delivery_error.get_or_insert(error);
173추가: }
174추가: }
175추가: }
176추가: }
177추가: if let Some(completion) = &self.terminal {
178추가: if let Err(error) = completion.outcome.validate(self.receiver.as_mut().unwrap()) {
179추가: self.delivery_error.get_or_insert(error);
180추가: }
181추가: self.status = if self.panic.is_some() {
182추가: Status::Panicked
183추가: } else if completion.delivery.is_some() || self.delivery_error.is_some() {
184추가: Status::DeliveryFailure
185추가: } else if completion.outcome.is_ok() {
186추가: Status::Completed
187추가: } else if completion.outcome.cancelled() {
188추가: Status::Cancelled
189추가: } else {
190추가: Status::NativeFailure
191추가: };
192추가: } else if self.panic.is_none() {
193추가: self.status = Status::DeliveryFailure;
194추가: }
195추가: if self.close == CloseState::Waiting {
196추가: self.close = CloseState::Allowed;
197추가: }
198추가: }
199추가: }
200추가: pub fn rows(&self) -> Vec<&str> {
201추가: if self.status != Status::Completed {
202추가: return Vec::new();
203추가: }
204추가: match self.terminal.as_ref().map(|c| &c.outcome) {
205추가: Some(Outcome::Ustar(t)) => t
206추가: .result()
207추가: .map(|c| c.value().entries.iter().map(|e| e.name.as_str()).collect())
208추가: .unwrap_or_default(),
209추가: Some(Outcome::Zip(_)) => vec!["생성한 sample.zip"],
210추가: Some(Outcome::Gzip(_)) => vec!["검증한 GZip 메모리 내용"],
211추가: None => Vec::new(),
212추가: }
213추가: }
214추가: pub fn select(&mut self, operation: core::OperationId, generation: u64, index: usize) -> bool {
215추가: if self.task.as_ref().map(|t| t.id) != Some(operation)
216추가: || generation != self.generation
217추가: || index >= self.rows().len()
218추가: {
219추가: return false;
220추가: }
221추가: self.selected = Some((operation, generation, index));
222추가: true
223추가: }
224추가: pub fn selected_bytes(&self) -> Option<&[u8]> {
225추가: if self.status != Status::Completed {
226추가: return None;
227추가: }
228추가: let (operation, generation, index) = self.selected?;
229추가: if self.task.as_ref()?.id != operation || generation != self.generation {
230추가: return None;
231추가: }
232추가: match &self.terminal.as_ref()?.outcome {
233추가: Outcome::Zip(t) => t.result().ok().map(|v| v.value().as_slice()),
234추가: Outcome::Gzip(t) => t.result().ok()?.value().bytes.as_deref(),
235추가: Outcome::Ustar(t) => {
236추가: let value = t.result().ok()?.value();
237추가: let id = &value.entries.get(index)?.id;
238추가: value
239추가: .files
240추가: .iter()
241추가: .find(|f| &f.id == id)
242추가: .map(|f| f.bytes.as_slice())
243추가: }
244추가: }
245추가: }
246추가: pub fn preview(&self) -> String {
247추가: let Some(bytes) = self.selected_bytes() else {
248추가: return "목록에서 결과를 선택하세요".into();
249추가: };
250추가: if let Ok(text) = std::str::from_utf8(bytes) {
251추가: text.chars().take(2048).collect()
252추가: } else {
253추가: format!("바이너리 {} bytes", bytes.len())
254추가: }
255추가: }
256추가: pub fn status_text(&self) -> &'static str {
257추가: match self.status {
258추가: Status::Idle => "합성 작업을 선택하세요",
259추가: Status::Running => "메모리 처리 중",
260추가: Status::CancelRequested => "취소 요청됨 / 반환과 종료 대기",
261추가: Status::Completed => "메모리 처리 완료",
262추가: Status::Cancelled => "작업이 취소 결과를 반환함",
263추가: Status::NativeFailure => "메모리 작업 실패",
264추가: Status::DeliveryFailure => "UI 전달 실패 / 입력 파일 손상이나 사용자 취소가 아님",
265추가: Status::Panicked => "작업 스레드 panic / 완료 결과 없음",
266추가: }
267추가: }
268추가: }
추가experiments/rust-ui-memory-app/src/lib.rs+6-0
@@ -0,0 +1,6 @@
1추가: #![forbid(unsafe_code)]
2추가:
3추가: pub use core_memory as core;
4추가: pub mod controller;
5추가: pub mod runtime;
6추가: pub mod transport;
추가experiments/rust-ui-memory-app/src/runtime.rs+268-0
@@ -0,0 +1,268 @@
1추가: use crate::{
2추가: core::{self, gzip, ustar, zip_create},
3추가: transport::{DeliveryFault, Transport},
4추가: };
5추가: use std::{
6추가: any::Any,
7추가: sync::mpsc::{self, Receiver, SyncSender},
8추가: thread::{self, JoinHandle},
9추가: };
10추가:
11추가: pub const DEFAULT_CAPACITY: usize = 256;
12추가: pub const PAYLOAD: &[u8] = include_bytes!("../../../tests/rust-ui-memory-app/fixtures/payload.txt");
13추가: pub const GZIP: &[u8] = include_bytes!("../../../tests/rust-ui-memory-app/fixtures/sample.gz");
14추가: pub const USTAR: &[u8] = include_bytes!("../../../tests/rust-ui-memory-app/fixtures/sample.tar");
15추가:
16추가: #[derive(Clone, Copy, Debug, PartialEq, Eq)]
17추가: pub enum Action {
18추가: Zip,
19추가: Ustar,
20추가: Gzip,
21추가: InvalidGzip,
22추가: }
23추가:
24추가: #[derive(Debug)]
25추가: pub enum ProgressEvent {
26추가: Zip(core::Event<zip_create::Checkpoint>),
27추가: Ustar(core::Event<ustar::Checkpoint>),
28추가: Gzip(core::Event<gzip::Checkpoint>),
29추가: }
30추가:
31추가: impl ProgressEvent {
32추가: pub fn validate(
33추가: &self,
34추가: receiver: &mut core::Receiver,
35추가: ) -> Result<core::Delivery, core::DeliveryError> {
36추가: match self {
37추가: Self::Zip(e) => receiver.progress(e),
38추가: Self::Ustar(e) => receiver.progress(e),
39추가: Self::Gzip(e) => receiver.progress(e),
40추가: }
41추가: }
42추가: pub fn progress(&self) -> Option<core::Progress> {
43추가: match self {
44추가: Self::Zip(e) => e.progress,
45추가: Self::Ustar(e) => e.progress,
46추가: Self::Gzip(e) => e.progress,
47추가: }
48추가: }
49추가: }
50추가:
51추가: #[derive(Debug, PartialEq, Eq)]
52추가: pub struct CallbackFailure(pub &'static str);
53추가:
54추가: #[derive(Debug)]
55추가: pub enum Outcome {
56추가: Zip(core::Terminal<Vec<u8>, zip_create::Failure>),
57추가: Ustar(core::Terminal<ustar::Completed, ustar::Error<CallbackFailure>>),
58추가: Gzip(core::Terminal<gzip::Completed, gzip::Error<CallbackFailure>>),
59추가: }
60추가:
61추가: impl Outcome {
62추가: pub fn validate(
63추가: &self,
64추가: receiver: &mut core::Receiver,
65추가: ) -> Result<core::Delivery, core::DeliveryError> {
66추가: match self {
67추가: Self::Zip(e) => receiver.terminal(e),
68추가: Self::Ustar(e) => receiver.terminal(e),
69추가: Self::Gzip(e) => receiver.terminal(e),
70추가: }
71추가: }
72추가: pub fn is_ok(&self) -> bool {
73추가: match self {
74추가: Self::Zip(e) => e.result().is_ok(),
75추가: Self::Ustar(e) => e.result().is_ok(),
76추가: Self::Gzip(e) => e.result().is_ok(),
77추가: }
78추가: }
79추가: pub fn cancelled(&self) -> bool {
80추가: match self {
81추가: Self::Zip(t) => matches!(
82추가: t.result(),
83추가: Err(core::Failure {
84추가: native: Some(zip_create::Failure::Cancelled),
85추가: ..
86추가: })
87추가: ),
88추가: Self::Ustar(t) => matches!(
89추가: t.result(),
90추가: Err(core::Failure {
91추가: native: Some(ustar::Error::Reader(ustar::Failure::Cancelled)),
92추가: ..
93추가: })
94추가: ),
95추가: Self::Gzip(t) => matches!(
96추가: t.result(),
97추가: Err(core::Failure {
98추가: native: Some(gzip::Error::Reader(gzip::Failure::Cancelled)),
99추가: ..
100추가: })
101추가: ),
102추가: }
103추가: }
104추가: pub fn next_sequence(&self) -> u64 {
105추가: match self {
106추가: Self::Zip(t) => t.stamp().sequence(),
107추가: Self::Ustar(t) => t.stamp().sequence(),
108추가: Self::Gzip(t) => t.stamp().sequence(),
109추가: }
110추가: }
111추가: }
112추가:
113추가: #[derive(Debug)]
114추가: pub struct Completion {
115추가: pub outcome: Outcome,
116추가: pub delivery: Option<DeliveryFault>,
117추가: }
118추가:
119추가: pub fn execute(
120추가: operation: core::Operation,
121추가: action: Action,
122추가: sender: SyncSender<ProgressEvent>,
123추가: ) -> Completion {
124추가: let mut transport = Transport::new(sender);
125추가: let outcome = match action {
126추가: Action::Zip => Outcome::Zip(operation.create_zip(
127추가: zip_create::Request {
128추가: entries: vec![zip_create::Entry {
129추가: name: "sample.txt".into(),
130추가: bytes: PAYLOAD.into(),
131추가: }],
132추가: options: zip_create::Options::default(),
133추가: limits: zip_create::Limits::default(),
134추가: timeout: std::time::Duration::from_secs(5),
135추가: },
136추가: |event| {
137추가: transport.forward(
138추가: event.stamp().sequence(),
139추가: ProgressEvent::Zip(event),
140추가: Ok(()),
141추가: || zip_create::Stop::Cancelled,
142추가: )
143추가: },
144추가: )),
145추가: Action::Ustar => Outcome::Ustar(operation.ustar(
146추가: ustar::Request {
147추가: input: USTAR.into(),
148추가: policy: ustar::NamePolicy::Linux,
149추가: limits: ustar::Limits::default(),
150추가: },
151추가: |entries| Ok(entries.iter().map(|entry| entry.id.clone()).collect()),
152추가: |event| {
153추가: transport.forward(
154추가: event.stamp().sequence(),
155추가: ProgressEvent::Ustar(event),
156추가: Ok(()),
157추가: || ustar::Stop::Cancelled,
158추가: )
159추가: },
160추가: )),
161추가: Action::Gzip | Action::InvalidGzip => {
162추가: let input = if action == Action::InvalidGzip {
163추가: Box::from(&b"invalid"[..])
164추가: } else {
165추가: GZIP.into()
166추가: };
167추가: let mut budget = gzip::Budget::new(gzip::Limits::default()).expect("고정 기본 예산");
168추가: Outcome::Gzip(operation.gzip(
169추가: gzip::Request {
170추가: input,
171추가: selected: true,
172추가: },
173추가: &mut budget,
174추가: |event| {
175추가: transport.forward(
176추가: event.stamp().sequence(),
177추가: ProgressEvent::Gzip(event),
178추가: Ok(()),
179추가: || gzip::Stop::Cancelled,
180추가: )
181추가: },
182추가: ))
183추가: }
184추가: };
185추가: Completion {
186추가: outcome,
187추가: delivery: transport.fault,
188추가: }
189추가: }
190추가:
191추가: pub fn deliver_completion(
192추가: sender: &SyncSender<Completion>,
193추가: completion: Completion,
194추가: ) -> Option<Completion> {
195추가: match sender.try_send(completion) {
196추가: Ok(()) => None,
197추가: Err(mpsc::TrySendError::Full(value) | mpsc::TrySendError::Disconnected(value)) => {
198추가: Some(value)
199추가: }
200추가: }
201추가: }
202추가:
203추가: #[derive(Debug)]
204추가: pub enum StartFailure {
205추가: Capacity,
206추가: Operation(core::AdapterFailure),
207추가: Spawn(std::io::Error),
208추가: }
209추가:
210추가: #[must_use = "작업 소유자는 종료까지 핸들을 보존해야 함"]
211추가: pub struct Task {
212추가: pub id: core::OperationId,
213추가: pub cancellation: core::Cancellation,
214추가: pub events: Option<Receiver<ProgressEvent>>,
215추가: pub completion: Option<Receiver<Completion>>,
216추가: handle: Option<JoinHandle<Option<Completion>>>,
217추가: }
218추가:
219추가: impl Task {
220추가: pub fn spawn(action: Action, capacity: usize) -> Result<Self, StartFailure> {
221추가: Self::spawn_with(capacity, move |op, sender| execute(op, action, sender))
222추가: }
223추가: pub fn spawn_with(
224추가: capacity: usize,
225추가: work: impl FnOnce(core::Operation, SyncSender<ProgressEvent>) -> Completion + Send + 'static,
226추가: ) -> Result<Self, StartFailure> {
227추가: if capacity > DEFAULT_CAPACITY {
228추가: return Err(StartFailure::Capacity);
229추가: }
230추가: let (op, cancellation) = core::Operation::start().map_err(StartFailure::Operation)?;
231추가: let id = op.id();
232추가: let (sender, events) = mpsc::sync_channel(capacity);
233추가: let (done, completion) = mpsc::sync_channel(1);
234추가: let handle = thread::Builder::new()
235추가: .name("zipelo-memory".into())
236추가: .spawn(move || deliver_completion(&done, work(op, sender)))
237추가: .map_err(StartFailure::Spawn)?;
238추가: Ok(Self {
239추가: id,
240추가: cancellation,
241추가: events: Some(events),
242추가: completion: Some(completion),
243추가: handle: Some(handle),
244추가: })
245추가: }
246추가: pub fn finished(&self) -> bool {
247추가: self.handle.as_ref().is_none_or(JoinHandle::is_finished)
248추가: }
249추가: pub fn joined(&self) -> bool {
250추가: self.handle.is_none()
251추가: }
252추가: pub fn poll_join(&mut self) -> Option<Result<Option<Completion>, Box<dyn Any + Send>>> {
253추가: if !self.finished() {
254추가: return None;
255추가: }
256추가: self.handle.take().map(JoinHandle::join)
257추가: }
258추가: }
259추가:
260추가: impl Drop for Task {
261추가: fn drop(&mut self) {
262추가: // 정상 frame 경로는 종료 확인 뒤에만 Task를 제거함. 비정상 소유권 폐기도 detach하지 않음.
263추가: if let Some(handle) = self.handle.take() {
264추가: self.cancellation.request();
265추가: let _ = handle.join();
266추가: }
267추가: }
268추가: }
추가experiments/rust-ui-memory-app/src/transport.rs+56-0
@@ -0,0 +1,56 @@
1추가: use std::sync::mpsc::{SyncSender, TrySendError};
2추가:
3추가: #[derive(Clone, Copy, Debug, PartialEq, Eq)]
4추가: pub enum DeliveryKind {
5추가: Full,
6추가: Disconnected,
7추가: }
8추가:
9추가: #[derive(Clone, Copy, Debug, PartialEq, Eq)]
10추가: pub struct DeliveryFault {
11추가: pub kind: DeliveryKind,
12추가: pub first_missing_sequence: u64,
13추가: }
14추가:
15추가: pub struct Transport<T> {
16추가: sender: SyncSender<T>,
17추가: pub fault: Option<DeliveryFault>,
18추가: }
19추가:
20추가: impl<T> Transport<T> {
21추가: pub fn new(sender: SyncSender<T>) -> Self {
22추가: Self {
23추가: sender,
24추가: fault: None,
25추가: }
26추가: }
27추가:
28추가: pub fn forward<E>(
29추가: &mut self,
30추가: sequence: u64,
31추가: value: T,
32추가: original: Result<(), E>,
33추가: stop: impl FnOnce() -> E,
34추가: ) -> Result<(), E> {
35추가: if self.fault.is_none() {
36추가: self.fault = match self.sender.try_send(value) {
37추가: Ok(()) => None,
38추가: Err(TrySendError::Full(_)) => Some(DeliveryFault {
39추가: kind: DeliveryKind::Full,
40추가: first_missing_sequence: sequence,
41추가: }),
42추가: Err(TrySendError::Disconnected(_)) => Some(DeliveryFault {
43추가: kind: DeliveryKind::Disconnected,
44추가: first_missing_sequence: sequence,
45추가: }),
46추가: };
47추가: }
48추가: // 원래 observer 오류를 전달 오류보다 먼저 반환함.
49추가: original?;
50추가: if self.fault.is_some() {
51추가: Err(stop())
52추가: } else {
53추가: Ok(())
54추가: }
55추가: }
56추가: }
추가tests/rust-ui-memory-app/SHA256SUMS+21-0
@@ -0,0 +1,21 @@
1추가: d591ec67b8f1a1ea448b6bdd971e0b8c039a33a492c8f068b085bdd20b3a64ae experiments/rust-ui-memory-app/Cargo.lock
2추가: 7a74a5d5be456dc6d080c0dd78a25eaf8bd12ef43a3b921f26bbb7e35901040f experiments/rust-ui-memory-app/Cargo.toml
3추가: 0714945e52a4d5b560c02c9a18478519f8c4e2572cbf87bd6d52adcfb2b63c62 experiments/rust-ui-memory-app/LICENSE
4추가: 5b98107ae51806d6d4cb4337bea3b979f55070eba6dc7c0c294e13e7686ab4c6 experiments/rust-ui-memory-app/THIRD-PARTY-NOTICES.txt
5추가: 1cddb84c6a8c5e4188be79220c92532351e51979d7ad0edbc0a12ac5381ed72c experiments/rust-ui-memory-app/src/app.rs
6추가: fbe8d8f80267ac20ddd1cff47b5f75b14a680de4935e32472813183183a34019 experiments/rust-ui-memory-app/src/controller.rs
7추가: 58d303d44c6b8580168f14c3ceb0eb878fc7a003f197f162584286873a904ddc experiments/rust-ui-memory-app/src/lib.rs
8추가: c1c1dde16263ea7ed4cf5808b3182e21878b8ffadfe8850974a8cbdbd4607b3f experiments/rust-ui-memory-app/src/runtime.rs
9추가: 7aef227ed4424e13cfa750373a9e1f32bebae12308589c81d051f41ea84991ac experiments/rust-ui-memory-app/src/transport.rs
10추가: d68f3ba20d8f392a2df38ac2faf785e197d023e86356c45eb7bebb7ce572c9e1 tests/rust-ui-memory-app/contract.json
11추가: 5ee41a973a0e976fbb6fe36d4a3fcb0ed026e638e997042a0bef8c2f238f0599 tests/rust-ui-memory-app/dependencies.json
12추가: 8536779d3551eb86a82f4c8b814bb26ddeaff04f992d3e080ae06321f10e3453 tests/rust-ui-memory-app/dependency_audit.py
13추가: 97c0bc5c804d85fb523da4c76abff2bec3aed3ae1e02b68db1c19792e9843808 tests/rust-ui-memory-app/files.json
14추가: ce7c1973b4eab97e4e49257ce4dbc5cb35c5a1eaae7c666a04b548fe1fd41dba tests/rust-ui-memory-app/fixtures/payload.txt
15추가: 6adcdc0775bca7b8c1ff8e41adeecf8a724f876f8b469f7f8fc611406a626e61 tests/rust-ui-memory-app/fixtures/sample.gz
16추가: 910cb4573b57fd26f122376f3f4eae0e4397163b83e32a3c850758d42f88dc55 tests/rust-ui-memory-app/fixtures/sample.tar
17추가: 09aca74cb3f20f1ed5b3e03fd647c80ef8e872f6ff97e17882cf2fda8b108b2c tests/rust-ui-memory-app/license-supplement.json
18추가: 865d69b95660fefe8c9ad6129d2692cff8007ecc3d55de1a049fe162173f434d tests/rust-ui-memory-app/reference-ui.lock
19추가: 3d6e73d481755bcf8d42f1574a5f4b669f38f9e5ae61ddfcfc4c55af07e6aace tests/rust-ui-memory-app/regressions.rs
20추가: f6a7b3df44869c206ff517f32653885c5fcd2f335ef4e8eff94d6ab626ca4119 tests/rust-ui-memory-app/sources.json
21추가: 6a756de6da66731b1ea9eaaacedfbe32096bd6a918eab591a392bc45529184f5 tests/rust-ui-memory-app/static_check.py
추가tests/rust-ui-memory-app/contract.json+112-0
@@ -0,0 +1,112 @@
1추가: {
2추가: "scope": "합성 메모리 입력만 사용하는 실제 PR42 호출 UI 후보임. 사용자 archive/선택기/파일 저장/게시/worker/tar.gz 연결 없음",
3추가: "core_head": "23b8d1c615f24f42469138fcc63e7fce7cda4f24",
4추가: "branch": "features/rust-ui-memory-app",
5추가: "layout": {
6추가: "palette": {
7추가: "paper": "#FFFFFF",
8추가: "ink": "#182739",
9추가: "selection": "#D3E6F6",
10추가: "focus": "#174C7C"
11추가: },
12추가: "type": "기존 설치 Noto CJK 한국어 폰트 index 1, 본문/버튼 18px, 제목 26px임",
13추가: "structure": "상단 동작 선택, 좌측 결과 목록, 우측 내용, 하단 상태의 작업실 구조임. 부가 설명도 본문 크기로 표시함",
14추가: "review": "기존 PR34의 파란색 선택과 한글 가독성을 계승하며 장식 카드/별도 아이콘을 추가하지 않음"
15추가: },
16추가: "transport": {
17추가: "capacity": 256,
18추가: "full": "유효 입력에서도 발생 가능한 UI 전달 한계임. 사용자 취소/손상 archive로 표시하지 않음. 대형 입력 처리를 보장하지 않음",
19추가: "raw": "모든 checkpoint Event를 순번 변경 없이 try_send함. 최초 전달 실패 이후 suffix는 보내지 않고 first_missing_sequence로 시작 위치를 보존함. 원래 observer Err를 반환 우선순위로 유지하며 전달 실패는 별도임",
20추가: "receiver": "원본 연속 stream을 PR42 Receiver로 검증함. 누락/중복 오류는 sticky로 보존하고 재생성하지 않음. terminal은 원형 보존하되 transport 오류가 있으면 payload 목록/내용에 적용하지 않음",
21추가: "completion": "용량 1 별도 채널로 Terminal 소유 이동. Full/Disconnected이면 반환된 값을 작업 스레드 반환값으로 소유하여 join으로 회수함. 복제하지 않음",
22추가: "mutex": "추가 공유 mutex를 사용하지 않아 자체 poison 경로 없음. 표준 채널 내부 구현 전체의 panic 회수를 주장하지 않음"
23추가: },
24추가: "lifecycle": {
25추가: "frame": "poll/try_recv/try_iter/is_finished만 사용하며 실행 중 join하지 않음. 완료 수신과 join 상태를 분리하고 원본 결과를 한 번 소유함",
26추가: "close": "확인/취소 요청 후 대기/철회 구분. 철회해도 전송한 취소는 남음. 종료 확인 전 시작/재시작/실제 닫기 금지. 확인 중 먼저 완료돼도 선택은 유지함",
27추가: "drop": "정상 GUI frame은 busy Task를 제거하지 않음. 비정상 owner 폐기의 Drop은 취소 요청 후 동기 join하여 조용한 detach를 피함. 이 비정상 fallback은 기다릴 수 있으며 비선점 callback/OOM/강제 프로세스 종료에서 유한 종료를 보장하지 않음",
28추가: "panic": "JoinError 원형을 별도로 소유하며 Terminal이나 cleanup 성공을 합성하지 않음",
29추가: "cancel": "요청과 실제 native 반환을 구분함. 이미 완료된 성공을 뒤늦은 취소로 바꾸지 않음. 마지막 checkpoint와 Terminal 생성 사이 경합은 확정 검증하지 않음"
30추가: },
31추가: "payload": {
32추가: "ownership": "원본 typed Terminal이 bytes/목록/Usage/원래 오류를 소유함. GUI 문자열은 별도 제한된 표시임",
33추가: "generation": "새 시작 시 checked 세대 증가 및 목록/원본 결과/선택 동시 제거. 선택 키는 실제 operation/세대/행 index임. USTAR id/name bytes는 원형 보존함",
34추가: "preview": "최대 Unicode 2048자 표시, 비 UTF-8은 바이너리 길이만 표시. 전체 bytes는 결과에 보존함. 원문 이름/내용을 경로나 명령으로 사용하지 않음",
35추가: "limitations": "파일 저장 미지원, 합성 입력 전용, 메모리 완료, USTAR ContentVerification::Unavailable을 화면에 표시함. ZIP 생성의 round-trip 검증이나 최종 Usage를 만들지 않음"
36추가: },
37추가: "fixtures": {
38추가: "producer": "Python 3.14.4 표준 gzip.compress(mtime=0), tarfile USTAR_FORMAT과 합성 UTF-8 bytes임",
39추가: "gzip": "payload.txt 전체 선택",
40추가: "ustar": "자료.txt 및 empty.txt 두 파일을 선택 콜백에서 전체 선택함. UI 행 선택은 이미 검증하여 반환한 bytes 중 표시할 항목만 선택함",
41추가: "zip": "payload.txt를 sample.txt라는 ASCII 이름으로 실제 ZIP 생성함",
42추가: "no_drain": "세 정상 fixture 각각 UI가 중간에 progress를 전혀 배출하지 않아도 모든 Event가 기본 256 큐에 들어가고 실제 Terminal 성공/순번 일치함을 회귀로 검증하도록 작성함. 아직 실행 전이므로 event 실제 최대값/통과를 주장하지 않음"
43추가: },
44추가: "dependencies": {
45추가: "external_new_outside_original_locks": 0,
46추가: "headless_default": true,
47추가: "ui_optional": "eframe =0.37.0, PR34 동일 features",
48추가: "platform_counts_including_local": {
49추가: "linux_headless": 34,
50추가: "linux_gui": 242,
51추가: "windows_gnu_headless": 35,
52추가: "windows_gnu_gui": 144,
53추가: "windows_msvc_headless": 35,
54추가: "windows_msvc_gui": 144
55추가: },
56추가: "registry_lock_records": 384,
57추가: "selected_analysis": "Windows는 metadata/tree만이며 Linux 외 빌드를 의미하지 않음",
58추가: "reference_ui_lock": {
59추가: "source_head": "63b80e3158c08b71ec70666a2a39216cd36752b1",
60추가: "source_path": "experiments/rust-ui-probe/Cargo.lock",
61추가: "copy": "tests/rust-ui-memory-app/reference-ui.lock",
62추가: "sha256": "865d69b95660fefe8c9ad6129d2692cff8007ecc3d55de1a049fe162173f434d"
63추가: },
64추가: "license_supplement": "기존 PR34의 고정 upstream 보충 원문 JSON을 새 tests 폴더에 동일 bytes로 보존함. archive에 license 파일이 없는 GUI package의 출처를 함께 제공하며 최종 배포 고지는 별도임"
65추가: },
66추가: "validation": {
67추가: "toolchain": "기존 Rust/Cargo/rustfmt 1.99.1 및 cache만 사용함",
68추가: "rust_tests_declared": 28,
69추가: "names": [
70추가: "zip_default_queue_fits_without_ui_drain",
71추가: "ustar_default_queue_fits_without_ui_drain",
72추가: "gzip_default_queue_fits_without_ui_drain",
73추가: "full_queue_is_transport_failure_not_user_cancel",
74추가: "disconnected_progress_preserves_first_missing_sequence",
75추가: "original_observer_error_beats_full_queue",
76추가: "original_observer_error_beats_disconnected_queue",
77추가: "original_observer_error_still_delivers_its_raw_event_when_possible",
78추가: "completion_receiver_loss_recovers_payload_from_join",
79추가: "full_completion_channel_returns_ownership_instead_of_dropping",
80추가: "progress_gap_keeps_real_terminal_but_cannot_apply_payload",
81추가: "thread_panic_is_joined_without_synthesized_terminal",
82추가: "cancellation_before_work_returns_real_cancelled_result",
83추가: "cancellation_after_terminal_does_not_rewrite_success",
84추가: "repeated_start_is_rejected_until_join_even_if_thread_finished",
85추가: "repeated_cancel_sets_request_once",
86추가: "close_confirmation_does_not_cancel_and_can_be_retracted",
87추가: "close_cancel_retraction_keeps_existing_cancel_request",
88추가: "close_waits_for_join_and_preserves_terminal",
89추가: "completed_during_confirmation_still_requires_choice",
90추가: "atomic_generation_replacement_rejects_old_selection",
91추가: "ustar_exact_ids_and_content_limitation_are_retained",
92추가: "error_retry_uses_new_operation_and_clears_previous_payload",
93추가: "headless_values_satisfy_thread_transfer_bounds",
94추가: "oversized_queue_is_rejected_without_spawning",
95추가: "gzip_preview_preserves_original_bytes",
96추가: "ui_event_wrapper_excludes_old_operation_before_current_sequence",
97추가: "native_gzip_callback_error_survives_simultaneous_queue_full"
98추가: ],
99추가: "rust_tests_compiled": false,
100추가: "rust_tests_discovered": false,
101추가: "rust_tests_executed": false,
102추가: "gui_executed": false,
103추가: "limits": "고정 head 검토 후 회귀/GUI 실행 별도 배정. 이전 PR34/39/42 및 원본 모듈 결과를 이 후보 통과로 합산하지 않음",
104추가: "builds": {
105추가: "headless_lib": "Linux locked/offline exit 0",
106추가: "gui": "Linux ui feature binary locked/offline exit 0",
107추가: "rustfmt": "1.99.1 check exit 0",
108추가: "metadata": "Linux headless/GUI locked/offline exit 0. Windows 두 target headless/GUI 선택 감사 완료. 미캐시 iOS를 포함한 무필터 metadata는 offline 실패로 보존함"
109추가: }
110추가: },
111추가: "preservation": "새 두 디렉터리만 추가함. 기존 core/60개 원본/PR34/39/main/C# 수정 없음. 공유 로컬 Git 브랜치 전환/스테이징 없음"
112추가: }
추가tests/rust-ui-memory-app/dependencies.json

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

Raw로 열기
추가tests/rust-ui-memory-app/dependency_audit.py+69-0
@@ -0,0 +1,69 @@
1추가: import hashlib
2추가: import json
3추가: from pathlib import Path
4추가: import re
5추가: import subprocess
6추가: import sys
7추가: import tomllib
8추가:
9추가: ROOT = Path(__file__).resolve().parents[2]
10추가: HERE = Path(__file__).resolve().parent
11추가: MANIFEST = ROOT / "experiments/rust-ui-memory-app/Cargo.toml"
12추가: TARGETS = ["x86_64-unknown-linux-gnu", "x86_64-pc-windows-gnu", "x86_64-pc-windows-msvc"]
13추가:
14추가:
15추가: def sha(data):
16추가: return hashlib.sha256(data).hexdigest()
17추가:
18추가:
19추가: def cargo(*args):
20추가: return subprocess.check_output(["cargo", "+1.99.1", *args, "--locked", "--offline", "--manifest-path", str(MANIFEST)], cwd=ROOT, text=True)
21추가:
22추가:
23추가: def main():
24추가: if sys.flags.optimize:
25추가: raise RuntimeError("최적화 모드에서는 감사할 수 없음")
26추가: locks = [tomllib.loads((ROOT / path).read_text())["package"] for path in ["tests/rust-ui-memory-app/reference-ui.lock", "experiments/rust-app-core-memory/Cargo.lock"]]
27추가: allowed = {(p["name"], p["version"], p.get("checksum")) for lock in locks for p in lock if p.get("source")}
28추가: current = tomllib.loads(MANIFEST.with_name("Cargo.lock").read_text())["package"]
29추가: records = {(p["name"], p["version"], p.get("checksum")) for p in current if p.get("source")}
30추가: if not records <= allowed:
31추가: raise RuntimeError("기존 lock 외 registry 항목")
32추가: results = []
33추가: for target in TARGETS:
34추가: for ui in [False, True]:
35추가: flags = ["--features", "ui"] if ui else ["--no-default-features"]
36추가: metadata = json.loads(cargo("metadata", "--format-version", "1", "--filter-platform", target, *flags))
37추가: packages = {(p["name"], p["version"]): p for p in metadata["packages"]}
38추가: tree = cargo("tree", "--target", target, "--prefix", "none", "--format", "{p}|{f}", "-e", "normal,build", *flags)
39추가: active = {}
40추가: for line in tree.splitlines():
41추가: match = re.fullmatch(r"([^ ]+) v([^ ]+)(?: \([^|]*\))?\|([^|]*?)(?: \(\*\))?", line)
42추가: if match is None:
43추가: raise RuntimeError("Cargo tree 행 해석 실패: " + line)
44추가: name, version, features = match.groups()
45추가: active.setdefault((name, version), set()).update(filter(None, features.split(",")))
46추가: selected = []
47추가: for key, features in sorted(active.items()):
48추가: package = packages[key]
49추가: item = {"name": key[0], "version": key[1], "features": sorted(features), "license": package["license"], "source": package["source"]}
50추가: if package["source"]:
51추가: lock = next(p for p in current if (p["name"], p["version"]) == key)
52추가: source = Path(package["manifest_path"]).parent
53추가: registry = source.parent.parent.parent
54추가: archive = registry / "cache" / source.parent.name / (key[0] + "-" + key[1] + ".crate")
55추가: if sha(archive.read_bytes()) != lock["checksum"]:
56추가: raise RuntimeError("캐시 checksum 불일치: " + str(key))
57추가: item["checksum"] = lock["checksum"]
58추가: item["license_files"] = [{"path": str(p.relative_to(source)), "sha256": sha(p.read_bytes())} for p in sorted(source.rglob("*")) if p.is_file() and not p.is_symlink() and p.name.lower().startswith(("license", "licence", "copying", "notice"))]
59추가: else:
60추가: item["source_path"] = str(Path(package["manifest_path"]).parent.relative_to(ROOT))
61추가: selected.append(item)
62추가: results.append({"target": target, "ui": ui, "selected_packages": len(selected), "packages": selected})
63추가: report = {"scope": "플랫폼별 locked/offline 선택 분석임. Linux 외 빌드나 실행 검증이 아님", "original_ui_head": "63b80e3158c08b71ec70666a2a39216cd36752b1", "core_head": "23b8d1c615f24f42469138fcc63e7fce7cda4f24", "registry_records": len(records), "new_registry_outside_original_union": 0, "selections": results}
64추가: (HERE / "dependencies.json").write_text(json.dumps(report, ensure_ascii=False, indent=4) + "\n")
65추가: print(json.dumps([{k: x[k] for k in ["target", "ui", "selected_packages"]} for x in results]))
66추가:
67추가:
68추가: if __name__ == "__main__":
69추가: main()
추가tests/rust-ui-memory-app/files.json+23-0
@@ -0,0 +1,23 @@
1추가: [
2추가: "experiments/rust-ui-memory-app/Cargo.lock",
3추가: "experiments/rust-ui-memory-app/Cargo.toml",
4추가: "experiments/rust-ui-memory-app/LICENSE",
5추가: "experiments/rust-ui-memory-app/THIRD-PARTY-NOTICES.txt",
6추가: "experiments/rust-ui-memory-app/src/app.rs",
7추가: "experiments/rust-ui-memory-app/src/controller.rs",
8추가: "experiments/rust-ui-memory-app/src/lib.rs",
9추가: "experiments/rust-ui-memory-app/src/runtime.rs",
10추가: "experiments/rust-ui-memory-app/src/transport.rs",
11추가: "tests/rust-ui-memory-app/contract.json",
12추가: "tests/rust-ui-memory-app/dependencies.json",
13추가: "tests/rust-ui-memory-app/dependency_audit.py",
14추가: "tests/rust-ui-memory-app/files.json",
15추가: "tests/rust-ui-memory-app/fixtures/payload.txt",
16추가: "tests/rust-ui-memory-app/fixtures/sample.gz",
17추가: "tests/rust-ui-memory-app/fixtures/sample.tar",
18추가: "tests/rust-ui-memory-app/license-supplement.json",
19추가: "tests/rust-ui-memory-app/reference-ui.lock",
20추가: "tests/rust-ui-memory-app/regressions.rs",
21추가: "tests/rust-ui-memory-app/sources.json",
22추가: "tests/rust-ui-memory-app/static_check.py"
23추가: ]
추가tests/rust-ui-memory-app/fixtures/payload.txt+1-0
@@ -0,0 +1 @@
1추가: Zipelo 합성 메모리 결과
추가tests/rust-ui-memory-app/fixtures/sample.gz

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/rust-ui-memory-app/fixtures/sample.tar

바이너리 파일이라 Diff를 표시하지 않아요.

파일 내려받기
추가tests/rust-ui-memory-app/license-supplement.json+56-0
@@ -0,0 +1,56 @@
1추가: {
2추가: "source": "공식 upstream 고정 source의 보충 라이선스이며 crate source 대체가 아님",
3추가: "files": [
4추가: {
5추가: "url": "https://raw.githubusercontent.com/AccessKit/accesskit/f3026222559c7f5f46d8f25cb7404de68eb149f0/LICENSE-APACHE",
6추가: "content": " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n",
7추가: "sha256": "62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a"
8추가: },
9추가: {
10추가: "url": "https://raw.githubusercontent.com/AccessKit/accesskit/f3026222559c7f5f46d8f25cb7404de68eb149f0/LICENSE-MIT",
11추가: "content": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n",
12추가: "sha256": "23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3"
13추가: },
14추가: {
15추가: "url": "https://raw.githubusercontent.com/AccessKit/accesskit/f3026222559c7f5f46d8f25cb7404de68eb149f0/LICENSE.chromium",
16추가: "content": "// Copyright 2015 The Chromium Authors. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n",
17추가: "sha256": "845022e0c1db1abb41a6ba4cd3c4b674ec290f3359d9d3c78ae558d4c0ed9308"
18추가: },
19추가: {
20추가: "url": "https://raw.githubusercontent.com/emilk/egui/3c6eb8261c3293ad9c7ea1ed58487e038860ebef/LICENSE-MIT",
21추가: "content": "Copyright (c) 2018-2021 Emil Ernerfeldt <[email protected]>\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the\nSoftware without restriction, including without\nlimitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software\nis furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice\nshall be included in all copies or substantial portions\nof the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF\nANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\nTO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\nPARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\nSHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR\nIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n",
22추가: "sha256": "95ca92f5f8ea5231f1580b3a2a799e8260af3114b900e1def5355a7f44bcf60c"
23추가: },
24추가: {
25추가: "url": "https://raw.githubusercontent.com/emilk/egui/3c6eb8261c3293ad9c7ea1ed58487e038860ebef/LICENSE-APACHE",
26추가: "content": " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
27추가: "sha256": "8173d5c29b4f956d532781d2b86e4e30f83e6b7878dce18c919451d6ba707c90"
28추가: },
29추가: {
30추가: "url": "https://raw.githubusercontent.com/rust-windowing/gl-rs/ea503e8d5fb6d73c6030e6191ce738cd3bf3433e/LICENSE",
31추가: "content": "\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n",
32추가: "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
33추가: },
34추가: {
35추가: "url": "https://raw.githubusercontent.com/aclysma/profiling/8271551172eb6fa4cba47369aedd93790c623df9/LICENSE-MIT",
36추가: "content": "MIT License\n\nCopyright (c) 2020 Philip Degarmo and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.",
37추가: "sha256": "c8167fdeeed46d3f244d3f85c5bf998ce889343691c32be2c61a8bc4b5c08333"
38추가: },
39추가: {
40추가: "url": "https://raw.githubusercontent.com/DoumanAsh/clipboard-win/ed27008ae5d1f10cfbb266de039f0fb35fd05a56/LICENSE",
41추가: "content": "Boost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or organization\nobtaining a copy of the software and accompanying documentation covered by\nthis license (the \"Software\") to use, reproduce, display, distribute,\nexecute, and transmit the Software, and to prepare derivative works of the\nSoftware, and to permit third-parties to whom the Software is furnished to\ndo so, all subject to the following:\n\nThe copyright notices in the Software and this entire statement, including\nthe above license grant, this restriction and the following disclaimer,\nmust be included in all copies of the Software, in whole or in part, and\nall derivative works of the Software, unless such copies or derivative\nworks are solely in the form of machine-executable object code generated by\na source language processor.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\nSHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\nFOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n",
42추가: "sha256": "c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566"
43추가: }
44추가: ],
45추가: "limits": [
46추가: "egui 일부 crate의 cargo_vcs SHA는 GitHub tree 422로 확인되지 않음. 동일 0.37.0 계열 eframe 고정 commit과 0.37.0 tag의 라이선스 blob 일치만 확인함",
47추가: "최종 배포 고지 묶음과 모든 내부 제삼자 자산의 법적 검토 완료를 의미하지 않음"
48추가: ],
49추가: "choices": [
50추가: "MIT OR Apache-2.0은 MIT 경로를 우선 검토함",
51추가: "accesskit_winit 및 gl_generator와 khronos_api는 Apache-2.0임",
52추가: "clipboard-win은 BSL-1.0임",
53추가: "self_cell의 GPL 대안은 선택하지 않고 Apache-2.0 경로를 사용함",
54추가: "Unicode-3.0 AND 조건 및 Apache 고지 의무는 유지함"
55추가: ]
56추가: }
추가tests/rust-ui-memory-app/reference-ui.lock

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

Raw로 열기
추가tests/rust-ui-memory-app/regressions.rs+421-0
@@ -0,0 +1,421 @@
1추가: use std::{
2추가: sync::mpsc,
3추가: thread,
4추가: time::{Duration, Instant},
5추가: };
6추가: use zipelo_ui_memory_app::{
7추가: controller::{CloseState, Controller, Status},
8추가: core,
9추가: runtime::{self, Action, DEFAULT_CAPACITY, Task},
10추가: transport::{DeliveryKind, Transport},
11추가: };
12추가:
13추가: fn finish(task: &Task) {
14추가: let deadline = Instant::now() + Duration::from_secs(10);
15추가: while !task.finished() {
16추가: assert!(Instant::now() < deadline, "작업 종료 기한 초과");
17추가: thread::sleep(Duration::from_millis(1));
18추가: }
19추가: }
20추가:
21추가: fn complete(controller: &mut Controller) {
22추가: let deadline = Instant::now() + Duration::from_secs(10);
23추가: while controller.busy() {
24추가: assert!(Instant::now() < deadline);
25추가: controller.poll();
26추가: thread::sleep(Duration::from_millis(1));
27추가: }
28추가: }
29추가:
30추가: fn fixture_without_draining(action: Action) {
31추가: let mut task = Task::spawn(action, DEFAULT_CAPACITY).unwrap();
32추가: finish(&task);
33추가: let events: Vec<_> = task.events.as_ref().unwrap().try_iter().collect();
34추가: let terminal = task.completion.as_ref().unwrap().try_recv().unwrap();
35추가: let mut receiver = core::Receiver::new(task.id);
36추가: for event in &events {
37추가: assert_eq!(event.validate(&mut receiver), Ok(core::Delivery::Accepted));
38추가: }
39추가: assert!(terminal.delivery.is_none());
40추가: assert!(terminal.outcome.is_ok());
41추가: assert_eq!(terminal.outcome.next_sequence(), events.len() as u64);
42추가: assert!(events.len() <= DEFAULT_CAPACITY);
43추가: assert_eq!(
44추가: terminal.outcome.validate(&mut receiver),
45추가: Ok(core::Delivery::Accepted)
46추가: );
47추가: assert!(matches!(task.poll_join(), Some(Ok(None))));
48추가: }
49추가:
50추가: #[test]
51추가: fn zip_default_queue_fits_without_ui_drain() {
52추가: fixture_without_draining(Action::Zip);
53추가: }
54추가: #[test]
55추가: fn ustar_default_queue_fits_without_ui_drain() {
56추가: fixture_without_draining(Action::Ustar);
57추가: }
58추가: #[test]
59추가: fn gzip_default_queue_fits_without_ui_drain() {
60추가: fixture_without_draining(Action::Gzip);
61추가: }
62추가:
63추가: #[test]
64추가: fn full_queue_is_transport_failure_not_user_cancel() {
65추가: let mut c = Controller::default();
66추가: assert!(c.start_with(Action::Gzip, 0));
67추가: finish(c.task.as_ref().unwrap());
68추가: c.poll();
69추가: assert_eq!(c.status, Status::DeliveryFailure);
70추가: assert_eq!(
71추가: c.terminal.as_ref().unwrap().delivery.unwrap().kind,
72추가: DeliveryKind::Full
73추가: );
74추가: assert!(c.rows().is_empty());
75추가: assert!(c.selected_bytes().is_none());
76추가: }
77추가:
78추가: #[test]
79추가: fn disconnected_progress_preserves_first_missing_sequence() {
80추가: let (sender, receiver) = mpsc::sync_channel(2);
81추가: drop(receiver);
82추가: let mut transport = Transport::new(sender);
83추가: assert_eq!(
84추가: transport.forward(7, 1, Ok(()), || "delivery"),
85추가: Err("delivery")
86추가: );
87추가: assert_eq!(transport.fault.unwrap().kind, DeliveryKind::Disconnected);
88추가: assert_eq!(transport.fault.unwrap().first_missing_sequence, 7);
89추가: let _ = transport.forward(8, 2, Ok(()), || "delivery");
90추가: assert_eq!(transport.fault.unwrap().first_missing_sequence, 7);
91추가: }
92추가:
93추가: #[test]
94추가: fn original_observer_error_beats_full_queue() {
95추가: let (sender, _receiver) = mpsc::sync_channel(0);
96추가: let mut transport = Transport::new(sender);
97추가: let cause = Box::new(47);
98추가: let identity = &*cause as *const i32;
99추가: let actual = transport
100추가: .forward(0, 1, Err(cause), || Box::new(99))
101추가: .unwrap_err();
102추가: assert_eq!(&*actual as *const i32, identity);
103추가: assert_eq!(transport.fault.unwrap().kind, DeliveryKind::Full);
104추가: }
105추가:
106추가: #[test]
107추가: fn original_observer_error_beats_disconnected_queue() {
108추가: let (sender, receiver) = mpsc::sync_channel(1);
109추가: drop(receiver);
110추가: let mut transport = Transport::new(sender);
111추가: assert_eq!(
112추가: transport.forward(0, 1, Err("original"), || "delivery"),
113추가: Err("original")
114추가: );
115추가: assert_eq!(transport.fault.unwrap().kind, DeliveryKind::Disconnected);
116추가: }
117추가:
118추가: #[test]
119추가: fn original_observer_error_still_delivers_its_raw_event_when_possible() {
120추가: let (sender, receiver) = mpsc::sync_channel(1);
121추가: let mut transport = Transport::new(sender);
122추가: assert_eq!(
123추가: transport.forward(3, 47, Err("original"), || "delivery"),
124추가: Err("original")
125추가: );
126추가: assert_eq!(receiver.try_recv(), Ok(47));
127추가: assert!(transport.fault.is_none());
128추가: }
129추가:
130추가: #[test]
131추가: fn completion_receiver_loss_recovers_payload_from_join() {
132추가: let (release, gate) = mpsc::sync_channel(1);
133추가: let mut task = Task::spawn_with(DEFAULT_CAPACITY, move |op, sender| {
134추가: gate.recv_timeout(Duration::from_secs(5)).unwrap();
135추가: runtime::execute(op, Action::Gzip, sender)
136추가: })
137추가: .unwrap();
138추가: task.completion.take();
139추가: release.try_send(()).unwrap();
140추가: finish(&task);
141추가: let completion = task.poll_join().unwrap().unwrap().unwrap();
142추가: assert!(completion.outcome.is_ok());
143추가: if let runtime::Outcome::Gzip(t) = completion.outcome {
144추가: assert_eq!(
145추가: t.into_result().unwrap().into_inner().bytes.unwrap(),
146추가: runtime::PAYLOAD
147추가: );
148추가: } else {
149추가: panic!();
150추가: }
151추가: assert!(task.poll_join().is_none());
152추가: }
153추가:
154추가: #[test]
155추가: fn full_completion_channel_returns_ownership_instead_of_dropping() {
156추가: let (sender, _receiver) = mpsc::sync_channel(0);
157추가: let (op, _) = core::Operation::start().unwrap();
158추가: let (progress, _events) = mpsc::sync_channel(DEFAULT_CAPACITY);
159추가: let terminal = runtime::execute(op, Action::Gzip, progress);
160추가: let recovered = runtime::deliver_completion(&sender, terminal).unwrap();
161추가: assert!(recovered.outcome.is_ok());
162추가: }
163추가:
164추가: #[test]
165추가: fn progress_gap_keeps_real_terminal_but_cannot_apply_payload() {
166추가: let mut c = Controller::default();
167추가: assert!(c.start_with(Action::Gzip, 0));
168추가: complete(&mut c);
169추가: assert!(c.terminal.is_some());
170추가: assert_eq!(
171추가: c.delivery_error,
172추가: Some(core::DeliveryError::Sequence {
173추가: expected: 0,
174추가: received: 1
175추가: })
176추가: );
177추가: assert_eq!(c.status, Status::DeliveryFailure);
178추가: assert!(c.rows().is_empty());
179추가: }
180추가:
181추가: #[test]
182추가: fn thread_panic_is_joined_without_synthesized_terminal() {
183추가: let mut c = Controller::default();
184추가: c.task = Some(Task::spawn_with(DEFAULT_CAPACITY, |_, _| panic!("합성 panic")).unwrap());
185추가: complete(&mut c);
186추가: assert_eq!(c.status, Status::Panicked);
187추가: assert!(c.panic.is_some());
188추가: assert!(c.terminal.is_none());
189추가: assert!(c.task.as_ref().unwrap().joined());
190추가: }
191추가:
192추가: #[test]
193추가: fn cancellation_before_work_returns_real_cancelled_result() {
194추가: let (op, cancel) = core::Operation::start().unwrap();
195추가: cancel.request();
196추가: let (sender, _events) = mpsc::sync_channel(DEFAULT_CAPACITY);
197추가: let terminal = runtime::execute(op, Action::Gzip, sender);
198추가: assert!(terminal.outcome.cancelled());
199추가: assert!(terminal.delivery.is_none());
200추가: }
201추가:
202추가: #[test]
203추가: fn cancellation_after_terminal_does_not_rewrite_success() {
204추가: let (op, cancel) = core::Operation::start().unwrap();
205추가: let (sender, _events) = mpsc::sync_channel(DEFAULT_CAPACITY);
206추가: let terminal = runtime::execute(op, Action::Gzip, sender);
207추가: cancel.request();
208추가: assert!(terminal.outcome.is_ok());
209추가: assert!(!terminal.outcome.cancelled());
210추가: }
211추가:
212추가: #[test]
213추가: fn repeated_start_is_rejected_until_join_even_if_thread_finished() {
214추가: let mut c = Controller::default();
215추가: assert!(c.start(Action::Gzip));
216추가: let id = c.task.as_ref().unwrap().id;
217추가: assert!(!c.start(Action::Zip));
218추가: finish(c.task.as_ref().unwrap());
219추가: assert!(!c.start(Action::Zip));
220추가: assert_eq!(c.task.as_ref().unwrap().id, id);
221추가: c.poll();
222추가: assert!(c.start(Action::Zip));
223추가: complete(&mut c);
224추가: }
225추가:
226추가: #[test]
227추가: fn repeated_cancel_sets_request_once() {
228추가: let mut c = Controller::default();
229추가: assert!(c.start(Action::Gzip));
230추가: assert!(c.cancel());
231추가: assert!(!c.cancel());
232추가: complete(&mut c);
233추가: }
234추가:
235추가: #[test]
236추가: fn close_confirmation_does_not_cancel_and_can_be_retracted() {
237추가: let mut c = Controller::default();
238추가: assert!(c.start(Action::Gzip));
239추가: c.request_close();
240추가: assert_eq!(c.close, CloseState::Confirming);
241추가: assert!(!c.task.as_ref().unwrap().cancellation.is_requested());
242추가: c.keep_open();
243추가: assert_eq!(c.close, CloseState::Open);
244추가: complete(&mut c);
245추가: }
246추가:
247추가: #[test]
248추가: fn close_cancel_retraction_keeps_existing_cancel_request() {
249추가: let mut c = Controller::default();
250추가: assert!(c.start(Action::Gzip));
251추가: c.request_close();
252추가: c.confirm_close();
253추가: assert_eq!(c.close, CloseState::Waiting);
254추가: c.keep_open();
255추가: assert_eq!(c.close, CloseState::Open);
256추가: assert!(c.task.as_ref().unwrap().cancellation.is_requested());
257추가: complete(&mut c);
258추가: assert_eq!(c.close, CloseState::Open);
259추가: }
260추가:
261추가: #[test]
262추가: fn close_waits_for_join_and_preserves_terminal() {
263추가: let mut c = Controller::default();
264추가: assert!(c.start(Action::Gzip));
265추가: c.request_close();
266추가: c.confirm_close();
267추가: assert_eq!(c.close, CloseState::Waiting);
268추가: assert!(!c.start(Action::Zip));
269추가: complete(&mut c);
270추가: assert_eq!(c.close, CloseState::Allowed);
271추가: assert!(c.terminal.is_some());
272추가: assert!(c.task.as_ref().unwrap().joined());
273추가: }
274추가:
275추가: #[test]
276추가: fn completed_during_confirmation_still_requires_choice() {
277추가: let mut c = Controller::default();
278추가: assert!(c.start(Action::Gzip));
279추가: c.request_close();
280추가: complete(&mut c);
281추가: assert_eq!(c.close, CloseState::Confirming);
282추가: c.confirm_close();
283추가: c.poll();
284추가: assert_eq!(c.close, CloseState::Allowed);
285추가: }
286추가:
287추가: #[test]
288추가: fn atomic_generation_replacement_rejects_old_selection() {
289추가: let mut c = Controller::default();
290추가: assert!(c.start(Action::Ustar));
291추가: complete(&mut c);
292추가: assert_eq!(c.status, Status::Completed);
293추가: let id = c.task.as_ref().unwrap().id;
294추가: let generation = c.generation;
295추가: assert!(c.select(id, generation, 0));
296추가: assert_eq!(c.selected_bytes(), Some(runtime::PAYLOAD));
297추가: assert!(c.start(Action::Gzip));
298추가: assert!(c.selected.is_none());
299추가: assert!(c.terminal.is_none());
300추가: assert!(!c.select(id, generation, 0));
301추가: complete(&mut c);
302추가: }
303추가:
304추가: #[test]
305추가: fn ustar_exact_ids_and_content_limitation_are_retained() {
306추가: let mut c = Controller::default();
307추가: assert!(c.start(Action::Ustar));
308추가: complete(&mut c);
309추가: assert_eq!(c.rows(), vec!["자료.txt", "empty.txt"]);
310추가: if let runtime::Outcome::Ustar(t) = &c.terminal.as_ref().unwrap().outcome {
311추가: assert_eq!(
312추가: t.result().unwrap().value().content_verification,
313추가: core::ustar::ContentVerification::Unavailable
314추가: );
315추가: assert_eq!(t.result().unwrap().value().files.len(), 2);
316추가: } else {
317추가: panic!();
318추가: }
319추가: }
320추가:
321추가: #[test]
322추가: fn error_retry_uses_new_operation_and_clears_previous_payload() {
323추가: let mut c = Controller::default();
324추가: assert!(c.start(Action::InvalidGzip));
325추가: complete(&mut c);
326추가: assert_eq!(c.status, Status::NativeFailure);
327추가: let old = c.task.as_ref().unwrap().id;
328추가: assert!(c.start(Action::Gzip));
329추가: assert_ne!(c.task.as_ref().unwrap().id, old);
330추가: complete(&mut c);
331추가: assert_eq!(c.status, Status::Completed);
332추가: }
333추가:
334추가: #[test]
335추가: fn headless_values_satisfy_thread_transfer_bounds() {
336추가: fn send<T: Send + 'static>() {}
337추가: send::<Task>();
338추가: send::<runtime::Completion>();
339추가: send::<runtime::ProgressEvent>();
340추가: }
341추가:
342추가: #[test]
343추가: fn oversized_queue_is_rejected_without_spawning() {
344추가: assert!(Task::spawn(Action::Zip, DEFAULT_CAPACITY + 1).is_err());
345추가: }
346추가:
347추가: #[test]
348추가: fn gzip_preview_preserves_original_bytes() {
349추가: let mut c = Controller::default();
350추가: assert!(c.start(Action::Gzip));
351추가: complete(&mut c);
352추가: assert!(c.select(c.task.as_ref().unwrap().id, c.generation, 0));
353추가: assert_eq!(c.selected_bytes(), Some(runtime::PAYLOAD));
354추가: assert_eq!(c.preview().as_bytes(), runtime::PAYLOAD);
355추가: }
356추가:
357추가: #[test]
358추가: fn ui_event_wrapper_excludes_old_operation_before_current_sequence() {
359추가: let (old, _) = core::Operation::start().unwrap();
360추가: let (sender, events) = mpsc::sync_channel(DEFAULT_CAPACITY);
361추가: let old_result = runtime::execute(old, Action::Gzip, sender);
362추가: let (current, _) = core::Operation::start().unwrap();
363추가: let mut receiver = core::Receiver::new(current.id());
364추가: for event in events.try_iter() {
365추가: assert_eq!(
366추가: event.validate(&mut receiver),
367추가: Ok(core::Delivery::IgnoredStale)
368추가: );
369추가: }
370추가: assert_eq!(
371추가: old_result.outcome.validate(&mut receiver),
372추가: Ok(core::Delivery::IgnoredStale)
373추가: );
374추가: let (sender, events) = mpsc::sync_channel(DEFAULT_CAPACITY);
375추가: let result = runtime::execute(current, Action::Gzip, sender);
376추가: for event in events.try_iter() {
377추가: assert_eq!(event.validate(&mut receiver), Ok(core::Delivery::Accepted));
378추가: }
379추가: assert_eq!(
380추가: result.outcome.validate(&mut receiver),
381추가: Ok(core::Delivery::Accepted)
382추가: );
383추가: }
384추가:
385추가: #[test]
386추가: fn native_gzip_callback_error_survives_simultaneous_queue_full() {
387추가: let (operation, cancel) = core::Operation::start().unwrap();
388추가: let (sender, _events) = mpsc::sync_channel(0);
389추가: let mut transport = Transport::new(sender);
390추가: let mut budget = core::gzip::Budget::new(core::gzip::Limits::default()).unwrap();
391추가: let terminal = operation.gzip(
392추가: core::gzip::Request {
393추가: input: runtime::GZIP.into(),
394추가: selected: true,
395추가: },
396추가: &mut budget,
397추가: |event| {
398추가: cancel.request();
399추가: transport.forward(
400추가: event.stamp().sequence(),
401추가: runtime::ProgressEvent::Gzip(event),
402추가: Err(core::gzip::Stop::Callback(runtime::CallbackFailure(
403추가: "original",
404추가: ))),
405추가: || core::gzip::Stop::Cancelled,
406추가: )
407추가: },
408추가: );
409추가: assert!(matches!(
410추가: terminal.result(),
411추가: Err(core::Failure {
412추가: native: Some(core::gzip::Error::Callback(runtime::CallbackFailure(
413추가: "original"
414추가: ))),
415추가: ..
416추가: })
417추가: ));
418추가: assert_eq!(transport.fault.unwrap().kind, DeliveryKind::Full);
419추가: assert!(terminal.cancellation_requested());
420추가: assert!(!terminal.cancellation_forwarded());
421추가: }
추가tests/rust-ui-memory-app/sources.json+350-0
@@ -0,0 +1,350 @@
1추가: {
2추가: "source_head": "23b8d1c615f24f42469138fcc63e7fce7cda4f24",
3추가: "files": [
4추가: {
5추가: "path": "experiments/rust-app-core-memory/Cargo.lock",
6추가: "sha256": "a96a436875a8365e5b7e8f837a02df818b400790615076b83903f12c3ad7116e",
7추가: "git_blob": "37b438af0cb4997dc0e9745e3985e77e31dbb3d0"
8추가: },
9추가: {
10추가: "path": "experiments/rust-app-core-memory/Cargo.toml",
11추가: "sha256": "d47e6b080a13005dd3c195f64d42f581bbc2050062ca4396fc41e32317a76c98",
12추가: "git_blob": "625f39eb96a492a2f4673b1e9065f6331e73a3e9"
13추가: },
14추가: {
15추가: "path": "experiments/rust-app-core-memory/LICENSE",
16추가: "sha256": "0714945e52a4d5b560c02c9a18478519f8c4e2572cbf87bd6d52adcfb2b63c62",
17추가: "git_blob": "5014abac33298592fd3450b51a9b414191e1aabc"
18추가: },
19추가: {
20추가: "path": "experiments/rust-app-core-memory/SHA256SUMS",
21추가: "sha256": "13afa3d9bf53fd5a1c69af085842b722953dd36de1d63d305fea93bf78580b8d",
22추가: "git_blob": "526e870c3e8667de26bbb3ad408521cb33df22e9"
23추가: },
24추가: {
25추가: "path": "experiments/rust-app-core-memory/THIRD-PARTY-NOTICES.txt",
26추가: "sha256": "b6ee40e53b19b59bdcc9464ecd759364264ee5ce9c320cf5616d0f656ec1df68",
27추가: "git_blob": "951447a0637ecc008123dbc2e8a8743741144d83"
28추가: },
29추가: {
30추가: "path": "experiments/rust-app-core-memory/contract.json",
31추가: "sha256": "beffc5271a3355b8ef784d3d15179f4172d2af5c2dc71c1072ae4673e2971c3f",
32추가: "git_blob": "716afdb8b471ef0e5403ba9a5c4a25f9a01e70e5"
33추가: },
34추가: {
35추가: "path": "experiments/rust-app-core-memory/dependencies.json",
36추가: "sha256": "39294cd19d2eb2ad02cf034e527c690348ca07492986b05000d11a053b6aa7e1",
37추가: "git_blob": "3e550f1fbc0331f27972a3cafd412d87cf11611d"
38추가: },
39추가: {
40추가: "path": "experiments/rust-app-core-memory/sources.json",
41추가: "sha256": "a1d536e851130f37fb02c1269cebe8933e43fecf30403da8978e0726746ac15e",
42추가: "git_blob": "74a3dec78cc76fe45aa7822e07549ec130657604"
43추가: },
44추가: {
45추가: "path": "experiments/rust-app-core-memory/src/lib.rs",
46추가: "sha256": "2540ab5f801d78f27e4d2a0a751f15378863ba5b14a4d564b3be4dc996cb7571",
47추가: "git_blob": "3bea6de7efe5657614a4747f2b071abe35de21d9"
48추가: },
49추가: {
50추가: "path": "experiments/rust-memory-gzip-reader/Cargo.lock",
51추가: "sha256": "511197f27b89d37c86f82ae1e8dda4229a3e5082ede9274efe8480df6e650d24",
52추가: "git_blob": "a638f9b00ea1d76a99ccd93ea465ef9df4163c7a"
53추가: },
54추가: {
55추가: "path": "experiments/rust-memory-gzip-reader/Cargo.toml",
56추가: "sha256": "ae76aededbb85cdd6c9227b4c06a1c8fef1bb7f203f1703e787b68f30ccfab6a",
57추가: "git_blob": "1b1b77e23d39cde1f05e55f73b62f68cf77dd9c6"
58추가: },
59추가: {
60추가: "path": "experiments/rust-memory-gzip-reader/LICENSE",
61추가: "sha256": "0714945e52a4d5b560c02c9a18478519f8c4e2572cbf87bd6d52adcfb2b63c62",
62추가: "git_blob": "5014abac33298592fd3450b51a9b414191e1aabc"
63추가: },
64추가: {
65추가: "path": "experiments/rust-memory-gzip-reader/SHA256SUMS",
66추가: "sha256": "13e41e7d8ce2442cd8d93b1229211a5257e0568acc3466d5f9ec37f03c72a736",
67추가: "git_blob": "e248c4827c2fb2e82a5e92f80deb0d744209c65c"
68추가: },
69추가: {
70추가: "path": "experiments/rust-memory-gzip-reader/THIRD-PARTY-NOTICES.txt",
71추가: "sha256": "655ad3bee8c41a593c2b00cbb0a12be11e7246c41dda00319c223dd3f904910e",
72추가: "git_blob": "f56aa8d736e78465701ac62fa5ad26d4d7dc05c9"
73추가: },
74추가: {
75추가: "path": "experiments/rust-memory-gzip-reader/contract.json",
76추가: "sha256": "1346c0b6f0ce5221acb9aef5067b0169e08ea6752f4db41a8b9c36b10ef9b43b",
77추가: "git_blob": "02729ca349d5629b1a9fcd7040441db2e2660065"
78추가: },
79추가: {
80추가: "path": "experiments/rust-memory-gzip-reader/dependencies.json",
81추가: "sha256": "3f71220451f8cd55dafdb6e6ae901572ec7bbe1be9c93d78953b44244aec6b07",
82추가: "git_blob": "bf9da9b737d9d574d5e31fb8343f844b61e4c192"
83추가: },
84추가: {
85추가: "path": "experiments/rust-memory-gzip-reader/src/budget.rs",
86추가: "sha256": "b0d0b891a048712baba2038b8439d809a0359638f390b806f88496733753d61c",
87추가: "git_blob": "0fa6fd1cdb541896540b7003168e5db71c11cb4b"
88추가: },
89추가: {
90추가: "path": "experiments/rust-memory-gzip-reader/src/lib.rs",
91추가: "sha256": "a865a114fdb9d79b66226387b9f0e3fa601aad29cfe65ab443c946d6cbd74062",
92추가: "git_blob": "1811dfc7ec0917da607727e7942b5a268ac7330a"
93추가: },
94추가: {
95추가: "path": "experiments/rust-memory-ustar-reader/Cargo.lock",
96추가: "sha256": "2a5d774e8cd96caa426d2d97d9c112062a57c156a026ae588932bced0af015ae",
97추가: "git_blob": "4016006d7b01deb8efebff0e1d44218a0dd4b376"
98추가: },
99추가: {
100추가: "path": "experiments/rust-memory-ustar-reader/Cargo.toml",
101추가: "sha256": "08f2cb43c2f541c4420deab0c6097ce732cd7ca6e32f9895c9cbc48dc7722734",
102추가: "git_blob": "42de96e4aa4c89a243ad988fa7a7f724ff70dc01"
103추가: },
104추가: {
105추가: "path": "experiments/rust-memory-ustar-reader/LICENSE",
106추가: "sha256": "0714945e52a4d5b560c02c9a18478519f8c4e2572cbf87bd6d52adcfb2b63c62",
107추가: "git_blob": "5014abac33298592fd3450b51a9b414191e1aabc"
108추가: },
109추가: {
110추가: "path": "experiments/rust-memory-ustar-reader/SHA256SUMS",
111추가: "sha256": "a7cf6f6ad510173bf9ccbf0245ad20fd06cad08bcab4cc601031006e95305d28",
112추가: "git_blob": "b8868532047fb561fc9fc987b1cbbb9c8daab298"
113추가: },
114추가: {
115추가: "path": "experiments/rust-memory-ustar-reader/THIRD-PARTY-NOTICES.txt",
116추가: "sha256": "e4d82397ea8ad7780bfcf97344548f2a7784e2ae6384441e54193b351bf8dad6",
117추가: "git_blob": "8540c10d9c03253ce1ed31142fe98229ab6d90cf"
118추가: },
119추가: {
120추가: "path": "experiments/rust-memory-ustar-reader/contract.json",
121추가: "sha256": "21cb673b63a14af1641406d8adb20cfcfd47adfad1ce15ff3c7c2d9840077b06",
122추가: "git_blob": "8ae86c21671984209bc30973605d61327259aa16"
123추가: },
124추가: {
125추가: "path": "experiments/rust-memory-ustar-reader/dependencies.json",
126추가: "sha256": "7c793eb80dbc167fddc8c0660123507fc80c6ebb763cbd06821f6b95735b9271",
127추가: "git_blob": "f9d8b8d2f82f758894ad2698c50107b2341fb183"
128추가: },
129추가: {
130추가: "path": "experiments/rust-memory-ustar-reader/src/budget.rs",
131추가: "sha256": "5d511a2519ed26e0fa8fb84b2d8cc0479679e9c3b5815a3c0e20790a283c923e",
132추가: "git_blob": "1eab0733b90b66fc12b5db2931fb7dcb08d80c13"
133추가: },
134추가: {
135추가: "path": "experiments/rust-memory-ustar-reader/src/header.rs",
136추가: "sha256": "263c2a610d522c0f5bf24ceef14be184735b4858a40277963252bae439d4112e",
137추가: "git_blob": "d278d372076b40715c6f73e1f0c67b54293566ca"
138추가: },
139추가: {
140추가: "path": "experiments/rust-memory-ustar-reader/src/lib.rs",
141추가: "sha256": "9b57f771c1d89ffc74aea604d7f3476202ad62914c91a5246802706294e5bfcd",
142추가: "git_blob": "ce8e3b751a53a66f5d0cfaab15ffdeea92fae98f"
143추가: },
144추가: {
145추가: "path": "experiments/rust-memory-zip-create/Cargo.lock",
146추가: "sha256": "bb094be9b047cc7a9100492e1e7aa69ddbbc2a3d8bf2c4e8eaa49024160fd2c3",
147추가: "git_blob": "aed6fe07391fce292edebb5206f98a617d2c4376"
148추가: },
149추가: {
150추가: "path": "experiments/rust-memory-zip-create/Cargo.toml",
151추가: "sha256": "c8483ab032ce94e35ba84b56a4b127e669358f7e9f9b945b3ba60b472ab87b0e",
152추가: "git_blob": "899e96fbbd98053ff521d7f29aa2b682fccafb08"
153추가: },
154추가: {
155추가: "path": "experiments/rust-memory-zip-create/SHA256SUMS",
156추가: "sha256": "c4d5651a956429a97e830906c132b537dca6e1c7c491f8148cbdd27d1cb63469",
157추가: "git_blob": "b6738fe846fa737f5cacd53147a1492e917b73d5"
158추가: },
159추가: {
160추가: "path": "experiments/rust-memory-zip-create/contract.json",
161추가: "sha256": "d3fc6cc43fa7f70f0a6cfb5e441348a3c011dac8d8e08b3061c0df5fce8e9206",
162추가: "git_blob": "6be643ca9603b688f705eae172bb276d4afff35a"
163추가: },
164추가: {
165추가: "path": "experiments/rust-memory-zip-create/src/lib.rs",
166추가: "sha256": "3b2019fd963600155fd4dc01f55fef7f3e5c8ceec944a36597de984d5a8b7e8b",
167추가: "git_blob": "08cea1778ec21e4403f752901de9bfc7fa1ee8c9"
168추가: },
169추가: {
170추가: "path": "experiments/rust-memory-zip-create/src/storage.rs",
171추가: "sha256": "1f81f5b1830eaf5f5e5e510841e10f3dd692f6d310a1871ce46fe4445dff9706",
172추가: "git_blob": "1b61dd18f5e41e86ffdde752fc6ebc828a2c1b8c"
173추가: },
174추가: {
175추가: "path": "tests/rust-memory-gzip-reader/Cargo.lock",
176추가: "sha256": "5932825be6b65fda2dc957a18992db63673e6eecdd55853fb743c133f359262c",
177추가: "git_blob": "46a7653b949febc573a3429aa7811b8c34508dc6"
178추가: },
179추가: {
180추가: "path": "tests/rust-memory-gzip-reader/Cargo.toml",
181추가: "sha256": "2e8476195852aaec340015755ecb37ef8fa65d5ba375f8c7a60e3b8d0643ed1e",
182추가: "git_blob": "b803e4a1c2495736b3758e4d993e40a86ef7f50d"
183추가: },
184추가: {
185추가: "path": "tests/rust-memory-gzip-reader/SHA256SUMS",
186추가: "sha256": "1633895d78cca4c38f63c6efdf164d2c2d5ca1561c7eeb87dc5144159f05fd77",
187추가: "git_blob": "cb0292aab9f320eca2fd4b3395c10f84ca898ff6"
188추가: },
189추가: {
190추가: "path": "tests/rust-memory-gzip-reader/budgets.rs",
191추가: "sha256": "d1b5132d656d514d73ac0f510991fab70d0c8783b9a10bf6314149a6d7a3649c",
192추가: "git_blob": "0ec6e8818c277600841f4f37d069a5acce1c306e"
193추가: },
194추가: {
195추가: "path": "tests/rust-memory-gzip-reader/checkpoints.rs",
196추가: "sha256": "6e995ed0edf29c0b4f513ddb0a9e56b427cefbd58e78351674ad0e4ee490de74",
197추가: "git_blob": "5fa98cc9affaa4554562308663716ea5b2841636"
198추가: },
199추가: {
200추가: "path": "tests/rust-memory-gzip-reader/contract.json",
201추가: "sha256": "aa6640e76fd821168afe6e78ae6f29aed27514a4100b5abab8054625d7aef79b",
202추가: "git_blob": "c6d4feae43bd9e67ffd1009b3b0dff653f7952ff"
203추가: },
204추가: {
205추가: "path": "tests/rust-memory-gzip-reader/fixtures.hex",
206추가: "sha256": "e0768b8c44a7e6586bc423eea561da49eecbf5114130d88992b2c6c5893ae355",
207추가: "git_blob": "80e41d988d8d13c45b54d640468ca4939e84d7fa"
208추가: },
209추가: {
210추가: "path": "tests/rust-memory-gzip-reader/fixtures.json",
211추가: "sha256": "329cbac0a9b5b064ef1db4c59d83860c97a6d2819e4659405b75e17bdc82b45d",
212추가: "git_blob": "d52a90d943151d7ba2c9dc1da76addccd661e4e4"
213추가: },
214추가: {
215추가: "path": "tests/rust-memory-gzip-reader/format.rs",
216추가: "sha256": "b5a6c624e9911aa4e818612cc7a868a43313ee1e1c63b6352b8410ed896154c5",
217추가: "git_blob": "302adf4151f5f5c8100133eab82ad6f5e72003d5"
218추가: },
219추가: {
220추가: "path": "tests/rust-memory-gzip-reader/generate_fixtures.py",
221추가: "sha256": "1cde1dd2f913820f77458e5accfcdb91aec5a1319e3c0fb2d91fd7e385690831",
222추가: "git_blob": "e48f324c331e429312c434761b1f40920957ca0d"
223추가: },
224추가: {
225추가: "path": "tests/rust-memory-gzip-reader/main.rs",
226추가: "sha256": "036865bd2661062ea59d84362fdd747d9ce79d9b78400f12be3bea7703466020",
227추가: "git_blob": "de62741b5834c691c67a0a606417237d3a45108b"
228추가: },
229추가: {
230추가: "path": "tests/rust-memory-gzip-reader/static_check.py",
231추가: "sha256": "c37887322e014c6b96c71f0e979856a2be88713af57462e4436697ee7034407e",
232추가: "git_blob": "74f7ca66d71692e7bec4f690ab6595d5344b0dfb"
233추가: },
234추가: {
235추가: "path": "tests/rust-memory-gzip-reader/static_check_helper_tests.py",
236추가: "sha256": "de4908b609ddb6789777901875ea224f962a9f96e9f17cd85765bb05d8231beb",
237추가: "git_blob": "e5ab9c60a4107c6ed21995f35d4b2a695de86e1d"
238추가: },
239추가: {
240추가: "path": "tests/rust-memory-gzip-reader/support.rs",
241추가: "sha256": "a4d39c7b9b9270eb31fb3e73d9ebd57c9ba78a99b73851944bdd4d645e8d5fc5",
242추가: "git_blob": "b0a0bd05bc3f7d331fad375cbb0d0eddbd825b48"
243추가: },
244추가: {
245추가: "path": "tests/rust-memory-ustar-reader/Cargo.lock",
246추가: "sha256": "6e4cce2848f1e4b120b28722fb73956dca7f759419029e299b6c09acc1e0dfc5",
247추가: "git_blob": "62a03ba78153130ca889b63c7be046264f8ede1f"
248추가: },
249추가: {
250추가: "path": "tests/rust-memory-ustar-reader/Cargo.toml",
251추가: "sha256": "5a7e53d47ff3c08b5531ed1fed5e574d917ed5b7f8af0a52c8de401ca6bcb792",
252추가: "git_blob": "1dc8fe5f69638e504c6f88a4ba4f1562b285f39f"
253추가: },
254추가: {
255추가: "path": "tests/rust-memory-ustar-reader/SHA256SUMS",
256추가: "sha256": "5740d93c2429dc81f9859c6fe29fdac9cf417f8783c07029a1f28a1f3a4d37fe",
257추가: "git_blob": "0093ed9578bab969ea69bb332d36fb5d980c4846"
258추가: },
259추가: {
260추가: "path": "tests/rust-memory-ustar-reader/budget.rs",
261추가: "sha256": "c3d80703b31a3e9712509168b0b1d947b985918d40aac6dfa8e4f4c0f31569f3",
262추가: "git_blob": "60ccf1de5f9f17ec0ad9e569fbe167241ea2472d"
263추가: },
264추가: {
265추가: "path": "tests/rust-memory-ustar-reader/callbacks.rs",
266추가: "sha256": "fe9f476dbee65e044adc3edd8f58c7a5183ec92b6802e05a0ac010319e0170f4",
267추가: "git_blob": "3676cc4adda6596d4ea6d14741e70268bded1356"
268추가: },
269추가: {
270추가: "path": "tests/rust-memory-ustar-reader/contract.json",
271추가: "sha256": "a4e4eb34896295b85dacc22dfa9344eba12854d912e20fc83c7f788b83bbbef9",
272추가: "git_blob": "08b8b17997818ee2685149f2cc0781cf2da1982a"
273추가: },
274추가: {
275추가: "path": "tests/rust-memory-ustar-reader/format.rs",
276추가: "sha256": "40934ec14e2e30994170118dbf9350c29a28ef9ae65aa4b10748216a35314c8b",
277추가: "git_blob": "80eecfd680669804add50ea14195eacd21de3a3e"
278추가: },
279추가: {
280추가: "path": "tests/rust-memory-ustar-reader/main.rs",
281추가: "sha256": "50714865d7b6e53e0419ca0e26536f62237117b743dc98097912fe453d78c558",
282추가: "git_blob": "b993568c08adcfd0be8648108432e3e3219961dd"
283추가: },
284추가: {
285추가: "path": "tests/rust-memory-ustar-reader/names.rs",
286추가: "sha256": "2611bfd6b8ca37bccb6110fbc954b15e810741d453edd6349efc0cdb114180c2",
287추가: "git_blob": "89c9df6bf935b7084aa24fedd3cd6ccf18307b23"
288추가: },
289추가: {
290추가: "path": "tests/rust-memory-ustar-reader/selection.rs",
291추가: "sha256": "b62dc7bbefee258dd110632aeff9140d512fb881a7d5edc7054ca31784cd6d99",
292추가: "git_blob": "e35f28c7c7897bda7270ad4a9f9bb925fd8d2c8e"
293추가: },
294추가: {
295추가: "path": "tests/rust-memory-ustar-reader/static_check.py",
296추가: "sha256": "e0d113edb4b150be4a5ecb1abb055fab91218461bc168bbf9787041c4fe2f09e",
297추가: "git_blob": "ebeb48b3c016a57b0e883a4de409c99800a6b2f0"
298추가: },
299추가: {
300추가: "path": "tests/rust-memory-ustar-reader/support.rs",
301추가: "sha256": "6c30a2c7ce9598f9e89d0f28b6a0512d1abb10462b1777a8c9042f9591c2bae7",
302추가: "git_blob": "a280942626fab1e193d3d6ed8ca87d139c9b1d4e"
303추가: },
304추가: {
305추가: "path": "tests/rust-memory-zip-create/SHA256SUMS",
306추가: "sha256": "be63110eb2df851d26a7a6c929d4b0d6c1c1f7d0ddff47de2e3034350fc48b00",
307추가: "git_blob": "b3fa66b24d8878f42a324df91440f7845dd88aa5"
308추가: },
309추가: {
310추가: "path": "tests/rust-memory-zip-create/api.rs",
311추가: "sha256": "69239e5ef0c9d78fa5db14ef45cfcc49b8be79ffd68402d98d61173282377ad5",
312추가: "git_blob": "7f8ff939763613aa35c226e5884085a6965e8c6e"
313추가: },
314추가: {
315추가: "path": "tests/rust-memory-zip-create/contract.json",
316추가: "sha256": "68ad1c93c78a73bcbecfc5413cdfcabbd70142daf5bc0ac33640e0975b4bfd21",
317추가: "git_blob": "9d154572a4f76db6ee702d70c7f39923f7af21ff"
318추가: },
319추가: {
320추가: "path": "tests/rust-memory-zip-create/lifecycle.rs",
321추가: "sha256": "ddb80e1ad74197fe5fd57356a1ff918ee60eeea442eb1997a585d1f9afb9bbc0",
322추가: "git_blob": "09c271403d06557cf98151929e538ee22dc43921"
323추가: },
324추가: {
325추가: "path": "tests/rust-memory-zip-create/limits.rs",
326추가: "sha256": "2abd7c04fb7e1b614179d38f9f865e655c8468df3002069c8058f3e84bb1b4e5",
327추가: "git_blob": "727b74081ebe164942a2a570c5cfa7c18e96d313"
328추가: },
329추가: {
330추가: "path": "tests/rust-memory-zip-create/names.rs",
331추가: "sha256": "dcd350774e6c597401f70de3bbf32be7f37187ecc6adf3260698346226ee1f11",
332추가: "git_blob": "7545050d770bb62be53cbd492d2f5d901065fb5f"
333추가: },
334추가: {
335추가: "path": "tests/rust-memory-zip-create/roundtrip.rs",
336추가: "sha256": "6e9688326e9e31bb8cdedc013bd03d1d656ac3067e341f69d62ba5abed21c21a",
337추가: "git_blob": "ed0cc4a0aa775c65215cd5f3671b6932ab927094"
338추가: },
339추가: {
340추가: "path": "tests/rust-memory-zip-create/storage.rs",
341추가: "sha256": "76a63e576d5db521d3b2af179a1251681ddbac5a2f7a62b3015eb75adcda0ee2",
342추가: "git_blob": "08aefae839d9ede99396062e17d670d8b8ee3efe"
343추가: },
344추가: {
345추가: "path": "tests/rust-memory-zip-create/support.rs",
346추가: "sha256": "971bdf33eb3e7d5ea64293fd70063e166019a47a229f3900fdcd416af8cdccb5",
347추가: "git_blob": "a1bba5fd57e8edbe29df6d13c7597583a9e4c3cc"
348추가: }
349추가: ]
350추가: }
추가tests/rust-ui-memory-app/static_check.py+58-0
@@ -0,0 +1,58 @@
1추가: import hashlib
2추가: import json
3추가: from pathlib import Path, PurePosixPath
4추가: import re
5추가: import sys
6추가:
7추가: ROOT = Path(__file__).resolve().parents[2]
8추가: HERE = Path(__file__).resolve().parent
9추가:
10추가:
11추가: def sha(path):
12추가: return hashlib.sha256(path.read_bytes()).hexdigest()
13추가:
14추가:
15추가: def main():
16추가: if sys.flags.optimize:
17추가: raise RuntimeError("최적화 모드에서는 검사할 수 없음")
18추가: if len(sys.argv) != 2 or re.fullmatch(r"[0-9a-f]{64}", sys.argv[1]) is None:
19추가: raise ValueError("별도 확인한 manifest SHA256 인수가 필요함")
20추가: manifest = HERE / "SHA256SUMS"
21추가: if sha(manifest) != sys.argv[1]:
22추가: raise ValueError("manifest 기대 hash 불일치")
23추가: data = manifest.read_bytes()
24추가: if not data.endswith(b"\n"):
25추가: raise ValueError("manifest 마지막 줄바꿈 누락")
26추가: names = set()
27추가: for row in data.decode("ascii").splitlines():
28추가: match = re.fullmatch(r"([0-9a-f]{64}) ([A-Za-z0-9_./-]+)", row)
29추가: if match is None:
30추가: raise ValueError("잘못된 hash 행")
31추가: expected, name = match.groups()
32추가: path = PurePosixPath(name)
33추가: if path.is_absolute() or str(path) != name or any(x in ("", ".", "..") for x in name.split("/")) or name in names:
34추가: raise ValueError("잘못된 경로 또는 중복")
35추가: names.add(name)
36추가: current = ROOT
37추가: for part in path.parts:
38추가: current = current / part
39추가: if current.is_symlink():
40추가: raise ValueError("symlink 거부")
41추가: if sha(current) != expected:
42추가: raise ValueError("파일 hash 불일치: " + name)
43추가: expected_names = set(json.loads((HERE / "files.json").read_text()))
44추가: if names != expected_names:
45추가: raise ValueError("누락 또는 추가 경로")
46추가: sources = json.loads((HERE / "sources.json").read_text())
47추가: for source in sources["files"]:
48추가: if sha(ROOT / source["path"]) != source["sha256"]:
49추가: raise ValueError("고정 source 불일치: " + source["path"])
50추가: contract = json.loads((HERE / "contract.json").read_text())
51추가: names = re.findall(r"#\[test\]\s*fn (\w+)", (HERE / "regressions.rs").read_text())
52추가: if len(names) != len(set(names)) or names != contract["validation"]["names"]:
53추가: raise ValueError("선언된 회귀 이름 불일치")
54추가: print(json.dumps({"static_files": len(expected_names), "upstream_files": len(sources["files"]), "declared_tests": len(names), "executed_tests": 0}))
55추가:
56추가:
57추가: if __name__ == "__main__":
58추가: main()