| Path | Purpose |
|---|---|
lua/herdr-context/init.lua |
Public API, setup, commands, and mappings |
lua/herdr-context/context.lua |
File checks, selections, and paths |
lua/herdr-context/diagnostics.lua |
Diagnostic collection and formatting |
lua/herdr-context/quickfix.lua |
Quickfix and location list collection |
lua/herdr-context/text.lua |
Shared one-line text normalization |
lua/herdr-context/messages.lua |
Message and notification history |
lua/herdr-context/messages/*.lua |
Notification backend adapters |
lua/herdr-context/router.lua |
Agent routing, validation, and picker labels |
lua/herdr-context/adapters.lua |
Agent reference formats |
lua/herdr-context/cli.lua |
Herdr commands and response parsing |
lua/herdr-context/health.lua |
:checkhealth herdr-context |
doc/herdr-context.txt |
Neovim help |
tests/run.lua |
Deterministic behavior tests |
tests/smoke.lua |
Command, failure, and health tests |
tests/visual.lua |
Visual-mode mapping test |
tests/compat/*.lua |
Notification plugin compatibility tests |
tests/fixtures/herdr |
Fixture Herdr executable |
scripts/release.py |
Release automation |
See Behavior and routing for user-visible rules.
context.luacollects file input throughdiagnostics.luaorquickfix.luawhen needed.messages.luacollects message and notification input.cli.lualists agents.router.luaselects candidates.vim.ui.selecthandles multiple candidates.adapters.luaformats file context.cli.luaplaces the text.cli.luafocuses the agent.
An error stops the flow. Placement must succeed before focus starts. cli.lua validates every Herdr
response before another module uses it.
Each module in messages/ reads one notification backend. Its collect() function returns records
with message, level, and title. An unavailable or failing backend returns no records.
| Command | Purpose |
|---|---|
just format |
Format Lua |
just format-check |
Check Lua formatting |
just test |
Run deterministic tests |
just smoke |
Run fixture-backed scenarios |
just verify |
Run formatting, tests, and smoke scenarios |
just install-test-plugins [mode] |
Install notification plugins |
just compat [mode] |
Run notification compatibility tests |
just update-test-plugin-pins |
Update compatibility pins |
Compatibility mode is pinned by default. Use latest to test current plugin branches:
just compat latestCompatibility tests need network access, so just verify does not run them. Set NVIM to test
another Neovim binary:
NVIM=/path/to/nvim just verifytests/minimal_init.lua loads the working tree with --noplugin. tests/harness.lua makes Neovim
exit with a failure status when a test fails.
| Suite | Use |
|---|---|
tests/run.lua |
Data, callbacks, formatting, routing, and public API behavior |
tests/smoke.lua |
vim.system, commands, failures, and health output |
tests/visual.lua |
Neovim modes and mappings |
tests/compat/ |
External notification APIs |
Test observable results such as command order, sent text, notifications, and selected targets. Do not test source text or private helper names.
Each compatibility test loads one real backend:
| Test | Backend |
|---|---|
nvim_notify.lua |
nvim-notify |
mini_notify.lua |
mini.notify |
snacks_notifier.lua |
Snacks.notifier |
noice.lua |
noice.nvim |
send.lua |
Full send path with mini.notify |
Pinned versions keep pull requests reproducible. The daily latest run detects upstream changes.
Noice uses an internal API, so run just compat latest after changing its adapter.
Update pins only after all adapters pass:
just compat latest
just update-test-plugin-pinsRun the working tree from a Herdr pane:
nvim \
--cmd "set runtimepath^=$PWD" \
--cmd "lua require('herdr-context').setup({ mappings = { buffer = 'gs' } })"- Run
:checkhealth herdr-context. - Send a saved file with
gs. - Check that the agent receives a relative file reference.
- Send complete lines in Visual-line mode.
- Check that the agent receives an inclusive range.
- Send part of a line in characterwise Visual mode.
- Check that the agent receives the range and exact fenced text.
- Leave the inserted text unsubmitted.
With several agents, check the picker and cancel once to confirm that cancellation sends nothing.
An agent adapter formats references. It does not route agents or run Herdr commands.
- Add the formatter to
lua/herdr-context/adapters.lua. - Register the exact Herdr agent kind.
- Add whole-file and range tests to
tests/run.lua. - Test partial selections if the syntax differs.
- Update
README.md,docs/behavior.md, anddoc/herdr-context.txt. - Run
just verify.
Keep the surrounding spaces unless the agent requires another format. Keep selected text after the reference.
.github/workflows/ci.yml checks formatting, tests, smoke scenarios, and pinned compatibility on
Neovim 0.10.4 and stable.
.github/workflows/compat-latest.yml tests current notification plugin branches each day. A failure
opens or updates an issue with the plugin-drift label. This workflow does not gate pull requests or
change pins.
Both workflows use the fixture Herdr executable.
Add user-visible changes under ## [Unreleased] in CHANGELOG.md. From a clean main branch, run:
just release <version>Use MAJOR.MINOR.PATCH. The command:
- Checks the branch, working tree, version, tag, and changelog.
- Adds the dated changelog section.
- Runs
just verify. - Creates the release commit and
v<version>tag. - Prints push and undo commands.
Push after review:
git push origin main && git push origin v<version>Use just release <version> --push to push from the release command.
The tag starts .github/workflows/release.yml. It validates the changelog, runs checks on Neovim
0.10.4 and stable, and creates the GitHub release.