PHO Algorithmic Audit Solver
This skill enables solving Public Health Observatory (PHO) registered algorithmic audits.
Every audit follows the same structure: resolve published data from a read-only REST API,
run multiple independent statistical modules exactly as specified, apply controlled
decision gates, and return a single JSON object conforming to a supplied answer template.
Workflow
Read the request and template. The workspace contains analysis_request.json and
answer_template.json. Read both completely. The request defines the geography,
years, measures, cohorts, module specifications, and decision rules. The template
defines the exact JSON structure, field names, array lengths, precision, and enum
values the answer must match.
Discover the API base URL. The prompt text contains <TASK_ENV_BASE_URL>.
Replace that token with the actual base URL before making any HTTP request.
Fetch all required data. Use the endpoints described in references/api.md.
Apply the release-resolution rules from the request: filter by effective status,
value type, source type, and validity flags; select the greatest revision then
latest release timestamp then lowest record ID for each entity-measure-time key.
Suppressed, invalid, withdrawn, blank, or null analytic values are unavailable
— never zero-fill them.
Construct cohorts in declared order. Build each cohort (primary, balanced,
broad, dual-source, machine-learning) from the effective completeness predicates.
Preserve entity-code then time order in every aligned array. When a cohort excludes
entities, report them sorted ascending.
Execute modules in declared order. The request lists modules in a specific
sequence. Complete each one fully before moving to the next. Every module is
self-contained: it uses its own cohort, hyperparameters, and random state.
For detailed implementations of each statistical method, see
references/methods.md.
Apply decision gates on unrounded values. After all modules are complete,
evaluate each business predicate on unrounded computed values. Count passing gates
and select the classification from the request's controlled decision mapping.
Report every gate's PASS/FAIL status in the declared module order.
Format the answer. Follow references/formatting.md
precisely. The answer template is the contract — every key, array length, order,
precision, enum value, and type must match. Submit exactly one JSON object with
no narrative outside it.
Core Principles
Never carry values across invocations. Every audit recomputes all evidence from
the effective request and the portal. The same protocol ID may be used with different
years, measures, geographies, or thresholds — recompute everything from scratch.
Preserve every declared order. Entity codes, feature lists, cluster groups, time
periods, grid values, and checkpoint intervals must appear in the exact order declared
by the request. When the template says "ascending ASCII" or "ascending state code",
sort accordingly. Never sort aligned result arrays independently of their companion
identifier arrays.
Respect the information boundary. Use only the portal API endpoints listed in the
environment access. No credentials are needed. Do not access endpoints not listed.
Precision rules. Report non-integer statistics to the decimal places declared
by the request (typically 4). Use JSON null only when a value is mathematically
unavailable (e.g., a t-statistic when the standard error is exactly zero). Never
use NaN, Infinity, or string representations of numbers.
PRNG determinism. Every random module uses a specific seed/stream declared in
the request. Implement the generator exactly as specified — do not substitute
library RNGs. Record checkpoints at the declared replicate numbers without
resetting the stream.
Complete every module before deciding. Even if an early gate would fail, all
modules must produce their full evidence. The decision module evaluates all gates
and picks the first failed module by precedence only for reporting.
Quick Reference
| Concern |
Reference |
| API endpoints, filtering, release resolution |
references/api.md |
| Ridge, elastic net, FE, GMM, bootstrap, PCA, clustering, conformal, sensitivity, Shapley |
references/methods.md |
| JSON precision, ordering, null rules, enum values |
references/formatting.md |
1---2name: pho-algorithmic-audit-113description: Solve Public Health Observatory algorithmic transportability audits. Use when the user presents an analysis_request.json and answer_template.json referencing a PHO protocol, mentions "Public Health Observatory", "algorithmic audit", "transportability", "PHO", or a task requiring six-module statistical computation against a read-only REST API at TASK_ENV_BASE_URL, or when the prompt asks to complete a registered audit using a Web portal with controlled publication gates.4metadata:5 source: https://skillmd.com/skills/prism-shadow/pho-algorithmic-audit-116---78# PHO Algorithmic Audit Solver910This skill enables solving Public Health Observatory (PHO) registered algorithmic audits.11Every audit follows the same structure: resolve published data from a read-only REST API,12run multiple independent statistical modules exactly as specified, apply controlled13decision gates, and return a single JSON object conforming to a supplied answer template.1415## Workflow16171. **Read the request and template.** The workspace contains `analysis_request.json` and18 `answer_template.json`. Read both completely. The request defines the geography,19 years, measures, cohorts, module specifications, and decision rules. The template20 defines the exact JSON structure, field names, array lengths, precision, and enum21 values the answer must match.22232. **Discover the API base URL.** The prompt text contains `<TASK_ENV_BASE_URL>`.24 Replace that token with the actual base URL before making any HTTP request.25263. **Fetch all required data.** Use the endpoints described in [references/api.md](references/api.md).27 Apply the release-resolution rules from the request: filter by effective status,28 value type, source type, and validity flags; select the greatest revision then29 latest release timestamp then lowest record ID for each entity-measure-time key.30 Suppressed, invalid, withdrawn, blank, or null analytic values are unavailable31 — never zero-fill them.32334. **Construct cohorts in declared order.** Build each cohort (primary, balanced,34 broad, dual-source, machine-learning) from the effective completeness predicates.35 Preserve entity-code then time order in every aligned array. When a cohort excludes36 entities, report them sorted ascending.37385. **Execute modules in declared order.** The request lists modules in a specific39 sequence. Complete each one fully before moving to the next. Every module is40 self-contained: it uses its own cohort, hyperparameters, and random state.41 For detailed implementations of each statistical method, see42 [references/methods.md](references/methods.md).43446. **Apply decision gates on unrounded values.** After all modules are complete,45 evaluate each business predicate on unrounded computed values. Count passing gates46 and select the classification from the request's controlled decision mapping.47 Report every gate's PASS/FAIL status in the declared module order.48497. **Format the answer.** Follow [references/formatting.md](references/formatting.md)50 precisely. The answer template is the contract — every key, array length, order,51 precision, enum value, and type must match. Submit exactly one JSON object with52 no narrative outside it.5354## Core Principles5556**Never carry values across invocations.** Every audit recomputes all evidence from57the effective request and the portal. The same protocol ID may be used with different58years, measures, geographies, or thresholds — recompute everything from scratch.5960**Preserve every declared order.** Entity codes, feature lists, cluster groups, time61periods, grid values, and checkpoint intervals must appear in the exact order declared62by the request. When the template says "ascending ASCII" or "ascending state code",63sort accordingly. Never sort aligned result arrays independently of their companion64identifier arrays.6566**Respect the information boundary.** Use only the portal API endpoints listed in the67environment access. No credentials are needed. Do not access endpoints not listed.6869**Precision rules.** Report non-integer statistics to the decimal places declared70by the request (typically 4). Use JSON null only when a value is mathematically71unavailable (e.g., a t-statistic when the standard error is exactly zero). Never72use NaN, Infinity, or string representations of numbers.7374**PRNG determinism.** Every random module uses a specific seed/stream declared in75the request. Implement the generator exactly as specified — do not substitute76library RNGs. Record checkpoints at the declared replicate numbers without77resetting the stream.7879**Complete every module before deciding.** Even if an early gate would fail, all80modules must produce their full evidence. The decision module evaluates all gates81and picks the first failed module by precedence only for reporting.8283## Quick Reference8485| Concern | Reference |86|---|---|87| API endpoints, filtering, release resolution | [references/api.md](references/api.md) |88| Ridge, elastic net, FE, GMM, bootstrap, PCA, clustering, conformal, sensitivity, Shapley | [references/methods.md](references/methods.md) |89| JSON precision, ordering, null rules, enum values | [references/formatting.md](references/formatting.md) |