Skip to content

feat: v0.4.0 — Scope 3 embodied carbon, water tracking, binary build#10

Merged
omrdev1 merged 1 commit into
mainfrom
feat/v0.4.0
Mar 27, 2026
Merged

feat: v0.4.0 — Scope 3 embodied carbon, water tracking, binary build#10
omrdev1 merged 1 commit into
mainfrom
feat/v0.4.0

Conversation

@omrdev1
Copy link
Copy Markdown
Owner

@omrdev1 omrdev1 commented Mar 27, 2026

What this closes

The two outstanding items from the original roadmap: embodied carbon (Scope 3) and water consumption tracking. Plus the binary build workflow. Nothing removed, everything additive.


1. Scope 3 Embodied Carbon

Every resource now reports manufacturing lifecycle carbon alongside operational carbon:

embodied_gco2e/month = (1,200,000g / 35,040h lifespan / 48 vCPUs) × vcpus × 730h
  • Source: Cloud Carbon Footprint DELL R740 baseline (v3)
  • ARM (Graviton) applies 20% discount — smaller die size + lower manufacturing TDP
  • All 40 instances in factors.json updated with embodied_co2e_grams_per_month

2. Water Consumption

water_litres = (W_effective × 730h / 1000) × WUE_litres_per_kwh
  • Source: AWS 2023 Sustainability Report (WUE by region)
  • WUE applied to IT load before PUE, matching AWS definition
  • All 14 regions updated with water_intensity_litres_per_kwh
  • Range: eu-north-1 (0.10 L/kWh) → ap-south-1 Mumbai (0.72 L/kWh)

3. Updated PR Comment Output

The live PR comment now shows all four dimensions:

Metric Monthly Total
🔋 Scope 2 — Operational CO2e 7.06kg
🏭 Scope 3 — Embodied CO2e 1.88kg
🌍 Total Lifecycle CO2e 8.93kg
💧 Water Consumption 7.5L
💰 Infrastructure Cost $126.29/month

Resource breakdown table adds Scope 3 and Water columns.

4. Binary Build Workflow

.github/workflows/release-binaries.yml — triggers on v* tags:

  • Builds 5 platform binaries via Bun compile
  • Smoke tests each binary (--version, --coverage)
  • Attaches to GitHub Release via softprops/action-gh-release@v2
  • Platforms: linux-x64, linux-arm64, darwin-arm64, darwin-x64, windows-x64

5. Documentation

  • METHODOLOGY.md: full rewrite with Scope 2/3 formulas, water formulas, worked examples, WUE table per region, recommendation scoring formula, full data sources table, known limitations
  • README.md: full rewrite with real live terminal output showing all dimensions, binary install section, quickstart, policy, coverage matrix

Tests

63 tests, 63 passing. json.test.ts now uses the real engine — no mock data.

## Scope 3 Embodied Carbon (engine.ts, factors.json v1.3.0)
- Added embodied_co2e_grams_per_month to all 40 instances in factors.json
- Formula: (1,200,000g / 35,040h / 48 vCPUs) × vcpus × 730h
- ARM (Graviton) applies 20% discount — smaller die, lower manufacturing TDP
- Source: Cloud Carbon Footprint DELL R740 baseline (v3)
- Returns embodiedCo2eGramsPerMonth and totalLifecycleCo2eGramsPerMonth per resource

## Water Consumption (engine.ts, factors.json v1.3.0)
- Added water_intensity_litres_per_kwh to all 14 regions in factors.json
- Formula: (W × 730h / 1000) × WUE_litres_per_kwh
- WUE applied to IT load (before PUE), matching AWS definition
- Source: AWS 2023 Sustainability Report
- Returns waterLitresPerMonth per resource
- eu-north-1 (0.10 L/kWh) and us-west-2 (0.18 L/kWh) are lowest
- ap-south-1 (Mumbai, 0.72 L/kWh) is highest

## Updated Types (types.ts)
- EmissionAndCostEstimate: embodiedCo2eGramsPerMonth, totalLifecycleCo2eGramsPerMonth, waterLitresPerMonth
- scope changed from SCOPE_2_OPERATIONAL to SCOPE_2_AND_3
- assumptionsApplied: embodiedCo2ePerVcpuPerMonthApplied, waterIntensityLitresPerKwhApplied
- PlanAnalysisResult.totals: currentEmbodiedCo2eGramsPerMonth, currentLifecycleCo2eGramsPerMonth, currentWaterLitresPerMonth

## Updated Formatters
- markdown.ts: headline table with all 4 dimensions (Scope 2, Scope 3, lifecycle, water, cost)
  resource breakdown adds Scope 3 CO2e and Water columns
  footer updated to reflect full Scope 2 + 3 coverage
- table.ts: Scope 2, Scope 3, Water columns in terminal output
  totals line shows Scope 2 / Scope 3 / Lifecycle / Water / Cost

## Binary Build Workflow (.github/workflows/release-binaries.yml)
- Triggers on v* tags and workflow_dispatch
- Builds 5 platform binaries via Bun compile:
  linux-x64, linux-arm64, darwin-arm64, darwin-x64, windows-x64
- Smoke tests each binary (--version, --coverage)
- Attaches all binaries to GitHub Release via softprops/action-gh-release@v2

## Documentation
- METHODOLOGY.md: full rewrite with Scope 2/3 formulas, water formulas,
  worked examples, WUE table, recommendation scoring, data sources, known limitations
- README.md: full rewrite with real live output (Scope 2/3/water columns),
  quickstart, suggestions, policy, coverage matrix, maths section

## Tests
- 63 tests, 63 passing
- json.test.ts now uses real engine output — no mock data
- formatter tests updated with full totals shape
- engine.test.ts: scope assertion updated to SCOPE_2_AND_3
@github-actions
Copy link
Copy Markdown

