Skip to content

Commit cf9d1f5

Browse files
Add agent-docs discovery pointers + CHANGELOG entry
src/openarmature/__init__.py module docstring first line points at the bundled AGENTS.md so the file shows in standard IDE hover (Pylance / Pyright on `import openarmature`). README gets a "For AI agents" section with the discovery one-liner adopters can point their own AGENTS.md / CLAUDE.md at. Repo-root AGENTS.md gains a disambiguating note distinguishing the two AGENTS.md files in the project: this one orients agents working ON openarmature; the bundled src/openarmature/AGENTS.md orients agents in user codebases that USE openarmature. CHANGELOG Unreleased section gains an Added entry covering the bundle + discovery surface + drift check + the submodule-pin discipline that prevents draft spec text from leaking into a release bundle.
1 parent d0bc5fa commit cf9d1f5

4 files changed

Lines changed: 31 additions & 4 deletions

File tree

AGENTS.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# AGENTS.md
22

3-
Orientation for coding agents working in this repo. `README.md` covers what
4-
the project is and how to use it; this file covers things that aren't
5-
obvious from reading the code.
3+
Orientation for coding agents working in **this repo** — i.e., agents
4+
contributing to openarmature itself. `README.md` covers what the project
5+
is and how to use it; this file covers things that aren't obvious from
6+
reading the code.
7+
8+
> **Two AGENTS.md files in this project. Different audiences.**
9+
>
10+
> - This file (`./AGENTS.md`, at the repo root) — for agents working on
11+
> the openarmature codebase. Package layout, test layout, tooling,
12+
> spec-submodule discipline, commit conventions.
13+
> - `src/openarmature/AGENTS.md` (shipped in the wheel) — for agents
14+
> working in user codebases that depend on openarmature. Capability
15+
> contracts, common patterns, non-obvious shapes, example index.
16+
> Generated by `scripts/build_agents_md.py` from canonical sources;
17+
> committed and CI-drift-checked.
618
719
## Spec is the source of truth
820

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). The
88

99
### Added
1010

11+
- **Bundled agent documentation at `openarmature/AGENTS.md`.** The wheel now ships a generated `AGENTS.md` file at the installed package root, agent-discoverable via `python -c "import openarmature; print(openarmature.__path__[0] + '/AGENTS.md')"`. Sections include a TL;DR, capability summaries pulled from the pinned spec submodule's §1 (Purpose) + §2 (Concepts), the patterns docs, hand-written non-obvious-shapes recipes, and a one-line example index. Generator lives at `scripts/build_agents_md.py`; the committed file is CI-drift-checked by `tests/test_agents_md_drift.py`. The submodule pin discipline (build refuses unless the submodule HEAD is reachable from a `v*` tag) prevents draft spec text from leaking into a release bundle. Adopting projects can point their own `AGENTS.md` / `CLAUDE.md` at this path so agent sessions in their codebase find it automatically.
1112
- **`FanOutInstanceProgress.result_is_error` field** (proposal 0027, accepted in spec v0.21.0). Explicit boolean discriminator on each per-instance entry in `CheckpointRecord.fan_out_progress``True` for `collect`-mode error contributions (roll forward into `errors_field`), `False` for success contributions (roll forward into `target_field`). The engine reads the explicit field on resume rather than inferring routing from `result`'s shape; the previous structural heuristic (`_looks_like_error_record`) is removed. Backward-compat path on load: pre-0027 records that omit the key default to `False`.
1213
- **Strict `CheckpointRecordInvalid` on fan-out count drift** (proposal 0029, accepted in spec v0.22.0). When the resumed run's resolved instance count differs from the saved `fan_out_progress` entry's `instance_count`, the engine raises `CheckpointRecordInvalid` before any fan-out instance work runs on the resumed path. Replaces the pre-0029 pad/truncate behavior which silently dropped `completed` contributions on shrink (breaking §10.11.1's exactly-once guarantee) and dispatched unsaved work on grow.
1314
- **`tool_choice` parameter on `Provider.complete()`** (proposal 0025, accepted in spec v0.20.0). Optional discriminated-union value constraining the model's tool-calling behavior — one of `"auto"`, `"required"`, `"none"`, or a `ForceTool(name=...)` record. Validation runs pre-send: `"required"` and `ForceTool` both demand non-empty `tools`, and `ForceTool.name` must appear in the supplied list; violations raise `ProviderInvalidRequest` (§7's existing category — no new error category). When `tool_choice` is `None` (the default) the wire field is omitted and the provider's own default applies, preserving pre-0025 behavior exactly. The `OpenAIProvider` maps the spec shape onto OpenAI's wire shape per §8.1.1 (the `ForceTool.type="tool"` renames to wire `type="function"`).

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,13 @@ A few things to notice:
195195
- **API reference**: auto-generated from docstrings. [openarmature.ai/reference](https://openarmature.ai/reference/)
196196
- **Examples**: ten runnable demos with walk-throughs. [openarmature.ai/examples](https://openarmature.ai/examples/) (source at [./examples/](./examples/))
197197
- **Spec**: behavioral contract this implementation conforms to. [LunarCommand/openarmature-spec](https://github.com/LunarCommand/openarmature-spec)
198+
199+
## For AI agents
200+
201+
If you're an AI agent working in code that uses openarmature, read the bundled agent docs before editing:
202+
203+
```bash
204+
python -c "import openarmature; print(openarmature.__path__[0] + '/AGENTS.md')"
205+
```
206+
207+
The file ships with the package and covers capability contracts, common patterns, non-obvious shapes, and an example index. Adopting projects can point their own `AGENTS.md` / `CLAUDE.md` at this path so agent sessions in their codebase find it automatically.

src/openarmature/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
"""OpenArmature: workflow framework for LLM pipelines and tool-calling agents."""
1+
"""OpenArmature: workflow framework for LLM pipelines and tool-calling agents.
2+
3+
AI agents: see ``AGENTS.md`` in this package for usage guidance
4+
(``python -c "import openarmature; print(openarmature.__path__[0] + '/AGENTS.md')"``).
5+
"""
26

37
__version__ = "0.8.0"
48
__spec_version__ = "0.22.1"

0 commit comments

Comments
 (0)