feat: enforce runtime domain invariants#45
Merged
Conversation
e43a071 to
54a7f40
Compare
Base automatically changed from
agent/stack-04-provider-output-validation
to
main
July 10, 2026 22:44
d0f2673 to
da08b3d
Compare
ebarti
added a commit
that referenced
this pull request
Jul 10, 2026
## What - adds side-effect-free `TaskSupportReport` preflight for built-in and third-party runtimes - keeps `AgentRuntime` migration-compatible through the optional `TaskSupportProvider` protocol - reports granular task capability gaps, configured model allow-list mismatches, and static Antigravity constraints - makes built-in dispatch consume the same support report used by public preflight - adds a machine-readable compatibility manifest tied to `pyproject.toml` and exact `uv.lock` versions ## Why Capability booleans and per-adapter rejection branches had drifted apart. Callers could not discover all incompatible fields before starting a run, provider-specific rules were delayed until dispatch, and compatibility ranges/tested runtime binaries existed only as duplicated prose and package metadata. ## Root cause Task support was encoded in several imperative adapter paths rather than one additive preflight contract. An initial implementation also made `validate_task` mandatory on `AgentRuntime`, which would have broken existing structural third-party runtimes; this PR uses an optional extension plus a declared-capability fallback instead. ## Checks - `ruff check src tests` - `mypy` - `pytest -q --cov=agent_runtime_kit --cov-report=term-missing --cov-fail-under=85` (340 passed, 3 skipped; 90.86%) - installed SDK contracts: 19 passed - `uv lock --check` - `uv build` ## Stack - Base: #45 - Next: #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Why
Several invalid or ambiguous states were constructible, and missing telemetry was indistinguishable from a real zero.
Root cause
The frozen dataclasses provided immutability but did not own their cross-field invariants, while adapter coercion helpers normalized missing and malformed counters to zero.
Checks
Compatibility
This intentionally rejects previously accepted invalid constructor inputs and changes unknown Usage fields from zero to None.
Stack