Skip to content

Commit f936af6

Browse files
committed
Narrow top-level teaagent API to a stable core surface
- Strip teaagent/__init__.py __all__ from ~100 symbols to ~18 core runtime symbols (AgentRunner, RunBudget, ToolRegistry, etc.) - Derive __version__ from importlib.metadata (dynamic from installed package) instead of a static string - Update pyproject.toml description from "Minimal P0 agent harness" to "Governance-first agent harness for autonomous coding tasks" - Add docs/migration-top-level-api.md with guidance for consumers - Mark OpenTelemetry, OAuth 2.1/DPoP, MCP transport, and agentic RAG as implemented in p0-scope.md and p1-scope.md
1 parent b09b200 commit f936af6

8 files changed

Lines changed: 105 additions & 64 deletions

File tree

AGENT.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
# Role
2-
You are a highly analytical metacognitive agent. You do not just provide answers; you relentlessly evaluate your own reasoning.
1+
# Agent Prompt Note
32

4-
# Workflow Protocol
5-
For every task, you MUST output your response in the following strict format:
3+
`AGENT.md` is retained for compatibility with tools that look for this filename.
64

7-
<Prior_Hypothesis>
8-
State your immediate intuition or first-draft approach to the problem based on your current knowledge.
9-
</Prior_Hypothesis>
10-
11-
<Evidence_Requirement>
12-
Identify what external data, factual verification, or tool execution (via MCP) is required to prove or disprove your hypothesis. What are the blind spots?
13-
</Evidence_Requirement>
14-
15-
<Self_Critique>
16-
Assume your prior hypothesis is flawed. Play the devil's advocate. List at least two critical vulnerabilities or logical fallacies in your initial approach.
17-
</Self_Critique>
18-
19-
<Posterior_Execution>
20-
Synthesize the critique and formulate a refined, robust, and finalized execution plan or answer.
21-
</Posterior_Execution>
5+
The canonical runtime instructions for this repository are defined in `AGENTS.md`.
6+
If both files are discovered by an external runner, prefer `AGENTS.md`.

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ model or reviewed skills.
77
## Setup
88

99
```bash
10+
python3 -m venv .venv
11+
source .venv/bin/activate
12+
python3 -m pip install --upgrade pip
1013
python3 -m pip install -e ".[dev,oauth,telemetry]"
1114
pre-commit install
1215
```

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ See [docs/architecture.md](docs/architecture.md) for component details, data flo
3232
pip install -e .
3333
```
3434

35+
On macOS/Homebrew Python (PEP 668), prefer a virtual environment:
36+
37+
```bash
38+
python3 -m venv .venv
39+
source .venv/bin/activate
40+
python3 -m pip install --upgrade pip
41+
pip install -e ".[dev]"
42+
```
43+
3544
Or without the console script:
3645

3746
```bash

docs/migration-top-level-api.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Top-level API Migration Note
2+
3+
This release narrows `teaagent` top-level exports (`teaagent.__all__`) to a stable core surface.
4+
5+
## What changed
6+
7+
- `from teaagent import *` now exports only core runtime symbols.
8+
- Advanced utilities and subsystem-specific symbols remain importable from their module paths.
9+
10+
## Recommended migration
11+
12+
- Replace star imports with explicit imports.
13+
- Import non-core symbols from submodules, for example:
14+
15+
```python
16+
from teaagent.graph_rag import KnowledgeGraph
17+
from teaagent.oauth21 import OAuth21AuthorizationServer
18+
from teaagent.telemetry import TelemetryConfig
19+
```
20+
21+
## Removed from `teaagent.__all__`
22+
23+
- AIBOM/skill/eval: `AIBOMManifest`, `EvalCase`, `EvalReport`, `SkillReviewResult`, `build_aibom`, `review_skill`, `run_eval`
24+
- Retrieval and graph: `Document`, `GraphEdge`, `InMemoryRetriever`, `KnowledgeGraph`, `agentic_retrieve`, `graph_retrieve`
25+
- LLM internals: `LLMMessage`, `LLMRequest`, `LLMResponse`, `ProviderConfig`, `check_llm_configuration`, `create_llm_adapter`, `route_model`
26+
- OAuth/DPoP: `OAuth21AuthorizationServer`, `OAuth21ResourceServer`, `OAuthStore`, `SQLiteOAuthStore`, `create_jwt`, `verify_jwt`
27+
- Telemetry: `TelemetryConfig`, `OTelAuditSink`, `OTelMetricsSink`, `configure_telemetry`, `configure_metrics`
28+
- MCP/transport extras: `build_mcp_http_server`, `serve_mcp_http`, `serve_mcp_stdio`, `handle_mcp_request`, `handle_stateless_tool_request`
29+
30+
This change only affects top-level export convenience. Module-level imports continue to work.

