Back to prompt library
Build a Cross-Border Dangerous Goods Booking and Segregation Auditor — implementation
Linked challenge: Build a Cross-Border Dangerous Goods Booking and Segregation Auditor
Prompt source
implementation84 lines11 sectionsNo variables1 code block
## Build
Process chemical cargo declarations submitted via FormSG webhooks against Singapore warehouse storage rules. Audit UN class incompatibilities and output TradeTrust verified yard placement plans.
## User
Chemical Logistics Safety Officer
## Workflow
1. Receive chemical cargo intake declarations from FormSG webhook submissions.
2. Validate dangerous goods UN numbers, hazard classes, and packing groups against maritime segregation tables.
3. Detect storage proximity violations between incompatible chemicals in port-adjacent staging yards.
4. Issue a TradeTrust wrapped yard segregation clearance certificate for warehouse marshals.
## Interface
A chemical warehouse yard grid viewer highlighting hazardous containment zones, incompatible neighboring pallets, and attestation issuance triggers.
## Data
Simulate FormSG webhook payloads matching official SDK formats alongside synthetic chemical manifest tables.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Singapore government FormSG](https://raw.githubusercontent.com/opengovsg/FormSG/develop/README.md)
Process FormSG webhook schema structures to ingest dangerous goods declarations.
## Tools
pydantic-ai, @opengovsg/formsg-sdk, fastapi.
Pydantic AI enforces rigid typing on chemical classification codes and segregation distance rules.
Hosted reasoning LLM configured for strict JSON extraction and logic checking.
## 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
- Validates FormSG webhook signature headers using simulated test secrets.
- Flags incompatible chemical pairings placed within minimum segregation buffers.
- Exports yard placement manifests specifying zone IDs and fire suppression categories.
- Requires safety officer sign-off before issuing TradeTrust clearance proofs.
## Starter Examples
```json
[
{
"input": {
"submission_id": "FSG-9021",
"un_number": "UN1203",
"hazard_class": "3",
"packing_group": "II",
"cargo_description": "Motor Spirit / Flammable Liquid",
"target_zone": "ZONE-A",
"adjacent_cargo": [
{
"un_number": "UN1942",
"hazard_class": "5.1",
"distance_meters": 15
}
]
},
"expected_output": {
"compliance_status": "approved",
"segregation_conflict": false,
"minimum_required_distance_meters": 10,
"assigned_zone": "ZONE-A-FLAMMABLE",
"clearance_token": "CERT-DG-9021"
}
},
{
"input": {
"submission_id": "FSG-9022",
"un_number": "UN1789",
"hazard_class": "8",
"packing_group": "II",
"cargo_description": "Hydrochloric Acid",
"target_zone": "ZONE-B",
"adjacent_cargo": [
{
"un_number": "UN1824",
"hazard_class": "8-ALKALI",
"distance_meters": 2
}
]
},
"expected_output": {
"compliance_status": "rejected",
"segregation_conflict": true,
"minimum_required_distance_meters": 5,
"assigned_zone": null,
"clearance_token": null
}
}
]
```
## Safety
Assists storage planning and auditing; physical chemical movements require licensed human supervision.
Use mock external writes. Require human review before any real deployment.