Skip to main content
Loading navigation
Back to prompt library

Build a Cold-Chain Handoff Evidence and Spoilage Claim Engine — implementation

Linked challenge: Build a Cold-Chain Handoff Evidence and Spoilage Claim Engine

Prompt source

implementation96 lines11 sectionsNo variables1 code block
## Build
Inspect refrigerated container sensor logs during Singapore border handoffs to detect temperature excursions. Bundle verified breach proofs into OpenAttestation packages for insurance settlement.

## User
Perishable Cargo Logistics Manager

## Workflow
1. Extract time-series temperature and humidity logs from reefer data loggers.
2. Evaluate readings against agreed contractual cold-chain safe zones.
3. Isolate continuous out-of-spec excursions and aggregate cumulative damage exposure.
4. Wrap verified incident evidence into an OpenAttestation document and draft claim notices.

## Interface
Temperature timeline viewer featuring threshold excursion alerts and one-click claim dossier exports.

## Data
Generate synthetic JSON time-series files simulating reefer container temperature and GPS streams.
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 wrapDocument function to create cryptographic integrity hashes over raw sensor log arrays.

## Tools
agno, pydantic, open-attestation.
Agno provides agentic tool integration for automated data verification and claim letter composition.
Hosted reasoning model for drafting formal cold-chain incident narratives.

## 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
- Parse IoT reefer container temperature telemetry logs across overland transit checkpoints.
- Detect continuous temperature threshold excursions violating cold-chain service agreements.
- Wrap breach evidence, transit timestamps, and sensor signatures into an OpenAttestation document.
- Compile an itemized cargo spoilage claim evidence packet for marine cargo underwriters.

## Starter Examples
```json
[
  {
    "input": {
      "allowable_temp_range": [
        -22,
        -18
      ],
      "container_id": "MSKU901234",
      "temperature_readings": [
        {
          "temp": -20.1,
          "time": "10:00"
        },
        {
          "temp": -14.2,
          "time": "10:15"
        },
        {
          "temp": -12.5,
          "time": "10:30"
        }
      ]
    },
    "expected_output": {
      "claim_eligible": true,
      "duration_minutes": 30,
      "excursion_detected": true,
      "max_temp_reached": -12.5,
      "open_attestation_proof_status": "GENERATED"
    }
  },
  {
    "input": {
      "allowable_temp_range": [
        -22,
        -18
      ],
      "container_id": "MSKU901235",
      "temperature_readings": [
        {
          "temp": -20,
          "time": "10:00"
        },
        {
          "temp": -19.5,
          "time": "10:15"
        },
        {
          "temp": -19.8,
          "time": "10:30"
        }
      ]
    },
    "expected_output": {
      "claim_eligible": false,
      "duration_minutes": 0,
      "excursion_detected": false,
      "max_temp_reached": -19.5,
      "open_attestation_proof_status": "NOT_REQUIRED"
    }
  }
]
```

## Safety
Does not initiate actual insurance claims; builds evidentiary dossiers for surveyor review.
Use mock external writes. Require human review before any real deployment.