amplifier-bundle-a2a
AGENTS.md2 starsChanged 6 months agoMITView on GitHub
Agent-to-agent (A2A) communication for Amplifier. The behavior behaviors/a2a.yaml composes a client tool (tool-a2a) and an HTTP server hook (hooks-a2a-server, default port 8222), plus a /a2a plain-language expert mode (setup, status, connect, troubleshoot). 1. Unit + lint (fast, host). The modules import amplifier_core, so a bare pytest won't collect — run the suite with the deps wired in: uv run --no-project --with amplifier-core --with aiohttp --with zeroconf \ --with pytest --with pytest-asyncio \ --with-editable modules/tool-a2a --with-editable modules/hooks-a2a-server \ pytest -q Then…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
No silent degrade: If mDNS is requested but zeroconf is missing, fail LOUD with a remedy — never skip silently.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — amplifier-bundle-a2a
Agent-to-agent (A2A) communication for Amplifier. The behavior behaviors/a2a.yaml
composes a client tool (tool-a2a) and an HTTP server hook (hooks-a2a-server,
default port 8222), plus a /a2a plain-language expert mode (setup, status, connect,
troubleshoot).
Gates before "done"
Unit + lint (fast, host). The modules import
amplifier_core, so a barepytestwon't collect — run the suite with the deps wired in:uv run --no-project --with amplifier-core --with aiohttp --with zeroconf \ --with pytest --with pytest-asyncio \ --with-editable modules/tool-a2a --with-editable modules/hooks-a2a-server \ pytest -qThen
ruff format,ruff check, andpyrightclean on changed code.- Smoke (DTU) — required when you touch the server hook, the behavior,
module dependencies, startup/config, or the
/a2amode. SeeSMOKE_TESTS.md; run the saved profile and confirm checks A–D.
See foundation:docs/PER_REPO_CONVENTIONS.md for the verification gradient.
Invariants — do not regress
- The server is opt-in.
hooks-a2a-serverstays INERT unless its config hasenabled: true. Never make it start by default — it binds a network port. Gate lives inmodules/hooks-a2a-server/amplifier_module_hooks_a2a_server/__init__.py(mount()). - A side-effecting
mount()MUST return an idempotent cleanup. Amplifier's hook validator callsmount()with your REAL config during session init to check protocol compliance — so anythingmount()does with side effects (binding port 8222, opening a socket) also happens during validation. The validator can only undo that via the cleanup you return (it cannot drain a Rust-backed coordinator'sregister_cleanup-ed functions). ReturnNoneand the probe-mount leaks: the real mount then dies with[Errno 98] address already in use/server_running: false. Somount()returnscleanup(idempotent) in addition tocoordinator.register_cleanup(cleanup). SeeKNOWN_ISSUES.md. - No silent degrade. If mDNS is requested but
zeroconfis missing, fail LOUD with a remedy — never skip silently.zeroconfis a declared dependency of both modules; keep it that way. - Sub-agents don't run the server. The
parent_idguard plus the behavior'sspawn.exclude_hookskeep the server to the root session only. - Identity/contacts are per-user local, not committed — they belong in a
project's gitignored
.amplifier/settings.yaml, never in the bundle.
Pitfalls
- The modules import
amplifier_core, so they won't import standalone. Unit-test the gate logic with a fake coordinator; use the DTU smoke for the real server path. - mDNS advertisement fails inside Incus/DTU containers (hostname→IP resolution) —
that's an environment artifact, not a bug. Verify
zeroconfpresence, not LAN advertisement, in the DTU. - zeroconf must use the ASYNC API.
advertise_mdns/browse_mdnsrun inside the session's event loop; the synchronousZeroconf()/register_service()/ServiceBrowserraisezeroconf.EventLoopBlockedthere — and itsstr()is empty, so it logs as a blankmDNS advertisement failed:. UseAsyncZeroconf/async_register_service/AsyncServiceBrowser. Log caught exceptions with%r(orexc_info=True), never%s— some zeroconf errors stringify to nothing. - Don't fight source overrides to test an unmerged fix. App-scoped behaviors pin
their module sources, so
AMPLIFIER_MODULE_*env vars andsources:insettings.yamldo NOT redirect them to a local checkout (confirmed dead end). To exercise a branch in a real session, commit it and run the DTU smoke — it mirrors your committed branch via Giteaurl_rewrites. A merged fix only reaches an installed CLI afteramplifier bundle update.
Done looks like
Unit + lint green; DTU smoke checks A–D PASS with evidence; docs (README / context)
updated if behavior or config changed; PR body filled from
.github/PULL_REQUEST_TEMPLATE.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

