Documentation Index
Fetch the complete documentation index at: https://docs.mangrovesystems.com/llms.txt
Use this file to discover all available pages before exploring further.
What you’ll build in this exercise:
- Create a comprehensive test dataset representing one month of Mangrove Biochar operations
- Run the full calculation pipeline and validate every batch output
- Verify all ledger balances reconcile
- Document and fix any integration issues discovered during testing
Part 1: Design (30 min)
1. Define test scenarios
Plan your test dataset to cover all three scenario types:Happy Path
Normal operations:
- 4 typical deliveries (2-6 t)
- 5 feedstock receipts
- 3 lab analyses
- Standard moisture (10-20%)
- Typical H:C ratio (0.2-0.5)
Edge Cases
Boundary values:
- 1 high-moisture receipt (50%)
- 1 high H:C ratio analysis (0.75)
- 1 very small delivery (0.5 t)
- 1 zero-distance transport
Error Cases
Invalid data:
- Missing a required datapoint
- Event outside accounting period
- Duplicate tracking IDs
2. Calculate expected outputs
Before running the pipeline, calculate the expected output for every batch in a spreadsheet. Include:- Gross carbon for each delivery
- Proportional emission allocation (by mass)
- Direct transport emissions per delivery
- Net carbon per batch
- Ledger totals and balances
3. Identify potential failure points
List what might go wrong:- Slug mismatches between new event types and model nodes
- Date range issues with edge case events
- Allocation denominators including edge case batches
- Missing aggregation for energy consumption events
Part 2: Build in Mangrove (1.5 hrs)
Step 1: Create the January 2024 test dataset
Create the following events using Add Data or Bulk Import : 5 Feedstock Receipt events:| Receipt | Date | Wet Mass (t) | Moisture % | Feedstock Type |
|---|---|---|---|---|
| FR-001 | Jan 2 | 12 | 15 | Agricultural waste |
| FR-002 | Jan 8 | 10 | 12 | Forestry residue |
| FR-003 | Jan 14 | 15 | 18 | Agricultural waste |
| FR-004 | Jan 20 | 8 | 50 | Agricultural waste (edge case) |
| FR-005 | Jan 27 | 11 | 14 | Forestry residue |
| Analysis | Date | Carbon % | H:C Ratio | Ash % |
|---|---|---|---|---|
| LA-001 | Jan 5 | 80 | 0.35 | 8 |
| LA-002 | Jan 15 | 78 | 0.42 | 10 |
| LA-003 | Jan 25 | 82 | 0.75 | 6 (edge case: high H:C) |
| Delivery | Date | Mass (t) | Carbon % |
|---|---|---|---|
| DEL-001 | Jan 7 | 5 | 80 |
| DEL-002 | Jan 14 | 3 | 78 |
| DEL-003 | Jan 21 | 4 | 82 |
| DEL-004 | Jan 28 | 0.5 | 79 (edge case: very small) |
- Electricity: 12,000 kWh
- Propane: 600 gallons
- Period: Jan 1 – Jan 31
| Delivery | Distance (km) | Fuel Type |
|---|---|---|
| DEL-001 | 180 | Diesel |
| DEL-002 | 150 | Diesel |
| DEL-003 | 0 | n/a (edge case: on-site) |
| DEL-004 | 200 | Diesel |
Step 2: Run the full pipeline
- Go to Production Accounting and generate batches for January 2024.
- Resolve any validation messages — these indicate missing or problematic data.
- Submit to generate batches.
Step 3: Validate batch outputs
For each of the 4 delivery batches, compare the pipeline output against your expected values:Check gross carbon
Does the gross tCO2e for each batch match your spreadsheet? If not, check the production model nodes (dry mass → carbon → CO2 conversion).
Check emission allocation
Are electricity and propane emissions allocated proportionally by mass? Do the allocations across all batches sum to the total period emissions?
Check transport emissions
Is DEL-003’s transport emission zero (on-site delivery)? Are other deliveries’ transport emissions correct?
Check net carbon
Does net = gross - (allocated electricity + allocated propane + transport) for each batch?
Step 4: Verify ledger reconciliation
Check each ledger’s balance:| Ledger | Credits (In) | Debits (Out) | Balance |
|---|---|---|---|
| Feedstock Inventory | Sum of dry feedstock masses | Allocated to production | Should be ≥ 0 |
| Biochar Production | Sum of biochar produced | Allocated to delivery | Should be ≥ 0 |
| Carbon Delivered | Sum of net tCO2e | Allocated to reports | Running total |
If a ledger balance goes negative, it means you’re claiming more output than input at that stage — a mass balance violation that must be resolved before reporting.
Step 5: Document and fix issues
For every issue found:- Describe the symptom — what output was wrong?
- Identify the root cause — which pitfall from Lesson 5.3?
- Apply the fix — update the configuration
- Re-run and verify — confirm the fix resolves the issue
Success criteria
You have completed the Module 5 exercise when:- Test dataset created — 17 events across 5 event types covering happy path and edge cases
- Pipeline executed — Generate Batches runs for January 2024 without unresolved validation errors
- 4 batches generated — one per delivery, with correct gross and net carbon values
- Batch outputs match — all values within 1% of your pre-calculated expected outputs
- Emissions correctly allocated — proportional allocations sum to period totals, direct allocations are batch-specific
- Ledger balances reconcile — no negative balances, inputs ≥ outputs at each stage
- Edge cases handled — high moisture, high H:C, small delivery, and zero-distance transport produce correct results
- Issues documented — any problems found during testing are documented with root cause and fix