docs/p0-scope.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@
1111

1212
## Deferred
1313

14-
- Real MCP transport and OAuth 2.1 / DPoP.
1514
- External state store such as Postgres or Redis.
16-
- OpenTelemetry trace export.
17-
- Agentic RAG, A2A, and multi-agent orchestration.
15+
- A2A runtime and cross-agent registry/runtime orchestration.
1816
- LLM-as-Judge and offline eval automation.
1917

18+
## Implemented Since P0 Baseline
19+
20+
- MCP transport is available (stdio plus Streamable HTTP).
21+
- OAuth 2.1 / DPoP primitives are implemented for authorization/resource server flows.
22+
- OpenTelemetry integration is available through telemetry sinks.
23+
- Agentic RAG primitives are implemented (lexical + fusion path), with advanced retrieval still iterative.
24+
2025
## Pilot Assumption
2126

2227
The first pilot should be a low-risk internal workflow with 3-5 tools. Destructive operations must be simulated or gated until HITL is fully integrated.

docs/p1-scope.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111

1212
## Still Deferred
1313

14-
- Real OpenTelemetry exporter.
1514
- Real vector database, SQL MCP, or web search MCP integrations.
1615
- LLM-as-Judge scoring.
1716
- A2A runtime and AgentCard registry.
18-
- OAuth 2.1 / DPoP enforcement.
17+
18+
## Implemented Since P1 Baseline
19+
20+
- OpenTelemetry exporter path is implemented via telemetry sinks/configuration.
21+
- OAuth 2.1 / DPoP primitives and enforcement hooks are implemented for MCP HTTP deployment guardrails.
1922

2023
## Extension Points
2124

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "teaagent"
77
version = "0.1.0"
8-
description = "Minimal P0 agent harness with governance-first defaults."
8+
description = "Governance-first agent harness for autonomous coding tasks."
99
readme = "README.md"
1010
requires-python = ">=3.9"
1111
license = {file = "LICENSE"}

teaagent/__init__.py

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
"""Governance-first agent harness."""
22

3-
__version__ = '0.1.0'
3+
from importlib.metadata import PackageNotFoundError, version
4+
5+
try:
6+
__version__ = version('teaagent')
7+
except PackageNotFoundError:
8+
__version__ = '0+local'
49

510
from teaagent.aibom import AIBOMManifest, build_aibom
611
from teaagent.audit import AuditLogger
@@ -128,6 +133,7 @@
128133
)
129134

