Sample Domain Application · Unreleased Source · Python 3.11+ · AGPL-3.0
Gate AI recommendations before the database commit.
acgs-enterprise-ai-manager is a full-stack reference application in the 18-repository ACGS workspace. It pairs a FastAPI + async SQLAlchemy backend and Vue frontend with an acgs-lite governance wrapper that evaluates AI-generated recommendations before writing accepted records to the database.
Repository Facts · Source Inspection
- Repository
- acgs-ai/acgs-enterprise-ai-manager
- In-code version / HEAD
- 1.0.0 · 0c6067d / 6eece30
- Distribution status
- Source repository only (not on PyPI)
- Stack
- FastAPI · Async SQLAlchemy · Vue 3
- License
- AGPL-3.0
01 · Recommendation Gate Flow
Evaluate the suggestion before persisting the row.
In backend/api/recommendations.py, generating a recommendation runs through a three-step boundary before the async database session commits.
- 01
Generate candidate recommendation
RecommendationEngine.generate_recommendation()produces a domain-scoped suggestion (tasks,projects,assets,infrastructure,documents, orfinancial) along with confidence and rationale fields. - 02
Validate against ACGSIntegration
ACGSIntegrationchecks the candidate against the configured YAML constitution (fail_closed=True) and writes an entry to its local tamper-evidentAuditLogger. - 03
Reject blocked rows or commit accepted state
If governance blocks the recommendation, the endpoint raises
HTTPException(403)before touching the database. Accepted recommendations are added to the async SQLAlchemyAsyncSessionand committed (withawait db.rollback()on commit failure).
02 · Governance Wrapper Contract
How acgs_integration.py resolves the engine.
Unlike the 13 framework adapters that hard-require acgs-lite>=3.0.1,<4 in package metadata, backend/governance/acgs_integration.py imports acgs_lite conditionally and falls back to an internal RulesEngine when acgs-lite is not installed.
try:
from acgs_lite import Constitution, GovernanceEngine
ACGS_AVAILABLE = True
except ImportError:
ACGS_AVAILABLE = False
logging.warning("acgs-lite not installed. Install with: pip install acgs-lite")
class ACGSIntegration:
def __init__(
self,
constitution_path: Optional[str] = None,
fail_closed: bool = True,
audit_enabled: bool = True,
audit_dir: Optional[str] = None,
):
self.fail_closed = fail_closed
self.audit_enabled = audit_enabledTerminology note: this repository's README expands MACI as Monitor-Approve-Control-Inspect, which is distinct from acgs-lite's canonical four-role separation-of-powers enum (PROPOSER · VALIDATOR · EXECUTOR · OBSERVER). See the Canonical Glossary for details.
03 · FastAPI Application Surface
Authenticated routes under backend/main.py.
Every /api/v1 router in backend/main.py attaches Depends(get_current_user) and Depends(enforce_route_policy) alongside GovernanceMiddleware, RBACMiddleware, and AuthMiddleware.
recommendations
backend/api/recommendations.py#L99
Evaluates AI recommendations against governance rules before committing accepted rows to the async SQLAlchemy session.
tasks
backend/api/tasks.py
Task lifecycle and assignment records under /api/v1/tasks.
projects
backend/api/projects.py
Project metadata and status routes under /api/v1/projects.
assets & infrastructure
backend/api/assets.py · infrastructure.py
IT asset and infrastructure inventory endpoints.
documents & financial
backend/api/documents.py · financial.py
Document metadata and financial record endpoints.
search & reports
backend/api/search.py · reports.py
Full-text search and governance summary reporting routes.
04 · Scope & Persistence Boundaries
Keep the sample application's boundaries in view.
Evaluate acgs-enterprise-ai-manager as an application-level integration example rather than a shared infrastructure control plane.
- 01
Unreleased source repository: Not published to PyPI and has no GitHub release tags.
- 02
Application-local database: Accepted recommendations persist to the application's configured SQLAlchemy database; they do not populate
acgs-lite'sEffectStoreorAcgs-Swarm's APCC store. - 03
Verify acgs-lite installation: Confirm
ACGS_AVAILABLE == Truein your environment if you expectacgs-liteconstitutional evaluation rather than the fallbackRulesEngine.
Put one real workflow under your control.
Choose one tool. Define what it may do. Inspect what happens when a request crosses the boundary.