feat(state,adapters): state store abstraction, postgres backend, governed adapters#1233
Draft
ohdearquant wants to merge 1 commit into
Draft
feat(state,adapters): state store abstraction, postgres backend, governed adapters#1233ohdearquant wants to merge 1 commit into
ohdearquant wants to merge 1 commit into
Conversation
…config resolution Extracted from PR #1187 — contains only state backend and adapter code, no docs/adrs, no work/runtime/governance modules. New files: - lionagi/state/store.py — StateStore abstraction (SQLite + Postgres) - lionagi/state/artifacts.py — ArtifactStore with content-addressed storage - lionagi/state/postgres.py — PostgresStore backend (asyncpg-based) - lionagi/state/schema_pg.sql — Postgres DDL - lionagi/adapters/governed_base.py — GovernedAdapter base class - lionagi/adapters/anthropic_agents.py — GovernedAnthropicAgent - lionagi/adapters/crewai.py — GovernedCrew - lionagi/adapters/langchain.py — GovernedChain - lionagi/adapters/openai_agents.py — GovernedOpenAIAgent - lionagi/config_resolution.py — resolve_config() helper Modified (state layer improvements): - lionagi/state/db.py — transaction() context manager, deferred-commit helper, and savepoints for nested transactions - lionagi/state/health.py, persist.py, provenance.py, reasons.py, staleness.py, schema.sql — updated schema and helper functions - lionagi/adapters/__init__.py — wires in governed adapter exports Tests: 433 pass, 1 skip (tests/state/, tests/adapters/, tests/test_config_resolution.py). Ruff clean on all changed .py files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Summary
StateStoreabstraction +PostgresStorebackend +ArtifactStoreGovernedAnthropicAgent,GovernedCrew,GovernedChain,GovernedOpenAIAgentconfig_resolution.pyfor project-level config resolutionStateDBwith transaction context manager + savepoint support for nested transactionsschema_pg.sql)Extracted from #1187 (stripped ADR docs).
Test plan
uv run pytest tests/state/ tests/adapters/ tests/test_config_resolution.py— 433 pass, 1 skip🤖 Generated with Claude Code