PHO Audit Protocols
Execute multi-module algorithmic audits using the Public Health Observatory (PHO) read-only data portal.
Workflow
- Read the task prompt and the attached analysis_request.json and answer_template.json.
- Download all required datasets from the portal as CSV via
GET /download?dataset={name}&format=csv.
Base URL is <TASK_ENV_BASE_URL> from the prompt.
- Resolve releases: for each (entity, year, measure, filter) combination, select greatest
revision, then latest released_at, then lowest record id. See references/release_resolution.md.
- Build the cohort(s) specified by the request (balanced, broad, dual-source, primary, etc.).
- Execute every audit module in the order declared by the request.
- Apply the controlled decision gate evaluation.
- Return exactly one JSON object conforming to the answer template. No narrative outside the JSON.
Portal reference
See references/portal_api.md for complete endpoint, column, and filter details.
Module catalog
See references/module_catalog.md for every registered module method name,
algorithmic contract, and script reference.
Key portal methodology rules
- Direct survey estimates are primary for state publications; county rollups are parallel.
- Age-adjusted values for state comparisons; crude values for county burden.
- Final releases supersede provisional; highest final revision governs.
- Suppressed, invalid, or blank values are never zero-filled.
- Country labels resolve via portal_label and alternate_labels to stable iso3 identifiers.
- RUCC 1-3 = metropolitan; 4-9 = nonmetropolitan.
- Leading zeros in FIPS codes are meaningful.
Scripts
Import from or adapt these bundled implementations:
| Script |
Contents |
| scripts/prng.py |
PCG32 and XORSHIFT32 with Webb six-point weight mapping |
| scripts/ols.py |
OLS, two-way FE, CR1/HC3 variance, delete-one-cluster jackknife |
| scripts/ridge.py |
Ridge coordinate descent, training-only standardization, nested group CV |
| scripts/pca.py |
Symmetric Jacobi PCA, standardized scores, loading orientation |
| scripts/cluster.py |
Deterministic k-means, silhouette, adjusted Rand index |
| scripts/conformal.py |
Grouped split conformal, cross-fold conformal, per-state coverage |
Reporting rules
- Round all non-integer reported statistics to the precision declared in the request (typically 4 or 6 decimal places).
- Use uppercase two-letter state codes and exact portal division/region names.
- Preserve every declared order (entity-code, time, feature, group); never independently sort aligned arrays.
- Use JSON null only when a requested statistic is mathematically unavailable; never use NaN or Infinity.
- Counts, ranks, seeds, PRNG states, and replicate numbers are integers.
Protocols observed in evidence
The following protocol_ids appear in the training evidence. Each follows the module
execution pattern above with different module compositions:
- PHO_STATE_TRANSPORT_AUDIT_V1: six-module state transportability audit (FE jackknife, ridge CV, wild bootstrap, conformal, trajectory PCA, source-year perturbation).
- PHO_COUNTY_MEDIATION_TRANSPORT_V1: county mediation audit (GMM mediation, nested ridge, wild bootstrap, state conformal, sensitivity surface, trajectory PCA).
- PHO_STATE_ROBUSTNESS_TRANSPORT_V1: weighted state robustness audit (weighted FE jackknife, elastic net CV, wild bootstrap, cross-fold conformal, trajectory PCA, source perturbation with Shapley).
- PHO_COUNTY_PANEL_TRANSPORT_V1: county panel dynamics audit (two-step GMM, elastic net CV, wild bootstrap, cross-fold conformal, trajectory PCA, source group deletion).
When a task protocol_id matches one of these, apply the corresponding module composition.
When a protocol_id is novel, construct the audit from the module names declared in
analysis_request.json, using the algorithmic contracts in the module catalog.
1---2name: pho-audit-protocols3description: Complete multi-module algorithmic audit protocols for the Public Health Observatory data portal. Use when a task requires running registered PHO protocol modules (fixed-effects jackknife, nested ridge/elastic-net CV, wild cluster bootstrap, grouped conformal, trajectory PCA+k-means, source perturbation, or controlled decision gates) against the read-only PHO web portal at the task environment base URL. Covers state, county, and country-level analyses with deterministic PRNGs, release resolution, and audit-grade reproducibility requirements.4metadata:5 source: https://skillmd.com/skills/prism-shadow/pho-audit-protocols6---78# PHO Audit Protocols910Execute multi-module algorithmic audits using the Public Health Observatory (PHO) read-only data portal.1112## Workflow13141. Read the task prompt and the attached analysis_request.json and answer_template.json.152. Download all required datasets from the portal as CSV via `GET /download?dataset={name}&format=csv`.16 Base URL is `<TASK_ENV_BASE_URL>` from the prompt.173. Resolve releases: for each (entity, year, measure, filter) combination, select greatest18 revision, then latest released_at, then lowest record id. See [references/release_resolution.md](references/release_resolution.md).194. Build the cohort(s) specified by the request (balanced, broad, dual-source, primary, etc.).205. Execute every audit module in the order declared by the request.216. Apply the controlled decision gate evaluation.227. Return exactly one JSON object conforming to the answer template. No narrative outside the JSON.2324## Portal reference2526See [references/portal_api.md](references/portal_api.md) for complete endpoint, column, and filter details.2728## Module catalog2930See [references/module_catalog.md](references/module_catalog.md) for every registered module method name,31algorithmic contract, and script reference.3233## Key portal methodology rules3435- Direct survey estimates are primary for state publications; county rollups are parallel.36- Age-adjusted values for state comparisons; crude values for county burden.37- Final releases supersede provisional; highest final revision governs.38- Suppressed, invalid, or blank values are never zero-filled.39- Country labels resolve via portal_label and alternate_labels to stable iso3 identifiers.40- RUCC 1-3 = metropolitan; 4-9 = nonmetropolitan.41- Leading zeros in FIPS codes are meaningful.4243## Scripts4445Import from or adapt these bundled implementations:4647| Script | Contents |48|--------|----------|49| [scripts/prng.py](scripts/prng.py) | PCG32 and XORSHIFT32 with Webb six-point weight mapping |50| [scripts/ols.py](scripts/ols.py) | OLS, two-way FE, CR1/HC3 variance, delete-one-cluster jackknife |51| [scripts/ridge.py](scripts/ridge.py) | Ridge coordinate descent, training-only standardization, nested group CV |52| [scripts/pca.py](scripts/pca.py) | Symmetric Jacobi PCA, standardized scores, loading orientation |53| [scripts/cluster.py](scripts/cluster.py) | Deterministic k-means, silhouette, adjusted Rand index |54| [scripts/conformal.py](scripts/conformal.py) | Grouped split conformal, cross-fold conformal, per-state coverage |5556## Reporting rules5758- Round all non-integer reported statistics to the precision declared in the request (typically 4 or 6 decimal places).59- Use uppercase two-letter state codes and exact portal division/region names.60- Preserve every declared order (entity-code, time, feature, group); never independently sort aligned arrays.61- Use JSON null only when a requested statistic is mathematically unavailable; never use NaN or Infinity.62- Counts, ranks, seeds, PRNG states, and replicate numbers are integers.6364## Protocols observed in evidence6566The following protocol_ids appear in the training evidence. Each follows the module67execution pattern above with different module compositions:6869- PHO_STATE_TRANSPORT_AUDIT_V1: six-module state transportability audit (FE jackknife, ridge CV, wild bootstrap, conformal, trajectory PCA, source-year perturbation).70- PHO_COUNTY_MEDIATION_TRANSPORT_V1: county mediation audit (GMM mediation, nested ridge, wild bootstrap, state conformal, sensitivity surface, trajectory PCA).71- PHO_STATE_ROBUSTNESS_TRANSPORT_V1: weighted state robustness audit (weighted FE jackknife, elastic net CV, wild bootstrap, cross-fold conformal, trajectory PCA, source perturbation with Shapley).72- PHO_COUNTY_PANEL_TRANSPORT_V1: county panel dynamics audit (two-step GMM, elastic net CV, wild bootstrap, cross-fold conformal, trajectory PCA, source group deletion).7374When a task protocol_id matches one of these, apply the corresponding module composition.75When a protocol_id is novel, construct the audit from the module names declared in76analysis_request.json, using the algorithmic contracts in the module catalog.