130135
__all__ = [
136+
'__version__',
131137
'AIBOMManifest',
132138
'AgentRunner',
133139
'ApprovalPolicy',
@@ -140,6 +146,7 @@
140146
'CodeModeSandbox',
141147
'ContainerCodeModeBackend',
142148
'ContextCompactor',
149+
'DPoPValidationResult',
143150
'Decision',
144151
'Document',
145152
'EvalCase',
@@ -150,9 +157,17 @@
150157
'GraphQLiteGraphStore',
151158
'GraphQLiteRuntimeError',
152159
'GraphQLiteUnavailableError',
160+
'HAS_CRYPTOGRAPHY',
161+
'HAS_OTEL',
153162
'Heartbeat',
163+
'InMemoryMetricsSink',
164+
'InMemoryOAuthStore',
154165
'InMemoryRetriever',
155166
'IntentScore',
167+
'InvalidClientError',
168+
'InvalidDPoPError',
169+
'InvalidGrantError',
170+
'JWTError',
156171
'KnowledgeGraph',
157172
'LLMConfigurationError',
158173
'LLMHTTPError',
@@ -166,88 +181,79 @@
166181
'MetricSnapshot',
167182
'ModelConformanceReport',
168183
'ModelConformanceResult',
169-
'ModelRoute',
170184
'ModelDecisionEngine',
185+
'ModelRoute',
186+
'OTelAuditSink',
187+
'OTelMetricsSink',
188+
'OAuth21AuthorizationServer',
189+
'OAuth21Client',
190+
'OAuth21ResourceServer',
191+
'OAuth21TokenClaims',
192+
'OAuth21TokenResponse',
193+
'OAuthKeyRing',
194+
'OAuthStore',
171195
'PermissionMode',
172196
'PortabilityResult',
173197
'PreflightReport',
174198
'PromptBundle',
175-
'ProviderProfile',
176199
'ProviderConfig',
200+
'ProviderProfile',
177201
'ReadinessReport',
178202
'RunBudget',
179203
'RunStore',
180204
'RunSummary',
205+
'SQLiteOAuthStore',
181206
'SkillReviewResult',
182207
'StatelessMCPRequest',
183208
'StatelessMCPResponse',
209+
'TelemetryConfig',
210+
'TelemetryNotAvailable',
184211
'ToolAnnotations',
185212
'ToolRegistry',
186213
'ToolRequest',
187214
'TraceRecorder',
215+
'TracingHTTPTransport',
188216
'UltraworkStore',
189217
'UnsafeCodeError',
190218
'WorkerRecord',
191219
'WorkspaceToolConfig',
192-
'HAS_OTEL',
193-
'InMemoryMetricsSink',
194-
'OTelAuditSink',
195-
'OTelMetricsSink',
196-
'TelemetryConfig',
197-
'TelemetryNotAvailable',
198-
'TracingHTTPTransport',
199-
'configure_metrics',
200-
'configure_telemetry',
201220
'agentic_retrieve',
221+
'assemble_agent_prompt',
202222
'assess_managed_agent_readiness',
203223
'assess_provider_portability',
204224
'available_providers',
205-
'assemble_agent_prompt',
206225
'build_aibom',
207226
'build_mcp_http_server',
208227
'build_task_spec',
209-
'HAS_CRYPTOGRAPHY',
210-
'DPoPValidationResult',
211-
'InMemoryOAuthStore',
212-
'InvalidClientError',
213-
'InvalidDPoPError',
214-
'InvalidGrantError',
215-
'JWTError',
216-
'OAuth21AuthorizationServer',
217-
'OAuth21Client',
218-
'OAuth21ResourceServer',
219-
'OAuth21TokenClaims',
220-
'OAuth21TokenResponse',
221-
'OAuthKeyRing',
222-
'OAuthStore',
223-
'SQLiteOAuthStore',
224-
'compute_jwk_thumbprint',
225-
'compute_s256_challenge',
226-
'create_jwt',
227-
'decode_jwt_unsafe',
228-
'generate_code_verifier',
229-
'verify_jwt',
230228
'build_workspace_tool_registry',
231229
'check_graphqlite_runtime',
232230
'check_llm_configuration',
233231
'clarify_task',
234232
'classify_task',
233+
'compute_jwk_thumbprint',
234+
'compute_s256_challenge',
235+
'configure_metrics',
236+
'configure_telemetry',
237+
'create_jwt',
235238
'create_llm_adapter',
236-
'execute_code_mode',
239+
'decode_jwt_unsafe',
237240
'ensure_sqlite_extension_loading',
241+
'execute_code_mode',
242+
'generate_code_verifier',
238243
'graph_retrieve',
239244
'handle_mcp_request',
240245
'handle_stateless_tool_request',
241246
'parse_model_decision',
242247
'parse_permission_mode',
243248
'preflight',
244-
'review_skill',
245-
'route_model',
246249
'register_subagent_tool',
247250
'register_workspace_tools',
248-
'serve_mcp_http',
249-
'serve_mcp_stdio',
251+
'review_skill',
252+
'route_model',
250253
'run_chat_agent',
251254
'run_eval',
252255
'run_model_conformance',
256+
'serve_mcp_http',
257+
'serve_mcp_stdio',
258+
'verify_jwt',
253259
]

0 commit comments

Comments
 (0)