Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a Cold-Chain Pharma Handover Compliance and Dispute Dossier Compiler

Format
Code-aware
Lines
88
Sections
11
Linked challenge
Build a Cold-Chain Pharma Handover Compliance and Dispute Dossier Compiler

Prompt source

Original prompt text with formatting preserved for inspection.

88 lines
11 sections
No variables
1 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.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.