Worked Examples
Developer reference for baseline construction — Global Impact Catalyst
Develop and verify reproducible baseline construction in Global Impact Catalyst using source-reviewed registry models and real NOAA atmospheric CO₂ observations. This engineering reference includes pinned source links, explicit reference-period and provenance contracts, unit and versioning checks, security-negative tests, and staging acceptance criteria that separate correct computation from scientifically defensible impact claims.
Application: Global Impact Catalyst
Component: Indicator Registry / Baseline Models / Program Measurement
Article type: Developer reference
Source-reviewed GitHub commit: e75808a0aa272656b1fdbacd2491c30fd6b987dc
Registry specification: v1.4.0; measurement documentation: v1.5.0
Scientific evidence: NOAA GML Mauna Loa annual atmospheric CO₂, 1959–2025, source snapshot November 19, 2026
Verification status: Offline reference-adapter tests passed; staging, installed-software and scientific review pending
Estimated reading time: 24–30 minutes
1. Goal and engineering scope
Implement and evaluate a reproducible, reference-period-aware baseline construction pipeline that stores the exact source evidence, selected years, units, method version, observation counts, missingness policy and approval state. A successful numeric calculation must not imply scientific validity, project impact, causal attribution or authorization to publish.
The worked case uses public measurements of atmospheric CO₂ at Mauna Loa rather than fictitious environmental results. It demonstrates input validation, stable calculations, source pinning and claim classification. It does not assert that a project intervention caused the atmospheric concentration trend.
2. Requirements and scientific boundaries
| Dimension | Required contract | Failure to prevent |
|---|---|---|
| Source | NOAA annual mean snapshot, source URL, release date and locally computed SHA-256 | Silent input revisions and irreproducible claims |
| Indicator and unit | Annual mean dry-air CO₂ mole fraction (ppm), pinned indicator definition and approved unit mapping | Relabelling concentration as tCO₂e emissions |
| Time | Inclusive start/end years, all expected years accounted for, representative period rationale | Accidental out-of-window inclusion and cherry-picking |
| Measurement state | Effective complete observations only, revision lineage and explicit exclusion log | Double counting revised or incomplete records |
| Method | Named method, version, unit precision and deterministic rounding | Changes that alter old results without traceability |
| Review | Draft output, role-specific authorization, provenance and separate human approval | Draft save silently triggering public release |
| Scientific interpretation | Observed difference, confounders, comparator/counterfactual limitations and uncertainties | Unsupported causal impact assertions |
Important: NOAA Mauna Loa atmospheric concentration is a site-based observation series and cannot be used as a direct estimate of project-level avoided emissions. A scientific counterfactual requires a suitable comparison design and project-specific outcome, exposure, geography, and population definitions.
3. Real scientific data and reproducible result
Primary source: NOAA Global Monitoring Laboratory — CO₂ data access; annual source annual text and CSV. The package includes an explicitly labelled annotated transcription of the 1959–2025 annual observations, not the original NOAA file bytes. NOAA notes that source data can be revised after quality checks.
| Year | Annual mean (ppm) | Role |
|---|---|---|
| 2015 | 401.01 | Historical baseline |
| 2016 | 404.41 | Historical baseline |
| 2017 | 406.76 | Historical baseline |
| 2018 | 408.72 | Historical baseline |
| 2019 | 411.65 | Historical baseline |
| 2025 | 427.35 | Later observation |
Arithmetic baseline, inclusive years 2015–2019: (401.01 + 404.41 + 406.76 + 408.72 + 411.65) / 5 = 406.510 ppm. Later observed difference: 427.35 − 406.510 = 20.840 ppm. Relative descriptive difference: 20.840 / 406.510 × 100 = 5.127% (three-decimal rounding). Five-year 2014–2018 sensitivity baseline: 403.942 ppm, a 2.568 ppm change arising solely from the reference-window choice.
NOAA’s reported annual uncertainty is not a conventional 95% confidence interval for this five-year mean; likewise, successive yearly concentrations are trending and not independent identically distributed intervention observations. The source notes document a temporary measurement-site substitution during 2022–2023, requiring explicit site-continuity review if those years are used.
4. Source-reviewed Global Impact Catalyst behavior
Repository at pinned commit: Content-Catalyst-LLC/global-impact-catalyst. Source code defines the baseline identifiers point_first, point_latest, period_average, rolling_average, benchmark and modelled. Versioned model registration checks method, unit, formula syntax and minimum observation count. The Python compute_baseline() returns a value, unit, method identifier, number of supplied observations used and baseline-model version ID.
Critical integration boundary: The reviewed Python function converts supplied values to floats and calculates; it does not visibly select them by the stored period_start/period_end or verify each observation’s source site, effective measurement revision, completeness or actor authorization. A calling service must perform those checks and prove them in integration tests. This is a source-level integration requirement, not evidence of an exploitable deployed vulnerability.
The benchmark method reads its declared constant instead of deriving a historical mean; its observations_used can be zero even though the function enforces the model’s minimum count before selecting a method. Its precondition and response semantics should be tested before relying on it. The safe arithmetic language gic-expression-1.0 rejects Python calls, attribute access and unrecognized variables. Do not pass untrusted code through another evaluator.
| Verified source location | Engineering relevance |
|---|---|
| python/global_impact_registry.py | register_baseline_model(), compute_baseline(), method identifiers, model versions and hashes |
| schemas/global_impact_indicator_registry.schema.json | Export schema v1.4.0: models, versions, identifiers, integrity counters |
| migrations/005_indicator_registry_units_baselines_targets_methods.sql | SQLite baseline, baseline-version, unit and binding tables |
| python/global_impact_measurement.py | Observation-level program measurement implementation; inspect effective revisions and states before integration |
| docs/baselines-targets-methods.md | Baseline methods, formula language, registration and governance |
| docs/indicator-registry.md | Registry lifecycle, immutable versions and contract bindings |
| docs/program-measurement.md | Measurement states, denominator context, revisions and exports |
| docs/wordpress-workspace.md | Authenticated WordPress registry management, not proof of installed routes |
| tests/test_indicator_registry.py | Repository unit tests for methods, units and registry versions |
| tests/test_measurement_portfolios.py | Measurement-level regression tests |
| docs/source-integrity.md | Source-integrity documentation |
| docs/review-governance.md | Review-governance documentation |
5. Proposed external data-selection contract (NOT an existing API)
In a service that bridges historical measurements and the registry, validate a request shaped like the following. The package provides this exact sample as data/selection_contract.example.json.
{
"workspace_id": "demo-research",
"actor_id": "synthetic-analyst",
"indicator_definition_version_id": "pinned-indicator-v1",
"baseline_model_version_id": "pinned-baseline-v1",
"method_type": "period_average",
"unit": "ppm",
"period": {"start_year": 2015, "end_year": 2019},
"minimum_observations": 5,
"claim_class": "descriptive_observation",
"publication_status": "draft",
"source_sha256": "<SHA-256 of pinned evidence snapshot>",
"site_transition_reviewed": false
}
Compatibility note: The source-reviewed built-in unit list includes tCO2e, kWh, % and others, but not a confirmed ppm concentration unit. A real registry integration requires an explicitly approved unit definition and compatible scientific semantics. The example IDs are synthetic references, not real deployed IDs or secrets.
6. Engineering execution path
- Authenticate and authorize: Validate session or service identity, workspace membership and permitted operation server-side. Never trust caller-supplied
workspace_idalone. - Resolve immutable definitions: Fetch pinned indicator and baseline versions and compare applicable unit, method and period metadata.
- Pin evidence: Record source URL, release vintage, retrieval time, local SHA-256 and licensing/classification; retain an immutable permitted source snapshot.
- Select valid observations: Query exact inclusive dates; resolve effective revisions and approved statuses; preserve excluded years and source-site changes.
- Run completeness and comparability gates: Reject missing years, zero-length series, duplicate time keys, nonfinite values and incompatible units unless an explicitly reviewed exception applies.
- Calculate: Use the pinned method version, specify rounding behavior and record unrounded intermediate values for audit.
- Interpret: Attach alternative baseline-window sensitivity, observational uncertainty caveats and a noncausal claim classification.
- Record and review: Persist a reproducible provenance manifest and immutable output version with actor, review status and audit events. A completed calculation remains a draft.
For write operations, the engineering acceptance suite should additionally verify revision-conflict handling, idempotency keys, audit-log failure behavior and the separation of saving from approval. These requirements are proposed acceptance criteria; this independent offline adapter does not implement a production identity provider, durable storage or WordPress workflows.
7. Executable reference adapter (offline, no installed API)
The companion package contains src/baseline_contract_adapter.py, src/scientific_baseline_validation.py, the real-observation CSV, a sample request and automated negative tests. The adapter validates the requested workspace string against a separately supplied expected workspace, pinned source checksum, dates, unit, version strings, site-transition acknowledgement and descriptive-only claim classification. The check demonstrates input guards; it is not a substitute for server-side authentication or actual version resolution.
python3 src/baseline_contract_adapter.py \
data/noaa_mlo_annual_1959_2025.csv \
data/selection_contract.example.json
python3 -m unittest discover -s tests -v
shasum -a 256 data/noaa_mlo_annual_1959_2025.csv
Expected output: baseline 406.510 ppm; 5 included years; preserved hash and version references; descriptive_observation; draft. The adapter does not issue HTTP requests, modify a repository, interact with WordPress, or mark a claim scientifically approved.
8. Negative tests and acceptance matrix
| Test condition | Expected system behavior | Verification scope |
|---|---|---|
| Cross-workspace selection | Reject authorization mismatch before reading protected data | Offline demonstration only; real identity/RBAC staging pending |
| Unknown source hash or stale pinned version | Fail closed; require exact allowed evidence and current authorized definition | Checksum/version string checks offline; resolution pending |
| Missing/duplicate/revised year | Do not count an omitted year as zero or both old and new observations | Missing/duplicate tested; database revisions pending |
| Invalid units or nonfinite values | Reject rather than silently convert to tCO₂e | Offline unit and numeric checks |
| 2022–2023 site transition | Require explicit documented comparability review | Offline acknowledgement gate; scientific review pending |
| Claim type set to causal impact | Reject without a separately reviewed causal evaluation design | Offline descriptive-only guard |
| Publication status is published/approved | Reject direct promotion through a computation request | Offline draft-only guard; WordPress publication tests pending |
| Duplicate submission or stale update | Apply idempotency and optimistic revision concurrency | Requires actual service and database staging |
| Restricted data in export/log | Do not emit private identifiers or privileged evidence | Requires actual WordPress/API export and log inspection |
| Audit event persistence fails | Fail the governed write or use an explicitly designed reliable audit mechanism | Requires actual persistence integration staging |
9. Known implementation risks and source/documentation mismatches
Method labels: User-facing baseline documentation uses general labels such as “point,” “average,” and “rolling,” while the reviewed Python code uses more specific identifiers, e.g., point_first, point_latest, period_average and rolling_average. Engineers must use source-verified enum values for programmatic integration, not prose labels.
Period metadata versus filtering: The registry stores reference-period metadata, but compute_baseline() does not visibly filter passed observations by date. Every caller should demonstrate explicit preselection.
Scientific confidence versus statistical coverage: The registry permits confidence labels such as low, medium and high; these labels are not statistical confidence intervals or independent scientific approval.
WordPress divergence: WordPress documentation describes authenticated indicator-registry controls and a REST namespace global-impact-catalyst/v1. It does not establish exact installed endpoints, proof that the Python and WordPress implementations enforce identical rules, or end-to-end access controls. Inspect the plugin and test authenticated/unauthenticated and cross-workspace requests on staging.
10. Review, governance, and threat model
Separate project authorization, source licensing, dataset restrictions, scientific review, editorial approval and public release. Engineers should model threats including tenant leakage, stale version reuse, arbitrary formula injection, missing or duplicate observations, source tampering, unauthorized publish transitions, and sensitive evidence exposure through audit logs, search indexes or exports.
A source snapshot and deterministic result prove what an algorithm computed from specific bytes; they cannot prove that the historical period was scientifically appropriate, that observations represent the intended population, or that a counterfactual is valid. Report limits and conflicts of interest in the review record.
11. Staging acceptance (not executed)
Use the companion STAGING_ACCEPTANCE_MATRIX.md for 32 manual checks spanning source identity, period inclusion, version drift, formula constraints, REST authentication, WordPress permissions, tenant isolation, revision conflicts, idempotency, publication gating, exports, logs, and scientific review. All staging checks remain NOT_RUN. Do not claim deployed acceptance or security certification from the offline suite.
12. Scientific and engineering references
- NOAA Global Monitoring Laboratory, Trends in Atmospheric CO₂: data access and citation guidance.
- NOAA Mauna Loa annual mean CO₂ record, source snapshot November 19, 2026; annotated transcription included with package.
- GHG Protocol Corporate Accounting and Reporting Standard — distinct from atmospheric CO₂ concentration monitoring.
- World Bank, Impact Evaluation in Practice — counterfactual identification and evaluation design.
- Global Impact Catalyst baseline method specification and repository regression tests.
13. Quality-check summary and publication boundary
- Trace all observations to a pinned scientific source and immutable content hash.
- Demonstrate complete, period-restricted selection with compatible units and effective revisions.
- Record the exact model/version, count, rounding, site changes and sensitivity result.
- Keep descriptive monitoring separate from counterfactual impact assertions.
- Run authenticated staging and scientific review before declaring installed-product or public-claim validity.
Expected engineering outcome: A reproducible draft baseline with disclosed assumptions and evidence lineage, suitable for review and for implementation regression testing—but not automatically approved, causally attributed or publicly certified.
