Skip to content

Commit 52b3289

Browse files
committed
Modularize CLI into a package and add tiered conformance checks
- Split monolithic cli.py (1020 lines) into teaagent/cli/ package with separate parser modules: _agent_parsers, _mcp_parsers, _memory_parsers, _misc_parsers, _model_parsers, plus __init__ and __main__ - Move is_loopback_host to mcp_http and enforce non-loopback security at the library level in build_mcp_http_server - Add tiered conformance (smoke/contract) with per-check granularity: non-empty response, exact content match, system prompt adherence, and token budget reporting - Simplify setup.py to delegate to pyproject.toml
1 parent 14c81d0 commit 52b3289

12 files changed

Lines changed: 1239 additions & 1062 deletions

docs/p2-scope.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
## Included
44

55
- In-memory Graph RAG primitives for entity/relation traversal and document retrieval.
6-
- Restricted Code Mode for deterministic local data manipulation with AST allow-list validation and child-process timeout/resource guardrails.
6+
- Restricted Code Mode with AST allow-list validation running in a child-process sandbox with CPU-time, wall-clock timeout, and best-effort memory limits (RLIMIT_AS/RLIMIT_CPU via `resource`). Container/VM-level isolation is still deferred.
77
- Stateless MCP request/response envelopes that carry capabilities and shared state per request.
8-
- Streamable HTTP transport for the MCP server with `Mcp-Session-Id` sessions, bearer-token/OAuth guardrails for non-loopback binds, and Origin allowlist (POST/GET/DELETE on `/mcp`).
8+
- Streamable HTTP transport for the MCP server with `Mcp-Session-Id` sessions, bearer-token/OAuth guardrails for non-loopback binds enforced at both the CLI and library level (`build_mcp_http_server` raises `ValueError` when bound to a non-loopback host without auth), and Origin allowlist (POST/GET/DELETE on `/mcp`).
99
- Managed-agent readiness checks for tool metadata, audit, budget, external state, and HITL gaps.
1010
- Provider portability checks for tool calling, structured output, system prompt support, prompt caching, and context limits.
11-
- Cross-provider live model conformance smoke checks with per-provider pass/fail/skip reporting.
11+
- Cross-provider live model conformance with layered `smoke` (non-empty response) and `contract` (exact content match, system-prompt adherence, token-budget reporting) tiers via `run_tiered_conformance`.
1212

1313
## Still Deferred
1414

1515
- Production GraphQLite deployment, migrations, and Cypher query tuning.
16-
- Strong production sandboxing for Code Mode using containers, V8 isolates, or a managed execution service.
16+
- Strong production sandboxing for Code Mode beyond the current child-process guardrails: containers, seccomp profiles, V8 isolates, or a managed execution service.
1717
- Production hardening for OAuth 2.1 / DPoP deployments, including key rotation and external client storage.
1818
- Actual managed runtime integration with Anthropic, OpenAI, Google ADK, or Vertex Agent Engine.
19-
- Deeper cross-provider conformance for streaming, structured output, tool calling, and provider-specific safety blocks.
19+
- Extended cross-provider conformance tiers for streaming, structured output, tool calling, latency budgets, and provider-specific safety/block taxonomy.
2020

2121
## P2 Extension Rules
2222

setup.py

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,6 @@
1-
from __future__ import annotations
1+
from setuptools import setup
22

3-
from setuptools import find_packages, setup
4-
5-
GRAPHQLITE_DEPS = ['graphqlite>=0.4.4', 'pysqlite3>=0.6.0']
6-
OAUTH_DEPS = ['cryptography>=3.4']
7-
TELEMETRY_DEPS = [
8-
'opentelemetry-api>=1.20',
9-
'opentelemetry-sdk>=1.20',
10-
'opentelemetry-exporter-otlp-proto-http>=1.20',
11-
]
12-
DEV_DEPS = [
13-
*GRAPHQLITE_DEPS,
14-
*OAUTH_DEPS,
15-
*TELEMETRY_DEPS,
16-
'pytest>=7',
17-
'pytest-cov>=4',
18-
'ruff>=0.4',
19-
'mypy>=1',
20-
]
21-
22-
23-
setup(
24-
name='teaagent',
25-
version='0.1.0',
26-
description='Minimal P0 agent harness with governance-first defaults.',
27-
packages=find_packages(),
28-
python_requires='>=3.9',
29-
install_requires=[],
30-
extras_require={
31-
'graphqlite': GRAPHQLITE_DEPS,
32-
'oauth': OAUTH_DEPS,
33-
'telemetry': TELEMETRY_DEPS,
34-
'dev': DEV_DEPS,
35-
},
36-
entry_points={'console_scripts': ['teaagent=teaagent.cli:main']},
37-
)
3+
# All project metadata and dependencies are declared in pyproject.toml.
4+
# This stub exists only for legacy editable-install compatibility with
5+
# tools that do not yet support PEP 517/660 without a setup.py present.
6+
setup()

0 commit comments

Comments
 (0)