Skip to content

feat(experimental): add five decision tracks to a2ui-agent-experimental - #4474

Merged
gspencergoog merged 2 commits into
mainfrom
feat/modular-decision-tracks
Dec 3, 2026
Merged

gspencergoog merged 2 commits into
mainfrom
feat/modular-decision-tracks

Conversation

@gspencergoog

@gspencergoog gspencergoog commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add the five framework-neutral decision-model tracks (cascade, binder, rpc, gated, prose) to a2ui-agent-experimental, built exclusively on public a2ui-core and a2ui-agent-sdk APIs.

Reviewer Focus

  • python/a2ui_agent_experimental/src/a2ui/experimental/decision/cascade/router.py: Single-batch UI gate, routing tier selector (RouteReason), closure-preserving catalog pruner, @runtime_checkable SurfaceTemplateSpec, and bounded CatalogDecisionGraph caching.
  • python/a2ui_agent_experimental/src/a2ui/experimental/decision/binder/: ToolPointerBinder, BinderConfig, SurfaceTemplate / ExpressSurfaceTemplate, MacroExpander integration, and prompt-quoting and slot-validation guards in _prompt.py and _slots.py.
  • python/a2ui_agent_experimental/src/a2ui/experimental/decision/gated/: GatedTemplateEvaluator (rejecting unknown variant options, supporting custom is_secret) and schema-driven child pruning via CatalogDecisionGraph in pruner.py.
  • python/a2ui_agent_experimental/src/a2ui/experimental/decision/prose/: ProseSurfaceUpgrader (backed by ExpressSurfaceTemplate, shared monotonic deadline, value-to-span grounding, on_extractor_error, custom is_secret) and fail-closed StructuredOutputExtractor (FieldExtractionError(A2uiError)).

Changes

  • Added a2ui.experimental.decision.cascade (DecisionCascadeRouter, CascadeConfig, CascadeTier, RouteDecision, RouteReason, SurfaceTemplateSpec, CascadeBatchFormatter).
  • Added a2ui.experimental.decision.binder (ToolPointerBinder, BinderConfig, BindResult, SurfaceTemplate, ExpressSurfaceTemplate, BindingState, format_binding_state).
  • Added a2ui.experimental.decision.rpc (NamedPredicateSpec, SessionRateLimiter, RATE_LIMITED_ERROR_CODE, build_predicate_agent_functions).
  • Added a2ui.experimental.decision.gated (GatedTemplateEvaluator, GatedTemplateSpec, extract_gates_and_variants, prune_components).
  • Added a2ui.experimental.decision.prose (ProseSurfaceUpgrader, ProseTemplateSpec, TypedFieldSpec, StructuredOutputExtractor, DeterministicMockExtractor, FieldExtractionError).
  • Added shared internal helpers (_express.py for single-surface Express compilation, _internal.py prompt quoting) and updated python/README.md, python/a2ui_agent_experimental/README.md, and python/a2ui_agent_experimental/CHANGELOG.md.
  • Added unit, hardening, and external-extension smoke tests in test_cascade_router.py, test_tool_pointer_binder.py, test_decision_predicates.py, test_gated_templates.py, test_prose_upgrader.py, test_tracks_hardening.py, test_tracks_r3_hardening.py, and test_external_extension_smoke.py.

Impact & Risks

  • a2ui-agent-experimental remains framework-neutral (google-adk, a2a-sdk, google-genai, and httpx are not dependencies and are never imported), verified by test_decision_kernel.py and test_public_api_boundary.py.
  • All public track entry points emit @experimental UserWarnings unless A2UI_SUPPRESS_EXPERIMENTAL_FEATURE_WARNINGS=1 is set.

Testing

  1. Run unit and hardening tests:
    uv run pytest python/a2ui_agent_experimental/tests
  2. Run type checking:
    uv run mypy python/a2ui_agent_experimental/src/
  3. Check formatting and license headers:
    uv run pyink --check python/a2ui_agent_experimental && python3 scripts/fix_licenses.py --check

@gspencergoog
gspencergoog added this pull request to stack #4475 December 1, 2026 00:11
gemini-code-assist[bot]

This comment was marked as resolved.

@gspencergoog
gspencergoog force-pushed the feat/modular-decision-tracks branch from 183c360 to a330c6c Compare December 1, 2026 00:31
gspencergoog added a commit that referenced this pull request Dec 1, 2026
…4474

Signed-off-by: Greg Spencer <gspencer@google.com>
@gspencergoog gspencergoog changed the title feat(decision): port five decision tracks and thin ADK wrappers feat(experimental): add five decision tracks, ADK wrappers, and extension guide Dec 1, 2026
@gspencergoog
gspencergoog marked this pull request as ready for review December 1, 2026 22:29
@gspencergoog
gspencergoog removed this pull request from stack #4475 December 1, 2026 22:40
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-tracks branch from c3504f9 to f156605 Compare December 1, 2026 22:44
@gspencergoog gspencergoog changed the title feat(experimental): add five decision tracks, ADK wrappers, and extension guide feat(experimental): add five decision tracks and extension guide Dec 1, 2026
@gspencergoog
gspencergoog added this pull request to stack #4501 December 1, 2026 22:46

