Asteria Data Quality Hub
Core Workflow
- Read the prompt,
payloads/case_scope.json,payloads/answer_template.json, andenvironment_access.mdbefore querying the hub. - Treat
answer_template.jsonas the output contract. Extract required keys, allowed enums, ordering rules, item counts, uniqueness rules, and numeric precision before doing calculations. Some templates are JSON Schema; others are compact field contracts. - Use the hub metadata first:
GET /api/catalog/collectionsto confirmcollection_id, family, approximate count, and source systems.GET /api/catalog/schemato confirm view/field names.
- Fetch the complete collection and support references. Prefer the bundled helper:
python <skill-dir>/scripts/fetch_hub_collection.py \
--env environment_access.md \
--collection '<collection_id>' \
--out hub_dump
Use --header 'Name: value' only when environment_access.md supplies credentials. If using curl manually, pass collection=<collection_id> to data and source-snapshot endpoints and page with limit/offset until offset + limit >= total.
- Reconcile retained logical records, quality issues, canonical fields, totals, rankings, and code panels by collection family. Read references/audit_patterns.md for the reusable family rules and opaque code semantics.
- Build the final object directly from the answer contract. Use only stable IDs from the task scope or hub data, sort arrays exactly as specified, deduplicate set outputs, round only the final reported numeric totals, and return JSON only.
Hub Access Notes
- Data endpoints return
{"items": [...], "limit": n, "offset": n, "total": n}. - Collection family selects the main endpoint:
contacts:/api/contactsfuel:/api/transactions/fuelfreight:/api/transactions/freightmaintenance:/api/maintenance/events
- Support endpoints use filters by reference type, for example
domain=fuel,domain=freight,kind=volume,kind=weight,kind=distance, andcurrency=EUR. /api/querycan be useful for aggregate checks when credentials are provided, but all observed task families can be solved from the paginated GET endpoints.
Final Checks
- Recompute counts from retained logical records, not raw rows, unless a field explicitly asks for raw rows.
- Keep quarantined financial rows out of normalized totals; keep valid mismatches in totals.
- Keep contact readiness partitions mutually exclusive.
- Keep maintenance invalid events and odometer-regression events separate unless the contract explicitly combines them.
- Validate JSON syntax with
python -m json.tool; ifjsonschemais available and the template is JSON Schema, validate against the template too.