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.

  1. 01

    Generate candidate recommendation

    RecommendationEngine.generate_recommendation() produces a domain-scoped suggestion (tasks, projects, assets, infrastructure, documents, or financial) along with confidence and rationale fields.

  2. 02

    Validate against ACGSIntegration

    ACGSIntegration checks the candidate against the configured YAML constitution (fail_closed=True) and writes an entry to its local tamper-evident AuditLogger.

  3. 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 SQLAlchemy AsyncSession and committed (with await 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.

backend/governance/acgs_integration.pyConditional import & fail_closed default
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_enabled

Terminology 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.

  1. 01

    Unreleased source repository: Not published to PyPI and has no GitHub release tags.

  2. 02

    Application-local database: Accepted recommendations persist to the application's configured SQLAlchemy database; they do not populate acgs-lite's EffectStore or Acgs-Swarm's APCC store.

  3. 03

    Verify acgs-lite installation: Confirm ACGS_AVAILABLE == True in your environment if you expect acgs-lite constitutional evaluation rather than the fallback RulesEngine.

Put one real workflow under your control.

Choose one tool. Define what it may do. Inspect what happens when a request crosses the boundary.