Asteria Fleet Data Quality Hub — collection audit & certification
When to use
Use this skill when a task asks you to audit / reconcile / certify a business
collection served by the Asteria Fleet Data Quality Hub (a read-only HTTP
API) and return a single JSON object matching an answer_template.json /
answer contract. The run always stages four inputs alongside this skill:
prompt.txt — the brief and which interfaces are relevant.
payloads/case_scope.json — collection id, business cutoff, focus /
ranking / decision-panel ID lists, certification thresholds, status→action map.
payloads/answer_template.json — the exact output contract (required keys,
types, enums, array lengths, ordering rules, numeric precision). Authoritative.
environment_access.md — the live base URL, the Authorization bearer token,
and the allowed-endpoint allowlist. The only source for network access.
Collection families seen: fuel purchases, freight charges,
maintenance events, and contact populations (partner-onboarding
certification, field-service roster readiness). Per-family outputs and
distinguishing logic live in references/playbooks.md.
Core principle
The hub holds overlapping source snapshots per collection. Your job is to
pick the authoritative snapshot, deduplicate raw rows into logical records as of
the business cutoff, separate quarantined (unusable) records from valid
ones, flag mismatch records (valid but expected-vs-actual category differs),
normalize units and currency, infer the opaque control codes the contract
demands, and certify. Never copy specific answer values from training
material — derive every count, ID, code, total, and ranking from the live hub
records plus the run's case_scope.json.
Step 0 — read the inputs
prompt.txt — note the family and which interfaces it names.
payloads/case_scope.json — every parameter you must obey (collection id,
cutoff, focus IDs, ranking limits, decision-panel ID lists, thresholds,
status→action map, fixed gates).
payloads/answer_template.json — the contract. Note required top-level keys,
per-field enums, minItems/maxItems, patterns, multipleOf, and any
x-ordering_rules / field descriptions that state ordering or precision.
Two shapes occur: a JSON-Schema object (most runs) or a field_contract
object with required_top_level_keys + field_contract (contact-roster
style). Enforce both equivalently.
environment_access.md — extract base URL, Authorization header value, and
the allowed-endpoint allowlist. Use only these to reach the hub.
Step 1 — connect to the hub
Resolve the prompt's <TASK_ENV_BASE_URL> placeholder to the base URL from
environment_access.md. Send Authorization: Bearer <token> on every request.
Stay inside the allowed-endpoint allowlist.
| Endpoint |
Purpose |
GET /api/catalog/collections |
List collections; confirm the target by collection_id; read family, source_systems, time span. |
GET /api/catalog/schema |
Logical views and their fields/meanings. |
GET /api/source-snapshots?collection=<id> |
Snapshot metadata: snapshot_id, snapshot_status (CERTIFIED/PROVISIONAL/STALE), row_count, business_cutoff. |
GET /api/transactions/fuel?collection=<id>&limit=&offset= |
Fuel rows (paginated). |
GET /api/transactions/freight?collection=<id>&limit=&offset= |
Freight charge rows (paginated). |
GET /api/maintenance/events?collection=<id>&limit=&offset= |
Maintenance event rows (paginated). |
GET /api/contacts?collection=<id>&limit=&offset= |
Contact rows (paginated). |
GET /api/reference/aliases |
Alias → canonical category/class maps. |
GET /api/reference/conversions |
Unit conversion factors. |
GET /api/reference/fx |
FX rates to base currency. |
POST /api/query |
Authenticated ad-hoc query layer over the views. The GET endpoints above already support full paging; probe /api/query's body contract at runtime only if you need server-side filtered joins. |
Pagination: every list endpoint accepts limit and offset and returns
total. Loop offset += limit until you have collected total items.
Collections are larger than one page — never assume a single response is
complete. Full detail, auth notes, and the view→field map are in
references/hub_api.md.
Step 2 — end-to-end procedure
- Resolve collection & snapshots. Confirm the
collection_id exists in
/api/catalog/collections and note its family. From
/api/source-snapshots?collection=<id>, the authoritative snapshot is the
one with snapshot_status CERTIFIED (and business_cutoff matching the
case-scope cutoff). Record its snapshot_id as authoritative_snapshot_id.
Other snapshots (PROVISIONAL/STALE) are overlap sources to deduplicate
against. Do not assume a -certified suffix — snapshot-id naming varies
by family (transactional families use -certified/-provisional; some
contact families use -s01/-s02). The snapshot_status field is
authoritative.
- Load schema (
/api/catalog/schema) for the relevant view's field names.
- Page all raw rows for the collection from the family's data endpoint,
each tagged with its
snapshot_id.
- Apply the cutoff. Keep only rows whose business date is
<= the
case-scope cutoff (family's business-date field — see playbooks).
- Deduplicate across snapshots. Group by logical key (
transaction_id /
charge_id / event_id / contact identity). When the same logical record
appears in multiple snapshots, retain the authoritative-snapshot
occurrence, drop the rest. raw_row_count = all in-scope raw rows;
duplicate_raw_count = dropped duplicates; logical count = raw − duplicates.
Report duplicate groups with the retained snapshot id.
- Classify each logical record into one disposition:
- Quarantine — unusable (family-specific conditions in playbooks).
Excluded from normalized totals and from mismatch exposure; still
counted as an exception.
- Mismatch — valid but recognized category/class (from alias resolution)
differs from the expected category/class on the record. Included in
normalized totals and in mismatch exposure.
- Valid (clean) — otherwise; included in normalized totals.
exception = distinct logical records that are a mismatch or
quarantined.
- Normalize units & currency. Convert quantity/weight/distance to the
canonical unit from
case_scope (L, KG, KM) using
/api/reference/conversions; convert amount to base currency (USD) using
/api/reference/fx. Apply to valid + mismatch records only, never
quarantined.
- Compute outputs — exactly the sections the contract requires (audit
summary counts, mismatch/unrecognized ID lists, normalized totals overall +
per category/class, focus rollups, ranked arrays, duplicate groups,
quarantine ID sets, region/depot rollups, readiness partitions, control-code
panels, certification status). Apply the contract's ordering and
precision (see
references/reconciliation.md).
- Infer opaque control codes for every decision-panel ID in
case_scope
(focus clusters, anchored/identifier/control cases, reference IDs,
transaction/charge IDs, event IDs). Codes are family-prefixed vocabularies;
infer each from the reconciled evidence — never copy a specific code from
training answers. See references/code_inference.md.
- Certify. Apply case-scope thresholds (e.g.
pass_max_quarantine_rate, pass_with_exceptions_max_quarantine_rate) and
any fixed gate to derive status (PASS / PASS_WITH_EXCEPTIONS / HOLD), then
map via the case-scope status_action_map to the action (RELEASE /
REVIEW_EXCEPTIONS / BLOCK_AND_REMEDIATE). Fixed gates (e.g. an odometer
regression gate forced to HOLD) override computed thresholds.
- Emit exactly one JSON object conforming to
answer_template.json:
only required top-level keys, correct nesting, enums, array lengths,
ordering, precision. No extra keys, no commentary, no Markdown. Validate
against the template before returning.
Critical rules (do not violate)
- One JSON object, exact contract. No extra or missing keys, no prose.
Validate against the template.
- Derive everything from live records + case_scope. Never reuse training
answer values (no counts, no ID lists, no code assignments, no canonical
values, no rankings).
- Quarantined records never enter normalized totals or mismatch exposure;
valid mismatches enter both.
exception = mismatch ∪ quarantine (distinct).
- Authoritative snapshot wins for duplicate retention;
authoritative_snapshot_id
comes from snapshot_status CERTIFIED, not a hardcoded id suffix.
- Page until
total. Never assume one response is complete.
- Stable IDs only — IDs present in the public data or case_scope; preserve
the contract's ordering.
- Precision — round monetary/quantity totals to 2 decimals (rates to 4);
counts are exact integers. Round at the final aggregation step, not mid-sum.
References
references/hub_api.md — endpoint catalog, auth, pagination, snapshot model, view→field map.
references/reconciliation.md — dedup, cutoff, quarantine/mismatch, normalization, ordering, precision, certification.
references/code_inference.md — opaque code families, prefixes, evidence dimensions.
references/playbooks.md — per-collection-family playbooks (fuel, freight, maintenance, contacts).
1---2name: asteria-fleet-dq-certification-33description: Audit and certify an Asteria Fleet Data Quality Hub collection — reconcile overlapping source snapshots as of a business cutoff, normalize units/currency, quarantine invalid records, classify expected-vs-actual mismatches, infer opaque internal control codes, and emit one JSON object conforming exactly to the run's answer contract.4---56# Asteria Fleet Data Quality Hub — collection audit & certification78## When to use910Use this skill when a task asks you to audit / reconcile / certify a business11collection served by the **Asteria Fleet Data Quality Hub** (a read-only HTTP12API) and return a single JSON object matching an `answer_template.json` /13answer contract. The run always stages four inputs alongside this skill:1415- `prompt.txt` — the brief and which interfaces are relevant.16- `payloads/case_scope.json` — collection id, business cutoff, focus /17 ranking / decision-panel ID lists, certification thresholds, status→action map.18- `payloads/answer_template.json` — the exact output contract (required keys,19 types, enums, array lengths, ordering rules, numeric precision). Authoritative.20- `environment_access.md` — the live base URL, the `Authorization` bearer token,21 and the allowed-endpoint allowlist. The **only** source for network access.2223Collection families seen: **fuel purchases**, **freight charges**,24**maintenance events**, and **contact populations** (partner-onboarding25certification, field-service roster readiness). Per-family outputs and26distinguishing logic live in `references/playbooks.md`.2728## Core principle2930The hub holds **overlapping source snapshots** per collection. Your job is to31pick the authoritative snapshot, deduplicate raw rows into logical records as of32the business cutoff, separate **quarantined** (unusable) records from **valid**33ones, flag **mismatch** records (valid but expected-vs-actual category differs),34normalize units and currency, infer the opaque control codes the contract35demands, and certify. **Never copy specific answer values from training36material** — derive every count, ID, code, total, and ranking from the live hub37records plus the run's `case_scope.json`.3839## Step 0 — read the inputs40411. `prompt.txt` — note the family and which interfaces it names.422. `payloads/case_scope.json` — every parameter you must obey (collection id,43 cutoff, focus IDs, ranking limits, decision-panel ID lists, thresholds,44 status→action map, fixed gates).453. `payloads/answer_template.json` — the contract. Note required top-level keys,46 per-field enums, `minItems`/`maxItems`, `pattern`s, `multipleOf`, and any47 `x-ordering_rules` / field `description`s that state ordering or precision.48 Two shapes occur: a JSON-Schema object (most runs) or a `field_contract`49 object with `required_top_level_keys` + `field_contract` (contact-roster50 style). Enforce both equivalently.514. `environment_access.md` — extract base URL, `Authorization` header value, and52 the allowed-endpoint allowlist. Use **only** these to reach the hub.5354## Step 1 — connect to the hub5556Resolve the prompt's `<TASK_ENV_BASE_URL>` placeholder to the base URL from57`environment_access.md`. Send `Authorization: Bearer <token>` on every request.58Stay inside the allowed-endpoint allowlist.5960| Endpoint | Purpose |61|---|---|62| `GET /api/catalog/collections` | List collections; confirm the target by `collection_id`; read `family`, `source_systems`, time span. |63| `GET /api/catalog/schema` | Logical `views` and their fields/meanings. |64| `GET /api/source-snapshots?collection=<id>` | Snapshot metadata: `snapshot_id`, `snapshot_status` (CERTIFIED/PROVISIONAL/STALE), `row_count`, `business_cutoff`. |65| `GET /api/transactions/fuel?collection=<id>&limit=&offset=` | Fuel rows (paginated). |66| `GET /api/transactions/freight?collection=<id>&limit=&offset=` | Freight charge rows (paginated). |67| `GET /api/maintenance/events?collection=<id>&limit=&offset=` | Maintenance event rows (paginated). |68| `GET /api/contacts?collection=<id>&limit=&offset=` | Contact rows (paginated). |69| `GET /api/reference/aliases` | Alias → canonical category/class maps. |70| `GET /api/reference/conversions` | Unit conversion factors. |71| `GET /api/reference/fx` | FX rates to base currency. |72| `POST /api/query` | Authenticated ad-hoc query layer over the views. The GET endpoints above already support full paging; probe `/api/query`'s body contract at runtime only if you need server-side filtered joins. |7374**Pagination:** every list endpoint accepts `limit` and `offset` and returns75`total`. Loop `offset += limit` until you have collected `total` items.76Collections are larger than one page — never assume a single response is77complete. Full detail, auth notes, and the view→field map are in78`references/hub_api.md`.7980## Step 2 — end-to-end procedure81821. **Resolve collection & snapshots.** Confirm the `collection_id` exists in83 `/api/catalog/collections` and note its `family`. From84 `/api/source-snapshots?collection=<id>`, the **authoritative snapshot** is the85 one with `snapshot_status` CERTIFIED (and `business_cutoff` matching the86 case-scope cutoff). Record its `snapshot_id` as `authoritative_snapshot_id`.87 Other snapshots (PROVISIONAL/STALE) are overlap sources to deduplicate88 against. Do **not** assume a `-certified` suffix — snapshot-id naming varies89 by family (transactional families use `-certified`/`-provisional`; some90 contact families use `-s01`/`-s02`). The `snapshot_status` field is91 authoritative.922. **Load schema** (`/api/catalog/schema`) for the relevant view's field names.933. **Page all raw rows** for the collection from the family's data endpoint,94 each tagged with its `snapshot_id`.954. **Apply the cutoff.** Keep only rows whose business date is `<=` the96 case-scope cutoff (family's business-date field — see playbooks).975. **Deduplicate across snapshots.** Group by logical key (`transaction_id` /98 `charge_id` / `event_id` / contact identity). When the same logical record99 appears in multiple snapshots, **retain the authoritative-snapshot100 occurrence**, drop the rest. `raw_row_count` = all in-scope raw rows;101 `duplicate_raw_count` = dropped duplicates; logical count = raw − duplicates.102 Report duplicate groups with the retained snapshot id.1036. **Classify each logical record** into one disposition:104 - **Quarantine** — unusable (family-specific conditions in playbooks).105 Excluded from normalized totals **and** from mismatch exposure; still106 counted as an exception.107 - **Mismatch** — valid but recognized category/class (from alias resolution)108 differs from the expected category/class on the record. **Included** in109 normalized totals **and** in mismatch exposure.110 - **Valid (clean)** — otherwise; included in normalized totals.111 - `exception` = distinct logical records that are a mismatch **or**112 quarantined.1137. **Normalize units & currency.** Convert quantity/weight/distance to the114 canonical unit from `case_scope` (`L`, `KG`, `KM`) using115 `/api/reference/conversions`; convert amount to base currency (`USD`) using116 `/api/reference/fx`. Apply to valid + mismatch records only, never117 quarantined.1188. **Compute outputs** — exactly the sections the contract requires (audit119 summary counts, mismatch/unrecognized ID lists, normalized totals overall +120 per category/class, focus rollups, ranked arrays, duplicate groups,121 quarantine ID sets, region/depot rollups, readiness partitions, control-code122 panels, certification status). Apply the contract's **ordering** and123 **precision** (see `references/reconciliation.md`).1249. **Infer opaque control codes** for every decision-panel ID in `case_scope`125 (focus clusters, anchored/identifier/control cases, reference IDs,126 transaction/charge IDs, event IDs). Codes are family-prefixed vocabularies;127 infer each from the reconciled evidence — never copy a specific code from128 training answers. See `references/code_inference.md`.12910. **Certify.** Apply case-scope thresholds (e.g.130 `pass_max_quarantine_rate`, `pass_with_exceptions_max_quarantine_rate`) and131 any fixed gate to derive `status` (PASS / PASS_WITH_EXCEPTIONS / HOLD), then132 map via the case-scope `status_action_map` to the action (RELEASE /133 REVIEW_EXCEPTIONS / BLOCK_AND_REMEDIATE). Fixed gates (e.g. an odometer134 regression gate forced to HOLD) override computed thresholds.13511. **Emit exactly one JSON object** conforming to `answer_template.json`:136 only required top-level keys, correct nesting, enums, array lengths,137 ordering, precision. No extra keys, no commentary, no Markdown. Validate138 against the template before returning.139140## Critical rules (do not violate)141142- **One JSON object, exact contract.** No extra or missing keys, no prose.143 Validate against the template.144- **Derive everything from live records + case_scope.** Never reuse training145 answer values (no counts, no ID lists, no code assignments, no canonical146 values, no rankings).147- **Quarantined records never enter normalized totals or mismatch exposure**;148 valid mismatches enter both. `exception` = mismatch ∪ quarantine (distinct).149- **Authoritative snapshot wins** for duplicate retention; `authoritative_snapshot_id`150 comes from `snapshot_status` CERTIFIED, not a hardcoded id suffix.151- **Page until `total`.** Never assume one response is complete.152- **Stable IDs only** — IDs present in the public data or case_scope; preserve153 the contract's ordering.154- **Precision** — round monetary/quantity totals to 2 decimals (rates to 4);155 counts are exact integers. Round at the final aggregation step, not mid-sum.156157## References158159- `references/hub_api.md` — endpoint catalog, auth, pagination, snapshot model, view→field map.160- `references/reconciliation.md` — dedup, cutoff, quarantine/mismatch, normalization, ordering, precision, certification.161- `references/code_inference.md` — opaque code families, prefixes, evidence dimensions.162- `references/playbooks.md` — per-collection-family playbooks (fuel, freight, maintenance, contacts).