Skip to content

Refresh a pane's live cwd from the agent list - #380

Merged
yansfil merged 1 commit into
mainfrom
fix/live-pane-cwd
Oct 4, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/live-pane-cwd

Conversation

@yansfil

@yansfil yansfil commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: #373 (원래 이 수정이 들어 있던 PR, 보류 중)

Summary

새 plain pane은 pane_created 시점에 셸이 시작되기 전 물려받은 작업 폴더를 cwd로 들고 있을 수 있습니다.
core는 agent.list가 읽어 온 실제 cwd를 같은 pane 기록에 반영하지 않아, 그 pane이 엉뚱한 checkout으로 분류될 수 있었습니다.
#373에서 Linux web/e2e/checkout-owner.spec.ts 실패의 원인으로 찾은 수정을 따로 뗀 것입니다.
agent.list 갱신 때 같은 workspace·tab에 있는 같은 pane의 cwd만 갱신하고, 목록이 topology를 만들거나 옮기지는 못하게 했습니다.

Review

  • 조심해서 볼 파일: herdr-core/src/session_sync/replica.rs - Herdr가 주는 cwd를 core 기록에 반영하는 자리(Herdr/core ownership). workspace·tab이 다르면 반영하지 않습니다.

Evidence

  • 확인한 것: 새 회귀 테스트 agent_refresh_reconciles_a_plain_new_panes_live_checkout_cwd가 수정 전 FAILED, 수정 후 ok.
  • 확인한 것: agent_refresh_does_not_move_a_pane_or_clear_its_known_cwd 포함 session_sync 테스트 51개 통과(1개 기존 ignored), rustfmt check 통과.
  • 확인하지 못한 것: 이 PR의 첫 CI에서도 checkout-owner.spec.ts:80(기대 3, 실제 2)이 실패했습니다. 이 수정만으로 그 e2e가 풀린다는 근거는 아직 없습니다. 실패 job을 다시 돌려 flaky인지 확인 중입니다.

@yansfil
yansfil merged commit fb58a48 into main Oct 4, 2026
38 of 41 checks passed
@yansfil
yansfil deleted the fix/live-pane-cwd branch October 4, 2026 06:20
yansfil added a commit that referenced this pull request Oct 4, 2026
…ixture error (#398)

Related: #396, #397, #400

## Summary

main `verify` 최근 20회 중 성공이 4회뿐이었고, 2회 이상 반복된 실패 셋이 모든 PR을 막고 있었습니다.
이 PR의 첫 CI에서 같은 기간 main과 PR #380에서도 난 새 탭 유실 실패가 다시 나서 함께 격리했습니다(#400,
원인 수정은 별도 PR).
원인 수정 없이, 반복 실패 두 test를 기존 `@flaky` 방식으로 격리하고, Windows fixture 정리 실패가 원래
오류를 덮지 않게 바꿉니다.

| 격리한 test | OS | issue | 만료일 |
| --- | --- | --- | --- |
| `hide-platform/tests/ipc.rs`
`a_burst_of_clients_that_connect_and_leave_loses_no_connect` | macOS만 |
#396 | 2026-10-12 |
| `web/e2e/pane-focus-ordering.spec.ts` "rapid pane clicks coalesce…" |
전체 (`@flaky`) | #397 | 2026-10-12 |
| `web/e2e/checkout-owner.spec.ts` `:80`, `:163` (빠른 새 탭 두 번에 탭 하나 유실) |
전체 (`@flaky`) | #400 | 2026-10-12 |

- Windows fixture: 정리 단계 `EBUSY`가 원래 오류를 대신 던지던 두 자리(`startHerdr`의 setup
실패, 시작 실패 후 `stop`)가 이제 원래 오류를 던지고 정리 오류를 그 뒤에 붙입니다.
- Windows fixture `stop`: 서버를 멈추기 전에 그 프로세스 트리를 적어 두고, 멈춘 뒤 남은 트리와
fixture 폴더 안 실행 파일(claude.exe shim 등)을 끝내고 사라진 것을 확인한 다음 폴더를 지웁니다.
- IPC test는 macOS에서만 `#[cfg_attr(target_os = "macos", ignore =
"<#396>")]`라서 Linux/Windows 필수 lane에서는 그대로 돕니다.
- `pane-focus-ordering`은 focus 담당 작업 소관이라 tag와 annotation만 바꿨습니다.

