Skip to content

P3-10: publish the current page to herdr's sidebar - #130

Merged
dvzrd merged 3 commits into
mainfrom
feat/p3-10-herdr-metadata
Oct 4, 2026
Merged

dvzrd merged 3 commits into
mainfrom
feat/p3-10-herdr-metadata

Conversation

@dvzrd

@dvzrd dvzrd commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Inside a herdr pane with its own HERDR_PANE_ID, wiki-reader publishes the page being read to herdr's sidebar as display-only pane metadata, on by default ([herdr] publish = false to opt out, as decided).

  • A Publisher worker thread in crates/wiki-reader/src/herdr.rs runs herdr pane report-metadata with a title and a page token. No socket client, no new dependency.
  • Debounced 250 ms; TTL 10 minutes renewed every 4; cleared on exit. --seq is Unix time in ms and strictly increasing, so a restarted reader is not ignored as stale.
  • Values pass as --title=… / --token=page=…, control characters stripped, text capped at herdr's 80 characters (long paths keep their tail).
  • Never reports agent state. A missing binary or failing call never touches navigation; it stops after three failures in a row. Plugin popups (no pane id) never publish.
  • The publisher is created only by run, so tests running inside herdr cannot publish to a real pane. App::sync_herdr hands over page changes from the event loop.
  • ADR-0022 records this together with the ordinary-pane launcher.

#128 and #129 are merged; this branch is a single commit on top of main.

Verification

  • scripts/check.sh passed.
  • Unit tests: exact argv, burst collapse, unchanged page not resent, renewal with increasing seq, clear on drop (not when nothing was published), failure isolation without blocking exit, target-pane rules, text cleaning; config parsing; an app-level test that page changes reach the publisher once with the right title and relative path.
  • Not yet verified in a real herdr: what the sidebar shows for the title versus the token, clear on exit, TTL expiry, and behaviour in a pane that hosts an agent. Needs the operator pass; no release.

🤖 Generated with Claude Code

Base automatically changed from feat/p3-09-herdr-popup to main October 4, 2026 02:48
Inside a herdr pane with its own HERDR_PANE_ID, a worker thread sends the page
title and a `page` token with `herdr pane report-metadata`:

- debounced (250 ms), 10 min TTL renewed every 4 min, cleared on exit;
- --seq is Unix time in ms, strictly increasing, so a restarted reader is not
  ignored as stale;
- values pass as --name=value (a title starting with `-` is safe), control
  characters stripped, text capped at herdr's 80 characters;
- never reports agent state; a missing binary or failing call never touches
  navigation and stops after three failures in a row;
- plugin popups (no pane id) and tests never publish: the publisher is only
  created by `run`.

`[herdr] publish` (default true) turns it off. ADR-0022 records this and the
ordinary-pane launcher. Docs, roadmap and dogfood log updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dvzrd
dvzrd force-pushed the feat/p3-10-herdr-metadata branch from 8b803f8 to 12fb14a Compare October 4, 2026 02:50
dvzrd and others added 2 commits October 3, 2026 20:03
herdr's CLI rejects `--title=value` ("unknown option"), so every report from
the first operator run failed and the publisher went quiet after three
failures. Pass `--title T --token page=P` as separate arguments; herdr accepts
a value that starts with `-` that way.

The fake herdr in the unit tests could not catch this, so add an opt-in test
against the real CLI (WIKI_READER_TEST_HERDR_PANE=<idle pane>, --ignored):
publish, read back with `pane get`, clear on drop. A unit test also asserts no
argument uses the `--name=value` form.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dvzrd
dvzrd marked this pull request as ready for review October 4, 2026 03:12
@dvzrd
dvzrd merged commit 7f6aa58 into main Oct 4, 2026
4 checks passed
@dvzrd
dvzrd deleted the feat/p3-10-herdr-metadata branch October 4, 2026 03:14
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