Skip to content

복구 실패 터미널을 안전하게 닫고 위임 작업 이름 보존 - #1085

Merged
yansfil merged 8 commits into
mainfrom
fix/herdr-coexistence
Oct 14, 2026
Merged

yansfil merged 8 commits into
mainfrom
fix/herdr-coexistence

Conversation

@yansfil

@yansfil yansfil commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

복구하지 못한 터미널을 잠든 작업이나 재연결 가능한 터미널처럼 안내하던 문제를 고쳤습니다.
실패한 폴더와 닫기 행동을 보여 주고, 저장된 대화와 제목을 유지하며 실제 닫힘이 확인된 뒤 항목을 제거합니다.
새로 위임한 작업의 Herdr 탭과 작업공간에는 읽을 수 있는 이름을 붙이고, 사용자 이름과 재시도 식별자는 보존합니다.

900×720·한국어·큰 글자에서 복구 실패 경로와 닫기 동작을 보여 주는 현재 후보의 OS 캡처

같은 격리 후보의 밝은 테마: 긴 경로와 닫기 버튼 표시

Review

  • 판단해 주세요: 한국어 복구 실패 안내와 긴 폴더 표시가 다음 행동을 충분히 설명하는지 확인해 주세요.
  • 조심해서 볼 파일: live.rs, runtime/editor.rs, runtime/agents.rs는 닫기 승인과 최신 terminal/session을 연결합니다.
  • 조심해서 볼 파일: coordination/naming.rs, coordination/lineage.rs는 생성 기록, 사용자 이름 보호, 재연결 재시도를 담당합니다.
  • 비용 검토: 새 polling 없이 기존 worker를 사용합니다. 이름 작업은 활성·대기 batch 각 32건, receipt 최대 4,096건입니다. 포화 중 같은 관측은 계획을 다시 만들지 않습니다.
  • 남은 한계: Herdr API에는 읽기와 rename/close 사이를 원자적으로 묶는 조건부 변경이 없습니다.
  • worker는 Runtime 밖에서 I/O하며 실제 상태 변경만 발행하고, 소유 coordinator 종료 시 현재 작업 뒤에 종료합니다.
  • 생성 응답이 durable 기록 전에 유실돼 첫 탭 이름의 소유 근거가 없으면 그 이름을 추정해 바꾸지 않습니다.

Evidence

  • private HOME·state·socket에서 브라우저 32개 흐름과 실제 Herdr spawn·이름 기록·재시도 동작을 확인했습니다.
  • Electron 900×720, 한국어 긴 폴더, 밝은/어두운 테마, 글자 크기 17, 키보드 닫기 검사가 통과했습니다.
  • 최종 후보의 macOS PID/window를 식별해 두 테마를 OS 캡처로 확인했습니다. 운영 앱·서버는 변경하지 않았습니다.
  • 닫기 10개 검사는 승인된 peer, 교체된 terminal/session, unknown, 범위 변경, 시간 제한과 부모만 닫기를 확인합니다.
  • 이름 큐를 32/32/6으로 소진하며 batch마다 동일 관측 100회를 넣어 계획이 추가되지 않음을 확인했습니다.
  • PR 게시 전 Rust 전체 테스트·lint, 웹/desktop typecheck·lint·unit·build와 두 리뷰가 통과했습니다.
  • 최종 CI verify와 Design contract가 통과했습니다. Windows 복구 화면 시나리오도 실제 실행됐습니다.
  • 추가 로컬 검사: 같은 소스의 게시 후 재검증에서 기존 spawn-guard 진단 로그 검사 1건이 실패했고, 분리 실행은 통과했습니다. 원인은 미확정이며 최신 로컬 보고서는 FAIL로 보존했습니다.
  • 생성물: CLI 계약은 optional 이름 결과를 포함하도록 재생성했습니다.
  • 확인하지 못한 것: 실제 원격 기기 연결 단절 UI, 물리 키보드 입력, Windows/Linux의 수동 OS 관찰은 수행하지 않았습니다.
