Skip to content

Restore task labels after session backlog and watcher restart - #270

Merged
yansfil merged 1 commit into
mainfrom
fix/context-label-records
Sep 30, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/context-label-records

Conversation

@yansfil

@yansfil yansfil commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 대형 도구 결과 뒤에서 세션 읽기가 멈춰 작업 이름이 기본 이름으로 남던 문제를 수정했습니다.
  • 대화 기록만 제한된 메모리에 유지하고, 남은 기록을 읽은 뒤 최신 사용자 요청으로 라벨을 생성합니다.
  • 재시작 시 여러 작업을 순서대로 분석하여 동시 호출 제한 때문에 라벨이 지연되지 않게 했습니다.

작업 라벨 복구 전후

왼쪽은 복구 전, 오른쪽은 복구 후 실제 앱입니다.
기본 이름으로 남던 세 작업이 현재 작업을 나타내는 이름으로 바뀌었습니다.

Review

  • 조심해서 볼 파일: hide-session/src/conversation_cursor.rs - 도구 기록을 건너뛰는 분류와 읽기·보관 한도.
  • 조심해서 볼 파일: plugins/agent-context-labels/src/lib.rs - 남은 기록, 실행 중 요청, 단일 분석 작업의 상태 전이.
  • 판단해 주세요: 재시작 직후 라벨 분석을 한 번에 하나씩 처리하는 동작과 최신 요청 선택 기준.

Evidence

  • 확인한 것: 관련 197개 테스트 통과, 대형 기록·분할 기록·파일 교체·재시작 회귀 검증 포함.
  • 확인한 것: 전체 Rust 포맷·lint, 디자인 계약, 실제 Herdr 계약 검사 통과.
  • 확인한 것: 실제 설치 앱의 동일 창을 캡처하여 세 작업의 라벨 복구를 확인했습니다.
  • 확인한 것: CI Rust 전체 테스트 1,664개와 웹 E2E 세 묶음이 통과했습니다.
  • 확인한 것: 데스크톱 E2E와 필수 verify가 실패 작업 1회 재실행 후 통과했습니다.
  • 확인하지 못한 것: 최종 전체 Rust 테스트는 기존 GitHub 경계 테스트의 1초 제한에서 실패했고, 해당 테스트 단독 재실행은 통과했습니다.
  • 확인하지 못한 것: 웹·데스크톱 E2E는 로컬에서 재실행하지 않았고 CI에서 검증했습니다.
Verification record
  • Base: 261baf8d3498eed48bb1d3ab013e08bdf5ad5802
  • Head: 5798d1e3f9e2b293f02557a59768c3fc72d94e6e
  • Related release suites: 197 passed, 2 existing live-provider tests ignored.
  • Workspace formatting and lint: passed.
  • Repository script suite: 32 passed.
  • CI workspace tests: 1,664 passed, 10 existing tests ignored.
  • CI web E2E: all three shards passed on the initial attempt.
  • Initial desktop CI: temporary-directory cleanup failed with ENOTEMPTY; only failed jobs were rerun once and passed.
  • Required PR verify: passed on attempt 2; all workspace, web, desktop and structural lanes passed.
  • Workspace test failure: github::tests::gh_boundary_is_read_only_noninteractive_and_preserves_failure_categories; isolated rerun passed.
  • Design contract, pinned Herdr schema/live contract, workstation identity check: passed.
  • Native observation: installed build 0.1.0-main.261baf8d, one app instance, exact window capture.
  • Run artifacts remain local; the comparison contains only the relevant sidebar rows.

@yansfil
yansfil merged commit 8d9919f into main Sep 30, 2026
13 of 15 checks passed
@yansfil
yansfil deleted the fix/context-label-records branch September 30, 2026 11:30
yansfil added a commit that referenced this pull request Oct 28, 2026
Closes with-hide/hide-private#147
Closes with-hide/hide-private#270
Closes with-hide/hide-private#161
Closes with-hide/hide-private#122
Closes with-hide/hide-private#168
Closes with-hide/hide-private#172
Closes with-hide/hide-private#195
Closes with-hide/hide-private#197

## Summary

Five of the most frequent web e2e flakes are fixed at their cause, and
one of them was a product race.
When a folder inside a repository was added as a project, one update
could draw it apart from its repository, with no tabs and under "No
agents", for about 10 ms.
The core now builds that update from path answers that already place the
new project.
The other four were tests that waited on the wrong thing, and four more
issues with the same tab failure close with them.
#287 needed no code, because its spec was deleted with Factory in #1437.

스크린샷 없음: no `web/src`, `site/` or `design/` change; the only product
change is in the core's catalog build.

## Review

