Skip to content

Test the graph's dash flow by the state its stepper owns - #309

Merged
yansfil merged 1 commit into
mainfrom
fix/graph-flow-state
Oct 1, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/graph-flow-state

Conversation

@yansfil

@yansfil yansfil commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Related: #298 (main에서 e2e/overview.spec.ts:179가 실패한 run 36898408446, web e2e linux 3/8)

Summary

  • #298이 넣은 대시 흐름 확인이 main CI에서 실패했습니다: 5초 동안 stroke-dashoffset 값 종류가 2개뿐이라 > 2가 깨졌습니다.
  • 원인은 제품이 아니라 확인 방법입니다. 대시는 오프셋 3개(0, -6, -12)를 약 1000ms 주기로 도는데, expect.poll의 간격도 1000ms로 굳어져 같은 위상만 계속 읽습니다.
  • 이제 캔버스가 대시가 도는 동안에만 data-graph-flowing을 달고, 브라우저 테스트는 표본 대신 이 상태를 읽습니다.
  • 스텝, 동작 줄이기에서의 멈춤, 다시 켜졌을 때의 재개는 가짜 타이머 단위 테스트가 정확히 확인합니다.

화면은 바뀌지 않습니다.

동작 줄이기를 끈 뒤 5초 동안 점선 path의 stroke-dashoffset 쓰기를 MutationObserver로 기록 (3회)
writes 16-17, distinct ["0","-6","-12"], 간격 ~333ms, 주기 ~1000ms, path는 연결된 상태

Review

  • 판단해 주세요: 확인 대상을 대시의 출력(오프셋 표본)에서 스텝퍼가 소유한 상태(data-graph-flowing)로 옮긴 것이 맞는지. 대시가 실제로 움직이는지는 단위 테스트의 가짜 타이머가 맡습니다.
  • 조심해서 볼 파일: web/src/graphMotion.ts - Flow에 running 알림이 생겼고, 스텝마다 하는 일은 그대로 setAttribute 하나입니다(high-frequency path, D-26).
  • 조심해서 볼 파일: web/src/GraphView.tsx - 캔버스가 바뀌어도 타이머가 이어지면 새 캔버스에 상태를 다시 씁니다.

Evidence

  • 확인한 것: 원인. 실패한 CI와 같은 흐름을 로컬에서 기록해, 타이머는 계속 돌고 있었고(초당 약 3회 쓰기) 오프셋은 정확히 3종류라는 것, 폴링 주기가 그 주기와 맞물린다는 것을 봤습니다. 제품 결함 후보(동작 줄이기를 껐을 때 change 리스너가 재개하지 않음, Flow가 떨어져 나간 노드를 칠함)는 기록에서 배제됐습니다.
  • 확인한 것: e2e/overview.spec.ts를 격리된 Herdr와 HOME으로 10회 반복해 통과(4/5 + 6/6). 5회 중 1회는 앱 코드 전의 git commit 설정 단계에서 실패했는데, 이 기기의 전역 git 서명 설정이 새는 환경 문제이고 이후 6회는 전역 git 설정 없이 돌렸습니다.
  • 확인한 것: graphMotion 단위 테스트 11개(새 테스트 1개: 켜짐, 꺼짐, 줄어든 동작에서의 꺼짐, 설정이 돌아왔을 때의 켜짐, 정리 때의 꺼짐), web lint, tsc, vitest 820개, 웹 토큰 검사, 디자인 계약 검사, 작업 환경 신원과 귀속 검사.
  • 확인하지 못한 것: 이 PR의 CI는 아직 돌지 않았습니다(올린 뒤 확인). Linux에서의 반복 실행은 로컬 macOS에서 대신했습니다.

…e instead of sampling their offsets

The dash pattern has three offsets and a 999 ms cycle, and a poll at its 1000 ms interval keeps reading one phase of it, so the check saw two values on a runner that was running the timer all along.
The canvas now carries data-graph-flowing while the Flow timer runs, the browser test reads that, and the stepping, its stop under less motion and its resume are asserted exactly with fake timers.
@yansfil
yansfil merged commit c04909a into main Oct 1, 2026
19 checks passed
@yansfil
yansfil deleted the fix/graph-flow-state branch October 1, 2026 18:16
yansfil added a commit that referenced this pull request Oct 1, 2026
…iew spec (#313)

Related: #298, #309 (PR #310의 run 36908368337, web e2e linux 2/6에서
`e2e/overview.spec.ts`의 정리 버튼 툴팁 확인이 실패)

## Summary

