aid-runtime-python 0.1.103__tar.gz → 0.1.105__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/PKG-INFO +1 -1
  2. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/pyproject.toml +1 -1
  3. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/__init__.py +1 -1
  4. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/engine.py +46 -12
  5. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime_python.egg-info/PKG-INFO +1 -1
  6. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_agents_deep_agents.py +8 -4
  7. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/README.md +0 -0
  8. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/setup.cfg +0 -0
  9. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/__init__.py +0 -0
  10. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/chat_model.py +0 -0
  11. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/deep_agents.py +0 -0
  12. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/guardrails.py +0 -0
  13. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/ir.py +0 -0
  14. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/loop.py +0 -0
  15. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/managed.py +0 -0
  16. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/memory.py +0 -0
  17. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/policy.py +0 -0
  18. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/agents/state.py +0 -0
  19. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/cache.py +0 -0
  20. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/concurrency.py +0 -0
  21. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/control.py +0 -0
  22. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/cost.py +0 -0
  23. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/decisions.py +0 -0
  24. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/errors.py +0 -0
  25. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/evals/__init__.py +0 -0
  26. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/evals/dataset.py +0 -0
  27. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/evals/gate.py +0 -0
  28. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/evals/metrics.py +0 -0
  29. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/evals/predicate.py +0 -0
  30. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/evals/runner.py +0 -0
  31. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/gateway.py +0 -0
  32. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/local_trace.py +0 -0
  33. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/pipeline.py +0 -0
  34. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/prompts.py +0 -0
  35. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/__init__.py +0 -0
  36. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/anthropic.py +0 -0
  37. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/base.py +0 -0
  38. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/bedrock.py +0 -0
  39. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/fake.py +0 -0
  40. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/gemini.py +0 -0
  41. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/gemini_wire.py +0 -0
  42. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/http.py +0 -0
  43. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/providers/vertex.py +0 -0
  44. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/py.typed +0 -0
  45. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/__init__.py +0 -0
  46. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/chunking.py +0 -0
  47. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/citations.py +0 -0
  48. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/connectors.py +0 -0
  49. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/embedding.py +0 -0
  50. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/gate.py +0 -0
  51. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/hybrid.py +0 -0
  52. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/knowledge_base.py +0 -0
  53. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/metrics.py +0 -0
  54. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/pgvector.py +0 -0
  55. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/rerank.py +0 -0
  56. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/retriever.py +0 -0
  57. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/stores.py +0 -0
  58. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/retrieval/types.py +0 -0
  59. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/steps.py +0 -0
  60. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/structured.py +0 -0
  61. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/tools.py +0 -0
  62. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/tracing.py +0 -0
  63. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime/types.py +0 -0
  64. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime_python.egg-info/SOURCES.txt +0 -0
  65. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime_python.egg-info/dependency_links.txt +0 -0
  66. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime_python.egg-info/requires.txt +0 -0
  67. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/src/aid_runtime_python.egg-info/top_level.txt +0 -0
  68. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_agents_budget.py +0 -0
  69. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_agents_hitl.py +0 -0
  70. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_agents_loop.py +0 -0
  71. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_agents_memory.py +0 -0
  72. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_anthropic_provider.py +0 -0
  73. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_bedrock_provider.py +0 -0
  74. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_cache.py +0 -0
  75. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_concurrency.py +0 -0
  76. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_control.py +0 -0
  77. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_cost.py +0 -0
  78. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_dataset.py +0 -0
  79. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_decisions.py +0 -0
  80. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_evals.py +0 -0
  81. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_evals_assert_gate.py +0 -0
  82. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_evals_decision.py +0 -0
  83. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_evals_gate.py +0 -0
  84. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_evals_predicate.py +0 -0
  85. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_gateway.py +0 -0
  86. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_gemini_provider.py +0 -0
  87. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_guardrails.py +0 -0
  88. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_guardrails_managed.py +0 -0
  89. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_http_provider.py +0 -0
  90. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_local_trace.py +0 -0
  91. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_package.py +0 -0
  92. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_pipeline.py +0 -0
  93. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_prompts.py +0 -0
  94. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_chunking.py +0 -0
  95. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_citations.py +0 -0
  96. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_connectors.py +0 -0
  97. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_embedding.py +0 -0
  98. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_gate.py +0 -0
  99. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_hybrid.py +0 -0
  100. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_knowledge_base.py +0 -0
  101. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_metrics.py +0 -0
  102. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_rerank.py +0 -0
  103. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_stores.py +0 -0
  104. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_retrieval_types.py +0 -0
  105. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_steps.py +0 -0
  106. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_streaming.py +0 -0
  107. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_structured.py +0 -0
  108. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_tool_permissions.py +0 -0
  109. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_tools.py +0 -0
  110. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_tracing.py +0 -0
  111. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_types.py +0 -0
  112. {aid_runtime_python-0.1.103 → aid_runtime_python-0.1.105}/tests/test_vertex_provider.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aid-runtime-python