## Review

- **판단해 주세요**: Rust test 격리를 `cfg_attr(..., ignore = <issue>)`로 하고
TESTING.md flaky 정책에 그 형식을 추가한 것.
- **판단해 주세요**: `pr.yml`의 lane 구조는 그대로이고, 단계 안에서 두 군데만 바꿨습니다.
- Windows `@platform` smoke에 `--grep-invert @flaky` 추가 (macOS
`@platform` job과 같게).
- desktop job의 quarantine 단계 이름을 "Quarantined tests"로 바꾸고 `hide-platform
-- --ignored` 실행을 추가 (비차단).
- **조심해서 볼 파일**: `web/e2e/platform-fixture.ts` - failure path. 새
PowerShell 두 개(트리 조회, 종료 확인 5 s 상한)는 Windows CI에서만 실행됩니다.
- **조심해서 볼 파일**: `web/e2e/herdr-fixture.ts` - 트리 조회나 종료 확인이 실패해도 서버는 멈추고
로그는 복사한 뒤, 폴더를 남기고 그 오류를 던집니다. 트리 조회는 서버가 살아 있을 때만 합니다(PID 재사용 방지).

## Evidence

- **집계**: main `verify` 최근 20회 (2026-10-04 03:51 - 14:33 UTC): 성공 4, 실패
10, 취소 6. 실패 job 로그 14개를 읽고 test별로 셌습니다.
- IPC `ConnectionRefused` 3회 (macOS):
[37209722343](https://github.com/modakbul-gongbang/hide/actions/runs/37209722343),
[37201946081](https://github.com/modakbul-gongbang/hide/actions/runs/37201946081),
[37195061109](https://github.com/modakbul-gongbang/hide/actions/runs/37195061109)
- rapid pane clicks 3회 (macOS):
[37201946081](https://github.com/modakbul-gongbang/hide/actions/runs/37201946081),
[37190200801](https://github.com/modakbul-gongbang/hide/actions/runs/37190200801),
[37182041622](https://github.com/modakbul-gongbang/hide/actions/runs/37182041622)
- Windows 정리 `EBUSY` 2회:
[37205377837](https://github.com/modakbul-gongbang/hide/actions/runs/37205377837)
(`stop`의 rmdir `fixture`),
[37200505780](https://github.com/modakbul-gongbang/hide/actions/runs/37200505780)
(setup 실패 뒤 unlink `bin\claude.exe`)
- 새 탭 유실 (Linux, Expected 3 Received 2):
[37214499584](https://github.com/modakbul-gongbang/hide/actions/runs/37214499584)
(이 PR `:80`),
[37182041622](https://github.com/modakbul-gongbang/hide/actions/runs/37182041622)
(main `:163`), PR #380
[37180917551](https://github.com/modakbul-gongbang/hide/actions/runs/37180917551)
attempt 1 (`:80`, attempt 2 통과)
- **확인한 것**: 이 PR head 8e312754의 `verify`
[37215621523](https://github.com/modakbul-gongbang/hide/actions/runs/37215621523)
통과, 모든 lane success.
- **확인한 것**: 이전 head f1f5ca0 run 37214499584에서 새 PowerShell 정리가 도는
Windows browser smoke 16 passed, `EBUSY` 없음. 같은 run의 desktop quarantine
단계에서 `--ignored`로 돈 IPC test는 macOS에서 통과.
- **확인한 것**: macOS에서 `hide-platform --test ipc`가 24 passed 1
ignored(#396 URL 표시), `-- --ignored`로 그 test 1 passed.
- **확인한 것**: `playwright test --list`에서 rapid pane clicks가 `--grep
@flaky`에 잡히고 `--grep @platform --grep-invert @flaky`에서 빠짐.
- **확인한 것**: `cargo lint`, desktop typecheck(`web/e2e` fixture 포함), web
lint 통과.
- **Windows 오류 보존 전후**:
- 전 (run 37200505780, 원래 오류가 사라짐): `Error: EBUSY: resource busy or
locked, unlink 'C:\...\hide-e2e-herdr-iuErtW\bin\claude.exe'`
- 후 (`afterCleanup`을 같은 모양의 오류로 Playwright list 리포터에서 실행): `Error:
fixture C compiler clang.exe failed (20 second process bound)` 다음 줄에
`cleanup after it also failed: EBUSY: resource busy or locked, unlink
...`, 위치는 원래 오류의 줄
- **확인하지 못한 것**: Windows 프로세스 정리가 실제로 남은 프로세스를 끝낸 경우(종료 대상이 있었던 실행)는 로그로
구분하지 못했습니다. CI 두 번에서 정리 실패가 없었다는 것까지만 확인했습니다.
- **확인하지 못한 것**: 각 spec의 `try/finally`에서 본문 오류와 `stop()` 오류가 겹치면 여전히 정리
오류가 남습니다(호출 161곳). 이 PR은 fixture 자신의 두 자리만 고쳤습니다.
- **확인하지 못한 것**: rapid pane clicks는 `@flaky`라 macOS뿐 아니라 Windows
`@platform` 필수 단계에서도 빠집니다(실패는 macOS만). Linux quarantine 단계와 nightly에서는
계속 돕니다. focus 원인 수정 PR이 #397에서 tag를 지울 때 함께 돌아옵니다.
- **확인하지 못한 것**: web/desktop e2e는 로컬에서 돌리지 않았습니다(디스크 여유 부족). 이 PR의 CI가
확인합니다.

<details><summary>대상에서 뺀 1회 실패 (최근 20회 중)</summary>

- desktop `keys.spec.ts:116` ⌃Tab/⌥Tab cycle:
[37189161274](https://github.com/modakbul-gongbang/hide/actions/runs/37189161274)
- desktop `agent-tab-groups.spec.ts:8` edge drag:
[37182041622](https://github.com/modakbul-gongbang/hide/actions/runs/37182041622)
- Linux `home.spec.ts:82`:
[37177739823](https://github.com/modakbul-gongbang/hide/actions/runs/37177739823)
- Windows `hided/tests/real_herdr.rs:457` 타이핑 echo:
[37175771645](https://github.com/modakbul-gongbang/hide/actions/runs/37175771645)
- Windows `startHerdr` 셸 자식 대기 `spawnSync powershell.exe ETIMEDOUT`
(close-subtree, s3):
[37201946081](https://github.com/modakbul-gongbang/hide/actions/runs/37201946081)

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

Every PR ran Rust, the unit suites on three OSes and the full E2E, even
a docs-only PR.
The median time for the required checks to finish was 32.45 min (Orca
16.22, Paseo 20.65).
Now a `plan` job reads the changed paths (`HEAD^1..HEAD` of the PR merge
commit) and plans only the lanes the change needs.
The same plan sets each job's `if:` and is what `verify` checks the
results against.

- `verify` passes only when every **planned** lane is `success` and
every **unplanned** lane is `skipped`. A planned lane that was skipped,
failed or cancelled fails `verify`, and so does a `needs` entry the plan
doesn't know or a failed plan.
- The Windows browser `@platform` smoke moves out of `windows check`
into its own `windows e2e` lane, which calls `web-e2e.yml` the same way
nightly does. Compile, unit tests and the OS contract stay in `windows
check`.
- `checks` is split into `policy` (on every plan), `web checks`,
`desktop checks` and `hcoord`.
- A main push, a comparison that fails (base missing, not a merge
commit, diff parse failure, `cargo metadata` failure) and any
unclassified path all run **every** lane.
- Main pushes no longer cancel each other (`cancel-in-progress` is now
PR-only). `design-contract.yml` also cancels only the same PR's previous
run.
- The rules live in one place, `scripts/ci-plan.py`; the table in
`docs/TESTING.md`, "Which lanes a pull request runs", explains them.

## Review

- **판단해 주세요**: whether it is acceptable that **main's full run is the
safety net** for a lane wrongly left out. A wrongly skipped lane
surfaces as a failure on main after the merge, not on the PR.
- **판단해 주세요**: whether to keep the Windows smoke now skipping `@flaky`
tests, as macOS already did. No `@platform` test is tagged `@flaky`
today, so the behavior is the same for now.
- **판단해 주세요**: web code shared with the desktop host (`SHARED_WEB`) also
runs the desktop lanes and the macOS/Windows `@platform` lanes. That is
broader than the brief's "desktop 연결까지"; I chose it because terminal,
input and shortcut changes are Windows-impacting.
- **조심해서 볼 파일**: `scripts/ci-plan.py` `READERS` and `SHARED_WEB`. These
two hand-kept lists are where a lane can be dropped wrongly (the failure
path). Review found five omissions from tests reading files across
folders and they are fixed (below).
- **조심해서 볼 파일**: the `verify` job in `.github/workflows/pr.yml` and
`aggregate()`. This is the merge gate itself.
- **질문**: `site/`, `tools/`, `spikes/`, `.github/*.md` and `agents/prd`
currently fall under "unknown path → everything". Should a follow-up
narrow them?

## Evidence

**Plan replay over the last 20 merged PRs.** Each row runs the
classifier on the merge commit's `^1..` diff:

| PR | 경로 수 | 계획 | 생략되는 lane | Rust crate |
| --- | ---: | --- | --- | --- |
| #389 | 7 | 전체 (`scripts/web-shell-measure/run.sh`) | - | 전체 |
| #388 | 6 | 부분 | desktop-checks, hcoord, os-contract, windows-check,
windows-e2e, macOS-e2e, desktop-e2e | herdr-core |
| #385 | 125 | 전체 (`.github/pull_request_template.md`) | - | 전체 |
| #387 | 70 | 전체 (`contracts/hided-ws.schema.json`) | - | 전체 |
| #386 | 61 | 전체 (`contracts/hided-ws.schema.json`) | - | 전체 |
| #368 | 2 | 전체 (`.github/workflows/pr.yml`) | - | 전체 |
| #372 | 23 | 전체 (`.github/workflows/nightly.yml`) | - | 전체 |
| #382 | 3 | 부분 | web-checks, desktop-checks, hcoord | herdr-core,
hide-host, hided |
| #383 | 1 | 부분 | rust, desktop-checks, hcoord, os-contract,
windows-check, desktop-e2e | - |
| #384 | 8 | 부분 | web-checks, desktop-checks, hcoord, os-contract,
windows-check, windows-e2e, web-e2e, macOS-e2e, desktop-e2e | herdr-core
|
| #380 | 2 | 부분 | web-checks, desktop-checks, hcoord | herdr-core, hided
|
| #381 | 1 | 부분 | rust, desktop-checks, hcoord, os-contract,
windows-check, desktop-e2e | - |
| #378 | 58 | 전체 (`.github/workflows/nightly.yml`) | - | 전체 |
| #377 | 11 | 부분 | hcoord | herdr-core, hided |
| #361 | 91 | 전체 (`agents/prd/three-column-panel/prd.md`) | - | 전체 |
| #376 | 7 | 부분 | web-checks, desktop-checks, hcoord | herdr-core,
hide-agent-hooks, hide-ai, hide-herdr-client, hide-host, hide-kit,
hide-memory, hide-platform, hide-session, hided |
| #367 | 27 | 부분 | hcoord | herdr-core, hide-host, hided |
| #375 | 2 | 부분 | web-checks, desktop-checks, hcoord | herdr-core,
hide-agent-hooks, hide-host, hide-kit, hide-memory, hided |
| #366 | 8 | 전체 (`.github/workflows/release.yml`) | - | 전체 |
| #362 | 153 | 전체 (`agents/prd/overview-request-view/prd.md`) | - | 전체 |

- **줄어드는 lane**:
- 11 of 20 PRs would run a partial plan; 9 run everything because they
touch `.github/`, `contracts/`, `scripts/` or `agents/`.
- A docs-only PR (#384) runs no E2E, Windows or macOS lane. It still
runs `rust -p herdr-core`, because a herdr-core test reads the root
`AGENTS.md`.
- A web display change (#388) runs no Windows, macOS, desktop or
OS-contract lane.
- A Rust crate change tests only that crate and its reverse
dependencies, from `cargo metadata`. For example #380 tests `herdr-core`
and `hided` only.
- **확인한 것**:
  - `scripts/tests/test_ci_plan.py` passes 19 cases. They cover:
    - Docs-only, which excludes Rust and E2E.
    - A pure web display change, which excludes the Windows smoke.
    - `hide-platform`, which includes Windows and the OS contract.
- Shared web, a `@platform` spec, `desktop/src/main` and leaf-crate
reverse dependencies.
    - Every `READERS` entry.
- Unknown paths, lockfiles and workflows, a type change, an empty diff,
a missing base, a non-merge HEAD and a missing crate graph, which all
run everything.
- The aggregate rejecting a skipped, failed or cancelled planned lane,
an unplanned lane that ran, a missing or extra `needs` entry, a failed
plan and an empty plan.
- The full `python3 -m unittest discover -s scripts/tests` suite passes
(108). That includes the check that every gate a workflow runs is a
tracked script.
- actionlint passes on every workflow. `check-herdr-pin-single-source`,
`check-hide-design-enforcement`, `check-no-workstation-identity`,
`check-harness-ignore-anchor` and `verify-cargo.sh fmt-check` all pass.
- Running `plan` on #388 produced the expected `GITHUB_OUTPUT` (`lanes`,
`full`, `rust-packages`) and the job-summary table.
- Running `aggregate` with a fake `needs` passed when the results
matched the plan and failed when a planned lane was skipped.
- **리뷰 반영**: a code review and a fidelity review against the brief found
these, now fixed:
- Tests read files across folders, so these changes now plan the lanes
that read them: the root `AGENTS.md` (herdr-core test), `web/src` and
`hided/src` (herdr-core structure tests), `wirePath.ts` (imported by web
e2e) and `design/tokens.json` (read by web tests).
  - Every crate change now runs `windows check`.
  - Main pushes no longer cancel each other.
  - `docs/PERFORMANCE_TESTING.md` no longer describes the old lanes.
- **CI ([run
37214808511](https://github.com/modakbul-gongbang/hide/actions/runs/37214808511))**:
- The plan was full (the change touches `.github/` and `scripts/`), and
every lane ran, including the separate `windows e2e`. All passed.
- The first attempt failed in Linux web e2e shard 2/6 on
`home.spec.ts:82` (the location bar read `Home/hde-…` instead of
`Home/~/hide`). This PR touches no web or test code. `verify` reported
exactly `web-e2e: planned, expected success, got failure`.
  - One rerun of the failed jobs passed, and `verify` is green.
- The `home.spec` failure is a flaky-test candidate; it belongs to the
main-green work, not this PR.
- **확인하지 못한 것**:
- Partial plans have never run on Actions. A docs-only or web-only PR
has not been tried; the first one after the merge will show it.
- The cold-cache time of the `windows e2e` lane is unmeasured. It uses
the same path as the nightly Windows lane.
- Main runs now queue instead of cancelling, but GitHub keeps only one
pending run per group. If three merges land in a row, the middle merge's
full run can be dropped.
- **안전망과 위험**: a lane that should have run but was skipped is the risk.
Main's full run catches it after the merge; the fix is then a rule in
`scripts/ci-plan.py` plus a test case.

Does not include: a failure ledger or history, a quarantine registry,
cache changes, a `max-parallel` experiment, or the `package.yml` `paths`
trigger (all out of scope).
If this and the main-green PR overlap in `pr.yml`, whichever merges
later rebases.
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