Verification record
  • PRD: agents/prd/herdr-coexistence/prd.md (sha256 5acdedc2d7e8232cc62eda161c53b44246dbc9c7a779d26f65a8d5158a7de35d)
  • Base fe1a5ef → head e758fd1; pre-publication verification 2026-10-14T06:28:59.435Z: PASS.
  • Post-CI local refresh on unchanged e758fd1: FAIL (S1 test 58.9s; S2 lint GREEN 15.7s). Earlier PASS and this later FAIL are distinct; the current verification-report files contain the FAIL.
  • Verification report: agents/runs/herdr-coexistence/verification-report.json and agents/runs/herdr-coexistence/verification-report.md; source fingerprint 0609b580e0b8a14e9eb8e5f46db53a1642b1348a5ca0e57a414b94140f022941
  • Pre-publication suites:
    • S1: GREEN bash scripts/verify-cargo.sh test (exit 0)
    • S2: GREEN bash scripts/verify-cargo.sh lint (exit 0)
  • Code review: e758fd1, no remaining Fix now; confirmed full-queue B13 bounds, fresh close scope/deadline and confirmed peer identity fixes. Same-head evidence continuity checked before publication.
  • Fidelity review: e758fd1, B1-B16 continuity accepted; four current-head UI artifacts independently matched and both OS captures viewed. No remaining Fix now.
  • Previous findings closed: optional naming schema, current tab membership, shared deadline, saturated-queue replanning, seed-tab creation proof, approved live peers and Close only this.
  • Follow-up: broader admission-to-worker coverage remains optional; native API read-to-mutation race cannot be eliminated without conditional mutation support.
  • UI/behavior checks at b597974 (production code unchanged by the fixture-only successor): 32/32 browser journeys, 1/1 native renderer, web/desktop typecheck/lint/unit/build; current-head OS captures identify PID 49695 / window 1296.
  • Original script checks: 326/326 under Python 3.12 and C locale; policy, design and pinned Herdr schema checks passed before rebase.
  • Base policy: main advanced to f3f857e after rebase; in-memory merge is conflict-free. CONTRIBUTING.md permits a behind-main PR; Observer retains premerge check and merge authority.
  • CI correction: Windows seed-tab fixture copied a native path directly into its receipt; it now uses the production created_worktree decoder. Exact Applied and observed-label assertions are retained. Both reviews accepted this test-only change.
  • d56e263 focused pinned-Herdr seed-tab reproduction: 1 passed. Final-head Windows check passed, including this seed-tab test; final-head Windows browser and desktop lanes passed.
  • Portable restoration correction: both full-folder UI expectations reuse toPage; desktop restoration is now tagged @platform so Windows CI selects it. Full-path, no-overflow, Korean font17, both themes and keyboard close assertions remain intact.
  • e758fd1 focused checks: native restoration with the @platform selector 1/1, browser coexistence 3/3, desktop typecheck and web/desktop lint passed. Both reviewers accepted the scope and retained evidence; actual Windows restoration passed in job 115715939280: 12/12 desktop tests, no flaky tests; macOS desktop passed 78/78 with no flaky tests.
  • Final CI: verify run 38522549285 SUCCESS and Design contract run 38522548158 SUCCESS on e758fd1.
  • Post-CI failure: spawn_guard::nonworker_and_unproven_question_answers_let_the_native_tool_run, spawn_guard.rs:229, mode refused, missing daemon.unreachable log. The preceding exit/stdout/stderr/query-count assertions passed. Its production and test paths have no diff in this PR. Exact isolated rerun passed 1/1 in 0.32s; cause remains unresolved, recorded as an existing intermittent diagnostic-test follow-up, not a proven regression or a fixed defect.
  • Local records: portable-final-verify.log and delivery/pr-body-prior-pass.md retain prior PASS evidence; post-ci-failed-verification-report.json/md and mechanical-48c9d78ea93b0159.log retain the FAIL; post-ci-spawn-guard-focused.log retains isolated PASS. No source, test threshold, retry or skip was changed. Per Observer direction, no further base-chasing reruns.
  • Evidence: 19 registered (13 log, 5 screenshot, 1 file); paths are local to the run directory
    • agents/runs/herdr-coexistence/e2e-coexistence.log
    • agents/runs/herdr-coexistence/native-dark-ocu.png
    • agents/runs/herdr-coexistence/close-approved-tests.log
    • agents/runs/herdr-coexistence/final-web-e2e.log
    • agents/runs/herdr-coexistence/final-native-restoration.log
    • agents/runs/herdr-coexistence/native-current-dark.png
    • agents/runs/herdr-coexistence/native-current-light.png
    • agents/runs/herdr-coexistence/real-spawn.log
    • agents/runs/herdr-coexistence/seed-tab-fixed.log
    • agents/runs/herdr-coexistence/review-fix-check.log
    • agents/runs/herdr-coexistence/pi-helper-barrier.log
    • agents/runs/herdr-coexistence/review-evidence.md
    • agents/runs/herdr-coexistence/native-rebased-dark.png
    • agents/runs/herdr-coexistence/native-rebased-light.png
    • agents/runs/herdr-coexistence/rebased-web-e2e.log
    • agents/runs/herdr-coexistence/rebased-native-restoration.log
    • agents/runs/herdr-coexistence/ci-seed-wire-fix.log
    • agents/runs/herdr-coexistence/portable-restoration-native.log
    • agents/runs/herdr-coexistence/portable-restoration-web.log
  • Changed paths: 52 (see Files changed)
  • Delivery: mode pr, branch fix/herdr-coexistence, base main

