team-ljyzipelo

공개

Merge pull request #72 from Team-LJY/features/app-password-flow

실제 작업자의 암호 요청과 암호 ZIP 생성 옵션을 화면에 연결
작성자
LeeJunyoung
작성 시각
커밋
2b284f88df169bc30adeb2e7470b207dc92c156f
이 시점의 파일 보기

변경된 파일 7개

+467-42
수정experiments/rust-ui-memory-app/src/archive_screen.rs+37-9
@@ -11,6 +11,8 @@ pub struct ArchiveApp {
1111 sources: String,
1212 zip_output: String,
1313 password: String,
14추가: password_challenge: Option<u64>,
15추가: aes256: bool,
1416 create: bool,
1517 open: bool,
1618 selected_only: bool,
@@ -28,6 +30,8 @@ impl ArchiveApp {
2830 sources: String::new(),
2931 zip_output: String::new(),
3032 password: String::new(),
33추가: password_challenge: None,
34추가: aes256: false,
3135 create: false,
3236 open: false,
3337 selected_only: false,
@@ -39,8 +43,12 @@ impl ArchiveApp {
3943 }
4044 app
4145 }
46추가: fn clear_password(&mut self) {
47추가: let mut bytes = std::mem::take(&mut self.password).into_bytes();
48추가: bytes.fill(0);
49추가: }
4250 pub fn open_path(&mut self, archive: PathBuf) {
43삭제: self.password.clear();
51추가: self.clear_password();
4452 self.model
4553 .begin(Start::List { archive }, self.factory.as_mut());
4654 }
@@ -58,16 +66,19 @@ impl ArchiveApp {
5866 .join("\n");
5967 self.create = true;
6068 } else {
61삭제: self.model.error = Some("ZIP 생성 경로는 현재 UTF-8 입력만 지원합니다".into());
69추가: self.model.input_error = Some("ZIP 생성 경로는 현재 UTF-8 입력만 지원합니다".into());
6270 }
6371 }
6472}
6573impl ArchiveApp {
6674 pub fn show(&mut self, root: &mut egui::Ui) {
6775 self.model.poll();
68삭제: if self.model.challenge.is_none() {
69삭제: self.password.clear();
76추가: let challenge = self.model.challenge.map(|(id, _, _)| id);
77추가: let new_challenge = challenge != self.password_challenge;
78추가: if new_challenge || challenge.is_none() {
79추가: self.clear_password();
7080 }
81추가: self.password_challenge = challenge;
7182 let ctx = root.ctx().clone();
7283 let dropped = ctx.input(|i| {
7384 i.raw
@@ -104,7 +115,7 @@ impl ArchiveApp {
104115 .add_enabled(self.model.busy(), egui::Button::new("취소 요청"))
105116 .clicked()
106117 {
107삭제: self.password.clear();
118추가: self.clear_password();
108119 self.model.cancel();
109120 }
110121 });
@@ -267,7 +278,7 @@ impl ArchiveApp {
267278 ui.selectable_value(&mut self.method, Method::Deflate, "압축");
268279 ui.selectable_value(&mut self.method, Method::Store, "묶기");
269280 });
270삭제: ui.label("암호 ZIP 생성은 작업자 지원 후 활성화됩니다");
281추가: ui.checkbox(&mut self.aes256, "암호로 보호");
271282 if ui.button("ZIP 만들기").clicked() {
272283 let sources = self
273284 .sources
@@ -287,7 +298,7 @@ impl ArchiveApp {
287298 sources,
288299 output_file: self.zip_output.clone().into(),
289300 method: self.method,
290삭제: aes256: false,
301추가: aes256: self.aes256,
291302 },
292303 self.factory.as_mut(),
293304 ) {
@@ -308,12 +319,23 @@ impl ArchiveApp {
308319 })
309320 .collapsible(false)
310321 .show(&ctx, |ui| {
311삭제: ui.label(format!("암호 입력 요청 {attempt}"));
322추가: ui.label(if encrypt {
323추가: "사용할 암호를 입력하세요"
324추가: } else if attempt > 1 {
325추가: "암호가 맞지 않습니다. 다시 입력하세요"
326추가: } else {
327추가: "암호를 입력하세요"
328추가: });
329추가: ui.label("암호");
312330 let edit = ui.add(
313331 egui::TextEdit::singleline(&mut self.password)
314332 .password(true)
333추가: .id(egui::Id::new("archive-password-input"))
315334 .char_limit(1024),
316335 );
336추가: if new_challenge {
337추가: edit.request_focus();
338추가: }
317339 if ui.button("암호 전달").clicked()
318340 || (edit.lost_focus() && ui.input(|i| i.key_pressed(egui::Key::Enter)))
319341 {
@@ -321,7 +343,7 @@ impl ArchiveApp {
321343 self.model.password(text);
322344 }
323345 if ui.button("작업 취소").clicked() {
324삭제: self.password.clear();
346추가: self.clear_password();
325347 self.model.cancel();
326348 }
327349 });
@@ -381,3 +403,9 @@ impl eframe::App for ArchiveApp {
381403 self.show(root);
382404 }
383405}
406추가:
407추가: impl Drop for ArchiveApp {
408추가: fn drop(&mut self) {
409추가: self.clear_password();
410추가: }
411추가: }
수정experiments/rust-ui-memory-app/src/archive_ui.rs+12-8
@@ -54,10 +54,12 @@ pub enum Start {
5454pub struct Secret(Vec<u8>);
5555impl Secret {
5656 pub fn new(text: String) -> Result<Self, &'static str> {
57삭제: if text.is_empty() || text.len() > 1024 {
57추가: let mut bytes = text.into_bytes();
58추가: if bytes.is_empty() || bytes.len() > 1024 {
59추가: bytes.fill(0);
5860 return Err("암호는 UTF-8 1~1024바이트로 입력하세요");
5961 }
60삭제: Ok(Self(text.into_bytes()))
62추가: Ok(Self(bytes))
6163 }
6264 pub fn as_bytes(&self) -> &[u8] {
6365 &self.0
@@ -268,6 +270,7 @@ pub struct Model {
268270 pub outputs: Vec<(String, Disposition)>,
269271 pub cancel: Option<CancelStatus>,
270272 pub error: Option<String>,
273추가: pub input_error: Option<String>,
271274 pub encryption: bool,
272275 pub close: Close,
273276 pub confirmed: bool,
@@ -323,19 +326,17 @@ impl Model {
323326 Start::CreateZip {
324327 sources,
325328 output_file,
326삭제: aes256,
327329 ..
328330 } => {
329331 !sources.is_empty()
330332 && output_file.is_absolute()
331삭제: && (!aes256 || self.encryption)
332333 && sources
333334 .iter()
334335 .all(|(p, n)| p.is_absolute() && valid_relative(n))
335336 }
336337 };
337338 if !validation {
338삭제: self.error = Some("입력 경로, 출력명과 선택한 목록을 확인하세요".into());
339추가: self.input_error = Some("입력 경로, 출력명과 선택한 목록을 확인하세요".into());
339340 return false;
340341 }
341342 let Some(id) = self.next_id.checked_add(1) else {
@@ -371,6 +372,7 @@ impl Model {
371372 self.progress = None;
372373 self.outputs.clear();
373374 self.cancel = None;
375추가: self.input_error = None;
374376 self.error = send_error;
375377 self.confirmed = false;
376378 self.running = Some(Running {
@@ -423,7 +425,7 @@ impl Model {
423425 let secret = match Secret::new(text) {
424426 Ok(s) => s,
425427 Err(e) => {
426삭제: self.error = Some(e.into());
428추가: self.input_error = Some(e.into());
427429 return false;
428430 }
429431 };
@@ -435,7 +437,7 @@ impl Model {
435437 .is_some()
436438 {
437439 self.challenge = None;
438삭제: self.error = None;
440추가: self.input_error = None;
439441 true
440442 } else {
441443 false
@@ -475,6 +477,7 @@ impl Model {
475477 if let Some(seq) = self.send(Command::Cancel) {
476478 self.running.as_mut().unwrap().cancel_sequence = Some(seq);
477479 self.challenge = None;
480추가: self.input_error = None;
478481 }
479482 }
480483 }
@@ -556,6 +559,7 @@ impl Model {
556559 self.selected.clear();
557560 }
558561 self.challenge = None;
562추가: self.input_error = None;
559563 if matches!(self.close, Close::Waiting | Close::Confirm) {
560564 self.close = Close::Review;
561565 }
@@ -668,7 +672,7 @@ impl Model {
668672 }
669673 }
670674 pub fn status(&self) -> String {
671삭제: if let Some(error) = &self.error {
675추가: if let Some(error) = self.error.as_ref().or(self.input_error.as_ref()) {
672676 return error.clone();
673677 }
674678 if self.busy() {
수정tests/rust-app-real-worker/README.md+11-0
@@ -51,6 +51,17 @@ fixtures/는 generate.py의 Python 표준 라이브러리로 생성한 작은
5151
5252취소와 종료 경합 회귀 시험은 실제 작업자에 List를 보낸 뒤 화면 poll 전에 취소하는 흐름을 100회 확인함. 취소 파이프 쓰기가 실패해도 검증된 Terminal과 성공 종료가 있으면 원래 결과를 보존하며, Terminal이 없는 조기 종료는 계속 실패로 처리함. 취소 쓰기 오류 판단을 미루어도 EOF와 child wait 전에는 닫기나 작업 교체를 허용하지 않음.
5353
54추가: 암호 화면 흐름
55추가:
56추가: password_flows.rs는 공개 시험 암호 fixture-password를 사용하는 기존 합성 ZIP 6개로
57추가: ZipCrypto와 AES의 Store/Deflate 목록 및 해제를 실제 화면 위젯과 작업자로 확인함.
58추가: 목록은 암호 없이 표시하며 해제 시 작업자의 challenge_id와 attempt로 암호를 요청함.
59추가: 틀린 암호 뒤 재입력, 3회 실패, 빈 입력과 UTF-8 바이트 한도 초과, 대기 중 취소,
60추가: 첫 실행의 AES ZIP 생성 및 재열기/해제를 검증함. 실패와 취소 중 출력이 없고 기존 파일과
61추가: 원본이 보존되며 Terminal, 양쪽 EOF 및 child wait 후 연결이 정리되는지 확인함.
62추가: 암호 표시를 가리고 재요청, 취소 및 창 해제 때 앱이 소유한 입력 버퍼를 지움.
63추가: Windows 실행이나 네이티브 OS 창 입력 자동화 검증은 포함하지 않음.
64추가:
54657z 앱 연동은 revision 2의 기존 Format 값 0~3을 유지하고 SevenZip 값 4를 추가함.
5566formats.rs는 전체 ListEnd 프레임을 고정 바이트와 비교하고 Unix/Windows 식별자가
5667목록 응답과 해제 요청 사이에서 보존되는지 확인함. 화면 흐름 시험은 PR69의 LZMA와
수정tests/rust-app-real-worker/flows.rs+2-0
@@ -271,6 +271,8 @@ mod screen {
271271 );
272272 }
273273 }
274추가: include!("password_flows.rs");
275추가:
274276 fn archive_flow(name: &str, format: Format) {
275277 let scratch = Scratch::new();
276278 let fixture = Path::new(env!("CARGO_MANIFEST_DIR"))
추가tests/rust-app-real-worker/password_flows.rs+333-0
@@ -0,0 +1,333 @@
1추가: const FIXTURE_PASSWORD: &str = "fixture-password";
2추가: fn encrypted_fixture(scratch: &Scratch, name: &str) -> PathBuf {
3추가: let archive = scratch.path(name);
4추가: fs::copy(
5추가: Path::new(env!("CARGO_MANIFEST_DIR"))
6추가: .join("../../tests/rust-archive-worker/fixtures")
7추가: .join(name),
8추가: &archive,
9추가: )
10추가: .unwrap();
11추가: archive
12추가: }
13추가: impl Screen {
14추가: fn password_request(&mut self, expected_attempt: u32, encrypt: bool) -> u64 {
15추가: let deadline = Instant::now() + Duration::from_secs(10);
16추가: loop {
17추가: self.render(vec![]);
18추가: assert!(self.app.model.busy(), "{}", self.app.model.status());
19추가: if let Some((id, attempt, purpose)) = self.app.model.challenge {
20추가: assert_eq!(attempt, expected_attempt);
21추가: assert_eq!(purpose, encrypt);
22추가: self.render(vec![]);
23추가: return id;
24추가: }
25추가: assert!(Instant::now() < deadline);
26추가: std::thread::sleep(Duration::from_millis(2));
27추가: }
28추가: }
29추가: fn password_answer(&mut self, text: &str) {
30추가: self.render(vec![]);
31추가: let input = self
32추가: .context
33추가: .read_response(egui::Id::new("archive-password-input"))
34추가: .expect("암호 입력란이 없음")
35추가: .rect
36추가: .center();
37추가: self.click_at(input);
38추가: let rendered = self.render(vec![
39추가: egui::Event::Key {
40추가: key: egui::Key::A,
41추가: physical_key: None,
42추가: pressed: true,
43추가: repeat: false,
44추가: modifiers: egui::Modifiers::COMMAND,
45추가: },
46추가: egui::Event::Text(text.into()),
47추가: ]);
48추가: if !text.is_empty() {
49추가: assert!(!rendered.iter().any(|(value, _)| value.contains(text)));
50추가: }
51추가: self.click("암호 전달");
52추가: }
53추가: fn start_password_extract(&mut self, output: &Path) {
54추가: self.fill("출력 폴더", egui::vec2(100.0, 0.0), output);
55추가: self.click("풀기");
56추가: assert!(self.app.model.busy());
57추가: }
58추가: fn finish_password_job(&mut self, expected: Outcome) {
59추가: let deadline = Instant::now() + Duration::from_secs(10);
60추가: while self.app.model.busy() {
61추가: self.render(vec![]);
62추가: assert!(Instant::now() < deadline);
63추가: std::thread::sleep(Duration::from_millis(2));
64추가: }
65추가: assert!(self.app.model.confirmed, "{}", self.app.model.status());
66추가: assert_eq!(self.app.model.terminal.as_ref().unwrap().outcome, expected);
67추가: assert!(self.app.model.challenge.is_none());
68추가: }
69추가: fn start_encrypted_zip(&mut self, source: &Path, archive: &Path) {
70추가: self.click("ZIP 만들기");
71추가: self.fill(
72추가: "원본 파일 절대 경로 / 한 줄에 하나",
73추가: egui::vec2(0.0, 25.0),
74추가: source,
75추가: );
76추가: self.fill("저장할 ZIP 절대 경로", egui::vec2(0.0, 22.0), archive);
77추가: self.click("암호로 보호");
78추가: self.click("ZIP 만들기");
79추가: assert!(self.app.model.busy(), "{}", self.app.model.status());
80추가: }
81추가: }
82추가: #[test]
83추가: fn encrypted_zip_list_and_extract_with_actual_password_dialog() {
84추가: for name in [
85추가: "zipcrypto-store.zip",
86추가: "zipcrypto-deflate.zip",
87추가: "aes1-store.zip",
88추가: "aes1-deflate.zip",
89추가: "aes2-store.zip",
90추가: "aes2-deflate.zip",
91추가: ] {
92추가: let scratch = Scratch::new();
93추가: let archive = encrypted_fixture(&scratch, name);
94추가: let original = fs::read(&archive).unwrap();
95추가: let output = make_directory(&scratch.path("output"));
96추가: let (factory, observed) = observed_factory();
97추가: let mut screen = Screen::new(factory);
98추가: screen.open(&archive);
99추가: assert!(screen.app.model.entries.iter().all(|entry| entry.encrypted));
100추가: assert!(screen.app.model.challenge.is_none());
101추가: screen.start_password_extract(&output);
102추가: screen.password_request(1, false);
103추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
104추가: screen.password_answer(FIXTURE_PASSWORD);
105추가: screen.finish_password_job(Outcome::Completed);
106추가: assert_eq!(
107추가: fs::read(output.join("payload.bin")).unwrap(),
108추가: b"Zipelo encrypted interoperability\n".repeat(8)
109추가: );
110추가: assert_eq!(fs::read(archive).unwrap(), original);
111추가: assert_reaped(&observed);
112추가: }
113추가: }
114추가: #[test]
115추가: fn wrong_password_retry_clears_input_and_succeeds_without_partial_output() {
116추가: let scratch = Scratch::new();
117추가: let archive = encrypted_fixture(&scratch, "aes2-deflate.zip");
118추가: let output = make_directory(&scratch.path("output"));
119추가: let (factory, observed) = observed_factory();
120추가: let mut screen = Screen::new(factory);
121추가: screen.open(&archive);
122추가: screen.start_password_extract(&output);
123추가: let first = screen.password_request(1, false);
124추가: screen.password_answer("wrong-password");
125추가: let second = screen.password_request(2, false);
126추가: assert_ne!(first, second);
127추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
128추가: let labels = screen.render(vec![]);
129추가: assert!(
130추가: labels
131추가: .iter()
132추가: .any(|(value, _)| value == "암호가 맞지 않습니다. 다시 입력하세요")
133추가: );
134추가: screen.click("암호 전달");
135추가: assert_eq!(screen.app.model.challenge, Some((second, 2, false)));
136추가: assert!(
137추가: screen
138추가: .app
139추가: .model
140추가: .input_error
141추가: .as_ref()
142추가: .unwrap()
143추가: .contains("1~1024바이트")
144추가: );
145추가: screen.render(vec![]);
146추가: screen.password_answer(FIXTURE_PASSWORD);
147추가: screen.finish_password_job(Outcome::Completed);
148추가: assert_reaped(&observed);
149추가: }
150추가: #[test]
151추가: fn three_wrong_passwords_fail_without_writes_and_can_start_a_new_job() {
152추가: let scratch = Scratch::new();
153추가: let archive = encrypted_fixture(&scratch, "zipcrypto-deflate.zip");
154추가: let output = make_directory(&scratch.path("output"));
155추가: let (factory, observed) = observed_factory();
156추가: let mut screen = Screen::new(factory);
157추가: screen.open(&archive);
158추가: screen.start_password_extract(&output);
159추가: for attempt in 1..=3 {
160추가: screen.password_request(attempt, false);
161추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
162추가: screen.password_answer("wrong-password");
163추가: }
164추가: screen.finish_password_job(Outcome::Failed);
165추가: assert_eq!(
166추가: screen.app.model.terminal.as_ref().unwrap().error,
167추가: Some(ErrorCode::WrongPassword)
168추가: );
169추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
170추가: screen.open(&archive);
171추가: assert_reaped(&observed);
172추가: }
173추가: #[test]
174추가: fn cancel_password_extraction_waits_for_cleanup_without_writes() {
175추가: let scratch = Scratch::new();
176추가: let archive = encrypted_fixture(&scratch, "aes1-store.zip");
177추가: let output = make_directory(&scratch.path("output"));
178추가: fs::write(output.join("existing.txt"), b"preserve").unwrap();
179추가: let (factory, observed) = observed_factory();
180추가: let mut screen = Screen::new(factory);
181추가: screen.open(&archive);
182추가: screen.start_password_extract(&output);
183추가: screen.password_request(1, false);
184추가: screen.click("작업 취소");
185추가: screen.app.model.request_close();
186추가: screen.app.model.confirm_close();
187추가: assert!(matches!(
188추가: screen.app.model.close,
189추가: Close::Waiting | Close::Review
190추가: ));
191추가: screen.finish_password_job(Outcome::Cancelled);
192추가: assert_eq!(screen.app.model.close, Close::Review);
193추가: assert_eq!(fs::read(output.join("existing.txt")).unwrap(), b"preserve");
194추가: assert_eq!(fs::read_dir(output).unwrap().count(), 1);
195추가: assert_reaped(&observed);
196추가: }
197추가: #[test]
198추가: fn cold_start_creates_aes_zip_then_reopens_and_extracts_with_password() {
199추가: let scratch = Scratch::new();
200추가: let source = scratch.path("private.txt");
201추가: let payload = b"Public synthetic password flow payload\n";
202추가: fs::write(&source, payload).unwrap();
203추가: let archive = scratch.path("encrypted.zip");
204추가: let output = make_directory(&scratch.path("output"));
205추가: let (factory, observed) = observed_factory();
206추가: let mut screen = Screen::new(factory);
207추가: assert!(!screen.app.model.encryption);
208추가: screen.start_encrypted_zip(&source, &archive);
209추가: screen.password_request(1, true);
210추가: assert!(!archive.exists());
211추가: screen.password_answer(FIXTURE_PASSWORD);
212추가: screen.finish_password_job(Outcome::Completed);
213추가: let bytes = fs::read(&archive).unwrap();
214추가: assert_eq!(&bytes[..4], b"PK\x03\x04");
215추가: assert_eq!(u16::from_le_bytes(bytes[6..8].try_into().unwrap()) & 1, 1);
216추가: assert_eq!(u16::from_le_bytes(bytes[8..10].try_into().unwrap()), 99);
217추가: screen.open(&archive);
218추가: assert!(screen.app.model.entries.iter().all(|entry| entry.encrypted));
219추가: screen.start_password_extract(&output);
220추가: screen.password_request(1, false);
221추가: screen.password_answer(FIXTURE_PASSWORD);
222추가: screen.finish_password_job(Outcome::Completed);
223추가: assert_eq!(fs::read(output.join("private.txt")).unwrap(), payload);
224추가: assert_eq!(fs::read(source).unwrap(), payload);
225추가: assert_reaped(&observed);
226추가: }
227추가: #[test]
228추가: fn cancel_password_creation_does_not_create_an_archive() {
229추가: let scratch = Scratch::new();
230추가: let source = scratch.path("private.txt");
231추가: fs::write(&source, b"preserve").unwrap();
232추가: let archive = scratch.path("cancelled.zip");
233추가: let (factory, observed) = observed_factory();
234추가: let mut screen = Screen::new(factory);
235추가: screen.start_encrypted_zip(&source, &archive);
236추가: screen.password_request(1, true);
237추가: screen.click("작업 취소");
238추가: screen.finish_password_job(Outcome::Cancelled);
239추가: assert!(!archive.exists());
240추가: assert_eq!(fs::read(source).unwrap(), b"preserve");
241추가: assert_eq!(fs::read_dir(&scratch.0).unwrap().count(), 1);
242추가: assert_reaped(&observed);
243추가: }
244추가:
245추가: #[test]
246추가: fn oversized_utf8_password_stays_in_dialog_then_accepts_valid_input() {
247추가: let scratch = Scratch::new();
248추가: let archive = encrypted_fixture(&scratch, "aes2-store.zip");
249추가: let output = make_directory(&scratch.path("output"));
250추가: let (factory, observed) = observed_factory();
251추가: let mut screen = Screen::new(factory);
252추가: screen.open(&archive);
253추가: screen.start_password_extract(&output);
254추가: let id = screen.password_request(1, false);
255추가: screen.password_answer(&"가".repeat(342));
256추가: assert_eq!(screen.app.model.challenge, Some((id, 1, false)));
257추가: assert!(
258추가: screen
259추가: .app
260추가: .model
261추가: .input_error
262추가: .as_ref()
263추가: .unwrap()
264추가: .contains("1~1024바이트")
265추가: );
266추가: assert_eq!(fs::read_dir(&output).unwrap().count(), 0);
267추가: screen.password_answer(FIXTURE_PASSWORD);
268추가: screen.finish_password_job(Outcome::Completed);
269추가: assert_reaped(&observed);
270추가: }
271추가:
272추가: fn invalid_password_then_cancel(invalid: &str, close: bool) {
273추가: let scratch = Scratch::new();
274추가: let source = scratch.path("private.txt");
275추가: fs::write(&source, b"preserve").unwrap();
276추가: let archive = scratch.path("cancelled.zip");
277추가: let (factory, observed) = observed_factory();
278추가: let mut screen = Screen::new(factory);
279추가: screen.start_encrypted_zip(&source, &archive);
280추가: let challenge = screen.password_request(1, true);
281추가: screen.password_answer(invalid);
282추가: assert_eq!(screen.app.model.challenge, Some((challenge, 1, true)));
283추가: assert!(screen.app.model.status().contains("1~1024바이트"));
284추가: if close {
285추가: screen.app.model.request_close();
286추가: screen.app.model.confirm_close();
287추가: assert_eq!(screen.app.model.close, Close::Waiting);
288추가: assert!(!screen.app.model.confirmed);
289추가: } else {
290추가: screen.click("작업 취소");
291추가: }
292추가: screen.finish_password_job(Outcome::Cancelled);
293추가: assert_eq!(screen.app.model.status(), "작업 취소됨");
294추가: assert_eq!(
295추가: screen.app.model.terminal.as_ref().unwrap().publication,
296추가: Publication::None
297추가: );
298추가: assert_eq!(screen.app.model.terminal.as_ref().unwrap().created_count, 0);
299추가: assert_eq!(
300추가: screen
301추가: .app
302추가: .model
303추가: .terminal
304추가: .as_ref()
305추가: .unwrap()
306추가: .retained_partial_count,
307추가: 0
308추가: );
309추가: assert!(!archive.exists());
310추가: assert_eq!(fs::read(&source).unwrap(), b"preserve");
311추가: assert_eq!(fs::read_dir(&scratch.0).unwrap().count(), 1);
312추가: assert_reaped(&observed);
313추가: if close {
314추가: assert_eq!(screen.app.model.close, Close::Review);
315추가: screen.app.model.acknowledge_close();
316추가: assert_eq!(screen.app.model.close, Close::Allowed);
317추가: } else {
318추가: screen.open(&encrypted_fixture(&scratch, "aes2-store.zip"));
319추가: assert_reaped(&observed);
320추가: }
321추가: }
322추가: #[test]
323추가: fn empty_password_then_cancel_confirms_worker_exit() {
324추가: invalid_password_then_cancel("", false);
325추가: }
326추가: #[test]
327추가: fn oversized_password_then_cancel_confirms_worker_exit() {
328추가: invalid_password_then_cancel(&"가".repeat(342), false);
329추가: }
330추가: #[test]
331추가: fn invalid_password_then_close_confirms_worker_exit() {
332추가: invalid_password_then_cancel("", true);
333추가: }
수정tests/rust-app-ui/regressions.rs+39-0
@@ -807,3 +807,42 @@ fn error_cleanup_requires_child_wait_without_fabricating_terminal() {
807807 assert_eq!(model.error.as_deref(), Some("pipe error"));
808808 assert_eq!(model.close, Close::Review);
809809}
810추가:
811추가: #[test]
812추가: fn password_validation_and_retry_do_not_erase_transport_failure() {
813추가: let mut factory = FakeFactory::default();
814추가: let mut model = Model::default();
815추가: assert!(model.begin(
816추가: Start::List {
817추가: archive: path("locked.zip")
818추가: },
819추가: &mut factory
820추가: ));
821추가: for _ in 0..10 {
822추가: model.poll();
823추가: if model.challenge.is_some() {
824추가: break;
825추가: }
826추가: }
827추가: assert!(model.challenge.is_some());
828추가: factory
829추가: .state
830추가: .borrow_mut()
831추가: .queue
832추가: .push_back(HostEvent::Fault("pipe error".into()));
833추가: for _ in 0..10 {
834추가: model.poll();
835추가: if model.error.is_some() {
836추가: break;
837추가: }
838추가: }
839추가: assert_eq!(model.error.as_deref(), Some("pipe error"));
840추가: assert!(!model.password(String::new()));
841추가: assert!(model.input_error.as_ref().unwrap().contains("1~1024바이트"));
842추가: assert_eq!(model.error.as_deref(), Some("pipe error"));
843추가: assert!(model.password("synthetic password".into()));
844추가: pump(&mut model);
845추가: assert!(model.input_error.is_none());
846추가: assert_eq!(model.error.as_deref(), Some("pipe error"));
847추가: assert!(!model.confirmed);
848추가: }
수정tests/rust-app-ui/validation.json+33-25
@@ -1,23 +1,22 @@
11{
22 "command": "python3 tests/ci/run_rust.py local",
33 "platform": "linux-desktop-2",
4삭제: "base_remote_main": "4160fcc4e80070b6ab9ea50c78705c0458b2384a",
5삭제: "local_baseline_head": "b8811fa1bcb169c1ec8e5b14dbe6a46c510da0d1",
6삭제: "source_state": "최신 PR69와 기존 SevenZip 앱 변환 및 암호 의존성 lockfile을 통합한 커밋에서 전체 검증함. 검증 후 이 증거 JSON만 갱신함.",
4추가: "base_remote_main": "e497fac4309018a2824b2f296a366a648f4429bf",
5추가: "local_baseline_head": "a1f6e48dfbff07d853a590a610d8673e72075661",
6추가: "source_state": "승인된 암호창과 main의 7z 구현을 동작 변경 없이 병합한 커밋에서 전체 검증함. 검증 후 이 증거 JSON만 갱신함.",
77 "linux_build_crates": 19,
88 "linux_test_targets": 19,
9삭제: "rust_tests_passed": 895,
10삭제: "new_archive_ui_tests_passed": 22,
9추가: "rust_tests_passed": 906,
10추가: "new_archive_ui_tests_passed": 23,
1111 "windows_cross_build_crates": 19,
1212 "windows_runtime_tested": false,
1313 "native_visual_check": "Headless egui Context used actual widget pointer/key events and the real OS worker process on Linux. Native OS window/input automation and Windows execution were not performed.",
14삭제: "prior_failures": "최초 실행은 공유 캐시의 기존 7z 미지원 작업자로 화면 시험 1개가 실패함. 추출 소스의 타임스탬프를 갱신하여 다시 빌드한 뒤 LZMA/LZMA2 화면 시험과 전체 실행이 통과함.",
14추가: "prior_failures": "Retained locally: first build drop API/legacy harness references; second and third egui renderer harness texture/first-frame setup; final runner passed.",
1515 "limitations": [
16삭제: "Normal ZIP/TAR.GZ/7z listing and extraction plus ZIP creation/reopen/extraction use the actual worker executable and OS pipes.",
17삭제: "Four successful screen tests run headless egui widgets, including LZMA/LZMA2 7z fixtures, not native OS GUI automation.",
18삭제: "Malformed, wrong-action, early-exit and disposal fault cases use a separate test-only probe; serialization failure and late cancellation use the actual worker.",
19삭제: "No Windows runtime, encryption ZIP, large-file performance, OS sandbox or exhaustive malicious-input validation in this frontend integration.",
20삭제: "Manual path text is UTF-8; native archive CLI/drop paths retain PathBuf and NativePath."
16추가: "Headless egui widgets with actual Linux child processes and OS pipes; no native OS window/input automation or Windows runtime.",
17추가: "Passwords are public synthetic fixture data. The tests verify masking and lifecycle cleanup, not an exhaustive process-memory audit.",
18추가: "No backend cryptography, wire contract, installer or 7z changes in this branch.",
19추가: "The UI and probe lockfiles include the existing PR67 crypto dependencies. Existing package versions remain unchanged."
2120 ],
2221 "tested_files": [
2322 {
@@ -34,11 +33,11 @@
3433 },
3534 {
3635 "path": "experiments/rust-ui-memory-app/src/archive_screen.rs",
37삭제: "sha256": "04b7a55c7405d89467fc821db27e0714fb0aa00612e614835b5fee901e5ca940"
36추가: "sha256": "3f8858d5fb18f329b6e3a1753a45e909f1caf973f1019402e93d97077b1d96fd"
3837 },
3938 {
4039 "path": "experiments/rust-ui-memory-app/src/archive_ui.rs",
41삭제: "sha256": "f26557645cea07350843c7e88225e07bb4316ab673dc2581b036567f01d66d6e"
40추가: "sha256": "438beb387c57c6b0da206066f76a1d7349dae95eb9f33be006338af7cf1ac2ef"
4241 },
4342 {
4443 "path": "experiments/rust-ui-memory-app/src/desktop.rs",
@@ -62,7 +61,7 @@
6261 },
6362 {
6463 "path": "tests/rust-app-real-worker/README.md",
65삭제: "sha256": "7253cd2a765dc594e3a27970fd3811eb50645d1179c2728b57eee2d440b3e367"
64추가: "sha256": "9924a1dbb6b687c3c08ec9785835ae73628867bbfa5deec8db0f8504f8de859a"
6665 },
6766 {
6867 "path": "tests/rust-app-real-worker/fixtures/sample.tar.gz",
@@ -74,7 +73,7 @@
7473 },
7574 {
7675 "path": "tests/rust-app-real-worker/flows.rs",
77삭제: "sha256": "23501dfcfcefa5404d1587d5295915a227a18ba53ccbdf56eaa35b101011d115"
76추가: "sha256": "bda6f27f50b8a332444de63463f3194b3ee75a2a897a495cc384d55e40f7279f"
7877 },
7978 {
8079 "path": "tests/rust-app-real-worker/generate.py",
@@ -98,7 +97,11 @@
9897 },
9998 {
10099 "path": "tests/rust-app-ui/regressions.rs",
101삭제: "sha256": "a4c3685a380cb73fd506a290270b2a5308529ef4f843c203127c2bc9a2df2a80"
100추가: "sha256": "9ddea054018426523bbbd8d913141244455aef32a40553ef5f76a42e3d0854c6"
101추가: },
102추가: {
103추가: "path": "tests/rust-app-real-worker/password_flows.rs",
104추가: "sha256": "2617f66bc85a889aab1d2c98466b67e949628f830d47a578db2635474ccb7898"
102105 },
103106 {
104107 "path": "tests/rust-app-real-worker/formats.rs",
@@ -113,17 +116,22 @@
113116 "오류 후 명시적 정리는 child wait 전에 닫기를 허용하지 않음",
114117 "정상 정리 신호는 EOF를 대신하지 않음",
115118 "정상 종료 뒤 채널 닫힘과 늦은 취소가 최종 결과를 오류로 바꾸지 않음",
116삭제: "child 회수 전 늦은 취소의 실제 작업자 경합 100회와 Terminal 없는 종료의 실패 유지"
119추가: "child 회수 전 늦은 취소의 실제 작업자 경합 100회와 Terminal 없는 종료의 실패 유지",
120추가: "빈 암호 입력 뒤 취소와 정상 종료 확인",
121추가: "UTF-8 1024바이트 초과 입력 뒤 취소와 출력 없음",
122추가: "입력 오류 뒤 창 닫기 시 child 회수 후 종료 허용",
123추가: "입력 오류와 암호 재입력이 기존 통신 오류를 지우지 않음"
117124 ],
118삭제: "before_review_fix": "Earlier PR62 fixes reproduced 3 failures before repair. Integration tests additionally reproduced normal channel shutdown and late-cancel races before repair. PR68 review race reproduced with the new test before repair; all 100 iterations passed after repair.",
125추가: "before_review_fix": "Earlier PR62 fixes reproduced 3 failures before repair. Integration tests additionally reproduced normal channel shutdown and late-cancel races before repair. PR68 review race reproduced with the new test before repair; all 100 iterations passed after repair. PR72 수정 전 동일 화면 회귀 시험의 빈 암호 뒤 취소, 초과 길이 뒤 취소, 오류 뒤 창 닫기 3개가 confirmed assertion에서 실패했고 수정 뒤 통과함.",
119126 "approved_ui_head": "423a7c80c9d7182e07d29adee03a97d09a19b11f",
120삭제: "tested_local_head": "496415fbd6fa6bc359f85775a88ed56cd71fa2e5",
121삭제: "real_worker_tests_passed": 11,
127추가: "tested_local_head": "dfb1e3848fae714d3716f14000f3a4ae434f98d3",
128추가: "real_worker_tests_passed": 21,
122129 "runner_tests_passed": 23,
130추가: "password_screen_tests_passed": 10,
131추가: "password_flow": "Actual widget input and real worker validated ZipCrypto, AES-256 AE-1/AE-2 Store/Deflate extraction, retry, three failures, cancel, UTF-8 byte limits and cold-start AES ZIP creation/reopen/extraction.",
123132 "format_contract_tests_passed": 2,
124삭제: "prerequisite_heads": {
125삭제: "PR69": "8614f8431a6d7f1967822c233a812d383e574000"
126삭제: },
127삭제: "format_extension": "Existing tags 0..3 unchanged; SevenZip=4. Full ListEnd golden frame, both platform identities and Extract codec roundtrip verified.",
128삭제: "lockfile_update": "PR71 159d51a의 앱 및 probe 암호 의존성 고정과 동일함. 기존 패키지 버전을 변경하지 않음."
133추가: "merge_heads": {
134추가: "password_pr72": "ff86e6ddb7100781c4d3dc0dd388d10e86d2025c",
135추가: "main": "e497fac4309018a2824b2f296a366a648f4429bf"
136추가: }
129137}