대용량 작업의 앱 연동 상태를 문서에 반영한다
- 작성자
- 시로사키 하나
- 작성 시각
- 커밋
9224585b5bd1d3542b0a596c9779d85fd0ac894a- 부모
- 822ad1e
변경된 파일 2개
+11-8| @@ -103,19 +103,21 @@ Python 표준 bz2, lzma와 tarfile로 독립 생성 및 해제한 결과의 SHA2 | ||
| 103 | 103 | |
| 104 | 104 | ## 큰 작업의 명시적 승인 계약 |
| 105 | 105 | |
| 106 | 삭제: `StartGuarded`는 기존 요청과 분리된 선택적 확장입니다. 작업자 구현만 포함하며 앱에서 새 요청과 승인 화면을 사용하는 연동, `--ui-scenario` 및 가이드 갱신은 frontend 범위입니다. 기존 앱의 요청에는 새 질문을 보내지 않습니다. 구버전 작업자가 새 요청을 거부하면 자동 재시도하지 않습니다. | |
| 106 | 추가: `StartGuarded`는 기존 요청과 분리된 선택적 확장입니다. 작업자와 앱의 요청 및 승인 화면 연동이 구현됐으며 `--ui-scenario` 상황, 시험과 [가이드](../../docs/ui-scenario-guide.md)도 반영됐습니다. 기존 `Start`와 `StartInteractive` 요청에는 자원 질문을 보내지 않습니다. 구버전 작업자가 새 요청을 거부하면 자동 재시도하지 않습니다. | |
| 107 | 107 | |
| 108 | 108 | - kind 6의 본문은 `GuardedStart { start: Start, ceiling: Limits, interactive: bool }` 순서입니다. start.limits는 기존 16 GiB 및 10,000개 이하이고 ceiling은 이를 늘리되 64 GiB 및 200,000개 이하입니다. 입력 한도는 동일해야 합니다. interactive는 Extract에서만 허용하며 기존 암호와 충돌 처리를 함께 사용합니다. |
| 109 | 삭제: - 작업자는 Accepted 뒤, 입력 캡처와 소스 탐색 전에 요청된 상한 확대 범위를 확인합니다. 입력 사본 작성부터 300초를 넘을 수 있으므로 승인을 먼저 받습니다. 이때 예상량과 실제량은 아직 미확인(None)이고 임시 저장 볼륨의 여유 공간을 알립니다. 허용 전에는 확대 한도가 적용되지 않으며 거부하면 Cancelled로 끝납니다. 작은 기존 작업은 Start를 계속 사용할 수 있습니다. | |
| 109 | 추가: - 작업자는 Accepted 뒤, 입력 캡처와 소스 탐색 전에 요청된 상한 확대 범위를 확인합니다. 입력 사본 작성부터 300초를 넘을 수 있으므로 승인을 먼저 받습니다. 이때 예상량과 실제량은 아직 미확인(None)이고 임시 저장 볼륨의 여유 공간을 알립니다. 허용 전에는 확대 한도가 적용되지 않으며 거부하면 Cancelled로 끝납니다. 앱의 일반 작업은 기존 16 GiB 및 10,000개 한도의 `StartGuarded`를 사용해 압축률을 감시합니다. 기존 `Start` 호출도 유지합니다. | |
| 110 | 110 | - kind 110의 `ResourceRequired`는 challenge_id, action, scope, usage, soft_limits, ceiling 순서입니다. `ResourceScope`는 output, entries, ratio의 bool 세 개입니다. `ResourceUsage`는 estimated_bytes, actual_bytes, estimated_entries, actual_entries, compressed_bytes, ratio_output_bytes, available_bytes 순서이며 모두 Option입니다. 바이트는 u64, 항목 수는 u32입니다. 미확인은 0으로 바꾸지 않습니다. 여유 공간은 관찰 중인 저장 볼륨의 값이며 공간 예약이나 모든 볼륨의 합계가 아닙니다. |
| 111 | 111 | - kind 7의 `ResourceReply`는 challenge_id u64, scope, allow bool입니다. 프레임의 작업 ID, 현재 질문 ID와 요청한 scope가 모두 일치하는 응답 한 개만 허용합니다. 중복, 오래된 응답과 다른 종류의 질문 응답은 Protocol입니다. 승인은 해당 작업의 해당 범위에만 적용하며 재사용하지 않습니다. |
| 112 | 삭제: - 해제량이 256 MiB 이상이고 압축률이 1,000배를 초과하면 ratio 범위를 별도로 묻습니다. ZIP은 항목별, 7z는 solid 폴더와 전체, 압축 TAR와 GZip은 스트림 전체의 크기로 검사합니다. 예상량과 실제량을 구분하고 u128 곱셈으로 비교합니다. 승인 중에는 추가 해제와 쓰기를 멈추며 취소는 별도 제어 읽기에서 처리합니다. | |
| 112 | 추가: - 해제량이 256 MiB 이상이고 압축률이 1,000배를 초과하면 ratio 범위를 별도로 묻습니다. ZIP은 항목별 크기와 전체 payload 합계, 7z는 solid 폴더와 전체, 압축 TAR와 GZip은 스트림 전체의 크기로 검사합니다. 예상량과 실제량을 구분하고 u128 곱셈으로 비교합니다. 승인 중에는 추가 해제와 쓰기를 멈추며 취소는 별도 제어 읽기에서 처리합니다. | |
| 113 | 113 | - 승인 후에도 64 GiB와 200,000개 정책 상한, 메타데이터와 사전 예산, 경로 및 무결성, 임시 저장소와 목적지 공간 검사를 적용합니다. ZIP 생성은 원본 논리 크기 합계를 제한하며 ZIP 구조와 암호화로 늘어나는 저장 공간을 별도로 계산합니다. 이미 게시한 출력은 실패나 취소 시 유지하고 게시 및 정리 상태를 보고합니다. |
| 114 | 삭제: - 승인된 작업은 전체 300초 대신 진행이 60초 동안 없을 때 Limit로 중단합니다. 실제 읽기, 해독, 쓰기와 메타데이터 수집만 진행으로 계산하며 반복 check 호출은 기한을 늘리지 않습니다. 암호, 충돌과 자원 질문은 한 번에 하나이며 각 응답 대기는 300초입니다. 유효한 응답 뒤에는 사용자 대기 시간을 제외하고 정체 감시를 재개합니다. 기존 요청의 전체 300초 제한은 유지합니다. OS의 블로킹 I/O를 강제로 중단하는 보장은 아닙니다. | |
| 114 | 추가: - 승인된 작업은 전체 300초 대신 진행이 60초 동안 없을 때 Limit로 중단합니다. 실제 읽기, 해독, 쓰기와 메타데이터 수집 및 빈 파일과 디렉터리의 성공 게시를 진행으로 계산하며 반복 check 호출은 기한을 늘리지 않습니다. 암호, 충돌과 자원 질문은 한 번에 하나이며 각 응답 대기는 300초입니다. 유효한 응답 뒤에는 사용자 대기 시간을 제외하고 정체 감시를 재개합니다. 기존 요청의 전체 300초 제한은 유지합니다. OS의 블로킹 I/O를 강제로 중단하는 보장은 아닙니다. | |
| 115 | 115 | |
| 116 | 116 | 메타데이터 정책은 유효한 자원 승인 여부로 선택하며 요청의 ceiling만 늘려서는 확대되지 않습니다. 원본 계획의 경로와 대기 이름은 확대 작업에서 같은 항목의 복사 비용으로 계산하고 노드를 중복 가산하지 않습니다. 이름 및 원본 경로의 바이트 비용과 암묵적 상위 폴더 노드는 계속 계산하므로 긴 경로나 많은 상위 폴더가 있으면 항목 200,000개 이전에도 Limit로 중단될 수 있습니다. 승인 전과 기존 slice API의 메타데이터 한도 및 계산 방식은 유지합니다. 기존 대용량 회귀의 64 MiB RSS 목표는 기본 메타데이터 정책의 측정값이며 확대 작업 전체의 메모리 상한을 뜻하지 않습니다. |
| 117 | 117 | |
| 118 | 삭제: 작업자는 짧은 이름의 빈 ZIP 항목 200,000개 목록을 승인 후 처리하는 시험을 통과해야 합니다. 앱 활성화와 UI 상황, 시험, 가이드는 frontend 연동 범위이며 완료 전까지 초안을 유지합니다. | |
| 118 | 추가: 앱은 목록이나 선택한 일반 파일의 크기로 한도 초과를 알 수 있으면 처리 전에 확대 승인을 요청합니다. 미확인 폴더 내부와 압축파일은 기본 한도로 시작합니다. 한도 오류 뒤 Terminal, 양쪽 EOF와 자식 회수가 확인되고 게시 없음, 생성 및 부분 잔존 0개, 정리 완료일 때만 "한도를 늘려 다시 시도"를 제공합니다. 선택하면 새 작업 ID로 시작해 다시 승인을 받습니다. 이미 출력이 있거나 결과가 불확실하면 확대 재시도 대신 저장 위치와 상세 결과를 안내합니다. 항목 확대를 승인한 작업에서만 앱 목록과 출력 기록 상한이 200,000개로 늘어납니다. | |
| 119 | 추가: | |
| 120 | 추가: 작업자의 짧은 이름 빈 ZIP 항목 200,000개 목록 시험과 앱 승인 및 재시도 시험을 반영했습니다. `resource-approval`, `resource-ratio`, `resource-retry`, `resource-partial` 상황과 가이드도 추가됐습니다. Windows와 Wayland의 실제 화면 및 입력 검증은 별도로 남아 있습니다. | |
| 119 | 121 | |
| 120 | 122 | 시험은 실제 64 GiB를 쓰지 않고 수치 경계와 축소한 limits/ceiling을 사용합니다. `resource_budget.rs`는 16 GiB 아래/경계/초과, 64 GiB 초과, 10,000개 및 200,000개 경계, 압축률 경계와 가상 시계의 60초 정체를 검사합니다. `metadata_policy.rs`는 축소한 바이트와 노드 예산, 원본 계획과 암묵적 폴더 계산을 확인합니다. `guarded.rs`는 승인 전 메타데이터 거부, 승인 뒤 200,000개 목록, 실제 작업자 승인/거부, 오래된 응답, 암호/충돌 순서, 승인 뒤 공간 실패, 여러 형식과 작은 고압축 입력의 경고 및 취소를 검사합니다. |
| 121 | 123 |
| @@ -227,7 +227,7 @@ | ||
| 227 | 227 | "disk_space": "Required input capture and complete integrity staging checks remain before conflict questions. Defer destination space checks until the current choice is resolved. Skip has no destination byte charge; overwrite, rename and non-conflicting files are checked immediately before their publication. Preserve legacy Start aggregate preflight, limits, per-write checks and partial-output reporting." |
| 228 | 228 | }, |
| 229 | 229 | "guarded_resources": { |
| 230 | 삭제: "status": "worker-implemented; wire handoff confirmed, frontend activation pending", | |
| 230 | 추가: "status": "worker-and-client-implemented; native Windows/Wayland verification pending", | |
| 231 | 231 | "agreement": "Frontend flow agreement 6fe5a494-7d5a-4bda-a7d3-831fb43e9238 and manager policy b3a743d2-10de-495c-8fdb-ecf2a5f3b453. Frame version 1, revision 3 messages and enum tags remain unchanged; this is an explicit opt-in extension.", |
| 232 | 232 | "admission": "After Accepted, request the output and/or entries scopes that ceiling increases above Start limits before capturing input or planning sources. Usage estimates and actuals are unknown at this point; report current staging-volume free space. The caller must show the requested ceilings and unknown values, not invent estimates. An earlier confirmation is needed because input capture itself can exceed 300 seconds. Each granted scope is confined to this job.", |
| 233 | 233 | "ratio": "Request ratio scope separately when expanded bytes are at least 256 MiB and strictly exceed compressed bytes times 1000. Check ZIP members and aggregate payload totals, 7z solid folders and totals, and complete compressed TAR/GZip streams. Use u128 arithmetic; unknown compressed length does not become zero. No ratio warning for legacy requests.", |
| @@ -236,7 +236,8 @@ | ||
| 236 | 236 | "waiting": "One resource, password or conflict challenge at a time. Pause processing while waiting; control reader remains live for Cancel. Response EOF fails Protocol. Guarded challenge wait is limited to 300 seconds per question; reset the inactivity clock after a valid reply, excluding the human wait.", |
| 237 | 237 | "time": "Legacy and unapproved jobs retain their whole-job 300-second deadline. After the first resource grant, use a 60-second inactivity deadline measured only from actual read/decode/write/metadata progress, not repeated cancellation checks or outgoing heartbeats. Cooperative checkpoints cannot forcibly interrupt a blocked OS call.", |
| 238 | 238 | "hard_ceiling": "Output/source bytes <=64 GiB and entries<=200000, including after approval. Caller may lower both ceilings for normal operation or scaled tests. Input quota cannot be expanded. Existing path, metadata, dictionary, frame and source-identity limits remain independent.", |
| 239 | 삭제: "metadata": "Only after a valid ResourceReply(allow=true) for this job, select 64 MiB MetadataBudget and 262144 nodes, including ZIP/TAR/7z parsing, decoded 7z headers, XZ index/block bounds, member/path validation, implicit output parents and source planning. Legacy Start/StartInteractive, unapproved guarded jobs and slice APIs keep 8 MiB and 32768 nodes. Merely requesting expanded ceilings does not grant a larger budget. Names and source paths still consume checked byte budgets and implicit parents consume nodes, so long/deep paths can hit the metadata cap before 200000 entries. Approved source-path/pending-name copies consume bytes without duplicating their entry node. Expanded metadata jobs do not retain a universal 64 MiB RSS target. Frontend activation remains pending.", | |
| 240 | 삭제: "tests": "Use numeric 16/64 GiB and 10000/200000 policy boundaries, scaled worker limits, a compressed 257 MiB zero stream, and a virtual clock for the 60-second stall. Do not write 64 GiB in tests." | |
| 239 | 추가: "metadata": "Only after a valid ResourceReply(allow=true) for this job, select 64 MiB MetadataBudget and 262144 nodes, including ZIP/TAR/7z parsing, decoded 7z headers, XZ index/block bounds, member/path validation, implicit output parents and source planning. Legacy Start/StartInteractive, unapproved guarded jobs and slice APIs keep 8 MiB and 32768 nodes. Merely requesting expanded ceilings does not grant a larger budget. Names and source paths still consume checked byte budgets and implicit parents consume nodes, so long/deep paths can hit the metadata cap before 200000 entries. Approved source-path/pending-name copies consume bytes without duplicating their entry node. Expanded metadata jobs do not retain a universal 64 MiB RSS target.", | |
| 240 | 추가: "client": "Normal app jobs use StartGuarded with the existing 16 GiB and 10000-entry limits. Known selection/file estimates request expanded ceilings before processing. After a Limit result, offer an explicit expanded retry only after Terminal, both EOFs and child reap, with Publication::None, zero created/partial counts and complete cleanup. Retry uses a new job ID and requires fresh approval; existing or uncertain output instead shows the saved location and detailed result. App catalog/output records grow to 200000 only for jobs granted the entries scope. Resource approval, ratio, retry and partial-output UI scenarios, tests and docs/ui-scenario-guide.md are implemented. Native Windows/Wayland verification remains separate.", | |
| 241 | 추가: "tests": "Use numeric 16/64 GiB and 10000/200000 policy boundaries, scaled worker limits, a compressed 257 MiB zero stream, and a virtual clock for the 60-second stall. Include client approval/retry tests in tests/rust-app-ui/guarded.rs and real-worker flows in tests/rust-app-real-worker/guarded_flows.rs. Do not write 64 GiB in tests." | |
| 241 | 242 | } |
| 242 | 243 | } |