An AI-governed software factory framework designed to programmatically enforce enterprise-grade architectural discipline, Infrastructure-as-Code (IaC), and secure CI/CD pipelines at generation time.
Modern autonomous developer tooling (Claude Code, GitHub Copilot, Gemini Code Assist) accelerates coding velocity. However, without deterministic structural guardrails, generated code frequently suffers from architectural drift, omitted non-functional requirements (NFRs), and unverified deployment scripts.
A2C operationalizes the core architectural thesis established in Context, Harness, and Evals: What the AI-Assisted SDLC Can Borrow from Distributed Systems:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β THE A2C GENERATION PIPELINE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. CONTEXT COMPILATION (G2C & P0) β
β β’ G2C: Compiles declarative OpenAPI/OData specifications into type-safe Pydantic contracts β
β β’ P0: Analyzes repository ASTs to project bounded, tenant-scoped workspace manifests β
ββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bounded, Typed Read-Model Context
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. HARNESS-GOVERNED GENERATION (A2C Core & E2A BaseAgent) β
β β’ Single public orchestrator entry point enforcing policy gates before model execution β
β β’ Multi-agent generation: CodeGenAgent, IaCAgent (Terraform), and CICDAgent (GitHub Actions) β
β β’ Ephemeral execution container sandboxes with scoped, non-amplifiable credentials β
ββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Proposed Code & IaC Artifacts
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. LAYERED VERIFICATION GATES (A2C CodeCriticAgent) β
β β’ Deterministic AST linting: Asserts Clean Architecture boundaries and required interfaces β
β β’ Factual groundedness: Evaluates RAGAS Faithfulness (score >= 0.85) against domain specs β
β β’ Static analysis: Programmatic secret scanning and SAST checks before Git packaging β
ββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββ΄βββββββββββββββββ
Pass β β Fail
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββ
β 4. DETERMINISTIC COMMIT & PR β β 5. SAGA COMPENSATING ROLLBACK β
β β’ Commits verified codebase & Terraform IaC β β β’ Cleanly rolls back ephemeral branch β
β β’ Registers deployment pipeline & telemetry β β β’ Preserves valid base scaffolding (P0) β
β β’ Verified audit trail to local outbox β β β’ Routes failure context to DLQ for SRE β
βββββββββββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββ
| Stakeholder Lens | Enterprise Risk Solved | How A2C Delivers Business Value |
|---|---|---|
| Chief Architect & VP of Eng | Architectural entropy & framework sprawl | Clean Architecture by Construction: Generated services automatically inherit strict interface contracts, ports, and adapters without developer shortcuts. |
| CISO & Enterprise Risk | Ungoverned AI code generation & secret leakage | Deterministic Pre-Commit Gates: AST static checks and SAST linters block commits containing hardcoded secrets, misconfigured permissions, or unvetted dependencies. |
| FinOps & Cloud Economics | Context window bloat & runaway generation costs | AST Context Pruning (P0): Strips syntactic noise and compiles minimal dependency closures (scaffold-config.json), optimizing LLM token budgets. |
| SRE & Platform Operations | Broken deployments & orphaned build artifacts | Saga Compensation Pattern: Automatically rolls back ephemeral branches and purges transient files upon downstream failure while preserving base scaffolding. |
| Product Leadership | Slow sprint velocity due to manual scaffolding | Zero-Day Production Readiness: Accelerates greenfield and modernization delivery cycles from weeks to minutes, generating production-grade services on day zero. |
The E2A Framework has a natural extension in A2C. E2A governs how runtime agentic AI applications execute safely. A2C applies E2A's own structural governance mechanisms (BaseAgent.run() with strict idempotency loops, latency SLO boundaries, policy enforcement, and automated quality evaluation gates) to generate code that itself complies with E2A standards.
The generator agent is governed by E2A. The output artifact is governed by E2A. Architecture is enforced structurally at generation time β not discovered later through costly production failures.
| Dimension | E2A Framework | A2C Framework |
|---|---|---|
| Core Target | Governs runtime agentic AI applications. | Generates governed enterprise software assets. |
| Input Interface | AgentState (query, intent, history). |
DevRequest (project_name, mandatory_nfrs, target_cloud). |
| Output Artifact | Validated agent responses, context-grounded RAG answers. | Production-grade microservice code, Terraform IaC, CI/CD pipelines. |
| Failure Mode | What Happens Without A2C | A2C Cloud-Native Solution |
|---|---|---|
| NFR Amnesia | Generated code lacks idempotency keys, circuit breakers, and telemetry. |
_apply_policy() injects 6 mandatory enterprise NFRs before any LLM generation call. |
| Architecture Drift | Business logic lands haphazardly inside HTTP route handlers; no clean service tiers. |
_build_messages() encodes Clean Architecture (Ports & Adapters) as an immutable contract. |
| Governance Gap | No policy-as-code or quality evaluation gates in generated code. |
CodeCriticAgent asserts pre-commit validation gates (NFR completeness |
| IaC Afterthought | Infrastructure is manually provisioned, untracked, and prone to configuration drift. |
IaCAgent generates modular production Terraform (AWS / GCP / Azure landing zones) as Phase 2 of the SDLC. |
| CI/CD Bolted On | Deployment lacks vulnerability scanning, automated rollback, or signed attestations. |
CICDAgent synthesizes complete GitHub Actions pipelines with OIDC, Trivy, and automated rollback. |
[ DevRequest ] (input: project_type, mandatory_nfrs, target_cloud)
β
βΌ
RequirementsAgent βββΆ Validates project_type, schema parameters, target cloud landing zone
β
βΌ
CodeGenAgent βββΆ Generates Clean Architecture microservice code & domain models
β
βΌ
IaCAgent βββΆ Generates modular Terraform (VPC, private subnets, ECS/Cloud Run/ACA)
β
βΌ
CICDAgent βββΆ Generates GitHub Actions with OIDC, Trivy, RAGAS gate, and auto-rollback
β
βΌ
CodeCriticAgent βββΆ Model review AND a deterministic NFR-pattern check (comments ignored); the lower score must be >= 0.75
β
βΌ
[ DevRequest ] βββΆ (output: generated_* fields, critic_report, artifacts written into the P0 workspace)
The agents are implemented in a2c_base.py on top of E2A's BaseAgent, BaseWorkflow, BaseToolService and BaseValidationService; SDLCWorkflow.execute(dev_request, config) is the entry point. By default the agents run in the NFR-first order of the Reference (Requirements β IaC β CodeGen: observability β CI/CD β CodeGen: NFR module β Critic; since v1.2 there is no generated business-service module: the service's entry point is its G2C-generated workflow); config['a2c_sequence'] = 'topology' runs the five agents once each in the order above. A DevRequest is validated by DevPlatformValidationService before the workflow starts, and artifacts are written only after the critic passes, each write conditional on the version read at the start of the run.
Each agent reaches the model through the inherited E2A LLM service (config['llm_service']), never a provider SDK. A different model for a specific step β for example a cheaper one for CodeCriticAgent β is an explicit per-call argument (critic.run(state, config, model_id=...)), not a mutation of shared config.
A2C is a meta-application of the E2A Architecture Framework. The same abstract class hierarchy that governs agentic AI systems is used here to build the developer platform that generates those systems.
- The agent is governed by E2A: Inherits single entry point execution, non-amplifiable credentials, and token budgets.
- The model call is decoupled: Generator and SDLC agents delegate inference to E2A's vendor-neutral
BaseLLMAgentServiceβ concurrency, RPM/TPM limits, DLP and typed failure semantics are inherited, and swapping provider is a binding change only. - Concurrent generation is bounded: with a configured idempotency store,
generate()andbootstrap()take an atomic claim per key (one owner, typedreplay/in_progress/conflict/recovery_requiredoutcomes), settle it on every exit path, and send every model call throughconfig['llm_service']. Shared abstract classes carry a compare-and-set ownership record, so saga compensation never deletes one it did not create. Seea2c_concurrency.pyand the smoke tests below. These run against in-memory test doubles; they have not been validated against a live store, a live inference gateway or production load. - The generated code follows E2A: Outputs Clean Architecture microservices with mandatory operational NFRs.
- Architecture is enforced structurally: Applied as a compiler constraint, not a prompt suggestion.
P0 extends A2C with Phase Zero scaffolding: generating everything an enterprise project requires before A2C generates domain business logic.
Why a separate class (not an extension): bootstrap() runs once per project at creation. SDLCAssistantAgent.run() runs whenever a new component is generated. Merging them would force re-scaffolding on every code generation call. The correct design: two independent classes composed via BootstrapAndGenerateWorkflow.
# Option 1 β Bootstrap only
bootstrapper = ProjectBootstrapperFactory.create(request)
result = bootstrapper.bootstrap(request)
# Option 2 β Full pipeline: P0 scaffold -> A2C generation
workflow = BootstrapAndGenerateWorkflow(config=config)
result = workflow.execute(request, config){
"scaffold": {
"runtime": "python",
"build_tool": "poetry",
"project_name": "SettlementEngine",
"platform": "aws"
},
"a2c": {
"enabled": true,
"project_type": "FastAPI Microservice",
"mandatory_nfrs": [
"Idempotency",
"Observability",
"TransactionalOutbox",
"CircuitBreaker"
]
}
}- Build and package definitions:
pyproject.toml/pom.xml/go.mod - Full directory tree structure: Strict adherence to Clean Architecture layers (domain, application, infrastructure, interfaces)
- Core environment configurations:
.gitignore,.env.example(generated from the centralE2A_CONFIGregistry, so generated projects share one configuration model),application.yml - Project governance:
README.md,LICENSE - Enterprise containerization: Multi-stage
Dockerfile(non-root UID 1001,HEALTHCHECK),.dockerignore - Automation:
Makefile,.github/workflows/(OIDC, lint, test, security scan)
See base_project_bootstrapper.py and scaffold-config-schema.json.
G2C is the declarative interface compilation layer of the stack. It uses E2A-governed generator classes to produce E2A abstract classes, A2C abstract classes, and their concrete inherited implementations via LLM.
The framework stack is self-generating.
E2AAbstractClassGenerator emits the full E2A abstract set β now nine classes including BaseLLMAgentService β so generated agents get config['llm_service'] delegation by construction. A repository that already holds an older e2a_base.py (no BaseLLMAgentService) should be treated as stale and regenerated before reuse; see docs/G2C_PHASE_TRIGGER_DECISION_REFERENCE.md.
| Generator Class | Output Generated | P0 Scaffold Included? |
|---|---|---|
E2AAbstractClassGenerator |
e2a_base.py or E2ABase.java |
No |
A2CAbstractClassGenerator |
a2c_base.py |
No |
E2AInheritedClassGenerator |
Abstract class + project scaffold + concrete agent class | Yes |
A2CInheritedClassGenerator |
E2A + A2C abstract classes + scaffold + SDLC subclass | Yes |
# DeveloperPlatformWorkflow chains all generators automatically
workflow = DeveloperPlatformWorkflow(config=config)
result = workflow.generate({
'generator_type': 'e2a_inherited',
'runtime': 'python',
'agent_name': 'SettlementAgent',
'user_prompt': 'SAP TM financial settlement agent with HMAC-SHA256 idempotency',
'output_path': './'
}, config)
# One call:
# 1. E2A base abstract class generated (abstract_class_source defaults to 'generate')
# 2. P0 scaffold, when request['scaffold'] is given (inline, inside the generator)
# 3. SettlementAgent class extending BaseAgent, written into the scaffold
# Every output passes GeneratorCriticAgent (score >= 0.75) before any file is written.
# Without config['llm_service'] the generators run in template mode (deterministic skeletons).Runtime-Agnostic Compilation: Generator classes are written in Python; generated output is Python, Java 21, Node.js, or Go based on request['runtime']. Zero generator code modifications are needed per runtime target.
See docs/G2C_FRAMEWORK_REFERENCE.md for the full specification and docs/G2C_PHASE_TRIGGER_DECISION_REFERENCE.md for which phases to run or skip for a given repository state.
a2c-framework/
βββ README.md Β· LICENSE
βββ docs/ A2C, G2C, G2C phase-trigger and P0 reference documents (.md, with PDF copies)
β βββ design/ HLD and LLD design documents with diagrams (p0/, g2c/, a2c/)
βββ a2c_base.py A2C β DevRequest, SDLCAssistantAgent and specialists,
β CodeCriticAgent, SDLCWorkflow, validation service, tools
βββ base_project_bootstrapper.py P0 β project bootstrap, BootstrapAndGenerateWorkflow
βββ base_generator_agent.py Β· inherited_generator.py Β· generator_templates.py
βββ e2a_abstract_class_generator.py Β· e2a_inherited_class_generator.py
βββ a2c_abstract_class_generator.py Β· a2c_inherited_class_generator.py
βββ generator_critic_agent.py Β· generator_factory.py
βββ developer_platform_workflow.py Β· generator_api_router.py Β· typedicts.py G2C
βββ a2c_concurrency.py claim store, shared-artifact ownership, deadlines
βββ smoke_test_generator_concurrency.py G2C/P0 concurrency (in-memory test doubles)
βββ smoke_test_g2c_contract.py G2C method contract: files, critic, chain, P0 inline, API
βββ smoke_test_a2c.py A2C workflow, critic, conditional writes, P0 -> A2C
βββ smoke_test_aidlc_integration.py E2A AI-DLC build over the real G2C, P0 and A2C
βββ scaffold-config-schema.json
βββ schemas/ generator-config-schema.json
βββ a2c_assets/ prompts/ (versioned generator prompts) and templates/ (template mode)
βββ a2c_template_llm.py Β· a2c_cli.py A2C template mode and the `aidlc-build` command
βββ examples/ scaffold and generator config examples
Run the tests (the A2C and AI-DLC ones need e2a-framework/reference checked out next to this repository, or E2A_REFERENCE_PATH set; the router checks need fastapi and httpx):
python smoke_test_generator_concurrency.py
python smoke_test_g2c_contract.py
python smoke_test_a2c.py
python smoke_test_aidlc_integration.py
python smoke_test_template_mode.py` covers v1.1.0 and v1.1.1: the G2C Java fix, P0 starters, template mode and `aidlc-build`.All of them use in-memory test doubles; nothing has been validated against a live store, a live inference gateway or production load.
e2a_base.py is intentionally not duplicated here: the single source of truth is e2a-framework/reference/e2a_base.py. Generated projects import it from the resolved shared-abstractions package.
| Document | Covers |
|---|---|
| A2C Framework Reference | Multi-agent SDLC workflow, NFR injection, critic gates |
| G2C Framework Reference | Generator classes and the unified generate() entry point |
| G2C Phase Trigger Decision Reference | Which of the seven phases run or skip for a given repository state |
| P0 Project Bootstrap Reference | bootstrap(), scaffold-config.json, directory trees per runtime |
| Design documents | HLD and LLD with diagrams for P0, G2C and A2C |
generates the E2A v1.2 agents, workflow, governance, validation, tool stubs and their tests (G2C);
settings in Terraform, the runtime and the code; models from the contracts; root workflows for a
monorepo; and a manifest so that aidlc-build --upgrade <project> can bring the scaffold to a later
A2C version. Examples: examples/requests/.
The model is bound from a profile (v1.4). A generated Python E2A service has a composition
root, services/bindings.py: bindings() calls e2a.bindings_from_profile(...) and
service_config() returns the config for workflow.execute(). The profile is
E2A_PROVIDER_PROFILE, else the request's a2c_sdlc.provider_profile (default simulated,
which ships with E2A and needs no account). To deploy on a managed provider, name its profile and
the package that provides it:
"a2c_sdlc": {"provider_profile": "anthropic_bedrock",
"provider_requirement": "e2a-managed-providers[anthropic-aws] @ git+https://..."}The generated tests always bind simulated, so they run without a provider account.
AI-DLC creates projects, and since v1.5 it also changes them. Every run, new or changed, ends the way a developer's own work does: a commit on a branch, authored by the developer, for a reviewed pull request (hub design note AD-01, checked against GitHub Copilot, GitLab Duo, Claude Code, Aider and the Linux kernel, Fedora and Apache policies).
aidlc-build --request request.json --output . --commitaidlc-change --project orders --prompt "Refuse orders above the customer's credit limit" --llm profile:anthropic_bedrock --signoff --pr- The developer is the author: the checkout's git identity, or in a workflow the person who started the run (the bot is only the committer). A run nobody can be identified for is refused.
- The tool is disclosed, not credited as a person:
Assisted-by: a2c-framework/<version>:<model>, withChange-Id,Prompt-Sha256and, in a workflow,AIDLC-Run.Signed-off-byonly when the developer passes--signoff: the tool never signs off on anyone's behalf. aidlc-changeplans the change, shows the plan, edits only what a developer could edit by hand (never a method E2A owns, never.a2c/, versions or dependencies; Terraform, CI and Dockerfiles only with--allow-infra), then verifies: compile, E2A conformance, secret scan, the critic's concurrency checks and the project's tests, with up to three attempts. If it still fails, nothing is committed: the last attempt is left inaidlc-change.patch.- As a developer would by hand: the version moves for the next release (semantic versioning),
CHANGELOG.mdgets an entry under Unreleased, tags stay manual..a2c/changes/<id>.jsonrecords the prompt (secrets redacted), the plan, the model, file hashes and the checks; one audit event per run goes to thea2c.auditlogger. - Workflows:
aidlc-scaffold.ymlandaidlc-change.ymlcommit as the developer (the bot is the committer) and keep the run's log and the model's answers.signed: true, for repositories that require signed commits: GitHub's bot authors and signs, the developer isCo-authored-by. - Python projects since v1.5.0; Java projects (Maven, e2a-java) since v1.5.1: the methods e2a-java
declares
finalare never touched, and Maven compiles and tests every attempt.
| a2c-framework | e2a-framework | capability-oriented-dsa (used by generated services) |
|---|---|---|
v1.5.4 |
v1.6.1 (and e2a-java 1.6.1 for Java) |
v0.2.x, v0.3.x |
v1.5.3 |
v1.6.1 (and e2a-java 1.6.1 for Java) |
v0.2.x, v0.3.x |
v1.5.2 |
v1.6.1 (and e2a-java 1.6.1 for Java) |
v0.2.x, v0.3.x |
v1.5.1 |
v1.6.1 (and e2a-java 1.6.1 for Java) |
v0.2.x, v0.3.x |
v1.5.0 |
v1.6.1 (and e2a-java 1.6.1 for Java) |
v0.2.x, v0.3.x |
v1.4.0 |
v1.6.1 (and e2a-java 1.6.1 for Java) |
v0.2.x, v0.3.x |
v1.3.0 |
v1.3.0 (and e2a-java 1.3.0 for Java) |
v0.2.x, v0.3.x |
v1.2.2 |
v1.2.2 |
v0.2.x, v0.3.x |
v1.2.1 |
v1.2.2 |
v0.2.x, v0.3.x |
v1.2.0 |
v1.2.0 |
v0.2.x, v0.3.x |
v1.1.2 |
v1.1.2 |
v0.2.x |
v1.1.1 |
v1.1.1 |
v0.2.0 |
v1.1.0 |
v1.1.0 |
v0.2.0 |
A2C operates as a core pillar of the enterprise generative AI and distributed systems ecosystem:
e2a-framework: The runtime governance substrate providing Template Method lifecycles, the vendor-neutralBaseLLMAgentService, MCP execution harnesses, and distributed idempotency locks.capability-oriented-dsa: governed algorithms with declared operations, used by the generated services for bounded matching and ranking.
Built with A2C. The three projects below began as architectural spikes (kept on their spike/v1-original branches) that informed this framework family. Their main branches are the completed projects: every service was generated by aidlc-build (P0 + G2C + A2C, template mode) from one request file, then completed by hand on the E2A contracts. The untouched scaffolds are on their aidlc/* branches.
| Project | Generated services | Target cloud (A2C landing zone) |
|---|---|---|
financial-settlement-platform |
settlement-service (Java 21, Maven), audit-ai-service (Python, Poetry) |
Azure |
aws-reconciliation-engine |
reconciliation-service (Python, Lambda) |
AWS |
order-to-cash-agentic-ai |
o2c-agent-service (Python, Cloud Run) |
Google Cloud |
Subham Gupta β Staff Architect Β· Distributed Systems & Enterprise Agentic Governance
13+ years building ledger-grade distributed systems at SAP scale.
Trademarks: AWS, GCP, Azure, Anthropic, Claude, OpenAI, and SAP belong to their respective owners and are used purely for architectural reference and nominative identification.
{ "context": {"project_name": "orders", "runtime": "python", "platform": "gcp", "repository_layout": "monorepo"}, "harness": { "agents": [{"name": "RouterAgent", "kind": "model", "output_schema": {...}}, {"name": "OrderAgent", "kind": "deterministic", "reads": ["get_price"], "writes": ["submit_payment"]}], "workflow": {"name": "OrderWorkflow", "steps": [{"step": "route", "agent": "RouterAgent"}, {"step": "act", "route_by": "intent", "agents": {"ORDER": "OrderAgent"}, "material": true}]}, "governance": {"stages": ["capacity", "token_budget", "firewall", "approval", "redaction"]} }, "a2c_sdlc": { "settings": [{"name": "LEDGER_URL"}, {"name": "LEDGER_TOKEN", "secret": true}], "contracts": ["contracts/order-event.v1.schema.json"] } }