🌱 GreenOps Infrastructure Impact

Metric Monthly Total
🔋 Scope 2 — Operational CO2e 7.06kg
🏭 Scope 3 — Embodied CO2e 1.88kg
🌍 Total Lifecycle CO2e 8.93kg
💧 Water Consumption 7.5L
💰 Infrastructure Cost $126.29/month

Potential Scope 2 Savings: -6.90kg CO2e/month (97.7%) | -$5.11/month
💡 Found 2 optimization recommendations.

Resource Breakdown

Resource Type Region Scope 2 CO2e Scope 3 CO2e Water Cost/mo Action
aws_instance.web m5.large us-east-1 4.31kg 1.04kg 4.6L $70.08 💡 View Recommendation
aws_instance.worker m6g.large us-east-1 2.74kg 0.83kg 2.9L $56.21 💡 View Recommendation

Recommendations

aws_instance.web

  • Current: m5.large in us-east-1
  • Suggested: m5.large in eu-north-1
  • Scope 2 Impact: -4.21kg CO2e/month | +$2.92/month
  • Rationale: Moving m5.large from us-east-1 to Europe (Stockholm) (eu-north-1) reduces Scope 2 grid carbon intensity from 384.5g to 8.8g CO2e/kWh, saving 4215g CO2e/month (note: cost increases by $2.92/month). Water consumption also decreases by 3.6L/month.

aws_instance.worker

  • Current: m6g.large in us-east-1
  • Suggested: m6g.large in eu-north-1
  • Scope 2 Impact: -2.68kg CO2e/month | +$2.19/month
  • Rationale: Moving m6g.large from us-east-1 to Europe (Stockholm) (eu-north-1) reduces Scope 2 grid carbon intensity from 384.5g to 8.8g CO2e/kWh, saving 2681g CO2e/month (note: cost increases by $2.19/month). Water consumption also decreases by 2.3L/month.

Emissions calculated using the Open GreenOps Methodology Ledger v1.3.0. Scope 2 (operational) and Scope 3 (embodied) emissions tracked. Water consumption estimated from AWS 2023 WUE data. Math is MIT-licensed and auditable. Analysed at 2026-03-27T18:57:09.985Z.

🏢 GreenOps Dashboard — aggregate carbon data across all your repositories, set team budgets, and export ESG reports. Join the waitlist · Coming soon.

@omrdev1 omrdev1 merged commit 9a3a51f into main Mar 27, 2026
2 checks passed
@omrdev1 omrdev1 deleted the feat/v0.4.0 branch March 28, 2026 10:48
omrdev1 added a commit that referenced this pull request May 19, 2026
…10)

## Scope 3 Embodied Carbon (engine.ts, factors.json v1.3.0)
- Added embodied_co2e_grams_per_month to all 40 instances in factors.json
- Formula: (1,200,000g / 35,040h / 48 vCPUs) × vcpus × 730h
- ARM (Graviton) applies 20% discount — smaller die, lower manufacturing TDP
- Source: Cloud Carbon Footprint DELL R740 baseline (v3)
- Returns embodiedCo2eGramsPerMonth and totalLifecycleCo2eGramsPerMonth per resource

## Water Consumption (engine.ts, factors.json v1.3.0)
- Added water_intensity_litres_per_kwh to all 14 regions in factors.json
- Formula: (W × 730h / 1000) × WUE_litres_per_kwh
- WUE applied to IT load (before PUE), matching AWS definition
- Source: AWS 2023 Sustainability Report
- Returns waterLitresPerMonth per resource
- eu-north-1 (0.10 L/kWh) and us-west-2 (0.18 L/kWh) are lowest
- ap-south-1 (Mumbai, 0.72 L/kWh) is highest

## Updated Types (types.ts)
- EmissionAndCostEstimate: embodiedCo2eGramsPerMonth, totalLifecycleCo2eGramsPerMonth, waterLitresPerMonth
- scope changed from SCOPE_2_OPERATIONAL to SCOPE_2_AND_3
- assumptionsApplied: embodiedCo2ePerVcpuPerMonthApplied, waterIntensityLitresPerKwhApplied
- PlanAnalysisResult.totals: currentEmbodiedCo2eGramsPerMonth, currentLifecycleCo2eGramsPerMonth, currentWaterLitresPerMonth

## Updated Formatters
- markdown.ts: headline table with all 4 dimensions (Scope 2, Scope 3, lifecycle, water, cost)
  resource breakdown adds Scope 3 CO2e and Water columns
  footer updated to reflect full Scope 2 + 3 coverage
- table.ts: Scope 2, Scope 3, Water columns in terminal output
  totals line shows Scope 2 / Scope 3 / Lifecycle / Water / Cost

## Binary Build Workflow (.github/workflows/release-binaries.yml)
- Triggers on v* tags and workflow_dispatch
- Builds 5 platform binaries via Bun compile:
  linux-x64, linux-arm64, darwin-arm64, darwin-x64, windows-x64
- Smoke tests each binary (--version, --coverage)
- Attaches all binaries to GitHub Release via softprops/action-gh-release@v2

## Documentation
- METHODOLOGY.md: full rewrite with Scope 2/3 formulas, water formulas,
  worked examples, WUE table, recommendation scoring, data sources, known limitations
- README.md: full rewrite with real live output (Scope 2/3/water columns),
  quickstart, suggestions, policy, coverage matrix, maths section

## Tests
- 63 tests, 63 passing
- json.test.ts now uses real engine output — no mock data
- formatter tests updated with full totals shape
- engine.test.ts: scope assertion updated to SCOPE_2_AND_3

Co-authored-by: GreenOps E2E <greenops-e2e@test.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant