Skip to content

feat(harness): public adk facade + docs for the unified harness surface (PR 9)#423

Merged
declan-scale merged 7 commits into
nextfrom
declan-scale/pr9-harness-cleanup
Jun 23, 2026
Merged

feat(harness): public adk facade + docs for the unified harness surface (PR 9)#423
declan-scale merged 7 commits into
nextfrom
declan-scale/pr9-harness-cleanup

Conversation

@declan-scale

@declan-scale declan-scale commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Public import path (AGX1-375): re-exports UnifiedEmitter, SpanTracer, TurnUsage, TurnResult, HarnessTurn, StreamTaskMessage, OpenSpan, CloseSpan, SpanSignal from agentex.lib.adk — additive, consistent with how convert_pydantic_ai_to_agentex_events / convert_langgraph_to_agentex_events are already exported. Agent authors can now do from agentex.lib.adk import UnifiedEmitter, TurnUsage, ... without touching internal core.harness paths.
  • Docs (adk/docs/harness.md): covers the canonical StreamTaskMessage* stream, convert_<harness>_to_agentex_events tap contract, HarnessTurn protocol, UnifiedEmitter (yield_turn vs auto_send_turn delivery modes), tracing-on-by-default semantics, TurnUsage fields, TurnResult, span derivation rules, and per-channel usage examples.
  • Dead-code sweep: nothing safe to remove in this branch. The _async modules (_pydantic_ai_async, _langgraph_async) still use direct adk.streaming calls — those migrations are separate PRs. The _*_tracing handlers are not present on this branch.

Test plan

  • uv run --all-packages --all-extras pytest tests/lib/core/harness/ -q — 45 passed
  • uv run --all-packages python -c "from agentex.lib.adk import UnifiedEmitter" — OK
  • uv run ruff check src/agentex/lib/adk/__init__.py — all checks passed
  • uv run pyright src/agentex/lib/adk/__init__.py — 0 errors

🤖 Generated with Claude Code

Greptile Summary

  • Adds public ADK re-exports for unified harness classes and stream/message types.
  • Documents the canonical harness event stream, tap contract, turn protocol, emitter delivery modes, usage/result fields, and tracing behavior.
  • Provides examples for yield-based and auto-send harness integration paths.

Confidence Score: 4/5

The import facade change is small, but the public API remains incomplete for the documented harness integration flow.

The review is based on a narrow diff with one clear public API gap in the newly added exports. Runtime verification was limited by local environment constraints, but the code-level issue is straightforward in the facade export list.

src/agentex/lib/adk/init.py

T-Rex T-Rex Logs

What T-Rex did

  • Ran a focused Python import check script for the ADK facade and implementation modules; the run was blocked because temporalio was missing before the facade export check, and the ADK package could not install in the current Python 3.11 environment.
  • Observed the public ADK facade import progression from failure to success: initial ImportError cannot import name 'UnifiedEmitter' from agentex.lib.adk, followed by a successful import where all claimed names are imported and the process exited with code 0.
  • Ran the harness docs-coverage check; the before state showed a missing_document result on the base worktree, while the after state shows the head worktree with EXISTS True, LINE_COUNT 196, all required terms present, and RESULT ok_all_required_terms_present.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. src/agentex/lib/adk/__init__.py, line 16-22 (link)

    P1 Incomplete public facade

    The new facade exports UnifiedEmitter and the shared harness types, but it still leaves PydanticAITurn, LangGraphTurn, and OpenAITurn behind private module paths. Agent authors can import the emitter and taps from agentex.lib.adk, but attempts to use the same public path for the turn wrappers needed by yield_turn() or auto_send_turn() fail with ImportError. Please re-export the existing turn classes and usage helpers so each shipped harness has a complete public import path.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/agentex/lib/adk/__init__.py
    Line: 16-22
    
    Comment:
    **Incomplete public facade**
    
    The new facade exports `UnifiedEmitter` and the shared harness types, but it still leaves `PydanticAITurn`, `LangGraphTurn`, and `OpenAITurn` behind private module paths. Agent authors can import the emitter and taps from `agentex.lib.adk`, but attempts to use the same public path for the turn wrappers needed by `yield_turn()` or `auto_send_turn()` fail with `ImportError`. Please re-export the existing turn classes and usage helpers so each shipped harness has a complete public import path.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/agentex/lib/adk/__init__.py:16-22
**Incomplete public facade**

The new facade exports `UnifiedEmitter` and the shared harness types, but it still leaves `PydanticAITurn`, `LangGraphTurn`, and `OpenAITurn` behind private module paths. Agent authors can import the emitter and taps from `agentex.lib.adk`, but attempts to use the same public path for the turn wrappers needed by `yield_turn()` or `auto_send_turn()` fail with `ImportError`. Please re-export the existing turn classes and usage helpers so each shipped harness has a complete public import path.

Reviews (9): Last reviewed commit: "docs(harness-cleanup): move PR 10 plan o..." | Re-trigger Greptile

