Snowpack-departure methodology lit review: rag-build + 11 papers + citation map#54
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Identified the methodology canon for #48 four snow metrics plus ERA5-Land bias context and trend-test methodology: Foundational snowpack methodology mote_etal2005 Declining mountain snowpack PNW (BAMS) mote_etal2018 Dramatic declines summary (npj, OA) pederson_etal2011 Long-record cordillera context (Science) BC-specific najafi_etal2017 Spring SWE attribution to anthropogenic forcing kang_etal2016 Fraser River freshet timing + salmon (Sci Rep, OA) Metric-specific methodology knowles_etal2006 Snowfall fraction (SFE/P) stewart_etal2005 Streamflow centroid timing / DOY-50 cayan_etal2001 Spring onset / first pulse Methodology / validation yue_wang2002 Mann-Kendall pre-whitening kouki_etal2023 ERA5-Land snow validation (Cryosphere, OA) munoz_sabater_etal2021 ERA5-Land dataset (already in Zotero) 8 of 11 are OA; 2 (Pederson, Yue and Wang) need manual download from ResearchGate. findings.md captures DOIs, access status, and a metric-vs-paper coverage matrix. Phase 2 (Zotero adds) waits on user confirmation of the candidate list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 3 - scripts/rag_build_snow_methodology.R clones the
departure-framing pattern but reads PDFs from a local cache
data/rag/snow_methodology_pdfs/ (downloaded via Zotero Web API in
a one-shot bash loop) rather than ~/Zotero/storage/{attachKey}/.
This decouples from the user's Zotero desktop "download files at
sync time" setting and is fully reproducible from the attach-key
list. Built duckdb store: 11 sources, 1006 chunks.
Phase 4 - scripts/rag_query_snow_methodology.R runs 23 queries
across 8 topics (the four #48 metrics plus baseline window, MK
autocorrelation, ERA5-Land bias, BC-specific). Raw retrieval at
planning/active/snow_methodology_quotes.md (727 lines).
Phase 5 - synthesized in findings.md:
Methodology quotes by #48 metric:
swe_max - April 1 SWE canon (pederson, mote)
- 15-30 percent decline (mote_etal2018)
- BC attribution (najafi_etal2017)
snowfall_fraction - SFE/P methodology (knowles_etal2006)
- Threshold Tmin > -5C (knowles)
snowmelt_doy_50 - Center timing CT (stewart_etal2005)
- 10-day Fraser shift (kang_etal2016)
snowmelt_rate_peak - no close precedent, our invention
Cross-cutting:
Baseline window 1951-1980 - acceptable, on early side vs WMO
MK + autocorrelation - raw MK is correct per yue_wang2002
(prewhitening fails when trend exists)
ERA5-Land bias - 150-200 percent NH overestimate, larger in
mountains (kouki_etal2023). Stable over time
so trends still valid.
Deviations from consensus - 4 documented (snowmelt_rate_peak
novelty, baseline timing, no prewhitening, true-max swe).
"Cite this for that" map - 15 rows, copy-paste ready for #48
Phase 5 to insert [@key] markers into vignette interp paragraph.
Critical finding from yue_wang2002 - cd_trend()'s raw MK +
Theil-Sen WITHOUT prewhitening is methodologically correct for
our 76-year series with strong climate trends. We were lucky.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 5, 2026
NewGraphEnvironment
added a commit
that referenced
this pull request
May 5, 2026
* Initialize PWF baseline for #56 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Phase 1 of #56: AOI + bundled context for Kootenay Lake region Mirrors the FWCP Peace pattern at smaller scale: data-raw/example_aoi_kootenay_lake.R - unions four BC FWA watershed groups (KOTL + LARL + DUNC + SLOC) via bcdata. Output is inst/extdata/example_aoi_kootenay_lake.gpkg, ~24,200 km^2, bbox 49N-51N / 118.5W-115.5W. Anchored on Kootenay Lake; LARL captures Trail/Rossland/Red Mountain at the south end. data-raw/example_context_kootenay_lake.R - bundled context layers via fresh (fwapg). 12 towns (Nelson, Castlegar, Trail, Rossland, Kaslo, Nakusp, Slocan, New Denver, Argenta, Crawford Bay, Kimberley, Cranbrook), 24 lakes >200 ha (vs Peace's 1000 ha threshold - smaller AOI supports more detail), named rivers, stream segments order>=5, highways, the 4 WSGs as polygons, 4 ecoregions clipped to AOI (TOP, SBF, NCM, PTR). Geometries simplified at 50 m tolerance (vs Peace's 200 m). Output inst/extdata/context_kootenay_lake.gpkg is 2.2 MB. Existing KOTL bundled assets (example_aoi_kotl.gpkg etc.) stay in place for the README quick-start - new AOI lives alongside under the kootenay_lake_* namespace, doesn't replace. Caught and fixed an inherited filter bug: Kaslo / Nakusp / Slocan / New Denver are stored in the GNS as feature_type 'Village (1)' not 'Village'. Added 'Village (1)' to the SELECT filter. The Peace script's town list happened to not have any feature_type=='Village' entries so the bug was latent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Phases 2-4 of #56: Kootenay Lake vignette draft Phase 2 - data-raw/kootenay_lake_vignette_data.R precomputes the heavy data via cd_extract -> cd_baseline -> cd_anomaly -> cd_trend -> cd_compare for the regional + per-ecoregion + per-WSG breakdowns, plus the spatial-pattern tmean departure raster, plus the WSG x ecoregion overlap (4 WSGs x 4 ecoregions = 12 non-zero cells, small enough to inline into the rds). Output: inst/vignette-data/ kootenay_lake.rds (404 KB) + kootenay_lake_departure_tmean.tif (3 KB). Mirrors data-raw/peace_fwcp_vignette_data.R with the per-WSG list added. Phase 3 - vignettes/kootenay-lake.Rmd cloned from peace-fwcp.Rmd and adapted to the Kootenay context. Section structure mirrors the Peace vignette: Area of Interest, Connect to the Data Catalog, Extract Climate Time Series, Trends, Daytime Highs and Overnight Lows, Snowpack (seasonal table + 4 annual time-series + per-WSG facets - new), Recent vs Pre-warming, Spatial Pattern, Per-Ecoregion Variation (with Snow per ecoregion + Snow per watershed group sub-sections), Watershed Groups Across Ecoregions, Interpretation, References. Bibliography reuses vignettes/references.bib (11 entries from #54). Headline numbers (regional, 2015-2025 vs 1951-1980 baseline): Annual SWE -23% (Peace was -10%) Annual snowfall -15% (Peace was -6%) Annual snowmelt -16% (Peace was -7%) DOY-50 shift -12.6 days earlier Annual prcp -7% SIGNIFICANT (Peace was roughly stable) The Kootenay story differs sharply from Peace - in Peace, snow was "redistributed" (less summer, more spring melt) on flat snowfall; in the Kootenays, total annual snowfall is also down, consistent with Knowles 2006's threshold finding that significant snowfall-fraction declines occur where winter wet-day Tmin > -5C (Kootenays sit in that regime; Peace doesn't). And precipitation itself is declining here, not flat - making this a "warmer AND drier" story rather than the Peace's "warmer with mostly-stable precipitation." Phase 4 - Watershed Groups Across Ecoregions section adapted for the 4-WSG AOI. WSG x ecoregion overlap table built from the rds inline (no separate commentary CSV needed - 4 rows is small). KOTL/DUNC/SLOC are essentially within Northern Columbia Mountains; LARL is the only WSG that meaningfully splits across two ecoregions (NCM + Selkirk-Bitterroot Foothills). Render: 6.8 s. 12 csl-entries in References. 166 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Phase 5 of #56: ASWS QA for Kootenay AOI + vignette caveat 74 paired station-years across 3 usable Kootenay ASWS sites (Moyie Mountain 1835m Purcells, Redfish Creek 2100m Selkirks alpine, Farron 1230m insufficient years). Pooled r=0.90 (vs Peace's 0.51 — much better correlation). Mean bias -54% (vs Peace's -36% — sharper). Bias stable at Moyie (p=0.15); marginal drift at Redfish (p=0.07, ~12 mm/yr widening). Vignette methodology paragraph updated with the actual Kootenay numbers replacing the generic 'should carry over' placeholder. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Phase 6 of #56: README links both vignettes pkgdown auto-discovers vignettes from vignettes/ so no _pkgdown.yml change needed. Render order will follow file alphabetical (kootenay-lake before peace-fwcp); leaving as-is for now — explicit articles ordering can be added later if motivated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
NewGraphEnvironment
added a commit
that referenced
this pull request
May 5, 2026
…/3) (#60) * Initialize PWF baseline for #58 Lit-review temperature-departure methodology + interpretation backing. Issue 1 of 3 in the climate-departure 3-split lit reviews (temperature, precip+drying, interpretation framing). Mirrors the #53/#54/v0.1.7 snowpack-lit-review pattern verbatim. Phase 0 renames existing rag scripts to noun_verb convention before new work begins. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Rename rag scripts to noun_verb convention Switch the 3 existing ragnar build/query scripts from verb_noun to noun_verb so the scripts/ directory reads cleanly for human users and matches the cd_* function naming convention (cd_cog_write, not cd_write_cog): rag_build_snow_methodology.R -> rag_snow_methodology_build.R rag_query_snow_methodology.R -> rag_snow_methodology_query.R rag_build_departure_framing.R -> rag_departure_framing_build.R Also updates internal docstring usage lines, CLAUDE.md script references, and the snow-lit-review archive README how-to-reproduce section. Phase 0 prep for #58 — establishes the naming convention before adding scripts/rag_temp_methodology_build.R + _query.R in Phase 3. NEWS.md and the archive task_plan/findings/progress files left as-is — historical records of what shipped at v0.1.7 stay named for that version. Refs #58. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Phase 0 followup: docstring + doc references for rag-script rename Companion to 521084f (rename commit). Updates internal references that point at the old script names — lost from 521084f because the preceding heredoc-style commit message failed to parse and the `git add -A` never ran: - 3 renamed scripts: docstring header + Usage line - CLAUDE.md (lines 107-108): script-reference bullets + naming- convention note - planning/archive/2026-05-issue-53-snow-lit-review/README.md: how-to-reproduce section - planning/active/{task_plan,findings,progress}.md: PWF tracking Refs #58. * Phase 1: temperature lit-review candidate list (10 new + 7 reuse + 2 cross-rag) Targeted web search confirmed DOIs + OA paths for 10 new papers covering: DTR / day-night asymmetry methodology (Karl 93, Easterling 97, Vose 05), Canadian / BC temperature trends (Vincent 18), elevation-dependent warming (Pepin 15, Rangwala & Miller 12), BC downscaling (Wang 12 ClimateWNA), climate-fish bridge (Mantua 10), and salmonid thermal envelope (Eaton & Scheller 96, Richter & Kolmes 05). Deep screen of the existing 19 items in NewGraphEnvironment/climate identified 7 reuse-relevant items (Mora 13, Hersbach 20, Munoz-Sabater 21, Isaak 17 NorWeST, Dierauer 20, Warkentin 22, Moore 22) — these get linked by item key without re-adding. Two cross-rag references from the snow methodology rag (Najafi 17, Yue & Wang 02) cover trend-test methodology and BC attribution without needing duplicate entries. PDF acquisition strategy: 4 papers OA-fetchable directly (UNL DigitalCommons, AMS post-embargo, NOAA-hosted PDFs, Canada.gov T&F landing), 6 paywalled and flagged for user ResearchGate download in Phase 2. 12-topic coverage matrix in findings.md maps every #58 vignette claim type to its primary + supporting citations, ready for the Phase 5 cite-this-for-that map. Refs #58. * Phase 2: 10 temperature-methodology papers added to climate collection POSTed all 10 candidate papers to NewGraphEnvironment/climate (key 8MH9LCC9) via Zotero Web API with PDFs attached via 4-step S3 upload. CrossRef-driven metadata; tags temperature-departure-methodology + cd-issue-58. 3 fresh PDF uploads, 7 deduped via md5 against existing Zotero S3 storage. PDFs sourced: 1 via curl (Wang 12 from UAlberta), 9 user-provided via ResearchGate. Karl 93 + Richter & Kolmes 05 needed OCR (image-only scans). All 10 in data/rag/temp_methodology_pdfs/ with text layers verified, gitignored. Initial run mistakenly stuffed Citation Key: <clean_key> overrides into the extra field — caught on review since NGE convention is BBT- auto-derived keys, not manual. PATCH'd all 10 items to clear the override. soul#43 filed to update /lit-search + /zotero-api skills so future runs avoid this pattern. User action needed: restart Zotero desktop so BBT generates the citation keys for the 10 new items (sync alone does not trigger key generation for Web-API-created items per CLAUDE.md). Once restarted, keys get captured into findings.md and the Phase 3 rag build script. Phase 2 deliverable: parent itemKey + attachKey table for all 10 papers in findings.md, PDFs in local cache ready for ragnar ingestion. Refs #58. * Phase 3: build temperature-methodology ragnar store Adds scripts/rag_temp_methodology_build.R cloning the snow build script with a 10-paper pdf_specs map (label + Zotero attachKey + note). Reads PDFs out of data/rag/temp_methodology_pdfs/ — same local-cache pattern as snow, sidesteps the "download files at sync" Zotero desktop dependency. Runs in ~28 s on Ollama nomic-embed-text: Found 10 / 10 PDFs Chunks: 677 Sources: 10 Sanity-tested retrieval on a DTR query — returns Karl 1993 abstract + DTR variable construction, Rangwala & Miller 2012 alpine trends, and Vincent 2018 nighttime asymmetry. All on-topic for the temperature methodology citation backbone. The Zotero attachKeys hardcoded in pdf_specs serve downstream auditing; the BBT-auto-derived citation keys (which is what the vignette will cite via [@key] markers) get captured in findings.md once the user restarts Zotero desktop and BBT generates keys for the 10 Web-API-created items. Next: Phase 4 — write rag_temp_methodology_query.R + mine the store for methodology quotes across 8 topics. Refs #58. * Phases 4 + 5: rag query script + temperature methodology synthesis Phase 4 — adds scripts/rag_temp_methodology_query.R (clone of the snow query script) running 24 queries across 8 topics and capturing top-5 chunks each to planning/active/temp_methodology_quotes.md (637 lines). Topics cover DTR asymmetry, Tmax/Tmin globe trends, Canadian/BC temperature trends, BC downscaling, elevation-dependent warming, climate-stream-temp bridge, salmonid thermal envelope, and trend methodology cross-checks. Phase 5 — synthesis in findings.md: per-topic methodology quotes selected from the rag retrieval, cross-cutting methodology section (baseline window, trend test cross-check vs Vincent 18's AC-iterative procedure, ERA5-Land 2m temperature validation gap), 4 documented deviations (UTC-day tmax/tmin per issue #37, raw MK vs AC-iterative, no direct ERA5-Land 2m T validation paper for BC, regional DTR ratio may differ from global), and an 18-row "cite this for that" menu mapping vignette claim types to citation keys. Philosophy preface added to findings.md per user feedback (2026-05-05): this is a library, not a prescription. The downstream vignette branch picks sparingly — citations only for authorities on findings actually visible in the AOI's graphs/tables, plain language, spelled-out acronyms, no over-decoration. Captured in memory as feedback_vignette_citations_sparse.md so future runs don't bloat findings.md with vignette-write expectations. Phase 5 also documented: - 7 existing items in NewGraphEnvironment/climate that are reuse-relevant (no re-add): mora_etal2013, hersbach_etal2020, munoz-sabater_etal2021, isaak_etal2017, dierauer_etal2020, warkentin_etal2022, moore_schindler2022 - 2 cross-rag references from data/rag/snow_methodology.duckdb that cover trend-test methodology and BC attribution without duplicate Zotero entries: najafi_etal2017, yue_wang2002 Next: Phase 6 — code-check, PR, archive. User action pending: Zotero desktop restart so BBT generates citation keys for the 10 new items; keys captured into findings.md before PR. Refs #58. * Capture BBT citation keys + Pepin authors PATCH After Zotero restart and BBT plugin update from 8.0.25 to 9.x (Z8/9 line; Z9 had auto-disabled BBT 8.x as incompatible), all 10 new climate-collection items now have BBT-auto-derived keys following the firstauthor_etalYEAR + TitlePrefix convention. Pepin 2015 required a creators-PATCH first: CrossRef returned only the corporate author "Mountain Research Initiative EDW Working Group" with no individuals, so BBT initially fell back to a title-derived key. Added the 21 individual working-group members listed in the paper roster (N. Pepin first as corresponding author). With BBT alive again, the key regenerated to pepin_etal2015Elevationdependentwarming. Final 10 BBT keys captured in findings.md Phase 2 table: karl_etal1993NewPerspective easterling_etal1997MaximumMinimum vose_etal2005Maximumminimum vincent_etal2018ChangesCanadas pepin_etal2015Elevationdependentwarming rangwala_miller2012Climatechange wang_etal2012ClimateWNAHighb mantua_etal2010Climatechange eaton_scheller1996Effectsclimate richter_kolmes2005MaximumTemperaturea cite-this-for-that map updated to use full BBT keys (replacing the local-label placeholders) so the downstream vignette branch can copy [@key] markers verbatim. Also captures keys for the 7 existing reuse-relevant climate-collection items + 2 cross-rag references (najafi_etal2017AttributionObserved, yue_wang2002Applicabilityprewhitening) for completeness. Refs #58. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 5, 2026
NewGraphEnvironment
added a commit
that referenced
this pull request
May 5, 2026
…/3) (#64) * Initialize PWF baseline for #63 * Phase 1: interpretation framing candidate list (4 new + 6 reuse + 4 cross-rag) * Phases 2+3+4+5: framing rag store + query + synthesis (with auto-restart) Phase 2 — POSTed 4 candidates to NewGraphEnvironment/climate (8MH9LCC9) via Web API with PDFs attached via S3. CrossRef-driven metadata; tags interpretation-framing-methodology + cd-issue-63. 2 fresh PDF uploads (Arguez & Vose, Hawkins & Sutton), 2 md5- deduped (Hansen 2012, Livezey 2007). Auto-restart fired and all 4 BBT keys captured cleanly: arguez_vose2011DefinitionStandard livezey_etal2007EstimationExtrapolation hawkins_sutton2012Timeemergence hansen_etal2012Perceptionclimate Phase 3 — adds scripts/rag_interpretation_framing_build.R cloning the precip+drying build script with a 4-paper pdf_specs map. Runs in ~10 s on Ollama nomic-embed-text: Found 4 / 4 PDFs Chunks: 291 Sources: 4 Phase 4 — adds scripts/rag_interpretation_framing_query.R running 16 queries across 6 topics (narrower than #58/#61's 24 queries since framing topic surface is smaller). Captures top-5 chunks each to planning/active/interpretation_framing_quotes.md (373 lines). Topics: baseline window methodology, normals when trends exist, time of emergence, cumulative-impact / loaded dice, shifting baseline climate, departure from recent variability. Phase 5 — synthesis in findings.md: per-topic methodology quotes selected from the rag retrieval, cross-cutting methodology section (Hansen 2012's choice of 1951-1980 base period validates cd's choice for cumulative-impact reporting — strongest direct precedent across all three lit reviews), 3 documented deviations (1951-1980 vs WMO 1961-1990 baseline, no AC correction, ToE not quantified per-AOI), and an 11-row cite-this-for-that menu mapping vignette framing claim types to BBT-auto-derived citation keys. 3-split scoreboard added to findings.md — pointer to the four findings.md files (#53/#54 snow, #58/#60 temp, #61/#62 precip+ drying, this) for the downstream vignette wire-up branch. Refs #63.
5 tasks
NewGraphEnvironment
added a commit
that referenced
this pull request
May 5, 2026
* Initialize PWF baseline for #65 (kootenay vignette wire-up) * Phase 1: citation audit log for #65 (7 proposed insertions) * Phase 2: insert 7 citations into kootenay-lake.Rmd interpretation paragraphs Adds 8 new BBT-keyed citations (1 reuses kang_etal2016 already in Snowpack section) into non-snow vignette sections. Each cite lands on a finding visible in the AOI's plots/tables per the feedback_vignette_citations_sparse.md philosophy. Audit trail in planning/active/citation_audit.md. Insertions: - L184 Trends: Hansen 2012 (1951-1980 base period precedent) - L195 Trends: Arguez & Vose 2011 (WMO climate normal definition) - L246 Daytime/Overnight: Karl 1993 (DTR asymmetry; converts prose-style author ref to [@key]) - L584 Spatial Pattern: Pepin 2015 + Rangwala & Miller 2012 (elevation-dependent warming + heterogeneity caveat) - L984 Interpretation/drying: Ficklin & Novick 2017 (VPD continental-scale drying) - L1012 Interpretation/salmonids: Mantua 2010 + Eaton & Scheller 1996 (climate-stream-temp-fish bridge) - L1024 Interpretation/Fraser: Kang 2016 (converts prose-style author ref to [@key]) Snowpack-section cites from #54 untouched. FWCP Peace cross-refs at L528, L973, L996 NOT touched (out of scope for #65; flagged in progress.md for follow-up). Refs #65. * Phase 3: review-agent sign-off + Ficklin scope fix * Phase 4: regenerate references.bib via rbbt for 8 new BBT keys
5 tasks
NewGraphEnvironment
added a commit
that referenced
this pull request
May 5, 2026
* Initialize PWF baseline for #67 (peace vignette wire-up) * Phases 1+2: audit log + 7 citation insertions in peace-fwcp.Rmd Adds 8 unique new BBT-keyed citations (1 reuses kang_etal2016 already in Snowpack section) into non-snow vignette sections. Same playbook as #65/v0.2.5 (kootenay wire-up); insertions cover: - L176 Trends: Hansen 2012 (1951-1980 base period precedent) - L186 Trends: Arguez and Vose 2011 (WMO climate normal definition) - L238 Daytime/Overnight: Karl 1993 (DTR asymmetry; converts prose ref). DTR narrowing is stronger here (0.4 C cumulative) than Kootenay (0.2 C). - L859 Interpretation/Warming: Pepin 2015 + Rangwala-Miller 2012 (elevation-dependent warming + heterogeneity caveat). Placed at Interpretation paragraph (which explicitly invokes EDW), NOT at Spatial Pattern (Peace's dominant gradient is E-W windward-of-Rockies, not pure elevation; Pepin/Rangwala don't cleanly fit there). - L887 Interpretation/drying: Ficklin and Novick 2017 (VPD continental-scale drying). Stronger Peace case than Kootenay because precip is UP in 2 ecoregions yet soil moisture flat - pure evaporative-demand effect. - L925 Interpretation/salmonids: Mantua 2010 + Eaton-Scheller 1996 (climate-stream-temp-fish bridge). - L937 Interpretation/Fraser: Kang 2016 (converts prose ref). Snowpack-section cites from #54 untouched. Audit trail with quotes/paraphrases/visible-in-vignette warrants in planning/active/citation_audit.md (7 rows). Refs #67. * Phase 3+4: agent sign-off, no edits needed; bib regen no-op
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the #53 lit-review companion to #48. Mines 11 peer-reviewed papers (10 newly added to the
NewGraphEnvironment/hydrologyZotero collection plus 1 already-in-library) for snow-departure methodology citations, builds a local ragnar DuckDB store, runs 23 queries across 8 topic areas, and produces a citation-keyedfindings.mdready for #48 Phase 5 to consume.Decoupled boundary: this PR produces methodology notes + a rag store. The actual
[@key]citation insertions invignettes/peace-fwcp.Rmdhappen in #48 Phase 5, sourced from this branch'sfindings.md.What's in this PR
scripts/rag_build_snow_methodology.R— clonesrag_build_departure_framing.Rpattern; reads PDFs fromdata/rag/snow_methodology_pdfs/(gitignored, populated via Zotero Web API); builds DuckDB with Ollamanomic-embed-textembeddings.scripts/rag_query_snow_methodology.R— runs 23 focused queries (per Add snow-related variables (SWE, snowfall fraction, melt timing) for hydrology departure #48 metric + cross-cutting) and dumps top-5 chunks per query.planning/active/snow_methodology_quotes.md— raw retrieval (727 lines, archived as part of /planning-archive on merge).planning/active/findings.md— synthesis: methodology quotes by Add snow-related variables (SWE, snowfall fraction, melt timing) for hydrology departure #48 metric, cross-cutting (baseline window, MK + autocorrelation, ERA5-Land bias), deviations from consensus, and a 15-row "cite this for that" citation map.Headline findings
cd_trend()'s raw Mann-Kendall + Theil-Sen (no prewhitening) is methodologically correct per Yue & Wang (2002). Their Monte Carlo result: prewhitening fails when a real trend exists in the series — it dramatically underestimates slope. For our 76-year series with strong climate trends, raw MK is the right call. We were lucky.snowmelt_rate_peak(annual max of 7-day rolling daily snowmelt) is our invention. The literature canon for freshet flashiness is streamflow-based (Stewart 2005 center timing, Kang 2016 Fraser timing). Our metric is upstream of that — direct on the snowmelt flux. Diagnostic of snowpack-side intensity but no close methodological precedent. Document as such in the vignette interp.ERA5-Land overestimates SWE in mountains by 150–200% NH-wide (Kouki et al. 2023). Bias is approximately stable over time — trends remain valid even though absolute values are biased. The ASWS QA cross-check planned for Add snow-related variables (SWE, snowfall fraction, melt timing) for hydrology departure #48 Phase 3 will document our specific BC bias structure.
swe_max(true annual max of daily SWE) is a slight deviation from the April-1-SWE canon (Pederson 2011, Mote 2005/2018). Equivalent in effect for BC pixels (peak is at or near April 1) but date-insensitive. Worth a brief methodology note in the vignette.BC-specific anchors are strong. Najafi et al. (2017) attributes BC spring SWE decline to anthropogenic forcing using VIC + CMIP5 fingerprinting; Kang et al. (2016) documents the 10-day advance of the Fraser freshet during the salmon migration window 1949–2006. Both directly map to our fish-passage reporting context.
Test plan
NewGraphEnvironment/hydrologyZotero collection (keyX29BX4U8) with PDFs attachedfindings.mdcovers all four Add snow-related variables (SWE, snowfall fraction, melt timing) for hydrology departure #48 metrics + 3 cross-cutting topics + deviations + citation map/planning-archive. Archivedfindings.mdbecomes the long-lived methodology reference.[@key]markers from the citation map intovignettes/peace-fwcp.RmdOut of scope
bibliography:YAML field inpeace-fwcp.Rmd— also Add snow-related variables (SWE, snowfall fraction, melt timing) for hydrology departure #48 Phase 5.cd_anomaly/cd_trend— Yue & Wang 2002 supports current behavior; no refactor needed. Could file an autocorrelation-aware variant against cd_compare(): add p-value for window-vs-window comparison #43 if motivated.Notes
The findings.md "cite this for that" table is the primary deliverable. It maps 15 vignette claim types to specific citation keys. #48 Phase 5 should be a copy-paste exercise rather than a literature search.
BBT will generate citation keys when the user restarts Zotero. The keys below match my proposed labels (firstauthor[_etal]year) and should align with BBT's auto-generation, but if they diverge the vignette's
[@key]references will need a sweep.Fixes #53
Relates to NewGraphEnvironment/sred-2025-2026#23
🤖 Generated with Claude Code