- **판단해 주세요**: #270 is fixed in the core, not in the test helper. The
in-between update was wrong (the project shown apart from its
repository, empty, under No agents), so `showProjectRow` is unchanged.
- **판단해 주세요**: the graph still remounts every card when it switches from
plain layers to the placed layout. The switch waits on the asynchronous
layout worker, up to `LAYOUT_TIMEOUT_MS` (3000 ms), so a click in that
window can be lost. This PR only makes the test wait for `layered`; the
product defect is with-hide/hide-private#317.
- **판단해 주세요**: the #122 test now opens the record by focusing the row
(`focus-within`), so it checks the focus path and no longer checks the
hover reveal.
- **조심해서 볼 파일**: `herdr-core/src/session_sync/coordinator.rs`, the
catalog build on the session-sync thread (high-frequency path). The
change only chooses between two path indexes already in hand. When the
coordinator's own answers place every registration (the usual case),
nothing changes.
- **비용 검토**: each update adds one `knows()` lookup per local
registration on at most two indexes, with no new reads, timers or
fan-out.

## Evidence

- **확인한 것**: the 8 tests behind these issues passed 20 repeats each on
42aa932 (160 passed, 0 failed). This is evidence for 42aa932; the
commit after it changes docs only.
- **확인한 것**: a scratch probe (not committed) that read the wire frames
reproduced the #270 update before the fix and saw 0 of 31 after it.
- **확인한 것**: the new core unit test proves that a pending answer makes
the catalog build from the path index that places every registration. It
does not prove the screen frame; the probe above is the screen-level
evidence.
- **확인한 것**: CI on 7d6ee3b passed in every lane that ran, and no lane
reported a flaky test.
- **확인하지 못한 것**: clippy and the full Rust and web suites did not run
locally (the disk had 0.8-1.8 GiB free); CI ran them. The Windows form
of #161 is checked only in CI.

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

**Issues**

| Issue | Flakes | Cause | Fix |
| --- | --- | --- | --- |
| #270 s4 registered subfolder History | 17 | Product: while the node's
path answer was pending, the coordinator built the catalog from answers
that predate the new registration and overwrote the creation's correct
publish; the helper then clicked the vanished fold |
`paths_to_build_from` in the coordinator |
| #147 plan-review | 24 | The graph draws cards in plain layers, then
mounts them anew once placed; `boundingBox()` read a removed card
(`null`) | Wait for `data-dependency-layout="layered"` (`placedBoxes`);
mission-map had the same read |
| #161 checkout-owner linked worktree | 15 | `waitForTerminal` took the
strip's selected tab as the expectation; the canvas drew the new tab
while the strip still selected the old one | The expected tab comes from
Herdr (`createdTabs`), all 9 callers |
| #168 #172 #195 #197 | - | Same `Expected: old tab / Received: new tab`
signature, same helper | Same fix |
| #122 session-work-ledger report letter | 1 | Hover-only record button:
a child nesting under the root moved the row away from a still pointer |
Reveal the buttons by focusing the row (`focus-within`) |
| #287 Factory questions | 21 | The spec was deleted with Factory in
#1437 (cc80696) | Closed with that evidence, no code |

**Repeat run (c2)**

- Commit: 42aa932 (head 7d6ee3b adds docs only).
- Machine: macOS, one worker, debug hided with the core fix, pinned
Herdr 0.9.5.
- Command: `scripts/verify-web.sh web e2e e2e/plan-review.spec.ts
e2e/mission-map.spec.ts e2e/checkout-owner.spec.ts e2e/s4.spec.ts
e2e/session-work-ledger.spec.ts e2e/herdr-coexistence.spec.ts
e2e/last-tab-leaves-checkout.spec.ts e2e/s2.spec.ts --grep "<the 8
tests>" --repeat-each 20`
- Result: 160 passed, 0 failed, 19.4 min.
- The other tests the helper change touches (checkout-owner,
session-work-ledger, sidebar-menus, overview-device, s2 tab switch)
passed once each, 15 in all.

**#270 probe (not committed)**

- It logged the fold and the core's `no_agent_projects` from wire
frames, with the real test's Git setup.
- Before the fix, every batch of 12-20 runs (5 batches) had at least one
publish of `registered` at its bare path with 0 tabs beside `fixture`
and under No agents. One batch was counted exactly: 2 of 20.
- After the fix: 0 of 31.

**Static checks**

- `verify-cargo.sh test -p herdr-core --lib`:
`catalog_path_tests::a_pending_answer_builds_from_the_paths_that_place_every_registration`
passes.
- `web typecheck`, `web lint` (e2e size budget included) and `cargo fmt
--check` pass.

**CI on 7d6ee3b**

- Passed: verify, gate, plan, policy checks, rust workspace, web and
desktop checks, static-design, windows check, os contract linux and
windows, remote mailbox, web e2e linux 1-6 of 6, windows e2e, desktop
e2e macos 1-2 of 2, desktop e2e windows.
- Skipped by path filter: agent CLIs, agent journey, agy contract, omp
SDK contract, os contract macOS, package, windows wsl.
- No lane reported a flaky test.

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