Skip to content

fix: show a Memory row's press as working from the press - #1906

Merged
yansfil merged 2 commits into
mainfrom
fix/memory-press-feedback
Oct 30, 2026
Merged

yansfil merged 2 commits into
mainfrom
fix/memory-press-feedback

Conversation

@yansfil

@yansfil yansfil commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

제안 탭에서 Memory 행의 문서 고치기를 눌러도 아무 일도 없는 것처럼 보였습니다.
누름은 실제로 처리되고 있었지만, 에이전트가 뜨기까지(수십 초) 화면은 버튼 그대로였고, 그동안 다른 행을 누르면 조용히 거절됐습니다.
이제 누른 행은 그 순간 고치는 중으로 바뀌고, Memory가 실제 진행 상태를 읽어 오면 그 행으로 넘어갑니다.
다른 카드가 시작 중일 때 누른 행은 차례를 기다리고, 시작이 거절되면 그 행에 시작하지 못했어요 · <이유>와 다시 시도가 나옵니다.
이유는 거절 코드별로 번역된 문구이고, 문구가 없는 코드(저장소 자체의 거절)만 코어 문장을 아래에 보여 줍니다.

제안 탭: 브랜치 5개로 거절된 시작(m400), 새 제안(m569), 누른 직후 고치는 중(m146)

Review

  • 판단해 주세요: 거절 코드 8개의 문구(web/src/i18n/resources/suggestions.ts, suggestions.refusal.*, 4개 언어)
  • 판단해 주세요: action_failed(카드가 사라짐, 문서와 다름 답변 필요 등 저장소 자체 거절)는 문장마다 이유가 달라 코어 문장을 그대로 둡니다
  • 판단해 주세요: 대기·실행 중인 누름 상한은 8개, 기록은 16개입니다. 넘치면 그 행에 거절로 보입니다
  • 조심해서 볼 파일: herdr-core/src/runtime/project_memory.rs - apply_memory_action을 begin_memory_action(거절을 반환)으로 나눔; 실패 경로가 Memory 탭에 그대로 가는지
  • 조심해서 볼 파일: herdr-core/src/runtime/memory_promotion.rs - start_promotion이 running 기록 직후 reserved()로 읽기를 요청; 쓰기 스레드가 Runtime 락을 잠깐 잡음(effects permit은 try_lock만 쓰므로 교착 없음)
  • 조심해서 볼 파일: herdr-core/src/runtime/suggestion_memory.rs - 누름 단계(대기/실행/기록됨/거절), 읽기 세대로 넘겨주는 시점, Refusal::of의 kind→코드 대응
  • 비용 검토: 누를 때마다 Vec 한 번 순회, 탭 합성은 기존처럼 facts가 바뀔 때만; 타이머·지연 없음

Evidence

  • 확인한 것: a_pressed_memory_row_reads_working_before_its_write_runs - 실제 store와 delivery worker로 누르고 Runtime 락을 쥔 채(쓰기 전) 행이 Applying/HideAiWorking, 같은 행 재클릭은 무시, 이후 에이전트 시작 실패까지 행이 버튼으로 돌아가지 않음
  • 확인한 것: a_press_behind_another_memory_change_waits_and_a_refusal_shows_on_its_row - 다른 Memory 변경 중 누름은 대기(working), 이어서 거절되면 행에 promotion_unavailable 코드와 코어 문장
  • 확인한 것: lay_memory_rows 단위 테스트로 진행/거절/넘어가기 누름의 행 모양
  • 확인한 것: HideAiTool.test.tsx - 아는 코드는 번역 문구만, 모르는 코드(not_started)는 코어 문장을 detail로 보여 줌
  • 확인한 것: verify-cargo.sh lint 통과, verify-cargo.sh test-scoped -p herdr-core 3563 passed / 0 failed(첫 커밋), 두 번째 커밋 후 Memory·제안 관련 290개 재실행 통과
  • 확인한 것: verify-web.sh web typecheck·lint·test 2313 passed
  • 확인한 것: 갤러리 hide-ai scene memory_pressed 상태를 ko·en, dark로 Playwright 캡처; 패널 폭에서 잘리던 긴 문구 둘을 줄임
  • 확인하지 못한 것: 설치된 앱이나 격리 앱에서 실제 에이전트 시작(수십 초) 동안의 화면은 보지 않았습니다. 런타임 테스트는 Herdr 없이 시작 실패 경로만 끝까지 갑니다
  • 확인하지 못한 것: hided·desktop·e2e 레인은 이 diff가 건드리지 않아 돌리지 않았습니다
Verification record

base f74c9aa, head c4a9907.

A 제안 row's 문서 고치기 on a Memory card is held by the core from the press until a read of Memory shows its promotion, so the row reads 고치는 중 at once instead of keeping its button for the tens of seconds the agent takes to start. A press while another Memory change runs waits its turn instead of being refused unseen, and a refused start is drawn on its row with the reason. The read that shows a promotion's running cards is asked for as soon as they are written, before the agent starts.
…ntence

