1. 📖 Project Story (Copy & Paste into the "About the Project" editor)

Inspiration

AI code assistants (like GitLab Duo Code Suggestions) have accelerated code generation by orders of magnitude. However, once code is pushed, the post-code development lifecycle becomes the primary driver of cloud waste:

• In multi-service architectures and monorepos, developers frequently commit small, localized changes to an isolated service, yet CI/CD pipelines trigger 100% of the entire test suite—wasting compute and generating unnecessary carbon emissions. • Existing test-skipping tools are dangerous: they lack deterministic safety boundaries and risk breaking production when shared core utilities change. • Meanwhile, many sustainability tools rely on vague "greenwashing" claims or unverified hardware sensor estimations.

We built EcoOps to bring the Software Carbon Intensity (SCI) Specification (ISO/IEC 21031) directly into GitLab CI/CD, demonstrating that an autonomous agent can cut cloud compute and emissions aggressively when safe, while mathematically guaranteeing production safety through fail-safe fallbacks. ──────

What it does

EcoOps operates autonomously within GitLab CI/CD pipelines:

  1. Intelligent AST Diff Analysis: Evaluates git diffs and commit context to determine the exact architectural blast radius of code changes.
  2. GitLab Dynamic Child Pipelines: Generates on-the-fly .gitlab-ci.yml downstream child pipelines running only the test suites mapped to the modified service.
  3. Deterministic Safety Fallback: If a shared core utility (core/base.py), dependency manifest (requirements.txt), Dockerfile, or CI configuration changes, EcoOps instantly overrides pruning and runs 100% of all tests across all services.
  4. Auditable ISO/IEC 21031 SCI Reporting: Calculates and logs operational emissions (E × I) per pipeline run using Google Cloud regional grid carbon data, disclosing power proxies (15 W/vCPU default) and data center PUE (1.10).
  5. Human-on-the-Loop Supervision: Exposes manual overrides (/ecoops full-suite) and full artifact traceability on every Merge Request. ────── ### How we built it • Zero-Dependency Engine: Written in standard Python with sub-millisecond execution, requiring no heavy external frameworks or runtime dependencies. • Native GitLab Architecture: Built natively on GitLab Dynamic Child Pipelines (generate-config → trigger-child) with complete parent-child status mirroring. • ISO/IEC 21031 SCI Math: Operational emissions modeled as:

Operational Emissions (gCO₂e) = E × I where E = Duration (hrs) × vCPU Count × Power Proxy (15 W) × PUE (1.10), multiplied by regional grid intensity factors.

• GitLab Duo Platform Alignment: Configured with formal Duo Agent specifications (.gitlab/agents/ecoops/config.yaml) and flow execution environments (.gitlab/duo/agent-config.yml). ──────

Challenges we ran into

• Anti-Abuse Verification on Cloud Runners: Free-tier SaaS runners require credit card verification for anti-crypto-mining policies. We solved this by architecting a lightweight, self-hosted Linux project runner communicating natively with GitLab.com. • YAML Scalar Grammar: GitLab's pipeline linter strictly validates nested scalar types. We eliminated YAML dictionary coercion errors by engineering clean multi-stage script generation. • Filter Separation: Ensuring non-code repository metadata (.gitignore, markdown documentation, licenses) does not inadvertently trigger full-suite test fallbacks. ──────

Accomplishments that we're proud of

• Measured 66.7% Emissions & Compute Reduction: Verified on live GitLab Merge Requests (dropping duration from 180s to 60s and operational emissions from 0.713 to 0.238 gCO₂e). • Zero-Breakage Production Safety: Verified on core changes where touching shared infrastructure immediately forced 100% full-suite execution. • Intellectual & Methodological Honesty: Explicitly disclosed all proxies (15 W/vCPU) and excluded embodied emissions (M) to avoid unverifiable cloud hardware claims. ──────

What we learned

Building autonomous agents for DevSecOps requires balancing autonomy with deterministic safety. Generative AI is ideal for natural language reasoning and risk explanation, but pipeline generation and safety guardrails must remain deterministic and auditable. ──────

What's next for EcoOps (7 SDLC Stages)

We are expanding EcoOps across the full 7-stage DevSecOps lifecycle:

• Plan: Carbon budget forecasting during sprint planning. • Verify: Dynamic test suite pruning and SCI emissions reporting (Active Prototype). • Secure: Threat-proportional security scanning based on modified modules. • Package: Container layer caching and green registry pruning. • Release: Carbon-aware release scheduling (delaying non-urgent deployments to clean grid hours). • Monitor: Real-time cluster power tracking. • Govern: Exportable enterprise ESG compliance audit reports.

Built With

  • ast
  • devsecops
  • dynamic-child-pipelines
  • gitlab
  • gitlab-ci
  • gitlab-duo
  • google-cloud
  • green-software
  • iso-iec-21031
  • pytest
  • python
  • sustainability
Share this project:

Updates

Submission history