- 정리 버튼에 `hover()`한 뒤 5초 안에 툴팁이 뜨지 않아 `overview.spec.ts`가 실패했습니다. 같은 파일의
다른 툴팁 확인도 같은 방식이라 같은 위험을 안고 있었습니다.
- 툴팁은 포인터 이동이 트리거에 닿은 뒤 500ms를 기다려 열립니다. 바쁜 러너에서 그 이동이 유실되면 아무것도 열리지 않고
다시 시도하는 쪽도 없습니다.
- `restOn` 도우미가 시도마다 페이지 밖으로 나갔다가 트리거에 다시 들어가서, 툴팁이 뜰 때까지 최대 3번, 한 번에
1.5초씩 기다립니다. 기다리는 시간은 4.5초로 이전의 5초 한 번보다 짧아서 timeout을 늘리지 않습니다.
- 일곱 곳(타일 막대, 타일 배지, 정리 버튼, 이슈 카드의 Workspace 열기와 시작, 느슨한 워크트리와 PR 줄)에
적용했습니다. 화면과 제품 코드는 바뀌지 않습니다.

## Review

- **판단해 주세요**: 원인을 로컬에서 재현하지 못했습니다(아래 Evidence). 실패한 CI의 페이지 스냅샷으로 "트리거는
있고 툴팁은 없다"까지 확인했고, 그에 맞는 재시도를 넣었습니다. 이 가설과 처방이 충분한지.
- **조심해서 볼 파일**: `web/e2e/overview.spec.ts` - `restOn`. 카드에 올려야 보이는
버튼(Workspace 열기, 시작)은 `within`으로 카드를 시도마다 먼저 호버합니다.

## Evidence

