we are in the middle of bringing the rust binding back into this repo because the external split has caused too many issues
README.md— onboarding, install, examples, and current package usage notes.docs/ARCHITECTURE.md— module responsibilities, event flow, quality gates, technical-debt policy.docs/api/README.md— API reference index.docs/releasing-alchemy-binding.md— current release workflow and migration notes for wheels that shiptinyagent._alchemy.HARNESS.md— critical enforcement document for this repo: pre-commit hooks, ratchets, and rule entry points.tests/architecture/test_import_boundaries.py— enforced layer contract for the Python package.
tinyagent/— published Python package.__init__.py— public exports.agent.py— high-levelAgentAPI and state management.agent_loop.py— orchestration loop.agent_tool_execution.py— concurrent tool execution.agent_types.py— shared message, event, and state models.alchemy_provider.py— Python bridge for thetinyagent._alchemyprovider path.proxy.py,proxy_event_handlers.py— proxy streaming path.caching.py— prompt caching helpers.
tests/— unit and contract tests.tests/architecture/— import-boundary enforcement.docs/api/— per-module reference docs.docs/harness/tool_call_types_harness.py— live typed tool-call harness.rules/— ast-grep rules fordocs/harness/.scripts/— custom lint/consistency checks and smoke scripts.examples/— runnable usage examples.static/images/— repo assets used by docs/README.
uv run pytestuv run mypy --ignore-missing-imports --exclude "lint_file_length\\.py$" .python3 scripts/lint_architecture.py.venv/bin/python -m pytest tests/architecture/test_import_boundaries.py -x -quv run vulture --min-confidence 80 tinyagentuv run pylint --disable=all --enable=duplicate-code tinyagentpython3 scripts/lint_debt.pypython3 scripts/check_release_binding.pypython3 scripts/check_release_binding.py --require-present— run before building/publishing wheels that are expected to ship_alchemyuv run python docs/harness/tool_call_types_harness.pysg scan -r rules/harness_no_duck_typing.yml docs/harness/sg scan -r rules/harness_no_thin_protocols.yml docs/harness/
- Layer order is enforced in
tests/architecture/test_import_boundaries.py:- Layer 3:
agent - Layer 2:
agent_loop,proxy - Layer 1:
agent_tool_execution,alchemy_provider,proxy_event_handlers,caching - Layer 0:
agent_types
- Layer 3:
agent_types.pymust remain the leaf module among governed TinyAgent modules.- Rust binding implementation work is allowed in this repo as part of the migration back from the external split.
- Keep Rust binding changes isolated from the core Python layer boundaries unless a cross-layer change is required.
tinyagent/__init__.pyis the public package surface; keep exports aligned withscripts/lint_architecture.pyconstraints.
- Product overview and examples:
README.md - Architecture and repo policies:
docs/ARCHITECTURE.md - API details:
docs/api/README.md,docs/api/*.md - Alchemy wheel-release workflow:
docs/releasing-alchemy-binding.md - Packaging/build config for this repo:
pyproject.toml - Critical repo enforcement harness:
HARNESS.md - Enforced checks:
.pre-commit-config.yaml,scripts/*.py - Import boundaries:
tests/architecture/test_import_boundaries.py - Harness-specific rules:
rules/README.md,rules/*.yml - Historical external binding repo:
https://github.com/alchemiststudiosDOTai/alchemy-rs - Do not file binding/runtime issues against
tunahorse/tinyagent-alchemy; usealchemiststudiosDOTai/alchemy-rsif an external alchemy issue is needed during migration
- Do not add
.envloading ordotenvimports insidetinyagent/. - Provider modules must not mutate
os.environ. - No free-form
TODO/FIXME/HACK/XXX/DEBTmarkers; use the ticketed format documented indocs/ARCHITECTURE.mdand enforced byscripts/lint_debt.py. - Keep docs in this repo aligned with the Python package and the in-repo Rust binding migration status.
- Rust-binding source, build steps, and release rules may now live in this repo when they are part of restoring the binding here.
- During the migration, prefer keeping the Python-facing
tinyagent._alchemycontract stable even if the build/release internals change. - Treat
HARNESS.mdand the enforcement harness it describes as critical repo infrastructure. They are not optional process notes. - If a codebase rule matters, record it in
HARNESS.mdand back it with a typed check, hook, script, test, or rule file. - Prefer code-level enforcement over prose-only policy. Important rules should be enforced in
.pre-commit-config.yaml,scripts/*.py,tests/architecture/, orrules/whenever practical. - If you add or rename a governed package module, update
tests/architecture/test_import_boundaries.py. - If you change
docs/harness/, rerun the ast-grep rules inrules/.
- Every listed path still exists.
- Every listed command still matches current config, docs, or scripts.
- Docs are updated when public API, usage contracts, or Rust-binding ownership/build rules change.
- Release/build instructions match the actual binding workflow used by this repo.
HARNESS.mdstays aligned with the actual enforced hooks, ratchets, and rule entry points.- Layer checks pass after import changes.
AGENTS.mdstays compact and points outward instead of duplicating docs.