Skip to content

refactor: rename the Herdr leftovers in the core and drop the dead socket variables - #2397

Merged
yansfil merged 6 commits into
mainfrom
refactor/core-herdr-names
Nov 10, 2026
Merged

yansfil merged 6 commits into
mainfrom
refactor/core-herdr-names

Conversation

@yansfil

@yansfil yansfil commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Related: mission-48 (Herdr leftovers, stage 3); follows #2379 and #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.

… socket variables

HERDR_SOCKET_PATH and HERDR_SESSION were read by no production path once the
import reads Herdr's config folder, so their registry row, the socket helpers
and their tests go. The rule that withholds the operator's Herdr pane identity
from a Hide pane is now one constant and one helper in hide-platform, and the
pane environment, desk process and ssh command call it.
…g names

Numbered::Herdr, HERDR_WORKSPACE, herdr_held and herdr-a style fixture ids
become the import's and neutral names. Stored and wire names are untouched.
Comments that explained the engine by what Herdr did now say what the engine
does; comments that credit Herdr's measured behaviour and the Apache notices
stay.
Comments in the agent adapter, hooks, holder, node and node-link crates say
what Hide and the engine do now. The Drawn ahead of Herdr heading is now
Drawn ahead of the engine, and its links follow. Evidence lines that cite
Herdr's measured behaviour and the derived-from notices stay as they were.

@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.

Round 1: FAIL on 64d0e7f9e0a829ff272d6df083f9e36834c85f7e (source review only).

Blocking findings, graded under docs/CODE_REVIEW.md:

  1. Serious - correctness: preserve the SSH environment's case rule. hide-node/src/ssh/openssh.rs:262 replaces case-sensitive starts_with("HERDR_") with a case-insensitive helper. On macOS/Linux, herdr_proxy_endpoint and HERDR_PROXY_ENDPOINT are different variables. An account's SSH ProxyCommand that consumes the lowercase variable received it before this change and now loses it, potentially preventing connection. The PR acknowledges the change, but the node's contract requires unchanged behaviour. Preserve the previous SSH matching semantics while sharing the prefix, or obtain the decision owner's explicit acceptance of this behaviour change.

  2. Ordinary - module boundaries / contract documentation: remove the deleted API from its owning guide. docs/ARCHITECTURE.md:1914 still advertises herdr_socket_default and says hide-platform/tests/it/host.rs checks that socket contract, although this PR deletes the function and those assertions. Describe the retained herdr_config_dir_from and its config-folder contract instead. This is the same-change cleanup required by engineering principle 1, not the separately owned AGENTS.md heading follow-up.

  3. Ordinary - tests: pin all seven required foreign identity names independently. hide-platform/tests/it/process.rs:3273 covers PANE_ID, SOCKET_PATH, ENV and SESSION, but not HERDR_WORKSPACE_ID, HERDR_TAB_ID or HERDR_BIN_PATH. The current prefix helper withholds all seven, but exempting any of those three in the helper would still pass this test and the changed engine contract's PANE_ID/SOCKET_PATH inputs. Assert the complete seven-name external contract, including the required case policy. Engineering principle 12 requires expectations from the contract rather than relying on the implementation's present prefix shape.

  4. Ordinary - tests: repeated-run evidence is missing. The PR's Tests / Repeat says "not repeated", including for the new test at hide-platform/tests/it/process.rs:3271. docs/CODE_REVIEW.md:58 and docs/TESTING.md:1025 require changed tests x runs and a passing repeat-job link. Supply the current-head evidence, or have the decision owner accept the exception in writing. The author's filtered green runs are useful but do not establish this requirement. No local rerun was attempted because this review explicitly prohibits builds/cargo.

Minor findings and assigned follow-ups:

  • Add the requested No screenshot: <reason> line to Summary. No product screen changed; no screenshot capture is needed.
  • hide-platform/src/process.rs:247-260 accidentally attaches the existing owner-launch metadata documentation to FOREIGN_PANE_IDENTITY, leaving OWNER_LAUNCH_KEYS at line 269 without its original documentation. Keep each comment on its own constant.
  • Some behaviour-by-comparison prose remains: docs/ARCHITECTURE.md:2366 still ends "as Herdr reads it"; hide-core/src/engine/own/agents.rs:310 and layout.rs:215 also retain comparison explanations. These can state the engine rule directly while retaining required provenance.
  • The old "Drawn ahead of Herdr" reference in AGENTS.md:126 and its CLAUDE.md symlink is the known web-and-scripts follow-up. It does not fail this review. The changed owning heading and other repository references were updated.

