Skip to content

refactor: remove the Herdr move and keep the read-only import - #2379

Merged
yansfil merged 8 commits into
mainfrom
refactor/remove-update-move
Nov 10, 2026
Merged

yansfil merged 8 commits into
mainfrom
refactor/remove-update-move

Conversation

@yansfil

@yansfil yansfil commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Hide가 옛 Herdr 세션을 자기 엔진으로 옮기던 기능(업데이트 때 자동 이동, 이동 질문 창, 기기 Herdr 정리)을 걷어냅니다.
읽기 전용 가져오기(온보딩 카드, 사이드바 줄, 설정 줄, hide import herdr)는 그대로 둡니다.
v1.1.1 이하에서 올라오는 사용자는 Herdr 서버를 직접 멈춰야 하며, 그 밖의 잃는 것 둘은 docs/INSTALL.md의 "업데이트가 잘못됐을 때"에 적었습니다.

첫 실행: 가져오기 카드 (격리 dev 서버의 gallery 장면, 라이트 - 실제 후보 앱 캡처가 아님)
사이드바 줄: 실제 후보 앱(격리 HIDE_STATE_DIR, Herdr 픽스처)에서 캡처 - "Herdr has 3 tabs · Import"
설정 줄: 실제 후보 앱(격리 HIDE_STATE_DIR, Herdr 픽스처)에서 캡처 - "Import Herdr work"

Review

  • 판단해 주세요: 업데이트 때 이동이 사라져서 v1.1.1 이하 사용자가 잃는 것 셋을 운영자가 받아들이는지 (docs/INSTALL.md, "업데이트가 잘못됐을 때").
  • 조심해서 볼 파일: hide-core/src/runtime/herdr_import.rs, hide-core/src/herdr_import.rs (가져오기 기록의 옛 필드 읽기: committed, not_stopped), hide-kit/src/record.rs (옛 herdr_hooks와 herdr:<agent> 읽기), hided/src/supervisor.rs와 hided/src/lib.rs (재시작 신호 이름).
  • 결정: ImportAction::Move는 제거하지 않고 항상 거부합니다. 가져오기 시험이 act("move")의 거부를 그대로 확인하기 때문입니다.
  • 결정: 재시작 신호는 ImportRestart(import_restart)로 이름만 바꿨습니다. 가져오기 뒤 코어 역할을 다시 시작하는 데 여전히 필요합니다.
  • 가져오기 시험 변경(운영자 승인 범위): device.rs의 기기 가져오기 시험 도우미 device()에서 움직임 입력을 뺐습니다. 시험 a_device_save_hide_never_used_is_only_offered는 a_device_save_is_only_offered_until_asked로 이름을 바꾸고 가져오기 기준으로 다시 썼습니다. hided의 a_save_hide_never_used_is_offered... 시험은 움직임 시작 줄을 뺐습니다. 나머지 가져오기 시험은 한 줄도 고치지 않았습니다.
  • 지운 시험(움직임): core runtime a_running_hide_herdr_is_asked..., a_herdr_that_could_not_be_stopped..., a_device_s_save_is_offered_under_its_name...; core a_commit_stands...(옛 기록 읽기 시험으로 대체); device a_device_whose_hide_herdr..., a_device_move_stops..., a_device_herdr_that_would_not_stop..., a_device_herdr_started_again...; hided a_device_s_asked_move..., hide_s_own_stopped_session_moves..., an_update_that_fails_after_the_move...; host herdr_save 정지 시험과 스탠드인 도우미; host kit 기기 Herdr 사본 시험과 도우미; kit tests/herdr_cases.rs 파일 전체; agent-hooks 통합 시험.
  • 남긴 가져오기 시험(한 줄도 안 고침): core runtime a_save_no_hide_herdr_runs..., an_unreadable_save_shows_why..., a_move_s_left_out..., a_core_without_its_own_engine..., waiting_conversations..., a_cut_agent...; host importable.rs 전체; hided a_herdr_started_again..., an_unreadable_save_is_shown_with_why.
  • 옛 기록 읽기 시험(새로 추가): core an_earlier_records_commit_mark_and_not_stopped_result_still_read, kit a_record_with_an_earlier_builds_herdr_hooks_still_loads, forgetting_an_earlier_herdr_piece_keeps_the_others.
  • 프로토콜: PROTOCOL_VERSION 94 -> 95, Call::HerdrStop 제거.
  • 웹: 이동 질문 창, "n개 옮기지 않음" 줄, 이동 문구와 move kind 제거. 가져오기 줄은 import kind만 씁니다. contracts/snapshot-wire-enums.json은 이 kind를 고정하지 않아 바뀌지 않았습니다.

