feat(deliverables): pure-agent-dev reference implementation - #169
Merged
Conversation
Implements the 'Code Guide: pure-agent-dev' from Issue #63 — a provider-agnostic agent skeleton on FastAPI, with BytePlus ECS as the first adapter. The whole implementation defends one rule: agents/ must never depend on the BytePlus SDK Enforced by tests/test_architecture.py, which parses the real import graph rather than relying on a comment: api -> services -> agents -> providers.base -> adapter -> cloud SDK Layers: providers/base.py ComputeProvider ABC — the contract every cloud implements providers/mock.py in-memory provider, so CI needs no credentials providers/byteplus/ real adapter (shape complete, SDK calls TODO) agents/planner.py intent -> AgentTask (provider-free by design) agents/executor.py AgentTask -> provider, only via the interface api/deps.py the single place a provider is chosen and injected Provider selection is configuration, not code: COMPUTE_PROVIDER=mock|byteplus. Also adds the external contract that was implicit in the guide: schemas/agent-task.schema.json JSON Schema (draft 2020-12) pure_agent/schemas/task.py Pydantic model tests/test_schema_contract.py checks the two against each other, so they cannot drift. Verified: pytest 47 passed pytest -O 47 passed (no assert used as control flow) ruff check . clean JSON Schema valid draft 2020-12 app boots on mock provider no credentials required The deliverable contains .github/workflows/ci.yml, so pushing it needs the 'workflows' permission on the GitHub App.
Closed
fig-ai-agent Bot
added a commit
that referenced
this pull request
Sep 10, 2026
Adds the 2026-09-10 section with the deliverables/pure-agent-dev entry. Co-authored-by: fig-ai-agent <fig-ai-agent@users.noreply.github.com>
fig-ai-agent Bot
added a commit
that referenced
this pull request
Sep 10, 2026
CHANGELOG - [2026-09-10]: record PR #170, and a Fixed note for Issue #63 closing via PR #169 (squash 590b861). - Replace the stale `fix/sha-pin-all-workflows` note with the measured state: as of 2026-09-10 main's workflows still mix full SHAs with mutable tags (checkout@v4 x17, upload-artifact@v4 x6, setup-python@v5 x7, and others), and the pin fix needs write access to .github/workflows/ which the App lacks. README - Refresh the deliverables row: it listed suites that no longer match what is in the directory, and omitted pure-agent-dev, onspace-ai, firecrawl-fastapi and manus-client. - State the CI reality under 'Repository health & standards' instead of implying all checks are green: jobs fail at 'Set up job' on the org's SHA-pin policy, so a PR passing its own tests locally still shows red. Docs only - no code, no workflow files. Co-authored-by: fig-ai-agent <fig-ai-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the Code Guide: pure-agent-dev from #63 — a provider-agnostic agent skeleton on FastAPI, with BytePlus ECS as the first adapter.
42 files, +1401 lines. Placed in
deliverables/per repo convention; the main application tree is untouched.The rule this exists to enforce
That is the whole point of the guide, and a comment cannot hold it.
tests/test_architecture.pyparses the real import graph and fails if any layer reaches across the interface:Four guards, all failing on the real thing rather than a style rule:
agents/,services/,schemas/may not import any concrete adapteragents/may not mention a cloud SDK name at allapi/deps.pymay name a concrete adapterproviders.baseAdding an AWS adapter, then, is one new file plus one line of wiring — nothing above
providers/moves.Layers
providers/base.pyComputeProviderABC — the contract every cloud implementsproviders/mock.pyproviders/byteplus/TODO(byteplus))agents/planner.pyAgentTask, provider-free by constructionagents/executor.pyAgentTask→ provider, only through the interfaceapi/deps.pyProvider choice is configuration, not code:
COMPUTE_PROVIDER=mock|byteplus.Two contracts, checked against each other
The guide left the task shape implicit. It is now written twice on purpose:
schemas/agent-task.schema.json— the external contract (JSON Schema draft 2020-12)pure_agent/schemas/task.py— the runtime Pydantic modeltests/test_schema_contract.pyasserts they agree — including that the action enum is identical in both. Drift between those two is the failure that silently breaks every consumer, so it is a test, not a review note.Verification
pytestpytest -Oassertis doing control-flow workruff check .GET /health→ 200 on the mock provider, zero credentialsThe
-Orun is not ceremony: the first version ofexecutor.pyguardedinstance_idwith a bareassert, whichpython -Ostrips — turning the guard into a silentNonepassed to the provider. It is now araise.Scope and honesty
TODO(byteplus)). Signatures, return types and the interface are final; filling them in touches no other file. It cannot be validated against a real account from here.MockComputeProvider..github/workflows/changes. The bundleddeliverables/pure-agent-dev/.github/workflows/ci.ymlis a new file path, so it does not trip the App'sworkflowsrestriction — but it will not run until it is moved to the repo's own workflows directory by a maintainer.Closes #63.