cleaned v0.7.0 (CIAT/cleaned staging @ 800d53a)fb8498c)peetmate/cleaned-review); CIAT/cleaned is unchangedThe package runs, and its Tier 2 structure follows IPCC. But several defects change headline results by tens of percent, and some by an order of magnitude:
Nine of these were confirmed by unit tests against the IPCC source text (06). Most of them reach the live iCLEANED app (05). Until they are fixed, absolute footprints should not be reported. Enteric CH4 differences between scenarios are the most defensible output.
| File | Scope | Critical | High | Medium | Low |
|---|---|---|---|---|---|
| 01_climate_ghg.md | IPCC GHG, SOC, N2O, GWP | 3 | 7 | 9 | 4 |
| 02_livestock.md | Energy, intake, herd, N, feed library | 2 | 5 | 9 | 8 |
| 03_landuse.md | Land, water, erosion, N balance, scenarios | 2 | 18 | 13 | 3 |
| 04_package_code.md | R CMD check, design, bugs, tests, docs | 4 | 8 | 15 | 5 |
| 05_app_relevance_and_workshop.md | Findings vs the deployed app, guide vs code, workshop plan | 39 Critical/High deduplicated: 28 affect the app, 7 are guarded by the app, 1 unclear, 3 have no runtime effect; 6 new issues | |||
| 06_critical_tests.md | Unit tests vs IPCC, with citations | 9 findings tested: 8 fully confirmed, 1 partly confirmed (coefficient check skipped); controls pass | |||
| 07_fix_log.md | Proposed fixes, tested on a temporary copy | Each fix turns only its own tests green, with no regressions; all fixes: 23 pass, 1 skipped | |||
| 08_demo.md | Current vs fixed vs IPCC, plus iCLEANED study impact | Built by knitting fixes/demo.Rmd |
R CMD check --as-cran gives 4 WARNINGs and 4 NOTEs, so CI (error_on = "warning") fails by design. The only existing test file contains no expectations.
| # | Finding | Review ids | Unit test (06) | Reaches app (05) |
|---|---|---|---|---|
| 1 | Net-energy requirements ÷ ME density, with no REM/REG conversion (IPCC Eq. 10.14–10.16) | CL F02, LV C-01 | FAIL: DMI 0.55–0.63× IPCC | Yes |
| 2 | N retention in kg N/day, used as a fraction and divided by 365 twice (Eq. 10.31A/10.33) | LV C-02, H-04; CL F04; PK F07 | FAIL: cow Nex +31% | Yes |
| 3 | SOC stock-change factors applied every year to the measured stock (Eq. 2.25) | CL F01, LU S-02 | FAIL: −7 t C/ha/yr on unchanged land | Yes, the largest effect: −4.5 t CO2/yr vs 5.1 t emissions in Study_1 |
| 4 | Burning counts biogenic CO2 and applies the N2O GWP to NOx | CL F03, PK F06 | FAIL: 24× | Yes: 40% of Study_2's total |
| 5 | Tree SOC is always 0 (list/data-frame mismatch) | PK F02, LU S-01 | FAIL | Yes |
| 6 | Divide-by-zero results silently set to 0 ha | LU-01, PK F04 | FAIL | Yes; the app's default removal = 0 triggers it |
| 7 | N leaching is a per-ha value added to farm totals | LU N-01 | FAIL: 2.6 vs 278 kg N | Yes |
| 8 | Main inputs fetched from the caller's environment (get(..., parent.frame())) |
PK F03 | FAIL ×2 | Guarded: the app passes arguments explicitly |
| 9 | Shipped example inputs don't run | PK F01, LU D-01, LV H-03 | FAIL ×3 | Guarded: the app writes the correct column names |
This corrects what I said earlier in the session. The app most likely runs v0.7.0-equivalent code: fork head 4ae5505, which has the same R/ and inst/ as staging (about 65% likely). The alternative is the renv.lock pin 4c44dc9 (about 30%).
global.R's fallback to cleaned_v0.6.0 is ruled out: that version crashes on the studies the current app saves.05 §6 has a 15-scenario test plan with expected ranges, and §7 has 16 warnings for facilitators. Minimum messages to participants:
soc.R:234)merge_outputs.R:810-812)* area_total (nitrogen_balance.R:249)ghg_emission.R:226,233)energy_requirement()get(parent.frame())data/The proposed fixes and their test results are in 07_fix_log.md. The demo is 08_demo.md.
../cleaned_review/: these reports, and the user guide as extracted text../cleaned_review_src/: read-only checkout of v0.7.0 (a detached worktree)fixes/: tests, the proposed fixes, the runner, demo.Rmd, build_site.R, build_notebook.py, results/, and cleaned_fixed_copy/ (a plain folder, not git)reproduce/: reproduce_critical_issues.R (self-contained script) and critical_issues.ipynb (Colab notebook, R runtime), both generated from the same codesite/: the published site, a git checkout of https://github.com/peetmate/cleaned-review (Pages: https://peetmate.github.io/cleaned-review/)../icleaned_review_src/: read-only clone of the app
Comments
Comments are GitHub Discussions on peetmate/cleaned-review; sign in with GitHub to post.