@yansfil
yansfil merged commit 9992c59 into main Oct 14, 2026
23 checks passed
@yansfil
yansfil deleted the fix/herdr-coexistence branch October 14, 2026 07:25
yansfil added a commit that referenced this pull request Oct 15, 2026
## Summary

CI는 PR이 바꾼 경로로 돌릴 레인을 고르는데, 규칙에 없는 경로가 하나라도 있으면 모든 레인을 돌립니다.
10-13 이후 머지된 PR 58개 중 13개가 그랬고, 원인은 테스트가 읽는 계약 파일, 레인이 부르는 workflow, 디자인
스크립트, `web/vite.config.ts`였습니다.
이제 이 경로들은 실제로 읽는 레인과 크레이트만 돌립니다. 같은 58개를 다시 계산하면 전체 레인 PR 13 → 1, 잡 855
→ 823, macOS 잡 58 → 45입니다.

- **계약 5개** (`hided-ws.schema.json`, `snapshot-wire-enums.json`,
`agent-adapters.json`, `hide-cli.json`, `usage-coverage.json`): 읽는 테스트의
크레이트만 `rust`로, 웹 테스트가 읽으면 `checks`, 셸이 import하면 `web-e2e`도.
- **레인 workflow 4개** (`web-e2e.yml`, `desktop-e2e.yml`,
`os-contract.yml`, `remote-mailbox.yml`): 그 workflow를 부르는 레인만.
- **`web/vite.config.ts`**: 셸을 빌드하거나 웹 단위 테스트를 돌리는 레인 전부. Rust만 도는 레인은
뺍니다.
- **디자인 생성기, 토큰 맵, 디자인 검사**: `policy`만. `design-contract.yml`이 모든 PR에서
따로 검사합니다.
- **`Cargo.lock`은 전체 그대로**: 거의 모든 크레이트가 `workspace-hack`에 의존해 lock 변경이
모든 크레이트에 닿습니다.
- **따라가다 찾은 누락** (두 번째 커밋): `docs/UI_BEHAVIOR.md`,
`docs/AI_PROVIDERS.md`, 에이전트 로고 manifest는 테스트가 읽는데 그 레인을 돌리지 않았습니다. 이제
돌립니다.

## Review

- **판단해 주세요**: `agent-adapters.json`은 웹 셸 파일 규칙(`checks`, `web-e2e`)을 따라
데스크톱 e2e를 돌리지 않습니다. `agentAdapters.ts` 변경도 지금 그렇고, 데스크톱에서만 깨지면 nightly가
잡습니다.
- **판단해 주세요**: brief 목록 밖인 `web-e2e.yml`, `desktop-e2e.yml`,
`os-contract.yml`과 디자인 검사 6개도 같은 규칙이라 넣었습니다. workflow는 테스트가 `pr.yml`의
`uses:`에서 부르는 레인을 읽어 맞춥니다.
- **조심해서 볼 파일**: `scripts/ci-plan.py` `classify` - 다른 규칙이 없는 경로는 이제
READERS가 전부 정합니다. 기존 READERS 경로는 다른 규칙이 먼저 잡아 그대로입니다.
- **조심해서 볼 파일**: `scripts/ci-plan.py` READERS - 크레이트는 그 크레이트 테스트만 돌립니다.
테스트가 아닌 코드가 계약을 읽게 되면 크레이트 변경 규칙으로 옮겨야 합니다.