- **확인한 것**: 실패한 CI의 페이지 스냅샷에 정리 버튼이 있고(접근 가능한 이름에 같은 문장이 들어 있음) 툴팁은 열려
있지 않았습니다.
- **확인한 것**: `e2e/overview.spec.ts`를 격리된 Herdr와 HOME에서 연속 5회 통과했고, web
lint, `tsc`, vitest 820개, 웹 토큰 검사, 귀속 검사가 통과했습니다.
- **확인하지 못한 것**: 실패를 로컬에서 재현하지 못했습니다. 원본 코드는 CPU를 2배 과부하로 걸어도 4회 모두
통과했고, 그래서 이 처방이 CI의 실패를 없앤다는 것은 CI에서 확인해야 합니다.
- **확인하지 못한 것**: 첫 구현은 `hover()`까지 5초 예산에 넣어서, 호버로만 보이는 카드 버튼에서 4분 동안
멈췄고 바로 고쳤습니다. 그 뒤 버전만 반복 실행으로 확인했습니다.
- **확인하지 못한 것**: Linux 러너에서의 반복 실행(로컬 macOS에서 대신함).
yansfil added a commit that referenced this pull request Oct 30, 2026
…and journey flakes (#1869)

Closes with-hide/hide-private#340
Closes with-hide/hide-private#325
Closes with-hide/hide-private#311

## Summary

Five desktop/journey flakes, each handled at its cause; one was a
product defect.

- **#311 (product fix)**: a new worktree's tab was focused before the
catalog listed its pane, so the worktree came forward only sometimes. It
now waits for the catalog, as an agent start already did (the contract
`docs/ARCHITECTURE.md` already stated), and comes forward only while the
operator has visited nothing else since, within 90 seconds and on the
same Herdr connection.
The page no longer sends its own focus for a worktree made on this
machine (New worktree, the start panel, Start from an issue, a pull
request's 맡기기): it only shows what the core selected, by the start's
request id, so a visit made while the worktree was being created is
kept. A worktree made on a device is still opened from the page once
that device lists it. The spec also waits for the project's first pane
before removing it.
- **#340**: the test restarted Herdr as soon as Hide drew the agent
asleep, before Herdr dropped the agent from its own list, so the cold
restore listed it again. It now waits for Herdr's list.
- **#325**: "Back to Hide" closes its own window, so Playwright's click
could throw "Target page, context or browser has been closed" although
the close was the outcome. A shared helper (`web/e2e/closing-click.ts`)
keeps Playwright's real pointer click, accepts that one error only, and
then waits for the page to close; the two practice.spec clicks with the
same shape use it too.
- **#322, #309 (cause not found, issues stay open)**: a failure now
keeps what was missing. #322 keeps the woken pane's screen, processes
and Herdr agent; #309 keeps the screen and Herdr's reading at each
activity change of a failed journey turn.

스크린샷 없음: nothing is drawn differently; what changes is whether a created
worktree is brought forward after the operator moved elsewhere.

## Review

- **판단해 주세요**: #311 now brings a new worktree on this machine forward
only under the start's conditions (no newer visit, 90 s, same
connection), written in `docs/UI_BEHAVIOR.md`, Start panel. Before, it
came forward only when the catalog already listed it, and the page could
also pull it forward late over a newer visit. Say if staying behind was
wanted.
- **조심해서 볼 파일**:
- `herdr-core/src/runtime/session.rs`, `group_starts.rs` - Herdr/core
focus ownership: `worktree_create` now holds the start focus permission,
so a visit made during creation cancels the follow (90 s bound,
generation check), as for agent starts.
- `herdr-core/src/runtime/pull_requests.rs`, `projects.rs`, `events.rs`
- `pr_delegate` takes an optional `request_id`, carried to the agent
start or the worktree start and onto its answer.
- `web/src/actions.ts` (`createWorktree`, `delegatePullRequest`),
`web/src/opening.ts` (`followStartedPane`) - the page sends a start
request id and begins the opening for a start on this machine; only a
device's pane is still opened from `WorkspaceNotices`.
- `web/e2e/closing-click.ts` - a real `locator.click()`; only the
page-closed error is tolerated, and only because the close is awaited
next.
- `scripts/agent_journey/journey.py` - the #309 trace is collected on
every turn, not only failed ones: per activity change one `agent list`
and one `pane read`, at most 8 moments (16 CLI calls, each with the
existing 15 s bound) per turn; it is written to the result only for a
turn that did not pass.
- **질문**: #322 and #309 stay open with diagnostics only. Should their
seven-day expiry move, or should they be deleted if they flake again
without a cause?

## Evidence

- **확인한 것**:
- #311 reproduced locally before the fix, 1 of 5 then 1 of 10 runs; the
dump showed the core's front checkout was the new worktree on the
failing run and the main checkout on passing runs
(`start.focus_disposition` with `local_checkout_owner` set vs null).
- New Rust test
`a_local_worktree_result_waits_for_its_catalog_before_it_comes_forward`
failed before the fix (front checkout stayed main) and passes after.
- New web test `createdWorktreeFollow.test.tsx` drives New worktree on
the screen path: create, a newer visit, then the late listing; no
`focus_pane` for the new pane is sent. With the page's old
open-when-listed restored it fails (`expected 'pane-next' to be null`).
It also checks that a device's worktree is still opened through
`remote_control` once listed, and that 맡기기 sends a request id only on
this machine.
- `a_node_pull_request_with_no_checkout_gets_its_worktree_on_the_node`
now also checks the request id reaches the answer; it failed until the
worktree start stamped it.
- herdr-core related lib tests (pull_request, node_issues, worktree,
group_tabs_remote, start_focus, task_operation, group_start): 351 pass;
clippy on herdr-core clean.
  - Whole web unit suite: 2286 pass; web typecheck and lint pass.
- `practice.spec.ts` whole file 27/27 (3 runs) and desktop
`first-run.spec.ts` "practice first" 5/5 with the pointer-click helper
(macOS, under load).
- `closing-click.ts` against a throwaway page: passes on a plain button
that closes its page, fails on the same button under a transparent cover
and with `pointer-events: none` (3 runs each). The previous
synthetic-click helper passed both covered cases.
- Earlier on this branch: `outside-home-project.spec.ts` 10/10,
`herdr-coexistence.spec.ts` cold restoration 5/5,
`sleep-wake-click.spec.ts` 5/5 locally (macOS).
- #340 cause read from the CI failure: `herdr-coexistence.spec.ts:106`
(`agent list` still had the sleeper after cold restore).
- #325 cause read from CI: the click's call log ends at "performing
click action" with "Target page, context or browser has been closed";
`leave()` runs `window.close()` (`web/src/practice/PracticeApp.tsx:58`).
- #309: three occurrences, all macOS antigravity fork; the row went
`stopped` -> `working` about 1.1 s after the prompt and stayed `working`
past 180 s while the model had answered. `/fork` itself worked (pane
shows "Forked conversation."), so the late-terminal-response lead does
not fit. The trace does not record the final screen after the row is
stuck on one activity, so it is a diagnostic, not a fix.
- **확인하지 못한 것**:
- #340's lag (Herdr dropping the agent after Hide draws it asleep) is
inferred from the failing assertion and the passing majority, not timed
directly.
- #325 and #340 were never reproduced locally, so the local passes only
show the new code holds; the old race is not shown gone.
- The #311 page change was not checked in the native app; the screen
path is covered by the web unit test and the e2e spec.
  - Linux and Windows are left to CI.
- Not run locally: the full web and desktop e2e suites, the journey
lane, clippy beyond herdr-core; CI runs them.
- `docs/ARCHITECTURE.md` (about 960 KB) was read only in the start
focus, sleep and worktree sections, not in full.

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

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