Skip to content

Herdr: Test Herdr in CI and Return the Revision From Pane Read - #320

Merged
Unique-Divine merged 3 commits into
mainfrom
ud/1450-herdr-ci
Dec 4, 2026
Merged

Unique-Divine merged 3 commits into
mainfrom
ud/1450-herdr-ci

Conversation

@Unique-Divine

@Unique-Divine Unique-Divine commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Runs Herdr's unit and CLI tests in dotfiles CI when anything under herdr/ changes, and makes pane read return the pane's content revision like agent read does since dotfiles PR 318.

Rationale

  • Only protocol_schema ran in CI, so PR 318's CLI checks ran once, by hand, before merge.
  • pane read still returned revision: 0, so a caller reading through pane read could not use the revision for a guarded agent send-keys.

Key Changes

  • .github/filters.yml: new herdr_test component for herdr/**. Docs and tests under herdr/ now select it; the release build (herdr_native) keeps its narrower inputs.
  • .github/workflows/ci.yml: new herdr-test job on ubuntu-24.04 with the native build's Rust 1.96.1, Zig 0.16.0 and Rust cache setup. It runs the --bin herdr unit tests with cargo nextest run --locked --bin herdr and the CLI tests with cargo test --locked --test cli. Manual dispatch selects it; tag pushes do not. The CI result gate requires it when selected.
    • Unit tests use nextest, Herdr's own runner (herdr/justfile). Under cargo test, platform::remote_bridge_tests closes a pipe and SIGPIPE kills the whole test binary; nextest runs each test in its own process.
    • The job skips client::shell::tests::copy::navigator_owns_search_mouse_selection_and_stable_target_focus, which also fails on main (panicked at src/client/shell/tests/copy.rs:1796:10: pane row). It needs its own fix.
  • ci-routing.test.ts: routing cases, decision outputs and the job/selector map cover herdr_test.
  • herdr/src/app/api/panes.rs: pane read reads content_seq() before the snapshot, as agent read does, and returns it.
  • herdr/src/cli/pane.rs, herdr/src/cli/spec.rs: pane read --json prints the full reply with the revision.
  • herdr/CHANGELOG.md: one Unreleased line.

Tests

  • cargo test --locked --bin herdr -- pane_read: test app::api::panes::tests::api_pane_read_returns_the_content_revision ... ok, test result: ok. 7 passed. The new test reads, feeds the pane output, reads again, and checks the revision rose and matches content_seq().
  • cargo test --locked --test cli -- agent_commands_work pane_read: test cases::agents::agent_commands_work ... ok, test result: ok. 2 passed. agent_commands_work now also checks pane read --json reports a non-zero revision.
  • bun test ci-routing.test.ts: 55 pass, 0 fail.
  • CI Herdr tests job: pass in 4m33s. Unit: Summary [ 17.454s] 3540 tests run: 3540 passed, 15 skipped. CLI: test result: ok. 114 passed; 0 failed.
  • bunx github-actionlint .github/workflows/*.yml: no findings.

Dogfood

On googlebox, a debug build (target/debug/herdr) as a separate headless server, herdr --session lab1450 server, with XDG_CONFIG_HOME, XDG_STATE_HOME, XDG_RUNTIME_DIR and HERDR_CONFIG_PATH under $TMPDIR/l4-1450-herdr. The live Herdr server was not touched.

$ herdr --session lab1450 workspace create --cwd $TMPDIR/l4-1450-herdr   -> w1:p1
$ herdr --session lab1450 pane read w1:p1 --source visible --json        -> revision 18, last line "❯"
$ (same read again)                                                       -> revision 18
$ herdr --session lab1450 pane run w1:p1 "echo lab1450-marker"
$ herdr --session lab1450 pane read w1:p1 --source visible --json        -> revision 46, "lab1450-marker"
$ herdr --session lab1450 pane run w1:p1 "echo second-marker"
$ herdr --session lab1450 pane read w1:p1 --source visible --json        -> revision 76, "second-marker"
$ (same read again)                                                       -> revision 76

The revision holds while the screen is unchanged and rises when it changes. herdr --session lab1450 server stop and session delete lab1450 removed the server, and the scratch folder was deleted.

@Unique-Divine
Unique-Divine merged commit c2ef284 into main Dec 4, 2026
23 checks passed
@Unique-Divine
Unique-Divine deleted the ud/1450-herdr-ci branch December 4, 2026 10:42
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