Skip to content

feat(experimental): add a2ui-agent-experimental package and decision kernel - #4473

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

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

Conversation

@gspencergoog

@gspencergoog gspencergoog commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add the standalone PEP 420 a2ui-agent-experimental package under python/a2ui_agent_experimental/ (a2ui.experimental.decision). It provides a vendor-agnostic, framework-neutral decision kernel built on public a2ui-core and a2ui-agent-sdk APIs, wired into CI, mypy, and PyPI release scripts.

Reviewer Focus

  • python/a2ui_agent_experimental/src/a2ui/experimental/decision/models.py and runtime.py: Vendor-agnostic DecisionModel callable contract, DecisionBatch, DecisionQuestion, DecisionAnswer, DecisionDistribution, Calibration, invoke_decision_model, and typed DecisionModelError (DecisionErrorCode).
  • python/a2ui_agent_experimental/src/a2ui/experimental/decision/payload_inspector.py and payload.py: RFC 6901 pointer extraction (inspect_pointers), DefaultSecretFilter, and cycle-bounded redact_payload. Also exposes the public a2ui.experimental.decision.payload customization-hook facade.
  • python/a2ui_agent_experimental/src/a2ui/experimental/decision/catalog_graph.py: CatalogDecisionGraph built on CatalogSchemaInspector without leaking the inspector or raw schemas, carrying is_integer, typed enum_values, and ProtocolVersion.
  • python/a2ui_agent_experimental/tests/test_public_api_boundary.py: AST guard enforcing that every a2ui.experimental.* subpackage imports only public a2ui.* facades with no private ._* segments.

Changes

  • Scaffolded python/a2ui_agent_experimental/ (pyproject.toml, README.md, CHANGELOG.md) as a PEP 420 namespace package under a2ui.experimental.decision with zero framework or HTTP dependencies in the base install.
  • Implemented the decision kernel: models.py, runtime.py, ask.py, mock.py, catalog_graph.py, payload_inspector.py, semantic_types.py, payload.py, _warnings.py (UserWarning), and _internal.py.
  • Wired a2ui-agent-experimental into root pyproject.toml, uv.lock, .github/workflows/python_ci.yml, .github/workflows/release-pypi.yml, .github/release_packages.json, .github/scripts/release_version.py, AGENTS.md, .agents/skills/a2ui-release-python/SKILL.md, and docs/contributing/release/release.md.
  • Added unit, boundary, and release-script tests in python/a2ui_agent_experimental/tests/test_decision_kernel.py, test_decision_ask.py, test_public_api_boundary.py, .github/scripts/tests/test_release_version.py, and .github/scripts/tests/test_release_notes.py.

Impact & Risks

Testing

  1. Run kernel and release script tests:
    uv run pytest python/a2ui_agent_experimental/tests .github/scripts/tests/test_release_version.py .github/scripts/tests/test_release_notes.py
  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 added a commit that referenced this pull request Dec 1, 2026
…4473

Signed-off-by: Greg Spencer <gspencer@google.com>
gspencergoog added a commit to gspencergoog/A2UI that referenced this pull request Dec 1, 2026
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-pkg branch from 343db48 to 05f558f Compare December 1, 2026 22:08
@gspencergoog gspencergoog changed the title feat(decision): scaffold a2ui-decision package and kernel feat(experimental): add a2ui-agent-experimental package and decision kernel 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 changed the base branch from feat/modular-adk-ui-hooks to feat/modular-agent-seams December 1, 2026 22:40
gspencergoog added a commit that referenced this pull request Dec 1, 2026
…4473

Signed-off-by: Greg Spencer <gspencer@google.com>
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-pkg branch from 7919d7f to 419a91e Compare December 1, 2026 22:42
@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! A vendor-neutral decision kernel built only on public facades is a nice shape. The packaging work is careful: the wheel respects PEP 420 and co-installs cleanly with the other a2ui packages, CI tests, type-checks and builds it, and the release gate correctly blocks publishing before the SDK APIs from #4471 ship. All 178 package tests and the release-script tests pass locally, and pointer escaping round-trips correctly.

The main things I found, inline:

  • Model distributions aren't validated, so ask() can return picks outside the options, BOOLEAN probabilities above 1, or SCORE answers without expected.
  • A few payload-inspector gaps: no cycle guard in inspect_pointers, secret key names the filter misses, non-JSON objects passing through redact_payload unredacted, and trailing-slash excludes that do nothing.
  • Error codes: some malformed outputs escape as a raw TypeError, and contract violations are reported as backend errors.
  • Bare-name lookup on mixed catalogs doesn't follow v1.0 surface-default resolution.
  • The boundary guard lets deep imports into public-named submodules through.
  • The SDK pin isn't met in a tagless checkout, which looks like the reason for the extra fetch-depth: 0 lines.

🤖 Agent-generated

gspencergoog added a commit that referenced this pull request Dec 2, 2026
Validate returned model distributions against question.candidates() in
_invoke_decision_model, tighten DecisionDistribution and DecisionAnswer
validation, classify non-awaitable and A2uiValidationError model failures as
DECISION_CONTRACT_ERROR, add cycle guards and pointer bounds to
inspect_pointers, expand secret key token matching, drop non-JSON objects in
redact_payload, unify path normalization, add v1.0 default_catalog_id to
CatalogDecisionGraph, tighten the public API boundary test to top-level
facades across src and tests, bump a2ui-agent-sdk fallback-version to 0.12.1,
and remove unused ActionSpec/ExpressSurfaceSpec/coerce_decision_payload while
syncing README.md Contents with __all__.
@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
Comment thread python/a2ui_agent/pyproject.toml Resolved
gspencergoog added a commit that referenced this pull request Dec 2, 2026
- Harden secret key redaction, DAG visit budget, depth parity, and allowlisted descendants
- Trim unused fields/helpers from PointerSummary, models, graph, and root __all__
- Smooth Calibration.apply at temperature 1.0 and unify A2uiValidationError errors
- Bump a2ui-agent-sdk dependency bound, fallback version, README, and release tests
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 c633e28: everything is fixed except the secret-key list, where auth, session, tokens, cc, pan and conn_string still get through (partly overlapping jacobsimionato's notes, so I haven't re-raised it). A few of the fixes introduced new problems, 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 force-pushed the feat/modular-decision-pkg branch from caadd23 to 3863fb5 Compare December 2, 2026 22:05
Base automatically changed from feat/modular-agent-seams to main December 2, 2026 22:21
…package

Signed-off-by: Greg Spencer <gspencer@google.com>
@gspencergoog
gspencergoog force-pushed the feat/modular-decision-pkg branch from 3863fb5 to abc0c74 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 abc0c74: the sum renormalization, mock scorer normalization, redaction budget, and the new a2ui.experimental.decision.payload facade all look good, and the package tests and mypy pass locally. LGTM.

🤖 Agent-generated

…udget status

Signed-off-by: Greg Spencer <gspencer@google.com>
@gspencergoog
gspencergoog merged commit afbaf20 into main Dec 3, 2026
56 checks passed
@gspencergoog
gspencergoog deleted the feat/modular-decision-pkg branch December 3, 2026 00:00
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