Skip to content

feat: move a Herdr session into Hide's own engine behind the switch - #2049

Merged
yansfil merged 42 commits into
mainfrom
feat/engine-b4-transition
Nov 4, 2026
Merged

yansfil merged 42 commits into
mainfrom
feat/engine-b4-transition

Conversation

@yansfil

@yansfil yansfil commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Related: #2017 (two-engine gate, merged)

Summary

On a machine that switches to Hide's own engine (still behind the development switch HIDE_DEV_PANE_HOLDER=1), Hide's Herdr session moves over: the same tabs, layout and ids, and the agents reopen their conversations.
While Hide's Herdr runs, Hide asks first; "Later" leaves a sidebar row, and a Herdr Hide never used can be imported read only from the row, Settings, the first run or hide import herdr.
A dialed device asks the same question under its name, and its node reads its save and stops Hide's Herdr there with the code this machine uses.
An agent whose turn the move or a reboot cut off gets one letter after it resumes; a resting agent gets none.
Pi, omp, OpenCode and Grok report their first session when the shell starts or the session switches, so letters reach them before their first turn.
The Herdr path is unchanged.

Hide의 Herdr가 돌 때 옮기기 전에 묻는 창 (갤러리 import-ask, ko, dark)

Review

  • 판단해 주세요: Hide's Herdr is stopped through its socket's server.stop (D-6 named the program's herdr server stop): the same API, it still works after an update removed the program (B42), and the end is confirmed by pid and start time, falling back to the system's end; a device's node stops its Herdr with the same code.
  • 판단해 주세요: a workspace left out shows the converter's English reason (its tab 2 does not lay out exactly the panes it holds) in every language.
  • 판단해 주세요: the cut-off letter is English like Hide's other notes, not the PRD's Korean wording.
  • 조심해서 볼 파일: herdr-core/src/herdr_import.rs - the record that holds not-yet-moved panes' Hide state, the commit mark, waiting resumes.
  • 조심해서 볼 파일: hided/src/herdr_transition.rs - which Herdr is Hide's (peer pid, start time, program), stop and its fallback, the core-role restart.
  • 조심해서 볼 파일: herdr-core/src/herdr_import/device.rs, hide-host/src/herdr_save.rs - a device's move: the node reads and stops (Call::HerdrSave, Call::HerdrStop, refused unless the server is still the one found), the save it read is kept in the device's engine folder, and the next start imports it before any link is up.
  • 판단해 주세요: node protocol goes to 74 for the two calls; main is 71, the gate 73, and no other open pull request uses 74 (checked 2026-11-04; check again before the merge, since git does not flag two branches choosing the same number).
  • 판단해 주세요: docs/INSTALL.md gains a support row for the move, unverified on all three systems until the new-engine journey moves a live Herdr; a Windows device runs no node, as the dialed device row already says.
  • 판단해 주세요: a conversation an import gave back whose pane runs another command (or on Windows, which does not say) now resumes in a new tab of the same workspace named for the agent, as D-8 says; it waits again only when that tab cannot open.
  • 조심해서 볼 파일: hided/src/core_update.rs - after a commit, a failed core update does not start the previous build and keeps current at the new one, so a retry starts it again (B40).
  • 조심해서 볼 파일: herdr-core/src/engine/own/restore.rs - reads hook files on the restore thread, gives waiting conversations back to their panes.
  • 조심해서 볼 파일: hided/src/pane_auth.rs - refuses hide from a Herdr pane not moved yet (pane_not_moved) before the checkout fallback.
  • 판단해 주세요: on Windows, where the system names no process's program, Hide's Herdr is the one running from a Hide runtime copy's herdr.exe or a pinned device copy, matched by file identity; a Herdr Hide started from a copy that was renamed reads as someone else's and is only offered read only (the docs/INSTALL.md cell says so).
  • 조심해서 볼 파일: herdr-core/src/herdr_import.rs - every change to the import record takes one lock in the record's owner, so the core, the start and a device's move never overwrite each other; the move is marked done (commit) only before a step that cannot be undone, never for a read-only import.
  • 조심해서 볼 파일: hided/src/herdr_transition.rs - an asked move reopens conversations only if Hide's Herdr is still stopped at the next start; one started again keeps them waiting and logs why; the move reads the Herdr socket a shell named while the own engine is on.
  • 판단해 주세요: 정책 검사 목록 변경과 이유: scripts/check-core-touches-no-machine.py now lists herdr-core/src/herdr_import.rs among the core's own stores (10 touches): the import record beside the engine's saved layout (D-25), the save a device's node read, kept there until the next start imports it, and the delivery ledger whose registrations the move hands over before the core runs. The module stays after Herdr goes (the PRD names it among the three remaining pieces), so it is a store and not a later layer. The core now names the save's wire types and read cap from hide_node_link::herdr_save instead of node code.
  • 비용 검토: no high-frequency path; the look runs on its own thread per ask, the letter tick is one emptiness test when nothing is owed (cap 128, 10 min).

Evidence

  • 확인한 것: on 2b75d26 (before the policy fix, which moved one constant and the core's import paths), the full scripts/verify-cargo.sh lint and scripts/verify-cargo.sh test --no-fail-fast: 7528 passed, 0 failed, 170 ignored.
  • 확인한 것: among them, a stand-in Herdr stopped through its socket and through the system, and a pid another process took left alone (B3, B42); Hide's Herdr known by its runtime copy file (the Windows rule, run here on macOS); the import record changed from 16 threads at once with nothing lost; a restarted Herdr keeping conversations waiting; the new-tab resume (B15); the update that keeps the new build after a commit and starts it on retry (B40); a device's move at the next start through a stand-in node; Grok's session start report.
  • 확인한 것: web typecheck, lint and tests on 2be4bb3 (HerdrImport, FirstRunWizard, onboarding gallery, i18n, the device question under its name); no web source changed since.
  • 확인한 것: the onboarding gallery's import-* states render, import-device among them.
  • 확인하지 못한 것: no live Herdr has moved: the device move is tested to the link stand-in level, and the real-device journey belongs to the release verification. Pi, omp and OpenCode's first-session report is proved by CI's web e2e on this pull request. Cursor is retired from support, so it reports nothing.
Verification record

Read Herdr's session.json in every form Herdr v0.9.5 reads, keep Herdr's
public workspace, tab and pane ids, map the split directions, and leave out
only a workspace that does not hold together, with its reason. Fixtures are
sessions Herdr 0.9.5, 0.9.1 and 0.8.2 wrote.
On the core's own engine nothing but Hide's integration names a pane's
session. Grok's and Cursor's session start hook now reports the session its
input names, and Pi's, omp's and OpenCode's scripts ask the helper's new
session operation at a session start or switch, so letters and the inbox
reach the agent before its first turn. The Pi, omp and OpenCode plugin e2e
specs run on both engines.
One record per machine's engine folder holds the Herdr save's workspaces
not moved yet, those moved, the conversations waiting to resume, the move
asked for, the commit mark and the last outcome. The local cleanup leaves
the state of the workspaces not moved alone, and only drops what the engine
made itself while the save cannot be read.
The save stamp is a u64 so the internally tagged record reads back; the
engine test expects its new workspace numbered apart from gathered Herdr
ones; the Pi, omp and OpenCode tests and pinned bytes follow the session
report, and the record hands a moved pane's Herdr terminal to its pane id.
The core looks at a device's Herdr save through its node before the device's
engine opens, offers it under the device's id, and stops Hide's Herdr there
through the node. A move is committed with the save the node read kept in the
device's engine folder, and the core's next start imports it before any link
is up, keeping the device id as its registrations' scope.
The stop's wait is passed in so a test ends a real child of the test binary in
under a second, and a server that ended between the look and the system's end
reads as gone rather than refused.
…busy

A conversation an import gave back once its Herdr stopped used to wait for the
next import when its pane ran another command. It now resumes in a new tab of
the same workspace after the restore, and waits again only when that tab cannot
open.
… back

After this machine's Herdr session moved, a failed core update already refused
to start the previous build; it now also points current at the new build, so a
retry starts that build again. The update's starter is passed in so both ends
are tested without the account's login item.
A look, a move and the engine's restore changed the record from their own
threads under two separate locks, and the restore under none, so one could
write over a waiting conversation another had added. Every change now reads,
changes and writes the record under one lock in herdr_import.
… stopped

The move reads Hide's Herdr on the socket HERDR_SOCKET_PATH names, where its
registrations were made. A start whose asked resume finds a Herdr on the
socket again imports its conversations waiting, and a device's resume follows
the save read after its stop. A read-only import of a save Hide never used
commits nothing, so a failed update may still go back, and a place that cannot
be read is logged.
Windows names no process's program file, so Hide's Herdr there read as
another's and was never moved or stopped. The server now counts as Hide's when
it runs one of Hide's Herdr files where they are. A save whose last change
cannot be read is unreadable rather than stamped as never changed.
Base automatically changed from feat/engine-two-engine-gate to main November 3, 2026 23:44
@yansfil
yansfil marked this pull request as ready for review November 3, 2026 23:57
…ine in the Pi and omp stand-in

A core on Herdr also holds an engine handle, so the takeover is left out
only when that handle is the core's own engine. The Pi and omp stand-in
reads the pane from HIDE_PANE_ID, which a pane on the own engine carries,
and asks Herdr only when the fixture runs it.
@yansfil
yansfil merged commit 5a628a9 into main Nov 4, 2026
51 checks passed
@yansfil
yansfil deleted the feat/engine-b4-transition branch November 4, 2026 03:50
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