@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from 37421b6 to df3461c Compare June 22, 2026 14:13
@declan-scale declan-scale force-pushed the declan-scale/pr9-harness-cleanup branch 2 times, most recently from 4da0747 to e56cccc Compare June 22, 2026 14:37
@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from ccbd5cf to e3fa1cc Compare June 22, 2026 15:14
@declan-scale declan-scale force-pushed the declan-scale/pr9-harness-cleanup branch 2 times, most recently from 61bb331 to 8f6e65b Compare June 22, 2026 16:01
Comment thread adk/docs/harness.md
@@ -0,0 +1,196 @@
# Unified Harness Surface

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from c8c63d1 to 05120f3 Compare June 22, 2026 18:47
@declan-scale declan-scale force-pushed the declan-scale/pr9-harness-cleanup branch from 8f6e65b to 423ba89 Compare June 22, 2026 18:47
@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from 05120f3 to c9a907c Compare June 22, 2026 19:54
@declan-scale declan-scale force-pushed the declan-scale/pr9-harness-cleanup branch from 423ba89 to 44a852a Compare June 22, 2026 19:54
@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from c9a907c to a04bf5e Compare June 22, 2026 20:01
Base automatically changed from declan-scale/agx1-373-conformance-equivalence to next June 22, 2026 20:09
@declan-scale declan-scale force-pushed the declan-scale/pr9-harness-cleanup branch from 44a852a to 78b36cd Compare June 22, 2026 20:11
declan-scale and others added 7 commits June 22, 2026 18:55
…-375); cleanup

Re-export UnifiedEmitter, SpanTracer, TurnUsage, TurnResult, HarnessTurn,
StreamTaskMessage, OpenSpan, CloseSpan, and SpanSignal from agentex.lib.adk
so agent authors can import the unified harness surface from the canonical
public facade instead of the internal core.harness path (AGX1-375).

Add adk/docs/harness.md covering the canonical StreamTaskMessage* stream,
convert_<harness>_to_agentex_events taps, HarnessTurn protocol, UnifiedEmitter
(yield_turn vs auto_send_turn), tracing-on-by-default, TurnUsage/TurnResult,
and per-channel usage examples.

Dead-code sweep: nothing safe to remove — the _async modules have not been
migrated to use the new auto_send path yet (those are separate migration PRs),
and the intentionally-kept _*_tracing handlers are not present in this branch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rs, workaround markers, optional adk.harness namespace)

Documents the deferred, breaking-ish cleanup to run as PR 10 once the whole
harness-surface stack merges, the deprecation window passes, and the golden
agent is migrated off the bespoke paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ile]

The sync ACP example imported create_pydantic_ai_tracing_handler (deprecated)
but never used it — only UnifiedEmitter and convert_pydantic_ai_to_agentex_events
are referenced. Remove it so the example doesn't steer readers toward the
deprecated handler.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…0 plan

Folds the review finding (duplicated _FakeTracing/_FakeSpan test doubles,
copy-pasted determinism test, five parallel harness-turn usage normalizers,
three divergent sync-path structures, competing adk/__init__.py edits, and
tutorial-scaffolding drift) into the existing post-merge cleanup plan as
scope items 6-12, flagged non-breaking so they can land independently of the
deprecation-gated removals.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ials

The migrations added a second set of langgraph/pydantic-ai/openai tutorial
agents alongside the ones already on next. The pre-existing ones demonstrate
the deprecated bespoke-tracing path (they import create_*_tracing_handler),
so retiring/migrating them is a hard prerequisite of item 1's symbol removal,
not optional. Adds item 13 (with a replace-in-place vs keep-new decision),
cross-references item 1, and gates item 13 alongside item 1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves the open naming decision in items 11/13: standardize on the
numbered NNN_<name> convention and rename the new harness_* tutorials off
the bare scheme, folding the rename into the replace-in-place retirement of
the pre-unified tutorials (pydantic-ai/langgraph/openai take over their old
numbered slots; codex gets fresh numbers; claude_code already compliant).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR 9 stays scoped to the public adk facade + adk/docs/harness.md. The PR 10
cleanup plan now lives on declan-scale/pr10-harness-cleanup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@declan-scale declan-scale force-pushed the declan-scale/pr9-harness-cleanup branch from 599176a to f58cfc9 Compare June 22, 2026 22:56
@declan-scale declan-scale merged commit fa60632 into next Jun 23, 2026
57 checks passed
@declan-scale declan-scale deleted the declan-scale/pr9-harness-cleanup branch June 23, 2026 00:10
@stainless-app stainless-app Bot mentioned this pull request Jun 23, 2026
declan-scale added a commit that referenced this pull request Jun 23, 2026
…ified-harness planning doc

PR 10 is stacked on PR 9 (#423). The plan sequences the 13 cleanup-scope items
plus a filesystem layout/naming consolidation (every harness -> _<harness>_sync.py
+ _<harness>_turn.py under _modules/, openai moved out of providers/_modules/)
and a harness.md docs refresh. The pre-unified unified-harness-surface plan doc is
removed now that the stack is merged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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