3
- Version: 0.1.103
3
+ Version: 0.1.105
4
4
  Summary: The AID Framework Python runtime: model gateway with pinning and cost budgets, prompt registry, tool executor, OTel GenAI tracing, plain-async pipeline, and an eval harness that gates on statistical regression against a stored baseline.
5
5
  Author: The AID Framework authors
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aid-runtime-python"
7
- version = "0.1.103"
7
+ version = "0.1.105"
8
8
  description = "The AID Framework Python runtime: model gateway with pinning and cost budgets, prompt registry, tool executor, OTel GenAI tracing, plain-async pipeline, and an eval harness that gates on statistical regression against a stored baseline."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -310,7 +310,7 @@ from aid_runtime.types import (
310
310
  )
311
311
 
312
312
  #: Kept in sync with ``pyproject.toml`` by a test, so the two cannot drift.
313
- __version__ = "0.1.103"
313
+ __version__ = "0.1.105"
314
314
 
315
315
  __all__ = [
316
316
  "ANTHROPIC_VERSION",
@@ -10,9 +10,10 @@ Agents release this runtime was built and measured against. It is a bare constan
10
10
  rather than a range because a range is the thing pinning exists to prevent: the
11
11
  harness's middleware stack, its recursion accounting and its interrupt payload all
12
12
  move between releases, so an unpinned backend would change behaviour under a
13
- stored eval baseline. ``pyproject.toml`` installs the same version, and
14
- :func:`check_engine` compares the IR's ``engineVersion`` against *this* constant,
15
- not against whatever wheel happens to be importable.
13
+ stored eval baseline. ``pyproject.toml``'s ``deepagents`` extra is the only
14
+ declaration of it -- this module reads it back from the installed metadata --
15
+ and :func:`check_engine` compares the IR's ``engineVersion`` against *this*
16
+ constant, not against whatever wheel happens to be importable.
16
17
 
17
18
  **Fail closed, in one place.** Every reason a ``deepagents`` agent cannot run --
18
19
  unknown engine, transfer declared, missing pin, mismatched pin, missing extra --
@@ -25,7 +26,8 @@ meaning nothing at all.
25
26
 
26
27
  from __future__ import annotations
27
28
 
28
- from importlib.metadata import PackageNotFoundError
29
+ import re
30
+ from importlib.metadata import PackageNotFoundError, requires
29
31
  from importlib.metadata import version as distribution_version
30
32
 
31
33
  from aid_runtime.agents.ir import AgentDefinition
@@ -54,17 +56,15 @@ DEEPAGENTS = "deepagents"
54
56
  #: The closed set of engines the IR may name.
55
57
  ENGINES = frozenset({NATIVE, DEEPAGENTS})
56
58
 
57
- #: The one authoritative pin. Measured from PyPI, mirrored in
58
- #: ``pyproject.toml``'s ``deepagents`` extra, and compared against the IR's
59
- #: ``engineVersion`` at run time.
60
- DEEPAGENTS_PIN = "0.7.32"
61
-
62
- #: The optional extra that installs the harness.
63
- DEEPAGENTS_EXTRA = "aid-runtime-python[deepagents]"
64
-
65
59
  #: The distribution the extra installs.
66
60
  DEEPAGENTS_DISTRIBUTION = "deepagents"
67
61
 
62
+ #: This runtime's own distribution, which carries the ``deepagents`` extra.
63
+ _OWN_DISTRIBUTION = "aid-runtime-python"
64
+
65
+ #: An exact ``deepagents==<version>`` requirement, however the extra is spelled.
66
+ _PIN_REQUIREMENT = re.compile(r"^\s*deepagents\s*==\s*([^\s;,]+)", re.IGNORECASE)
67
+
68
68
 
69
69
  def installed_deepagents_version() -> str | None:
70
70
  """The installed ``deepagents`` version, or ``None`` when the extra is absent.
@@ -80,6 +80,40 @@ def installed_deepagents_version() -> str | None:
80
80
  return None
81
81
 
82
82
 
83
+ def _declared_deepagents_pin() -> str | None:
84
+ """The exact pin the ``deepagents`` extra declares, or ``None`` if unresolvable.
85
+
86
+ ``pyproject.toml`` is the *only* declaration of the pin. It used to be copied
87
+ into this module as a literal, which meant a dependency bump moved the extra
88
+ and left the constant behind: the runtime then refused specs pinned to the
89
+ version it was actually installing, and the suite failed on an assertion that
90
+ compared two copies of the number rather than any behaviour.
91
+ """
92
+ try:
93
+ requirements = requires(_OWN_DISTRIBUTION) or ()
94
+ except PackageNotFoundError:
95
+ return None
96
+ for requirement in requirements:
97
+ match = _PIN_REQUIREMENT.match(requirement)
98
+ if match is not None:
99
+ return match.group(1)
100
+ return None
101
+
102
+
103
+ #: The one authoritative pin, compared against the IR's ``engineVersion`` at run
104
+ #: time. Declared once, in the ``deepagents`` extra; this module reads it back.
105
+ #:
106
+ #: The fallbacks cover an import from a source tree with no installed metadata:
107
+ #: the installed harness is the release the app will actually run, so it is right
108
+ #: in every case where the backend can run at all. The final literal is
109
+ #: unreachable for a runnable backend, because :func:`check_engine` raises
110
+ #: :class:`~aid_runtime.errors.DeepAgentsUnavailableError` when the extra is absent.
111
+ DEEPAGENTS_PIN = _declared_deepagents_pin() or installed_deepagents_version() or "0.7.32"
112
+
113
+ #: The optional extra that installs the harness.
114
+ DEEPAGENTS_EXTRA = f"{_OWN_DISTRIBUTION}[deepagents]"
115
+
116
+
83
117
  def check_engine(agent: AgentDefinition) -> str:
84
118
  """Validate this agent's engine, or raise the reason it cannot run.
85
119
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aid-runtime-python
3
- Version: 0.1.103
3
+ Version: 0.1.105
4
4
  Summary: The AID Framework Python runtime: model gateway with pinning and cost budgets, prompt registry, tool executor, OTel GenAI tracing, plain-async pipeline, and an eval harness that gates on statistical regression against a stored baseline.
5
5
  Author: The AID Framework authors
6
6
  License-Expression: Apache-2.0
@@ -102,10 +102,14 @@ async def test_native_remains_the_default_engine() -> None:
102
102
 
103
103
 
104
104
  async def test_the_installed_release_is_the_pinned_one() -> None:
105
- """The pin is a measurement, not a guess: it has to match the environment.
106
-
107
- This is the test that fails when the extra is bumped without moving the pin,
108
- which is the failure mode the single authoritative constant exists to prevent.
105
+ """The environment has to agree with the extra, not with a copied constant.
106
+
107
+ ``DEEPAGENTS_PIN`` is read back from the ``deepagents`` extra declared in
108
+ ``pyproject.toml``. This assertion therefore fails only when the installed
109
+ harness is *not* the declared one -- an out-of-sync environment -- which is
110
+ the drift that matters. It used to compare the installed wheel to a literal
111
+ copied into ``engine.py``, so every dependency bump failed it while the pin
112
+ silently drifted from the extra that actually shipped.
109
113
  """
110
114
  assert installed_deepagents_version() == PIN
111
115