Evidence

  • 확인한 것 (이 PR의 마지막 두 커밋 기준): cargo check --tests로 hided, hide-core 통과. 필터된 nextest: hide-core 396건(herdr·device·import), hided 50, hide-kit 121, hide-host 33, hide-node-link 11, hide-agent-hooks 106 전부 통과. fmt-check 통과. 웹 typecheck, lint, HerdrImport.test.tsx 6/6 통과.
  • 캡처: 사이드바 줄과 설정 줄은 격리 후보 앱(빈 HIDE_STATE_DIR, Herdr 픽스처, 가짜가 아닌 실행 중 hided)에서 찍었습니다. 첫 실행 가져오기 카드는 후보 앱에서 재현하지 못해 gallery 장면 캡처이며, 운영자가 장면 캡처를 증거로 받아들이기로 했습니다.
  • 확인하지 못한 것: 전체 nextest와 전체 web vitest, 이 PR의 CI 전체 lane(main의 read-across-restart 시험은 known flaky Run project Tasks as a DAG through a local Software Factory (stage 1: engine and hide factory) #682), 실제 Herdr 세션을 쓴 가져오기 흐름, 첫 실행 카드의 후보 앱 캡처.

@yansfil yansfil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL - round 1, reviewed commit b1d9f55.

Two ordinary findings block this review under docs/CODE_REVIEW.md. No serious runtime defect was established by this source-only review.

  1. Ordinary - restore active contracts deleted with the transition documentation. At docs/agent-hooks.md:1068-1071, the replacement of the Herdr integration section also deletes the complete "Which agents ask for a review", "Retired agents", and "Codex trusts Hide's own hooks" sections. These still describe active code, including exact hook trust selection, preserving an operator-disabled hook, child-process deadlines/cleanup, failure reporting, and retirement ownership. INSTALL.md:385 and ARCHITECTURE.md:4277 still link to the deleted sections. ARCHITECTURE.md:2419 also loses the adjacent resting-agent restore, adopt_resting/start_unshown, transition-letter, and device hook-file boundaries, which remain implemented. Restore those active contracts, removing only Herdr move-specific statements. Finish updating the active references: ARCHITECTURE.md:4277-4278 still claims the kit trusts recorded Herdr entries and removes Herdr integration, and README.md:109 still assigns ownership to the deleted src/herdr_integration.rs.

  2. Ordinary - retain the import coverage contained in the deleted device tests. The removed a_device_s_save_is_offered_under_its_name_and_goes_with_its_link (hide-core/src/runtime/tests/herdr_import.rs, deletion after the current line 202) also covered the kept per-device snapshot, local/device action isolation, and offer removal/refusal after disconnect. The removed a_device_s_asked_move_is_made_at_the_next_start_with_the_save_its_node_read (hided/src/herdr_transition.rs, deletion before current line 329) was the regression for the still-live devices_before_core path: consume the cached remote save before a link exists, preserve the device registration scope, remove the cached save, and make a second startup idempotent without consuming the local offer. No replacement tests exercise those boundaries. Deleting Move/stop assertions is authorized, but these functions also guarded behavior that stays. Preserve that coverage as explicit Import cases without restoring the move. The removed device UI test likewise leaves no device case in HerdrImport.test.tsx; retain an Import case for the device label and action target.

Minor findings:

  • hide-core/src/herdr_import/device.rs:68 and runtime/own_devices.rs:114-116 retain a (Seen, bool) interface whose second member is now always false and discarded. The device test helper also retains ignored move-only arguments. Remove the obsolete plumbing under engineering principles 1 and 2.
  • hided/src/supervisor.rs:143-150: the notification restarts the core for an import, not Herdr. import_restart / ImportRestart would describe its owner and purpose more accurately than herdr_restart / HerdrRestart. This is a naming issue, not a broken import; the intentionally kept herdr_import* fields need no rename.
  • hide-node-link/src/panes.rs:16 still instructs a refused caller to "move Herdr from Hide's window". That UI action is removed. Keep the existing refusal code/constant identity but update the advice to the retained import flow.

Checks and review perspectives:

  • Correctness: followed Place/fetch -> local and device Machine -> Take::Import -> persisted request/cached save -> startup conversion/adoption, including Record, Held, look, given_back, the hide import herdr CLI and pane_auth holds. No missing required import symbol or remaining active server-stop branch found. The converter and onboarding/sidebar/Settings entry points survive.
  • Backward reads: sampled an_earlier_records_commit_mark_and_not_stopped_result_still_read (herdr_import.rs:981), the installed.json legacy-field/piece tests (record.rs:411,434), and the persisted native call-identity reopen/dedup test interrupted_backfill_keeps_old_call_identity_until_completion (usage_ledger/store/tests.rs:375). The latter storage path is unchanged. The committed field remains readable despite deny_unknown_fields, and not_stopped is read as no outcome.
  • Tests: the edits in the three identified import tests remove obsolete move/commit setup or unused state; the retained import/restart/unreadable assertions are appropriate. The deleted mixed device tests are the coverage issue above.
  • Protocol: 94 -> 95 has its history note; HerdrStop is removed from the call enum, dispatcher and execution side. Rust now emits only import/result kinds and TypeScript agrees. This kind is a String in model.rs, not a pinned wire enum: snapshot-wire-enums.json and wire_enum_tests have no corresponding entry, so leaving those unchanged is consistent.
  • Fragmentation and module boundaries: kept import reads still share their existing host/converter owners; no parallel import implementation was added. The missing owning documentation is finding 1.
  • Ownership and limits: the deletion removes stop/cleanup ownership rather than adding new children, timers or growing queues. The existing bounded fetch and import worker paths remain. No measured performance or native behavior claim is made.
  • INSTALL documents the three accepted losses for a v1.1.1-or-older update. The support cells were revised without claiming an unverified platform is proven; the separate paused core-move rows remain. UI_BEHAVIOR and the main import description match the intended removal.
  • The PR body follows Summary / Review / Evidence and currently includes the required explicit screenshot-absence line. Candidate captures are pending and are not a finding by themselves.

Engineering principle 1 requires deleting the obsolete move while retaining required read/import paths; principle 12 requires tests to preserve observable kept behavior. The two ordinary findings concern those retained contracts.

No files changed. No builds, cargo, tests, app/pane/daemon interaction, or runtime import were performed. The author's reported test results were not independently rerun; CI and candidate/native captures are separate evidence.

@yansfil
yansfil marked this pull request as ready for review November 10, 2026 11:12
…move goes

Restore the resting-agent and device-resume paragraphs and the agent-hook
sections the move cleanup dropped, and re-express the device import tests
as import tests. Rename the restart signal to import and point the recovery
hint at the import path.

@yansfil yansfil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL - round 2, reviewed only b1d9f55..e903059.

Ordinary, module boundaries / documentation ownership - round-1 finding 1 is partly fixed.
The active sections are restored at docs/agent-hooks.md:1072,1080,1092, and the restore/transition-letter/device boundaries are restored at docs/ARCHITECTURE.md:2421-2429. README.md:109 no longer points to the deleted herdr_integration.rs. However, ARCHITECTURE.md:4287 still says the kit trusts entries recorded by the old Herdr integration, and :4288 still says agent_kit::apply removes that integration. Those two round-1 statements remain unchanged and contradict both the implemented deletion and the restored agent-hooks.md:1067-1070. Remove the Herdr targets/removal clauses while retaining the active Hide-hook trust contract. The documentation finding remains open until those owning-guide statements agree.

Prior-finding closure:

  • Round-1 finding 2, device import coverage: fixed in source. runtime/tests/herdr_import.rs:207 restores the per-device snapshot, local/device action isolation, in-flight state, retirement and refusal checks using Import. hided/src/herdr_transition.rs:359 restores cached-save startup import, device registration scope, consumed save, repeated startup and the unaffected local offer. web/src/HerdrImport.test.tsx:112 checks the device label and both Import action targets. herdr_import/device.rs:234 additionally checks saved machine identity, resume request and restart notification without an automatic repeat on look. These assert retained behavior, consistent with engineering principle 12; no test was executed in this review.
  • Obsolete bool/helper inputs: fixed. herdr_import/device.rs:68 returns Seen; runtime/own_devices.rs:114 consumes it directly; device.rs:203 removes the ignored move-only inputs and unused returned node. This satisfies engineering principles 1 and 2 without reintroducing a move.
  • Restart signal naming: fixed. hided/src/lib.rs:165,666-696 and supervisor.rs:143-150,187 consistently use import_restart / ImportRestart.
  • Recovery advice: fixed. hide-node-link/src/panes.rs:16 now directs the caller to import the session, preserving the existing refusal identity.

Screenshots judgment: the PR body explicitly identifies all three images as gallery scenes from an isolated dev server and says no running candidate app was captured. That is acceptable as clearly labelled component/synthetic-state illustration for the PR screenshot requirement. It is not sufficient to close this node's c3, which explicitly requires the onboarding card, sidebar row and Settings line in an isolated running candidate app. DESIGN_WORKFLOW.md:40-41 distinguishes those evidence classes. Keep candidate-app verification pending until that observation exists, or until the decision owner explicitly changes the acceptance criterion. These images do not prove real startup, daemon state projection or the retained import flow. I did not independently inspect the image pixels.

Minor: the PR body's Review section still describes herdr_restart / HerdrRestart and ignored helper inputs, although this commit removes both. Update that description to match the reviewed candidate.

All six CODE_REVIEW perspectives were considered for this delta: correctness, fragmentation, simplicity, module boundaries, ownership/limits and tests. No new runtime defect, duplicate import implementation, resource owner or growing resource is introduced by the delta; the new runtime ingestion helper is test-only. The remaining ordinary finding is the previously identified contradictory owning documentation.

HEAD and PR head matched e903059. git diff --check passed for this delta. No files changed, builds, cargo, tests, agents, app/pane/daemon interaction or native verification were performed. The round-1 conclusions on unchanged code were not re-reviewed.

@yansfil yansfil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS - round 3 (final), reviewed commit 2a8aa17.

Reviewed only e903059..2a8aa17: two documentation sentences in docs/ARCHITECTURE.md.

The remaining ordinary finding is fixed at ARCHITECTURE.md:4287-4288. The guide now says the pass trusts Hide's own hook entries and that agent_kit::apply installs the agents' pieces. The obsolete claims about trusting and removing an earlier Herdr integration are gone, while the active hook trust contract and its owning reference remain. This closes round-1 finding 1; the device-import coverage finding and the minor source findings were closed in round 2.

All six CODE_REVIEW perspectives were considered for this delta: correctness, fragmentation, simplicity, module boundaries, ownership/limits and tests. The change makes the owning guide agree with the previously reviewed implementation and adds no runtime behavior or test changes. No remaining serious or ordinary code/test/documentation findings.

This is a source-review PASS. Candidate-app captures remain a separate c3 verification obligation; this review does not promote the gallery images to running-app evidence or close c3. CI and runtime/native verification are not established by this verdict.

Local HEAD and PR head matched the reviewed commit; git diff --check passed. No files changed, builds, cargo, tests, agents, or app/pane/daemon interaction were performed. Unchanged code was not re-reviewed.

@yansfil
yansfil added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 198e007 Nov 10, 2026
51 checks passed
@yansfil
yansfil deleted the refactor/remove-update-move branch November 10, 2026 12:38
HyunjunJeon pushed a commit to HyunjunJeon/hide that referenced this pull request Nov 12, 2026
…cket variables (with-hide#2397)

Related: mission-48 (Herdr leftovers, stage 3); follows with-hide#2379 and with-hide#2387.

## Summary

Hide no longer runs Herdr, but the core, platform and adapter code still
named Herdr in identifiers, test fixtures, comments and log names.
This renames those to the import's names or neutral names, rewrites
comments so they say what the engine does, and removes the environment
variables nothing reads any more (`HERDR_SOCKET_PATH`, `HERDR_SESSION`).
The rule that keeps the operator's Herdr pane identity out of a Hide
pane is now one constant and one helper.
Behaviour does not change: the read-only Herdr import keeps its names,
its files and its attribution.

No screenshot: no screen changes.

## Review

- **Decide**: the PRD slugs (`engine-bundle-4-herdr-removal`,
`grid-ahead-of-herdr`) stay in comments because renaming them would
break links to local PRD files.
- **Risky files**: `hide-platform/src/process.rs` - the new
`FOREIGN_PANE_IDENTITY` rule is used by the holder, desk, node and core
copies.
- **Risky files**: `hide-node/src/ssh/openssh.rs` - the ssh command
keeps its own case-sensitive comparison, so a lowercase `herdr_*`
variable is still passed on, as before; a test pins it. Desk and holder
already matched case-insensitively.
- **Risky files**: `hide-core/src/environment.rs` - the
`HERDR_SOCKET_PATH` registry row goes; the status list is now three
rows.
- **Cost**: none; no hot path changed.
- **Questions**: none.

## Tests

- **Layer**: unit, the existing crate suites (no new layer).
- **Catches**:
`the_foreign_pane_identity_is_the_herdr_prefix_whatever_the_case` fails
if the prefix or its case rule changes in hide-platform.
- **Repeat**: not repeated; the changed tests are renames with the same
assertions, and the one new test is a pure function check with no
timing, so each ran once in `verify` on 6c83a76.
- **Waits**: none added.

## Evidence

- **Verified**: `verify` is green on 6c83a76, including the e2e lanes.
- **Verified**: `scripts/verify-cargo.sh fmt-check` passes.
- **Verified**: filtered nextest runs, all green: hide-core 277 tests
(ids, environment, session navigation, remote settings, device kit, node
issues, gone worktrees, spent bells, import, machine profiles, moved
workspace); hide-platform 30 (host, foreign pane identity, login child);
hide-holder 1; hide-desk 4; hide-node 113; hide-kit 29.
- **Not verified**: the full workspace suite locally; only the filtered
crate tests above were run, and CI covers the rest.
- **Not verified**: `docs/INSTALL.md` support rows still name the move;
that belongs to the transition-removal node.
- **Not verified**: assertion and panic messages in hide-core tests
still say "Herdr" (about 70 lines); they are expectations, not comments
or names.
- **Not verified**: plugin JavaScript comments in `hide-agent-hooks`
(`opencode/tui.js`, `opencode/plugin.js`, `pi_extension/extension.js`)
still say Herdr; they are hashed into the installed plugin, so changing
them needs a version bump.
- **Not verified**: `AGENTS.md` still links "Drawn ahead of Herdr" and
has a "Herdr Source" section; the web-and-scripts node owns it.
- **Not verified**: `hided/src/herdr_transition.rs` log component names
are unchanged; the transition-removal node owns that file.
- **Not verified**: `ARCHITECTURE.md` heading "The core, the shell and
Herdr" is unchanged, because other docs link to its anchor.
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