Skip to main content
Loading navigation
Back to prompt library

Build a Cross-Border Shipment Exception Evidence and Customer Notice Generator — implementation

Linked challenge: Build a Cross-Border Shipment Exception Evidence and Customer Notice Generator

Prompt source

implementation76 lines11 sectionsNo variables1 code block
## Build
Evaluate customs hold and physical cargo inspection exceptions across Singapore checkpoint manifests. Synthesize tamper-proof TradeTrust wrapped evidence packages and draft customer delay notices.

## User
Cross-border freight forwarder operations specialist

## Workflow
1. Ingest simplified normalized cross-border manifest records, checkpoint inspection hold logs, and seal discrepancy reports.
2. Detect manifest discrepancies including declared container weight drift and customs inspection hold status codes.
3. Wrap the structured cargo incident report into a verifiable OpenAttestation schema document.
4. Generate a structured delay explanation notice with mitigation steps and queue it for operational review.

## Interface
A browser-based logistics incident console displaying checkpoint clearance statuses, an OpenAttestation document preview, and a customer notice editor.

## Data
Generate 25 synthetic cross-border container manifest records with checkpoint hold logs in JSON format, without requiring production credentials.
Starter examples below are synthetic. They are not downloaded records.

## Source
[OpenAttestation](https://raw.githubusercontent.com/Open-Attestation/open-attestation/master/README.md)
Applies the OpenAttestation wrapDocuments workflow to compute batch merkle roots and wrap exception evidence payloads.

## Tools
vercel-ai-sdk, @govtechsg/open-attestation, zod.
Vercel AI SDK provides streamlined streaming and structured object generation for drafting operational client notices.
Requires an LLM capable of structured JSON generation via API or local serving.

## 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
- OpenAttestation wrapDocuments produces valid wrapped documents containing verifiable target hashes for each incident record.
- Manifest inspection detects container gross weight variance exceeding declared tolerance thresholds.
- The generated customer notice contains estimated hold duration, hold reason code, and immediate freight forwarder action items.
- All simulated external updates are previewed in human review queues prior to mock transmission.

## Starter Examples
```json
[
  {
    "input": {
      "shipment_id": "SG-JB-2025-0891",
      "checkpoint": "Tuas Checkpoint",
      "declared_weight_kg": 18500,
      "measured_weight_kg": 20450,
      "seal_intact": false,
      "status_code": "HOLD_SEAL_MISMATCH",
      "consignee_name": "Lion City Electronics Pte Ltd",
      "cargo_description": "Precision server rack components"
    },
    "expected_output": {
      "exception_detected": true,
      "weight_variance_kg": 1950,
      "oa_wrapped": true,
      "review_queue_item": {
        "shipment_id": "SG-JB-2025-0891",
        "action_required": "Physical re-inspection and carrier seal audit",
        "customer_notice_draft": "Shipment SG-JB-2025-0891 is held at Tuas Checkpoint due to a seal discrepancy and weight variance. An inspection dossier has been prepared."
      }
    }
  },
  {
    "input": {
      "shipment_id": "SG-JB-2025-0892",
      "checkpoint": "Woodlands Checkpoint",
      "declared_weight_kg": 12000,
      "measured_weight_kg": 12010,
      "seal_intact": true,
      "status_code": "CLEARED_NORMAL",
      "consignee_name": "Jurong Cold Store Logistics",
      "cargo_description": "Frozen poultry cuts"
    },
    "expected_output": {
      "exception_detected": false,
      "weight_variance_kg": 10,
      "oa_wrapped": false,
      "review_queue_item": null
    }
  }
]
```

## Safety
Generates drafts for simulated operations; does not submit regulatory filings or trigger actual cargo releases.
Use mock external writes. Require human review before any real deployment.