Back to prompt library
Build a Cold-Chain Pharma Handover Compliance and Dispute Dossier Compiler — implementation
Linked challenge: Build a Cold-Chain Pharma Handover Compliance and Dispute Dossier Compiler
Prompt source
implementation88 lines11 sectionsNo variables1 code block
## Build
Inspect overland reefer telemetry between Malaysia and Singapore for temperature non-compliance. Compile verifiable OpenAttestation proof packs and generate carrier dispute notifications.
## User
Pharmaceutical distribution quality auditor
## Workflow
1. Parse IoT datalogger dumps from incoming reefer pharmaceutical shipments at Woodlands Checkpoint.
2. Correlate recorded temperatures against defined Good Distribution Practice (GDP) tolerances.
3. Execute OpenAttestation wrapDocuments to create a cryptographic proof bundle of the raw telemetry.
4. Generate a structured carrier non-conformance notice itemizing temperature spikes and custody handoffs.
## Interface
Audit interface featuring GDP tolerance band visualizations, excursion duration counters, and OpenAttestation document signing triggers.
## Data
Synthesize simulated pharmaceutical reefer log files alongside OpenAttestation 2.0 schemas from source 2.
Starter examples below are synthetic. They are not downloaded records.
## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Uses OpenAttestation wrapDocuments and signDocument utilities to notarize cold-chain audit evidence.
## Tools
mastra-ai, @govtechsg/open-attestation, typescript.
Mastra AI coordinates multi-step validation agents handling sensor processing, crypto attestation, and dispute drafting.
Hosted reasoning model capable of analyzing GDP compliance rules and writing precise formal dispute notices.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Parses ISO 8601 timestamps and Celsius temperature telemetry records.
- Flags MKT (Mean Kinetic Temperature) threshold violations above permissible pharma levels.
- Computes Merkle root and target hash adhering to OpenAttestation 2.0 schema rules.
- Synthesizes structured dispute dossiers with explicit timestamp references.
## Starter Examples
```json
[
{
"input": {
"shipment_id": "PH-BIO-2025-081",
"temperature_band": "2-8C",
"telemetry": [
{
"ts": "2025-06-01T04:00:00Z",
"celsius": 4.1
},
{
"ts": "2025-06-01T05:00:00Z",
"celsius": 11.4
},
{
"ts": "2025-06-01T06:30:00Z",
"celsius": 9.8
}
],
"carrier_id": "CARRIER-TRANS-9"
},
"expected_output": {
"compliance_violation": true,
"max_spike_celsius": 11.4,
"excursion_minutes": 150,
"oa_merkle_generated": true,
"action": "DISPUTE_NOTICE_ISSUED"
}
},
{
"input": {
"shipment_id": "PH-BIO-2025-082",
"temperature_band": "2-8C",
"telemetry": [
{
"ts": "2025-06-01T04:00:00Z",
"celsius": 3.8
},
{
"ts": "2025-06-01T05:00:00Z",
"celsius": 4.2
}
],
"carrier_id": "CARRIER-TRANS-9"
},
"expected_output": {
"compliance_violation": false,
"max_spike_celsius": 4.2,
"excursion_minutes": 0,
"oa_merkle_generated": false,
"action": "RELEASE_SHIPMENT"
}
}
]
```
## Safety
Simulates cold-chain quality quarantine orders; does not trigger physical destruction of medical assets.
Use mock external writes. Require human review before any real deployment.