Repository navigation
feat(experimental): add five decision tracks to a2ui-agent-experimental - #4474
Conversation
183c360 to
a330c6c
Compare
…4474 Signed-off-by: Greg Spencer <gspencer@google.com>
c3504f9 to
f156605
Compare
nan-yu
left a comment
There was a problem hiding this comment.
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
abstaindoesn'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_secretreplaces the defaults, and raw payload keys can inject prompt lines. - Binder robustness: NaN slots, second-turn
createSurfacewith the default surface id, andconfig=silently ignoring kwargs. - Docs and guards: the neutrality test's
adkexemption, missing experimental warnings on public functions, the README's ADK claim, and the guide's import rule being weaker than AGENTS.md.
🤖 Agent-generated
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.
…tracks Signed-off-by: Greg Spencer <gspencer@google.com>
… and restore synthesizer kernel extensions Signed-off-by: Greg Spencer <gspencer@google.com>
nan-yu
left a comment
There was a problem hiding this comment.
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
…d binder feedback Signed-off-by: Greg Spencer <gspencer@google.com>
41b203e to
19fb02f
Compare
nan-yu
left a comment
There was a problem hiding this comment.
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
19fb02f to
05731d1
Compare
…racks Signed-off-by: Greg Spencer <gspencer@google.com>
…, and rpc tracks Signed-off-by: Greg Spencer <gspencer@google.com>
05731d1 to
d90bd46
Compare
Summary
Add the five framework-neutral decision-model tracks (
cascade,binder,rpc,gated,prose) toa2ui-agent-experimental, built exclusively on publica2ui-coreanda2ui-agent-sdkAPIs.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 boundedCatalogDecisionGraphcaching.python/a2ui_agent_experimental/src/a2ui/experimental/decision/binder/:ToolPointerBinder,BinderConfig,SurfaceTemplate/ExpressSurfaceTemplate,MacroExpanderintegration, and prompt-quoting and slot-validation guards in_prompt.pyand_slots.py.python/a2ui_agent_experimental/src/a2ui/experimental/decision/gated/:GatedTemplateEvaluator(rejecting unknown variant options, supporting customis_secret) and schema-driven child pruning viaCatalogDecisionGraphinpruner.py.python/a2ui_agent_experimental/src/a2ui/experimental/decision/prose/:ProseSurfaceUpgrader(backed byExpressSurfaceTemplate, shared monotonic deadline, value-to-span grounding,on_extractor_error, customis_secret) and fail-closedStructuredOutputExtractor(FieldExtractionError(A2uiError)).Changes
a2ui.experimental.decision.cascade(DecisionCascadeRouter,CascadeConfig,CascadeTier,RouteDecision,RouteReason,SurfaceTemplateSpec,CascadeBatchFormatter).a2ui.experimental.decision.binder(ToolPointerBinder,BinderConfig,BindResult,SurfaceTemplate,ExpressSurfaceTemplate,BindingState,format_binding_state).a2ui.experimental.decision.rpc(NamedPredicateSpec,SessionRateLimiter,RATE_LIMITED_ERROR_CODE,build_predicate_agent_functions).a2ui.experimental.decision.gated(GatedTemplateEvaluator,GatedTemplateSpec,extract_gates_and_variants,prune_components).a2ui.experimental.decision.prose(ProseSurfaceUpgrader,ProseTemplateSpec,TypedFieldSpec,StructuredOutputExtractor,DeterministicMockExtractor,FieldExtractionError)._express.pyfor single-surface Express compilation,_internal.pyprompt quoting) and updatedpython/README.md,python/a2ui_agent_experimental/README.md, andpython/a2ui_agent_experimental/CHANGELOG.md.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, andtest_external_extension_smoke.py.Impact & Risks
a2ui-agent-experimentalremains framework-neutral (google-adk,a2a-sdk,google-genai, andhttpxare not dependencies and are never imported), verified bytest_decision_kernel.pyandtest_public_api_boundary.py.@experimentalUserWarnings unlessA2UI_SUPPRESS_EXPERIMENTAL_FEATURE_WARNINGS=1is set.Testing
uv run pytest python/a2ui_agent_experimental/testsuv run mypy python/a2ui_agent_experimental/src/uv run pyink --check python/a2ui_agent_experimental && python3 scripts/fix_licenses.py --check