Public Health Observatory Audit Solver
Start Here
- Read the user prompt,
analysis_request.json, answer_template.json, and any local environment_access.md.
- Use the portal base URL from the prompt placeholder or from
environment_access.md. Do not call judge endpoints.
- Fetch only authorized portal evidence. Prefer CSV downloads through
/download?dataset=<name>&format=csv after checking /catalog for schemas.
- Build one effective request contract before touching analytic data. Apply direct keys and
*_overrides by exact path only; arrays replace whole arrays, objects deep-merge, scalars replace exact paths, and unknown targets are errors.
- Compute every requested module from scratch from portal evidence. Keep unrounded values internally, preserve declared order everywhere, and round only when serializing the final JSON.
- Return exactly one JSON object conforming to
answer_template.json. Do not add narrative. Do not include solved-standard provenance unless the future template explicitly requires it.
Portal Datasets
Expect these portal datasets unless /catalog says otherwise:
- Geography:
states, counties, countries
- Publications:
state_health, state_socioeconomic, county_health, county_socioeconomic, country_indicators
- Revision metadata:
revisions
Use text identifiers as text. Preserve leading zeros in FIPS fields. Treat suppressed, invalid, withdrawn, blank, and null analytic values as unavailable, never as zero.
Method Reference
Read references/pho_methods.md before implementing modules. It summarizes the reusable methods inferred from the staged PHO examples without embedding their solved values.
Use scripts/pho_stats.py for deterministic numerical primitives. Copy or import only the functions needed for the task, then write task-local code that binds variables, cohorts, filters, grids, seeds, and output fields from the effective future request.
Output Discipline
- Validate top-level keys, nested keys, array lengths, enum values, and numeric precision against the template.
- Preserve all registered orders: entity, state, division, fold, feature, coefficient, lambda/grid, replicate checkpoint, source group, year, and candidate-cluster order.
- Do not independently sort aligned result arrays. Sort only when the request or template explicitly says a set-like list must be sorted.
- Use JSON
null only for mathematically unavailable requested statistics. Never emit NaN, Infinity, comments, markdown, or explanatory text.
1---2name: pho-portal-audit3description: Solve Public Health Observatory web-portal audit tasks that require analysis_request.json and answer_template.json outputs, including state, county, and country release reconciliation; deterministic fixed-effect, GMM, ridge or elastic-net, bootstrap, conformal, PCA, clustering, sensitivity, source-perturbation, and controlled-decision modules. Use when a task references the Public Health Observatory portal, PHO protocol IDs, or asks for one JSON audit object from portal evidence.4metadata:5 source: https://skillmd.com/skills/prism-shadow/pho-portal-audit6---78# Public Health Observatory Audit Solver910## Start Here11121. Read the user prompt, `analysis_request.json`, `answer_template.json`, and any local `environment_access.md`.132. Use the portal base URL from the prompt placeholder or from `environment_access.md`. Do not call judge endpoints.143. Fetch only authorized portal evidence. Prefer CSV downloads through `/download?dataset=<name>&format=csv` after checking `/catalog` for schemas.154. Build one effective request contract before touching analytic data. Apply direct keys and `*_overrides` by exact path only; arrays replace whole arrays, objects deep-merge, scalars replace exact paths, and unknown targets are errors.165. Compute every requested module from scratch from portal evidence. Keep unrounded values internally, preserve declared order everywhere, and round only when serializing the final JSON.176. Return exactly one JSON object conforming to `answer_template.json`. Do not add narrative. Do not include solved-standard provenance unless the future template explicitly requires it.1819## Portal Datasets2021Expect these portal datasets unless `/catalog` says otherwise:2223- Geography: `states`, `counties`, `countries`24- Publications: `state_health`, `state_socioeconomic`, `county_health`, `county_socioeconomic`, `country_indicators`25- Revision metadata: `revisions`2627Use text identifiers as text. Preserve leading zeros in FIPS fields. Treat suppressed, invalid, withdrawn, blank, and null analytic values as unavailable, never as zero.2829## Method Reference3031Read [references/pho_methods.md](references/pho_methods.md) before implementing modules. It summarizes the reusable methods inferred from the staged PHO examples without embedding their solved values.3233Use [scripts/pho_stats.py](scripts/pho_stats.py) for deterministic numerical primitives. Copy or import only the functions needed for the task, then write task-local code that binds variables, cohorts, filters, grids, seeds, and output fields from the effective future request.3435## Output Discipline3637- Validate top-level keys, nested keys, array lengths, enum values, and numeric precision against the template.38- Preserve all registered orders: entity, state, division, fold, feature, coefficient, lambda/grid, replicate checkpoint, source group, year, and candidate-cluster order.39- Do not independently sort aligned result arrays. Sort only when the request or template explicitly says a set-like list must be sorted.40- Use JSON `null` only for mathematically unavailable requested statistics. Never emit `NaN`, `Infinity`, comments, markdown, or explanatory text.