Checked in the requested order:

  • Numbered::Imported, IMPORTED_WORKSPACE = 'w', import_held and hold_import_state remain internal. Imported IDs, filenames, protocol types, contract JSON and snapshot names were not changed by these renames. The changed diagnostic component/kind and engine_workspace_ids field have no remaining old-name consumer in this repository; external alert configuration was not inspected.
  • Holder, Desk and SSH filtering use the shared helper. The kit already uses restrict_to_login_environment with an explicit allowlist, so it has no independent prefix filter to replace. The platform login-child test observes that stronger boundary. The Windows engine-contract command retains an independent literal expectation.
  • Continuing to withhold HERDR_SOCKET_PATH and HERDR_SESSION is intentional: removing Hide's readers does not make a Hide pane an operator-owned Herdr pane. Descendant programs must not inherit that foreign identity.
  • Deleted socket/session helpers and registry handling have no production caller left. Remaining names occur in isolation guards, stripping tests or history, apart from the stale API documentation above. The import's config-folder reader and its callers remain.
  • Apache headers, definition TOML headers, NOTICE, vendor/portable-pty, hide-vt and hide-screen-rules were preserved. Measured-source sentences remain; INSTALL.md's measured support row changed only its anchor. Import names/files, herdr_kind, i18n keys, the profiles-list event, and the phone tally subtree were left alone.
  • Five renamed test functions were compared against the merge base by syntax: IDs, worktree slug, resize prediction, old stored reason rendering, and opening an imported worktree. Each function is exactly identical after the declared function/local identifier renames; no assertion was weakened. Fixture ID substitutions in session_navigation were also checked for consistent references.
  • Fragmentation and simplicity improve through one production prefix rule; no new dependency, process, resident owner, resource cap, runtime lock scope or notification path is introduced.

No files were edited, no agents started, and no build, cargo, native app, pane or daemon operation was performed. CI was still in progress when the PR was read; this is not a claim that CI or runtime verification passed.

…ch withheld name

The shared foreign pane identity helper is case-insensitive for the pane
environment and the desk, but the ssh command keeps its original
case-sensitive match, so a lowercase herdr_* variable a proxy command reads
still reaches ssh. Each withheld Herdr variable now has its own assertion, and
the operator's architecture notes no longer describe the deleted socket
helpers or compare with Herdr's measured internals.

@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.

Round 2: source review PASS at e1b8915, limited to 64d0e7f..e1b8915. No remaining serious or ordinary code findings in this delta. Final PR evidence remains pending as requested; this does not certify merge readiness.

Previous findings:

  • R1, serious / correctness: fixed. hide-node/src/ssh/openssh.rs:39-40,270 restores the original case-sensitive SSH filtering while reading the shared prefix constant. Lowercase and mixed-case proxy variables remain inherited; the regression test at :625 checks those cases.
  • R2, ordinary / module boundaries and documentation: fixed. docs/ARCHITECTURE.md:1914 documents the retained herdr_config_dir_from import path instead of the deleted socket API. This satisfies engineering principle 1, cleaning obsolete documentation with the removal.
  • R3, ordinary / tests: fixed. hide-platform/tests/it/process.rs:3269-3287 independently names and asserts all seven required variables. The real-child test at :3306-3328 also sets and checks every name. An exemption for any required name now fails an assertion. This satisfies engineering principle 12, taking expected names from the external contract. Withholding HERDR_SOCKET_PATH and HERDR_SESSION remains intentional after their Hide readers were deleted: a Hide child must not inherit the operator's foreign pane identity.
  • R4, ordinary / test evidence: not yet fixed in the current PR body. Per the round-2 request, defer this to the final CI/body check, without blocking this code verdict. The final body still needs changed-tests times runs and a repeat-job link.

Previous minors:

  • The misplaced owner-launch documentation is fixed at hide-platform/src/process.rs:247-263.
  • The remaining comparison prose is fixed at docs/ARCHITECTURE.md:2366, hide-core/src/engine/own/agents.rs:307-311 and hide-core/src/engine/own/layout.rs:212-218. Source attribution headers remain intact.
  • No screenshot: <reason> is still absent; it belongs in the agreed final body update. That update should also replace Review's now-stale statement that SSH uses the case-insensitive helper.
  • The old AGENTS.md/CLAUDE.md heading reference remains the accepted web-and-scripts follow-up.

Minor / documentation: hide-platform/tests/it/process.rs:3279-3282 still says SSH calls the case-insensitive helper. SSH now deliberately reads the constant with its original case-sensitive predicate. Adjust that test comment when convenient.

Across correctness, fragmentation, simplicity, module boundaries, ownership/limits and tests, the new production change restores the original SSH behavior and keeps one prefix owner (engineering principle 5); it adds no resource lifetime, queue, I/O or synchronization change. No stored/wire name is changed in this delta. Protected attribution headers and measured-evidence sentences are untouched.

Verified by source comparison and git diff --check; worktree clean. No builds, cargo, test execution or runtime/app checks were performed. Author-run test results and final repeat evidence remain separate from this source review.

@yansfil
yansfil added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit e9331f9 Nov 10, 2026
83 checks passed
@yansfil
yansfil deleted the refactor/core-herdr-names branch November 10, 2026 17:37
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