The row carries the refusal's code (branches_full, not_git, promotion_unavailable, action_busy, presses_full, store_unavailable, project_unavailable, project_unreachable) and the tab words it in every interface language; only a code the tab has no words for, such as the store's own refusals, shows the core's sentence.
@yansfil
yansfil merged commit 6eaf6e9 into main Oct 30, 2026
33 checks passed
@yansfil
yansfil deleted the fix/memory-press-feedback branch October 30, 2026 16:29
yansfil added a commit that referenced this pull request Oct 30, 2026
…nflicting branch by itself (#1908)

Related: #1906 (fix/memory-press-feedback also touches the refusal shown
on a row, including `branches_full`; merge-order: this stays alone and
merges main once after #1906 and #1903)

## Summary

`문서 고치기` and Memory's `N개 문서에 반영` no longer stop at `결정을 기다리는 브랜치가
5개예요`: a fix starts on its own branch from the base however many
branches already wait.
When `main에 합치기` or `main에 바로 올리기` is refused because the base moved and
the branch conflicts with it (`merge_conflict`), Hide starts `다시 맞추기`
itself, once per refusal, and the row shows `다시 맞추는 중` under 반영 중.
When the remake is ready, Hide presses the same merge once more by
itself, since the operator already asked for it; the row reads `합치는 중`
and folds as any merge does.
Only a second refusal, or a remake that made no commit, stops for the
operator with `다시 시도`; the hand `다시 맞추기` button is gone.
This replaces PRD hide-ai-branch-first-apply D-17 and B28 (operator
decision 2026-10-31: "컨플릭트 나면 고쳐서 하면 되는 거 아닌가").

![브랜치 6개가 기다려도 문서 고치기가 나오고, 충돌난 브랜치는 반영 중에서 다시 맞추는
중](https://github.com/yansfil/pr-assets/blob/main/hide/fix-no-branch-cap/63d478b/no-branch-cap-remaking.png?raw=true)

## Review

- **판단해 주세요**: the remade branch is merged without anyone reading the
agent's conflict resolution (lead's decision: the press already asked
for the merge).
- **판단해 주세요**: which merge a remake finishes lives in memory only; after
a restart the remade branch waits for a press rather than adding a store
field and a Memory schema migration.
- **조심해서 볼 파일**: `herdr-core/src/runtime/suggestion_apply.rs` - failure
path: the refusal and then `LineAction::Rebase` go to the worker in that
order, so the refusal is recorded before the remake begins.
- **조심해서 볼 파일**: `herdr-core/src/runtime/memory_branch.rs` - failure
path: a merge decision now prepares a rebase start under the lock
(`promotion_start`); on `merge_conflict` the decision worker restarts
the batch with `BatchPurpose::Rebase` instead of writing the refusal,
and writes the refusal when no card restarts.
- **조심해서 볼 파일**: `herdr-core/src/runtime/memory_branch.rs`
`finish_remade_batches` - runs on each Memory read; it fires only after
the batch was seen running, so the old ready rows of a stale read are
never merged.
- **조심해서 볼 파일**: `contracts/snapshot-wire-enums.json`,
`herdr-core/src/model.rs` - snapshot wire: `suggestion_hold` loses
`branches_full` and the Memory snapshot loses `branches_full`; the shell
already treated it as optional.
- **비용 검토**: no cap was added (principle 15). Running remake agents are
bounded only by refusals, and each refusal is one operator press;
nothing loops, since a remake that conflicts again needs another press.
A cap on concurrent Hide AI agents per Project would be the real bound
if one is wanted; this PR does not invent one.

## Evidence

- **확인한 것**: core test
`a_merge_that_conflicts_with_the_base_starts_the_remake_itself` on a
real git repo: a conflicting merge refuses with `merge_conflict`,
exactly one `LineAction::Rebase` follows, and once the remade attempt is
ready main fast-forwards to the remade tip with no second press.
- **확인한 것**: core test
`a_remade_branch_that_conflicts_again_waits_for_the_operator`: a remake
that still conflicts is refused once, no second remake starts, and a
later ready attempt moves nothing.
- **확인한 것**: `bash scripts/verify-cargo.sh lint` passed, and
`verify-cargo.sh nextest -p herdr-core -p hided` ran 4228 tests, all
passed.
- **확인한 것**: `bash scripts/verify-web.sh` passed (web 264 files / 2311
tests, desktop 28 files / 302 tests, typecheck, lint, build); `node
scripts/check-design-contract.mjs` passed.
- **확인한 것**: gallery state `hide-ai&state=remaking` (dark, ko, 420 px)
captured with headless Chromium: six ready branches, `AGENTS.md 고치기`
still offered, and the remade row reading `다시 맞추는 중 1분`.
- **확인하지 못한 것**: the Memory batch's automatic remake and its finishing
merge have no test of their own (the decision worker needs a live Herdr
spawn); they reuse the restart path `다시 맞추기` took and the operator's
merge path.
- **확인하지 못한 것**: no native run in the installed app; a real agent
remaking a conflicting branch was not exercised end to end.

<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