## Evidence

- **확인한 것**: `python3 -m unittest discover -s scripts/tests -p
'test_*.py'` 343개 통과.
- **확인한 것**: 계약 테스트는 기대값을 소스에서 얻습니다. 주석을 뺀 코드에서 파일 이름을 부르는 크레이트와 웹 파일이
계획된 크레이트와 레인과 같아야 합니다.
- **확인한 것**: 레인 하나를 빼는 변조 3개(계약, vite 설정, `os-contract.yml`)가 각각 테스트를
실패시킵니다.
- **확인한 것**: 재현 스크립트로 PR 58개의 merge commit diff를 변경 전후 planner에 넣었습니다.
spec은 merge commit 시점 내용으로 읽었습니다. 표는 아래.
- **확인하지 못한 것**: 머지 뒤 실제 PR 런의 잡 수와 대기 시간. 이 PR은 `scripts/ci-plan.py`를
바꿔 자기 런은 전체 레인입니다.
- **확인하지 못한 것**: 리더 스캔은 파일 이름 문자열로 찾아, 경로를 조각으로 이어 붙여 읽는 코드는 놓칠 수 있습니다.

<details><summary>PR별 전/후 (전체 레인이던 13개)</summary>

잡 수는 `plan`, `verify`와 레인별 잡(`web-e2e` 5, `os-contract` 2, `package` 3,
나머지 1)의 합입니다.
Rust 크레이트는 `rust` 레인이 lint와 테스트를 도는 범위입니다(전체 레인이면 workspace 전체).

| PR | Unclassified paths before | Full after | Jobs | macOS jobs | Rust
crates | Lanes dropped |
| --- | --- | --- | --- | --- | --- | --- |
| #1108 | `contracts/hided-ws.schema.json` | no | 18 -> 16 | 2 -> 0 |
workspace -> 11 of 16 | os-contract-macos, desktop-e2e |
| #1085 | `contracts/hide-cli.json` | no | 21 -> 20 | 3 -> 2 | workspace
-> 8 of 16 | os-contract-macos |
| #1083 | `.github/workflows/remote-mailbox.yml` | no | 21 -> 21 | 3 ->
3 | workspace -> 14 of 16 | - |
| #1076 | `scripts/gen-tokens.mjs` | no | 18 -> 10 | 2 -> 0 | workspace
-> 1 of 16 | os-contract, os-contract-macos, windows-check, windows-e2e,
windows-desktop, remote-mailbox, desktop-e2e |
| #1074 | `contracts/hided-ws.schema.json` | no | 18 -> 17 | 2 -> 1 |
workspace -> 3 of 16 | os-contract-macos |
| #1070 | `scripts/gen-screens.mjs`, `web/vite.config.ts` | no | 18 ->
17 | 2 -> 1 | workspace -> 8 of 16 | os-contract-macos |
| #1056 | `contracts/snapshot-wire-enums.json` | no | 21 -> 20 | 3 -> 2
| workspace -> 10 of 16 | os-contract-macos |
| #1051 | `contracts/hided-ws.schema.json` | no | 21 -> 20 | 3 -> 2 |
workspace -> 3 of 16 | os-contract-macos |
| #1049 | `scripts/pen-token-map.json` | no | 18 -> 3 | 2 -> 0 |
workspace -> not run | rust, checks, os-contract, os-contract-macos,
windows-check, windows-e2e, windows-desktop, web-e2e, remote-mailbox,
desktop-e2e |
| #1044 | `.github/workflows/remote-mailbox.yml`,
`contracts/agent-adapters.json`, `contracts/hided-ws.schema.json`,
`contracts/usage-coverage.json` | no | 21 -> 21 | 3 -> 3 | workspace ->
15 of 16 | - |
| #1037 | `contracts/hided-ws.schema.json` | no | 18 -> 17 | 2 -> 1 |
workspace -> 3 of 16 | os-contract-macos |
| #1030 | `Cargo.lock`, `contracts/agent-adapters.json`,
`contracts/hided-ws.schema.json`, `contracts/usage-coverage.json` | yes
| 18 -> 18 | 2 -> 2 | workspace -> workspace | - |
| #1017 | `contracts/snapshot-wire-enums.json` | no | 18 -> 17 | 2 -> 1
| workspace -> 9 of 16 | os-contract-macos |

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