Skip to content

fix(sandbox): 샌드박스 부팅 체인 무음 실패 대응 포팅 (#304) - #306

Merged
rkttu merged 1 commit into
v1.21.xfrom
port/issue-304-citool-fix
Jul 27, 2026
Merged

fix(sandbox): 샌드박스 부팅 체인 무음 실패 대응 포팅 (#304)#306
rkttu merged 1 commit into
v1.21.xfrom
port/issue-304-citool-fix

Conversation

@rkttu

@rkttu rkttu commented Jul 27, 2026

Copy link
Copy Markdown
Member

#305(main / 1.20.9)에 반영한 수정을 미리 보기 레인으로 옮깁니다.

v1.21.0-preview.1 사용자도 동일한 무음 실패에 노출되어 있습니다. 조기 검증을 부탁드린 분들이 아무 단서 없이 막히는 상황은 피해야 해서 함께 포팅합니다.

담긴 내용

  • citool.exe --refresh<nul 로 호출 — 이 명령이 작업 후 표준 입력을 기다리는 환경이 있고(이슈 [버그] Windows sandbox 실행되고 아무런 메시지 없이 Spork 설치 진행이 안됨 #304 제보 환경에서 확인·수정 후 해소 검증됨), batch 에서 블로킹될 수 있는 유일한 줄이라 여기서 멈추면 바로 다음 줄의 Spork 실행에 영원히 도달하지 못합니다
  • 부팅 브레드크럼을 Data 마운트(영속)에 기록 — Spork 가 뜨기 전에 실패하면 지금까지 아무 흔적도 남지 않았습니다
  • Spork 비정상 종료 시 콘솔 안내 + pause
  • LogonCommand 를 C:\Windows\System32\cmd.exe /c 경유로 변경
  • 앱 내 도움말 FAQ 자가 진단 안내
  • 회귀 테스트 6종 (생성 스크립트 순수 ASCII 고정 포함)

충돌 없음

v1.21.x 고유의 AOT 변경(IL3000 억제, SporkJsonContext)과 수정 영역이 겹치지 않아 양쪽이 그대로 보존됩니다. 패치는 --3way 로 깨끗하게 적용됐고, 포팅 후 SandboxBuilder.cs 의 main 대비 차이는 위 AOT 변경 2건뿐입니다.

Refs #304

🤖 Generated with Claude Code

main(1.20.9)에 반영한 수정을 미리 보기 레인에도 옮긴다. v1.21.0-preview.1 사용자도
동일한 무음 실패에 노출되어 있고, 조기 검증을 부탁한 사용자가 아무 단서 없이 막히는
상황은 피해야 한다.

- citool.exe --refresh 를 <nul 로 호출. 이 명령이 작업 후 표준 입력을 기다리는 환경이
  있으며(제보 환경에서 확인), batch 에서 블로킹될 수 있는 유일한 줄이라 그 자리에서
  멈추면 바로 다음 줄의 Spork 실행에 영원히 도달하지 못한다.
- 부팅 브레드크럼을 Data 마운트(영속)에 기록. Spork 가 뜨기 전에 실패하면 지금까지
  아무 흔적도 남지 않았다.
- Spork 가 비정상 종료 코드로 끝나면 콘솔에 안내 후 pause.
- LogonCommand 를 C:\Windows\System32\cmd.exe /c 경유로 변경. .cmd 는 PE 이미지가
  아니라 실행에 셸/파일 연결이 개입하는데, 그 경로가 깨지면 조용히 실행되지 않는다.
- 앱 내 도움말 FAQ 에 자가 진단 안내 추가.
- 회귀 테스트 6종(생성 스크립트 순수 ASCII 고정 포함).

v1.21.x 고유의 AOT 변경(IL3000 억제, SporkJsonContext)과는 영역이 겹치지 않아
양쪽이 그대로 보존된다.

Refs #304

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 27, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports the sandbox boot-chain “silent failure” mitigations (Issue #304) into the preview lane so v1.21.0-preview.1 users get actionable diagnostics when Windows Sandbox opens but Spork does not start.

Changes:

  • Prevent potential citool.exe --refresh stdin wait from blocking the batch chain by redirecting stdin from nul.
  • Add persistent boot breadcrumbs (tablecloth-boot.log) and show a console notice + pause on abnormal Spork exit.
  • Update LogonCommand to invoke the startup script via absolute C:\Windows\System32\cmd.exe /c, plus add FAQ guidance and regression tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/TableCloth.App/Components/Implementations/SandboxBuilder.cs Adjusts Windows Sandbox LogonCommand invocation and hardens StartupScript.cmd generation with breadcrumbs + citool stdin redirection.
src/TableCloth.Test/SandboxStartupScriptTests.cs Adds regression tests to lock in script ASCII-only constraint, citool stdin redirection, breadcrumb logging, and command ordering.
src/TableCloth/Help/manual.ko.html Adds a Korean FAQ entry guiding users to self-diagnose and attach tablecloth-boot.log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +142 to +145
Assert.IsTrue(sacIndex >= 0 && citoolIndex >= 0 && sporkIndex >= 0,
"SAC 정책 / citool / spork 실행 중 하나가 스크립트에 없습니다.");
Assert.IsLessThan(citoolIndex, sacIndex, "SAC 레지스트리 설정이 citool refresh 보다 뒤에 있습니다.");
Assert.IsLessThan(sporkIndex, citoolIndex, "citool refresh 가 Spork 실행보다 뒤에 있습니다.");
Comment on lines +490 to +492
// 본 batch 는 UTF-8(Encoding.Default)로 기록되는데 cmd 는 이를 OEM 코드페이지로 읽는다.
// 따라서 **반드시 ASCII 만** 사용한다. 한글을 넣으면 바이트 정렬이 깨져 스크립트가 통째로
// 무동작이 될 수 있다(이슈 #304 진단 중 실측).
Comment on lines +33 to +37
/// <summary>
/// 스크립트는 UTF-8(Encoding.Default)로 기록되지만 cmd 는 이를 OEM 코드페이지로 읽는다.
/// 비 ASCII 문자가 섞이면 바이트 정렬이 깨져 스크립트가 통째로 무동작이 될 수 있다
/// (이슈 #304 진단 중 진단 하니스에서 실측한 현상).
/// </summary>
@rkttu
rkttu merged commit 85ce241 into v1.21.x Jul 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants