Skip to content

Complete web file editing and harden checkout file boundaries - #140

Merged
yansfil merged 32 commits into
mainfrom
prd/web-shell-pivot-s3-completion
Sep 24, 2026
Merged

yansfil merged 32 commits into
mainfrom
prd/web-shell-pivot-s3-completion

Conversation

@yansfil

@yansfil yansfil commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139, agents/prd/web-shell-pivot-s3/prd.md

Summary

  • S3 후속으로 오른쪽 Explorer, 600ms 자동저장, 탭별 draft 복구와 Markdown frontmatter 표시를 완성합니다.
  • 일반 웹의 큰 파일은 기본 앱 실행 대신 다운로드하며, 256 MiB 초과는 저장 선택창으로 스트리밍합니다.
  • 등록 checkout의 열린 디렉터리 핸들로 실제 파일 I/O를 제한하고, 폴더 교체 감시와 파일 인덱스 자원을 보강합니다.
  • 파일 조작·다운로드·복구 회귀 테스트를 추가하고 기존 6함수 C ABI와 native 전환 경로를 유지합니다.

Review

  • 판단해 주세요: 현재 배포 대상인 macOS 기준입니다. Windows의 경쟁 상황에서 덮어쓰기 방지 보장은 미완료입니다.
  • 판단해 주세요: Trash는 checkout 밖의 비공개 임시 위치로 먼저 이동합니다. 다른 볼륨이면 원본을 남기고 실패합니다.
  • 판단해 주세요: 보호 범위는 checkout 경로 교체입니다. 호스트 전체에 접근하는 동일 사용자 프로세스의 침해를 막는 sandbox는 아닙니다.
  • 조심해서 볼 파일: herdr-core/src/files.rs, hided/src/boundary.rs - 실제 I/O 경계, Trash 실패 복구와 보존.
  • 조심해서 볼 파일: hided/src/watch.rs, hided/src/index.rs - 교체된 폴더 재연결, 핸들·ignore 파일 읽기 상한.
  • 조심해서 볼 파일: web/src/buffers.ts, hided/src/server.rs - 저장 상태 identity, 스트리밍 취소·backpressure.

Evidence

  • 확인한 것: 최신 수정 diff를 검토해 경로 재열기, 폴더 교체, Trash 복구 및 인덱스 핸들 누적의 수정 위치를 확인했습니다.
  • 확인한 것: 8e8bf8e는 CI에서 발견된 감시 시간 타입 오류를 수정했습니다. rustfmt와 diff whitespace 검사를 마쳤습니다.
  • 이전 결과: 813d92a에서 web unit 136개, E2E 30개와 Rust/Swift 검증이 통과했습니다. 최신 HEAD의 증거는 아닙니다.
  • 확인한 것: 8e8bf8e의 필수 PR CI가 모두 성공했습니다. Rust·Swift·웹·저장소 규칙·디자인 및 최종 verify를 확인했습니다.
  • 첫 CI의 감시 시간 타입 컴파일 오류를 수정한 뒤 verify 재실행이 성공했습니다.
  • 확인하지 못한 것: 최신 HEAD의 native/browser 수동 QA·성능 재측정·Windows 실행·사용자의 실사용 전환은 미확인입니다.
  • 확인하지 못한 것: 이번 PR에 공개 가능한 스크린샷은 첨부하지 않았습니다. 로컬 검증 산출물은 저장소에 넣지 않았습니다.
  • 사용자 승인에 따라 추가 로컬 verify 및 반복 리뷰는 생략하며, 필수 CI와 branch protection은 유지합니다.

Breaking change

  • 웹에서 큰 파일을 열 때 호스트 기본 앱을 실행하지 않습니다. 다운로드를 사용하며 256 MiB 초과에는 저장 선택창 지원 브라우저가 필요합니다.

AI tooling: 대부분 AI 도구. 변경 코드를 직접 대조했으며, 사용자의 새 실사용 검증을 대행했다고 주장하지 않습니다.

@yansfil
yansfil merged commit 7511846 into main Sep 24, 2026
6 checks passed
@yansfil
yansfil deleted the prd/web-shell-pivot-s3-completion branch September 24, 2026 01:23
yansfil added a commit that referenced this pull request Sep 24, 2026
Related: `agents/prd/web-shell-pivot-s4/prd.md`; S3 #140

## Summary

- Add the web shell's right-side History list for uncommitted and branch
changes.
- Open changes as readonly unified diffs in existing preview tabs and
editor space.
- Scope History to registered folders, including valid subfolders and
cross-boundary renames.
- Bind Git status and diffs to the opened checkout directory and cap
selected diff output.

![Working change in the registered
folder](https://github.com/yansfil/pr-assets/blob/main/hide/web-shell-pivot-s4/5b91b5e/final-working-chromux.png?raw=true)

![Committed branch change in the registered
folder](https://github.com/yansfil/pr-assets/blob/main/hide/web-shell-pivot-s4/5b91b5e/final-committed-chromux.png?raw=true)

## Review

- **판단해 주세요**: Check History labels and diff readability at narrow
desktop widths.
- **조심해서 볼 파일**: `herdr-core/src/changes.rs`, `herdr-core/src/files.rs`
- Git scope and opened-handle identity.
- **조심해서 볼 파일**: `herdr-core/src/runtime/events.rs` - checkout focus and
History selection in one frame.
- **조심해서 볼 파일**: `web/src/HistoryList.tsx`,
`web/src/editor/PatchView.tsx` - readonly list and patch display.

## Evidence

- **확인한 것**: At `56faaf5`, focused History tests passed 16/16; runtime
focus test, Rust lint, daemon build and S4 web E2E 2/2 passed.
- **확인한 것**: Herdr Browser at `bef04b3` showed nested working and branch
diffs; outside sibling changes were absent.
- **확인한 것**: PR CI at `56faaf5` passed all six required checks,
including Rust, Swift and web.
- **확인하지 못한 것**: Local sealed verification remains STALE/FAIL; no local
PASS exists for `56faaf5`. Prior Rust suites failed unchanged timing/PID
tests; each passed alone and in CI.
- **승인된 예외**: The user explicitly approved merging S4 with this missing
local PASS after all required CI passed at the exact head; the local
failures remain unresolved.
- **확인하지 못한 것**: Windows runtime, installed native app and user
transition are outside S4 verification.

<details><summary>Verification record</summary>

- Contract: `agents/prd/web-shell-pivot-s4/prd.md`; base `5271703`; head
`56faaf5f21c27fc75b7eb6463c3d3c3822886477`.
- `bef04b3` sealed: Rust 658 passed, 3 path-alias tests failed;
Swift/lint passed; 216.4s. Fixed at `5b91b5e`.
- `5b91b5e` sealed: Rust FFI destroy timing failed twice (782ms, 751ms
vs 250ms); Swift/lint passed; 250.7s and 72.5s.
- `5b91b5e` serial sealed: Rust opener PID parse failed on an empty
file; Swift/lint passed; 81.3s.
- Isolated FFI and opener tests passed (0.32s and 1.16s); macOS CI
passed both in `cargo test --locked --workspace`.
- `56faaf5` focused: History 16/16, runtime focus, Rust lint, daemon
build, S4 web E2E 2/2 passed.
- Forced root swap after checkout handle capture: pinned Git status kept
inside A and excluded B secret.
- Final code and security closure found no new S4 defect; native
FileRoots-absent behavior and Windows runtime remain unverified.
- Current-head CI: six required checks PASS; local Sasu verification
remains STALE/FAIL.
- No current sealed PASS or gate override was recorded. Human-approved
CI-based merge exception applies only to S4 PR #141 at this exact head.

</details>
yansfil added a commit that referenced this pull request Oct 10, 2026
## Summary

같은 PR이 화면마다 다르게 보였다: 사이드바 아이콘은 주황, Sessions chip은 회색 `◷`, 카드는 생명주기 색,
보드와 Overview는 따로 그린 checks 표시와 주황 "변경 요청".
PR 상태를 core 한 곳(`PrState::of`)에서 정해 체크아웃 PR, 검색 결과, 링크 패널에도 같은 값으로 싣고,
web은 한 모듈(`web/src/prMark.ts`)과 한 컴포넌트(`components/pr-mark.tsx`)로 그린다.
모든 PR 표면이 상태 색 PR 아이콘과 `#번호`(여러 개면 `#924 +1`)를 그리고, 텍스트 글리프(◷ ✓ ✕ ⇥)와
화면별 색 표, 분류기, checks/review 문구 복사본, stale 계산 복사본은 지웠다.
색은 failed 빨강, pending 주황, mergeable 초록, draft 회색, merged 보라, closed 흐림으로
한 상태에 한 토큰이고, `--pr-open`은 `--pr-failed`, `--pr-mergeable`로 바뀐다.
운영자가 2026-10-10 승인한 시안 r1(1a-6a)대로이며, 승인 내용은 `docs/status-model.md`(Pull
request visual states)와 `docs/UI_BEHAVIOR.md`에 적었다.

![사이드바 before(왼쪽)/after(오른쪽): 에이전트 줄의 PR이 상태 색 아이콘과
번호로](https://github.com/yansfil/pr-assets/blob/main/herdr-ide/pr-mark-unify/8765577/compare-sidebar-dark.png?raw=true)

사이드바 에이전트 줄은 아이콘만 있던 PR에 번호가 붙는다(3a). 아래 접힌 블록에 Sessions, pane 헤더, Pen
시트가 있다.

## Review

- **판단해 주세요**: 사이드바 에이전트 줄에 번호가 붙어 좁은 폭(320)에서 제목이 더 일찍 잘린다(위 이미지의 `P8
읽기 전용 준…`). 승인(3a)대로지만 실제 폭에서 괜찮은지.
- **판단해 주세요**: pane 헤더의 Review/Merge 밴드도 같은 상태를 읽는다. Merge는 mergeable,
Review는 pending일 때만 서고 밴드 색은 상태 색(failed 빨강, mergeable 초록, pending
회색)이다. 그래서 draft에는 두 밴드가 다 없고, checks가 도는 열린 PR의 밴드는 초록에서 회색이 된다.
- **판단해 주세요**: PR 패널 머리의 상태 단어가 생명주기(열림/초안/머지됨/닫힘)에서 mark와 같은 상태 단어(CI
실패, 머지 가능 등)로 바뀌었다.
- **조심해서 볼 파일**: `herdr-core/src/model.rs` - snapshot wire:
`PullRequestSnapshot`을 손으로 쓴 `Serialize`로 바꿔 `state`를 덧붙인다. 필드 순서와 core
전용 필드 제외가 그대로인지.
- **조심해서 볼 파일**: `contracts/snapshot-wire-enums.json` - 새 wire enum
`pr_state`(6개). 체크아웃 PR `state`, `GithubSearchResult.pr_state`, 링크 패널
`state`가 더해지고, 읽는 곳이 없어진 `PrSummary.worst_count`, 검색 결과 `is_draft`는
wire에서 빠진다.
- **조심해서 볼 파일**: `herdr-core/src/agent_state/sessions.rs` - 에이전트 PR 요약이
이제 draft를 센다(전에는 draft를 몰라 pending). Idle 순서에 draft가 merged 앞에 들어간다.
- **질문**: Project Sessions의 세션 PR chip(`#N 만듦`/`#N`,
`LinkSessions.tsx`)은 상태가 아니라 만듦/참여를 보라색으로 구분한다. core가 상태를 싣지 않아 이번 범위에서
뺐는데, 같은 mark로 바꿀지.
- **조심해서 볼 파일**: `design/hide-ui.lib.pen`, `design/hide-screens.pen` -
스크립트로만 고쳤다(Pen 앱 저장 없음). 라이브러리 구조 diff는 Foundations, Agent tree parts,
Agent graph box, PR hover card, Pane header 3개, Checkout row 1개,
Overview group header 1개 노드로 한정된다.

## Evidence

- **확인한 것**: core 상태 규칙 테스트(여섯 상태, draft가 failing checks보다 앞,
changes_requested는 failed, checks 없음/unknown은 pass가 아님, wire에 `state`가
실림)와 wire enum 계약 테스트.
- **확인한 것**: web `prMark.test.ts` 9개: 여섯 상태의 토큰과 아이콘, wire enum과 키 일치,
review/checks 단어 색, 배지 단어, stale 문구, 에이전트 mark의 worst와 `+N`.
- **확인한 것**: origin/main(#925, #926, #928 포함) 위로 rebase한 뒤
`verify-cargo.sh lint`, `verify-cargo.sh test`(46개 바이너리 3925개),
`verify-web.sh`(web 1339개, desktop 162개), `check-design-contract.mjs`,
workstation identity, attribution, harness, capability-readers,
core-touches-no-machine 검사 통과.
- **확인한 것**: pane 헤더 밴드 테스트에 passing checks의 draft가 Merge 밴드를 받지 않는 경우를
더했다.
- **확인한 것**: rebase한 빌드로 web e2e 12개 spec(checkout-pr, sidebar-pr-start,
overview-prs, overview, link-graph, cmdk, disk-cleanup, session-panel,
projects-sidebar, sidebar-menus, graph-cross-project, agents-tab) 34개
통과. 격리된 pinned Herdr 0.9.3과 가짜 `gh`로 돌렸다.
- **확인한 것**: before/after는 gallery scene(`projects-sidebar`,
`session-panel`, `pane-header`)을 branch point와 이 브랜치에서 각각 띄워 같은
viewport로 찍었다. daemon이나 운영자 앱은 쓰지 않았다.
- **확인하지 못한 것**: 설치된 앱이나 격리 fixture에서 실제 GitHub PR로 본 live 화면은 없다. 화면
확인은 gallery scene과 e2e의 가짜 `gh` 응답까지다.
- **확인하지 못한 것**: Windows lane과 desktop e2e는 로컬에서 돌리지 않았다(CI가 돈다).
- **생성물**: `design/hide-screens.pen`(20 MB)은 `gen-screens`가 다시 썼다. 결과는
아래 Pen 시트 이미지.

<details><summary>추가 증거</summary>

Sessions before(위)/after(아래): 텍스트 글리프와 테두리 chip이 상태 아이콘과 번호로.
![Sessions
before/after](https://github.com/yansfil/pr-assets/blob/main/herdr-ide/pr-mark-unify/8765577/compare-sessions-dark.png?raw=true)

pane 헤더 before(위)/after(아래): `#140✓` chip이 아이콘과 번호로.
![pane 헤더
before/after](https://github.com/yansfil/pr-assets/blob/main/herdr-ide/pr-mark-unify/8765577/compare-pane-header-dark.png?raw=true)

사이드바 light before/after.
![사이드바 light
before/after](https://github.com/yansfil/pr-assets/blob/main/herdr-ide/pr-mark-unify/8765577/compare-sidebar-light.png?raw=true)

Pen `Component / Agent tree parts`: PR mark master와 여섯 상태, 여러 PR, 흐림,
포인터 아래, 좁은 변형.
![Agent tree
parts](https://github.com/yansfil/pr-assets/blob/main/herdr-ide/pr-mark-unify/8765577/pen-cmp-agent-tree-parts.png?raw=true)

Pen `Component / Agent graph box`: 테두리와 checks 표시 없는 PR mark, 변경 요청만 빨간
단어.
![Agent graph
box](https://github.com/yansfil/pr-assets/blob/main/herdr-ide/pr-mark-unify/8765577/pen-cmp-agent-graph-box.png?raw=true)

Pen `Component / PR hover card`: 배지는 아이콘만 상태 색, 단어와 Open PR은 글자색.
![PR hover
card](https://github.com/yansfil/pr-assets/blob/main/herdr-ide/pr-mark-unify/8765577/pen-pr-card-sheet.png?raw=true)

</details>
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.

1 participant