@nan-yu nan-yu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, Greg! The five tracks share the kernel cleanly, and much of the core holds up under probing. The emitted messages validate against the v1.0 basic catalog, the cascade pruner keeps every component and function that the remaining components reference (a v0.9 pruned catalog round-trips and validates), and variant groups already reject unknown options.

The main things I found, inline:

  • Gated: an ineligible template can be rendered when the model picks a label it wasn't offered; v0.9 catalogs always fail because messages state 1.0.
  • Prose grounding: it is off by default, it never compares dates, booleans and other non-text values, and it accepts substring or case-changed matches. The deadline is advisory, and abstain doesn't cover every error.
  • Fail-open security paths: predicates turn NaN/out-of-range output into verdicts, rate-limiter eviction resets active sessions, a custom is_secret replaces the defaults, and raw payload keys can inject prompt lines.
  • Binder robustness: NaN slots, second-turn createSurface with the default surface id, and config= silently ignoring kwargs.
  • Docs and guards: the neutrality test's adk exemption, missing experimental warnings on public functions, the README's ADK claim, and the guide's import rule being weaker than AGENTS.md.

🤖 Agent-generated

Comment thread python/README.md Resolved
gspencergoog added a commit that referenced this pull request Dec 2, 2026
Harden all five decision tracks and docs per PR #4474 review:
- gated: restrict template selection to eligible templates, validate v1.0
  transport catalogs and derive wire version, use positional question IDs in
  select_and_evaluate to avoid ':' collisions, decorate public functions with
  @experimental.
- prose: default require_grounded_span=True, add NFKC token-boundary and
  case-sensitive TEXT/NUMBER/BOOLEAN/DATE/TIME/DATETIME/DURATION/LIST_DATE
  grounding checks, enforce upgrade() deadline via asyncio.wait_for, wrap
  arbitrary extractor exceptions/malformed returns for on_extractor_error,
  remove unused ProseTemplateSpec.catalog_id, decorate prompt/schema helpers.
- rpc: validate predicate answers by question_id and fail closed on
  SessionRateLimiter capacity instead of evicting live sessions.
- binder: compose custom is_secret additively with is_secret_pointer across
  tracks, JSON-quote prompt values in format_binding_state, reject non-finite
  floats on literal number slots, emit deleteSurface before createSurface when
  replacing an existing renderer_state surface, reject config= combined with
  individual tuning kwargs, decorate format_binding_state with @experimental.
- cascade: validate custom batch_formatter required question IDs and treat
  explicit allowedParents: [] as unplaceable.
- guards & docs: remove leftover 'adk' neutrality exemption, drop stale ADK
  clause from python/README.md, and tighten extending_a2ui.md + smoke test to
  allowlist explicit top-level public facades.
@gspencergoog
gspencergoog removed this pull request from stack #4501 December 2, 2026 02:44
@gspencergoog
gspencergoog added this pull request to stack #4521 December 2, 2026 02:44
gspencergoog added a commit that referenced this pull request Dec 2, 2026
…tracks

Signed-off-by: Greg Spencer <gspencer@google.com>
gspencergoog added a commit that referenced this pull request Dec 2, 2026
… and restore synthesizer kernel extensions

Signed-off-by: Greg Spencer <gspencer@google.com>

@nan-yu nan-yu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for working through all of these! I re-checked the earlier comments against b666862: 20 of 22 are fixed. Two are only partly fixed (prose grounding for durations and negation, and prompt quoting in slot option texts), and a couple of the fixes introduced new gaps. Details inline.

🤖 Agent-generated

gspencergoog added a commit that referenced this pull request Dec 2, 2026
…d binder feedback

Signed-off-by: Greg Spencer <gspencer@google.com>
@gspencergoog gspencergoog changed the title feat(experimental): add five decision tracks and extension guide feat(experimental): add five decision tracks to a2ui-agent-experimental Dec 2, 2026
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-tracks branch 2 times, most recently from 41b203e to 19fb02f Compare December 2, 2026 22:21

@nan-yu nan-yu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, Greg! I re-checked the last round against 19fb02f: duration grounding now compares totals, negation looks at the whole clause, macro-catalog templates are accepted, and slot option texts are quoted. The package tests and mypy pass locally. LGTM.

🤖 Agent-generated

@gspencergoog
gspencergoog force-pushed the feat/modular-decision-tracks branch from 19fb02f to 05731d1 Compare December 2, 2026 23:00
Base automatically changed from feat/modular-decision-pkg to main December 3, 2026 00:00
…racks

Signed-off-by: Greg Spencer <gspencer@google.com>
…, and rpc tracks

Signed-off-by: Greg Spencer <gspencer@google.com>
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-tracks branch from 05731d1 to d90bd46 Compare December 3, 2026 00:00
@gspencergoog
gspencergoog enabled stacked auto-merge (squash) December 3, 2026 00:00
@gspencergoog
gspencergoog merged commit a7631c2 into main Dec 3, 2026
55 checks passed
@gspencergoog
gspencergoog deleted the feat/modular-decision-tracks branch December 3, 2026 00:09
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.

3 participants