Skip to content

instrument: protocol adapters + M7 certification (M1.D + M7 port)#95

Closed
mmercuri wants to merge 2 commits into
feat/instrument-base-foundationfrom
feat/instrument-protocols
Closed

instrument: protocol adapters + M7 certification (M1.D + M7 port)#95
mmercuri wants to merge 2 commits into
feat/instrument-base-foundationfrom
feat/instrument-protocols

Conversation

@mmercuri

Copy link
Copy Markdown
Contributor

Summary

Ports the six protocol adapters and the M7 protocol-certification
suite onto the new layerlens.instrument base layer:

A2A, AGUI, MCP, AP2, A2UI, UCP

Also lands the cross-protocol infrastructure:

  • base.py — shared protocol adapter mixin
  • certification.pyCertificationSuite (M7) — exercises every
    protocol adapter against a canned trace catalog and emits a
    machine-readable verdict
  • connection_pool.py / health.py / exceptions.py /
    _commerce.py — cross-protocol helpers

Scope

  • src/layerlens/instrument/adapters/protocols/{a2a,agui,mcp}/
    — full per-protocol packages (adapter, events, transport)
  • src/layerlens/instrument/adapters/protocols/{ap2,a2ui,ucp}.py
    — single-file adapters
  • src/layerlens/instrument/adapters/protocols/{base,certification,connection_pool,exceptions,health,_commerce}.py
    — shared protocol layer
  • tests/instrument/adapters/protocols/ — unit + smoke +
    certification tests for all six protocols
  • samples/instrument/{a2a,agui,mcp,ap2,a2ui,ucp}/ — runnable
    per-protocol samples
  • docs/adapters/{protocols-*,certification}.md — per-protocol
    integration guide + M7 certification doc
  • pyproject.toml — six new optional extras (protocols-a2a,
    protocols-agui, protocols-mcp, protocols-ap2,
    protocols-a2ui, protocols-ucp) plus the protocols-all
    umbrella; pyright/ruff exclusions for the dynamic monkey-patching
    protocol code

Blast radius

  • Default pip install layerlens install set is unchanged. Only
    protocols-mcp pulls in a non-stdlib dep (mcp); protocols-a2a
    reuses the already-required httpx; the other four protocols are
    self-contained.
  • protocols-agui currently exposes an empty extra group: the
    upstream AG-UI client SDK is not yet on PyPI. The adapter is
    self-contained; the extra is reserved so consumers can still
    install layerlens[protocols-agui] for forward-compatibility.
  • M7 certification suite is an additive read-only API.
  • No changes to existing public API surface.

Test plan

  • uv run pytest tests/instrument/adapters/protocols/ -x
    107 passed (a2a, agui, mcp, ap2, a2ui, ucp + certification + smoke)
  • Reviewer (m-peko) verifies M7 certification harness coverage

Stacks on

  • feat/instrument-base-foundation (M1.A) — required for the
    BaseAdapter surface this PR consumes.

Linear

LAY-3400 umbrella (M1.D + M7).

Ports the six protocol adapters and the M7 protocol-certification
suite onto the new layerlens.instrument base layer:

  A2A, AGUI, MCP, AP2, A2UI, UCP

Also lands the cross-protocol infrastructure:
  - base.py: shared protocol adapter mixin
  - certification.py: CertificationSuite (M7) — exercises every
    protocol adapter against a canned trace catalog and emits a
    machine-readable verdict
  - connection_pool.py / health.py / exceptions.py / _commerce.py:
    cross-protocol helpers

Scope
-----
- src/layerlens/instrument/adapters/protocols/{a2a,agui,mcp}/: full
  per-protocol packages (adapter, events, transport)
- src/layerlens/instrument/adapters/protocols/{ap2,a2ui,ucp}.py:
  single-file adapters
- src/layerlens/instrument/adapters/protocols/{base,certification,
  connection_pool,exceptions,health,_commerce}.py: shared protocol
  layer
- tests/instrument/adapters/protocols/: unit + smoke + certification
  tests for all six protocols
- samples/instrument/{a2a,agui,mcp,ap2,a2ui,ucp}/: runnable per-
  protocol samples
- docs/adapters/{protocols-*,certification}.md: per-protocol
  integration guide + M7 certification doc
- pyproject.toml: six new optional extras
  (protocols-a2a, protocols-agui, protocols-mcp, protocols-ap2,
  protocols-a2ui, protocols-ucp) plus the protocols-all umbrella;
  pyright/ruff exclusions for the dynamic monkey-patching protocol
  code

Blast radius
------------
- Default `pip install layerlens` install set is unchanged. Only
  protocols-mcp pulls in a non-stdlib dep (`mcp`); protocols-a2a
  reuses the already-required `httpx`; the other four protocols are
  self-contained.
- protocols-agui currently exposes an empty extra group: the upstream
  AG-UI client SDK is not yet on PyPI. The adapter is self-contained;
  the extra is reserved so that consumers can still install
  `layerlens[protocols-agui]` for forward-compatibility.
- M7 certification suite is an additive read-only API.
- No changes to existing public API surface.

Test plan
---------
- uv run pytest tests/instrument/adapters/protocols/ -x  ->
  107 passed (a2a, agui, mcp, ap2, a2ui, ucp + certification + smoke)

Stacks on
---------
- feat/instrument-base-foundation (M1.A) — required for the
  BaseAdapter surface this PR consumes.

LAY-3400 umbrella (M1.D + M7).
@mmercuri mmercuri requested a review from m-peko April 26, 2026 02:24
Auto-applied by 'ruff check --fix'. No behavior change.
@mmercuri

Copy link
Copy Markdown
Contributor Author

Linear: https://linear.app/layerlens/issue/LAY-3400 (Protocol adapters + certification suite — M1.D + M7). Stacked on PR #93. Under Apollo M1 epic LAY-3423.

@m-peko m-peko closed this May 21, 2026
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.

2 participants